#!/bin/sh # # This file is in the public domain. ident='$FreeBSD$' # # usage: show { settings | options } ... # show() { mode=$1; shift case ${mode} in settings) yes_prefix=WITH no_prefix=WITHOUT ;; options) yes_prefix=WITHOUT no_prefix=WITH ;; *) echo "internal error" >/dev/stderr exit 1 ;; esac ( cd ../../.. make "$@" showconfig SRCCONF=/dev/null __MAKE_CONF=/dev/null ) | while read var _ val; do opt=${var#MK_} case ${val} in yes) echo ${yes_prefix}_${opt} ;; no) echo ${no_prefix}_${opt} ;; *) echo "make showconfig broken" >/dev/stderr exit 1 ;; esac done } main() { trap 'rm -f _defcfg _config _config2 _deps _deps2' exit ident=${ident#$} ident=${ident% $} fbsdid='$'FreeBSD'$' cat <_defcfg show options | while read opt; do if [ -f ${opt} ]; then cat </dev/stderr continue fi show settings -D${opt} |sort >_config comm -13 _defcfg _config |grep -v "^${opt}$" >_deps if [ -s _deps ]; then cat <_config2 comm -13 _config _config2 >_deps2 if [ -s _deps2 ]; then cat <