Automatic date update in version.in
[deliverable/binutils-gdb.git] / libctf / configure.ac
index f31108c0fade9a9efb2ee895ab5ca342676796fc..80644b89d67a9ba50076fbf87661a9447c153344 100644 (file)
@@ -1,7 +1,7 @@
 dnl                                            -*- Autoconf -*-
 dnl Process this file with autoconf to produce a configure script.
 dnl
-dnl   Copyright (C) 2019-2020 Free Software Foundation, Inc.
+dnl   Copyright (C) 2019-2021 Free Software Foundation, Inc.
 dnl
 dnl This file is free software; you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -19,10 +19,14 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_PREREQ(2.64)
-AC_INIT([libctf library], 1.2.0-pre)
+AC_INIT([libctf], 1.2.0)
 AC_CONFIG_SRCDIR(ctf-impl.h)
+AC_CONFIG_MACRO_DIR(..)
 AC_CONFIG_MACRO_DIR(../config)
 AC_CONFIG_MACRO_DIR(../bfd)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
 AC_USE_SYSTEM_EXTENSIONS
 AM_INIT_AUTOMAKE
 
@@ -64,9 +68,15 @@ ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_libctf_warn_cflags])
 
 AC_FUNC_MMAP
 # Needed for BFD capability checks.
-AC_SEARCH_LIBS(dlopen, dl)
+AC_SEARCH_LIBS(dlsym, dl)
 AM_ZLIB
 
+GCC_ENABLE([libctf-hash-debugging], [no], [], [Enable expensive debugging of CTF deduplication type hashing])
+if test "${enable_libctf_hash_debugging}" = yes; then
+    AC_DEFINE(ENABLE_LIBCTF_HASH_DEBUGGING, 1, [Enable expensive debugging of CTF deduplication type hashing])
+fi
+AM_CONDITIONAL(ENABLE_LIBCTF_HASH_DEBUGGING, test "${enable_libctf_hash_debugging}" = yes)
+
 # Similar to GDB_AC_CHECK_BFD.
 OLD_CFLAGS=$CFLAGS
 OLD_LDFLAGS=$LDFLAGS
@@ -81,6 +91,7 @@ intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
 LIBS="-lbfd -liberty -lz $intl $LIBS"
 AC_CACHE_CHECK([for ELF support in BFD], ac_cv_libctf_bfd_elf,
 [AC_TRY_LINK([#include <stdlib.h>
+            #include <string.h>
             #include "bfd.h"
             #include "elf-bfd.h"],
            [(void) bfd_section_from_elf_index (NULL, 0);
@@ -100,9 +111,9 @@ AC_C_BIGENDIAN
 AC_CHECK_HEADERS(byteswap.h endian.h)
 AC_CHECK_FUNCS(pread)
 
-AC_CHECK_DECLS([asprintf])
 dnl Check for bswap_{16,32,64}
 AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64], [], [], [[#include <byteswap.h>]])
+AC_CHECK_DECLS([asprintf, vasprintf, stpcpy])
 
 dnl Check for qsort_r.  (Taken from gnulib.)
 AC_CHECK_FUNCS_ONCE([qsort_r])
@@ -162,56 +173,50 @@ if test $ac_cv_libctf_macro_O_CLOEXEC = yes; then
            [Whether the platform has a definition of O_CLOEXEC.])
 fi
 
-# Horrible hacks to build DLLs on Windows and a shared library elsewhere.
-SHARED_LIBADD=
+CTF_LIBADD="-L`pwd`/../libiberty -liberty"
 SHARED_LDFLAGS=
-BFD_LIBADD=
-BFD_DEPENDENCIES=
+
+# Horrible hacks to build DLLs on Windows and a shared library elsewhere.
 if test "$enable_shared" = "yes"; then
 # When building a shared libctf, link against the pic version of libiberty
 # so that apps that use libctf won't need libiberty just to satisfy any
-# libctf references.
-# We can't do that if a pic libiberty is unavailable since including non-pic
-# code would insert text relocations into libctf.
+# libctf references.  We can't do that if a pic libiberty is unavailable
+# since including non-pic # code would insert text relocations into libctf.
 # Note that linking against libbfd as we do here, which is itself linked
 # against libiberty, may not satisfy all the libctf libiberty references
 # since libbfd may not pull in the entirety of libiberty.
+# Also, jam libintl into the right place in all of this: after libiberty,
+# which uses it, but before -lcygwin, which it uses.
 changequote(,)dnl
   x=`sed -n -e 's/^[   ]*PICFLAG[      ]*=[    ]*//p' < ../libiberty/Makefile | sed -n '$p'`
 changequote([,])dnl
   if test -n "$x"; then
-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
+    CTF_LIBADD="-L`pwd`/../libiberty/pic -liberty"
   fi
+fi
+
+CTF_LIBADD="$CTF_LIBADD $LIBINTL"
 
+if test "$enable_shared" = "yes"; then
   case "${host}" in
   # More hacks to build DLLs on Windows.
     *-*-cygwin*)
       SHARED_LDFLAGS="-no-undefined"
-      SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
-      BFD_LIBADD="-L`pwd`/../bfd -lbfd"
-      ;;
-
-    *-*-darwin*)
-      BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib"
-      BFD_DEPENDENCIES="../bfd/libbfd.la"
-      ;;
-    *)
-      case "$host_vendor" in
-       hp)
-         BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl"
-         ;;
-       *)
-         BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
-         ;;
-      esac
-      BFD_DEPENDENCIES="../bfd/libbfd.la"
+      CTF_LIBADD="$CTF_LIBADD -lcygwin"
       ;;
   esac
 fi
 AC_SUBST(SHARED_LDFLAGS)
-AC_SUBST(SHARED_LIBADD)
-AC_SUBST(BFD_LIBADD)
-AC_SUBST(BFD_DEPENDENCIES)
+AC_SUBST(CTF_LIBADD)
+
+AC_PATH_PROG([EXPECT], [expect])
+AC_CACHE_CHECK([for Tcl supporting try/catch], [ac_cv_libctf_tcl_try],
+  [ac_cv_libctf_tcl_try=`if test -z $EXPECT; then echo no; else $EXPECT << EOF
+if @<:@llength @<:@info commands try@:>@@:>@ then { puts yes } else { puts no }
+EOF
+fi`
+])
+AM_CONDITIONAL(TCL_TRY, test "${ac_cv_libctf_tcl_try}" = yes)
 
 # Use a version script, if possible, or an -export-symbols-regex otherwise.
 VERSION_FLAGS='-export-symbols-regex ctf_.*'
@@ -223,3 +228,5 @@ AC_SUBST(VERSION_FLAGS)
 AC_CONFIG_FILES(Makefile)
 AC_CONFIG_HEADERS(config.h)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER
This page took 0.030517 seconds and 4 git commands to generate.