AM_MAINTAINER_MODE
# Set the 'development' global.
-. $srcdir/development.sh
+. $srcdir/../bfd/development.sh
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_MSG_RESULT(${PYTHON_CFLAGS})
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.
- #
# On x64 Windows, Python's include headers, and pyconfig.h in
# particular, rely on MS_WIN64 macro to detect that it's a 64bit
# version of Windows. Unfortunately, MS_WIN64 is only defined if
# solved as of 2012-10-02 (http://bugs.python.org/issue4709).
case "$gdb_host" in
- irix*) if test "${GCC}" = yes; then
- CPPFLAGS="$CPPFLAGS -Dsiginfo=__siginfo"
- fi
- ;;
mingw64)
if test "${GCC}" = yes; then
CPPFLAGS="$CPPFLAGS -DMS_WIN64"
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_CPPFLAGS)
AC_SUBST(PYTHON_LIBS)
+AM_CONDITIONAL(HAVE_PYTHON, test "${have_libpython}" != no)
# -------------------- #
# Check for libguile. #
# -------------------- #
-dnl We check guile with pkg-config.
-
-AC_PATH_PROG(pkg_config_prog_path, pkg-config, missing)
-
dnl Utility to simplify finding libguile.
dnl $1 = pkg-config-program
dnl $2 = space-separate list of guile versions to try
guile_version_list=$2
flag_errors=$3
define([have_libguile_var],$4)
- if test "${pkg_config}" = "missing"; then
- AC_ERROR(pkg-config program not found)
- fi
- if test ! -f "${pkg_config}"; then
- AC_ERROR(pkg-config program ${pkg_config} not found)
- fi
found_usable_guile=checking
AC_MSG_CHECKING([for usable guile from ${pkg_config}])
for guile_version in ${guile_version_list}; do
dnl that's bad.
new_CPPFLAGS=`${pkg_config} --cflags ${guile_version}`
if test $? != 0; then
- AC_ERROR(failure running pkg-config --cflags ${guile_version})
+ AC_MSG_ERROR([failure running pkg-config --cflags ${guile_version}])
fi
new_LIBS=`${pkg_config} --libs ${guile_version}`
if test $? != 0; then
- AC_ERROR(failure running pkg-config --libs ${guile_version})
+ AC_MSG_ERROR([failure running pkg-config --libs ${guile_version}])
fi
dnl If we get this far, great.
found_usable_guile=${guile_version}
done
if test "${found_usable_guile}" = "checking"; then
if test "${flag_errors}" = "yes"; then
- AC_ERROR(unable to find usable guile version from "${guile_version_list}")
+ AC_MSG_ERROR([unable to find usable guile version from "${guile_version_list}"])
else
found_usable_guile=no
fi
LIBS=$save_LIBS
if test "${found_usable_guile}" = no; then
if test "${flag_errors}" = yes; then
- AC_MSG_FAILURE(linking guile version ${guile_version} test program failed)
+ AC_MSG_FAILURE([linking guile version ${guile_version} test program failed])
fi
fi
fi
dnl pkg-config --exists $version
dnl pkg-config --cflags $version
dnl pkg-config --libs $version
-dnl $version will be the default guile version (currently guile-2.0),
-dnl but the program is free to ignore this.
+dnl pkg-config --variable guild $version
+dnl The script will be called with $version having each value in
+dnl $try_guile_versions until --exists indicates success.
AC_ARG_WITH(guile,
AS_HELP_STRING([--with-guile@<:@=GUILE@:>@], [include guile support (auto/yes/no/<guile-version>/<pkg-config-program>)]),
AC_MSG_CHECKING([whether to use guile])
AC_MSG_RESULT([$with_guile])
-try_guile_versions="guile-2.0"
+dnl We check guile with pkg-config.
+AC_PATH_PROG(pkg_config_prog_path, pkg-config, missing)
+
+try_guile_versions="guile-2.2 guile-2.0"
have_libguile=no
case "${with_guile}" in
no)
AC_MSG_WARN([guile support disabled; some features will be unavailable.])
;;
auto)
- AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${try_guile_versions}, no, have_libguile)
+ if test "${pkg_config_prog_path}" = "missing"; then
+ AC_MSG_WARN([pkg-config not found, guile support disabled])
+ else
+ AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${try_guile_versions}, no, have_libguile)
+ fi
;;
yes)
+ if test "${pkg_config_prog_path}" = "missing"; then
+ AC_MSG_ERROR([pkg-config not found])
+ fi
AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${try_guile_versions}, yes, have_libguile)
;;
[[\\/]]* | ?:[[\\/]]*)
- AC_TRY_LIBGUILE(${with_guile}, ${try_guile_versions}, yes, have_libguile)
+ if test -x "${with_guile}"; then
+ AC_TRY_LIBGUILE(${with_guile}, ${try_guile_versions}, yes, have_libguile)
+ else
+ AC_MSG_ERROR([Guile config program not executable: ${with_guile}])
+ fi
;;
"" | */*)
# Disallow --with=guile="" and --with-guile=foo/bar.
- AC_ERROR(invalid value for --with-guile)
+ AC_MSG_ERROR([invalid value for --with-guile])
;;
*)
# A space separate list of guile versions to try, in order.
+ if test "${pkg_config_prog_path}" = "missing"; then
+ AC_MSG_ERROR([pkg-config not found])
+ fi
AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${with_guile}, yes, have_libguile)
;;
esac
if test "${have_libguile}" != no; then
+ dnl Get the name of the 'guild' program.
+ case "${with_guile}" in
+ [[\\/]]* | ?:[[\\/]]*)
+ GDB_GUILE_PROGRAM_NAMES(["${with_guile}"], ["${guile_version}"])
+ ;;
+ *)
+ GDB_GUILE_PROGRAM_NAMES(["${pkg_config_prog_path}"], ["${guile_version}"])
+ ;;
+ esac
+
+ dnl Make sure guild can handle this host.
+ GDB_TRY_GUILD([$srcdir/guile/lib/gdb/support.scm])
+ dnl If not, disable guile support.
+ if test "$ac_cv_guild_ok" = no; then
+ have_libguile=no
+ AC_MSG_WARN(disabling guile support, $GUILD fails compiling for $host)
+ fi
+fi
+
+if test "${have_libguile}" != no; then
AC_DEFINE(HAVE_GUILE, 1, [Define if Guile interpreter is being linked in.])
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_GUILE_OBS)"
CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_GUILE_DEPS)"
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_GUILE_SRCS)"
CONFIG_INSTALL="$CONFIG_INSTALL install-guile"
ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_GUILE_CFLAGS)"
+
+ dnl The 'scm_new_smob' function appeared in Guile 2.0.6.
+ save_LIBS="$LIBS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LIBS="$GUILE_LIBS"
+ CPPFLAGS="$GUILE_CPPFLAGS"
+ AC_CHECK_FUNCS([scm_new_smob])
+ LIBS="$save_LIBS"
+ CPPFLAGS="$save_CPPFLAGS"
else
# Even if Guile support is not compiled in, we need to have these files
# included.
fi
AC_SUBST(GUILE_CPPFLAGS)
AC_SUBST(GUILE_LIBS)
+AM_CONDITIONAL(HAVE_GUILE, test "${have_libguile}" != no)
# --------------------- #
# Check for libmcheck. #
sigaction sigprocmask sigsetmask socketpair \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
setrlimit getrlimit posix_madvise waitpid lstat \
- ptrace64])
+ ptrace64 sigaltstack])
AM_LANGINFO_CODESET
GDB_AC_COMMON
fi
fi
-# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
-# since sigsetjmp might only be defined as a macro.
-AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
-[AC_TRY_COMPILE([
-#include <setjmp.h>
-], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
-gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
-if test $gdb_cv_func_sigsetjmp = yes; then
- AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
-fi
-
# Assume we'll default to using the included libiberty regex.
gdb_use_included_regex=yes
struct bt_ctf_event *event = NULL;
const struct bt_definition *scope;
+ bt_iter_set_pos (bt_ctf_get_iter (NULL), pos);
scope = bt_ctf_get_top_level_scope (event,
BT_STREAM_EVENT_HEADER);
bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id"));