TARGET_SYSTEM_ROOT_DEFINE
TARGET_SYSTEM_ROOT
CONFIG_LDFLAGS
+RDYNAMIC
ALLOCA
PYTHON_CFLAGS
python_prog_path
--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
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
int
main ()
{
-#ifndef $2
- (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
#endif
;
+
if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
if test "x$prefix" = xNONE; then
test_prefix=/usr/local
+
# GDB's datadir relocation
+
if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
if test "x$prefix" = xNONE; then
test_prefix=/usr/local
+
# Check whether --with-relocated-sources was given.
if test "${with_relocated_sources+set}" = set; then :
withval=$with_relocated_sources; reloc_srcdir="${withval}"
+
# Check whether --with-python was given.
if test "${with_python+set}" = set; then :
withval=$with_python;
$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
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.
# 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
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}
{ $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
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
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
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).
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"
;;
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
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
+
if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
if test "x$prefix" = xNONE; then
test_prefix=/usr/local
+
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror; case "${enableval}" in