X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fconfigure;h=92818a0a0e00d0d9994b6ed59526146be2eaefb2;hb=144886fa6bdc77ca109153ea4a58e886a36ffff2;hp=2c7db685a5442f4280ce8b45333e97db7d7b2066;hpb=0a4f61e3e4c32971615274aed323a1be06117551;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/configure b/gdb/configure index 2c7db685a5..92818a0a0e 100755 --- a/gdb/configure +++ b/gdb/configure @@ -659,11 +659,14 @@ TARGET_SYSTEM_ROOT CONFIG_LDFLAGS RDYNAMIC ALLOCA +PYTHON_LIBS +PYTHON_CPPFLAGS PYTHON_CFLAGS python_prog_path LTLIBEXPAT LIBEXPAT HAVE_LIBEXPAT +READLINE_TEXI_INCFLAG READLINE_CFLAGS READLINE_DEPS READLINE @@ -975,6 +978,7 @@ with_tk with_x enable_sim enable_multi_ice +enable_gdbserver ' ac_precious_vars='build_alias host_alias @@ -988,7 +992,7 @@ CPP YACC YFLAGS XMKMF' -ac_subdirs_all='doc testsuite +ac_subdirs_all='testsuite gdbtk multi-ice gdbserver' @@ -1635,6 +1639,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] @@ -7880,7 +7886,7 @@ fi -subdirs="$subdirs doc testsuite" +subdirs="$subdirs testsuite" # Check whether to support alternative target configurations @@ -9736,6 +9742,7 @@ if test "$with_system_readline" = yes; then READLINE=-lreadline READLINE_DEPS= READLINE_CFLAGS= + READLINE_TEXI_INCFLAG= # readline-6.0 started to use the name `_rl_echoing_p'. # `$(READLINE_DIR)/' of bundled readline would not resolve in configure. @@ -9773,12 +9780,14 @@ else READLINE='$(READLINE_DIR)/libreadline.a' READLINE_DEPS='$(READLINE)' READLINE_CFLAGS='-I$(READLINE_SRC)/..' + READLINE_TEXI_INCFLAG='-I $(READLINE_DIR)' fi + # Check whether --with-expat was given. if test "${with_expat+set}" = set; then : withval=$with_expat; @@ -10469,6 +10478,13 @@ else # Assume the python binary is ${with_python}/bin/python. python_prog="${with_python}/bin/python" python_prefix= + # If python does not exit ${with_python}/bin, then try in + # ${with_python}. On Windows/MinGW, this is where the Python + # executable is. + if test ! -x "${python_prog}"; then + python_prog="${with_python}/python" + python_prefix= + fi if test ! -x "${python_prog}"; then # Fall back to gdb 7.0/7.1 behaviour. python_prog=missing @@ -10626,34 +10642,39 @@ fi fi fi else - # Fall back to gdb 7.0/7.1 behaviour. - if test -z ${python_prefix}; then - python_includes= - python_libs= - else - python_includes="-I${python_prefix}/include" - python_libs="-L${python_prefix}/lib" - fi + # We do not have a python executable we can use to determine where + # to find the Python headers and libs. We cannot guess the include + # path from the python_prefix either, because that include path + # depends on the Python version. So, there is nothing much we can + # do except assume that the compiler will be able to find those files. + python_includes= + python_libs= have_python_config=no fi - # Having "/pythonX.Y" in the include path is awkward. - # All those python headers get bubbled up to the top inviting lots - # of random collisions. GDB originally didn't use python-config to - # find the compilation parameters and includes "pythonX.Y/" in the - # 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'` - # If we have python-config, only try the configuration it provides. # Otherwise fallback on the old way of trying different versions of # python in turn. 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,'` + | sed -e 's,^.* -l\(python[0-9]*[.]*[0-9]*\).*$,\1,'` case "${python_version}" in python*) @@ -10670,7 +10691,7 @@ $as_echo_n "checking for ${version}... " >&6; } found_usable_python=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "${version}/Python.h" +#include "Python.h" int main () { @@ -10682,12 +10703,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : have_libpython=${version} found_usable_python=yes -else - CPPFLAGS=$save_CPPFLAGS - LIBS=$save_LIBS + PYTHON_CPPFLAGS=$new_CPPFLAGS + PYTHON_LIBS=$new_LIBS fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 $as_echo "${found_usable_python}" >&6; } @@ -10712,7 +10734,7 @@ $as_echo_n "checking for ${version}... " >&6; } found_usable_python=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "${version}/Python.h" +#include "Python.h" int main () { @@ -10724,12 +10746,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : have_libpython=${version} found_usable_python=yes -else - CPPFLAGS=$save_CPPFLAGS - LIBS=$save_LIBS + PYTHON_CPPFLAGS=$new_CPPFLAGS + PYTHON_LIBS=$new_LIBS fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 $as_echo "${found_usable_python}" >&6; } @@ -10749,7 +10772,7 @@ $as_echo_n "checking for ${version}... " >&6; } found_usable_python=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "${version}/Python.h" +#include "Python.h" int main () { @@ -10761,12 +10784,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : have_libpython=${version} found_usable_python=yes -else - CPPFLAGS=$save_CPPFLAGS - LIBS=$save_LIBS + PYTHON_CPPFLAGS=$new_CPPFLAGS + PYTHON_LIBS=$new_LIBS fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 $as_echo "${found_usable_python}" >&6; } @@ -10786,7 +10810,7 @@ $as_echo_n "checking for ${version}... " >&6; } found_usable_python=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "${version}/Python.h" +#include "Python.h" int main () { @@ -10798,12 +10822,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : have_libpython=${version} found_usable_python=yes -else - CPPFLAGS=$save_CPPFLAGS - LIBS=$save_LIBS + PYTHON_CPPFLAGS=$new_CPPFLAGS + PYTHON_LIBS=$new_LIBS fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 $as_echo "${found_usable_python}" >&6; } @@ -10823,7 +10848,7 @@ $as_echo_n "checking for ${version}... " >&6; } found_usable_python=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "${version}/Python.h" +#include "Python.h" int main () { @@ -10835,30 +10860,31 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : have_libpython=${version} found_usable_python=yes -else - CPPFLAGS=$save_CPPFLAGS - LIBS=$save_LIBS + PYTHON_CPPFLAGS=$new_CPPFLAGS + PYTHON_LIBS=$new_LIBS fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 $as_echo "${found_usable_python}" >&6; } fi fi - if test "${have_libpython}" = python2.7; then + if test "${have_libpython}" = python2.7 -o "${have_libpython}" = python27; then $as_echo "#define HAVE_LIBPYTHON2_7 1" >>confdefs.h - elif test "${have_libpython}" = python2.6; then + elif test "${have_libpython}" = python2.6 -o "${have_libpython}" = python26; then $as_echo "#define HAVE_LIBPYTHON2_6 1" >>confdefs.h - elif test "${have_libpython}" = python2.5; then + elif test "${have_libpython}" = python2.5 -o "${have_libpython}" = python25; then $as_echo "#define HAVE_LIBPYTHON2_5 1" >>confdefs.h - elif test "${have_libpython}" = python2.4; then + elif test "${have_libpython}" = python2.4 -o "${have_libpython}" = python24; then $as_echo "#define HAVE_LIBPYTHON2_4 1" >>confdefs.h @@ -10957,6 +10983,21 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${PYTHON_CFLAGS}" >&5 $as_echo "${PYTHON_CFLAGS}" >&6; } fi + + # On IRIX, type siginfo is not defined. Instead, sys/siginfo.h provides: + # #if _SGIAPI + # #define siginfo __siginfo + # #endif + # The problem is that including Python causes some XOPEN macros to be + # unilaterally defined, and that in turn causes _SGIAPI to evaluate + # to false. So, we work around this issue by defining siginfo ourself + # though the command-line. + case "$gdb_host" in + irix*) if test "${GCC}" = yes; then + CPPFLAGS="$CPPFLAGS -Dsiginfo=__siginfo" + fi + ;; + esac else # Even if Python support is not compiled in, we need to have these files # included. @@ -10966,6 +11007,8 @@ else fi + + # ------------------------- # # Checks for header files. # # ------------------------- # @@ -14306,27 +14349,6 @@ $as_echo "$found" >&6; } if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in - hpux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HPUX/OSF thread support" >&5 -$as_echo_n "checking for HPUX/OSF thread support... " >&6; } - if test -f /usr/include/dce/cma_config.h ; then - if test "$GCC" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_HPUX_THREAD_SUPPORT 1" >>confdefs.h - - CONFIG_OBS="${CONFIG_OBS} hpux-thread.o" - CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (suppressed because you are not using GCC)" >&5 -$as_echo "no (suppressed because you are not using GCC)" >&6; } - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; solaris*) # See if thread_db library is around for Solaris thread debugging. # Note that we must explicitly test for version 1 of the library @@ -14465,6 +14487,22 @@ $as_echo "$gdb_cv_have_aix_thread_debug" >&6; } CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" CONFIG_OBS="${CONFIG_OBS} aix-thread.o" CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug" + + # Older versions of AIX do not provide the declaration for + # the getthrds function (it appears that it was introduced + # with AIX 6.x). + ac_fn_c_check_decl "$LINENO" "getthrds" "ac_cv_have_decl_getthrds" "#include +" +if test "x$ac_cv_have_decl_getthrds" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETTHRDS $ac_have_decl +_ACEOF + fi ;; esac @@ -14934,6 +14972,10 @@ OLD_LIBS=$LIBS CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" LDFLAGS="$LDFLAGS -L../bfd -L../libiberty" intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` +# -ldl is provided by bfd/Makfile.am (LIBDL) . +if test "$plugins" = "yes"; then + LIBS="-ldl $LIBS" +fi LIBS="-lbfd -liberty $intl $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5 $as_echo_n "checking for ELF support in BFD... " >&6; } @@ -14969,6 +15011,10 @@ if test $gdb_cv_var_elf = yes; then $as_echo "#define HAVE_ELF 1" >>confdefs.h + # -ldl is provided by bfd/Makfile.am (LIBDL) . + if test "$plugins" = "yes"; then + OLD_LIBS="-ldl $OLD_LIBS" + fi fi CFLAGS=$OLD_CFLAGS LDFLAGS=$OLD_LDFLAGS @@ -15816,8 +15862,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 @@ -15825,12 +15883,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. @@ -15869,7 +15934,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 doc/Makefile gnulib/Makefile data-directory/Makefile" ac_config_commands="$ac_config_commands default" @@ -16635,7 +16700,9 @@ do "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:gdbinit.in" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "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;;