--- Makefile (revision 323918) +++ Makefile (working copy) @@ -133,7 +133,7 @@ xdev-links native-xtools stageworld stagekernel stage-packages \ create-packages-world create-packages-kernel create-packages \ packages installconfig real-packages sign-packages package-pkg \ - print-dir test-system-compiler + print-dir test-system-compiler config rmconfig # XXX: r156740: This can't work since bsd.subdir.mk is not included ever. # It will only work for SUBDIR_TARGETS in make.conf. --- Makefile.config (nonexistent) +++ Makefile.config (working copy) @@ -0,0 +1,179 @@ +# $FreeBSD$ +# +# This Makefile is designed to have a very simpe interface to create a +# user-friendly interface to configure the options needed to build the +# world and/or the kernel, but not the options used to compile the kernel +# or the devices that will be statically linked to the kernel. + +.include +.include "${.CURDIR}/sys/conf/kern.opts.mk" +.include + +DIALOG?=/usr/bin/dialog +DIALOG_OPTS=--backtitle "FreeBSD Configurator" +CHECK_LIST=--checklist "Build options" 50 80 45 +MAKE=/usr/bin/make -C ${.CURDIR} +MAKE_CONF=${MAKE} -f Makefile.config +WARNMSG=The following options will be set because of the chosen options: + +SRCCONF?=/etc/src.conf +SRCCONF_BEFORE=${SRCCONF} +SRCCONF_DEFAULT=/dev/null +SRCCONF_CURRENT=/tmp/`echo ${SRCCONF} | tr '/' '_'` + +SRC_ENV_CONF?=/etc/src-env.conf +SRC_ENV_CONF_BEFORE=${SRC_ENV_CONF} +SRC_ENV_CONF_DEFAULT=/dev/null +SRC_ENV_CONF_CURRENT=/tmp/`echo ${SRC_ENV_CONF} | tr '/' '_'` + +CONFIG_OPTIONS= + +# Create the main menu with all the options to be configured. +MAIN_MENU= +.for __cat in ${CATEGORIES} +MAIN_MENU+= ${__cat} +.if defined(${__cat}_DESC) +MAIN_MENU+= ${${__cat}_DESC} +.else +MAIN_MENU+= ${__cat} +.endif + +# For every single category, get the options to be configured on it. +.if defined(${__cat}) +${__cat}_OPTS= +.for __opt in ${${__cat}} +${__cat}_OPTS+= ${__opt} +.if defined(${__opt}_DESC) +${__cat}_OPTS+= "${${__opt}_DESC}" +.else +${__cat}_OPTS+= "${__opt}" +.endif + +.if defined(MK_${__opt}) +.if ${MK_${__opt}} != "no" +${__cat}_OPTS+= on +.else +${__cat}_OPTS+= off +.endif +.else +${__cat}_OPTS+= off +.endif + +.endfor + + +config-${__cat:tl}: + @${DIALOG} ${DIALOG_OPTS} ${CHECK_LIST} ${${__cat}_OPTS}\ + 2> /tmp/config || exit 0; \ + touch ${SRCCONF_CURRENT}.tmp ${SRC_ENV_CONF_CURRENT}.tmp ; \ + for ITEM in ${${__cat}};do \ + FILE=${SRCCONF_CURRENT}.tmp ; \ + echo ${__ENV_ONLY_OPTIONS} | grep -q "$${ITEM}"\ + && FILE=${SRC_ENV_CONF_CURRENT}.tmp; \ + if grep -qE "(^|[[:space:]])$${ITEM}([[:space:]]|$$)" \ + /tmp/config ; then \ + echo "WITH_$${ITEM}=yes" >> $${FILE}; \ + else \ + echo "WITHOUT_$${ITEM}=yes" >> $${FILE} ; \ + fi ; \ + done ;\ + sort ${SRCCONF_CURRENT}.tmp | uniq > ${SRCCONF_CURRENT} || true; \ + sort ${SRC_ENV_CONF_CURRENT}.tmp | uniq > ${SRC_ENV_CONF_CURRENT} || true; \ + rm -f /tmp/config-* ; \ + ${MAKE_CONF} check-config ; \ + if [ ! -s "${SRCCONF}.tmp" -a ! -s "${SRC_CONF_ENV}.tmp" ] ;\ + then \ + comm -23 /tmp/config-current /tmp/config-default \ + > ${SRCCONF} ;\ + comm -23 /tmp/config-current.env /tmp/config-default.env \ + > ${SRC_ENV_CONF} ; \ + else \ + WARNMSG="${WARNMSG}" ; \ + for ITEM in $$(cut -d '=' -f1 ${SRCCONF}.tmp) ; do \ + ONOFF=$$(echo $${ITEM} | cut -d '_' -f1) ; \ + ITEM=$$(echo $${ITEM} | cut -d '_' -f2-) ; \ + [ "$${ONOFF}" = "WITHOUT" ] && ONOFF="off" \ + || ONOFF="on" ;\ + WARNMSG="$${WARNMSG}\n $${ITEM} -> $${ONOFF}"; \ + done ; \ + ${DIALOG} ${DIALOG_OPTS} --msgbox "$${WARNMSG}" 30 70 ; \ + ${MAKE_CONF} config-${__cat:tl} ;\ + fi +.endif #defined(${__cat}) +.endfor #${CATEGORIES} + +.for __conf in before default current +config-${__conf}: + @${MAKE} SRCCONF=${SRCCONF_${__conf:tu}} \ + SRC_CONF_ENV=${SRC_ENV_CONF_${__conf:tu}} showconfig | \ + while read OPTION _ VALUE; do \ + FILE=/tmp/${.TARGET}.tmp ; \ + echo ${__ENV_ONLY_OPTIONS} | grep -q "$${OPTION##MK_}" && \ + FILE=/tmp/${.TARGET}.env.tmp ;\ + [ "$${VALUE}" = "yes" ] && WHAT=WITH || WHAT=WITHOUT ; \ + echo "$${WHAT}_$${OPTION##MK_}=yes" >> $${FILE} ;\ + done ; sort /tmp/${.TARGET}.tmp | uniq > /tmp/${.TARGET} ; \ + sort /tmp/${.TARGET}.env.tmp | uniq > /tmp/${.TARGET}.env ; \ + rm -f /tmp/${.TARGET}.tmp /tmp/${.TARGET}.env.tmp + +.endfor + +config: ${SRCCONF} ${SRC_ENV_CONF} + @cp ${SRCCONF} ${SRCCONF}.bak; \ + cp ${SRC_ENV_CONF} ${SRC_ENV_CONF}.bak; \ + while true ; do \ + if [ -r "${SRCCONF_CURRENT}" ] ; then \ + echo "There is another process trying to configure the build" \ + ", please finish it first." ;\ + exit 1 ;\ + fi ; \ + cp ${SRCCONF} ${SRCCONF_CURRENT} ;\ + if ! ${DIALOG} ${DIALOG_OPTS} --menu "Categories" 20 70 15 \ + ${MAIN_MENU} SAVE "Save the current configuration" \ + 2> /tmp/config ; then\ + mv ${SRCCONF}.bak ${SRCCONF} ;\ + mv ${SRC_ENV_CONF}.bak ${SRC_ENV_CONF} ;\ + rm -f /tmp/config* ${SRCCONF_CURRENT}* \ + ${SRC_ENV_CONF_CURRENT}* ${SRCCONF}.tmp \ + ${SRC_ENV_CONF}.tmp ;\ + exit 0 ;\ + fi ;\ + SUBMENU="config-`cat /tmp/config | tr '[:upper:]' '[:lower:]'`"; \ + ${MAKE_CONF} $${SUBMENU} ; \ + rm -f /tmp/config* ${SRCCONF_CURRENT}* \ + ${SRC_ENV_CONF_CURRENT}* ${SRCCONF}.tmp \ + ${SRC_ENV_CONF}.tmp ;\ + [ "$${SUBMENU}" = "config-save" ] && break ; \ + done + +${SRCCONF} ${SRC_ENV_CONF}: + @[ -r ${.TARGET} ] || touch ${.TARGET} + +check-config: ${SRCCONF} ${SRC_ENV_CONF} config-before config-default config-current + @comm -23 /tmp/config-current /tmp/config-before | sort | uniq \ + > ${SRCCONF_CURRENT}.diff ;\ + comm -23 /tmp/config-current.env /tmp/config-before.env | sort | uniq \ + > ${SRC_ENV_CONF_CURRENT}.diff ;\ + cat ${SRCCONF_CURRENT}.diff | while read LINE ; do \ + grep -qE "$${LINE} ${SRCCONF_CURRENT} && continue ;\ + echo $${LINE} ; \ + done > ${SRCCONF}.tmp ; \ + cat ${SRC_ENV_CONF_CURRENT}.diff | while read LINE ; do \ + grep -qE "$${LINE} ${SRC_ENV_CONF_CURRENT} && continue ;\ + echo $${LINE} ; \ + done > ${SRC_ENV_CONF}.tmp + +config-save: config-default config-current + @if [ -r "${SRCCONF_CURRENT}" ] ; then \ + mv ${SRCCONF_CURRENT} ${SRCCONF} ; \ + rm -f ${SRCCONF}.bak ; \ + else \ + mv ${SRCCONF}.bak ${SRCCONF} ; \ + fi + @if [ -r "${SRC_ENV_CONF_CURRENT}" ] ; then \ + mv ${SRC_ENV_CONF_CURRENT} ${SRC_ENV_CONF} ; \ + rm ${SRC_ENV_CONF}.bak ; \ + else \ + mv ${SRC_ENV_CONF}.bak ${SRC_ENV_CONF} ; \ + fi + --- Makefile.inc1 (revision 323918) +++ Makefile.inc1 (working copy) @@ -2889,3 +2889,9 @@ xdev xdev-build xdev-install xdev-links: .PHONY @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target" .endif + +config: + @cd ${SRCDIR} ; ${CDMAKE} -f Makefile.config config + +rmconfig: + @rm -f /etc/src.conf /etc/src-env.conf --- share/mk/src.opts.desc.mk (nonexistent) +++ share/mk/src.opts.desc.mk (working copy) @@ -0,0 +1,264 @@ +# $FreeBSD$ +# +# Description of the options used for all the /usr/src builds +# +# All the descriptions are stored in the FOO_DESC variables. + +CATEGORIES= \ + ADMIN \ + DEVEL \ + DOCS \ + DRIVERS \ + EMULATION \ + NETWORK \ + OTHER \ + PROGRAMS \ + SECURITY \ + + +ADMIN= \ + ACCT \ + ACPI \ + AMD \ + APM \ + AT \ + AUDIT \ + AUTHPF \ + AUTOFS \ + BLACKLIST \ + BLACKLIST_SUPPORT \ + BSDINSTALL \ + FINGER \ + FREEBSD_UPDATE \ + HAST \ + JAIL \ + LPR \ + MAIL \ + MAILWRAPPER \ + NTP \ + PAM \ + PAM_SUPPORT \ + PC_SYSINSTALL \ + PF \ + PKGBOOTSTRAP \ + PMC \ + PORTSNAP \ + QUOTAS \ + RADIUS_SUPPORT \ + RATELIMIT \ + RBOOTD \ + RCMDS \ + SENDMAIL \ + SETUID_LOGIN \ + TALK \ + TIMED \ + UTMPX \ + + +DEVEL= \ + ASSERT_DEBUG \ + AUTO_OBJ \ + BINUTILS \ + BINUTILS_BOOTSTRAP \ + CCACHE_BUILD \ + CLANG \ + CLANG_BOOTSTRAP \ + CLANG_EXTRAS \ + CLANG_FULL \ + CROSS_COMPILER \ + CTF \ + CTM \ + CXGBETOOL \ + CXX \ + DEBUG_FILES \ + DIRDEPS_BUILD \ + DIRDEPS_CACHE \ + DTRACE_TESTS \ + ELFTOOLCHAIN_BOOTSTRAP \ + FORMAT_EXTENSIONS \ + FP_LIBC \ + GCC \ + GCC_BOOTSTRAP \ + GCOV \ + GDB \ + GDB_LIBEXEC \ + GNUCXX \ + ICONV \ + INCLUDES \ + INSTALLLIB \ + KDUMP \ + KERNEL_SYMBOLS \ + KVM \ + KVM_SUPPORT \ + LIB32 \ + LIBCPLUSPLUS \ + LIBPTHREAD \ + LIBSOFT \ + LIBTHR \ + LLD \ + LLDB \ + LLD_BOOTSTRAP \ + LLVM_LIBUNWIND \ + MAKE \ + META_MODE \ + PROFILE \ + REPRODUCIBLE_BUILD \ + RESCUE \ + SHARED_TOOLCHAIN \ + SOURCELESS \ + SOURCELESS_HOST \ + SOURCELESS_UCODE \ + SSP \ + STAGING \ + STALE_STAGED \ + SYSROOT \ + SYSTEM_COMPILER \ + TESTS \ + TESTS_SUPPORT \ + TOOLCHAIN \ + WARNS \ + + +NETWORK= \ + ATM \ + BLUETOOTH \ + DMAGENT \ + EXTRA_TCP_STACKS \ + INET \ + INET6 \ + INET6_SUPPORT \ + INETD \ + INET_SUPPORT \ + IPFILTER \ + IPFW \ + IPSEC_SUPPORT \ + LDNS \ + LDNS_UTILS \ + NETCAT \ + NETGRAPH \ + NETGRAPH_SUPPORT \ + NIS \ + PPP \ + ROUTED \ + RPCBIND_WARMSTART_SUPPORT \ + TCP_WRAPPERS \ + TELNET \ + TFTP \ + UNBOUND \ + WIRELESS \ + WIRELESS_SUPPORT \ + WPA_SUPPLICANT_EAPOL \ + + +EMULATION= \ + BHYVE \ + NDIS \ + + +PROGRAMS= \ + BSD_CPIO \ + BSD_GREP \ + BSD_GREP_FASTMATCH \ + BSNMP \ + BZIP2 \ + BZIP2_SUPPORT \ + CALENDAR \ + CLANG_IS_CC \ + CPP \ + DIALOG \ + EE \ + FILE \ + FMTREE \ + FTP \ + GAMES \ + GNU_DIFF \ + GNU_GREP \ + GNU_GREP_COMPAT \ + GPIO \ + LLD_IS_LD \ + LOCATE \ + LS_COLORS \ + LZMA_SUPPORT \ + SORT_THREADS \ + STAGING_PROG \ + SVN \ + SVNLITE \ + SYMVER \ + SYSCONS \ + TCSH \ + TEXTPROC \ + USB \ + VI \ + + +SECURITY= \ + CAPSICUM \ + CASPER \ + CRYPT \ + ED_CRYPTO \ + GSSAPI \ + KERBEROS \ + KERBEROS_SUPPORT \ + OPENLDAP \ + OPENSSH \ + OPENSSL \ + + +DRIVERS= \ + CCD \ + CUSE \ + FDT \ + FLOPPY \ + HESIOD \ + HYPERV \ + ISCSI \ + NAND \ + USB_GADGET_EXAMPLES \ + ZFS \ + + +OTHER= \ + BOOT \ + BOOTPARAMD \ + BOOTD \ + CDDL \ + DYNAMICROOT \ + EFI \ + FORTH \ + GPL_DTC \ + INSTALL_AS_USER \ + LEGACY_CONSOLE \ + LOCALES \ + NLS \ + NLS_CATALOGS \ + NLS_CACHING \ + OFED \ + ZONEINFO \ + ZONEINFO_LEAPSECONDS_SUPPORT \ + ZONEINFO_OLD_TIMEZONES_SUPPORT \ + + +DOCS= \ + DICT \ + DOCCOMPRESS \ + EXAMPLES \ + HTML \ + MAN \ + MANCOMPRESS \ + MAN_UTILS \ + SHAREDOCS \ + STAGING_MAN \ + VT \ + + +ADMIN_DESC= "Administration programs" +DEVEL_DESC= "Building options, compilers and debugging information." +DOCS_DESC= "Documentation options" +DRIVERS_DESC= "Kernel modules or options relative to devices." +EMULATION_DESC= "Emulation/virtualitation options." +NETWORK_DESC= "Programs or kernel options/modules to build." +OTHER_DESC= "Other options to configure." +PROGRAMS_DESC= "Non-administrative programs to build." +SECURITY_DESC= "Security features to include in the build." + +