]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gas/configure.ac
kvx: New port.
[thirdparty/binutils-gdb.git] / gas / configure.ac
index b65108fecb21e81768c94659f04a6fb46bfb6bc5..3a04c39d3449e80af036ec953063e4cff42a8da5 100644 (file)
@@ -3,7 +3,7 @@ dnl
 dnl And be careful when changing it!  If you must add tests with square
 dnl brackets, be sure changequote invocations surround it.
 dnl
-dnl   Copyright (C) 2012-2020 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
@@ -29,9 +29,9 @@ dnl we specify this explicitly, automake-1.7 will assume that ylwrap is in
 dnl gas/ instead of gas/../.
 AC_CONFIG_AUX_DIR(..)
 AC_CANONICAL_TARGET
-AC_ISC_POSIX
 
 AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
 
 AC_PROG_CC
 AC_GNU_SOURCE
@@ -76,6 +76,15 @@ AC_ARG_ENABLE(compressed_debug_sections,
   *)   ac_default_compressed_debug_sections=unset ;;
 esac])dnl
 
+# Select default compression algorithm.
+ac_default_compressed_debug_sections_algorithm=COMPRESS_DEBUG_GABI_ZLIB
+AC_ARG_ENABLE(default_compressed_debug_sections_algorithm,
+             AS_HELP_STRING([--enable-default-compressed-debug-sections-algorithm={zlib,zstd}],
+             [Default compression algorithm for --enable-compressed-debug-sections.]),
+[case "${enableval}" in
+   zstd) ac_default_compressed_debug_sections_algorithm=COMPRESS_DEBUG_ZSTD ;;
+esac])dnl
+
 # PR gas/19520
 # Decide if x86 assembler should generate relax relocations.
 ac_default_x86_relax_relocations=unset
@@ -237,11 +246,17 @@ for this_target in $target $canon_targets ; do
     generic_target=${cpu_type}-${target_vendor}-${target_os}
     case ${generic_target} in
       i386-*-msdosdjgpp* \
-      | i386-*-go32* \
-      | i386-go32-rtems*)
+      | i386-*-go32*)
        AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?])
        ;;
 
+      i386-*-linux-* | x86_64-*-linux-*)
+       if test ${this_target} = $target \
+          && test ${ac_default_generate_x86_used_note} = unset; then
+         ac_default_generate_x86_used_note=1
+       fi
+       ;;
+
       i386-*-solaris2 \
       | x86_64-*-solaris2 \
       | i386-*-solaris2.[[0-9]] \
@@ -257,6 +272,8 @@ for this_target in $target $canon_targets ; do
         ;;
 
 changequote(,)dnl
+      ppc-*-aix5.[01]*)
+       ;;
       ppc-*-aix[5-9].*)
 changequote([,])dnl
        AC_DEFINE(AIX_WEAK_SUPPORT, 1,
@@ -377,6 +394,9 @@ changequote([,])dnl
        esac
        # Decide which ABI to target by default.
        case ${target} in
+         mips64*-openbsd* | mips64*-linux-gnuabi64)
+           mips_default_abi=N64_ABI
+           ;;
          mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
          | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
            mips_default_abi=N32_ABI
@@ -384,9 +404,6 @@ changequote([,])dnl
          mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
            mips_default_abi=O32_ABI
            ;;
-         mips64*-openbsd*)
-           mips_default_abi=N64_ABI
-           ;;
          *)
            mips_default_abi=NO_ABI
            ;;
@@ -404,7 +421,7 @@ changequote([,])dnl
 
     # Do we need the opcodes library?
     case ${cpu_type} in
-      vax | tic30)
+      vax | tic30 | i386 | arm)
        ;;
 
       *)
@@ -422,7 +439,7 @@ changequote([,])dnl
     case ${cpu_type} in
 
       bfin)
-       for f in bfin-parse.o bfin-lex-wrapper.o; do
+       for f in config/bfin-parse.o config/bfin-lex-wrapper.o; do
          case " $extra_objects " in
            *" $f "*) ;;
            *) extra_objects="$extra_objects $f" ;;
@@ -434,20 +451,40 @@ changequote([,])dnl
        if test $this_target = $target ; then
          AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
        fi
-        using_cgen=yes
         ;;
       epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | or1k)
        using_cgen=yes
        ;;
 
+      loongarch)
+       for f in config/loongarch-parse.o config/loongarch-lex-wrapper.o; do
+         case " $extra_objects " in
+           *" $f "*) ;;
+           *) extra_objects="$extra_objects $f" ;;
+         esac
+       done
+        # --target=loongarch[32|64]-*-*.  */
+        if test $this_target = $target ; then
+          AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
+        fi
+       ;;
+
       m32c)
        using_cgen=yes
        ;;
       frv)
        using_cgen=yes
        ;;
+      kvx)
+       for f in config/kvx-parse.o; do
+         case " $extra_objects " in
+           *" $f "*) ;;
+           *) extra_objects="$extra_objects $f" ;;
+         esac
+       done
+       ;;
       m68k)
-       f=m68k-parse.o
+       f=config/m68k-parse.o
        case " $extra_objects " in
          *" $f "*) ;;
          *) extra_objects="$extra_objects $f" ;;
@@ -597,7 +634,7 @@ changequote([,])dnl
         fi
         AC_MSG_RESULT($with_isa_spec)
 
-        # --with-priv-spec=[1.9|1.9.1|1.10|1.11].
+        # --with-priv-spec=[1.9.1|1.10|1.11|1.12].
         AC_MSG_CHECKING(for default configuration of --with-priv-spec)
         if test "x${with_priv_spec}" != x; then
           AC_DEFINE_UNQUOTED(DEFAULT_RISCV_PRIV_SPEC, "$with_priv_spec",
@@ -607,7 +644,7 @@ changequote([,])dnl
         ;;
 
       rl78)
-       f=rl78-parse.o
+       f=config/rl78-parse.o
        case " $extra_objects " in
          *" $f "*) ;;
          *) extra_objects="$extra_objects $f" ;;
@@ -615,7 +652,7 @@ changequote([,])dnl
        ;;
 
       rx)
-       f=rx-parse.o
+       f=config/rx-parse.o
        case " $extra_objects " in
          *" $f "*) ;;
          *) extra_objects="$extra_objects $f" ;;
@@ -626,10 +663,6 @@ changequote([,])dnl
        using_cgen=yes
        ;;
 
-      xc16x)
-       using_cgen=yes
-       ;;
-
       xtensa)
        f=config/xtensa-relax.o
        case " $extra_objects " in
@@ -721,14 +754,7 @@ AC_DEFINE_UNQUOTED(DEFAULT_X86_USED_NOTE,
    properties by default.])
 
 if test ${ac_default_generate_riscv_attr} = unset; then
-    case ${target_os} in
-      elf)
-       ac_default_generate_riscv_attr=1
-       ;;
-      *)
-       ac_default_generate_riscv_attr=0
-       ;;
-  esac
+  ac_default_generate_riscv_attr=1
 fi
 
 AC_DEFINE_UNQUOTED(DEFAULT_RISCV_ATTR,
@@ -746,6 +772,9 @@ if test x$ac_default_compressed_debug_sections = xyes ; then
   AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
 fi
 
+AC_DEFINE_UNQUOTED(DEFAULT_COMPRESSED_DEBUG_ALGORITHM, $ac_default_compressed_debug_sections_algorithm,
+                  [Default compression algorithm for --enable-compressed-debug-sections.])
+
 # Turn on all targets if possible
 if test ${all_targets} = "yes"; then
   case ${target_cpu_type} in
@@ -934,8 +963,7 @@ AM_MAINTAINER_MODE
 AM_CONDITIONAL(GENINSRC_NEVER, false)
 AC_EXEEXT
 
-AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h errno.h sys/types.h limits.h locale.h time.h sys/stat.h)
-ACX_HEADER_STRING
+AC_CHECK_HEADERS(memory.h sys/stat.h sys/types.h unistd.h)
 
 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
 # people who are not cross-compiling but are compiling cross-assemblers.
@@ -948,14 +976,6 @@ else
 fi
 AC_MSG_RESULT($cross_gas)
 
-dnl ansidecl.h will deal with const
-dnl AC_C_CONST
-AC_FUNC_ALLOCA
-AC_C_INLINE
-
-# VMS doesn't have unlink.
-AC_CHECK_FUNCS(unlink remove, break)
-AC_CHECK_FUNCS(sbrk setlocale)
 AC_CHECK_FUNCS(strsignal)
 
 AM_LC_MESSAGES
@@ -980,29 +1000,13 @@ gas_test_headers="
 #ifdef HAVE_MEMORY_H
 #include <memory.h>
 #endif
-#ifdef HAVE_STRING_H
 #include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
-#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 "
 
-# Does errno.h declare errno, or do we have to add a separate declaration
-# for it?
-GAS_CHECK_DECL_NEEDED(errno, f, int f, [
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-])
-
 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
 AC_CACHE_VAL(gas_cv_decl_getopt_unistd_h,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
@@ -1015,17 +1019,14 @@ fi
 
 GAS_CHECK_DECL_NEEDED(environ, f, char **f, $gas_test_headers)
 GAS_CHECK_DECL_NEEDED(ffs, f, int (*f)(int), $gas_test_headers)
-GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
-GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
-GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers)
-GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
 
-AC_CHECK_DECLS([free, getenv, malloc, mempcpy, realloc, stpcpy, strstr, vsnprintf, asprintf])
+AC_CHECK_DECLS([asprintf, mempcpy, stpcpy])
 
 BFD_BINARY_FOPEN
 
-# Link in zlib if we can.  This allows us to write compressed debug sections.
+# Link in zlib/zstd if we can.  This allows us to write compressed debug sections.
 AM_ZLIB
+AC_ZSTD
 
 # Support for VMS timestamps via cross compile
 
@@ -1053,7 +1054,7 @@ dnl the build directory which include the right .h file.  Make sure
 dnl the old symlinks don't exist, so that a reconfigure in an existing
 dnl directory behaves reasonably.
 
-AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
+AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
 AC_CONFIG_COMMANDS([default],
 [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
  echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
@@ -1069,3 +1070,5 @@ AC_CONFIG_COMMANDS([default],
  te_file=${te_file}])
 
 AC_OUTPUT
+
+GNU_MAKE_JOBSERVER