Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/share/mk/bsd.lib.mk,v rcsdiff: /ftp/cvs/cvsroot/src/share/mk/bsd.lib.mk,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.283 retrieving revision 1.288 diff -u -p -r1.283 -r1.288 --- src/share/mk/bsd.lib.mk 2008/08/10 10:42:01 1.283 +++ src/share/mk/bsd.lib.mk 2008/10/19 15:22:50 1.288 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.lib.mk,v 1.283 2008/08/10 10:42:01 lukem Exp $ +# $NetBSD: bsd.lib.mk,v 1.288 2008/10/19 15:22:50 christos Exp $ # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 .include @@ -34,6 +34,13 @@ realinstall: checkver libinstall clean: cleanlib ##### LIB specific flags. +# XXX: This is needed for programs that link with .a libraries +# Perhaps a more correct solution is to always generate _pic.a +# files or always have a shared library. +.if defined(MKPIE) && (${MKPIE} != "no") +CFLAGS+= ${PIE_CFLAGS} +AFLAGS+= ${PIE_AFLAGS} +.endif COPTS+= ${COPTS.lib${LIB}} CPPFLAGS+= ${CPPFLAGS.lib${LIB}} CXXFLAGS+= ${CXXFLAGS.lib${LIB}} @@ -55,7 +62,7 @@ DPADD+= ${LIBDO.${_lib}}/lib${_lib}.so .endif # } ##### Build and install rules -MKDEP_SUFFIXES?= .o .po .so .ln +MKDEP_SUFFIXES?= .o .po .so .go .ln CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include} CXXFLAGS+= ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++} @@ -501,13 +508,17 @@ lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL # We don't use INSTALL_SYMLINK here because this is just # happening inside the build directory/objdir. XXX Why does # this spend so much effort on libraries that aren't live??? XXX -.if defined(SHLIB_MAJOR) && ${SHLIB_FULLVERSION} != ${SHLIB_MAJOR} +.if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \ + "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}" ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR} .endif ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp mv -f lib${LIB}.so.tmp lib${LIB}.so .endif +.if ${MKSTRIPIDENT} != "no" + ${OBJCOPY} -R .ident ${.TARGET} +.endif .if !empty(LOBJS) # { LLIBS?= -lc @@ -646,17 +657,20 @@ ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib /sbin/ldconfig -m ${_LIBSODIR} ${LIBDIR} .endif .if ${OBJECT_FMT} == "ELF" +.if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \ + "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}" ${INSTALL_SYMLINK} \ - lib${LIB}.so.${SHLIB_FULLVERSION} \ + ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \ ${_LIB_SO_TGT}.${SHLIB_MAJOR} .if ${_LIBSODIR} != ${LIBDIR} ${INSTALL_SYMLINK} -l r \ ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \ ${_LIB_SO_TGTLIBDIR}.${SHLIB_MAJOR} .endif +.endif .if ${MKLINKLIB} != "no" ${INSTALL_SYMLINK} \ - lib${LIB}.so.${SHLIB_FULLVERSION} \ + ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \ ${_LIB_SO_TGT} .if ${_LIBSODIR} != ${LIBDIR} ${INSTALL_SYMLINK} -l r \