[BACK]Return to bsd.lib.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/share/mk/bsd.lib.mk between version 1.307 and 1.314

version 1.307, 2010/04/27 14:32:14 version 1.314, 2011/04/11 23:03:38
Line 63  DPADD+=  ${LIBDO.${_lib}}/lib${_lib}.so
Line 63  DPADD+=  ${LIBDO.${_lib}}/lib${_lib}.so
 ##### Build and install rules  ##### Build and install rules
 MKDEP_SUFFIXES?=        .o .po .pico .go .ln  MKDEP_SUFFIXES?=        .o .po .pico .go .ln
   
 # Use purely kernel private headers in rump builds  
 .if !defined(RUMPKERNEL)  
 .if empty(CPPFLAGS:M-nostdinc)  
 CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}  
 .endif  
 .if empty(CXXFLAGS:M-nostdinc++)  
 CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}  
 .endif  
 .endif  
   
 .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})              # {  .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})              # {
 SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major  SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
 SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor  SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
Line 140  SHLIB_FULLVERSION=${SHLIB_MAJOR}
Line 130  SHLIB_FULLVERSION=${SHLIB_MAJOR}
   
 # Data-driven table using make variables to control how shared libraries  # Data-driven table using make variables to control how shared libraries
 # are built for different platforms and object formats.  # are built for different platforms and object formats.
 # OBJECT_FMT:           currently either "ELF" or "a.out", from <bsd.own.mk>  
 # SHLIB_MAJOR, SHLIB_MINOR, SHLIB_TEENY: Major, minor, and teeny version  # SHLIB_MAJOR, SHLIB_MINOR, SHLIB_TEENY: Major, minor, and teeny version
 #                       numbers of shared library  #                       numbers of shared library
 # SHLIB_SOVERSION:      version number to be compiled into a shared library  # SHLIB_SOVERSION:      version number to be compiled into a shared library
Line 168  CPPPICFLAGS?= -DPIC
Line 157  CPPPICFLAGS?= -DPIC
 CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}  CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
 APICFLAGS ?=  APICFLAGS ?=
   
 .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \  .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")      # } {
        ${OBJECT_FMT} == "ELF"                                           # } {  
   
 # If you use -fPIC you need to define BIGPIC to turn on 32-bit  # If you use -fPIC you need to define BIGPIC to turn on 32-bit
 # relocations in asm code  # relocations in asm code
Line 203  MKSHLIBOBJS= no
Line 191  MKSHLIBOBJS= no
 .endif  .endif
   
 # Platform-independent linker flags for ELF shared libraries  # Platform-independent linker flags for ELF shared libraries
 .if ${OBJECT_FMT} == "ELF"  
 SHLIB_SOVERSION=        ${SHLIB_MAJOR}  SHLIB_SOVERSION=        ${SHLIB_MAJOR}
 SHLIB_SHFLAGS=          -Wl,-soname,${_LIB_PREFIX}${LIB}.so.${SHLIB_SOVERSION}  SHLIB_SHFLAGS=          -Wl,-soname,${_LIB_PREFIX}${LIB}.so.${SHLIB_SOVERSION}
 SHLIB_SHFLAGS+=         -Wl,--warn-shared-textrel  SHLIB_SHFLAGS+=         -Wl,--warn-shared-textrel
 SHLIB_LDSTARTFILE?=     ${_GCC_CRTDIR}/crti.o ${_GCC_CRTBEGINS}  SHLIB_LDSTARTFILE?=     ${_GCC_CRTDIR}/crti.o ${_GCC_CRTBEGINS}
 SHLIB_LDENDFILE?=       ${_GCC_CRTENDS} ${_GCC_CRTDIR}/crtn.o  SHLIB_LDENDFILE?=       ${_GCC_CRTENDS} ${_GCC_CRTDIR}/crtn.o
 .endif  
   
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
 OBJCFLAGS+=     ${OBJCOPTS}  OBJCFLAGS+=     ${OBJCOPTS}
Line 446  SOBJS+=${OBJS:.o=.pico}
Line 432  SOBJS+=${OBJS:.o=.pico}
 .endif  .endif
 .if defined(SHLIB_FULLVERSION)  .if defined(SHLIB_FULLVERSION)
 _LIB.so:=lib${LIB}.so.${SHLIB_FULLVERSION}  _LIB.so:=lib${LIB}.so.${SHLIB_FULLVERSION}
 .if ${MKDEBUG} != "no" && ${OBJECT_FMT} == "ELF"  .if ${MKDEBUG} != "no"
 _LIB.debug:=${_LIB.so}.debug  _LIB.debug:=${_LIB.so}.debug
 .endif  .endif
 _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}  _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
Line 525  lib${LIB}_g.a:: ${GOBJS} __archivebuild
Line 511  lib${LIB}_g.a:: ${GOBJS} __archivebuild
   
 _LIBLDOPTS=  _LIBLDOPTS=
 .if ${SHLIBDIR} != "/usr/lib"  .if ${SHLIBDIR} != "/usr/lib"
 _LIBLDOPTS+=    -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \  _LIBLDOPTS+=    -Wl,-rpath,${SHLIBDIR} \
                 -R${SHLIBDIR} \                  -L=${SHLIBDIR}
                 -L${DESTDIR}${SHLIBDIR}  
 .elif ${SHLIBINSTALLDIR} != "/usr/lib"  .elif ${SHLIBINSTALLDIR} != "/usr/lib"
 _LIBLDOPTS+=    -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \  _LIBLDOPTS+=    -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
                 -L${DESTDIR}${SHLIBINSTALLDIR}                  -L=${SHLIBINSTALLDIR}
 .endif  .endif
   
 # gcc -shared now adds -lc automatically. For libraries other than libc and  # gcc -shared now adds -lc automatically. For libraries other than libc and
Line 539  _LIBLDOPTS+= -Wl,-rpath-link,${DESTDIR}$
Line 524  _LIBLDOPTS+= -Wl,-rpath-link,${DESTDIR}$
 # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not  # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not
 # to add standard libraries, not the linker.  # to add standard libraries, not the linker.
 .if !defined(LIB)  .if !defined(LIB)
   .if !empty(LIBC_SO)
 DPLIBC ?= ${DESTDIR}${LIBC_SO}  DPLIBC ?= ${DESTDIR}${LIBC_SO}
   .endif
 .else  .else
 .if ${LIB} != "c" && ${LIB:Mgcc*} == ""  .if ${LIB} != "c" && ${LIB:Mgcc*} == ""
   .if !empty(LIBC_SO)
 DPLIBC ?= ${DESTDIR}${LIBC_SO}  DPLIBC ?= ${DESTDIR}${LIBC_SO}
   .endif
 .else  .else
 LDLIBC ?= -nodefaultlibs  LDLIBC ?= -nodefaultlibs
 .if ${LIB} == "c"  .if ${LIB} == "c"
Line 564  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
Line 553  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}      ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
         ${_MKTARGET_BUILD}          ${_MKTARGET_BUILD}
         rm -f lib${LIB}.so.${SHLIB_FULLVERSION}          rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
 .if defined(DESTDIR)  
         ${LIBCC} ${LDLIBC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}${SHLIBDIR}/ \  
             -Wl,-x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \  
             -Wl,--whole-archive ${SOLIB} \  
             -Wl,--no-whole-archive ${_LDADD.lib${LIB}} \  
             ${_LIBLDOPTS} ${_LDFLAGS.lib${LIB}} \  
             -L${_GCC_LIBGCCDIR}  
 .else  
         ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${_LDFLAGS.lib${LIB}} \          ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${_LDFLAGS.lib${LIB}} \
             -o ${.TARGET} ${_LIBLDOPTS} \              -o ${.TARGET} ${_LIBLDOPTS} \
             -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${_LDADD.lib${LIB}}              -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${_LDADD.lib${LIB}}
 .endif  
 .if ${OBJECT_FMT} == "ELF"  
 #  We don't use INSTALL_SYMLINK here because this is just  #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does  #  happening inside the build directory/objdir. XXX Why does
 #  this spend so much effort on libraries that aren't live??? XXX  #  this spend so much effort on libraries that aren't live??? XXX
Line 587  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
Line 566  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
 .endif  .endif
         ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp          ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
         mv -f lib${LIB}.so.tmp lib${LIB}.so          mv -f lib${LIB}.so.tmp lib${LIB}.so
 .endif  
 .if ${MKSTRIPIDENT} != "no"  .if ${MKSTRIPIDENT} != "no"
         ${OBJCOPY} -R .ident ${.TARGET}          ${OBJCOPY} -R .ident ${.TARGET}
 .endif  .endif
Line 595  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
Line 573  lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
 .if defined(_LIB.debug)  .if defined(_LIB.debug)
 ${_LIB.debug}: ${_LIB.so}  ${_LIB.debug}: ${_LIB.so}
         ${_MKTARGET_CREATE}          ${_MKTARGET_CREATE}
         ${OBJCOPY} --only-keep-debug ${_LIB.so} ${_LIB.debug}          (  ${OBJCOPY} --only-keep-debug ${_LIB.so} ${_LIB.debug} \
         ${OBJCOPY} --strip-debug \          && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
             -R .gnu_debuglink --add-gnu-debuglink=${_LIB.debug} ${_LIB.so} \                  --add-gnu-debuglink=${_LIB.debug} ${_LIB.so} \
             || rm -f ${_LIB.debug}          ) || (rm -f ${_LIB.debug}; false)
 .endif  .endif
   
 .if !empty(LOBJS)                                                       # {  .if !empty(LOBJS)                                                       # {
Line 734  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib
Line 712  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib
                 ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \                  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
                 ${_LIB_SO_TGTLIBDIR}.${SHLIB_FULLVERSION}                  ${_LIB_SO_TGTLIBDIR}.${SHLIB_FULLVERSION}
 .endif  .endif
 .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)  
         /sbin/ldconfig -m ${_LIBSODIR} ${LIBDIR}  
 .endif  
 .if ${OBJECT_FMT} == "ELF"  
 .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \  .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
     "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"      "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
         ${INSTALL_SYMLINK} \          ${INSTALL_SYMLINK} \
Line 760  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib
Line 734  ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib
 .endif  .endif
 .endif  .endif
 .endif  .endif
 .endif  
   
 .if defined(_LIB.debug)  .if defined(_LIB.debug)
 libinstall:: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}  libinstall:: ${DESTDIR}${DEBUGDIR}${LIBDIR}/${_LIB.debug}

Legend:
Removed from v.1.307  
changed lines
  Added in v.1.314

CVSweb <webmaster@jp.NetBSD.org>