X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fconfigure;h=2949817372ceb65ecfc66a593ef4f426ec24b102;hb=016a3251631341bf4d8fe50966d2b70f8ea69e96;hp=53a6ca9e760daa1732b37742be6ba3ac06418455;hpb=05b4bd799a73514fc9156f87ce4b353f7458cf11;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/configure b/gdb/configure index 53a6ca9e76..2949817372 100755 --- a/gdb/configure +++ b/gdb/configure @@ -591,7 +591,12 @@ ac_includes_default="\ enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS +GCORE_TRANSFORM_NAME +GDB_TRANSFORM_NAME GDB_NM_FILE +LTLIBBABELTRACE +LIBBABELTRACE +HAVE_LIBBABELTRACE frags target_subdir CONFIG_UNINSTALL @@ -653,6 +658,18 @@ TARGET_SYSTEM_ROOT CONFIG_LDFLAGS RDYNAMIC ALLOCA +LTLIBIPT +LIBIPT +HAVE_LIBIPT +HAVE_GUILE_FALSE +HAVE_GUILE_TRUE +GUILE_LIBS +GUILE_CPPFLAGS +GUILD_TARGET_FLAG +GUILD +pkg_config_prog_path +HAVE_PYTHON_FALSE +HAVE_PYTHON_TRUE PYTHON_LIBS PYTHON_CPPFLAGS PYTHON_CFLAGS @@ -666,6 +683,10 @@ READLINE_TEXI_INCFLAG READLINE_CFLAGS READLINE_DEPS READLINE +LTLIBICONV +LIBICONV +zlibinc +zlibdir MIG WINDRES DLLTOOL @@ -681,6 +702,7 @@ AWK REPORT_BUGS_TEXI REPORT_BUGS_TO PKGVERSION +HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs GDB_DATADIR @@ -709,6 +731,10 @@ MAKE CCDEPMODE DEPDIR am__leading_dot +COMPILER +INSTALL_STRIP_PROGRAM +STRIP +install_sh target_os target_vendor target_cpu @@ -724,6 +750,9 @@ build EGREP GREP CPP +ac_ct_CXX +CXXFLAGS +CXX OBJEXT EXEEXT ac_ct_CC @@ -778,6 +807,7 @@ enable_option_checking enable_maintainer_mode enable_plugins enable_largefile +enable_build_with_cxx with_separate_debug_dir with_gdb_datadir with_relocated_sources @@ -794,17 +824,20 @@ with_curses enable_profiling with_pkgversion with_bugurl -with_zlib +with_system_zlib +with_gnu_ld +enable_rpath with_libiconv_prefix with_iconv_bin with_system_readline with_jit_reader_dir with_expat -with_gnu_ld -enable_rpath with_libexpat_prefix with_python +with_guile enable_libmcheck +with_intel_pt +with_libipt_prefix with_included_regex with_sysroot with_system_gdbinit @@ -819,6 +852,8 @@ with_x enable_sim enable_multi_ice enable_gdbserver +with_babeltrace +with_libbabeltrace_prefix ' ac_precious_vars='build_alias host_alias @@ -828,6 +863,9 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +CXX +CXXFLAGS +CCC CPP MAKEINFO MAKEINFOFLAGS @@ -1461,8 +1499,9 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer - --enable-plugins Enable support for plugins (defaults no) + --enable-plugins Enable support for plugins --disable-largefile omit support for large files + --enable-build-with-cxx build with C++ compiler instead of C compiler --enable-targets=TARGETS alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) @@ -1472,7 +1511,7 @@ Optional Features: --enable-gdbtk enable gdbtk graphical user interface (GUI) --enable-profiling enable profiling of GDB --disable-rpath do not hardcode runtime library paths - --enable-libmcheck Try building GDB with -lmcheck if available + --enable-libmcheck Try linking with -lmcheck if available --enable-werror treat compile warnings as errors --enable-build-warnings enable build-time compiler warnings if gcc is used --enable-gdb-build-warnings @@ -1506,19 +1545,24 @@ Optional Packages: library --with-pkgversion=PKG Use PKG in the version string in place of "GDB" --with-bugurl=URL Direct users to URL to report a bug - --with-zlib include zlib support (auto/yes/no) default=auto - --with-libiconv-prefix=DIR - search for libiconv in DIR/include and DIR/lib + --with-system-zlib use installed libz + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-iconv-bin=PATH specify where to find the iconv program --with-system-readline use installed readline library --with-jit-reader-dir=PATH directory to load the JIT readers from --with-expat include expat support (auto/yes/no) - --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libexpat-prefix[=DIR] search for libexpat in DIR/include and DIR/lib --without-libexpat-prefix don't search for libexpat in includedir and libdir --with-python[=PYTHON] include python support (auto/yes/no/) + --with-guile[=GUILE] include guile support + (auto/yes/no//) + --with-intel-pt include Intel(R) Processor Trace support (auto/yes/no) + --with-libipt-prefix[=DIR] search for libipt in DIR/include and DIR/lib + --without-libipt-prefix don't search for libipt in includedir and libdir --without-included-regex don't use included regex; this is the default on systems with version 2 of the GNU C library (use @@ -1532,6 +1576,9 @@ Optional Packages: --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-x use the X Window System + --with-babeltrace include babeltrace support (auto/yes/no) + --with-libbabeltrace-prefix[=DIR] search for libbabeltrace in DIR/include and DIR/lib + --without-libbabeltrace-prefix don't search for libbabeltrace in includedir and libdir Some influential environment variables: CC C compiler command @@ -1541,6 +1588,8 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags CPP C preprocessor MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS @@ -1670,6 +1719,44 @@ fi } # ac_fn_c_try_compile +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_cxx_try_compile + # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -1867,6 +1954,52 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_header_compile +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -2045,52 +2178,6 @@ rm -f conftest.val } # ac_fn_c_compute_int -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_link - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -2158,6 +2245,60 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_func +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type + # ac_fn_c_check_decl LINENO SYMBOL VAR # ------------------------------------ # Tests whether SYMBOL is declared, setting cache variable VAR accordingly. @@ -2260,50 +2401,41 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_member -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () +# ac_fn_cxx_check_decl LINENO SYMBOL VAR +# -------------------------------------- +# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +ac_fn_cxx_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { -if (sizeof (($2))) - return 0; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else +if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -2312,7 +2444,7 @@ eval ac_res=\$$3 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -} # ac_fn_c_check_type +} # ac_fn_cxx_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2693,10 +2825,8 @@ fi -# Provide more thorough testing by -lmcheck. -# Set it to 'true' for development snapshots, 'false' for releases or -# pre-releases. -development=true +# Set the 'development' global. +. $srcdir/../bfd/development.sh ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3463,29 +3593,287 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + rm -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. @@ -4066,56 +4454,145 @@ test -n "$target_alias" && # even in directories otherwise not depending on the $plugins option. -# Check whether --enable-plugins was given. -if test "${enable_plugins+set}" = set; then : - enableval=$enable_plugins; case "${enableval}" in - yes | "") plugins=yes ;; - no) plugins=no ;; - *) plugins=yes ;; - esac -else - plugins=no + maybe_plugins=no + for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + maybe_plugins=yes fi +done + for ac_header in windows.h +do : + ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default +" +if test "x$ac_cv_header_windows_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + maybe_plugins=yes +fi -case "${host}" in - sparc-*-solaris*|i[3-7]86-*-solaris*) - # On native 32bit sparc and ia32 solaris, large-file and procfs support - # are mutually exclusive; and without procfs support, the bfd/ elf module - # cannot provide certain routines such as elfcore_write_prpsinfo - # or elfcore_write_prstatus. So unless the user explicitly requested - # large-file support through the --enable-largefile switch, disable - # large-file support in favor of procfs support. - test "${target}" = "${host}" -a "x$plugins" = xno \ - && : ${enable_largefile="no"} - ;; -esac +done -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; -fi -if test "$enable_largefile" != no; then + # Check whether --enable-plugins was given. +if test "${enable_plugins+set}" = set; then : + enableval=$enable_plugins; case "${enableval}" in + no) plugins=no ;; + *) plugins=yes + if test "$maybe_plugins" != "yes" ; then + as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5 + fi ;; + esac +else + plugins=$maybe_plugins - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : +fi + + if test "$plugins" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if test "${ac_cv_search_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_dlopen+set}" = set; then : + break +fi +done +if test "${ac_cv_search_dlopen+set}" = set; then : + +else + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + fi + + +case "${host}" in + sparc-*-solaris*|i[3-7]86-*-solaris*) + # On native 32bit sparc and ia32 solaris, large-file and procfs support + # are mutually exclusive; and without procfs support, the bfd/ elf module + # cannot provide certain routines such as elfcore_write_prpsinfo + # or elfcore_write_prstatus. So unless the user explicitly requested + # large-file support through the --enable-largefile switch, disable + # large-file support in favor of procfs support. + test "${target}" = "${host}" -a "x$plugins" = xno \ + && : ${enable_largefile="no"} + ;; +esac + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 @@ -4373,6 +4850,118 @@ case "x$am_cv_prog_cc_stdc" in *) CC="$CC $am_cv_prog_cc_stdc" ;; esac +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + ac_aux_dir= for ac_dir in .. "$srcdir"/..; do @@ -4409,6 +4998,30 @@ ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +# See if we are building with C++, and substitute COMPILER. + + # Check whether --enable-build-with-cxx was given. +if test "${enable_build_with_cxx+set}" = set; then : + enableval=$enable_build_with_cxx; case $enableval in + yes | no) + ;; + *) + as_fn_error "bad value $enableval for --enable-build-with-cxx" "$LINENO" 5 ;; + esac +else + enable_build_with_cxx=no +fi + + + if test "$enable_build_with_cxx" = "yes"; then + # We're using -fpermissive as shortcut for now. + COMPILER='$(CXX) -fpermissive' + else + COMPILER='$(CC)' + fi + + + # Dependency checking. rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null @@ -4610,6 +5223,12 @@ $as_echo "no" >&6; } fi +gnulib_extra_configure_args= +# If large-file support is disabled, make sure gnulib does the same. +if test "$enable_largefile" = no; then +gnulib_extra_configure_args="$gnulib_extra_configure_args --disable-largefile" +fi + # Configure gnulib. We need to build gnulib under some other # directory not "gnulib", to avoid the problem of both GDB and # GDBserver wanting to build it in the same directory, when building @@ -4617,6 +5236,7 @@ fi in_src="gnulib" in_build="build-gnulib" + in_extra_args="$gnulib_extra_configure_args" # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. @@ -4701,6 +5321,11 @@ fi ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac + if test -n "$in_extra_args"; then + # Add the extra args at the end. + ac_sub_configure_args="$ac_sub_configure_args $in_extra_args" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. @@ -5071,10 +5696,15 @@ fi . $srcdir/configure.host +# Add in the common host objects. +. $srcdir/common/common.host +gdb_host_obs="$gdb_host_obs $common_host_obs" + # Accumulate some settings from configure.tgt over all enabled targets TARGET_OBS= all_targets= +HAVE_NATIVE_GCORE_TARGET= for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` do @@ -5109,6 +5739,12 @@ fi if test x${want64} = xfalse; then . ${srcdir}/../bfd/config.bfd fi + + # Check whether this target is native and supports gcore. + if test $gdb_native = yes -a "$targ_alias" = "$target_alias" \ + && $gdb_have_gcore; then + HAVE_NATIVE_GCORE_TARGET=1 + fi fi done @@ -5171,6 +5807,7 @@ fi + # For other settings, only the main target counts. gdb_sim= gdb_osabi= @@ -6117,8 +6754,10 @@ else fi -# Needed for GNU/Hurd. -if test -n "$ac_tool_prefix"; then +case $host_os in + gnu*) + # Needed for GNU Hurd hosts. + if test -n "$ac_tool_prefix"; then # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -6210,6 +6849,11 @@ else MIG="$ac_cv_prog_MIG" fi + if test x"$MIG" = x; then + as_fn_error "MIG not found but required for $host hosts" "$LINENO" 5 + fi + ;; +esac # ---------------------- # # Checks for libraries. # @@ -6430,20 +7074,27 @@ fi # Link in zlib if we can. This allows us to read compressed debug sections. - # See if the user specified whether he wants zlib support or not. + # Use the system's zlib library. + zlibdir="-L\$(top_builddir)/../zlib" + zlibinc="-I\$(top_srcdir)/../zlib" + +# Check whether --with-system-zlib was given. +if test "${with_system_zlib+set}" = set; then : + withval=$with_system_zlib; if test x$with_system_zlib = xyes ; then + zlibdir= + zlibinc= + fi -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; -else - with_zlib=auto fi - if test "$with_zlib" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5 -$as_echo_n "checking for library containing zlibVersion... " >&6; } -if test "${ac_cv_search_zlibVersion+set}" = set; then : + + + +# On FreeBSD we may need libutil for kinfo_getvmmap (used by fbsd-nat.c). +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kinfo_getvmmap" >&5 +$as_echo_n "checking for library containing kinfo_getvmmap... " >&6; } +if test "${ac_cv_search_kinfo_getvmmap+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -6456,16 +7107,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char zlibVersion (); +char kinfo_getvmmap (); int main () { -return zlibVersion (); +return kinfo_getvmmap (); ; return 0; } _ACEOF -for ac_lib in '' z; do +for ac_lib in '' util; do if test -z "$ac_lib"; then ac_res="none required" else @@ -6473,707 +7124,839 @@ for ac_lib in '' z; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_zlibVersion=$ac_res + ac_cv_search_kinfo_getvmmap=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_zlibVersion+set}" = set; then : + if test "${ac_cv_search_kinfo_getvmmap+set}" = set; then : break fi done -if test "${ac_cv_search_zlibVersion+set}" = set; then : +if test "${ac_cv_search_kinfo_getvmmap+set}" = set; then : else - ac_cv_search_zlibVersion=no + ac_cv_search_kinfo_getvmmap=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5 -$as_echo "$ac_cv_search_zlibVersion" >&6; } -ac_res=$ac_cv_search_zlibVersion +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kinfo_getvmmap" >&5 +$as_echo "$ac_cv_search_kinfo_getvmmap" >&6; } +ac_res=$ac_cv_search_kinfo_getvmmap if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - for ac_header in zlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ZLIB_H 1 -_ACEOF + +$as_echo "#define HAVE_KINFO_GETVMMAP 1" >>confdefs.h fi -done -fi - if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then - as_fn_error "zlib (libz) library was explicitly requested but not found" "$LINENO" 5 - fi + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" -# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c). -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlgetmodinfo" >&5 -$as_echo_n "checking for library containing dlgetmodinfo... " >&6; } -if test "${ac_cv_search_dlgetmodinfo+set}" = set; then : - $as_echo_n "(cached) " >&6 +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + with_gnu_ld=no +fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlgetmodinfo (); -int -main () -{ -return dlgetmodinfo (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl xpdl; do - if test -z "$ac_lib"; then - ac_res="none required" +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" + PATH_SEPARATOR=: fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlgetmodinfo=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_dlgetmodinfo+set}" = set; then : - break -fi -done -if test "${ac_cv_search_dlgetmodinfo+set}" = set; then : - -else - ac_cv_search_dlgetmodinfo=no + rm -f conf$$.sh fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +$as_echo_n "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${acl_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlgetmodinfo" >&5 -$as_echo "$ac_cv_search_dlgetmodinfo" >&6; } -ac_res=$ac_cv_search_dlgetmodinfo -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - fi - - - - -# Check whether --with-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then : - withval=$with_libiconv_prefix; - for dir in `echo "$withval" | tr : ' '`; do - if test -d $dir/include; then LIBICONV_INCLUDE="-I$dir/include"; fi - if test -d $dir/lib; then LIBICONV_LIBDIR="-L$dir/lib"; fi - done - +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${acl_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld - BUILD_LIBICONV_LIBDIRS="../libiconv/lib/.libs ../libiconv/lib/_libs" - BUILD_LIBICONV_INCLUDE="-I../libiconv/include" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 -$as_echo_n "checking for iconv... " >&6; } -if test "${am_cv_func_iconv+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if test "${acl_cv_rpath+set}" = set; then : $as_echo_n "(cached) " >&6 else - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - am_cv_use_build_libiconv=no - am_cv_build_libiconv_path= + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done - # If libiconv is part of the build tree, then try using it over - # any system iconv. - if test -d ../libiconv; then - for lib_dir in $BUILD_LIBICONV_LIBDIRS; do - am_save_LIBS="$LIBS" - am_save_CPPFLAGS="$CPPFLAGS" - LIBS="$LIBS $lib_dir/libiconv.a" - CPPFLAGS="$CPPFLAGS $BUILD_LIBICONV_INCLUDE" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_use_build_libiconv=yes - am_cv_build_libiconv_path=$lib_dir/libiconv.a - am_cv_lib_iconv=yes - am_cv_func_iconv=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - CPPFLAGS="$am_save_CPPFLAGS" - if test "$am_cv_use_build_libiconv" = "yes"; then - break - fi - done - fi - - # Next, try to find iconv in libc. - if test "$am_cv_func_iconv" != yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_func_iconv=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - # If iconv was not in libc, try -liconv. In this case, arrange to - # look in the libiconv prefix, if it was specified by the user. - if test "$am_cv_func_iconv" != yes; then - am_save_CPPFLAGS="$CPPFLAGS" - am_save_LIBS="$LIBS" - if test -n "$LIBICONV_INCLUDE"; then - CPPFLAGS="$CPPFLAGS $LIBICONV_INCLUDE" - LIBS="$LIBS $LIBICONV_LIBDIR" - fi - LIBS="$LIBS -liconv" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_lib_iconv=yes - am_cv_func_iconv=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - CPPFLAGS="$am_save_CPPFLAGS" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 -$as_echo "$am_cv_func_iconv" >&6; } - # Set the various flags based on the cache variables. We can't rely - # on the flags to remain set from the above code, due to caching. - LIBICONV= - if test "$am_cv_lib_iconv" = yes; then - LIBICONV="-liconv" - else - LIBICONV_LIBDIR= - LIBICONV_INCLUDE= - fi - if test "$am_cv_use_build_libiconv" = yes; then - LIBICONV="$am_cv_build_libiconv_path" - LIBICONV_LIBDIR="" - LIBICONV_INCLUDE="$BUILD_LIBICONV_INCLUDE" - fi - CPPFLAGS="$CPPFLAGS $LIBICONV_INCLUDE" - LIBS="$LIBS $LIBICONV_LIBDIR $LIBICONV" - if test "$am_cv_func_iconv" = yes; then -$as_echo "#define HAVE_ICONV 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 -$as_echo_n "checking for iconv declaration... " >&6; } - if test "${am_cv_proto_iconv+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif + use_additional=yes -int -main () -{ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - am_cv_proto_iconv_arg1="" -else - am_cv_proto_iconv_arg1="const" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" -fi + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" - am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- - }$am_cv_proto_iconv" >&5 -$as_echo "${ac_t:- - }$am_cv_proto_iconv" >&6; } + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -cat >>confdefs.h <<_ACEOF -#define ICONV_CONST $am_cv_proto_iconv_arg1 -_ACEOF - - fi - - -# GDB may fork/exec the iconv program to get the list of supported character -# sets. Allow the user to specify where to find it. -# There are several factors affecting the choice of option name: -# - There is already --with-libiconv-prefix but we can't use it, it specifies -# the build-time location of libiconv files. -# - The program we need to find is iconv, which comes with glibc. The user -# doesn't necessarily have libiconv installed. Therefore naming this -# --with-libiconv-foo feels wrong. -# - We want the path to be relocatable, but GDB_AC_DEFINE_RELOCATABLE is -# defined to work on directories not files (though it really doesn't know -# the difference). -# - Calling this --with-iconv-prefix is perceived to cause too much confusion -# with --with-libiconv-prefix. -# Putting these together is why the option name is --with-iconv-bin. - - -# Check whether --with-iconv-bin was given. -if test "${with_iconv_bin+set}" = set; then : - withval=$with_iconv_bin; iconv_bin="${withval}" - -cat >>confdefs.h <<_ACEOF -#define ICONV_BIN "${iconv_bin}" -_ACEOF +# Check whether --with-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then - if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - value=0 - case ${iconv_bin} in - "${test_prefix}"|"${test_prefix}/"*|\ - '${exec_prefix}'|'${exec_prefix}/'*) - value=1 - ;; - esac + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" -cat >>confdefs.h <<_ACEOF -#define ICONV_BIN_RELOCATABLE $value -_ACEOF + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi fi + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do -# On alpha-osf, it appears that libtermcap and libcurses are not compatible. -# There is a very specific comment in /usr/include/curses.h explaining that -# termcap routines built into libcurses must not be used. -# -# The symptoms we observed so far is GDB unexpectedly changing -# the terminal settings when tgetent is called - this is particularly -# visible as the output is missing carriage returns, and so rapidly -# becomes very hard to read. -# -# The readline configure script has already decided that libtermcap -# was enough for its purposes, and so decided to build readline using -# libtermcap. Since the TUI mode requires curses, building GDB with -# TUI enabled results in both libraries to be used at the same time, -# which is not allowed. This basically means that GDB with TUI is -# broken on alpha-osf. + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -case $host_os in - osf* ) - if test x"$enable_tui" = xyes; then - as_fn_error "Building GDB with TUI mode is not supported on this host" "$LINENO" 5 - fi - if test x"$enable_tui" = xauto; then - enable_tui=no - fi - ;; -esac + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do -# For the TUI, we need enhanced curses functionality. -if test x"$enable_tui" != xno; then - prefer_curses=yes -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -curses_found=no -if test x"$prefer_curses" = xyes; then - # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied - # curses library because the latter might not provide all the - # functionality we need. However, this leads to problems on systems - # where the linker searches /usr/local/lib, but the compiler doesn't - # search /usr/local/include, if ncurses is installed in /usr/local. A - # default installation of ncurses on alpha*-dec-osf* will lead to such - # a situation. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 -$as_echo_n "checking for library containing waddstr... " >&6; } -if test "${ac_cv_search_waddstr+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char waddstr (); -int -main () -{ -return waddstr (); - ; - return 0; -} -_ACEOF -for ac_lib in '' ncurses cursesX curses; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_waddstr=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_waddstr+set}" = set; then : - break -fi -done -if test "${ac_cv_search_waddstr+set}" = set; then : + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -else - ac_cv_search_waddstr=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_waddstr" >&5 -$as_echo "$ac_cv_search_waddstr" >&6; } -ac_res=$ac_cv_search_waddstr -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do - if test "$ac_cv_search_waddstr" != no; then - curses_found=yes - fi -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -# Check whether we should enable the TUI, but only do so if we really -# can. -if test x"$enable_tui" != xno; then - if test -d $srcdir/tui; then - if test "$curses_found" != no; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)" - else - if test x"$enable_tui" = xyes; then - as_fn_error "no enhanced curses library found; disable TUI" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no enhanced curses library found; disabling TUI" >&5 -$as_echo "$as_me: WARNING: no enhanced curses library found; disabling TUI" >&2;} + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done fi fi -fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi -# Since GDB uses Readline, we need termcap functionality. In many -# cases this will be provided by the curses library, but some systems -# have a seperate termcap library, or no curses library at all. -case $host_os in - cygwin*) - if test -d $srcdir/libtermcap; then - LIBS="../libtermcap/libtermcap.a $LIBS" - ac_cv_search_tgetent="../libtermcap/libtermcap.a" - fi ;; - go32* | *djgpp*) - ac_cv_search_tgetent="none required" - ;; - *mingw32*) - ac_cv_search_tgetent="none required" - CONFIG_OBS="$CONFIG_OBS windows-termcap.o" - ;; -esac -# These are the libraries checked by Readline. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 -$as_echo_n "checking for library containing tgetent... " >&6; } -if test "${ac_cv_search_tgetent+set}" = set; then : + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } +if test "${am_cv_func_iconv+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tgetent (); + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + am_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include int main () { -return tgetent (); +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); ; return 0; } _ACEOF -for ac_lib in '' termcap tinfo curses ncurses; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_tgetent=$ac_res +if ac_fn_c_try_link "$LINENO"; then : + am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_tgetent+set}" = set; then : - break -fi -done -if test "${ac_cv_search_tgetent+set}" = set; then : - -else - ac_cv_search_tgetent=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5 -$as_echo "$ac_cv_search_tgetent" >&6; } -ac_res=$ac_cv_search_tgetent -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS="$am_save_CPPFLAGS" + if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then + for _libs in .libs _libs; do + am_save_CPPFLAGS="$CPPFLAGS" + am_save_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS -I../libiconv/include" + LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + INCICONV="-I../libiconv/include" + LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a + LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la + am_cv_lib_iconv=yes + am_cv_func_iconv=yes fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS="$am_save_CPPFLAGS" + LIBS="$am_save_LIBS" + if test "$am_cv_func_iconv" = "yes"; then + break + fi + done + fi - -if test "$ac_cv_search_tgetent" = no; then - as_fn_error "no termcap library found" "$LINENO" 5 + if test "$am_cv_func_iconv" != yes; then + am_save_CPPFLAGS="$CPPFLAGS" + am_save_LIBS="$LIBS" + CPPFLAGS="$LIBS $INCICONV" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS="$am_save_CPPFLAGS" + LIBS="$am_save_LIBS" + fi - -# Check whether --with-system-readline was given. -if test "${with_system_readline+set}" = set; then : - withval=$with_system_readline; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then +$as_echo "#define HAVE_ICONV 1" >>confdefs.h -if test "$with_system_readline" = yes; then - READLINE=-lreadline - READLINE_DEPS= - READLINE_CFLAGS= - READLINE_TEXI_INCFLAG= -else - READLINE='$(READLINE_DIR)/libreadline.a' - READLINE_DEPS='$(READLINE)' - READLINE_CFLAGS='-I$(READLINE_SRC)/..' - READLINE_TEXI_INCFLAG='-I $(READLINE_DIR)' -fi + fi + if test "$am_cv_lib_iconv" = yes; then + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } + else + LIBICONV= + LTLIBICONV= + fi -# Generate jit-reader.h -# This is typedeffed to GDB_CORE_ADDR in jit-reader.h -TARGET_PTR= -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 -$as_echo_n "checking size of unsigned long long... " >&6; } -if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then : + if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +$as_echo_n "checking for iconv declaration... " >&6; } + if test "${am_cv_proto_iconv+set}" = set; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_unsigned_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (unsigned long long) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_unsigned_long_long=0 - fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 -$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long + ; + return 0; +} _ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 -$as_echo_n "checking size of unsigned long... " >&6; } -if test "${ac_cv_sizeof_unsigned_long+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : - +if ac_fn_c_try_compile "$LINENO"; then : + am_cv_proto_iconv_arg1="" else - if test "$ac_cv_type_unsigned_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (unsigned long) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_unsigned_long=0 - fi + am_cv_proto_iconv_arg1="const" fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 -$as_echo "$ac_cv_sizeof_unsigned_long" >&6; } - + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +$as_echo "${ac_t:- + }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF -#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long +#define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF + fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned __int128" >&5 -$as_echo_n "checking size of unsigned __int128... " >&6; } -if test "${ac_cv_sizeof_unsigned___int128+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned __int128))" "ac_cv_sizeof_unsigned___int128" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_unsigned___int128" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (unsigned __int128) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_unsigned___int128=0 - fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned___int128" >&5 -$as_echo "$ac_cv_sizeof_unsigned___int128" >&6; } +# GDB may fork/exec the iconv program to get the list of supported character +# sets. Allow the user to specify where to find it. +# There are several factors affecting the choice of option name: +# - There is already --with-libiconv-prefix but we can't use it, it specifies +# the build-time location of libiconv files. +# - The program we need to find is iconv, which comes with glibc. The user +# doesn't necessarily have libiconv installed. Therefore naming this +# --with-libiconv-foo feels wrong. +# - We want the path to be relocatable, but GDB_AC_DEFINE_RELOCATABLE is +# defined to work on directories not files (though it really doesn't know +# the difference). +# - Calling this --with-iconv-prefix is perceived to cause too much confusion +# with --with-libiconv-prefix. +# Putting these together is why the option name is --with-iconv-bin. +# Check whether --with-iconv-bin was given. +if test "${with_iconv_bin+set}" = set; then : + withval=$with_iconv_bin; iconv_bin="${withval}" cat >>confdefs.h <<_ACEOF -#define SIZEOF_UNSIGNED___INT128 $ac_cv_sizeof_unsigned___int128 +#define ICONV_BIN "${iconv_bin}" _ACEOF - -if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then - TARGET_PTR="unsigned long" -elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then - TARGET_PTR="unsigned long long" -elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then - TARGET_PTR="unsigned __int128" -else - TARGET_PTR="unsigned long" -fi - - -ac_config_files="$ac_config_files jit-reader.h:jit-reader.in" + if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + value=0 + case ${iconv_bin} in + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + value=1 + ;; + esac + +cat >>confdefs.h <<_ACEOF +#define ICONV_BIN_RELOCATABLE $value +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if test "${ac_cv_search_dlopen+set}" = set; then : + +fi + + +# For the TUI, we need enhanced curses functionality. +if test x"$enable_tui" != xno; then + prefer_curses=yes +fi + +curses_found=no +if test x"$prefer_curses" = xyes; then + # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied + # curses library because the latter might not provide all the + # functionality we need. However, this leads to problems on systems + # where the linker searches /usr/local/lib, but the compiler doesn't + # search /usr/local/include, if ncurses is installed in /usr/local. A + # default installation of ncurses on alpha*-dec-osf* will lead to such + # a situation. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 +$as_echo_n "checking for library containing waddstr... " >&6; } +if test "${ac_cv_search_waddstr+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -7186,16 +7969,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dlopen (); +char waddstr (); int main () { -return dlopen (); +return waddstr (); ; return 0; } _ACEOF -for ac_lib in '' dl; do +for ac_lib in '' ncurses cursesX curses; do if test -z "$ac_lib"; then ac_res="none required" else @@ -7203,287 +7986,433 @@ for ac_lib in '' dl; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlopen=$ac_res + ac_cv_search_waddstr=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_dlopen+set}" = set; then : + if test "${ac_cv_search_waddstr+set}" = set; then : break fi done -if test "${ac_cv_search_dlopen+set}" = set; then : +if test "${ac_cv_search_waddstr+set}" = set; then : else - ac_cv_search_dlopen=no + ac_cv_search_waddstr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -$as_echo "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_waddstr" >&5 +$as_echo "$ac_cv_search_waddstr" >&6; } +ac_res=$ac_cv_search_waddstr if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - - -# Check whether --with-jit-reader-dir was given. -if test "${with_jit_reader_dir+set}" = set; then : - withval=$with_jit_reader_dir; - JIT_READER_DIR=$withval -else - JIT_READER_DIR=${libdir}/gdb + if test "$ac_cv_search_waddstr" != no; then + curses_found=yes + fi fi +# Check whether we should enable the TUI, but only do so if we really +# can. +if test x"$enable_tui" != xno; then + if test -d $srcdir/tui; then + if test "$curses_found" != no; then + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" + CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" + ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)" + else + if test x"$enable_tui" = xyes; then + as_fn_error "no enhanced curses library found; disable TUI" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no enhanced curses library found; disabling TUI" >&5 +$as_echo "$as_me: WARNING: no enhanced curses library found; disabling TUI" >&2;} + fi + fi + fi +fi - test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $JIT_READER_DIR` - ac_define_dir=`eval echo $ac_define_dir` - -cat >>confdefs.h <<_ACEOF -#define JIT_READER_DIR "$ac_define_dir" -_ACEOF - +# Since GDB uses Readline, we need termcap functionality. In many +# cases this will be provided by the curses library, but some systems +# have a seperate termcap library, or no curses library at all. +case $host_os in + cygwin*) + if test -d $srcdir/libtermcap; then + LIBS="../libtermcap/libtermcap.a $LIBS" + ac_cv_search_tgetent="../libtermcap/libtermcap.a" + fi ;; + go32* | *djgpp*) + ac_cv_search_tgetent="none required" + ;; +esac +# These are the libraries checked by Readline. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 +$as_echo_n "checking for library containing tgetent... " >&6; } +if test "${ac_cv_search_tgetent+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +for ac_lib in '' termcap tinfo curses ncurses; do + if test -z "$ac_lib"; then + ac_res="none required" else - test_prefix=$exec_prefix + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - value=0 - case ${ac_define_dir} in - "${test_prefix}"|"${test_prefix}/"*|\ - '${exec_prefix}'|'${exec_prefix}/'*) - value=1 - ;; - esac + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_tgetent=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_tgetent+set}" = set; then : + break +fi +done +if test "${ac_cv_search_tgetent+set}" = set; then : -cat >>confdefs.h <<_ACEOF -#define JIT_READER_DIR_RELOCATABLE $value -_ACEOF +else + ac_cv_search_tgetent=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5 +$as_echo "$ac_cv_search_tgetent" >&6; } +ac_res=$ac_cv_search_tgetent +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +fi +if test "$ac_cv_search_tgetent" = no; then + CONFIG_OBS="$CONFIG_OBS stub-termcap.o" +fi -# Check whether --with-expat was given. -if test "${with_expat+set}" = set; then : - withval=$with_expat; -else - with_expat=auto +# Check whether --with-system-readline was given. +if test "${with_system_readline+set}" = set; then : + withval=$with_system_readline; fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use expat" >&5 -$as_echo_n "checking whether to use expat... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_expat" >&5 -$as_echo "$with_expat" >&6; } -if test "${with_expat}" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: expat support disabled; some features may be unavailable." >&5 -$as_echo "$as_me: WARNING: expat support disabled; some features may be unavailable." >&2;} - HAVE_LIBEXPAT=no +if test "$with_system_readline" = yes; then + READLINE=-lreadline + READLINE_DEPS= + READLINE_CFLAGS= + READLINE_TEXI_INCFLAG= else + READLINE='$(READLINE_DIR)/libreadline.a' + READLINE_DEPS='$(READLINE)' + READLINE_CFLAGS='-I$(READLINE_SRC)/..' + READLINE_TEXI_INCFLAG='-I $(READLINE_DIR)' +fi - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + + +# Generate jit-reader.h + +# This is typedeffed to GDB_CORE_ADDR in jit-reader.h +TARGET_PTR= + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 +$as_echo_n "checking size of unsigned long long... " >&6; } +if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then : + $as_echo_n "(cached) " >&6 else - with_gnu_ld=no -fi + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then : -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 -$as_echo_n "checking for ld used by GCC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if test "${acl_cv_path_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi + if test "$ac_cv_type_unsigned_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (unsigned long long) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_unsigned_long_long=0 + fi fi -LD="$acl_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${acl_cv_prog_gnu_ld+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 +$as_echo_n "checking size of unsigned long... " >&6; } +if test "${ac_cv_sizeof_unsigned_long+set}" = set; then : $as_echo_n "(cached) " >&6 else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - acl_cv_prog_gnu_ld=yes + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : + else - acl_cv_prog_gnu_ld=no + if test "$ac_cv_type_unsigned_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (unsigned long) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_unsigned_long=0 + fi fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 -$as_echo "$acl_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$acl_cv_prog_gnu_ld +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 -$as_echo_n "checking for shared library run path origin... " >&6; } -if test "${acl_cv_rpath+set}" = set; then : +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned __int128" >&5 +$as_echo_n "checking size of unsigned __int128... " >&6; } +if test "${ac_cv_sizeof_unsigned___int128+set}" = set; then : $as_echo_n "(cached) " >&6 else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned __int128))" "ac_cv_sizeof_unsigned___int128" "$ac_includes_default"; then : - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 -$as_echo "$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; : else - enable_rpath=yes + if test "$ac_cv_type_unsigned___int128" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (unsigned __int128) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_unsigned___int128=0 + fi fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned___int128" >&5 +$as_echo "$ac_cv_sizeof_unsigned___int128" >&6; } +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED___INT128 $ac_cv_sizeof_unsigned___int128 +_ACEOF +if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then + TARGET_PTR="unsigned long" +elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then + TARGET_PTR="unsigned long long" +elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then + TARGET_PTR="unsigned __int128" +else + TARGET_PTR="unsigned long" +fi +ac_config_files="$ac_config_files jit-reader.h:jit-reader.in" - use_additional=yes - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if test "${ac_cv_search_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_dlopen+set}" = set; then : + break +fi +done +if test "${ac_cv_search_dlopen+set}" = set; then : - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +else + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +fi -# Check whether --with-libexpat-prefix was given. -if test "${with_libexpat_prefix+set}" = set; then : - withval=$with_libexpat_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" + + +# Check whether --with-jit-reader-dir was given. +if test "${with_jit_reader_dir+set}" = set; then : + withval=$with_jit_reader_dir; + JIT_READER_DIR=$withval +else + JIT_READER_DIR=${libdir}/gdb +fi + + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_dir=`eval echo $JIT_READER_DIR` + ac_define_dir=`eval echo $ac_define_dir` + +cat >>confdefs.h <<_ACEOF +#define JIT_READER_DIR "$ac_define_dir" +_ACEOF + + + + + if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + value=0 + case ${ac_define_dir} in + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + value=1 + ;; + esac + +cat >>confdefs.h <<_ACEOF +#define JIT_READER_DIR_RELOCATABLE $value +_ACEOF + + + + + +# Check whether --with-expat was given. +if test "${with_expat+set}" = set; then : + withval=$with_expat; +else + with_expat=auto +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use expat" >&5 +$as_echo_n "checking whether to use expat... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_expat" >&5 +$as_echo "$with_expat" >&6; } + +if test "${with_expat}" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: expat support disabled; some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: expat support disabled; some features may be unavailable." >&2;} + HAVE_LIBEXPAT=no +else + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libexpat-prefix was given. +if test "${with_libexpat_prefix+set}" = set; then : + withval=$with_libexpat_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" @@ -7938,6 +8867,10 @@ done fi fi +# --------------------- # +# Check for libpython. # +# --------------------- # + @@ -8472,15 +9405,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext $as_echo "${PYTHON_CFLAGS}" >&6; } fi - # On IRIX, type siginfo is not defined. Instead, sys/siginfo.h provides: - # #if _SGIAPI - # #define siginfo __siginfo - # #endif - # The problem is that including Python causes some XOPEN macros to be - # unilaterally defined, and that in turn causes _SGIAPI to evaluate - # to false. So, we work around this issue by defining siginfo ourself - # though the command-line. - # # On x64 Windows, Python's include headers, and pyconfig.h in # particular, rely on MS_WIN64 macro to detect that it's a 64bit # version of Windows. Unfortunately, MS_WIN64 is only defined if @@ -8490,10 +9414,6 @@ $as_echo "${PYTHON_CFLAGS}" >&6; } # solved as of 2012-10-02 (http://bugs.python.org/issue4709). case "$gdb_host" in - irix*) if test "${GCC}" = yes; then - CPPFLAGS="$CPPFLAGS -Dsiginfo=__siginfo" - fi - ;; mingw64) if test "${GCC}" = yes; then CPPFLAGS="$CPPFLAGS -DMS_WIN64" @@ -8529,1218 +9449,1328 @@ rm -f conftest.err conftest.$ac_ext $as_echo "${python_has_threads}" >&6; } CPPFLAGS="${saved_CPPFLAGS}" else - # Even if Python support is not compiled in, we need to have these files - # included. - CONFIG_OBS="$CONFIG_OBS python.o py-value.o py-prettyprint.o py-auto-load.o" - CONFIG_SRCS="$CONFIG_SRCS python/python.c python/py-value.c \ - python/py-prettyprint.c python/py-auto-load.c" + # Even if Python support is not compiled in, we need to have this file + # included so that the "python" command, et.al., still exists. + CONFIG_OBS="$CONFIG_OBS python.o" + CONFIG_SRCS="$CONFIG_SRCS python/python.c" fi - -# Provide a --enable-libmcheck/--disable-libmcheck set of options -# allowing a user to enable this option even when building releases, -# or to disable it when building a snapshot. -# Check whether --enable-libmcheck was given. -if test "${enable_libmcheck+set}" = set; then : - enableval=$enable_libmcheck; case "${enableval}" in - yes | y) ENABLE_LIBMCHECK="yes" ;; - no | n) ENABLE_LIBMCHECK="no" ;; - *) as_fn_error "bad value ${enableval} for --enable-libmcheck" "$LINENO" 5 ;; - esac + if test "${have_libpython}" != no; then + HAVE_PYTHON_TRUE= + HAVE_PYTHON_FALSE='#' +else + HAVE_PYTHON_TRUE='#' + HAVE_PYTHON_FALSE= fi -# Enable -lmcheck by default (it provides cheap-enough memory mangling), -# but turn it off if Python is enabled with threads, since -lmcheck is -# not thread safe (http://sourceware.org/bugzilla/show_bug.cgi?id=9939), -# and for releases. -if test -z "${ENABLE_LIBMCHECK}" \ - -a \( "${have_libpython}" = "no" \ - -o "${python_has_threads}" = "no" \) \ - && $development; then - ENABLE_LIBMCHECK=yes +# -------------------- # +# Check for libguile. # +# -------------------- # + + + + + + +# Check whether --with-guile was given. +if test "${with_guile+set}" = set; then : + withval=$with_guile; +else + with_guile=auto fi -if test "$ENABLE_LIBMCHECK" = "yes" ; then - if test "${have_libpython}" != "no" -a "${python_has_threads}" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&5 -$as_echo "$as_me: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&2;} - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmcheck" >&5 -$as_echo_n "checking for main in -lmcheck... " >&6; } -if test "${ac_cv_lib_mcheck_main+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use guile" >&5 +$as_echo_n "checking whether to use guile... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_guile" >&5 +$as_echo "$with_guile" >&6; } + +# Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_pkg_config_prog_path+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmcheck $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + case $pkg_config_prog_path in + [\\/]* | ?:[\\/]*) + ac_cv_path_pkg_config_prog_path="$pkg_config_prog_path" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_pkg_config_prog_path="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_pkg_config_prog_path" && ac_cv_path_pkg_config_prog_path="missing" + ;; +esac +fi +pkg_config_prog_path=$ac_cv_path_pkg_config_prog_path +if test -n "$pkg_config_prog_path"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pkg_config_prog_path" >&5 +$as_echo "$pkg_config_prog_path" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +try_guile_versions="guile-2.2 guile-2.0" +have_libguile=no +case "${with_guile}" in +no) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: guile support disabled; some features will be unavailable." >&5 +$as_echo "$as_me: WARNING: guile support disabled; some features will be unavailable." >&2;} + ;; +auto) + if test "${pkg_config_prog_path}" = "missing"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config not found, guile support disabled" >&5 +$as_echo "$as_me: WARNING: pkg-config not found, guile support disabled" >&2;} + else + pkg_config=${pkg_config_prog_path} + guile_version_list=${try_guile_versions} + flag_errors=no + found_usable_guile=checking + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable guile from ${pkg_config}" >&5 +$as_echo_n "checking for usable guile from ${pkg_config}... " >&6; } + for guile_version in ${guile_version_list}; do + ${pkg_config} --exists ${guile_version} 2>/dev/null + if test $? != 0; then + continue + fi + new_CPPFLAGS=`${pkg_config} --cflags ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --cflags ${guile_version}" "$LINENO" 5 + fi + new_LIBS=`${pkg_config} --libs ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --libs ${guile_version}" "$LINENO" 5 + fi + found_usable_guile=${guile_version} + break + done + if test "${found_usable_guile}" = "checking"; then + if test "${flag_errors}" = "yes"; then + as_fn_error "unable to find usable guile version from \"${guile_version_list}\"" "$LINENO" 5 + else + found_usable_guile=no + fi + fi + if test "${found_usable_guile}" != no; then + save_CPPFLAGS=$CPPFLAGS + save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" + LIBS="$LIBS $new_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "libguile.h" int main () { -return main (); +scm_init_guile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mcheck_main=yes + have_libguile=yes + GUILE_CPPFLAGS=$new_CPPFLAGS + GUILE_LIBS=$new_LIBS else - ac_cv_lib_mcheck_main=no + found_usable_guile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mcheck_main" >&5 -$as_echo "$ac_cv_lib_mcheck_main" >&6; } -if test "x$ac_cv_lib_mcheck_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMCHECK 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled" +if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = x""yes; then : - LIBS="-lmcheck $LIBS" +$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h -fi fi -# ------------------------- # -# Checks for header files. # -# ------------------------- # + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS + if test "${found_usable_guile}" = no; then + if test "${flag_errors}" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "linking guile version ${guile_version} test program failed +See \`config.log' for more details." "$LINENO" 5; } + fi + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_guile}" >&5 +$as_echo "${found_usable_guile}" >&6; } -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> + fi + ;; +yes) + if test "${pkg_config_prog_path}" = "missing"; then + as_fn_error "pkg-config not found" "$LINENO" 5 + fi + pkg_config=${pkg_config_prog_path} + guile_version_list=${try_guile_versions} + flag_errors=yes + + found_usable_guile=checking + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable guile from ${pkg_config}" >&5 +$as_echo_n "checking for usable guile from ${pkg_config}... " >&6; } + for guile_version in ${guile_version_list}; do + ${pkg_config} --exists ${guile_version} 2>/dev/null + if test $? != 0; then + continue + fi + new_CPPFLAGS=`${pkg_config} --cflags ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --cflags ${guile_version}" "$LINENO" 5 + fi + new_LIBS=`${pkg_config} --libs ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --libs ${guile_version}" "$LINENO" 5 + fi + found_usable_guile=${guile_version} + break + done + if test "${found_usable_guile}" = "checking"; then + if test "${flag_errors}" = "yes"; then + as_fn_error "unable to find usable guile version from \"${guile_version_list}\"" "$LINENO" 5 + else + found_usable_guile=no + fi + fi + if test "${found_usable_guile}" != no; then + save_CPPFLAGS=$CPPFLAGS + save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" + LIBS="$LIBS $new_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "libguile.h" int main () { -if ((DIR *) 0) -return 0; +scm_init_guile (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" +if ac_fn_c_try_link "$LINENO"; then : + have_libguile=yes + GUILE_CPPFLAGS=$new_CPPFLAGS + GUILE_LIBS=$new_LIBS else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + found_usable_guile=no fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled" +if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = x""yes; then : + +$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h + -ac_header_dirent=$ac_hdr; break fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS + if test "${found_usable_guile}" = no; then + if test "${flag_errors}" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "linking guile version ${guile_version} test program failed +See \`config.log' for more details." "$LINENO" 5; } + fi + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_guile}" >&5 +$as_echo "${found_usable_guile}" >&6; } -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int + ;; +[\\/]* | ?:[\\/]*) + if test -x "${with_guile}"; then + + pkg_config=${with_guile} + guile_version_list=${try_guile_versions} + flag_errors=yes + + found_usable_guile=checking + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable guile from ${pkg_config}" >&5 +$as_echo_n "checking for usable guile from ${pkg_config}... " >&6; } + for guile_version in ${guile_version_list}; do + ${pkg_config} --exists ${guile_version} 2>/dev/null + if test $? != 0; then + continue + fi + new_CPPFLAGS=`${pkg_config} --cflags ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --cflags ${guile_version}" "$LINENO" 5 + fi + new_LIBS=`${pkg_config} --libs ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --libs ${guile_version}" "$LINENO" 5 + fi + found_usable_guile=${guile_version} + break + done + if test "${found_usable_guile}" = "checking"; then + if test "${flag_errors}" = "yes"; then + as_fn_error "unable to find usable guile version from \"${guile_version_list}\"" "$LINENO" 5 + else + found_usable_guile=no + fi + fi + if test "${found_usable_guile}" != no; then + save_CPPFLAGS=$CPPFLAGS + save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" + LIBS="$LIBS $new_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "libguile.h" +int main () { -return opendir (); +scm_init_guile (); ; return 0; } _ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res +if ac_fn_c_try_link "$LINENO"; then : + have_libguile=yes + GUILE_CPPFLAGS=$new_CPPFLAGS + GUILE_LIBS=$new_LIBS +else + found_usable_guile=no fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : + conftest$ac_exeext conftest.$ac_ext + ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled" +if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = x""yes; then : + +$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS + if test "${found_usable_guile}" = no; then + if test "${flag_errors}" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "linking guile version ${guile_version} test program failed +See \`config.log' for more details." "$LINENO" 5; } + fi + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_guile}" >&5 +$as_echo "${found_usable_guile}" >&6; } -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); + else + as_fn_error "Guile config program not executable: ${with_guile}" "$LINENO" 5 + fi + ;; +"" | */*) + # Disallow --with=guile="" and --with-guile=foo/bar. + as_fn_error "invalid value for --with-guile" "$LINENO" 5 + ;; +*) + # A space separate list of guile versions to try, in order. + if test "${pkg_config_prog_path}" = "missing"; then + as_fn_error "pkg-config not found" "$LINENO" 5 + fi + + pkg_config=${pkg_config_prog_path} + guile_version_list=${with_guile} + flag_errors=yes + + found_usable_guile=checking + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable guile from ${pkg_config}" >&5 +$as_echo_n "checking for usable guile from ${pkg_config}... " >&6; } + for guile_version in ${guile_version_list}; do + ${pkg_config} --exists ${guile_version} 2>/dev/null + if test $? != 0; then + continue + fi + new_CPPFLAGS=`${pkg_config} --cflags ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --cflags ${guile_version}" "$LINENO" 5 + fi + new_LIBS=`${pkg_config} --libs ${guile_version}` + if test $? != 0; then + as_fn_error "failure running pkg-config --libs ${guile_version}" "$LINENO" 5 + fi + found_usable_guile=${guile_version} + break + done + if test "${found_usable_guile}" = "checking"; then + if test "${flag_errors}" = "yes"; then + as_fn_error "unable to find usable guile version from \"${guile_version_list}\"" "$LINENO" 5 + else + found_usable_guile=no + fi + fi + if test "${found_usable_guile}" != no; then + save_CPPFLAGS=$CPPFLAGS + save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" + LIBS="$LIBS $new_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "libguile.h" int main () { -return opendir (); +scm_init_guile (); ; return 0; } _ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res +if ac_fn_c_try_link "$LINENO"; then : + have_libguile=yes + GUILE_CPPFLAGS=$new_CPPFLAGS + GUILE_LIBS=$new_LIBS +else + found_usable_guile=no fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : + conftest$ac_exeext conftest.$ac_ext + ac_fn_c_check_func "$LINENO" "scm_set_automatic_finalization_enabled" "ac_cv_func_scm_set_automatic_finalization_enabled" +if test "x$ac_cv_func_scm_set_automatic_finalization_enabled" = x""yes; then : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +$as_echo "#define HAVE_GUILE_MANUAL_FINALIZATION 1" >>confdefs.h -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS + if test "${found_usable_guile}" = no; then + if test "${flag_errors}" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "linking guile version ${guile_version} test program failed +See \`config.log' for more details." "$LINENO" 5; } + fi + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_guile}" >&5 +$as_echo "${found_usable_guile}" >&6; } + + ;; +esac + +if test "${have_libguile}" != no; then + case "${with_guile}" in + [\\/]* | ?:[\\/]*) + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the absolute file name of the 'guild' command" >&5 +$as_echo_n "checking for the absolute file name of the 'guild' command... " >&6; } +if test "${ac_cv_guild_program_name+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include + ac_cv_guild_program_name="`"${with_guile}" --variable guild "${guile_version}"`" -int -main () -{ + # In Guile up to 2.0.11 included, guile-2.0.pc would not define + # the 'guild' and 'bindir' variables. In that case, try to guess + # what the program name is, at the risk of getting it wrong if + # Guile was configured with '--program-suffix' or similar. + if test "x$ac_cv_guild_program_name" = "x"; then + guile_exec_prefix="`"${with_guile}" --variable exec_prefix "${guile_version}"`" + ac_cv_guild_program_name="$guile_exec_prefix/bin/guild" + fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_guild_program_name" >&5 +$as_echo "$ac_cv_guild_program_name" >&6; } -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + if ! "$ac_cv_guild_program_name" --version >&5 2>&5; then + as_fn_error "'$ac_cv_guild_program_name' appears to be unusable" "$LINENO" 5 + fi -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : + GUILD="$ac_cv_guild_program_name" + + + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the absolute file name of the 'guild' command" >&5 +$as_echo_n "checking for the absolute file name of the 'guild' command... " >&6; } +if test "${ac_cv_guild_program_name+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ac_cv_header_stdc=no -fi -rm -f conftest* + ac_cv_guild_program_name="`"${pkg_config_prog_path}" --variable guild "${guile_version}"`" + + # In Guile up to 2.0.11 included, guile-2.0.pc would not define + # the 'guild' and 'bindir' variables. In that case, try to guess + # what the program name is, at the risk of getting it wrong if + # Guile was configured with '--program-suffix' or similar. + if test "x$ac_cv_guild_program_name" = "x"; then + guile_exec_prefix="`"${pkg_config_prog_path}" --variable exec_prefix "${guile_version}"`" + ac_cv_guild_program_name="$guile_exec_prefix/bin/guild" + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_guild_program_name" >&5 +$as_echo "$ac_cv_guild_program_name" >&6; } -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + if ! "$ac_cv_guild_program_name" --version >&5 2>&5; then + as_fn_error "'$ac_cv_guild_program_name' appears to be unusable" "$LINENO" 5 + fi -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + GUILD="$ac_cv_guild_program_name" -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi + ;; + esac + + + if test "$cross_compiling" = no; then + GUILD_TARGET_FLAG= + else + GUILD_TARGET_FLAG="--target=$host" + fi + -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether guild supports this host" >&5 +$as_echo_n "checking whether guild supports this host... " >&6; } +if test "${ac_cv_guild_ok+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + echo "$ac_cv_guild_program_name compile $GUILD_TARGET_FLAG -o conftest.go $srcdir/guile/lib/gdb/support.scm" >&5 + if "$ac_cv_guild_program_name" compile $GUILD_TARGET_FLAG -o conftest.go "$srcdir/guile/lib/gdb/support.scm" >&5 2>&5; then + ac_cv_guild_ok=yes + else + ac_cv_guild_ok=no + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_guild_ok" >&5 +$as_echo "$ac_cv_guild_ok" >&6; } + if test "$ac_cv_guild_ok" = no; then + have_libguile=no + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling guile support" >&5 +$as_echo "$as_me: WARNING: disabling guile support" >&2;} + fi fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +if test "${have_libguile}" != no; then -fi +$as_echo "#define HAVE_GUILE 1" >>confdefs.h -# elf_hp.h is for HP/UX 64-bit shared library support. -for ac_header in nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \ - thread_db.h signal.h stddef.h \ - stdlib.h string.h memory.h strings.h sys/fault.h \ - sys/file.h sys/filio.h sys/ioctl.h sys/param.h \ - sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \ - sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \ - sys/types.h sys/wait.h wait.h termios.h termio.h \ - sgtty.h unistd.h elf_hp.h locale.h \ - dlfcn.h sys/socket.h sys/un.h linux/perf_event.h + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_GUILE_OBS)" + CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_GUILE_DEPS)" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_GUILE_SRCS)" + CONFIG_INSTALL="$CONFIG_INSTALL install-guile" + ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_GUILE_CFLAGS)" + + save_LIBS="$LIBS" + save_CPPFLAGS="$CPPFLAGS" + LIBS="$GUILE_LIBS" + CPPFLAGS="$GUILE_CPPFLAGS" + for ac_func in scm_new_smob do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : + ac_fn_c_check_func "$LINENO" "scm_new_smob" "ac_cv_func_scm_new_smob" +if test "x$ac_cv_func_scm_new_smob" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SCM_NEW_SMOB 1 _ACEOF fi - done -for ac_header in link.h -do : - ac_fn_c_check_header_compile "$LINENO" "link.h" "ac_cv_header_link_h" "#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NLIST_H -# include -#endif + LIBS="$save_LIBS" + CPPFLAGS="$save_CPPFLAGS" +else + # Even if Guile support is not compiled in, we need to have these files + # included. + CONFIG_OBS="$CONFIG_OBS guile.o" + CONFIG_SRCS="$CONFIG_SRCS guile/guile.c" +fi -" -if test "x$ac_cv_header_link_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINK_H 1 -_ACEOF + if test "${have_libguile}" != no; then + HAVE_GUILE_TRUE= + HAVE_GUILE_FALSE='#' +else + HAVE_GUILE_TRUE='#' + HAVE_GUILE_FALSE= fi -done -for ac_header in sys/proc.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" "#if HAVE_SYS_PARAM_H -# include -#endif +# --------------------- # +# Check for libmcheck. # +# --------------------- # -" -if test "x$ac_cv_header_sys_proc_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_PROC_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/user.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "#if HAVE_SYS_PARAM_H -# include -#endif - -" -if test "x$ac_cv_header_sys_user_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_USER_H 1 -_ACEOF - -fi - -done - - -# On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash -# between and that would cause AC_CHECK_HEADERS to -# think that we don't have if we're using GCC. -case $host_os in - solaris2.[789]) - if test "$GCC" = yes; then - -$as_echo "#define _MSE_INT_H 1" >>confdefs.h - - fi ;; -esac -for ac_header in curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in term.h -do : - ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "#if HAVE_CURSES_H -# include -#endif - -" -if test "x$ac_cv_header_term_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TERM_H 1 -_ACEOF - -fi - -done - - -# ------------------------- # -# Checks for declarations. # -# ------------------------- # - -ac_fn_c_check_decl "$LINENO" "free" "ac_cv_have_decl_free" "$ac_includes_default" -if test "x$ac_cv_have_decl_free" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "malloc" "ac_cv_have_decl_malloc" "$ac_includes_default" -if test "x$ac_cv_have_decl_malloc" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "realloc" "ac_cv_have_decl_realloc" "$ac_includes_default" -if test "x$ac_cv_have_decl_realloc" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_REALLOC $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default" -if test "x$ac_cv_have_decl_strerror" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default" -if test "x$ac_cv_have_decl_strstr" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRSTR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "getopt" "ac_cv_have_decl_getopt" "$ac_includes_default" -if test "x$ac_cv_have_decl_getopt" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETOPT $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" -if test "x$ac_cv_have_decl_snprintf" = x""yes; then : - ac_have_decl=1 +# Enable -lmcheck by default (it provides cheap-enough memory mangling), +# but turn it off if Python is enabled with threads, since -lmcheck is +# not thread safe (http://sourceware.org/bugzilla/show_bug.cgi?id=9939), +# and for releases. +if test \( "${have_libpython}" = "no" -o "${python_has_threads}" = "no" \) \ + && $development; then + libmcheck_default=yes else - ac_have_decl=0 + libmcheck_default=no fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SNPRINTF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default" -if test "x$ac_cv_have_decl_vsnprintf" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 + # Check whether --enable-libmcheck was given. +if test "${enable_libmcheck+set}" = set; then : + enableval=$enable_libmcheck; case "${enableval}" in + yes | y) ENABLE_LIBMCHECK="yes" ;; + no | n) ENABLE_LIBMCHECK="no" ;; + *) as_fn_error "bad value ${enableval} for --enable-libmcheck" "$LINENO" 5 ;; + esac fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VSNPRINTF $ac_have_decl -_ACEOF + if test -z "${ENABLE_LIBMCHECK}"; then + ENABLE_LIBMCHECK=${libmcheck_default} + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 -$as_echo_n "checking for LC_MESSAGES... " >&6; } -if test "${am_cv_val_LC_MESSAGES+set}" = set; then : + if test "$ENABLE_LIBMCHECK" = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmcheck" >&5 +$as_echo_n "checking for main in -lmcheck... " >&6; } +if test "${ac_cv_lib_mcheck_main+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmcheck $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + + int main () { -return LC_MESSAGES +return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - am_cv_val_LC_MESSAGES=yes + ac_cv_lib_mcheck_main=yes else - am_cv_val_LC_MESSAGES=no + ac_cv_lib_mcheck_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 -$as_echo "$am_cv_val_LC_MESSAGES" >&6; } - if test $am_cv_val_LC_MESSAGES = yes; then - -$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mcheck_main" >&5 +$as_echo "$ac_cv_lib_mcheck_main" >&6; } +if test "x$ac_cv_lib_mcheck_main" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMCHECK 1 +_ACEOF - fi + LIBS="-lmcheck $LIBS" +fi -# ----------------------- # -# Checks for structures. # -# ----------------------- # + fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLOCKS 1 -_ACEOF +if test "$ENABLE_LIBMCHECK" = "yes" \ + -a "${have_libpython}" != "no" \ + -a "${python_has_threads}" = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&5 +$as_echo "$as_me: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&2;} +fi +# Check whether --with-intel_pt was given. +if test "${with_intel_pt+set}" = set; then : + withval=$with_intel_pt; +else + with_intel_pt=auto fi -ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5 +$as_echo_n "checking whether to use intel pt... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5 +$as_echo "$with_intel_pt" >&6; } +if test "${with_intel_pt}" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel(R) Processor Trace support disabled; some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: Intel(R) Processor Trace support disabled; some features may be unavailable." >&2;} + HAVE_LIBIPT=no +else -fi -# ------------------ # -# Checks for types. # -# ------------------ # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF -ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include -#include + use_additional=yes -" -if test "x$ac_cv_type_socklen_t" = x""yes; then : + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" -cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKLEN_T 1 -_ACEOF + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -fi +# Check whether --with-libipt-prefix was given. +if test "${with_libipt_prefix+set}" = set; then : + withval=$with_libipt_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then -# ------------------------------------- # -# Checks for compiler characteristics. # -# ------------------------------------- # - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -$as_echo "#define const /**/" >>confdefs.h + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif + LIBIPT= + LTLIBIPT= + INCIPT= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='ipt ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBIPT="${LIBIPT}${LIBIPT:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBIPT; do -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBIPT="${LIBIPT}${LIBIPT:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBIPT="${LIBIPT}${LIBIPT:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBIPT="${LIBIPT}${LIBIPT:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBIPT; do -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBIPT="${LIBIPT}${LIBIPT:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBIPT="${LIBIPT}${LIBIPT:+ }$found_so" + else + LIBIPT="${LIBIPT}${LIBIPT:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBIPT="${LIBIPT}${LIBIPT:+ }$found_a" + else + LIBIPT="${LIBIPT}${LIBIPT:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCIPT; do -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCIPT="${INCIPT}${INCIPT:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBIPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBIPT="${LIBIPT}${LIBIPT:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBIPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBIPT="${LIBIPT}${LIBIPT:+ }$dep" + LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }$dep" + ;; + esac + done + fi + else + LIBIPT="${LIBIPT}${LIBIPT:+ }-l$name" + LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBIPT="${LIBIPT}${LIBIPT:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBIPT="${LIBIPT}${LIBIPT:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCIPT; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libipt" >&5 +$as_echo_n "checking for libipt... " >&6; } +if test "${ac_cv_libipt+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBIPT" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "intel-pt.h" int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - +pt_insn_alloc_decoder (0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_libipt=yes else - ac_cv_c_bigendian=no + ac_cv_libipt=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libipt" >&5 +$as_echo "$ac_cv_libipt" >&6; } + if test "$ac_cv_libipt" = yes; then + HAVE_LIBIPT=yes + +$as_echo "#define HAVE_LIBIPT 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libipt" >&5 +$as_echo_n "checking how to link with libipt... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBIPT" >&5 +$as_echo "$LIBIPT" >&6; } + else + HAVE_LIBIPT=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBIPT= + LTLIBIPT= + fi + + + + + + + if test "$HAVE_LIBIPT" != yes; then + if test "$with_intel_pt" = yes; then + as_fn_error "libipt is missing or unusable" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: libipt is missing or unusable; some features may be unavailable." >&2;} fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + fi +fi -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +# ------------------------- # +# Checks for header files. # +# ------------------------- # - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include +#include +#include +#include int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes + ac_cv_header_stdc=yes else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; +#include - ; - return 0; -} _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_header_stdc=no fi +rm -f conftest* - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h - - ;; #( - *) - as_fn_error "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac - - -# ------------------------------ # -# Checks for library functions. # -# ------------------------------ # -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then : - $as_echo_n "(cached) " >&6 -else +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - if (p) return 0; - ; - return 0; -} +#include + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_working_alloca_h=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + else - ac_cv_working_alloca_h=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_cv_header_stdc=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } -if test $ac_cv_working_alloca_h = yes; then - -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then : - $as_echo_n "(cached) " >&6 +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { -char *p = (char *) alloca (1); - if (p) return 0; - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_func_alloca_works=yes +if ac_fn_c_try_run "$LINENO"; then : + else - ac_cv_func_alloca_works=no + ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } -if test $ac_cv_func_alloca_works = yes; then +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +$as_echo "#define STDC_HEADERS 1" >>confdefs.h -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. +fi -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext +# elf_hp.h is for HP/UX 64-bit shared library support. +for ac_header in nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \ + thread_db.h \ + sys/fault.h \ + sys/file.h sys/filio.h sys/ioctl.h sys/param.h \ + sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \ + sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \ + termios.h termio.h \ + sgtty.h elf_hp.h \ + dlfcn.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -$as_echo "#define C_ALLOCA 1" >>confdefs.h +fi +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if test "${ac_cv_os_cray+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray +for ac_header in sys/proc.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" "#if HAVE_SYS_PARAM_H +# include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func +" +if test "x$ac_cv_header_sys_proc_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_PROC_H 1 _ACEOF - break fi - done -fi +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_c_stack_direction=0 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} +for ac_header in sys/user.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/user.h" "ac_cv_header_sys_user_h" "#if HAVE_SYS_PARAM_H +# include +#endif -int -main () -{ - return find_stack_direction () < 0; -} +" +if test "x$ac_cv_header_sys_user_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_USER_H 1 _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_stack_direction=1 -else - ac_cv_c_stack_direction=-1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +done -fi -for ac_header in stdlib.h unistd.h +# On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash +# between and that would cause AC_CHECK_HEADERS to +# think that we don't have if we're using GCC. +case $host_os in + solaris2.[789]) + if test "$GCC" = yes; then + +$as_echo "#define _MSE_INT_H 1" >>confdefs.h + + fi ;; +esac +for ac_header in curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -9754,637 +10784,638 @@ fi done -for ac_func in getpagesize +for ac_header in term.h do : - ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = x""yes; then : + ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "#if HAVE_CURSES_H +# include +#endif + +" +if test "x$ac_cv_header_term_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_GETPAGESIZE 1 +#define HAVE_TERM_H 1 _ACEOF fi + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 -$as_echo_n "checking for working mmap... " >&6; } -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : + +# ------------------------- # +# Checks for declarations. # +# ------------------------- # + + + # Check for presence and size of long long. + ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if test "${ac_cv_sizeof_long_long+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - ac_cv_func_mmap_fixed_mapped=no + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (long long) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long_long=0 + fi +fi -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ -#include -#include -#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H -char *malloc (); -#endif +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF -/* This mess was copied from the GNU getpagesize.h. */ -#ifndef HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# ifndef HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# ifdef HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ +fi -int -main () -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - pagesize = getpagesize (); + ac_fn_c_check_decl "$LINENO" "basename(char *)" "ac_cv_have_decl_basename_char_p_" "$ac_includes_default" +if test "x$ac_cv_have_decl_basename_char_p_" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - return 1; - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - return 1; - if (write (fd, data, pagesize) != pagesize) - return 1; - close (fd); +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_BASENAME $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "ffs" "ac_cv_have_decl_ffs" "$ac_includes_default" +if test "x$ac_cv_have_decl_ffs" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - return 1; - data2 = (char *) malloc (2 * pagesize); - if (!data2) - return 1; - data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - return 1; - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - return 1; +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "asprintf" "ac_cv_have_decl_asprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_asprintf" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - return 1; - if (read (fd, data3, pagesize) != pagesize) - return 1; - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - return 1; - close (fd); - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ASPRINTF $ac_have_decl _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_mmap_fixed_mapped=yes +ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_vasprintf" = x""yes; then : + ac_have_decl=1 else - ac_cv_func_mmap_fixed_mapped=no + ac_have_decl=0 fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VASPRINTF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_snprintf" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_vsnprintf" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 -$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } -if test $ac_cv_func_mmap_fixed_mapped = yes; then -$as_echo "#define HAVE_MMAP 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF $ac_have_decl +_ACEOF + ac_fn_c_check_decl "$LINENO" "strtol" "ac_cv_have_decl_strtol" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtol" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -rm -f conftest.mmap -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = x""yes; then : +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strtoul" "ac_cv_have_decl_strtoul" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoul" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOUL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoll" = x""yes; then : + ac_have_decl=1 else + ac_have_decl=0 +fi cat >>confdefs.h <<_ACEOF -#define pid_t int +#define HAVE_DECL_STRTOLL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoull" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOULL $ac_have_decl _ACEOF + ac_fn_c_check_decl "$LINENO" "strverscmp" "ac_cv_have_decl_strverscmp" "$ac_includes_default" +if test "x$ac_cv_have_decl_strverscmp" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRVERSCMP $ac_have_decl _ACEOF + + +ac_fn_c_check_decl "$LINENO" "free" "ac_cv_have_decl_free" "$ac_includes_default" +if test "x$ac_cv_have_decl_free" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -done +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "malloc" "ac_cv_have_decl_malloc" "$ac_includes_default" +if test "x$ac_cv_have_decl_malloc" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MALLOC $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "realloc" "ac_cv_have_decl_realloc" "$ac_includes_default" +if test "x$ac_cv_have_decl_realloc" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_REALLOC $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_snprintf" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -done -if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if test "${ac_cv_func_fork_works+set}" = set; then : +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF $ac_have_decl +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if test "${am_cv_val_LC_MESSAGES+set}" = set; then : $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include int main () { - - /* By Ruediger Kuhlmann. */ - return fork () < 0; - +return LC_MESSAGES ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_fork_works=yes +if ac_fn_c_try_link "$LINENO"; then : + am_cv_val_LC_MESSAGES=yes else - ac_cv_func_fork_works=no + am_cv_val_LC_MESSAGES=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 +$as_echo "$am_cv_val_LC_MESSAGES" >&6; } + if test $am_cv_val_LC_MESSAGES = yes; then + +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h + + fi + + +# ----------------------- # +# Checks for structures. # +# ----------------------- # + +ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +_ACEOF + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF + -else - ac_cv_func_fork_works=$ac_cv_func_fork fi -if test "x$ac_cv_func_fork_works" = xcross; then - case $host in - *-*-amigaos* | *-*-msdosdjgpp*) - # Override, as these systems have only a dummy fork() stub - ac_cv_func_fork_works=no - ;; - *) - ac_cv_func_fork_works=yes - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} -fi -ac_cv_func_vfork_works=$ac_cv_func_vfork -if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if test "${ac_cv_func_vfork_works+set}" = set; then : + + +# ------------------ # +# Checks for types. # +# ------------------ # + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if test "${ac_cv_type_signal+set}" = set; then : $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Thanks to Paul Eggert for this test. */ -$ac_includes_default -#include -#ifdef HAVE_VFORK_H -# include -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. The compiler - is told about this with #include , but some compilers - (e.g. gcc -O) don't grok . Test for this by using a - static variable whose address is put into a register that is - clobbered by the vfork. */ -static void -#ifdef __cplusplus -sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} +#include +#include int main () { - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (0); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. This - test uses lots of local variables, at least as many local - variables as main has allocated so far including compiler - temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris - 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should - reuse the register of parent for one of the local variables, - since it will think that parent can't possibly be used any more - in this routine. Assigning to the local variable will thus - munge parent in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent - from child file descriptors. If the child closes a descriptor - before it execs or exits, this munges the parent's descriptor - as well. Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - return ( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } +return *(signal (0, 0)) (0) == 1; + ; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_vfork_works=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int else - ac_cv_func_vfork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - + ac_cv_type_signal=void fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } - -fi; -if test "x$ac_cv_func_fork_works" = xcross; then - ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } -if test "x$ac_cv_func_vfork_works" = xyes; then +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h -else +ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include +#include -$as_echo "#define vfork fork" >>confdefs.h +" +if test "x$ac_cv_type_socklen_t" = x""yes; then : -fi -if test "x$ac_cv_func_fork_works" = xyes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_SOCKLEN_T 1 +_ACEOF -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi -for ac_func in canonicalize_file_name realpath getrusage getuid getgid \ - pipe poll pread pread64 pwrite readlink resize_term \ - sbrk setpgid setpgrp setsid \ - sigaction sigprocmask sigsetmask socketpair syscall \ - ttrace wborder wresize setlocale iconvlist libiconvlist btowc \ - setrlimit getrlimit posix_madvise waitpid lstat -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done +# ------------------------------------- # +# Checks for compiler characteristics. # +# ------------------------------------- # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 -$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } -if test "${am_cv_langinfo_codeset+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + int main () { -char* cs = nl_langinfo(CODESET); +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_langinfo_codeset=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes else - am_cv_langinfo_codeset=no + ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 -$as_echo "$am_cv_langinfo_codeset" >&6; } - if test $am_cv_langinfo_codeset = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then -$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h +$as_echo "#define const /**/" >>confdefs.h - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif -# Check the return and argument types of ptrace. No canned test for -# this, so roll our own. -gdb_ptrace_headers=' -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_PTRACE_H -# include -#endif -#if HAVE_UNISTD_H -# include -#endif -' -# There is no point in checking if we don't have a prototype. -ac_fn_c_check_decl "$LINENO" "ptrace" "ac_cv_have_decl_ptrace" "$gdb_ptrace_headers -" -if test "x$ac_cv_have_decl_ptrace" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE $ac_have_decl +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif _ACEOF -if test $ac_have_decl = 1; then : + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; - : ${gdb_cv_func_ptrace_ret='int'} - : ${gdb_cv_func_ptrace_args='int,int,long,long'} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi - -# Check return type. Varargs (used on GNU/Linux) conflict with the -# empty argument list, so check for that explicitly. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of ptrace" >&5 -$as_echo_n "checking return type of ptrace... " >&6; } -if test "${gdb_cv_func_ptrace_ret+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$gdb_ptrace_headers +#include + #include + int main () { -extern long ptrace (enum __ptrace_request, ...); +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_func_ptrace_ret='long' -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$gdb_ptrace_headers +#include + #include + int main () { -extern int ptrace (); +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_func_ptrace_ret='int' + ac_cv_c_bigendian=yes else - gdb_cv_func_ptrace_ret='long' + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_ret" >&5 -$as_echo "$gdb_cv_func_ptrace_ret" >&6; } - -cat >>confdefs.h <<_ACEOF -#define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret -_ACEOF - -# Check argument types. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for ptrace" >&5 -$as_echo_n "checking types of arguments for ptrace... " >&6; } -if test "${gdb_cv_func_ptrace_args+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$gdb_ptrace_headers +#include + int main () { -extern long ptrace (enum __ptrace_request, ...); +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_func_ptrace_args='int,int,long,long' -else - -for gdb_arg1 in 'int' 'long'; do - for gdb_arg2 in 'pid_t' 'int' 'long'; do - for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do - for gdb_arg4 in 'int' 'long'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$gdb_ptrace_headers +#include + int main () { - -extern $gdb_cv_func_ptrace_ret - ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4); +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4"; - break 4; + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - for gdb_arg5 in 'int *' 'int' 'long'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$gdb_ptrace_headers +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { - -extern $gdb_cv_func_ptrace_ret - ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5); - +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - -gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5"; - break 5; -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done - done - done - done -done -# Provide a safe default value. -: ${gdb_cv_func_ptrace_args='int,int,long,long'} - + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5 -$as_echo "$gdb_cv_func_ptrace_args" >&6; } -ac_save_IFS=$IFS; IFS=',' -set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'` -IFS=$ac_save_IFS -shift - -cat >>confdefs.h <<_ACEOF -#define PTRACE_TYPE_ARG3 $3 -_ACEOF - -if test -n "$5"; then - -cat >>confdefs.h <<_ACEOF -#define PTRACE_TYPE_ARG5 $5 -_ACEOF - -fi - -if test "$cross_compiling" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } -if test "${ac_cv_func_setpgrp_void+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - as_fn_error "cannot check setpgrp when cross compiling" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10392,2334 +11423,3327 @@ $ac_includes_default int main () { -/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - return setpgrp (1,1) != -1; + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_setpgrp_void=no + ac_cv_c_bigendian=no else - ac_cv_func_setpgrp_void=yes + ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } -if test $ac_cv_func_setpgrp_void = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -$as_echo "#define SETPGRP_VOID 1" >>confdefs.h +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# ------------------------------ # +# Checks for library functions. # +# ------------------------------ # + +for ac_header in stdlib.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } -if test "${ac_cv_func_setpgrp_void+set}" = set; then : +done + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc -#include +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +/* Assume that all systems that can run configure have sys/param.h. */ +# ifndef HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ int main () { + char *data, *data2, *data3; + int i, pagesize; + int fd; - if (setpgrp(1,1) == -1) - exit (0); - else - exit (1); + pagesize = getpagesize (); - ; + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 1; + if (write (fd, data, pagesize) != pagesize) + return 1; + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 1; + data2 = (char *) malloc (2 * pagesize); + if (!data2) + return 1; + data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 1; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 1; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 1; + if (read (fd, data3, pagesize) != pagesize) + return 1; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 1; + close (fd); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_func_setpgrp_void=no +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes else - ac_cv_func_setpgrp_void=yes + ac_cv_func_mmap_fixed_mapped=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } -if test $ac_cv_func_setpgrp_void = yes; then - $as_echo "#define SETPGRP_VOID 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + fi +rm -f conftest.mmap -# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do -# since sigsetjmp might only be defined as a macro. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 -$as_echo_n "checking for sigsetjmp... " >&6; } -if test "${gdb_cv_func_sigsetjmp+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = x""yes; then : -#include +else -int -main () -{ -sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define pid_t int _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_func_sigsetjmp=yes -else - gdb_cv_func_sigsetjmp=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5 -$as_echo "$gdb_cv_func_sigsetjmp" >&6; } -if test $gdb_cv_func_sigsetjmp = yes; then -$as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h +for ac_header in vfork.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VFORK_H 1 +_ACEOF fi -# Assume we'll default to using the included libiberty regex. -gdb_use_included_regex=yes +done -# However, if the system regex is GNU regex, then default to *not* -# using the included regex. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU regex" >&5 -$as_echo_n "checking for GNU regex... " >&6; } -if test "${gdb_cv_have_gnu_regex+set}" = set; then : +for ac_func in fork vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if test "${ac_cv_func_fork_works+set}" = set; then : $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +$ac_includes_default int main () { -#define REGEX_INTERFACE_VERSION 1 -#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION -# error "Version mismatch" -#endif + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_gnu_regex=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes else - gdb_cv_have_gnu_regex=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_func_fork_works=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_gnu_regex" >&5 -$as_echo "$gdb_cv_have_gnu_regex" >&6; } -if test $gdb_cv_have_gnu_regex = yes; then - gdb_use_included_regex=no +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } -# Check whether --with-included-regex was given. -if test "${with_included_regex+set}" = set; then : - withval=$with_included_regex; gdb_with_regex=$withval else - gdb_with_regex=$gdb_use_included_regex + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if test "${ac_cv_func_vfork_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#ifdef HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} -if test "$gdb_with_regex" = yes; then +int +main () +{ + pid_t parent = getpid (); + pid_t child; -$as_echo "#define USE_INCLUDED_REGEX 1" >>confdefs.h + sparc_address_test (0); -fi + child = vfork (); -# Check if defines `struct thread' with a td_pcb member. -ac_fn_c_check_member "$LINENO" "struct thread" "td_pcb" "ac_cv_member_struct_thread_td_pcb" "#include -#include + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); -" -if test "x$ac_cv_member_struct_thread_td_pcb" = x""yes; then : + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_THREAD_TD_PCB 1 + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes +else + ac_cv_func_vfork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi +if test "x$ac_cv_func_vfork_works" = xyes; then + +$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h -# See if defines `struct lwp`. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct lwp" >&5 -$as_echo_n "checking for struct lwp... " >&6; } -if test "${gdb_cv_struct_lwp+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -struct lwp l; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_struct_lwp=yes else - gdb_cv_struct_lwp=no + +$as_echo "#define vfork fork" >>confdefs.h + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x$ac_cv_func_fork_works" = xyes; then + +$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_lwp" >&5 -$as_echo "$gdb_cv_struct_lwp" >&6; } -if test $gdb_cv_struct_lwp = yes; then -$as_echo "#define HAVE_STRUCT_LWP 1" >>confdefs.h +for ac_func in getauxval getrusage getuid getgid \ + pipe poll pread pread64 pwrite resize_term \ + sbrk setpgid setpgrp setsid \ + sigaction sigprocmask sigsetmask socketpair \ + ttrace wborder wresize setlocale iconvlist libiconvlist btowc \ + setrlimit getrlimit posix_madvise waitpid \ + ptrace64 sigaltstack mkdtemp setns +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi +done -# See if degines `struct reg'. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct reg in machine/reg.h" >&5 -$as_echo_n "checking for struct reg in machine/reg.h... " >&6; } -if test "${gdb_cv_struct_reg+set}" = set; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if test "${am_cv_langinfo_codeset+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include +#include int main () { -struct reg r; +char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_struct_reg=yes -else - gdb_cv_struct_reg=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_reg" >&5 -$as_echo "$gdb_cv_struct_reg" >&6; } -if test $gdb_cv_struct_reg = yes; then - -$as_echo "#define HAVE_STRUCT_REG 1" >>confdefs.h - -fi - -# See if supports the %fs and %gs i386 segment registers. -# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. -ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include -" -if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_REG_R_FS 1 -_ACEOF - - -fi -ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include -" -if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_REG_R_GS 1 -_ACEOF - - +if ac_fn_c_try_link "$LINENO"; then : + am_cv_langinfo_codeset=yes +else + am_cv_langinfo_codeset=no fi - - -# See if supports the %fs_base and %gs_bas amd64 segment registers. -# Older amd64 Linux's don't have the fs_base and gs_base members of -# `struct user_regs_struct'. -ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "fs_base" "ac_cv_member_struct_user_regs_struct_fs_base" "#include -" -if test "x$ac_cv_member_struct_user_regs_struct_fs_base" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE 1 -_ACEOF - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "gs_base" "ac_cv_member_struct_user_regs_struct_gs_base" "#include -" -if test "x$ac_cv_member_struct_user_regs_struct_gs_base" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h -fi + fi -# See if provides the PTRACE_GETREGS request. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETREGS" >&5 -$as_echo_n "checking for PTRACE_GETREGS... " >&6; } -if test "${gdb_cv_have_ptrace_getregs+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include +#include +#include +#include + int main () { -PTRACE_GETREGS; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_ptrace_getregs=yes + ac_cv_header_stdc=yes else - gdb_cv_have_ptrace_getregs=no + ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no fi +rm -f conftest* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getregs" >&5 -$as_echo "$gdb_cv_have_ptrace_getregs" >&6; } -if test $gdb_cv_have_ptrace_getregs = yes; then +fi -$as_echo "#define HAVE_PTRACE_GETREGS 1" >>confdefs.h +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* fi -# See if provides the PTRACE_GETFPXREGS request. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETFPXREGS" >&5 -$as_echo_n "checking for PTRACE_GETFPXREGS... " >&6; } -if test "${gdb_cv_have_ptrace_getfpxregs+set}" = set; then : - $as_echo_n "(cached) " >&6 +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { -PTRACE_GETFPXREGS; - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_ptrace_getfpxregs=yes +if ac_fn_c_try_run "$LINENO"; then : + else - gdb_cv_have_ptrace_getfpxregs=no + ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getfpxregs" >&5 -$as_echo "$gdb_cv_have_ptrace_getfpxregs" >&6; } -if test $gdb_cv_have_ptrace_getfpxregs = yes; then +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then -$as_echo "#define HAVE_PTRACE_GETFPXREGS 1" >>confdefs.h +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi -# See if provides the PT_GETDBREGS request. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETDBREGS" >&5 -$as_echo_n "checking for PT_GETDBREGS... " >&6; } -if test "${gdb_cv_have_pt_getdbregs+set}" = set; then : + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if test "${ac_cv_working_alloca_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include +#include int main () { -PT_GETDBREGS; +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_pt_getdbregs=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes else - gdb_cv_have_pt_getdbregs=no + ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getdbregs" >&5 -$as_echo "$gdb_cv_have_pt_getdbregs" >&6; } -if test $gdb_cv_have_pt_getdbregs = yes; then - -$as_echo "#define HAVE_PT_GETDBREGS 1" >>confdefs.h +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -# See if provides the PT_GETXMMREGS request. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETXMMREGS" >&5 -$as_echo_n "checking for PT_GETXMMREGS... " >&6; } -if test "${gdb_cv_have_pt_getxmmregs+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if test "${ac_cv_func_alloca_works+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + int main () { -PT_GETXMMREGS; +char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_pt_getxmmregs=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes else - gdb_cv_have_pt_getxmmregs=no + ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getxmmregs" >&5 -$as_echo "$gdb_cv_have_pt_getxmmregs" >&6; } -if test $gdb_cv_have_pt_getxmmregs = yes; then +if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_PT_GETXMMREGS 1" >>confdefs.h +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h -fi +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. -# Detect which type of /proc is in use, such as for Solaris. +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -if test "${target}" = "${host}"; then - case "${host}" in - *-*-sysv4.2* | *-*-sysv5* | *-*-interix* ) - -$as_echo "#define NEW_PROC_API 1" >>confdefs.h - - ;; - *-*-solaris2.[6789] | *-*-solaris2.1[0-9]*) - -$as_echo "#define NEW_PROC_API 1" >>confdefs.h - - ;; - mips-sgi-irix5*) - # Work around needing _KMEMUSER problem on IRIX 5. - -$as_echo "#define _KMEMUSER 1" >>confdefs.h +$as_echo "#define C_ALLOCA 1" >>confdefs.h - ;; - esac -fi -if test "$ac_cv_header_sys_procfs_h" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pstatus_t in sys/procfs.h" >&5 -$as_echo_n "checking for pstatus_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_pstatus_t+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if test "${ac_cv_os_cray+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -pstatus_t avar - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_pstatus_t=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes else - bfd_cv_have_sys_procfs_type_pstatus_t=no - + ac_cv_os_cray=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest* + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : - if test $bfd_cv_have_sys_procfs_type_pstatus_t = yes; then +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF -$as_echo "#define HAVE_PSTATUS_T 1" >>confdefs.h + break +fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_pstatus_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_pstatus_t" >&6; } + done +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prrun_t in sys/procfs.h" >&5 -$as_echo_n "checking for prrun_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_prrun_t+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if test "${ac_cv_c_stack_direction+set}" = set; then : $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include int main () { -prrun_t avar - ; - return 0; + return find_stack_direction () < 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prrun_t=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 else - bfd_cv_have_sys_procfs_type_prrun_t=no - + ac_cv_c_stack_direction=-1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF - if test $bfd_cv_have_sys_procfs_type_prrun_t = yes; then -$as_echo "#define HAVE_PRRUN_T 1" >>confdefs.h +fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prrun_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_prrun_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5 -$as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_gregset_t+set}" = set; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if test "${am_cv_langinfo_codeset+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +#include int main () { -gregset_t avar +char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_gregset_t=yes +if ac_fn_c_try_link "$LINENO"; then : + am_cv_langinfo_codeset=yes else - bfd_cv_have_sys_procfs_type_gregset_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_langinfo_codeset=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - if test $bfd_cv_have_sys_procfs_type_gregset_t = yes; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then -$as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; } + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5 -$as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_fpregset_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -fpregset_t avar - ; - return 0; -} + for ac_header in linux/perf_event.h locale.h memory.h signal.h sys/resource.h sys/socket.h sys/syscall.h sys/un.h sys/wait.h thread_db.h wait.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_fpregset_t=yes -else - bfd_cv_have_sys_procfs_type_fpregset_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then +done -$as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; } + for ac_func in fdwalk getrlimit pipe pipe2 socketpair +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5 -$as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_prgregset_t+set}" = set; then : - $as_echo_n "(cached) " >&6 +fi +done + + + ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror" = x""yes; then : + ac_have_decl=1 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_have_decl=0 +fi -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -prgregset_t avar - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR $ac_have_decl _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prgregset_t=yes +ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default" +if test "x$ac_cv_have_decl_strstr" = x""yes; then : + ac_have_decl=1 else - bfd_cv_have_sys_procfs_type_prgregset_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_have_decl=0 fi - if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then - -$as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRSTR $ac_have_decl +_ACEOF - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5 -$as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_prfpregset_t+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 +$as_echo_n "checking for sigsetjmp... " >&6; } +if test "${gdb_cv_func_sigsetjmp+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +#include + int main () { -prfpregset_t avar +sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prfpregset_t=yes + gdb_cv_func_sigsetjmp=yes else - bfd_cv_have_sys_procfs_type_prfpregset_t=no - + gdb_cv_func_sigsetjmp=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5 +$as_echo "$gdb_cv_func_sigsetjmp" >&6; } +if test $gdb_cv_func_sigsetjmp = yes; then - if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then +$as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h -$as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h +fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5 -$as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_prgregset32_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +# Check the return and argument types of ptrace. -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -prgregset32_t avar - ; - return 0; -} + + +for ac_header in sys/ptrace.h ptrace.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prgregset32_t=yes -else - bfd_cv_have_sys_procfs_type_prgregset32_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then +done -$as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; } +# Needs to be tested in C++ mode, to detect whether we need to cast +# the first argument to enum __ptrace_request. +if test "$enable_build_with_cxx" = "yes"; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset32_t in sys/procfs.h" >&5 -$as_echo_n "checking for prfpregset32_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_prfpregset32_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -prfpregset32_t avar - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prfpregset32_t=yes +gdb_ptrace_headers=' +#include +#if HAVE_SYS_PTRACE_H +# include +#endif +#if HAVE_UNISTD_H +# include +#endif +' +# There is no point in checking if we don't have a prototype. +ac_fn_cxx_check_decl "$LINENO" "ptrace" "ac_cv_have_decl_ptrace" "$gdb_ptrace_headers +" +if test "x$ac_cv_have_decl_ptrace" = x""yes; then : + ac_have_decl=1 else - bfd_cv_have_sys_procfs_type_prfpregset32_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_have_decl=0 fi - if test $bfd_cv_have_sys_procfs_type_prfpregset32_t = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : -$as_echo "#define HAVE_PRFPREGSET32_T 1" >>confdefs.h +else - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset32_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_prfpregset32_t" >&6; } + : ${gdb_cv_func_ptrace_ret='int'} + : ${gdb_cv_func_ptrace_args='int,int,long,long'} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5 -$as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_lwpid_t+set}" = set; then : +fi + +# Check return type. Varargs (used on GNU/Linux) conflict with the +# empty argument list, so check for that explicitly. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of ptrace" >&5 +$as_echo_n "checking return type of ptrace... " >&6; } +if test "${gdb_cv_func_ptrace_ret+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +$gdb_ptrace_headers int main () { -lwpid_t avar +extern long ptrace (enum __ptrace_request, ...); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_lwpid_t=yes -else - bfd_cv_have_sys_procfs_type_lwpid_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then - -$as_echo "#define HAVE_LWPID_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5 -$as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_psaddr_t+set}" = set; then : - $as_echo_n "(cached) " >&6 +if ac_fn_cxx_try_compile "$LINENO"; then : + gdb_cv_func_ptrace_ret='long' else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +$gdb_ptrace_headers int main () { -psaddr_t avar +extern int ptrace (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_psaddr_t=yes +if ac_fn_cxx_try_compile "$LINENO"; then : + gdb_cv_func_ptrace_ret='int' else - bfd_cv_have_sys_procfs_type_psaddr_t=no - + gdb_cv_func_ptrace_ret='long' fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_ret" >&5 +$as_echo "$gdb_cv_func_ptrace_ret" >&6; } - if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then - -$as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; } +cat >>confdefs.h <<_ACEOF +#define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prsysent_t in sys/procfs.h" >&5 -$as_echo_n "checking for prsysent_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_prsysent_t+set}" = set; then : +# Check argument types. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for ptrace" >&5 +$as_echo_n "checking types of arguments for ptrace... " >&6; } +if test "${gdb_cv_func_ptrace_args+set}" = set; then : $as_echo_n "(cached) " >&6 else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +$gdb_ptrace_headers int main () { -prsysent_t avar +extern long ptrace (enum __ptrace_request, ...); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prsysent_t=yes +if ac_fn_cxx_try_compile "$LINENO"; then : + gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long' else - bfd_cv_have_sys_procfs_type_prsysent_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_prsysent_t = yes; then - -$as_echo "#define HAVE_PRSYSENT_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prsysent_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_prsysent_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pr_sigset_t in sys/procfs.h" >&5 -$as_echo_n "checking for pr_sigset_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_pr_sigset_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +for gdb_arg1 in 'int' 'long'; do + for gdb_arg2 in 'pid_t' 'int' 'long'; do + for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do + for gdb_arg4 in 'int' 'long' 'void *'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +$gdb_ptrace_headers int main () { -pr_sigset_t avar + +extern $gdb_cv_func_ptrace_ret + ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4); + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_pr_sigset_t=yes -else - bfd_cv_have_sys_procfs_type_pr_sigset_t=no - +if ac_fn_cxx_try_compile "$LINENO"; then : + gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4"; + break 4; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_pr_sigset_t = yes; then - -$as_echo "#define HAVE_PR_SIGSET_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_pr_sigset_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_pr_sigset_t" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pr_sigaction64_t in sys/procfs.h" >&5 -$as_echo_n "checking for pr_sigaction64_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_pr_sigaction64_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + for gdb_arg5 in 'int *' 'int' 'long'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +$gdb_ptrace_headers int main () { -pr_sigaction64_t avar + +extern $gdb_cv_func_ptrace_ret + ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5); + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes -else - bfd_cv_have_sys_procfs_type_pr_sigaction64_t=no +if ac_fn_cxx_try_compile "$LINENO"; then : +gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5"; + break 5; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_pr_sigaction64_t = yes; then - -$as_echo "#define HAVE_PR_SIGACTION64_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_pr_sigaction64_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pr_siginfo64_t in sys/procfs.h" >&5 -$as_echo_n "checking for pr_siginfo64_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_pr_siginfo64_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -pr_siginfo64_t avar - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes -else - bfd_cv_have_sys_procfs_type_pr_siginfo64_t=no + done + done + done + done +done +# Provide a safe default value. +: ${gdb_cv_func_ptrace_args='int,int,long,long'} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5 +$as_echo "$gdb_cv_func_ptrace_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift - if test $bfd_cv_have_sys_procfs_type_pr_siginfo64_t = yes; then +cat >>confdefs.h <<_ACEOF +#define PTRACE_TYPE_ARG1 $1 +_ACEOF -$as_echo "#define HAVE_PR_SIGINFO64_T 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_pr_siginfo64_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_pr_siginfo64_t" >&6; } +cat >>confdefs.h <<_ACEOF +#define PTRACE_TYPE_ARG3 $3 +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PTRACE_TYPE_ARG4 $4 +_ACEOF +if test -n "$5"; then +cat >>confdefs.h <<_ACEOF +#define PTRACE_TYPE_ARG5 $5 +_ACEOF +fi - if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether prfpregset_t type is broken" >&5 -$as_echo_n "checking whether prfpregset_t type is broken... " >&6; } - if test "${gdb_cv_prfpregset_t_broken+set}" = set; then : +if test "$enable_build_with_cxx" = "yes"; then + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi + + +if test "$cross_compiling" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 +$as_echo_n "checking whether setpgrp takes no argument... " >&6; } +if test "${ac_cv_func_setpgrp_void+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - gdb_cv_prfpregset_t_broken=yes + as_fn_error "cannot check setpgrp when cross compiling" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - int main () - { - if (sizeof (prfpregset_t) == sizeof (void *)) - return 1; - return 0; - } +$ac_includes_default +int +main () +{ +/* If this system has a BSD-style setpgrp which takes arguments, + setpgrp(1, 1) will fail with ESRCH and return -1, in that case + exit successfully. */ + return setpgrp (1,1) != -1; + ; + return 0; +} _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gdb_cv_prfpregset_t_broken=no + ac_cv_func_setpgrp_void=no else - gdb_cv_prfpregset_t_broken=yes + ac_cv_func_setpgrp_void=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 +$as_echo "$ac_cv_func_setpgrp_void" >&6; } +if test $ac_cv_func_setpgrp_void = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_prfpregset_t_broken" >&5 -$as_echo "$gdb_cv_prfpregset_t_broken" >&6; } - if test $gdb_cv_prfpregset_t_broken = yes; then - -$as_echo "#define PRFPREGSET_T_BROKEN 1" >>confdefs.h - - fi - fi +$as_echo "#define SETPGRP_VOID 1" >>confdefs.h +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 -$as_echo_n "checking for PIOCSET ioctl entry in sys/procfs.h... " >&6; } - if test "${gdb_cv_have_procfs_piocset+set}" = set; then : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 +$as_echo_n "checking whether setpgrp takes no argument... " >&6; } +if test "${ac_cv_func_setpgrp_void+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include -#include -#include int main () { - int dummy;; - dummy = ioctl(0, PIOCSET, &dummy); + if (setpgrp(1,1) == -1) + exit (0); + else + exit (1); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_procfs_piocset=yes + ac_cv_func_setpgrp_void=no else - gdb_cv_have_procfs_piocset=no + ac_cv_func_setpgrp_void=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 +$as_echo "$ac_cv_func_setpgrp_void" >&6; } +if test $ac_cv_func_setpgrp_void = yes; then + $as_echo "#define SETPGRP_VOID 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_procfs_piocset" >&5 -$as_echo "$gdb_cv_have_procfs_piocset" >&6; } - if test $gdb_cv_have_procfs_piocset = yes; then - -$as_echo "#define HAVE_PROCFS_PIOCSET 1" >>confdefs.h - - fi +fi fi -if test ${host} = ${target} ; then +# Assume we'll default to using the included libiberty regex. +gdb_use_included_regex=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for member l_addr in struct link_map" >&5 -$as_echo_n "checking for member l_addr in struct link_map... " >&6; } - if test "${gdb_cv_have_struct_link_map_with_l_members+set}" = set; then : +# However, if the system regex is GNU regex, then default to *not* +# using the included regex. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU regex" >&5 +$as_echo_n "checking for GNU regex... " >&6; } +if test "${gdb_cv_have_gnu_regex+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int main () { -struct link_map lm; (void) lm.l_addr; +#define REGEX_INTERFACE_VERSION 1 +#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION +# error "Version mismatch" +#endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_struct_link_map_with_l_members=yes + gdb_cv_have_gnu_regex=yes else - gdb_cv_have_struct_link_map_with_l_members=no + gdb_cv_have_gnu_regex=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_gnu_regex" >&5 +$as_echo "$gdb_cv_have_gnu_regex" >&6; } +if test $gdb_cv_have_gnu_regex = yes; then + gdb_use_included_regex=no +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_struct_link_map_with_l_members" >&5 -$as_echo "$gdb_cv_have_struct_link_map_with_l_members" >&6; } - if test $gdb_cv_have_struct_link_map_with_l_members = yes; then -$as_echo "#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1" >>confdefs.h +# Check whether --with-included-regex was given. +if test "${with_included_regex+set}" = set; then : + withval=$with_included_regex; gdb_with_regex=$withval +else + gdb_with_regex=$gdb_use_included_regex +fi - fi +if test "$gdb_with_regex" = yes; then +$as_echo "#define USE_INCLUDED_REGEX 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for member lm_addr in struct link_map" >&5 -$as_echo_n "checking for member lm_addr in struct link_map... " >&6; } - if test "${gdb_cv_have_struct_link_map_with_lm_members+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -struct link_map lm; (void) lm.lm_addr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_struct_link_map_with_lm_members=yes -else - gdb_cv_have_struct_link_map_with_lm_members=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_struct_link_map_with_lm_members" >&5 -$as_echo "$gdb_cv_have_struct_link_map_with_lm_members" >&6; } - if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then +# Check if defines `struct thread' with a td_pcb member. +ac_fn_c_check_member "$LINENO" "struct thread" "td_pcb" "ac_cv_member_struct_thread_td_pcb" "#include +#include -$as_echo "#define HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS 1" >>confdefs.h +" +if test "x$ac_cv_member_struct_thread_td_pcb" = x""yes; then : - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_THREAD_TD_PCB 1 +_ACEOF + + +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for member som_addr in struct so_map" >&5 -$as_echo_n "checking for member som_addr in struct so_map... " >&6; } - if test "${gdb_cv_have_struct_so_map_with_som_members+set}" = set; then : +# See if defines `struct lwp`. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct lwp" >&5 +$as_echo_n "checking for struct lwp... " >&6; } +if test "${gdb_cv_struct_lwp+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#ifdef HAVE_NLIST_H -#include -#endif -#include +#include +#include int main () { -struct so_map lm; (void) lm.som_addr; +struct lwp l; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_struct_so_map_with_som_members=yes + gdb_cv_struct_lwp=yes else - gdb_cv_have_struct_so_map_with_som_members=no + gdb_cv_struct_lwp=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_lwp" >&5 +$as_echo "$gdb_cv_struct_lwp" >&6; } +if test $gdb_cv_struct_lwp = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_struct_so_map_with_som_members" >&5 -$as_echo "$gdb_cv_have_struct_so_map_with_som_members" >&6; } - if test $gdb_cv_have_struct_so_map_with_som_members = yes; then - -$as_echo "#define HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS 1" >>confdefs.h - - fi +$as_echo "#define HAVE_STRUCT_LWP 1" >>confdefs.h +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct link_map32 in sys/link.h" >&5 -$as_echo_n "checking for struct link_map32 in sys/link.h... " >&6; } - if test "${gdb_cv_have_struct_link_map32+set}" = set; then : +# See if degines `struct reg'. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct reg in machine/reg.h" >&5 +$as_echo_n "checking for struct reg in machine/reg.h... " >&6; } +if test "${gdb_cv_struct_reg+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _SYSCALL32 -#include +#include +#include int main () { -struct link_map32 l; +struct reg r; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_struct_link_map32=yes + gdb_cv_struct_reg=yes else - gdb_cv_have_struct_link_map32=no + gdb_cv_struct_reg=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_reg" >&5 +$as_echo "$gdb_cv_struct_reg" >&6; } +if test $gdb_cv_struct_reg = yes; then + +$as_echo "#define HAVE_STRUCT_REG 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_struct_link_map32" >&5 -$as_echo "$gdb_cv_have_struct_link_map32" >&6; } - if test $gdb_cv_have_struct_link_map32 = yes; then +fi -$as_echo "#define HAVE_STRUCT_LINK_MAP32 1" >>confdefs.h +# See if supports the %fs and %gs i386 segment registers. +# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. +ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include +" +if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then : +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_REG_R_FS 1 +_ACEOF -$as_echo "#define _SYSCALL32 1" >>confdefs.h - fi fi +ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include +" +if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then : -# Check if the compiler supports the `long long' type. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in compiler" >&5 -$as_echo_n "checking for long long support in compiler... " >&6; } -if test "${gdb_cv_c_long_long+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -extern long long foo; -int -main () -{ -switch (foo & 2) { case 0: return 1; } - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_REG_R_GS 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_c_long_long=yes -else - gdb_cv_c_long_long=no + + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +# See if supports the %fs_base and %gs_bas amd64 segment registers. +# Older amd64 Linux's don't have the fs_base and gs_base members of +# `struct user_regs_struct'. +ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "fs_base" "ac_cv_member_struct_user_regs_struct_fs_base" "#include +" +if test "x$ac_cv_member_struct_user_regs_struct_fs_base" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE 1 +_ACEOF + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_long" >&5 -$as_echo "$gdb_cv_c_long_long" >&6; } -if test $gdb_cv_c_long_long != yes; then - # libdecnumber requires long long. - as_fn_error "Compiler must support long long for GDB." "$LINENO" 5 +ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "gs_base" "ac_cv_member_struct_user_regs_struct_gs_base" "#include +" +if test "x$ac_cv_member_struct_user_regs_struct_gs_base" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE 1 +_ACEOF + + fi -# Check if the compiler and runtime support printing long longs. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in printf" >&5 -$as_echo_n "checking for long long support in printf... " >&6; } -if test "${gdb_cv_printf_has_long_long+set}" = set; then : +# See if provides the PTRACE_GETREGS request. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETREGS" >&5 +$as_echo_n "checking for PTRACE_GETREGS... " >&6; } +if test "${gdb_cv_have_ptrace_getregs+set}" = set; then : $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - gdb_cv_printf_has_long_long=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include int main () { -char buf[32]; - long long l = 0; - l = (l << 16) + 0x0123; - l = (l << 16) + 0x4567; - l = (l << 16) + 0x89ab; - l = (l << 16) + 0xcdef; - sprintf (buf, "0x%016llx", l); - return (strcmp ("0x0123456789abcdef", buf)); +PTRACE_GETREGS; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gdb_cv_printf_has_long_long=yes +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_have_ptrace_getregs=yes else - gdb_cv_printf_has_long_long=no + gdb_cv_have_ptrace_getregs=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_long" >&5 -$as_echo "$gdb_cv_printf_has_long_long" >&6; } -if test $gdb_cv_printf_has_long_long = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getregs" >&5 +$as_echo "$gdb_cv_have_ptrace_getregs" >&6; } +if test $gdb_cv_have_ptrace_getregs = yes; then -$as_echo "#define PRINTF_HAS_LONG_LONG 1" >>confdefs.h +$as_echo "#define HAVE_PTRACE_GETREGS 1" >>confdefs.h fi -# Check if the compiler and runtime support printing decfloats. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for decfloat support in printf" >&5 -$as_echo_n "checking for decfloat support in printf... " >&6; } -if test "${gdb_cv_printf_has_decfloat+set}" = set; then : +# See if provides the PTRACE_GETFPXREGS request. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETFPXREGS" >&5 +$as_echo_n "checking for PTRACE_GETFPXREGS... " >&6; } +if test "${gdb_cv_have_ptrace_getfpxregs+set}" = set; then : $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - gdb_cv_printf_has_decfloat=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include int main () { -char buf[64]; - _Decimal32 d32 = 1.2345df; - _Decimal64 d64 = 1.2345dd; - _Decimal128 d128 = 1.2345dl; - sprintf (buf, "Decimal32: %H\nDecimal64: %D\nDecimal128: %DD", d32, d64, d128); - return (strcmp ("Decimal32: 1.2345\nDecimal64: 1.2345\nDecimal128: 1.2345", buf)); +PTRACE_GETFPXREGS; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gdb_cv_printf_has_decfloat=yes +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_have_ptrace_getfpxregs=yes else - gdb_cv_printf_has_decfloat=no + gdb_cv_have_ptrace_getfpxregs=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_decfloat" >&5 -$as_echo "$gdb_cv_printf_has_decfloat" >&6; } -if test $gdb_cv_printf_has_decfloat = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getfpxregs" >&5 +$as_echo "$gdb_cv_have_ptrace_getfpxregs" >&6; } +if test $gdb_cv_have_ptrace_getfpxregs = yes; then -$as_echo "#define PRINTF_HAS_DECFLOAT 1" >>confdefs.h +$as_echo "#define HAVE_PTRACE_GETFPXREGS 1" >>confdefs.h fi -# Check if the compiler supports the `long double' type. We can't use -# AC_C_LONG_DOUBLE because that one does additional checks on the -# constants defined in that fail on some systems, -# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in compiler" >&5 -$as_echo_n "checking for long double support in compiler... " >&6; } -if test "${gdb_cv_c_long_double+set}" = set; then : +# See if provides the PT_GETDBREGS request. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETDBREGS" >&5 +$as_echo_n "checking for PT_GETDBREGS... " >&6; } +if test "${gdb_cv_have_pt_getdbregs+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -long double foo; +#include +#include +int +main () +{ +PT_GETDBREGS; + ; + return 0; +} _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_c_long_double=yes + gdb_cv_have_pt_getdbregs=yes else - gdb_cv_c_long_double=no + gdb_cv_have_pt_getdbregs=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_double" >&5 -$as_echo "$gdb_cv_c_long_double" >&6; } -if test $gdb_cv_c_long_double = yes; then -$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getdbregs" >&5 +$as_echo "$gdb_cv_have_pt_getdbregs" >&6; } +if test $gdb_cv_have_pt_getdbregs = yes; then -fi +$as_echo "#define HAVE_PT_GETDBREGS 1" >>confdefs.h -# Check if the compiler and runtime support printing long doubles. +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in printf" >&5 -$as_echo_n "checking for long double support in printf... " >&6; } -if test "${gdb_cv_printf_has_long_double+set}" = set; then : +# See if provides the PT_GETXMMREGS request. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETXMMREGS" >&5 +$as_echo_n "checking for PT_GETXMMREGS... " >&6; } +if test "${gdb_cv_have_pt_getxmmregs+set}" = set; then : $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - gdb_cv_printf_has_long_double=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include +#include int main () { -char buf[16]; - long double f = 3.141592653; - sprintf (buf, "%Lg", f); - return (strncmp ("3.14159", buf, 7)); +PT_GETXMMREGS; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gdb_cv_printf_has_long_double=yes +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_have_pt_getxmmregs=yes else - gdb_cv_printf_has_long_double=no + gdb_cv_have_pt_getxmmregs=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_double" >&5 -$as_echo "$gdb_cv_printf_has_long_double" >&6; } -if test $gdb_cv_printf_has_long_double = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getxmmregs" >&5 +$as_echo "$gdb_cv_have_pt_getxmmregs" >&6; } +if test $gdb_cv_have_pt_getxmmregs = yes; then -$as_echo "#define PRINTF_HAS_LONG_DOUBLE 1" >>confdefs.h +$as_echo "#define HAVE_PT_GETXMMREGS 1" >>confdefs.h fi -# Check if the compiler and runtime support scanning long doubles. +# Detect which type of /proc is in use, such as for Solaris. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in scanf" >&5 -$as_echo_n "checking for long double support in scanf... " >&6; } -if test "${gdb_cv_scanf_has_long_double+set}" = set; then : +if test "${target}" = "${host}"; then + case "${host}" in + *-*-sysv4.2* | *-*-sysv5* ) + +$as_echo "#define NEW_PROC_API 1" >>confdefs.h + + ;; + *-*-solaris2.[6789] | *-*-solaris2.1[0-9]*) + +$as_echo "#define NEW_PROC_API 1" >>confdefs.h + + ;; + mips-sgi-irix5*) + # Work around needing _KMEMUSER problem on IRIX 5. + +$as_echo "#define _KMEMUSER 1" >>confdefs.h + + ;; + esac +fi + +if test "$ac_cv_header_sys_procfs_h" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5 +$as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_gregset_t+set}" = set; then : $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - gdb_cv_scanf_has_long_double=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -char *buf = "3.141592653"; - long double f = 0; - sscanf (buf, "%Lg", &f); - return !(f > 3.14159 && f < 3.14160); +gregset_t avar ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gdb_cv_scanf_has_long_double=yes +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_gregset_t=yes else - gdb_cv_scanf_has_long_double=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + bfd_cv_have_sys_procfs_type_gregset_t=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_scanf_has_long_double" >&5 -$as_echo "$gdb_cv_scanf_has_long_double" >&6; } -if test $gdb_cv_scanf_has_long_double = yes; then - -$as_echo "#define SCANF_HAS_LONG_DOUBLE 1" >>confdefs.h - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -case ${host_os} in -aix*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -bbigtoc option" >&5 -$as_echo_n "checking for -bbigtoc option... " >&6; } -if test "${gdb_cv_bigtoc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else + if test $bfd_cv_have_sys_procfs_type_gregset_t = yes; then - SAVE_LDFLAGS=$LDFLAGS +$as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h - case $GCC in - yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;; - *) gdb_cv_bigtoc=-bbigtoc ;; - esac + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; } - LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5 +$as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_fpregset_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -int i; +fpregset_t avar ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_fpregset_t=yes else - gdb_cv_bigtoc= -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="${SAVE_LDFLAGS}" + bfd_cv_have_sys_procfs_type_fpregset_t=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_bigtoc" >&5 -$as_echo "$gdb_cv_bigtoc" >&6; } - CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}" - ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5 -$as_echo_n "checking for the dynamic export flag... " >&6; } -dynamic_list=false -if test "${gdb_native}" = yes; then - # The dynamically loaded libthread_db needs access to symbols in the gdb - # executable. Older GNU ld supports --export-dynamic but --dynamic-list - # may not be supported there. - old_LDFLAGS="$LDFLAGS" - # Older GNU ld supports --export-dynamic but --dynamic-list it does not. - RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" - LDFLAGS="$LDFLAGS $RDYNAMIC" - if test "${have_libpython}" = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then -int -main () -{ +$as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - dynamic_list=true -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - else - # Workaround http://bugs.python.org/issue4434 where static - # libpythonX.Y.a would get its symbols required for - # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. - # Problem does not happen for the recommended libpythonX.Y.so linkage. - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PYTHON_CFLAGS" - if test "$cross_compiling" = yes; then : - true + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5 +$as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_prgregset_t+set}" = set; then : + $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "${have_libpython}/Python.h" + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -int err; - Py_Initialize (); - err = PyRun_SimpleString ("import itertools\n"); - Py_Finalize (); - return err == 0 ? 0 : 1; +prgregset_t avar ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - dynamic_list=true -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_prgregset_t=yes +else + bfd_cv_have_sys_procfs_type_prgregset_t=no - CFLAGS="$old_CFLAGS" - fi - LDFLAGS="$old_LDFLAGS" fi -if $dynamic_list; then - found="-Wl,--dynamic-list" - RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' -else - found="-rdynamic" - RDYNAMIC="-rdynamic" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5 -$as_echo "$found" >&6; } - + if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then -if test ${build} = ${host} -a ${host} = ${target} ; then - case ${host_os} in - solaris*) - # See if thread_db library is around for Solaris thread debugging. - # Note that we must explicitly test for version 1 of the library - # because version 0 (present on Solaris 2.4 or earlier) doesn't have - # the same API. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris thread debugging library" >&5 -$as_echo_n "checking for Solaris thread debugging library... " >&6; } - if test -f /usr/lib/libthread_db.so.1 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +$as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h -$as_echo "#define HAVE_THREAD_DB_LIB 1" >>confdefs.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; } - CONFIG_OBS="${CONFIG_OBS} sol-thread.o" - CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" - # On SPARC CPUs, we also need to build sparc-sol-thread. - case ${host_cpu} in - sparc*) - CONFIG_OBS="${CONFIG_OBS} sparc-sol-thread.o" - CONFIG_SRCS="${CONFIG_SRCS} sparc-sol-thread.c" - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5 +$as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_prfpregset_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -return dlopen (); +prfpregset_t avar ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_prfpregset_t=yes else - ac_cv_lib_dl_dlopen=no + bfd_cv_have_sys_procfs_type_prfpregset_t=no + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - LIBS="-ldl $LIBS" + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then -fi +$as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h - CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC" - # Sun randomly tweaked the prototypes in - # at one point. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if is old" >&5 -$as_echo_n "checking if is old... " >&6; } - if test "${gdb_cv_proc_service_is_old+set}" = set; then : + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5 +$as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_prgregset32_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - ps_err_e ps_pdwrite - (struct ps_prochandle*, psaddr_t, const void*, size_t); - +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { - +prgregset32_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_proc_service_is_old=no + bfd_cv_have_sys_procfs_type_prgregset32_t=yes else - gdb_cv_proc_service_is_old=yes + bfd_cv_have_sys_procfs_type_prgregset32_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_proc_service_is_old" >&5 -$as_echo "$gdb_cv_proc_service_is_old" >&6; } - if test $gdb_cv_proc_service_is_old = yes; then + if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then -$as_echo "#define PROC_SERVICE_IS_OLD 1" >>confdefs.h +$as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - aix*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AiX thread debugging library" >&5 -$as_echo_n "checking for AiX thread debugging library... " >&6; } - if test "${gdb_cv_have_aix_thread_debug+set}" = set; then : + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5 +$as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_lwpid_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -#ifndef PTHDB_VERSION_3 - #error - #endif +lwpid_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_have_aix_thread_debug=yes + bfd_cv_have_sys_procfs_type_lwpid_t=yes else - gdb_cv_have_aix_thread_debug=no + bfd_cv_have_sys_procfs_type_lwpid_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_aix_thread_debug" >&5 -$as_echo "$gdb_cv_have_aix_thread_debug" >&6; } - if test $gdb_cv_have_aix_thread_debug = yes; then - CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" - CONFIG_OBS="${CONFIG_OBS} aix-thread.o" - LIBS="$LIBS -lpthdebug" - - # Older versions of AIX do not provide the declaration for - # the getthrds function (it appears that it was introduced - # with AIX 6.x). - ac_fn_c_check_decl "$LINENO" "getthrds" "ac_cv_have_decl_getthrds" "#include -" -if test "x$ac_cv_have_decl_getthrds" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETTHRDS $ac_have_decl -_ACEOF + if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then - fi - ;; - esac +$as_echo "#define HAVE_LWPID_T 1" >>confdefs.h -fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; } -if test "x$ac_cv_header_thread_db_h" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has TD_NOTALLOC" >&5 -$as_echo_n "checking whether has TD_NOTALLOC... " >&6; } -if test "${gdb_cv_thread_db_h_has_td_notalloc+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5 +$as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_psaddr_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -int i = TD_NOTALLOC; +psaddr_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_thread_db_h_has_td_notalloc=yes + bfd_cv_have_sys_procfs_type_psaddr_t=yes else - gdb_cv_thread_db_h_has_td_notalloc=no + bfd_cv_have_sys_procfs_type_psaddr_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notalloc" >&5 -$as_echo "$gdb_cv_thread_db_h_has_td_notalloc" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has TD_VERSION" >&5 -$as_echo_n "checking whether has TD_VERSION... " >&6; } -if test "${gdb_cv_thread_db_h_has_td_version+set}" = set; then : + + if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then + +$as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prsysent_t in sys/procfs.h" >&5 +$as_echo_n "checking for prsysent_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_prsysent_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -int i = TD_VERSION; +prsysent_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_thread_db_h_has_td_version=yes + bfd_cv_have_sys_procfs_type_prsysent_t=yes else - gdb_cv_thread_db_h_has_td_version=no + bfd_cv_have_sys_procfs_type_prsysent_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_version" >&5 -$as_echo "$gdb_cv_thread_db_h_has_td_version" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has TD_NOTLS" >&5 -$as_echo_n "checking whether has TD_NOTLS... " >&6; } -if test "${gdb_cv_thread_db_h_has_td_notls+set}" = set; then : + + if test $bfd_cv_have_sys_procfs_type_prsysent_t = yes; then + +$as_echo "#define HAVE_PRSYSENT_T 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prsysent_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_prsysent_t" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pr_sigset_t in sys/procfs.h" >&5 +$as_echo_n "checking for pr_sigset_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_pr_sigset_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -int i = TD_NOTLS; +pr_sigset_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_thread_db_h_has_td_notls=yes + bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else - gdb_cv_thread_db_h_has_td_notls=no + bfd_cv_have_sys_procfs_type_pr_sigset_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notls" >&5 -$as_echo "$gdb_cv_thread_db_h_has_td_notls" >&6; } -fi -if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then - -$as_echo "#define THREAD_DB_HAS_TD_NOTALLOC 1" >>confdefs.h - fi -if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then - -$as_echo "#define THREAD_DB_HAS_TD_VERSION 1" >>confdefs.h -fi -if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then + if test $bfd_cv_have_sys_procfs_type_pr_sigset_t = yes; then -$as_echo "#define THREAD_DB_HAS_TD_NOTLS 1" >>confdefs.h +$as_echo "#define HAVE_PR_SIGSET_T 1" >>confdefs.h -fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_pr_sigset_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_pr_sigset_t" >&6; } -if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has __NR_tkill" >&5 -$as_echo_n "checking whether has __NR_tkill... " >&6; } -if test "${gdb_cv_sys_syscall_h_has_tkill+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pr_sigaction64_t in sys/procfs.h" >&5 +$as_echo_n "checking for pr_sigaction64_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_pr_sigaction64_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { -int i = __NR_tkill; +pr_sigaction64_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_sys_syscall_h_has_tkill=yes + bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else - gdb_cv_sys_syscall_h_has_tkill=no + bfd_cv_have_sys_procfs_type_pr_sigaction64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_sys_syscall_h_has_tkill" >&5 -$as_echo "$gdb_cv_sys_syscall_h_has_tkill" >&6; } -fi -if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then - -$as_echo "#define HAVE_TKILL_SYSCALL 1" >>confdefs.h - fi -ac_fn_c_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include -" -if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + if test $bfd_cv_have_sys_procfs_type_pr_sigaction64_t = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl -_ACEOF +$as_echo "#define HAVE_PR_SIGACTION64_T 1" >>confdefs.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_pr_sigaction64_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" >&6; } -if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pr_siginfo64_t in sys/procfs.h" >&5 +$as_echo_n "checking for pr_siginfo64_t in sys/procfs.h... " >&6; } + if test "${bfd_cv_have_sys_procfs_type_pr_siginfo64_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include int main () { - -# if !HAVE_DECL_ADDR_NO_RANDOMIZE -# define ADDR_NO_RANDOMIZE 0x0040000 -# endif - /* Test the flag could be set and stays set. */ - personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); - if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) - return 1 +pr_siginfo64_t avar ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_personality=true +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else - have_personality=false + bfd_cv_have_sys_procfs_type_pr_siginfo64_t=no + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test $bfd_cv_have_sys_procfs_type_pr_siginfo64_t = yes; then + +$as_echo "#define HAVE_PR_SIGINFO64_T 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_pr_siginfo64_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_pr_siginfo64_t" >&6; } + + + + + + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether prfpregset_t type is broken" >&5 +$as_echo_n "checking whether prfpregset_t type is broken... " >&6; } + if test "${gdb_cv_prfpregset_t_broken+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gdb_cv_prfpregset_t_broken=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -int -main () -{ - -# if !HAVE_DECL_ADDR_NO_RANDOMIZE -# define ADDR_NO_RANDOMIZE 0x0040000 -# endif - /* Test the flag could be set and stays set. */ - personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); - if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) - return 1 - ; - return 0; -} +#include + int main () + { + if (sizeof (prfpregset_t) == sizeof (void *)) + return 1; + return 0; + } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - have_personality=true + gdb_cv_prfpregset_t_broken=no else - have_personality=false + gdb_cv_prfpregset_t_broken=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi -if $have_personality -then - -$as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_prfpregset_t_broken" >&5 +$as_echo "$gdb_cv_prfpregset_t_broken" >&6; } + if test $gdb_cv_prfpregset_t_broken = yes; then -# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, -# except that the argument to --with-sysroot is optional. -# --with-sysroot (or --with-sysroot=yes) sets the default sysroot path. -if test "x$with_sysroot" = xyes; then - with_sysroot="${exec_prefix}/${target_alias}/sys-root" -fi - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; TARGET_SYSTEM_ROOT=$withval -else - TARGET_SYSTEM_ROOT= -fi - - - test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $TARGET_SYSTEM_ROOT` - ac_define_dir=`eval echo $ac_define_dir` - -cat >>confdefs.h <<_ACEOF -#define TARGET_SYSTEM_ROOT "$ac_define_dir" -_ACEOF - - - - - if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - value=0 - case ${ac_define_dir} in - "${test_prefix}"|"${test_prefix}/"*|\ - '${exec_prefix}'|'${exec_prefix}/'*) - value=1 - ;; - esac - -cat >>confdefs.h <<_ACEOF -#define TARGET_SYSTEM_ROOT_RELOCATABLE $value -_ACEOF - - - - - -# Check whether --with-system-gdbinit was given. -if test "${with_system_gdbinit+set}" = set; then : - withval=$with_system_gdbinit; - SYSTEM_GDBINIT=$withval -else - SYSTEM_GDBINIT= -fi - - - test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $SYSTEM_GDBINIT` - ac_define_dir=`eval echo $ac_define_dir` - -cat >>confdefs.h <<_ACEOF -#define SYSTEM_GDBINIT "$ac_define_dir" -_ACEOF - - - +$as_echo "#define PRFPREGSET_T_BROKEN 1" >>confdefs.h - if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix + fi fi - value=0 - case ${ac_define_dir} in - "${test_prefix}"|"${test_prefix}/"*|\ - '${exec_prefix}'|'${exec_prefix}/'*) - value=1 - ;; - esac - -cat >>confdefs.h <<_ACEOF -#define SYSTEM_GDBINIT_RELOCATABLE $value -_ACEOF - - - - -# Check whether --enable-werror was given. -if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) as_fn_error "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; - esac -fi - - -# Enable -Werror by default when using gcc. Turn it off for releases. -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then - ERROR_ON_WARNING=yes -fi - -WERROR_CFLAGS="" -if test "${ERROR_ON_WARNING}" = yes ; then - WERROR_CFLAGS="-Werror" fi -# The entries after -Wno-pointer-sign are disabled warnings which may -# be enabled in the future, which can not currently be used to build -# GDB. -# NOTE: If you change this list, remember to update -# gdb/doc/gdbint.texinfo. -build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wformat-nonliteral -Wno-pointer-sign \ --Wno-unused -Wunused-value -Wunused-function \ --Wno-switch -Wno-char-subscripts -Wmissing-prototypes \ --Wdeclaration-after-statement -Wempty-body" - -# Enable -Wno-format by default when using gcc on mingw since many -# GCC versions complain about %I64. -case "${host}" in - *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; -esac +# Check if the compiler supports the `long long' type. -# Check whether --enable-build-warnings was given. -if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in - yes) ;; - no) build_warnings="-w";; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${build_warnings} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${t} ${build_warnings}";; - *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting compiler warning flags = $build_warnings" 6>&1 -fi -fi -# Check whether --enable-gdb-build-warnings was given. -if test "${enable_gdb_build_warnings+set}" = set; then : - enableval=$enable_gdb_build_warnings; case "${enableval}" in - yes) ;; - no) build_warnings="-w";; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${build_warnings} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${t} ${build_warnings}";; - *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 -fi -fi -WARN_CFLAGS="" -if test "x${build_warnings}" != x -a "x$GCC" = xyes -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5 -$as_echo_n "checking compiler warning flags... " >&6; } - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) # Check that GCC accepts it - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $w" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in compiler" >&5 +$as_echo_n "checking for long long support in compiler... " >&6; } +if test "${gdb_cv_c_long_long+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +extern long long foo; int main () { - +switch (foo & 2) { case 0: return 1; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - WARN_CFLAGS="${WARN_CFLAGS} $w" + gdb_cv_c_long_long=yes +else + gdb_cv_c_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saved_CFLAGS" - esac - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 -$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_long" >&5 +$as_echo "$gdb_cv_c_long_long" >&6; } +if test $gdb_cv_c_long_long != yes; then + # libdecnumber requires long long. + as_fn_error "Compiler must support long long for GDB." "$LINENO" 5 fi +# Check if the compiler and runtime support printing long longs. - -# In the Cygwin environment, we need some additional flags. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cygwin" >&5 -$as_echo_n "checking for cygwin... " >&6; } -if test "${gdb_cv_os_cygwin+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in printf" >&5 +$as_echo_n "checking for long long support in printf... " >&6; } +if test "${gdb_cv_printf_has_long_long+set}" = set; then : $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gdb_cv_printf_has_long_long=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#if defined (__CYGWIN__) || defined (__CYGWIN32__) -lose -#endif +$ac_includes_default +int +main () +{ +char buf[32]; + long long l = 0; + l = (l << 16) + 0x0123; + l = (l << 16) + 0x4567; + l = (l << 16) + 0x89ab; + l = (l << 16) + 0xcdef; + sprintf (buf, "0x%016llx", l); + return (strcmp ("0x0123456789abcdef", buf)); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "lose" >/dev/null 2>&1; then : - gdb_cv_os_cygwin=yes +if ac_fn_c_try_run "$LINENO"; then : + gdb_cv_printf_has_long_long=yes else - gdb_cv_os_cygwin=no + gdb_cv_printf_has_long_long=no fi -rm -f conftest* - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_os_cygwin" >&5 -$as_echo "$gdb_cv_os_cygwin" >&6; } - -SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o" -case ${host} in - *go32* ) SER_HARDWIRE=ser-go32.o ;; - *djgpp* ) SER_HARDWIRE=ser-go32.o ;; - *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;; -esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_long" >&5 +$as_echo "$gdb_cv_printf_has_long_long" >&6; } +if test $gdb_cv_printf_has_long_long = yes; then +$as_echo "#define PRINTF_HAS_LONG_LONG 1" >>confdefs.h -# libreadline needs libuser32.a in a cygwin environment -WIN32LIBS= -if test x$gdb_cv_os_cygwin = xyes; then - WIN32LIBS="-luser32" - case "${target}" in - *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp" - ;; - esac fi -# The ser-tcp.c module requires sockets. -case ${host} in - *mingw32*) +# Check if the compiler and runtime support printing decfloats. -$as_echo "#define USE_WIN32API 1" >>confdefs.h - - WIN32LIBS="$WIN32LIBS -lws2_32" - ;; -esac - - -# Add ELF support to GDB, but only if BFD includes ELF support. -OLD_CFLAGS=$CFLAGS -OLD_LDFLAGS=$LDFLAGS -OLD_LIBS=$LIBS -# Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS -# points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We -# always want our bfd. -CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" -LDFLAGS="-L../bfd -L../libiberty $LDFLAGS" -intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` -# -ldl is provided by bfd/Makfile.am (LIBDL) . -if test "$plugins" = "yes"; then - LIBS="-ldl $LIBS" -fi -LIBS="-lbfd -liberty $intl $LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5 -$as_echo_n "checking for ELF support in BFD... " >&6; } -if test "${gdb_cv_var_elf+set}" = set; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for decfloat support in printf" >&5 +$as_echo_n "checking for decfloat support in printf... " >&6; } +if test "${gdb_cv_printf_has_decfloat+set}" = set; then : $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gdb_cv_printf_has_decfloat=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include "bfd.h" -#include "elf-bfd.h" - +$ac_includes_default int main () { -bfd *abfd = NULL; bfd_get_elf_phdr_upper_bound (abfd); +char buf[64]; + _Decimal32 d32 = 1.2345df; + _Decimal64 d64 = 1.2345dd; + _Decimal128 d128 = 1.2345dl; + sprintf (buf, "Decimal32: %H\nDecimal64: %D\nDecimal128: %DD", d32, d64, d128); + return (strcmp ("Decimal32: 1.2345\nDecimal64: 1.2345\nDecimal128: 1.2345", buf)); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gdb_cv_var_elf=yes +if ac_fn_c_try_run "$LINENO"; then : + gdb_cv_printf_has_decfloat=yes else - gdb_cv_var_elf=no + gdb_cv_printf_has_decfloat=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_elf" >&5 -$as_echo "$gdb_cv_var_elf" >&6; } -if test $gdb_cv_var_elf = yes; then - CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o" - -$as_echo "#define HAVE_ELF 1" >>confdefs.h - # -ldl is provided by bfd/Makfile.am (LIBDL) . - if test "$plugins" = "yes"; then - OLD_LIBS="-ldl $OLD_LIBS" - fi fi -CFLAGS=$OLD_CFLAGS -LDFLAGS=$OLD_LDFLAGS -LIBS=$OLD_LIBS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_decfloat" >&5 +$as_echo "$gdb_cv_printf_has_decfloat" >&6; } +if test $gdb_cv_printf_has_decfloat = yes; then -# Add any host-specific objects to GDB. -CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}" +$as_echo "#define PRINTF_HAS_DECFLOAT 1" >>confdefs.h -# If building on ELF, look for lzma support for embedded compressed debug info. -if test $gdb_cv_var_elf = yes; then +fi -# Check whether --with-lzma was given. -if test "${with_lzma+set}" = set; then : - withval=$with_lzma; +# Check if the compiler supports the `long double' type. We can't use +# AC_C_LONG_DOUBLE because that one does additional checks on the +# constants defined in that fail on some systems, +# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in compiler" >&5 +$as_echo_n "checking for long double support in compiler... " >&6; } +if test "${gdb_cv_c_long_double+set}" = set; then : + $as_echo_n "(cached) " >&6 else - with_lzma=auto + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +long double foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_c_long_double=yes +else + gdb_cv_c_long_double=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_double" >&5 +$as_echo "$gdb_cv_c_long_double" >&6; } +if test $gdb_cv_c_long_double = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use lzma" >&5 -$as_echo_n "checking whether to use lzma... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lzma" >&5 -$as_echo "$with_lzma" >&6; } - - if test "${with_lzma}" != no; then +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h +fi +# Check if the compiler and runtime support printing long doubles. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in printf" >&5 +$as_echo_n "checking for long double support in printf... " >&6; } +if test "${gdb_cv_printf_has_long_double+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gdb_cv_printf_has_long_double=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +char buf[16]; + long double f = 3.141592653; + sprintf (buf, "%Lg", f); + return (strncmp ("3.14159", buf, 7)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gdb_cv_printf_has_long_double=yes +else + gdb_cv_printf_has_long_double=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_double" >&5 +$as_echo "$gdb_cv_printf_has_long_double" >&6; } +if test $gdb_cv_printf_has_long_double = yes; then +$as_echo "#define PRINTF_HAS_LONG_DOUBLE 1" >>confdefs.h +fi +# Check if the compiler and runtime support scanning long doubles. - use_additional=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in scanf" >&5 +$as_echo_n "checking for long double support in scanf... " >&6; } +if test "${gdb_cv_scanf_has_long_double+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gdb_cv_scanf_has_long_double=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *buf = "3.141592653"; + long double f = 0; + sscanf (buf, "%Lg", &f); + return !(f > 3.14159 && f < 3.14160); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gdb_cv_scanf_has_long_double=yes +else + gdb_cv_scanf_has_long_double=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_scanf_has_long_double" >&5 +$as_echo "$gdb_cv_scanf_has_long_double" >&6; } +if test $gdb_cv_scanf_has_long_double = yes; then - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +$as_echo "#define SCANF_HAS_LONG_DOUBLE 1" >>confdefs.h - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +fi +case ${host_os} in +aix*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -bbigtoc option" >&5 +$as_echo_n "checking for -bbigtoc option... " >&6; } +if test "${gdb_cv_bigtoc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else -# Check whether --with-liblzma-prefix was given. -if test "${with_liblzma_prefix+set}" = set; then : - withval=$with_liblzma_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then + SAVE_LDFLAGS=$LDFLAGS - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" + case $GCC in + yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;; + *) gdb_cv_bigtoc=-bbigtoc ;; + esac - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" + LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi +else + gdb_cv_bigtoc= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="${SAVE_LDFLAGS}" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_bigtoc" >&5 +$as_echo "$gdb_cv_bigtoc" >&6; } + CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}" + ;; +esac - LIBLZMA= - LTLIBLZMA= - INCLZMA= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='lzma ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }$value" - else - : - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5 +$as_echo_n "checking for the dynamic export flag... " >&6; } +dynamic_list=false +if test "${gdb_native}" = yes; then + # The dynamically loaded libthread_db needs access to symbols in the gdb + # executable. Older GNU ld supports --export-dynamic but --dynamic-list + # may not be supported there. + old_LDFLAGS="$LDFLAGS" + # Older GNU ld supports --export-dynamic but --dynamic-list it does not. + RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" + LDFLAGS="$LDFLAGS $RDYNAMIC" + if test "${have_libpython}" = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + dynamic_list=true +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + else + # Workaround http://bugs.python.org/issue4434 where static + # libpythonX.Y.a would get its symbols required for + # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. + # Problem does not happen for the recommended libpythonX.Y.so linkage. + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" + old_LIBS="$LIBS" + LIBS="$LIBS $PYTHON_LIBS" + if test "$cross_compiling" = yes; then : + true +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "${have_libpython}/Python.h" +int +main () +{ +int err; + Py_Initialize (); + err = PyRun_SimpleString ("import itertools\n"); + Py_Finalize (); + return err == 0 ? 0 : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + dynamic_list=true +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" + fi + LDFLAGS="$old_LDFLAGS" +fi +if $dynamic_list; then + found="-Wl,--dynamic-list" + RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' +else + found="-rdynamic" + RDYNAMIC="-rdynamic" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5 +$as_echo "$found" >&6; } + + +if test ${build} = ${host} -a ${host} = ${target} ; then + case ${host_os} in + solaris*) + # See if thread_db library is around for Solaris thread debugging. + # Note that we must explicitly test for version 1 of the library + # because version 0 (present on Solaris 2.4 or earlier) doesn't have + # the same API. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris thread debugging library" >&5 +$as_echo_n "checking for Solaris thread debugging library... " >&6; } + if test -f /usr/lib/libthread_db.so.1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_THREAD_DB_LIB 1" >>confdefs.h + + CONFIG_OBS="${CONFIG_OBS} sol-thread.o" + CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + + CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC" + # Sun randomly tweaked the prototypes in + # at one point. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if is old" >&5 +$as_echo_n "checking if is old... " >&6; } + if test "${gdb_cv_proc_service_is_old+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + ps_err_e ps_pdwrite + (struct ps_prochandle*, psaddr_t, const void*, size_t); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_proc_service_is_old=no +else + gdb_cv_proc_service_is_old=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_proc_service_is_old" >&5 +$as_echo "$gdb_cv_proc_service_is_old" >&6; } + if test $gdb_cv_proc_service_is_old = yes; then + +$as_echo "#define PROC_SERVICE_IS_OLD 1" >>confdefs.h + + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + aix*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AiX thread debugging library" >&5 +$as_echo_n "checking for AiX thread debugging library... " >&6; } + if test "${gdb_cv_have_aix_thread_debug+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +#ifndef PTHDB_VERSION_3 + #error + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_have_aix_thread_debug=yes +else + gdb_cv_have_aix_thread_debug=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_aix_thread_debug" >&5 +$as_echo "$gdb_cv_have_aix_thread_debug" >&6; } + if test $gdb_cv_have_aix_thread_debug = yes; then + CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" + CONFIG_OBS="${CONFIG_OBS} aix-thread.o" + LIBS="$LIBS -lpthdebug" + + # Older versions of AIX do not provide the declaration for + # the getthrds function (it appears that it was introduced + # with AIX 6.x). + ac_fn_c_check_decl "$LINENO" "getthrds" "ac_cv_have_decl_getthrds" "#include +" +if test "x$ac_cv_have_decl_getthrds" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETTHRDS $ac_have_decl +_ACEOF + + fi + ;; + esac + +fi + +if test "x$ac_cv_header_thread_db_h" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has TD_NOTALLOC" >&5 +$as_echo_n "checking whether has TD_NOTALLOC... " >&6; } +if test "${gdb_cv_thread_db_h_has_td_notalloc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = TD_NOTALLOC; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_thread_db_h_has_td_notalloc=yes +else + gdb_cv_thread_db_h_has_td_notalloc=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notalloc" >&5 +$as_echo "$gdb_cv_thread_db_h_has_td_notalloc" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has TD_VERSION" >&5 +$as_echo_n "checking whether has TD_VERSION... " >&6; } +if test "${gdb_cv_thread_db_h_has_td_version+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = TD_VERSION; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_thread_db_h_has_td_version=yes +else + gdb_cv_thread_db_h_has_td_version=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_version" >&5 +$as_echo "$gdb_cv_thread_db_h_has_td_version" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has TD_NOTLS" >&5 +$as_echo_n "checking whether has TD_NOTLS... " >&6; } +if test "${gdb_cv_thread_db_h_has_td_notls+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = TD_NOTLS; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_thread_db_h_has_td_notls=yes +else + gdb_cv_thread_db_h_has_td_notls=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notls" >&5 +$as_echo "$gdb_cv_thread_db_h_has_td_notls" >&6; } +fi +if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then + +$as_echo "#define THREAD_DB_HAS_TD_NOTALLOC 1" >>confdefs.h + +fi +if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then + +$as_echo "#define THREAD_DB_HAS_TD_VERSION 1" >>confdefs.h + +fi +if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then + +$as_echo "#define THREAD_DB_HAS_TD_NOTLS 1" >>confdefs.h + +fi + +if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether has __NR_tkill" >&5 +$as_echo_n "checking whether has __NR_tkill... " >&6; } +if test "${gdb_cv_sys_syscall_h_has_tkill+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = __NR_tkill; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gdb_cv_sys_syscall_h_has_tkill=yes +else + gdb_cv_sys_syscall_h_has_tkill=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_sys_syscall_h_has_tkill" >&5 +$as_echo "$gdb_cv_sys_syscall_h_has_tkill" >&6; } +fi +if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes"; then + ac_fn_c_check_func "$LINENO" "syscall" "ac_cv_func_syscall" +if test "x$ac_cv_func_syscall" = x""yes; then : + +$as_echo "#define HAVE_TKILL_SYSCALL 1" >>confdefs.h + + +fi + +fi + +ac_fn_c_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include +" +if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl +_ACEOF + + +if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +# if !HAVE_DECL_ADDR_NO_RANDOMIZE +# define ADDR_NO_RANDOMIZE 0x0040000 +# endif + /* Test the flag could be set and stays set. */ + personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); + if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) + return 1 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_personality=true +else + have_personality=false +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +# if !HAVE_DECL_ADDR_NO_RANDOMIZE +# define ADDR_NO_RANDOMIZE 0x0040000 +# endif + /* Test the flag could be set and stays set. */ + personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); + if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) + return 1 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_personality=true +else + have_personality=false +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +if $have_personality +then + +$as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h + +fi + +case $host_os in + go32* | *djgpp*) + gdbinit=gdb.ini + ;; + *) + gdbinit=.gdbinit + ;; +esac + +cat >>confdefs.h <<_ACEOF +#define GDBINIT "$gdbinit" +_ACEOF + + + +# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, +# except that the argument to --with-sysroot is optional. +# --with-sysroot (or --with-sysroot=yes) sets the default sysroot path. +if test "x$with_sysroot" = xyes; then + with_sysroot="${exec_prefix}/${target_alias}/sys-root" +fi + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; TARGET_SYSTEM_ROOT=$withval +else + TARGET_SYSTEM_ROOT= +fi + + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_dir=`eval echo $TARGET_SYSTEM_ROOT` + ac_define_dir=`eval echo $ac_define_dir` + +cat >>confdefs.h <<_ACEOF +#define TARGET_SYSTEM_ROOT "$ac_define_dir" +_ACEOF + + + + + if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + value=0 + case ${ac_define_dir} in + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + value=1 + ;; + esac + +cat >>confdefs.h <<_ACEOF +#define TARGET_SYSTEM_ROOT_RELOCATABLE $value +_ACEOF + + + + + +# Check whether --with-system-gdbinit was given. +if test "${with_system_gdbinit+set}" = set; then : + withval=$with_system_gdbinit; + SYSTEM_GDBINIT=$withval +else + SYSTEM_GDBINIT= +fi + + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_dir=`eval echo $SYSTEM_GDBINIT` + ac_define_dir=`eval echo $ac_define_dir` + +cat >>confdefs.h <<_ACEOF +#define SYSTEM_GDBINIT "$ac_define_dir" +_ACEOF + + + + + if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + value=0 + case ${ac_define_dir} in + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + value=1 + ;; + esac + +cat >>confdefs.h <<_ACEOF +#define SYSTEM_GDBINIT_RELOCATABLE $value +_ACEOF + + + + +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) as_fn_error "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; + esac +fi + + +# Enable -Werror by default when using gcc in C mode. Leave it off +# for C++ until we're warning clean. Turn it off for releases. +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" \ + && test x"$enable_build_with_cxx" != x"yes" \ + && $development; then + ERROR_ON_WARNING=yes +fi + +WERROR_CFLAGS="" +if test "${ERROR_ON_WARNING}" = yes ; then + WERROR_CFLAGS="-Werror" +fi + +# These options work in either C or C++ modes. +build_warnings="-Wall -Wpointer-arith \ +-Wno-unused -Wunused-value -Wunused-function \ +-Wno-switch -Wno-char-subscripts \ +-Wempty-body" + +# Now add in C and C++ specific options, depending on mode. +if test "$enable_build_with_cxx" = "yes"; then + build_warnings="$build_warnings -Wno-sign-compare -Wno-write-strings \ +-Wno-narrowing" +else + build_warnings="$build_warnings -Wpointer-sign -Wmissing-prototypes \ +-Wdeclaration-after-statement -Wmissing-parameter-type \ +-Wold-style-declaration -Wold-style-definition" +fi + +# Enable -Wno-format by default when using gcc on mingw since many +# GCC versions complain about %I64. +case "${host}" in + *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; + *) build_warnings="$build_warnings -Wformat-nonliteral" ;; +esac + +# Check whether --enable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then : + enableval=$enable_build_warnings; case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting compiler warning flags = $build_warnings" 6>&1 +fi +fi +# Check whether --enable-gdb-build-warnings was given. +if test "${enable_gdb_build_warnings+set}" = set; then : + enableval=$enable_gdb_build_warnings; case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 +fi +fi + +# The set of warnings supported by a C++ compiler is not the same as +# of the C compiler. +if test "$enable_build_with_cxx" = "yes"; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + +WARN_CFLAGS="" +if test "x${build_warnings}" != x -a "x$GCC" = xyes +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5 +$as_echo_n "checking compiler warning flags... " >&6; } + # Separate out the -Werror flag as some files just cannot be + # compiled with it enabled. + for w in ${build_warnings}; do + case $w in + -Werr*) WERROR_CFLAGS=-Werror ;; + *) + # Check whether GCC accepts it. + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $w" + saved_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $w" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + WARN_CFLAGS="${WARN_CFLAGS} $w" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$saved_CFLAGS" + CXXFLAGS="$saved_CXXFLAGS" + esac + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 +$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } +fi + + + +if test "$enable_build_with_cxx" = "yes"; then + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi + +# In the Cygwin environment, we need some additional flags. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cygwin" >&5 +$as_echo_n "checking for cygwin... " >&6; } +if test "${gdb_cv_os_cygwin+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined (__CYGWIN__) || defined (__CYGWIN32__) +lose +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "^lose$" >/dev/null 2>&1; then : + gdb_cv_os_cygwin=yes +else + gdb_cv_os_cygwin=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_os_cygwin" >&5 +$as_echo "$gdb_cv_os_cygwin" >&6; } + + +SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o" +case ${host} in + *go32* ) SER_HARDWIRE=ser-go32.o ;; + *djgpp* ) SER_HARDWIRE=ser-go32.o ;; + *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;; +esac + + +# libreadline needs libuser32.a in a cygwin environment +WIN32LIBS= +if test x$gdb_cv_os_cygwin = xyes; then + WIN32LIBS="-luser32" + case "${target}" in + *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp" + ;; + esac +fi + +# The ser-tcp.c module requires sockets. +case ${host} in + *mingw32*) + +$as_echo "#define USE_WIN32API 1" >>confdefs.h + + WIN32LIBS="$WIN32LIBS -lws2_32" + ;; +esac + + +# Add ELF support to GDB, but only if BFD includes ELF support. + + OLD_CFLAGS=$CFLAGS + OLD_LDFLAGS=$LDFLAGS + OLD_LIBS=$LIBS + # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS + # points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We + # always want our bfd. + CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" + ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` + LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" + intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` + LIBS="-lbfd -liberty -lz $intl $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5 +$as_echo_n "checking for ELF support in BFD... " >&6; } +if test "${gdb_cv_var_elf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include "bfd.h" + #include "elf-bfd.h" + +int +main () +{ +return bfd_get_elf_phdr_upper_bound (NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gdb_cv_var_elf=yes +else + gdb_cv_var_elf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_elf" >&5 +$as_echo "$gdb_cv_var_elf" >&6; } + CFLAGS=$OLD_CFLAGS + LDFLAGS=$OLD_LDFLAGS + LIBS=$OLD_LIBS +if test $gdb_cv_var_elf = yes; then + CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o dtrace-probe.o" + +$as_echo "#define HAVE_ELF 1" >>confdefs.h + + # -ldl is provided by bfd/Makfile.am (LIBDL) . + if test "$plugins" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if test "${ac_cv_search_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_dlopen+set}" = set; then : + break +fi +done +if test "${ac_cv_search_dlopen+set}" = set; then : + +else + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + fi +fi + +# Add macho support to GDB, but only if BFD includes it. + + OLD_CFLAGS=$CFLAGS + OLD_LDFLAGS=$LDFLAGS + OLD_LIBS=$LIBS + # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS + # points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We + # always want our bfd. + CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" + ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'` + LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS" + intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` + LIBS="-lbfd -liberty -lz $intl $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O support in BFD" >&5 +$as_echo_n "checking for Mach-O support in BFD... " >&6; } +if test "${gdb_cv_var_macho+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include "bfd.h" + #include "mach-o.h" + +int +main () +{ +return bfd_mach_o_lookup_command (NULL, 0, NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gdb_cv_var_macho=yes +else + gdb_cv_var_macho=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_macho" >&5 +$as_echo "$gdb_cv_var_macho" >&6; } + CFLAGS=$OLD_CFLAGS + LDFLAGS=$OLD_LDFLAGS + LIBS=$OLD_LIBS +if test $gdb_cv_var_macho = yes; then + CONFIG_OBS="$CONFIG_OBS machoread.o" +fi + +# Add any host-specific objects to GDB. +CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}" + +# If building on ELF, look for lzma support for embedded compressed debug info. +if test $gdb_cv_var_elf = yes; then + +# Check whether --with-lzma was given. +if test "${with_lzma+set}" = set; then : + withval=$with_lzma; +else + with_lzma=auto +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use lzma" >&5 +$as_echo_n "checking whether to use lzma... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lzma" >&5 +$as_echo "$with_lzma" >&6; } + + if test "${with_lzma}" != no; then + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-liblzma-prefix was given. +if test "${with_liblzma_prefix+set}" = set; then : + withval=$with_liblzma_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + LIBLZMA= + LTLIBLZMA= + INCLZMA= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='lzma ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }$value" + else + : + fi else found_dir= found_la= @@ -13790,201 +15814,711 @@ do ac_x_libraries=$ac_dir break 2 fi - done -done -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi # $ac_x_libraries = no + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + + +# Unlike the sim directory, whether a simulator is linked is controlled by +# presence of a gdb_sim definition in the target configure.tgt entry. +# This code just checks for a few cases where we'd like to ignore those +# definitions, even when they're present in the '.mt' file. These cases +# are when --disable-sim is specified, or if the simulator directory is +# not part of the source tree. +# +# Check whether --enable-sim was given. +if test "${enable_sim+set}" = set; then : + enableval=$enable_sim; echo "enable_sim = $enable_sim"; + echo "enableval = ${enableval}"; + case "${enableval}" in + yes) ignore_sim=false ;; + no) ignore_sim=true ;; + *) ignore_sim=false ;; + esac +else + ignore_sim=false +fi + + +if test ! -d "${srcdir}/../sim"; then + ignore_sim=true +fi + +SIM= +SIM_OBS= +if test "${ignore_sim}" = "false"; then + if test x"${gdb_sim}" != x ; then + SIM="${gdb_sim}" + SIM_OBS="remote-sim.o" + +$as_echo "#define WITH_SIM 1" >>confdefs.h + + fi +fi + + + + + + + + + + + + + + +# List of host floatformats. + +cat >>confdefs.h <<_ACEOF +#define GDB_HOST_FLOAT_FORMAT $gdb_host_float_format +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define GDB_HOST_DOUBLE_FORMAT $gdb_host_double_format +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define GDB_HOST_LONG_DOUBLE_FORMAT $gdb_host_long_double_format +_ACEOF + + +# target_subdir is used by the testsuite to find the target libraries. +target_subdir= +if test "${host}" != "${target}"; then + target_subdir="${target_alias}/" +fi + + +frags= +if test "${gdb_native}" = "yes"; then + host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh + if test ! -f ${host_makefile_frag}; then + as_fn_error "\"*** Gdb does not support native target ${host}\"" "$LINENO" 5 + fi + frags="$frags $host_makefile_frag" +else + host_makefile_frag=/dev/null +fi + + + + +if test "${gdb_native}" = "yes"; then +# We pick this up from the host configuration file (.mh) because we +# do not have a native configuration Makefile fragment. +nativefile=`sed -n ' +s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p +' ${host_makefile_frag}` +fi + + +if test x"${gdb_osabi}" != x ; then + +cat >>confdefs.h <<_ACEOF +#define GDB_OSABI_DEFAULT $gdb_osabi +_ACEOF + +fi + +# Enable multi-ice-gdb-server. +# Check whether --enable-multi-ice was given. +if test "${enable_multi_ice+set}" = set; then : + enableval=$enable_multi_ice; case $enableval in + yes | no) + ;; + *) as_fn_error "bad value $enableval for --enable-multi-ice" "$LINENO" 5 ;; + esac +fi + +if test "x$enable_multi_ice" = xyes; then + subdirs="$subdirs multi-ice" + +fi + +# Check whether --enable-gdbserver was given. +if test "${enable_gdbserver+set}" = set; then : + enableval=$enable_gdbserver; case "${enableval}" in + yes| no|auto) ;; + *) as_fn_error "bad value ${enableval} for --enable-gdbserver option" "$LINENO" 5 ;; +esac +else + enable_gdbserver=auto +fi + + +# We only build gdbserver automatically in a native configuration, and +# only if the user did not explicitly disable its build. +if test "$gdb_native" = "yes" -a "$enable_gdbserver" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gdbserver is supported on this host" >&5 +$as_echo_n "checking whether gdbserver is supported on this host... " >&6; } + if test "x$build_gdbserver" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + subdirs="$subdirs gdbserver" + + gdbserver_build_enabled=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +fi + +# If the user explicitly request the gdbserver to be built, verify that +# we were in fact able to enable it. +if test "$enable_gdbserver" = "yes" -a "$gdbserver_build_enabled" != "yes"; then + as_fn_error "Automatic gdbserver build is not supported for this configuration" "$LINENO" 5 +fi + +# Check for babeltrace and babeltrace-ctf + +# Check whether --with-babeltrace was given. +if test "${with_babeltrace+set}" = set; then : + withval=$with_babeltrace; +else + with_babeltrace=auto +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use babeltrace" >&5 +$as_echo_n "checking whether to use babeltrace... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_babeltrace" >&5 +$as_echo "$with_babeltrace" >&6; } + +if test "x$with_babeltrace" = "xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: babletrace support disabled; GDB is unable to read CTF data." >&5 +$as_echo "$as_me: WARNING: babletrace support disabled; GDB is unable to read CTF data." >&2;} +else + # Append -Werror to CFLAGS so that configure can catch the warning + # "assignment from incompatible pointer type", which is related to + # the babeltrace change from 1.0.3 to 1.1.0. Babeltrace 1.1.0 works + # in GDB, while babeltrace 1.0.3 is broken. + # AC_LIB_HAVE_LINKFLAGS may modify CPPFLAGS in it, so it should be + # safe to save and restore CFLAGS here. + saved_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror" + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libbabeltrace-prefix was given. +if test "${with_libbabeltrace_prefix+set}" = set; then : + withval=$with_libbabeltrace_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" -esac fi -;; #( - *) have_x=yes;; - esac - eval "$ac_cv_have_x" -fi # $with_x != no -if test "$have_x" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -$as_echo "$have_x" >&6; } - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -$as_echo "libraries $x_libraries, headers $x_includes" >&6; } -fi + LIBBABELTRACE= + LTLIBBABELTRACE= + INCBABELTRACE= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='babeltrace babeltrace-ctf' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBBABELTRACE; do + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -# Unlike the sim directory, whether a simulator is linked is controlled by -# presence of a gdb_sim definition in the target configure.tgt entry. -# This code just checks for a few cases where we'd like to ignore those -# definitions, even when they're present in the '.mt' file. These cases -# are when --disable-sim is specified, or if the simulator directory is -# not part of the source tree. -# -# Check whether --enable-sim was given. -if test "${enable_sim+set}" = set; then : - enableval=$enable_sim; echo "enable_sim = $enable_sim"; - echo "enableval = ${enableval}"; - case "${enableval}" in - yes) ignore_sim=false ;; - no) ignore_sim=true ;; - *) ignore_sim=false ;; - esac -else - ignore_sim=false -fi + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBBABELTRACE; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so" + else + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_a" + else + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCBABELTRACE; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCBABELTRACE="${INCBABELTRACE}${INCBABELTRACE:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBBABELTRACE; do -if test ! -d "${srcdir}/../sim"; then - ignore_sim=true -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -SIM= -SIM_OBS= -if test "${ignore_sim}" = "false"; then - if test x"${gdb_sim}" != x ; then - SIM="${gdb_sim}" - SIM_OBS="remote-sim.o" + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBBABELTRACE; do -$as_echo "#define WITH_SIM 1" >>confdefs.h + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$dep" + LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }$dep" + ;; + esac + done + fi + else + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-l$name" + LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-R$found_dir" + done fi -fi - - - - - - - - - + ac_save_CPPFLAGS="$CPPFLAGS" + for element in $INCBABELTRACE; do + haveit= + for x in $CPPFLAGS; do + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -# List of host floatformats. + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done -cat >>confdefs.h <<_ACEOF -#define GDB_HOST_FLOAT_FORMAT $gdb_host_float_format -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbabeltrace" >&5 +$as_echo_n "checking for libbabeltrace... " >&6; } +if test "${ac_cv_libbabeltrace+set}" = set; then : + $as_echo_n "(cached) " >&6 +else -cat >>confdefs.h <<_ACEOF -#define GDB_HOST_DOUBLE_FORMAT $gdb_host_double_format -_ACEOF + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBBABELTRACE" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include +int +main () +{ +struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL)); + struct bt_ctf_event *event = NULL; + const struct bt_definition *scope; + bt_iter_set_pos (bt_ctf_get_iter (NULL), pos); + scope = bt_ctf_get_top_level_scope (event, + BT_STREAM_EVENT_HEADER); + bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id")); -cat >>confdefs.h <<_ACEOF -#define GDB_HOST_LONG_DOUBLE_FORMAT $gdb_host_long_double_format + ; + return 0; +} _ACEOF - - -# target_subdir is used by the testsuite to find the target libraries. -target_subdir= -if test "${host}" != "${target}"; then - target_subdir="${target_alias}/" -fi - - -frags= -if test "${gdb_native}" = "yes"; then - host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh - if test ! -f ${host_makefile_frag}; then - as_fn_error "\"*** Gdb does not support native target ${host}\"" "$LINENO" 5 - fi - frags="$frags $host_makefile_frag" +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_libbabeltrace=yes else - host_makefile_frag=/dev/null + ac_cv_libbabeltrace=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" - - - -if test "${gdb_native}" = "yes"; then -# We pick this up from the host configuration file (.mh) because we -# do not have a native configuration Makefile fragment. -nativefile=`sed -n ' -s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p -' ${host_makefile_frag}` fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbabeltrace" >&5 +$as_echo "$ac_cv_libbabeltrace" >&6; } + if test "$ac_cv_libbabeltrace" = yes; then + HAVE_LIBBABELTRACE=yes +$as_echo "#define HAVE_LIBBABELTRACE 1" >>confdefs.h -if test x"${gdb_osabi}" != x ; then - -cat >>confdefs.h <<_ACEOF -#define GDB_OSABI_DEFAULT $gdb_osabi -_ACEOF - -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libbabeltrace" >&5 +$as_echo_n "checking how to link with libbabeltrace... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBBABELTRACE" >&5 +$as_echo "$LIBBABELTRACE" >&6; } + else + HAVE_LIBBABELTRACE=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBBABELTRACE= + LTLIBBABELTRACE= + fi -# Enable multi-ice-gdb-server. -# Check whether --enable-multi-ice was given. -if test "${enable_multi_ice+set}" = set; then : - enableval=$enable_multi_ice; case $enableval in - yes | no) - ;; - *) as_fn_error "bad value $enableval for --enable-multi-ice" "$LINENO" 5 ;; - esac -fi -if test "x$enable_multi_ice" = xyes; then - subdirs="$subdirs multi-ice" -fi -# Check whether --enable-gdbserver was given. -if test "${enable_gdbserver+set}" = set; then : - enableval=$enable_gdbserver; case "${enableval}" in - yes| no|auto) ;; - *) as_fn_error "bad value ${enableval} for --enable-gdbserver option" "$LINENO" 5 ;; -esac -else - enable_gdbserver=auto -fi -# We only build gdbserver automatically in a native configuration, and -# only if the user did not explicitly disable its build. -if test "$gdb_native" = "yes" -a "$enable_gdbserver" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gdbserver is supported on this host" >&5 -$as_echo_n "checking whether gdbserver is supported on this host... " >&6; } - if test "x$build_gdbserver" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - subdirs="$subdirs gdbserver" + CFLAGS=$saved_CFLAGS - gdbserver_build_enabled=yes - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "$HAVE_LIBBABELTRACE" != yes; then + if test "$with_babeltrace" = yes; then + as_fn_error "babeltrace is missing or unusable" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data." >&5 +$as_echo "$as_me: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data." >&2;} + fi fi fi -# If the user explicitly request the gdbserver to be built, verify that -# we were in fact able to enable it. -if test "$enable_gdbserver" = "yes" -a "$gdbserver_build_enabled" != "yes"; then - as_fn_error "Automatic gdbserver build is not supported for this configuration" "$LINENO" 5 -fi - # If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link # to an empty version. @@ -14023,6 +16557,25 @@ ac_config_links="$ac_config_links $ac_config_links_1" $as_echo "#define GDB_DEFAULT_HOST_CHARSET \"UTF-8\"" >>confdefs.h + + gdb_ac_transform=`echo "$program_transform_name" | sed -e 's/\\$\\$/\\$/g'` + GDB_TRANSFORM_NAME=`echo gdb | sed -e "$gdb_ac_transform"` + if test "x$GDB_TRANSFORM_NAME" = x; then + GDB_TRANSFORM_NAME=gdb + fi + + + + gdb_ac_transform=`echo "$program_transform_name" | sed -e 's/\\$\\$/\\$/g'` + GCORE_TRANSFORM_NAME=`echo gcore | sed -e "$gdb_ac_transform"` + if test "x$GCORE_TRANSFORM_NAME" = x; then + GCORE_TRANSFORM_NAME=gcore + fi + + +ac_config_files="$ac_config_files gcore" + + ac_config_files="$ac_config_files Makefile gdb-gdb.gdb doc/Makefile data-directory/Makefile" ac_config_commands="$ac_config_commands default" @@ -14132,6 +16685,14 @@ if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then as_fn_error "conditional \"GMAKE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then + as_fn_error "conditional \"HAVE_PYTHON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_GUILE_TRUE}" && test -z "${HAVE_GUILE_FALSE}"; then + as_fn_error "conditional \"HAVE_GUILE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : ${CONFIG_STATUS=./config.status} @@ -14733,6 +17294,7 @@ do "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;; "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;; "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;; + "gcore") CONFIG_FILES="$CONFIG_FILES gcore" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "gdb-gdb.gdb") CONFIG_FILES="$CONFIG_FILES gdb-gdb.gdb" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; @@ -15354,6 +17916,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;; + "gcore":F) chmod +x gcore ;; "default":C) case x$CONFIG_HEADERS in xconfig.h:config.in)