aboutsummaryrefslogtreecommitdiff
path: root/sim/m4/sim_ac_common.m4
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-17 14:45:25 -0500
committerMike Frysinger <vapier@gentoo.org>2021-04-02 23:31:14 -0400
commitc2783492b62faa62bc501ffdd18fa0b6aa8d64b6 (patch)
treeda47b05f876d4c9955dbcee8c91a91624807a1a9 /sim/m4/sim_ac_common.m4
parentca698bee0a391bcde5cb5e29fde5df86ba28a04a (diff)
downloadgdb-c2783492b62faa62bc501ffdd18fa0b6aa8d64b6.zip
gdb-c2783492b62faa62bc501ffdd18fa0b6aa8d64b6.tar.gz
gdb-c2783492b62faa62bc501ffdd18fa0b6aa8d64b6.tar.bz2
sim: unify toolchain settings
The toplevel, common, and igen dirs all have their own code for setting up toolchain settings. Unify all of that in a new macro.
Diffstat (limited to 'sim/m4/sim_ac_common.m4')
-rw-r--r--sim/m4/sim_ac_common.m451
1 files changed, 2 insertions, 49 deletions
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index f67c7f8..8cb45a8 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -20,56 +20,9 @@ dnl It is intended to be invoked last.
dnl
dnl See README-HACKING for more details.
AC_DEFUN([SIM_AC_COMMON],
-[
-AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_PROG_CPP])
+[dnl
+SIM_AC_TOOLCHAIN
AC_CONFIG_HEADERS([config.h:config.in])
-AC_CANONICAL_SYSTEM
-AC_USE_SYSTEM_EXTENSIONS
-AC_C_BIGENDIAN
-AC_ARG_PROGRAM
-AC_PROG_INSTALL
-
-dnl Setup toolchain settings for build-time tools..
-if test "x$cross_compiling" = "xno"; then
- : "${CC_FOR_BUILD:=\$(CC)}"
- : "${CFLAGS_FOR_BUILD:=\$(CFLAGS)}"
-else
- : "${CC_FOR_BUILD:=gcc}"
- : "${CFLAGS_FOR_BUILD:=-g -O}"
-fi
-AC_SUBST(CC_FOR_BUILD)
-AC_SUBST(CFLAGS_FOR_BUILD)
-
-AC_SUBST(CFLAGS)
-AC_CHECK_TOOL(AR, ar)
-AC_PROG_RANLIB
-
-# Require C11 or newer. Autoconf-2.70 provides ac_cv_prog_cc_c11 when using
-# AC_PROG_CC, but we're still using Autoconf-2.69, and the newest it understands
-# is C99. So handle it ourselves.
-m4_version_prereq([2.70], [AC_MSG_ERROR([clean this up!])], [:])
-C_DIALECT=
-AC_MSG_CHECKING([whether C11 is supported by default])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
-# error "C11 support not found"
-#endif
-])], [AC_MSG_RESULT([yes])], [
- AC_MSG_RESULT([no])
- AC_MSG_CHECKING([for -std=c11 support])
- ac_save_CC="$CC"
- CC="$CC -std=c11"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
-# error "C11 support not found"
-#endif
-])], [
- AC_MSG_RESULT([yes])
- CC="$ac_save_CC"
- C_DIALECT="-std=c11"
-], [AC_MSG_ERROR([C11 is required])])])
-AC_SUBST(C_DIALECT)
# Some of the common include files depend on bfd.h, and bfd.h checks
# that config.h is included first by testing that the PACKAGE macro