* configure.ac: Don't fail if python is unusable when
authorDoug Evans <dje@google.com>
Thu, 3 Jun 2010 18:58:39 +0000 (18:58 +0000)
committerDoug Evans <dje@google.com>
Thu, 3 Jun 2010 18:58:39 +0000 (18:58 +0000)
configured with --with-python=auto.
* configure: Regenerate.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index 693c295a925edf7515c947c69d11afcf4d7618fa..1df82061cc666141301de0cf0d3b556f1c98079d 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-03  Doug Evans  <dje@google.com>
+
+       * configure.ac: Don't fail if python is unusable when
+       configured with --with-python=auto.
+       * configure: Regenerate.
+
 2010-06-03  Sami Wagiaalla  <swagiaal@redhat.com>
 
        * dwarf2read.c (new_symbol): Remove redundant naming of symbol.
index 5380293df5ef2aeeffc561d6f69901595b46da4f..bae0b5b3a78c8b05b2403b3bfb8406bba54613a1 100755 (executable)
@@ -2122,8 +2122,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
@@ -2133,8 +2135,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
 
   ;
@@ -10463,12 +10469,12 @@ else
       # Assume the python binary is ${with_python}/bin/python.
       python_prog="${with_python}/bin/python"
       python_prefix=
-      if test ! -x ${python_prog}; then
+      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.
   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
-      as_fn_error "failure running python-config --exec-prefix" "$LINENO" 5
+      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
@@ -10679,7 +10696,7 @@ $as_echo "${found_usable_python}" >&6; }
       as_fn_error "unable to determine python version from ${python_libs}" "$LINENO" 5
       ;;
     esac
-  else
+  elif test "${have_python_config}" != failed; then
     if test "${have_libpython}" = no; then
 
   version=python2.6
index 16789b9aefaa8ef6712d3be729c63c5cd49f8457..d65fd493d1df901911cd00f0a769a9b428e15190 100644 (file)
@@ -664,12 +664,12 @@ else
       # Assume the python binary is ${with_python}/bin/python.
       python_prog="${with_python}/bin/python"
       python_prefix=
-      if test ! -x ${python_prog}; then
+      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.
@@ -716,19 +716,30 @@ else
   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
-      AC_ERROR(failure running python-config --includes)
+      have_python_config=failed
+      if test "${with_python}" != auto; then
+        AC_ERROR(failure running python-config --includes)
+      fi
     fi
     python_libs=`${python_prog} ${srcdir}/python/python-config.py --ldflags`
     if test $? != 0; then
-      AC_ERROR(failure running python-config --ldflags)
+      have_python_config=failed
+      if test "${with_python}" != auto; then
+        AC_ERROR(failure running python-config --ldflags)
+      fi
     fi
     python_prefix=`${python_prog} ${srcdir}/python/python-config.py --exec-prefix`
     if test $? != 0; then
-      AC_ERROR(failure running python-config --exec-prefix)
+      have_python_config=failed
+      if test "${with_python}" != auto; then
+        AC_ERROR(failure running python-config --exec-prefix)
+      fi
     fi
-    have_python_config=yes
   else
     # Fall back to gdb 7.0/7.1 behaviour.
     if test -z ${python_prefix}; then
@@ -767,7 +778,7 @@ else
       AC_MSG_ERROR([unable to determine python version from ${python_libs}])
       ;;
     esac
-  else
+  elif test "${have_python_config}" != failed; then
     if test "${have_libpython}" = no; then
       AC_TRY_LIBPYTHON(python2.6, have_libpython,
                        ${python_includes}, "${python_libs} -lpython2.6")