]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/configure.ac
2.41 Release sources
[thirdparty/binutils-gdb.git] / binutils / configure.ac
index 84c287c69a631b0caf830a974ad6746f62e907a5..b5798bf755f314d00cfcf2d578e9a1d1f05c0420 100644 (file)
@@ -1,31 +1,31 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl
-dnl   Copyright (C) 2012-2014 Free Software Foundation, Inc.
+dnl   Copyright (C) 2012-2023 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
 dnl the Free Software Foundation; either version 3 of the License, or
 dnl (at your option) any later version.
-dnl 
+dnl
 dnl This program is distributed in the hope that it will be useful,
 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 dnl GNU General Public License for more details.
-dnl 
+dnl
 dnl You should have received a copy of the GNU General Public License
 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])
+m4_include([../config/debuginfod.m4])
 AC_INIT([binutils], BFD_VERSION)
 AC_CONFIG_SRCDIR(ar.c)
 
 AC_CANONICAL_TARGET
-AC_ISC_POSIX
 
 AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
 
 AC_PROG_CC
 AC_GNU_SOURCE
@@ -34,6 +34,19 @@ AC_USE_SYSTEM_EXTENSIONS
 LT_INIT
 ACX_LARGEFILE
 
+ac_checking=
+. ${srcdir}/../bfd/development.sh
+test "$development" = true && ac_checking=yes
+AC_ARG_ENABLE(checking,
+[  --enable-checking       enable run-time checks],
+[case "${enableval}" in
+  no|none)  ac_checking= ;;
+  *)       ac_checking=yes ;;
+esac])dnl
+if test x$ac_checking != x ; then
+  AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.])
+fi
+
 AC_ARG_ENABLE(targets,
 [  --enable-targets        alternative target configurations],
 [case "${enableval}" in
@@ -43,6 +56,7 @@ AC_ARG_ENABLE(targets,
   *)        enable_targets=$enableval ;;
 esac])dnl
 
+
 AC_ARG_ENABLE(deterministic-archives,
 [AS_HELP_STRING([--enable-deterministic-archives],
                [ar and ranlib default to -D behavior])], [
@@ -55,6 +69,7 @@ fi], [default_ar_deterministic=0])
 AC_DEFINE_UNQUOTED(DEFAULT_AR_DETERMINISTIC, $default_ar_deterministic,
                   [Should ar and ranlib use -D behavior by default?])
 
+
 AC_ARG_ENABLE(default-strings-all,
 [AS_HELP_STRING([--disable-default-strings-all],
                [strings defaults to --data behavior])], [
@@ -67,6 +82,56 @@ fi], [default_strings_all=1])
 AC_DEFINE_UNQUOTED(DEFAULT_STRINGS_ALL, $default_strings_all,
                   [Should strings use -a behavior by default?])
 
+
+AC_ARG_ENABLE(f-for-ifunc-symbols,
+[AS_HELP_STRING([--enable-f-for-ifunc-symbols],
+       [Have nm use F and f for global and local ifunc symbols])], [
+if test "${enableval}" = no; then
+  default_f_for_ifunc=0
+else
+  default_f_for_ifunc=1
+fi], [default_f_for_ifunc=0])
+
+AC_DEFINE_UNQUOTED(DEFAULT_F_FOR_IFUNC_SYMBOLS, $default_f_for_ifunc,
+                  [Have nm use F and f for global and local ifunc symbols])
+
+
+AC_ARG_ENABLE(follow-debug-links,
+[AS_HELP_STRING([--enable-follow-debug-links],
+       [Have readelf and objdump follow debug links by default])], [
+if test "${enableval}" = no; then
+  default_for_follow_links=0
+else
+  default_for_follow_links=1
+fi], [default_for_follow_links=1])
+
+AC_DEFINE_UNQUOTED(DEFAULT_FOR_FOLLOW_LINKS, $default_for_follow_links,
+                  [Have readelf and objdump follow debug links by default])
+
+
+
+
+AC_ARG_ENABLE(colored-disassembly,
+[AS_HELP_STRING([--enable-colored-disassembly],
+       [Have objdump use colors in its disassembly by default])], [
+if test "${enableval}" = no; then
+  default_for_colored_disassembly=0
+else
+  default_for_colored_disassembly=1
+fi], [default_for_colored_disassembly=0])
+
+AC_DEFINE_UNQUOTED(DEFAULT_FOR_COLORED_DISASSEMBLY, $default_for_colored_disassembly,
+                  [Have objdump use colors in its disassembly by default])
+
+
+AC_DEBUGINFOD
+
+GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections])
+if test "${enable_libctf}" = yes; then
+    AC_DEFINE(ENABLE_LIBCTF, 1, [Handle .ctf type-info sections])
+fi
+AM_CONDITIONAL(ENABLE_LIBCTF, test "${enable_libctf}" = yes)
+
 AM_BINUTILS_WARNINGS
 
 AC_CONFIG_HEADERS(config.h:config.in)
@@ -89,7 +154,7 @@ fi
 AC_PROG_YACC
 AM_PROG_LEX
 
-ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW hr"
+ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW"
 ZW_GNU_GETTEXT_SISTER_DIR
 AM_PO_SUBDIRS
 
@@ -124,51 +189,69 @@ case "${host}" in
 esac
 AC_SUBST(DEMANGLER_NAME)
 
-AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h locale.h sys/param.h wchar.h)
+# We use headers from include/ that check various HAVE_*_H macros, thus
+# should ensure they are set by configure.  This is true even when C99
+# guarantees they are available.
+# plugin-api.h tests HAVE_STDINT_H and HAVE_INTTYPES_H
+# Besides those, we need to check anything used in binutils/ not in C99.
+AC_CHECK_HEADERS(fcntl.h inttypes.h stdint.h sys/file.h \
+                sys/stat.h sys/time.h sys/types.h unistd.h)
 AC_HEADER_SYS_WAIT
-ACX_HEADER_STRING
-AC_FUNC_ALLOCA
-AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale)
-AC_CHECK_FUNC([mkstemp],
-             AC_DEFINE([HAVE_MKSTEMP], 1,
-             [Define to 1 if you have the `mkstemp' function.]))
-AC_CHECK_FUNC([mkdtemp],
-              AC_DEFINE([HAVE_MKDTEMP], 1,
-              [Define to 1 if you have the `mkdtemp' function.]))
-  AC_MSG_CHECKING([for mbstate_t])
-  AC_TRY_COMPILE([#include <wchar.h>],
-  [mbstate_t teststate;],
-  have_mbstate_t=yes, have_mbstate_t=no)
-  AC_MSG_RESULT($have_mbstate_t)
-  if test x"$have_mbstate_t" = xyes; then
-    AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.])
-  fi
+AC_FUNC_MMAP
+AC_CHECK_FUNCS(fseeko fseeko64 getc_unlocked mkdtemp mkstemp utimensat utimes)
+
+AC_MSG_CHECKING([for mbstate_t])
+AC_TRY_COMPILE([#include <wchar.h>],
+[mbstate_t teststate;],
+have_mbstate_t=yes, have_mbstate_t=no)
+AC_MSG_RESULT($have_mbstate_t)
+if test x"$have_mbstate_t" = xyes; then
+  AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.])
+fi
+
+# Copied from gnulib stat-time.m4.
+# We should just switch over to using gnulib.
+AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
+  [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
+     [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
+     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+        [[
+          #include <sys/types.h>
+          #include <sys/stat.h>
+          #if HAVE_SYS_TIME_H
+          # include <sys/time.h>
+          #endif
+          #include <time.h>
+          struct timespec ts;
+          struct stat st;
+        ]],
+        [[
+          st.st_atim = ts;
+        ]])],
+        [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
+        [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
+   if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+     AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
+       [Define to 1 if the type of the st_atim member of a struct stat is
+        struct timespec.])
+   fi],
+  [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
+     [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
+        [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
+           [#include <sys/types.h>
+            #include <sys/stat.h>])],
+        [#include <sys/types.h>
+         #include <sys/stat.h>])],
+     [#include <sys/types.h>
+      #include <sys/stat.h>])],
+  [#include <sys/types.h>
+   #include <sys/stat.h>])
 
 # Some systems have frexp only in -lm, not in -lc.
 AC_SEARCH_LIBS(frexp, m)
 
 AM_LC_MESSAGES
 
-AC_MSG_CHECKING(for time_t in time.h)
-AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
-bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
-AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
-if test $bu_cv_decl_time_t_time_h = yes; then
-  AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
-           [Is the type time_t defined in <time.h>?])
-fi
-
-AC_MSG_CHECKING(for time_t in sys/types.h)
-AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
-bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
-AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
-if test $bu_cv_decl_time_t_types_h = yes; then
-  AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
-           [Is the type time_t defined in <sys/types.h>?])
-fi
-
 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
@@ -195,16 +278,28 @@ if test $bu_cv_header_utime_h = yes; then
   AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
 fi
 
-AC_CHECK_DECLS([environ, fprintf, getc_unlocked, getenv,
-               sbrk, snprintf, stpcpy, strnlen, strstr, vsnprintf])
+AC_CHECK_DECLS([asprintf, environ, getc_unlocked, stpcpy, strnlen])
 
-# Link in zlib if we can.  This allows us to read compressed debug
+# Link in zlib/zstd if we can.  This allows us to read compressed debug
 # sections.  This is used only by readelf.c (objdump uses bfd for
 # reading compressed sections).
 AM_ZLIB
+AC_ZSTD
 
 BFD_BINARY_FOPEN
 
+# Support for the msgpack C library.
+AC_ARG_WITH([msgpack],
+           AC_HELP_STRING([--with-msgpack], [Enable msgpack support (auto/yes/no)]),
+           [],
+           [with_msgpack=auto])
+
+AS_IF([test "$with_msgpack" != no],
+  [PKG_CHECK_MODULES(MSGPACK, msgpack,
+    [AC_DEFINE([HAVE_MSGPACK], [1], [Define to 1 if msgpack is available.])],
+    [AS_IF([test "$with_msgpack" = yes],
+      [AC_MSG_ERROR([--with-msgpack was given, but msgpack is missing or unusable.])])])])
+
 # target-specific stuff:
 
 # Canonicalize the secondary target names.
@@ -225,8 +320,6 @@ AC_CHECK_HEADER(iconv.h)
 AM_ICONV
 
 all_targets=false
-BUILD_NLMCONV=
-NLMCONV_DEFS=
 BUILD_SRCONV=
 BUILD_DLLTOOL=
 DLLTOOL_DEFS=
@@ -245,9 +338,7 @@ for targ in $target $canon_targets
 do
     if test "x$targ" = "xall"; then
         all_targets=true
-       BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
        BUILD_SRCONV='$(SRCONV_PROG)'
-       NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
        BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
        BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
        BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
@@ -257,42 +348,22 @@ do
        fi
        DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
        BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
-       od_vectors="$od_vectors objdump_private_desc_xcoff"
+       od_vectors="$od_vectors objdump_private_desc_xcoff objdump_private_desc_pe"
     else
        case $targ in
-changequote(,)dnl
-       i[3-7]86*-*-netware*)
-changequote([,])dnl
-         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
-         NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
-         ;;
-       alpha*-*-netware*)
-         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
-         NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
-         ;;
-       powerpc*-*-netware*)
-         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
-         NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
-         ;;
-       sparc*-*-netware*)
-         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
-         NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
-         ;;
-       esac
-
-       case $targ in
        *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
        esac
 
        case $targ in
-       arm-epoc-pe*)
-         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+       aarch64-*-mingw*)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          if test -z "$DLLTOOL_DEFAULT"; then
-           DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
+           DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_AARCH64"
          fi
-         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
+         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_AARCH64"
          BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
          BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
+         BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
          ;;
        arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
          BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@@ -323,7 +394,7 @@ changequote([,])dnl
          BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
          ;;
 changequote(,)dnl
-       i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
+       i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32**)
 changequote([,])dnl
          BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          if test -z "$DLLTOOL_DEFAULT"; then
@@ -352,15 +423,6 @@ changequote(,)dnl
 changequote([,])dnl
          OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
          ;;
-       powerpc*-*-pe* | powerpc*-*-cygwin*)
-         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
-         if test -z "$DLLTOOL_DEFAULT"; then
-           DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
-         fi
-         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
-         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
-         BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
-         ;;
        powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
          case "$BUILD_INSTALL_MISC" in
            *embedspu*) ;;
@@ -379,15 +441,6 @@ changequote([,])dnl
        spu-*-*)
          BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
          ;;
-       mips*-*-pe)
-         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
-         if test -z "$DLLTOOL_DEFAULT"; then
-           DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
-         fi
-         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
-         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
-         BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
-         ;;
        mcore-*-pe)
          BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          if test -z "$DLLTOOL_DEFAULT"; then
@@ -414,9 +467,12 @@ changequote([,])dnl
        avr-*-*)
          od_vectors="$od_vectors objdump_private_desc_elf32_avr"
          ;;
-       powerpc-*-aix*)
+       powerpc*-*-aix* | rs6000-*-aix*)
          od_vectors="$od_vectors objdump_private_desc_xcoff"
          ;;
+       *-*-pe* | *-*-cygwin* | *-*-mingw*)
+         od_vectors="$od_vectors objdump_private_desc_pe"
+         ;;
         *-*-darwin*)
          od_vectors="$od_vectors objdump_private_desc_mach_o"
          ;;
@@ -438,6 +494,8 @@ for i in $od_vectors ; do
            od_files="$od_files od-elf32_avr" ;;
        objdump_private_desc_xcoff)
            od_files="$od_files od-xcoff" ;;
+       objdump_private_desc_pe)
+           od_files="$od_files od-pe" ;;
        objdump_private_desc_mach_o)
            od_files="$od_files od-macho" ;;
        *) AC_MSG_ERROR(*** unknown private vector $i) ;;
@@ -470,8 +528,6 @@ fi
 
 OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
 
-AC_SUBST(NLMCONV_DEFS)
-AC_SUBST(BUILD_NLMCONV)
 AC_SUBST(BUILD_SRCONV)
 AC_SUBST(BUILD_DLLTOOL)
 AC_SUBST(DLLTOOL_DEFS)
@@ -510,5 +566,7 @@ AC_SUBST(docdir)
 AC_SUBST(htmldir)
 AC_SUBST(pdfdir)
 
-AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
+AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER