From 1776e3e59ca6200dff981894361b8b49cb453766 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Wed, 9 Oct 2019 10:42:00 +0100 Subject: Fix --enable-libctf and --disable-static This fixes test runs and compilation when --disable-libctf, --disable-static, or --enable-shared are passed. Changes since v2: Use GCC_ENABLE and fix indentation. Fix prototype using 'void'. Use 'unsupported' and gdb_caching_proc. Changes since v3: Adapt to upstream changes providing skip_ctf_tests. Changes since v4: Adapt to upstream changes in the seven months (!) since I last looked at this. gdb/ChangeLog * configure.ac: Add --enable-libctf: handle --disable-static properly. * acinclude.m4: sinclude ../config/enable.m4. * Makefile.in (aclocal_m4_deps): Adjust accordingly. (LIBCTF): Substitute in. (CTF_DEPS): New, likewise. (CLIBS): libctf needs symbols from libbfd: move earlier. (CDEPS): Use CTF_DEPS, not LIBCTF, now LIBCTF can include rpath flags. * ctfread.c: Surround in ENABLE_LIBCTF. (elfctf_build_psymtabs) [!ENABLE_LIBCTF]: New stub. * configure: Regenerate. * config.in: Likewise. gdb/testsuite/ChangeLog * configure.ac: Add --enable-libctf. * aclocal.m4: sinclude ../config/enable.m4. * Makefile.in (site.exp): Add enable_libctf to site.exp. * lib/gdb.exp (skip_ctf_tests): Use it. * gdb.base/ctf-constvars.exp: Error message tweak. * gdb.base/ctf-ptype.exp: Likewise. * configure: Regenerate. --- gdb/configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gdb/configure.ac') diff --git a/gdb/configure.ac b/gdb/configure.ac index 6275080..b975cec 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2066,6 +2066,27 @@ AC_ARG_WITH(xxhash, AC_HELP_STRING([--with-xxhash], [use libxxhash for hashing (faster) (auto/yes/no)]), [], [with_xxhash=auto]) +GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections]) +if test x${enable_static} = xno; then + LIBCTF="-Wl,--rpath,../libctf/.libs ../libctf/.libs/libctf.so" + CTF_DEPS="../libctf/.libs/libctf.so" +else + LIBCTF="../libctf/.libs/libctf.a" + CTF_DEPS="$LIBCTF" +fi +if test "${enable_libctf}" = yes; then + AC_DEFINE(ENABLE_LIBCTF, 1, [Handle .ctf type-info sections]) +else + LIBCTF= + CTF_DEPS= +fi +AC_SUBST(ENABLE_LIBCTF) +AC_SUBST(LIBCTF) +AC_SUBST(CTF_DEPS) + +# If nativefile (NAT_FILE) is not set in configure.nat, we link to an +# empty version. + if test "x$with_xxhash" != "xno"; then AC_LIB_HAVE_LINKFLAGS([xxhash], [], [#include ], -- cgit v1.1