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.167 retrieving revision 1.174 diff -u -p -r1.167 -r1.174 --- src/share/mk/bsd.lib.mk 2000/05/03 15:15:50 1.167 +++ src/share/mk/bsd.lib.mk 2000/07/17 16:49:30 1.174 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.lib.mk,v 1.167 2000/05/03 15:15:50 matt Exp $ +# $NetBSD: bsd.lib.mk,v 1.174 2000/07/17 16:49:30 eeh Exp $ # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 .if !target(__initialized__) @@ -19,6 +19,7 @@ clean cleandir distclean: cleanlib .if exists(${SHLIB_VERSION_FILE}) SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor +SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny # Check for higher installed library versions. .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \ @@ -27,11 +28,44 @@ checkver: @(cd ${.CURDIR} && \ ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \ -d ${DESTDIR}${LIBDIR} ${LIB}) -.else +.endif +.endif + +.if !target(checkver) checkver: .endif + +print-shlib-major: +.if defined(SHLIB_MAJOR) + @echo ${SHLIB_MAJOR} .else -checkver: + @false +.endif + +print-shlib-minor: +.if defined(SHLIB_MINOR) + @echo ${SHLIB_MINOR} +.else + @false +.endif + +print-shlib-teeny: +.if defined(SHLIB_TEENY) + @echo ${SHLIB_TEENY} +.else + @false +.endif + +.if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR) +.if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR) +.if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY) +SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY} +.else +SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} +.endif +.else +SHLIB_FULLVERSION=${SHLIB_MAJOR} +.endif .endif # add additional suffixes not exported. @@ -49,7 +83,8 @@ checkver: # OBJECT_FMT: currently either "ELF" or "a.out", from # SHLIB_SOVERSION: version number to be compiled into a shared library # via -soname. Usualy ${SHLIB_MAJOR} on ELF. -# NetBSD/pmax used to use ${SHLIB_MAJOR}.{SHLIB-MINOR}. +# NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR} +# [.${SHLIB_TEENY}]] # SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library. # with ELF, also set shared-lib version for ld.so. # SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors @@ -77,6 +112,10 @@ AINC+=-DABICALLS AFLAGS+= -fPIC AS+= -KPIC +.elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF" +# On the VAX, all object are PIC by default, not just sharedlibs. +MKPICLIB= no + .elif ${MACHINE_ARCH} == "sparc" && ${OBJECT_FMT} == "ELF" CPICFLAGS ?= -fPIC -DPIC @@ -84,13 +123,20 @@ CPPPICFLAGS?= -DPIC CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS} APICFLAGS ?= -KPIC +.elif ${MACHINE_ARCH} == "sparc64" && ${OBJECT_FMT} == "ELF" + +CPICFLAGS ?= -fPIC -DPIC +CPPPICFLAGS?= -DPIC +CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS} +APICFLAGS ?= -KPIC + .else # Platform-independent flags for NetBSD a.out shared libraries (and PowerPC) SHLIB_LDSTARTFILE= SHLIB_LDENDFILE= +SHLIB_SOVERSION=${SHLIB_FULLVERSION} SHLIB_SHFLAGS= -SHLIB_SOVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} CPICFLAGS?= -fPIC -DPIC CPPPICFLAGS?= -DPIC CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS} @@ -243,8 +289,8 @@ SOLIB=lib${LIB}_pic.a _LIBS+=${SOLIB} SOBJS+=${OBJS:.o=.so} .endif -.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) -_LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +.if defined(SHLIB_FULLVERSION) +_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION} .endif .endif @@ -289,16 +335,16 @@ lib${LIB}_p.a:: ${POBJS} __archivebuild lib${LIB}_pic.a:: ${SOBJS} __archivebuild @echo building shared object ${LIB} library -lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOLIB} ${DPADD} \ +lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \ ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE} - @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) - @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} + @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\) + @rm -f lib${LIB}.so.${SHLIB_FULLVERSION} .if defined(DESTDIR) $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \ ${SHLIB_LDSTARTFILE} \ --whole-archive ${SOLIB} \ - -L${DESTDIR}${LIBDIR} -R${LIBDIR} \ --no-whole-archive ${LDADD} \ + -L${DESTDIR}${LIBDIR} -R${LIBDIR} \ ${SHLIB_LDENDFILE} .else $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \ @@ -308,11 +354,9 @@ lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINO .endif .if ${OBJECT_FMT} == "ELF" rm -f lib${LIB}.so.${SHLIB_MAJOR} - ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - lib${LIB}.so.${SHLIB_MAJOR} + ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR} rm -f lib${LIB}.so - ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - lib${LIB}.so + ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so .endif LLIBS?= -lc @@ -342,36 +386,37 @@ libinstall:: .if ${MKLINKLIB} != "no" libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a +.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a .if !defined(UPDATE) .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a .endif + .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a) ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE .endif - -.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall .endif .if ${MKPROFILE} != "no" libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a +.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a .if !defined(UPDATE) .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a .endif + .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a) ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE .endif - -.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall .endif .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no" -.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a +.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a .if !defined(UPDATE) .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a .endif + .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a) ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE .endif @@ -384,17 +429,17 @@ ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib .endif .endif -.if ${MKPIC} != "no" && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) -libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +.if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION) +libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION} +.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION} .if !defined(UPDATE) -.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -.endif -.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}) -${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: .MADE +.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION} .endif -.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} +.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION}) +${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE +.endif +${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION} ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET} .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR) @@ -402,11 +447,11 @@ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB .endif .if ${OBJECT_FMT} == "ELF" rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR} - ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR} rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so .if ${MKLINKLIB} != "no" - ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \ ${DESTDIR}${LIBDIR}/lib${LIB}.so .endif .endif @@ -414,14 +459,14 @@ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln +.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln .if !defined(UPDATE) .PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln .endif + .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln) ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE .endif - -.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}