* gas/mips/mips.exp (run_dump_test_arch): Check for the presence
[deliverable/binutils-gdb.git] / gdb / configure
index a69db06bd47e05fc91c4184ad7bc6203964cbf51..dd3d04cf939992213e83d1a7f6d8d67331baf6d4 100755 (executable)
@@ -657,6 +657,7 @@ SYSTEM_GDBINIT
 TARGET_SYSTEM_ROOT_DEFINE
 TARGET_SYSTEM_ROOT
 CONFIG_LDFLAGS
+RDYNAMIC
 ALLOCA
 PYTHON_CFLAGS
 python_prog_path
@@ -974,6 +975,7 @@ with_tk
 with_x
 enable_sim
 enable_multi_ice
+enable_gdbserver
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1634,6 +1636,8 @@ Optional Features:
                           gcc is used
   --enable-sim            link gdb with simulator
   --enable-multi-ice      build the multi-ice-gdb-server
+  --enable-gdbserver      automatically build gdbserver (yes/no/auto, default
+                          is auto)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1658,7 +1662,8 @@ Optional Packages:
   --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           include python support (auto/yes/no/<path>)
+  --with-python[=PYTHON]  include python support
+                          (auto/yes/no/<python-program>)
   --without-included-regex
                           don't use included regex; this is the default on
                           systems with version 2 of the GNU C library (use
@@ -2120,8 +2125,10 @@ $as_echo "$ac_res" >&6; }
 ac_fn_c_check_decl ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&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
@@ -2131,8 +2138,12 @@ $4
 int
 main ()
 {
-#ifndef $2
-  (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
 #endif
 
   ;
@@ -7777,6 +7788,7 @@ _ACEOF
 
 
 
+
   if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
      if test "x$prefix" = xNONE; then
        test_prefix=/usr/local
@@ -7800,6 +7812,7 @@ _ACEOF
 
 
 
+
 # GDB's datadir relocation
 
 
@@ -7824,6 +7837,7 @@ _ACEOF
 
 
 
+
   if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
      if test "x$prefix" = xNONE; then
        test_prefix=/usr/local
@@ -7848,6 +7862,7 @@ _ACEOF
 
 
 
+
 # Check whether --with-relocated-sources was given.
 if test "${with_relocated_sources+set}" = set; then :
   withval=$with_relocated_sources; reloc_srcdir="${withval}"
@@ -10433,6 +10448,7 @@ fi
 
 
 
+
 # Check whether --with-python was given.
 if test "${with_python+set}" = set; then :
   withval=$with_python;
@@ -10450,23 +10466,23 @@ if test "${with_python}" = no; then
 $as_echo "$as_me: WARNING: python support disabled; some features may be unavailable." >&2;}
   have_libpython=no
 else
-  have_python_config=no
   case "${with_python}" in
   /*)
     if test -d ${with_python}; then
       # Assume the python binary is ${with_python}/bin/python.
-      python_prefix=${with_python}
       python_prog="${with_python}/bin/python"
-      if test ! -x ${python_prog}; then
+      python_prefix=
+      if test ! -x "${python_prog}"; then
         # Fall back to gdb 7.0/7.1 behaviour.
         python_prog=missing
+        python_prefix=${with_python}
       fi
-    elif test -x ${with_python}; then
+    elif test -x "${with_python}"; then
       # While we can't run python compiled for $host (unless host == build),
       # the user could write a script that provides the needed information,
       # so we support that.
-      python_prefix=
       python_prog=${with_python}
+      python_prefix=
     else
       as_fn_error "invalid value for --with-python" "$LINENO" 5
     fi
   esac
 
   if test "${python_prog}" != missing; then
+    # We have a python program to use, but it may be too old.
+    # Don't flag an error for --with-python=auto (the default).
+    have_python_config=yes
     python_includes=`${python_prog} ${srcdir}/python/python-config.py --includes`
     if test $? != 0; then
-      as_fn_error "failure running python-config --includes" "$LINENO" 5
+      have_python_config=failed
+      if test "${with_python}" != auto; then
+        as_fn_error "failure running python-config --includes" "$LINENO" 5
+      fi
     fi
     python_libs=`${python_prog} ${srcdir}/python/python-config.py --ldflags`
     if test $? != 0; then
-      as_fn_error "failure running python-config --ldflags" "$LINENO" 5
+      have_python_config=failed
+      if test "${with_python}" != auto; then
+        as_fn_error "failure running python-config --ldflags" "$LINENO" 5
+      fi
+    fi
+    python_prefix=`${python_prog} ${srcdir}/python/python-config.py --exec-prefix`
+    if test $? != 0; then
+      have_python_config=failed
+      if test "${with_python}" != auto; then
+        as_fn_error "failure running python-config --exec-prefix" "$LINENO" 5
+      fi
     fi
-    have_python_config=yes
   else
     # Fall back to gdb 7.0/7.1 behaviour.
     if test -z ${python_prefix}; then
@@ -10606,6 +10637,7 @@ fi
       python_includes="-I${python_prefix}/include"
       python_libs="-L${python_prefix}/lib"
     fi
+    have_python_config=no
   fi
 
   # Having "/pythonX.Y" in the include path is awkward.
@@ -10615,7 +10647,7 @@ fi
   # path of the, umm, include file.  So strip away this part of the
   # output of python-config --includes.
   python_includes=`echo "${python_includes} " \
-                       | sed -e 's,/python[0-9]*[.][0-9]* , ,g'`
+                        | sed -e 's,/python[0-9]*[.][0-9]* , ,g'`
 
   # If we have python-config, only try the configuration it provides.
   # Otherwise fallback on the old way of trying different versions of
@@ -10624,8 +10656,9 @@ fi
   have_libpython=no
   if test "${have_python_config}" = yes; then
     python_version=`echo " ${python_libs} " \
-                        | sed -e 's,^.* -l\(python[0-9]*[.][0-9]*\) .*$,\1,'`
-    if test "${python_version}" != ""; then
+                         | sed -e 's,^.* -l\(python[0-9]*[.][0-9]*\) .*$,\1,'`
+    case "${python_version}" in
+    python*)
 
   version=${python_version}
 
@@ -10661,10 +10694,49 @@ rm -f core conftest.err conftest.$ac_objext \
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5
 $as_echo "${found_usable_python}" >&6; }
 
-    else
+      ;;
+    *)
       as_fn_error "unable to determine python version from ${python_libs}" "$LINENO" 5
+      ;;
+    esac
+  elif test "${have_python_config}" != failed; then
+    if test "${have_libpython}" = no; then
+
+  version=python2.7
+
+  new_CPPFLAGS=${python_includes}
+  new_LIBS="${python_libs} -lpython2.7"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${version}" >&5
+$as_echo_n "checking for ${version}... " >&6; }
+  save_CPPFLAGS=$CPPFLAGS
+  save_LIBS=$LIBS
+  CPPFLAGS="$CPPFLAGS $new_CPPFLAGS"
+  LIBS="$LIBS $new_LIBS"
+  found_usable_python=no
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "${version}/Python.h"
+int
+main ()
+{
+Py_Initialize ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  have_libpython=${version}
+                  found_usable_python=yes
+else
+  CPPFLAGS=$save_CPPFLAGS
+                  LIBS=$save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5
+$as_echo "${found_usable_python}" >&6; }
+
     fi
-  else
     if test "${have_libpython}" = no; then
 
   version=python2.6
@@ -10777,7 +10849,11 @@ $as_echo "${found_usable_python}" >&6; }
 
     fi
   fi
-  if test "${have_libpython}" = python2.6; then
+  if test "${have_libpython}" = python2.7; then
+
+$as_echo "#define HAVE_LIBPYTHON2_7 1" >>confdefs.h
+
+  elif test "${have_libpython}" = python2.6; then
 
 $as_echo "#define HAVE_LIBPYTHON2_6 1" >>confdefs.h
 
@@ -10804,6 +10880,37 @@ $as_echo "$as_me: WARNING: python is missing or unusable; some features may be u
       as_fn_error "no usable python found at ${with_python}" "$LINENO" 5
       ;;
     esac
+  else
+    if test -n "${python_prefix}"; then
+
+cat >>confdefs.h <<_ACEOF
+#define WITH_PYTHON_PATH "${python_prefix}"
+_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 ${python_prefix} in
+     "${test_prefix}"|"${test_prefix}/"*|\
+       '${exec_prefix}'|'${exec_prefix}/'*)
+     value=1
+     ;;
+  esac
+
+cat >>confdefs.h <<_ACEOF
+#define PYTHON_PATH_RELOCATABLE $value
+_ACEOF
+
+
+    fi
   fi
 fi
 
@@ -10814,6 +10921,7 @@ $as_echo "#define HAVE_PYTHON 1" >>confdefs.h
   CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)"
   CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)"
   CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)"
+  CONFIG_INSTALL="$CONFIG_INSTALL install-python"
   ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)"
 
   # Flags needed to compile Python code (taken from python-config --cflags).
@@ -12442,10 +12550,10 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
 fi
 
 for ac_func in canonicalize_file_name realpath getrusage getuid \
-               getgid pipe poll pread64 sbrk setpgid setpgrp setsid \
+               getgid pipe poll pread64 resize_term sbrk setpgid setpgrp setsid \
                sigaction sigprocmask sigsetmask socketpair syscall \
-               ttrace wborder setlocale iconvlist libiconvlist btowc \
-               setrlimit getrlimit posix_madvise
+               ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
+               setrlimit getrlimit posix_madvise waitpid
 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"
@@ -14123,6 +14231,80 @@ $as_echo "$gdb_cv_bigtoc" >&6; }
   ;;
 esac
 
+{ $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"
+     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
+
+     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
@@ -14208,38 +14390,7 @@ _ACEOF
 
 fi
 
-         if test "$GCC" = "yes" ; then
-            # The GNU linker requires the -export-dynamic option to make
-            # all symbols visible in the dynamic symbol table.
-            hold_ldflags=$LDFLAGS
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ld -export-dynamic flag" >&5
-$as_echo_n "checking for the ld -export-dynamic flag... " >&6; }
-            LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-int i;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  found=yes
-else
-  found=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-            LDFLAGS=$hold_ldflags
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
-$as_echo "$found" >&6; }
-            if test $found = yes; then
-               CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
-            fi
-         fi
+        CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC"
         # Sun randomly tweaked the prototypes in <proc_service.h>
         # at one point.
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if <proc_service.h> is old" >&5
@@ -14596,6 +14747,7 @@ _ACEOF
 
 
 
+
   if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
      if test "x$prefix" = xNONE; then
        test_prefix=/usr/local
@@ -14619,6 +14771,7 @@ _ACEOF
 
 
 
+
 # Check whether --enable-werror was given.
 if test "${enable_werror+set}" = set; then :
   enableval=$enable_werror; case "${enableval}" in
@@ -15666,8 +15819,20 @@ if test "x$enable_multi_ice" = xyes; then
 
 fi
 
-# We only build gdbserver automatically in a native configuration.
-if test "$gdb_native" = "yes"; then
+# 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
@@ -15675,12 +15840,19 @@ $as_echo_n "checking whether gdbserver is supported on this host... " >&6; }
 $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
+
 # If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
 # to an empty version.
 
@@ -15719,7 +15891,7 @@ ac_config_links="$ac_config_links $ac_config_links_1"
 $as_echo "#define GDB_DEFAULT_HOST_CHARSET \"UTF-8\"" >>confdefs.h
 
 
-ac_config_files="$ac_config_files Makefile .gdbinit:gdbinit.in gnulib/Makefile"
+ac_config_files="$ac_config_files Makefile .gdbinit:gdbinit.in gnulib/Makefile data-directory/Makefile"
 
 ac_config_commands="$ac_config_commands default"
 
@@ -16486,6 +16658,7 @@ do
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:gdbinit.in" ;;
     "gnulib/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib/Makefile" ;;
+    "data-directory/Makefile") CONFIG_FILES="$CONFIG_FILES data-directory/Makefile" ;;
     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
 
   *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
This page took 0.032718 seconds and 4 git commands to generate.