[csw-maintainers] GAR: Adding a /opt/csw/lib/foo/64 --> /opt/csw/lib/foo/{amd64, sparcv9} link
Maciej (Matchek) Blizinski
maciej at opencsw.org
Mon Nov 23 22:57:48 CET 2009
On Mon, Nov 23, 2009 at 5:56 PM, Philip Brown <phil at bolthole.com> wrote:
> On Mon, Nov 23, 2009 at 4:41 AM, Maciej (Matchek) Blizinski
> <maciej at opencsw.org> wrote:
>> I'm working on a library package with the *.so files in
>> /opt/csw/lib/foo. The package will have 64-bit support, so the shared
>> objects will be:
>>
>> /opt/csw/lib/foo/*.so
>> /opt/csw/lib/foo/sparcv9/*.so
>> /opt/csw/lib/foo/amd64/*.so
>>
>> I've noticed that CSWcommon provides a symlink: /opt/csw/lib/64. It
>> points to amd64 or sparcv9 depending on the host architecture. This
>> link is needed to provide a architecture independent -L flag for
>> 64-bit builds: /opt/csw/lib/foo/64.
>>
>> I guess that something along the lines of ln -s sparcv9
>> /opt/csw/lib/foo/64, or amd64, depending on the architecture. What's
>> the right GAR idiom for it? Should it be a post-merge target?
>>
>
> Eh, that's just a convention. If the library (or packages USING the
> library) work as-is, there's no need for you to be making those
> symlinks.
It seems to me as those links are very useful. When you have the 64
--> {sparcv9,amd64} symlinks, you can say:
LD_OPTIONS = -R/opt/csw/lib/$ISALIST -R/opt/csw/lib/64
...and it will work on both sparcv9 and amd64.
Here's how I did it in GAR:
post-merge:
if [ "$(GARCH)" = sparc ]; then \
gln -sf sparc9 $(PKGROOT)$(libdir)/64; \
elif [ "$(GARCH)" = i386 ]; then \
gln -sf amd64 $(PKGROOT)$(libdir)/64; \
fi
@$(MAKECOOKIE)
It created the right structure:
maciej at build8s [build8s]:~/src/opencsw/pkg/nspr/trunk > tree
work/solaris8-sparc/pkgroot/opt/csw/lib/nspr
work/solaris8-sparc/pkgroot/opt/csw/lib/nspr
|-- 64 -> sparc9
|-- cpu
| `-- sparcv8plus
| `-- libnspr_flt4.so
|-- libnspr4.so -> libnspr4.so.8
|-- libnspr4.so.8
|-- libplc4.so -> libplc4.so.8
|-- libplc4.so.8
|-- libplds4.so -> libplds4.so.8
|-- libplds4.so.8
`-- sparcv9
|-- libnspr4.so -> libnspr4.so.8
|-- libnspr4.so.8
|-- libplc4.so -> libplc4.so.8
|-- libplc4.so.8
|-- libplds4.so -> libplds4.so.8
`-- libplds4.so.8
3 directories, 14 files
After making the package:
d none /opt/csw/lib/nspr 0755 root bin
s none /opt/csw/lib/nspr/64=sparcv9
(...)
I'll be able now to create NSS packages using -L/opt/csw/lib/nspr/64.
More information about the maintainers
mailing list