On Sun, Aug 31, 2003 at 02:07:42PM +0200, Alexander Leidinger wrote:
> On Sat, 30 Aug 2003 21:56:53 +0300
> Ruslan Ermilov <[EMAIL PROTECTED]> wrote:
> 
> > > I think a workaround would be to use absolute symlinks (at least as an
> > > option).
> > > 
> > I might be missing an obvious, but I just don't see a reason
> > why we should use relative linking here: we should just link
> > to where we really install.  With the attached patch, I get:
> > 
> > $ make -n install -DNOMAN DESTDIR=/foo
> > install -C -o root -g wheel -m 444   libalias.a /foo/usr/lib
> > install -s -o root -g wheel -m 444     libalias.so.4 /foo/lib
> > ln -fs libalias.so.4 /foo/lib/libalias.so
> > ln -fs /foo/lib/libalias.so.4  /foo/usr/lib/libalias.so
> 
> Don't you have to remove the first ${DESTDIR} to make this work in the
> "put a harddisk into a running system and install a system via
> installworld  & distribute" case?
> 
Doh, you're of course right!  An updated patch is attached.

Now it looks like this:

install -C -o root -g wheel -m 444   libalias.a /foo/usr/lib
install -s -o root -g wheel -m 444     libalias.so.4 /foo/lib
ln -fs libalias.so.4 /foo/lib/libalias.so
ln -fs /lib/libalias.so.4  /foo/usr/lib/libalias.so

This is also consistent with how we handle SYMLINKS:

# make -f bsd.prog.mk BINDIR=/bin SYMLINKS='${BINDIR}/file1 ${BINDIR}/file2' install 
DESTDIR=/foo
/foo/bin/file2 -> /bin/file1
# ls -l /foo/bin
total 0
lrwxr-xr-x  1 root  wheel  10 Aug 31 17:44 file2 -> /bin/file1


Cheers,
-- 
Ruslan Ermilov          Sysadmin and DBA,
[EMAIL PROTECTED]               Sunbay Software Ltd,
[EMAIL PROTECTED]               FreeBSD committer
Index: bsd.lib.mk
===================================================================
RCS file: /home/ncvs/src/share/mk/bsd.lib.mk,v
retrieving revision 1.150
diff -u -r1.150 bsd.lib.mk
--- bsd.lib.mk  17 Aug 2003 23:56:29 -0000      1.150
+++ bsd.lib.mk  31 Aug 2003 14:46:32 -0000
@@ -207,9 +207,8 @@
            ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
 .if defined(SHLIB_LINK)
        ln -fs ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK}
-.if (${LIBDIR} != ${SHLIBDIR})
-       ln -fs ${LIBDIR:C|/[^/]+|/..|g:S|^/||}${SHLIBDIR}/${SHLIB_NAME} \
-           ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
+.if ${LIBDIR} != ${SHLIBDIR}
+       ln -fs ${SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
 .endif
 .endif
 .endif

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to