]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libdecnumber/configure.ac
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / libdecnumber / configure.ac
index 4d9060f5cd54eb4ae5a1ebfa63f3052bdf4b9bac..14f67f926d1273a5c77585cfb1f4c54dd946bfbf 100644 (file)
@@ -1,7 +1,7 @@
 # configure.ac for libdecnumber                        -*- Autoconf -*-
 # Process this file with autoconf to generate a configuration script.
 
-# Copyright 2005, 2006, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2005-2022 Free Software Foundation, Inc.
 
 # This file is part of GCC.
 
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-AC_PREREQ(2.64)
 AC_INIT(libdecnumber, [ ], gcc-bugs@gcc.gnu.org, libdecnumber)
 AC_CONFIG_SRCDIR(decNumber.h)
 AC_CONFIG_MACRO_DIR(../config)
+AC_CONFIG_AUX_DIR(..)
 
 # Checks for programs.
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_PROG_RANLIB
+AC_CHECK_TOOL(AR, ar)
 
 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
 AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
@@ -42,6 +43,8 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
                          -Wmissing-format-attribute -Wcast-qual])
 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
 
+ACX_PROG_CC_WARNING_OPTS([-fno-lto], [nolto_flags])
+
 # Only enable with --enable-werror-always until existing warnings are
 # corrected.
 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
@@ -75,42 +78,11 @@ AC_CANONICAL_TARGET
 # Default decimal format
 # If you change the defaults here, be sure to change them in the GCC directory also
 AC_MSG_CHECKING([for decimal floating point])
-AC_ARG_ENABLE(decimal-float,
-[  --enable-decimal-float={no,yes,bid,dpd}
-                       enable decimal float extension to C.  Selecting 'bid'
-                       or 'dpd' choses which decimal floating point format
-                       to use],
-[
-  case $enable_decimal_float in
-    yes | no | bid | dpd) ;;
-    *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
-Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
-  esac
-],
-[
-  case $target in
-    powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*)
-      enable_decimal_float=yes
-      ;;
-    *)
-      enable_decimal_float=no
-      ;;
-  esac
-])
-
-# x86's use BID format instead of DPD
-# In theory --enable-decimal-float=no should not compile anything
-# For the sake of simplicity, just use the default format in this directory
-if test x$enable_decimal_float = xyes -o x$enable_decimal_float = xno; then
-  case $target in
-    i?86*-*-linux* | x86_64*-*-linux*)
-      enable_decimal_float=bid
-      ;;
-    *)
-      enable_decimal_float=dpd
-      ;;
-  esac
-fi
+
+GCC_AC_ENABLE_DECIMAL_FLOAT([$target])
+
+# Use default_decimal_float for dependency.
+enable_decimal_float=$default_decimal_float
 
 # If BID is being used, additional objects should be linked in.
 if test x$enable_decimal_float = xbid; then
@@ -125,6 +97,40 @@ AC_SUBST(ADDITIONAL_OBJS)
 
 AC_C_BIGENDIAN
 
+# Enable --enable-host-shared.
+AC_ARG_ENABLE(host-shared,
+[AS_HELP_STRING([--enable-host-shared],
+               [build host code as shared libraries])])
+AC_SUBST(enable_host_shared)
+
+# Enable --enable-host-pie.
+AC_ARG_ENABLE(host-pie,
+[AS_HELP_STRING([--enable-host-pie],
+               [build host code as PIE])])
+AC_SUBST(enable_host_pie)
+
+if test x$enable_host_shared = xyes; then
+  PICFLAG=-fPIC
+elif test x$enable_host_pie = xyes; then
+  PICFLAG=-fPIE
+else
+  PICFLAG=
+fi
+
+AC_SUBST(PICFLAG)
+
+# Enable Intel CET on Intel CET enabled host if jit is enabled.
+GCC_CET_HOST_FLAGS(CET_HOST_FLAGS)
+case x$enable_languages in
+*jit*)
+  ;;
+*)
+  CET_HOST_FLAGS=
+  ;;
+esac
+AC_SUBST(CET_HOST_FLAGS)
+
+
 # Output.
 
 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])