Fix "-Wl,--dynamic-list" gdb/configure test
authorPedro Alves <palves@redhat.com>
Tue, 3 May 2016 09:30:51 +0000 (10:30 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 3 May 2016 09:30:51 +0000 (10:30 +0100)
The -Wl,--dynamic-list test is currently broken on Fedora 23, when you
configure with --with-python=python3.4.  We see:

 configure:13741: checking for the dynamic export flag
 configure:13796: gcc -o conftest -g3 -O0  -fno-strict-aliasing -DNDEBUG -fwrapv    -Wl,--dynamic-list=/home/pedro/gdb/mygit/src/gdb/proc-service.list conftest.c -ldl -lncurses -lm -ldl  -lpthread -ldl -lutil -lm -lpython3.4m -Xlinker -export-dynamic >&5
 conftest.c:182:30: fatal error: python3.4/Python.h: No such file or directory
 compilation terminated.
 configure:13796: $? = 1

The correct -I path is in PYTHON_CPPFLAGS:

 PYTHON_CPPFLAGS='-I/usr/include/python3.4m -I/usr/include/python3.4m'

(Other Python-related tests in the file are already doing this.)

gdb/ChangeLog:
2016-05-03  Pedro Alves  <palves@redhat.com>

* configure.ac (checking for the dynamic export flag): Add
$PYTHON_CPPFLAGS to CPPFLAGS.
* configure: Regenerate.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index 1da02fdd4e64357596813c458534fd4135188640..e8d4ed1d7af0b98713b3d8fa9675d1a309dfe7b5 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-03  Pedro Alves  <palves@redhat.com>
+
+       * configure.ac (checking for the dynamic export flag): Add
+       $PYTHON_CPPFLAGS to CPPFLAGS.
+       * configure: Regenerate.
+
 2016-05-03  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * symfile.c (find_pc_overlay): Add braces to avoid -Wparentheses
index 228cb99a77e69475420f19c80f4a99e91eb3e1d6..bc6761f9558c04d336d032d43766d57491c51ce0 100755 (executable)
@@ -13709,12 +13709,14 @@ rm -f core conftest.err conftest.$ac_objext \
      CFLAGS="$CFLAGS $PYTHON_CFLAGS"
      old_LIBS="$LIBS"
      LIBS="$LIBS $PYTHON_LIBS"
+     old_CPPFLAGS="$CPPFLAGS"
+     CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
      if test "$cross_compiling" = yes; then :
   true
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include "${have_libpython}/Python.h"
+#include "Python.h"
 int
 main ()
 {
@@ -13736,6 +13738,7 @@ fi
 
      LIBS="$old_LIBS"
      CFLAGS="$old_CFLAGS"
+     CPPFLAGS="$old_CPPFLAGS"
    fi
    LDFLAGS="$old_LDFLAGS"
 fi
index 3aa132aea418401f5e4304e679d608fcc107e38a..d7b2e8a6bcac18dce2594969b3add68b7a54113d 100644 (file)
@@ -1722,9 +1722,11 @@ if test "${gdb_native}" = yes; then
      CFLAGS="$CFLAGS $PYTHON_CFLAGS"
      old_LIBS="$LIBS"
      LIBS="$LIBS $PYTHON_LIBS"
+     old_CPPFLAGS="$CPPFLAGS"
+     CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
      AC_RUN_IFELSE(
        AC_LANG_PROGRAM(
-         [#include "]${have_libpython}[/Python.h"],
+         [#include "Python.h"],
          [int err;
           Py_Initialize ();
           err = PyRun_SimpleString ("import itertools\n");
@@ -1733,6 +1735,7 @@ if test "${gdb_native}" = yes; then
        [dynamic_list=true], [], [true])
      LIBS="$old_LIBS"
      CFLAGS="$old_CFLAGS"
+     CPPFLAGS="$old_CPPFLAGS"
    fi
    LDFLAGS="$old_LDFLAGS"
 fi