diff options
author | ru <ru@FreeBSD.org> | 2006-03-17 18:54:44 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-03-17 18:54:44 +0000 |
commit | 388e590f951441f619cd32710dc151e0ac810a10 (patch) | |
tree | 801e953598fc63a37f62cf997017301675552fe9 /share/mk | |
parent | a251964eaca5833ff2c4651fe4f7f8cac7199da5 (diff) | |
download | FreeBSD-src-388e590f951441f619cd32710dc151e0ac810a10.zip FreeBSD-src-388e590f951441f619cd32710dc151e0ac810a10.tar.gz |
Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html
The src.conf(5) manpage is to follow in a few days.
Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/bsd.incs.mk | 4 | ||||
-rw-r--r-- | share/mk/bsd.info.mk | 6 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 10 | ||||
-rw-r--r-- | share/mk/bsd.libnames.mk | 14 | ||||
-rw-r--r-- | share/mk/bsd.nls.mk | 6 | ||||
-rw-r--r-- | share/mk/bsd.own.mk | 276 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 8 |
7 files changed, 298 insertions, 26 deletions
diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk index 924458b..d51fb17 100644 --- a/share/mk/bsd.incs.mk +++ b/share/mk/bsd.incs.mk @@ -4,7 +4,7 @@ .error bsd.incs.mk cannot be included directly. .endif -.if !defined(NO_INCS) && !defined(NO_TOOLCHAIN) +.if !defined(NO_INCS) && ${MK_TOOLCHAIN} != "no" INCSGROUPS?= INCS @@ -81,4 +81,4 @@ installincludes: realinstall: installincludes .ORDER: beforeinstall installincludes -.endif # !defined(NO_INCS) && !defined(NO_TOOLCHAIN) +.endif # !defined(NO_INCS) && ${MK_TOOLCHAIN} != "no" diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk index 1de6cf7..826231f 100644 --- a/share/mk/bsd.info.mk +++ b/share/mk/bsd.info.mk @@ -53,8 +53,6 @@ # # MAKEINFOFLAGS Options for ${MAKEINFO} command. [--no-split] # -# NO_INFO Do not make or install info files. [not set] -# # NO_INFOCOMPRESS If you do not want info files be # compressed when they are installed. [not set] # @@ -123,7 +121,7 @@ DVIPS2ASCII?= dvips2ascii IFILENS+= ${INFO:S/$/.${_f}/} .endfor -.if !defined(NO_INFO) +.if ${MK_INFO} != "no" CLEANFILES+= ${IFILENS} .if !defined(NO_INFOCOMPRESS) CLEANFILES+= ${IFILENS:S/$/${ICOMPRESS_EXT}/} @@ -172,7 +170,7 @@ CLEANFILES+= ${INFO:S/$/-la.texi/} CLEANFILES+= ${INFO:S/$/.info.*.html/} ${INFO:S/$/.info/} .endif -.if !defined(NO_INFO) && defined(INFO) +.if ${MK_INFO} != "no" && defined(INFO) install: ${INSTALLINFODIRS} .if !empty(IFILES:N*.html) ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \ diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 02f1d46..b968ff8 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -185,7 +185,7 @@ ${SHLIB_NAME}: ${SOBJS} `lorder ${SOBJS} | tsort -q` ${LDADD} .endif -.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && !defined(NO_TOOLCHAIN) +.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" _LIBS+= lib${LIB}_pic.a lib${LIB}_pic.a: ${SOBJS} @@ -210,7 +210,7 @@ ${LINTLIB}: ${LINTOBJS} all: ${_LIBS} -.if !defined(NO_MAN) +.if ${MK_MAN} != "no" all: _manpages .endif @@ -272,7 +272,7 @@ _libinstall: .endif .endif .endif -.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && !defined(NO_TOOLCHAIN) +.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR} .endif @@ -287,7 +287,7 @@ _libinstall: .include <bsd.incs.mk> .include <bsd.links.mk> -.if !defined(NO_MAN) +.if ${MK_MAN} != "no" realinstall: _maninstall .ORDER: beforeinstall _maninstall .endif @@ -299,7 +299,7 @@ lint: ${SRCS:M*.c} ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} .endif -.if !defined(NO_MAN) +.if ${MK_MAN} != "no" .include <bsd.man.mk> .endif diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index abf796b..4536716 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -15,7 +15,7 @@ LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a LIBBEGEMOT?= ${DESTDIR}${LIBDIR}/libbegemot.a -.if !defined(NO_BIND) && defined(WITH_BIND_LIBS) +.if ${MK_BIND_LIBS} != "no" LIBBIND?= ${DESTDIR}${LIBDIR}/libbind.a LIBBIND9?= ${DESTDIR}${LIBDIR}/libbind9.a .endif @@ -54,7 +54,7 @@ LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a LIBHISTORY?= ${DESTDIR}${LIBDIR}/libhistory.a LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a LIBIPX?= ${DESTDIR}${LIBDIR}/libipx.a -.if !defined(NO_BIND) && defined(WITH_BIND_LIBS) +.if ${MK_BIND_LIBS} != "no" LIBISC?= ${DESTDIR}${LIBDIR}/libisc.a LIBISCCC?= ${DESTDIR}${LIBDIR}/libisccc.a LIBISCCFG?= ${DESTDIR}${LIBDIR}/libisccfg.a @@ -68,7 +68,7 @@ LIBKRB5?= ${DESTDIR}${LIBDIR}/libkrb5.a LIBKVM?= ${DESTDIR}${LIBDIR}/libkvm.a LIBL?= ${DESTDIR}${LIBDIR}/libl.a LIBLN?= "don't use LIBLN, use LIBL" -.if !defined(NO_BIND) +.if ${MK_BIND} != "no" LIBLWRES?= ${DESTDIR}${LIBDIR}/liblwres.a .endif LIBM?= ${DESTDIR}${LIBDIR}/libm.a @@ -76,7 +76,7 @@ LIBMAGIC?= ${DESTDIR}${LIBDIR}/libmagic.a LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a -.if !defined(NO_SENDMAIL) +.if ${MK_SENDMAIL} != "no" LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a .endif LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a @@ -93,7 +93,7 @@ LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a MINUSLPAM= -lpam .if defined(LDFLAGS) && !empty(LDFLAGS:M-static) -.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) +.if ${MK_KERBEROS} != "no" LIBPAM+= ${LIBKRB5} ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} \ ${LIBROKEN} ${LIBCOM_ERR} MINUSLPAM+= -lkrb5 -lasn1 -lcrypto -lcrypt -lroken -lcom_err @@ -102,11 +102,11 @@ LIBPAM+= ${LIBRADIUS} ${LIBTACPLUS} ${LIBCRYPT} \ ${LIBUTIL} ${LIBOPIE} ${LIBMD} MINUSLPAM+= -lradius -ltacplus -lcrypt \ -lutil -lopie -lmd -.if !defined(NO_OPENSSH) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) +.if ${MK_OPENSSH} != "no" LIBPAM+= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} MINUSLPAM+= -lssh -lcrypto -lcrypt .endif -.if !defined(NO_NIS) +.if ${MK_NIS} != "no" LIBPAM+= ${LIBYPCLNT} MINUSLPAM+= -lypclnt .endif diff --git a/share/mk/bsd.nls.mk b/share/mk/bsd.nls.mk index 237debe..48093eb 100644 --- a/share/mk/bsd.nls.mk +++ b/share/mk/bsd.nls.mk @@ -18,8 +18,6 @@ # NLSMODE National Language Support files mode. [${NOBINMODE}] # # NLSOWN National Language Support files owner. [${SHAREOWN}] -# -# NO_NLS Do not make or install NLS files. [not set] .if !target(__<bsd.init.mk>__) .error bsd.nls.mk cannot be included directly. @@ -32,7 +30,7 @@ GENCAT?= gencat .msg.cat: ${GENCAT} ${.TARGET} ${.IMPSRC} -.if defined(NLS) && !empty(NLS) && !defined(NO_NLS) +.if defined(NLS) && !empty(NLS) && ${MK_NLS} != "no" # # .msg file pre-build rules @@ -73,4 +71,4 @@ SYMLINKS+= ../${file:R}/${NLSNAME}.cat ${NLSDIR}/${dst}/${NLSNAME}.cat .endfor .endfor -.endif # defined(NLS) && !empty(NLS) && !defined(NO_NLS) +.endif # defined(NLS) && !empty(NLS) && ${MK_NLS} != "no" diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index ac03fda..17b9ff9b 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -104,6 +104,9 @@ .if !target(__<bsd.own.mk>__) __<bsd.own.mk>__: +SRCCONF?= /etc/src.conf +.sinclude "${SRCCONF}" + # Binaries BINOWN?= root BINGRP?= wheel @@ -165,4 +168,277 @@ STRIP?= -s COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz +# +# Define MK_* variables (which are either "yes" or "no") for users +# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the +# make(1) environment. +# These should be tested with `== "no"' or `!= "no"' in makefiles. +# The NO_* variables should only be set by makefiles. +# + +# +# Supported NO_* options (if defined, MK_* will be forced to "no", +# regardless of user's setting). +# +.for var in \ + MAN +.if defined(NO_${var}) +WITHOUT_${var}= +.endif +.endfor + +# +# Compat NO_* options (same as above, except their use is deprecated). +# +.if !defined(BURN_BRIDGES) +.for var in \ + ACPI \ + ATM \ + AUDIT \ + AUTHPF \ + BIND \ + BIND_DNSSEC \ + BIND_ETC \ + BIND_LIBS_LWRES \ + BIND_MTREE \ + BIND_NAMED \ + BIND_UTILS \ + BLUETOOTH \ + BOOT \ + CALENDAR \ + COLLECT2 \ + CPP \ + CRYPT \ + CVS \ + CXX \ + DICT \ + DYNAMICROOT \ + EXAMPLES \ + FORTH \ + FORTRAN \ + FP_LIBC \ + GAMES \ + GCOV \ + GDB \ + GNU \ + GPIB \ + GROFF \ + HTML \ + I4B \ + INET6 \ + INFO \ + IPFILTER \ + IPX \ + KERBEROS \ + LIBC_R \ + LIBPTHREAD \ + LIBTHR \ + LOCALES \ + LPR \ + MAILWRAPPER \ + NETCAT \ + NIS \ + NLS \ + NLS_CATALOGS \ + OBJC \ + OPENSSH \ + OPENSSL \ + PAM \ + PCVT \ + PF \ + RCMDS \ + RCS \ + RESCUE \ + SENDMAIL \ + SETUID_LOGIN \ + SHAREDOCS \ + SYSCONS \ + TCSH \ + TOOLCHAIN \ + USB \ + WPA_SUPPLICANT_EAPOL +.if defined(NO_${var}) +#.warning NO_${var} is deprecated in favour of WITHOUT_${var}= +WITHOUT_${var}= +.endif +.endfor +.endif # !defined(BURN_BRIDGES) + +# +# Older-style variables that enabled behaviour when set. +# +.if defined(YES_HESIOD) +WITH_HESIOD= +.endif +.if defined(MAKE_IDEA) +WITH_IDEA= +.endif + +# +# MK_* options which default to "yes". +# +.for var in \ + ACPI \ + ATM \ + AUDIT \ + AUTHPF \ + BIND \ + BIND_DNSSEC \ + BIND_ETC \ + BIND_LIBS_LWRES \ + BIND_MTREE \ + BIND_NAMED \ + BIND_UTILS \ + BLUETOOTH \ + BOOT \ + CALENDAR \ + COLLECT2 \ + CPP \ + CRYPT \ + CVS \ + CXX \ + DICT \ + DYNAMICROOT \ + EXAMPLES \ + FORTH \ + FORTRAN \ + FP_LIBC \ + GAMES \ + GCOV \ + GDB \ + GNU \ + GPIB \ + GROFF \ + HTML \ + I4B \ + INET6 \ + INFO \ + IPFILTER \ + IPX \ + KERBEROS \ + LIBC_R \ + LIBPTHREAD \ + LIBTHR \ + LOCALES \ + LPR \ + MAILWRAPPER \ + MAN \ + NETCAT \ + NIS \ + NLS \ + NLS_CATALOGS \ + OBJC \ + OPENSSH \ + OPENSSL \ + PAM \ + PCVT \ + PF \ + RCMDS \ + RCS \ + RESCUE \ + SENDMAIL \ + SETUID_LOGIN \ + SHAREDOCS \ + SYSCONS \ + TCSH \ + TOOLCHAIN \ + USB \ + WPA_SUPPLICANT_EAPOL +.if defined(WITH_${var}) && defined(WITHOUT_${var}) +.error WITH_${var} and WITHOUT_${var} can't both be set. +.endif +.if defined(MK_${var}) +.error MK_${var} can't be set by a user. +.endif +.if defined(WITHOUT_${var}) +MK_${var}:= no +.else +MK_${var}:= yes +.endif +.endfor + +# +# MK_* options which default to "no". +# +.for var in \ + BIND_LIBS \ + HESIOD \ + IDEA +.if defined(WITH_${var}) && defined(WITHOUT_${var}) +.error WITH_${var} and WITHOUT_${var} can't both be set. +.endif +.if defined(MK_${var}) +.error MK_${var} can't be set by a user. +.endif +.if defined(WITH_${var}) +MK_${var}:= yes +.else +MK_${var}:= no +.endif +.endfor + +# +# Force some options off if their dependencies are off. +# +.if ${MK_BIND} == "no" +MK_BIND_DNSSEC:= no +MK_BIND_ETC:= no +MK_BIND_LIBS:= no +MK_BIND_LIBS_LWRES:= no +MK_BIND_MTREE:= no +MK_BIND_NAMED:= no +MK_BIND_UTILS:= no +.endif + +.if ${MK_CRYPT} == "no" +MK_OPENSSL:= no +MK_OPENSSH:= no +MK_KERBEROS:= no +.endif + +.if ${MK_CXX} == "no" +MK_COLLECT2:= no +.endif + +.if ${MK_OPENSSL} == "no" +MK_OPENSSH:= no +MK_KERBEROS:= no +.endif + +.if ${MK_PF} == "no" +MK_AUTHPF:= no +.endif + +.if ${MK_TOOLCHAIN} == "no" +MK_GDB:= no +.endif + +# +# Set defaults for the MK_*_SUPPORT variables. +# + +# +# MK_*_SUPPORT options which default to "yes" unless their corresponding +# MK_* variable is set to "no". +# +.for var in \ + GNU \ + HESIOD \ + INET6 \ + IPX \ + KERBEROS \ + PAM +.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) +.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. +.endif +.if defined(MK_${var}_SUPPORT) +.error MK_${var}_SUPPORT can't be set by a user. +.endif +.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" +MK_${var}_SUPPORT:= no +.else +MK_${var}_SUPPORT:= yes +.endif +.endfor + .endif # !target(__<bsd.own.mk>__) diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 3b4d092..2485a90 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -74,7 +74,7 @@ ${PROG}: ${OBJS} .endif -.if !defined(NO_MAN) && !defined(MAN) && \ +.if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ !defined(MAN7) && !defined(MAN8) && !defined(MAN9) && \ @@ -85,7 +85,7 @@ MAN1= ${MAN} .endif all: objwarn ${PROG} ${SCRIPTS} -.if !defined(NO_MAN) +.if ${MK_MAN} != "no" all: _manpages .endif @@ -177,7 +177,7 @@ NLSNAME?= ${PROG} .include <bsd.incs.mk> .include <bsd.links.mk> -.if !defined(NO_MAN) +.if ${MK_MAN} != "no" realinstall: _maninstall .ORDER: beforeinstall _maninstall .endif @@ -191,7 +191,7 @@ lint: ${SRCS:M*.c} .endif .endif -.if !defined(NO_MAN) +.if ${MK_MAN} != "no" .include <bsd.man.mk> .endif |