Subject: PR lib/7283 - shared library builds use old dependent libraries
To: None <tech-userlevel@netbsd.org, tech-pkg@netbsd.org>
From: Erik E. Fair <fair@clock.org>
List: tech-pkg
Date: 03/29/1999 12:32:42
I just filed PR lib/7283 with a patch for bsd.lib.mk that I would like
someone more expert than I to examine the diff and commit it. This is
sufficiently central to the build process that I don't want to hose it in
the middle of a release cycle, but this bug Must Be Fixed.

*** src/share/mk/bsd.lib.mk.orig        Mon Mar 29 11:30:36 1999
--- src/share/mk/bsd.lib.mk     Mon Mar 29 11:41:00 1999
***************
*** 242,251 ****
--- 242,260 ----
      ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
        @echo building shared ${LIB} library \(version
${SHLIB_MAJOR}.${SHLIB_MINOR}\)
        @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
+ .if defined(DESTDIR)
+       $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+           ${SHLIB_LDSTARTFILE} \
+           --whole-archive lib${LIB}_pic.a \
+           -nostdlib -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
+           --no-whole-archive ${LDADD} \
+           ${SHLIB_LDENDFILE}
+ .else
        $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
            ${SHLIB_LDSTARTFILE} \
            --whole-archive lib${LIB}_pic.a --no-whole-archive ${LDADD} \
            ${SHLIB_LDENDFILE}
+ .endif
  .if ${OBJECT_FMT} == "ELF"
        rm -f lib${LIB}.so.${SHLIB_MAJOR}
        ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \