--- Gnu-Mach/configure 2020/09/02 04:36:56 1.1.1.1 +++ Gnu-Mach/configure 2020/09/02 04:37:01 1.1.1.2 @@ -12,6 +12,8 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_default_prefix= +ac_help="$ac_help +Enable use of in-kernel debugger" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -520,6 +522,7 @@ fi + # # Deduce output var `systype' from configuration parms. # @@ -549,7 +552,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:553: checking host system type" >&5 +echo "configure:556: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -571,10 +574,15 @@ echo "$ac_t""$host" 1>&6 case "$host_cpu" in -i[345]86) systype=i386 ;; +i[3456]86) systype=i386 ;; *) { echo "configure: error: unsupported CPU type" 1>&2; exit 1; } ;; esac +case "$host_os" in +gnu*) ;; +*) { echo "configure: error: sorry, this is the gnu os, not $host_os" 1>&2; exit 1; } ;; +esac + @@ -582,12 +590,25 @@ esac # +# Options +# +# Check whether --enable-kdb or --disable-kdb was given. +if test "${enable_kdb+set}" = set; then + enableval="$enable_kdb" + cat >> confdefs.h <<\EOF +#define MACH_KDB 1 +EOF + +fi + + +# # Programs # # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:591: checking for $ac_word" >&5 +echo "configure:612: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -616,7 +637,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:620: checking for $ac_word" >&5 +echo "configure:641: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -664,7 +685,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:668: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:689: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -674,11 +695,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $C cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -695,15 +716,20 @@ rm -fr conftest* echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + cross_linkable=no + ac_cv_prog_cc_cross=yes + # AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.]) +else + cross_linkable=yes fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:702: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:727: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:707: checking whether we are using GNU C" >&5 +echo "configure:733: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -712,7 +738,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -726,32 +752,20 @@ if test $ac_cv_prog_gcc = yes; then ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:731: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" else - CFLAGS="-O2" + # Add "-O" to both the CC and CPP commands, to eliminate possible confusion + # that results from __OPTIMIZE__ being defined for CC but not CPP. + if echo "$CC " | grep ' -O[1-9 ]' > /dev/null 2>&1; then + : # already optimizing + else + CC="$CC -O" + ac_cv_prog_CC="$CC" + fi fi else GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" fi for ac_prog in mawk gawk nawk awk @@ -759,7 +773,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:763: checking for $ac_word" >&5 +echo "configure:777: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -798,7 +812,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:802: checking for a BSD compatible install" >&5 +echo "configure:816: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -847,10 +861,137 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:866: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`$ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. +set dummy ${ac_tool_prefix}mig; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:892: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MIG"; then + ac_cv_prog_MIG="$MIG" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MIG="${ac_tool_prefix}mig" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +MIG="$ac_cv_prog_MIG" +if test -n "$MIG"; then + echo "$ac_t""$MIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_MIG"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "mig", so it can be a program name with args. +set dummy mig; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:923: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MIG"; then + ac_cv_prog_MIG="$MIG" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MIG="mig" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="mig" +fi +fi +MIG="$ac_cv_prog_MIG" +if test -n "$MIG"; then + echo "$ac_t""$MIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + MIG="mig" +fi +fi + + +if test $cross_compiling = yes; then + for ac_prog in gcc cc +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:961: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$BUILD_CC"; then + ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_BUILD_CC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +BUILD_CC="$ac_cv_prog_BUILD_CC" +if test -n "$BUILD_CC"; then + echo "$ac_t""$BUILD_CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$BUILD_CC" && break +done + + CC=$BUILD_CC +fi + # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:854: checking for $ac_word" >&5 +echo "configure:995: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -883,7 +1024,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:887: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1028: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -891,7 +1032,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -929,7 +1070,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:933: checking for $ac_word" >&5 +echo "configure:1074: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -958,127 +1099,154 @@ test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:963: checking build system type" >&5 -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`$ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -if test $host != $build; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= +if test $cross_compiling = yes ; then + CC=$ac_cv_prog_CC fi -# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. -set dummy ${ac_tool_prefix}mig; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:989: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then + +usable_libc='yes' +needed_funcs='memcpy memset bcopy bzero htonl ntohl ntohs' +for ac_func in $needed_funcs +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1114: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$MIG"; then - ac_cv_prog_MIG="$MIG" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_MIG="${ac_tool_prefix}mig" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -MIG="$ac_cv_prog_MIG" -if test -n "$MIG"; then - echo "$ac_t""$MIG" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +int main() { -if test -z "$ac_cv_prog_MIG"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "mig", so it can be a program name with args. -set dummy mig; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1020: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$MIG"; then - ac_cv_prog_MIG="$MIG" # Let the user override the test. +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_MIG="mig" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="mig" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" fi +rm -f conftest* fi -MIG="$ac_cv_prog_MIG" -if test -n "$MIG"; then - echo "$ac_t""$MIG" 1>&6 + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +usable_libc=no fi +done +if test $usable_libc = no ; then + echo "Support functions not found using $CC, trying $BUILD_CC." + CC="$BUILD_CC" + for i in $needed_funcs ; do + unset ac_cv_func_$i + done + usable_libc=yes + for ac_func in $needed_funcs +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1177: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - MIG="mig" -fi -fi + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +int main() { -if test $host != $build; then - # Extract the first word of "gcc cc", so it can be a program name with args. -set dummy gcc cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1056: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$BUILD_CC"; then - ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_BUILD_CC="" - break - fi - done - IFS="$ac_save_ifs" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" fi +rm -f conftest* fi -BUILD_CC="$ac_cv_prog_BUILD_CC" -if test -n "$BUILD_CC"; then - echo "$ac_t""$BUILD_CC" 1>&6 + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +usable_libc=no fi +done + if test $usable_libc = no ; then + echo "Configuration problem:" 1>&2 + echo "Please set installed-clib in the toplevel Makefile so the functions:" + echo "$needed_funcs are available." + exit 1 + else + + set -- `$BUILD_CC -v 2>&1 | sed -n 's/.*from \(.*\)\/lib\/gcc-lib\/\([^/][^/]*\).*/\1 \2/p'` + + if test -f "$1/$2/lib/libc.a" ; then + installed_clib=$1/$2/lib/libc.a + else + installed_clib=$1/lib/libc.a + fi + fi + CC=$ac_cv_prog_CC +else + installed_clib=$prefix/lib/libcrt.a fi + # Set up `machine' link in build directory for easier header file location. @@ -1239,12 +1407,10 @@ s%@host_os@%$host_os%g s%@systype@%$systype%g s%@cross_compiling@%$cross_compiling%g s%@CC@%$CC%g +s%@cross_linkable@%$cross_linkable%g s%@AWK@%$AWK%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@LEX@%$LEX%g -s%@LEXLIB@%$LEXLIB%g -s%@YACC@%$YACC%g s%@build@%$build%g s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g @@ -1252,6 +1418,10 @@ s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@MIG@%$MIG%g s%@BUILD_CC@%$BUILD_CC%g +s%@LEX@%$LEX%g +s%@LEXLIB@%$LEXLIB%g +s%@YACC@%$YACC%g +s%@installed_clib@%$installed_clib%g s%@subdirs@%$subdirs%g CEOF