]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - fixincludes/configure.ac
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / fixincludes / configure.ac
index 04305fe63b72adb065318a2175916082a52e71f5..ec8534f769f978aec3c4b8356e7aa42d66aa8500 100644 (file)
@@ -1,17 +1,19 @@
-AC_PREREQ(2.59)
 
 AC_INIT(fixincludes, [ ])
 AC_CONFIG_SRCDIR(inclhack.def)
 AC_CONFIG_AUX_DIR(..)
+m4_sinclude(../libtool.m4)
 AC_CANONICAL_SYSTEM
 AC_PROG_CC
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_SED
 
 # Figure out what compiler warnings we can enable.
 # See config/warnings.m4 for details.
 
 ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
                          -Wmissing-prototypes -Wold-style-definition \
-                         -Wmissing-format-attribute])
+                         -Wmissing-format-attribute -Wno-overlength-strings])
 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
 
 # Only enable with --enable-werror-always until existing warnings are
@@ -49,7 +51,9 @@ fi],
 [case $host in
        i?86-*-msdosdjgpp* | \
        i?86-*-mingw32* | \
-       *-*-beos* )
+       x86_64-*-mingw32* | \
+       *-*-beos* | \
+        *-*-*vms*)
                TARGET=twoprocess
                ;;
 
@@ -64,6 +68,14 @@ if test $TARGET = twoprocess; then
                  [Define if testing and fixing are done by separate process])
 fi
 
+# Enable --enable-host-pie.
+AC_ARG_ENABLE(host-pie,
+[AS_HELP_STRING([--enable-host-pie],
+       [build host code as PIE])],
+[PICFLAG=-fPIE; LD_PICFLAG=-pie], [])
+AC_SUBST(PICFLAG)
+AC_SUBST(LD_PICFLAG)
+
 case $host in
        vax-dec-bsd* )
                AC_DEFINE(exit, xexit, [Define to xexit if the host system does not support atexit])
@@ -84,13 +96,14 @@ define(fixincludes_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
   fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
   putchar_unlocked putc_unlocked)
 AC_CHECK_FUNCS(fixincludes_UNLOCKED_FUNCS)
-AC_CHECK_DECLS(m4_split(m4_normalize(abort errno fixincludes_UNLOCKED_FUNCS)))
+AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, vasprintf])
+AC_CHECK_DECLS(m4_split(m4_normalize(fixincludes_UNLOCKED_FUNCS)))
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
 # Checks for library functions.
-gcc_AC_FUNC_MMAP_BLACKLIST
+GCC_AC_FUNC_MMAP_BLACKLIST
 
 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 AC_ARG_ENABLE(maintainer-mode,
@@ -105,6 +118,11 @@ else
   MAINT='#'
 fi     
 AC_SUBST(MAINT)
+AC_DEFINE_UNQUOTED([SED_PROGRAM], "${SED}",
+   [Defined to the best working sed program on the host system])
+
+# Determine what GCC version number to use in filesystem paths.
+GCC_BASE_VER
 
 AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
 AC_CONFIG_FILES(Makefile mkheaders.almost:mkheaders.in)