aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc1118
-rw-r--r--tools/make_libdeps.sh2
2 files changed, 67 insertions, 53 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 32dc07e9d774..08fec739bad4 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -76,6 +76,9 @@ SUBDIR+= libexec
.if exists(${.CURDIR}/sbin)
SUBDIR+= sbin
.endif
+.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
+SUBDIR+= secure
+.endif
.if exists(${.CURDIR}/share) && !defined(NOSHARE)
SUBDIR+= share
.endif
@@ -88,9 +91,6 @@ SUBDIR+= usr.bin
.if exists(${.CURDIR}/usr.sbin)
SUBDIR+= usr.sbin
.endif
-.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
-SUBDIR+= secure
-.endif
# etc must be last for "distribute" to work
.if exists(${.CURDIR}/etc)
@@ -183,7 +183,8 @@ BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
DESTDIR= \
INSTALL="sh ${.CURDIR}/tools/install.sh"
BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
- -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED
+ -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
+ -DNO_WERROR
# build-tool stage
TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
@@ -451,8 +452,8 @@ buildkernel:
.endif
.endif
cd ${KRNLOBJDIR}/${_kernel}; \
- MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
- ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
+ MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
+ ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
.if !defined(NO_KERNELDEPEND)
cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
@@ -640,70 +641,79 @@ hierarchy:
#
# libraries - build all libraries, and install them under ${DESTDIR}.
#
-# The following dependencies exist between the libraries:
-#
-# lib*: csu libgcc_pic
-# libatm: libmd
-# libcrypt: libmd
-# libdialog: libncurses
-# libedit: libncurses
-# libg++: msun
-# libkrb: libcrypt
-# libopie: libmd
-# libpam: libcom_err libcrypt libcrypto libkrb libopie libradius \
-# libskey libtacplus libutil libz libssh
-# libradius: libmd
-# libreadline: libncurses
-# libskey: libcrypt libmd
-# libssh: libcrypto libz
-# libstc++: msun
-# libtacplus: libmd
+# The list of libraries with dependents (${_prebuild_libs}) and their
+# interdependencies (__L) are built automatically by the
+# ${.CURDIR}/tools/make_libdeps.sh script.
#
-# Across directories this comes down to (rougly):
+libraries:
+ cd ${.CURDIR}; \
+ ${MAKE} -f Makefile.inc1 _startup_libs; \
+ ${MAKE} -f Makefile.inc1 _prebuild_libs; \
+ ${MAKE} -f Makefile.inc1 _generic_libs;
+
+# These dependencies are not automatically generated:
#
-# gnu/lib: lib/msun lib/libncurses
-# kerberosIV/lib kerberos5/lib: lib/libcrypt
-# lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb \
-# secure/lib/libssh lib/libz
-# secure/lib: secure/lib/libcrypto lib/libmd lib/libz
+# gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
+# shared libraries for ELF.
#
-.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
-_csu= lib/csu/${MACHINE_ARCH}.pcc
-.elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
-_csu= lib/csu/i386-elf
+_startup_libs= gnu/lib/csu gnu/lib/libgcc
+.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT})
+_startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT}
.else
-_csu= lib/csu/${MACHINE_ARCH}
+_startup_libs+= lib/csu/${MACHINE_ARCH}
.endif
-.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
-_secure_lib= secure/lib
-.if exists(${.CURDIR}/secure/lib/libcrypto)
-_libcrypto= secure/lib/libcrypto
+_prebuild_libs=
+
+_generic_libs= gnu/lib
+
+.if !defined(NOPERL)
+_generic_libs+= gnu/usr.bin/perl/libperl
.endif
+
+.if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
+_prebuild_libs+= kerberos5/lib/libasn1
+_prebuild_libs+= kerberos5/lib/libgssapi
+_prebuild_libs+= kerberos5/lib/libkrb5
+_prebuild_libs+= kerberos5/lib/libroken
+_generic_libs+= kerberos5/lib
.endif
.if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
-_kerberosIV_lib= kerberosIV/lib
+_prebuild_libs+= kerberosIV/lib/libkrb
+kerberosIV/lib/libkrb__L: lib/libcrypt__L
+_generic_libs+= kerberosIV/lib
.endif
-.if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
-_kerberos5_lib= kerberos5/lib
-.endif
+_prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
+ lib/libncurses lib/libopie lib/libradius lib/libskey \
+ lib/libtacplus lib/libutil \
+ lib/libz lib/msun
-.if !defined(NOPERL)
-_libperl= gnu/usr.bin/perl/libperl
+lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
+lib/libskey__L: lib/libcrypt__L lib/libmd__L
+
+_generic_libs+= lib
+
+.if !defined(NOCRYPT) && !defined(NOSECURE)
+.if !defined(NO_OPENSSL)
+_prebuild_libs+= secure/lib/libcrypto
+.if !defined(NO_OPENSSH)
+_prebuild_libs+= secure/lib/libssh
+secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
+.endif
+.endif
+_generic_libs+= secure/lib
.endif
+_generic_libs+= usr.bin/lex/lib
+
.if ${MACHINE_ARCH} == "i386"
-_libkeycap= usr.sbin/pcvt/keycap
+_generic_libs+= usr.sbin/pcvt/keycap
.endif
-libraries:
-.for _lib in ${_csu} gnu/lib/csu gnu/lib/libgcc lib/libmd lib/libcrypt \
- lib/libz ${_libcrypto} ${_secure_lib} ${_kerberosIV_lib} \
- ${_kerberos5_lib} lib/libcom_err lib/msun lib/libncurses \
- lib/libopie lib/libradius lib/libskey lib/libtacplus lib/libutil \
- lib gnu/lib ${_libperl} usr.bin/lex/lib ${_libkeycap}
+.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
+${_lib}__L: .PHONY
.if exists(${.CURDIR}/${_lib})
cd ${.CURDIR}/${_lib}; \
${MAKE} DIRPRFX=${_lib}/ depend; \
@@ -712,6 +722,10 @@ libraries:
.endif
.endfor
+_startup_libs: ${_startup_libs:S/$/__L/}
+_prebuild_libs: ${_prebuild_libs:S/$/__L/}
+_generic_libs: ${_generic_libs:S/$/__L/}
+
.for __target in clean cleandepend cleandir depend includes obj
.for entry in ${SUBDIR}
${entry}.${__target}__D: .PHONY
diff --git a/tools/make_libdeps.sh b/tools/make_libdeps.sh
index 39e170f2ddc4..20f487036cd9 100644
--- a/tools/make_libdeps.sh
+++ b/tools/make_libdeps.sh
@@ -34,6 +34,7 @@ USRSRC=${1:-/usr/src} # source root
LIBS="
lib
gnu/lib
+ gnu/usr.bin/perl/libperl
kerberosIV/lib
kerberos5/lib
secure/lib
@@ -48,7 +49,6 @@ sed -E
-e's; ;! ;g'
-e's;$;!;'
-e's;-lm!;lib/msun;g'
- -e's;-l(supc\+\+)!;gnu/lib/lib\1;g'
-e's;-l(krb)!;kerberosIV/lib/lib\1;g'
-e's;-l(asn1|gssapi|krb5|roken)!;kerberos5/lib/lib\1;g'
-e's;-l(crypto|ssh)!;secure/lib/lib\1;g'