Use unique_xmalloc_ptr in fixup_go_packaging
[deliverable/binutils-gdb.git] / gdb / configure
index 50164ac8a4aedf65d49865f38cbbef6ef7c353c4..b572d414ca514a966f6b35a3cec34a16f6cd7fa7 100755 (executable)
@@ -2520,6 +2520,73 @@ fi
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_link
+
+# ac_fn_cxx_check_func LINENO FUNC VAR
+# ------------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_cxx_check_func ()
+{
+  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 eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* 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 $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext 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; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_func
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -6710,7 +6777,7 @@ else
 fi
 
 if test x"$enable_gdbmi" = xyes; then
-  if test -d $srcdir/mi; then
+  if test -d "$srcdir/mi"; then
     CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)"
     CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)"
     CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)"
@@ -6742,7 +6809,7 @@ if test "${enable_gdbtk+set}" = set; then :
       as_fn_error $? "bad value $enableval for --enable-gdbtk" "$LINENO" 5 ;;
   esac
 else
-  if test -d $srcdir/gdbtk; then
+  if test -d "$srcdir/gdbtk"; then
     enable_gdbtk=yes
   else
     enable_gdbtk=no
@@ -6889,7 +6956,7 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var__etext" >&5
 $as_echo "$ac_cv_var__etext" >&6; }
-if test $ac_cv_var__etext = yes; then
+if test "$ac_cv_var__etext" = yes; then
 
 $as_echo "#define HAVE__ETEXT 1" >>confdefs.h
 
@@ -6922,13 +6989,13 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_etext" >&5
 $as_echo "$ac_cv_var_etext" >&6; }
-if test $ac_cv_var_etext = yes; then
+if test "$ac_cv_var_etext" = yes; then
 
 $as_echo "#define HAVE_ETEXT 1" >>confdefs.h
 
 fi
 if test "$enable_profiling" = yes ; then
-  if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
+  if test "$ac_cv_func_monstartup" = no || test "$ac_cv_func__mcleanup" = no; then
     as_fn_error $? "--enable-profiling requires monstartup and _mcleanup" "$LINENO" 5
   fi
   PROFILE_CFLAGS=-pg
@@ -6961,7 +7028,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_supports_pg" >&5
 $as_echo "$ac_cv_cc_supports_pg" >&6; }
 
-  if test $ac_cv_cc_supports_pg = no; then
+  if test "$ac_cv_cc_supports_pg" = no; then
     as_fn_error $? "--enable-profiling requires a compiler which supports -pg" "$LINENO" 5
   fi
 
@@ -8865,7 +8932,7 @@ 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 -d "$srcdir/tui"; then
     if test "$curses_found" != no; then
       CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
       CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
@@ -8888,7 +8955,7 @@ fi
 
 case $host_os in
   cygwin*)
-    if test -d $srcdir/libtermcap; then
+    if test -d "$srcdir/libtermcap"; then
       LIBS="../libtermcap/libtermcap.a $LIBS"
       ac_cv_search_tgetent="../libtermcap/libtermcap.a"
     fi ;;
@@ -10261,7 +10328,7 @@ $as_echo "$as_me: WARNING: python support disabled; some features may be unavail
 else
   case "${with_python}" in
   [\\/]* | ?:[\\/]*)
-    if test -d ${with_python}; then
+    if test -d "${with_python}"; then
       # Assume the python binary is ${with_python}/bin/python.
       python_prog="${with_python}/bin/python"
       python_prefix=
@@ -10297,7 +10364,7 @@ else
     python_prefix=
     case "${with_python}" in
     yes | auto)
-      if test ${build} = ${host}; then
+      if test "${build}" = "${host}"; then
         # Extract the first word of "python", so it can be a program name with args.
 set dummy python; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; 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"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
@@ -14263,10 +14320,26 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_cxx_std_thread" >&5
 $as_echo "$gdb_cv_cxx_std_thread" >&6; }
+
+    # This check must be here, while LIBS includes any necessary
+    # threading library.
+    for ac_func in pthread_sigmask pthread_setname_np
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
     LIBS="$save_LIBS"
     CXXFLAGS="$save_CXXFLAGS"
   fi
-  if test $gdb_cv_cxx_std_thread = yes; then
+  if test "$gdb_cv_cxx_std_thread" = "yes"; then
 
 $as_echo "#define CXX_STD_THREAD 1" >>confdefs.h
 
@@ -14305,7 +14378,7 @@ 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 "$gdb_cv_func_sigsetjmp" = "yes"; then
 
 $as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
 
@@ -14588,7 +14661,7 @@ 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
+if test "$ac_cv_func_setpgrp_void" = yes; then
   $as_echo "#define SETPGRP_VOID 1" >>confdefs.h
 
 fi
@@ -14627,7 +14700,7 @@ 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
+if test "$gdb_cv_have_gnu_regex" = yes; then
   gdb_use_included_regex=no
 fi
 
@@ -14688,7 +14761,7 @@ 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
+if test "$gdb_cv_struct_lwp" = yes; then
 
 $as_echo "#define HAVE_STRUCT_LWP 1" >>confdefs.h
 
@@ -14721,7 +14794,7 @@ 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
+if test "$gdb_cv_struct_reg" = yes; then
 
 $as_echo "#define HAVE_STRUCT_REG 1" >>confdefs.h
 
@@ -14807,7 +14880,7 @@ fi
 
 { $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
+if test "$gdb_cv_have_ptrace_getregs" = yes; then
 
 $as_echo "#define HAVE_PTRACE_GETREGS 1" >>confdefs.h
 
@@ -14840,7 +14913,7 @@ 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
+if test "$gdb_cv_have_ptrace_getfpxregs" = yes; then
 
 $as_echo "#define HAVE_PTRACE_GETFPXREGS 1" >>confdefs.h
 
@@ -14874,7 +14947,7 @@ fi
 
 { $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
+if test "$gdb_cv_have_pt_getdbregs" = yes; then
 
 $as_echo "#define HAVE_PT_GETDBREGS 1" >>confdefs.h
 
@@ -14908,7 +14981,7 @@ fi
 
 { $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 "$gdb_cv_have_pt_getxmmregs" = yes; then
 
 $as_echo "#define HAVE_PT_GETXMMREGS 1" >>confdefs.h
 
@@ -15270,7 +15343,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 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
+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
@@ -15315,7 +15388,7 @@ 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
+if test "$gdb_cv_printf_has_long_long" = yes; then
 
 $as_echo "#define PRINTF_HAS_LONG_LONG 1" >>confdefs.h
 
@@ -15359,7 +15432,7 @@ 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
+if test "$gdb_cv_printf_has_decfloat" = yes; then
 
 $as_echo "#define PRINTF_HAS_DECFLOAT 1" >>confdefs.h
 
@@ -15388,7 +15461,7 @@ 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
+if test "$gdb_cv_c_long_double" = yes; then
 
 $as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
 
@@ -15430,7 +15503,7 @@ 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
+if test "$gdb_cv_printf_has_long_double" = yes; then
 
 $as_echo "#define PRINTF_HAS_LONG_DOUBLE 1" >>confdefs.h
 
@@ -15472,7 +15545,7 @@ fi
 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
+if test "$gdb_cv_scanf_has_long_double" = yes; then
 
 $as_echo "#define SCANF_HAS_LONG_DOUBLE 1" >>confdefs.h
 
@@ -15609,7 +15682,7 @@ fi
 $as_echo "$found" >&6; }
 
 
-if test ${build} = ${host} -a ${host} = ${target} ; then
+if test "${build}" = "${host}" -a "${host}" = "${target}" ; then
    case ${host_os} in
    aix*)
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AiX thread debugging library" >&5
@@ -15640,7 +15713,7 @@ 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
+      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"
@@ -16273,7 +16346,7 @@ esac
 
 # libreadline needs libuser32.a in a cygwin environment
 WIN32LIBS=
-if test x$gdb_cv_os_cygwin = xyes; then
+if test x"$gdb_cv_os_cygwin" = xyes; then
     WIN32LIBS="-luser32"
     case "${target}" in
        *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
@@ -16337,7 +16410,7 @@ $as_echo "$gdb_cv_var_elf" >&6; }
   CFLAGS=$OLD_CFLAGS
   LDFLAGS=$OLD_LDFLAGS
   LIBS=$OLD_LIBS
-if test $gdb_cv_var_elf = yes; then
+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
@@ -16448,7 +16521,7 @@ $as_echo "$gdb_cv_var_macho" >&6; }
   CFLAGS=$OLD_CFLAGS
   LDFLAGS=$OLD_LDFLAGS
   LIBS=$OLD_LIBS
-if test $gdb_cv_var_macho = yes; then
+if test "$gdb_cv_var_macho" = yes; then
   CONFIG_OBS="$CONFIG_OBS machoread.o"
 fi
 
@@ -16456,7 +16529,7 @@ fi
 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
+if test "$gdb_cv_var_elf" = yes; then
 
 # Check whether --with-lzma was given.
 if test "${with_lzma+set}" = set; then :
@@ -17450,7 +17523,7 @@ $as_echo "${private_dir}" >&6; }
        CONFIG_INSTALL="${CONFIG_INSTALL} install-gdbtk"
        CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-gdbtk"
 
-       if test x$gdb_cv_os_cygwin = xyes; then
+       if test x"$gdb_cv_os_cygwin" = xyes; then
          WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
          WIN32LDAPP="-Wl,--subsystem,console"
          CONFIG_OBS="${CONFIG_OBS} gdbres.o"
This page took 0.036059 seconds and 4 git commands to generate.