X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fconfigure.ac;h=6ba7c5cfa4f1d287255235e2929206df52efe7ef;hb=27e4fac77ea57b288ac1e08d936d9a8fdc01a1ee;hp=d929b8982a378cdbf4861ff5fc1fc4ad6ee3fa58;hpb=c12d372d263309e2ee81efda713096ea9e62a759;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/configure.ac b/gdb/configure.ac index d929b8982a..6ba7c5cfa4 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -177,10 +177,6 @@ fi . $srcdir/configure.host -# Add in the common host objects. -. $srcdir/gdbsupport/common.host -gdb_host_obs="$gdb_host_obs $common_host_obs" - # Accumulate some settings from configure.tgt over all enabled targets TARGET_OBS= @@ -691,19 +687,17 @@ fi # --------------------- # dnl Utility to simplify finding libpython. -dnl $1 = pythonX.Y -dnl $2 = the shell variable to assign the result to +dnl $1 = the shell variable to assign the result to dnl If libpython is found we store $version here. -dnl $3 = additional flags to add to CPPFLAGS -dnl $4 = additional flags to add to LIBS +dnl $2 = additional flags to add to CPPFLAGS +dnl $3 = additional flags to add to LIBS AC_DEFUN([AC_TRY_LIBPYTHON], [ - version=$1 - define([have_libpython_var],$2) - new_CPPFLAGS=$3 - new_LIBS=$4 - AC_MSG_CHECKING([for ${version}]) + define([have_libpython_var],$1) + new_CPPFLAGS=$2 + new_LIBS=$3 + AC_MSG_CHECKING([for python]) save_CPPFLAGS=$CPPFLAGS save_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" @@ -711,7 +705,7 @@ AC_DEFUN([AC_TRY_LIBPYTHON], found_usable_python=no AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "Python.h"]], [[Py_Initialize ();]])], - [have_libpython_var=${version} + [have_libpython_var=yes found_usable_python=yes PYTHON_CPPFLAGS=$new_CPPFLAGS PYTHON_LIBS=$new_LIBS]) @@ -868,47 +862,18 @@ else have_libpython=no if test "${have_python_config}" = yes; then - # Determine the Python version by extracting "-lpython" - # part of the python_libs. is usually X.Y with X and Y - # being decimal numbers, but can also be XY (seen on Windows). - # - # The extraction is performed using sed with a regular expression. - # Initially, the regexp used was using the '?' quantifier to make - # the dot in the version number optional. Unfortunately, this - # does not work with non-GNU versions of sed because, because of - # what looks like a limitation (the '?' quantifier does not work - # with back-references). We work around this limitation by using - # the '*' quantifier instead. It means that, in theory, we might - # match unexpected version strings such as "-lpython2..7", but - # this seems unlikely in practice. And even if that happens, - # an error will be triggered later on, when checking that version - # number. - python_version=`echo " ${python_libs} " \ - | sed -e 's,^.* -l\(python[[0-9]]*[[.]]*[[0-9]]*\).*$,\1,'` - case "${python_version}" in - python*) - AC_TRY_LIBPYTHON(${python_version}, have_libpython, - ${python_includes}, ${python_libs}) - ;; - *) - AC_MSG_ERROR([unable to determine python version from ${python_libs}]) - ;; - esac + AC_TRY_LIBPYTHON(have_libpython, + ${python_includes}, ${python_libs}) elif test "${have_python_config}" != failed; then if test "${have_libpython}" = no; then - AC_TRY_LIBPYTHON(python2.7, have_libpython, + AC_TRY_LIBPYTHON(have_libpython, ${python_includes}, "-lpython2.7 ${python_libs}") fi if test "${have_libpython}" = no; then - AC_TRY_LIBPYTHON(python2.6, have_libpython, + AC_TRY_LIBPYTHON(have_libpython, ${python_includes}, "-lpython2.6 ${python_libs}") fi fi - if test "${have_libpython}" = python2.7 -o "${have_libpython}" = python27; then - AC_DEFINE(HAVE_LIBPYTHON2_7, 1, [Define if Python 2.7 is being used.]) - elif test "${have_libpython}" = python2.6 -o "${have_libpython}" = python26; then - AC_DEFINE(HAVE_LIBPYTHON2_6, 1, [Define if Python 2.6 is being used.]) - fi if test "${have_libpython}" = no; then case "${with_python}" in @@ -979,23 +944,6 @@ if test "${have_libpython}" != no; then fi ;; esac - - # Note that "python -m threading" cannot be used to check for - # threading support due to a bug in Python 2.7.3 - # (http://bugs.python.org/issue15567). - AC_MSG_CHECKING(whether python supports threads) - saved_CPPFLAGS="${CPPFLAGS}" - CPPFLAGS="${PYTHON_CPPFLAGS}" - # Note that the test is reversed so that python_has_threads=yes on - # unexpected failures. - AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ -#include -#ifdef WITH_THREAD -# error -#endif - ]])], [python_has_threads=no], [python_has_threads=yes]) - AC_MSG_RESULT(${python_has_threads}) - CPPFLAGS="${saved_CPPFLAGS}" else # Even if Python support is not compiled in, we need to have this file # included so that the "python" command, et.al., still exists. @@ -1843,6 +1791,9 @@ GDB_AC_DEFINE_RELOCATABLE(TARGET_SYSTEM_ROOT, sysroot, ${ac_define_dir}) GDB_AC_WITH_DIR(SYSTEM_GDBINIT, system-gdbinit, [automatically load a system-wide gdbinit file], []) +GDB_AC_WITH_DIR(SYSTEM_GDBINIT_DIR, system-gdbinit-dir, + [automatically load system-wide gdbinit files from this directory], + []) AM_GDB_WARNINGS AM_GDB_UBSAN