Do not build libctf for targets that do not use the ELF file format.
[deliverable/binutils-gdb.git] / binutils / configure.ac
index 0d3e732a6faac4461a5f0cec909cb776e98a38e4..71be51e6a6f2c4de59adef1b9765fad841c3d780 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl
-dnl   Copyright (C) 2012-2018 Free Software Foundation, Inc.
+dnl   Copyright (C) 2012-2019 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
@@ -17,7 +17,6 @@ dnl along with this program; see the file COPYING3.  If not see
 dnl <http://www.gnu.org/licenses/>.
 dnl
 
-AC_PREREQ(2.59)
 m4_include([../bfd/version.m4])
 AC_INIT([binutils], BFD_VERSION)
 AC_CONFIG_SRCDIR(ar.c)
@@ -131,6 +130,7 @@ AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.
 AC_HEADER_SYS_WAIT
 ACX_HEADER_STRING
 AC_FUNC_ALLOCA
+AC_FUNC_MMAP
 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale)
 AC_CHECK_FUNC([mkstemp],
              AC_DEFINE([HAVE_MKSTEMP], 1,
@@ -393,6 +393,35 @@ changequote([,])dnl
     fi
 done
 
+
+AC_MSG_CHECKING([for libctf support])
+case "${target}" in
+  *-*-pe | *-*-*vms* | *-*-darwin | *-*-*coff* | *-*-wince | *-*-mingw*)
+    AC_CACHE_VAL(bu_cv_libctf_support, bu_cv_libctf_support=no)
+    ;;
+  *-*-aout | *-*-osf* | *-*-go32 | *-*-macos* | *-*-rhapsody*)
+    AC_CACHE_VAL(bu_cv_libctf_support, bu_cv_libctf_support=no)
+    ;;
+  *-*-netbsdpe | *-*-cygwin* | *-*-pep | *-*-msdos | *-*-winnt)
+    AC_CACHE_VAL(bu_cv_libctf_support, bu_cv_libctf_support=no)
+    ;;
+  ns32k-*-* | pdp11-*-* | *-*-aix* | *-*-netbsdaout)
+    AC_CACHE_VAL(bu_cv_libctf_support, bu_cv_libctf_support=no)
+    ;;
+  *)
+    AC_CACHE_VAL(bu_cv_libctf_support, bu_cv_libctf_support=yes)
+  ;;      
+esac
+AC_MSG_RESULT($bu_cv_libctf_support)
+if test $bu_cv_libctf_support = yes; then
+  AC_DEFINE(HAVE_LIBCTF, 1, [Is libctf available?])
+fi
+LIBCTF=
+if test $bu_cv_libctf_support = yes; then
+  LIBCTF=../libctf/libctf.a
+fi
+
+
 # Uniq objdump private vector, build objdump target ofiles.
 od_files=
 f=""
@@ -449,6 +478,7 @@ AC_SUBST(BUILD_MISC)
 AC_SUBST(BUILD_INSTALL_MISC)
 AC_SUBST(OBJDUMP_DEFS)
 AC_SUBST(OBJDUMP_PRIVATE_OFILES)
+AC_SUBST(LIBCTF)
 
 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
 
This page took 0.024073 seconds and 4 git commands to generate.