Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-03-22 12:25:20 +0300
committerCorinna Vinschen <corinna@vinschen.de>2016-03-22 12:25:20 +0300
commitfe508576ef1f815b22177d7597796886b91ea0c8 (patch)
tree885adbb929453bbbee04db48bdbbafec4e29205e /config
parent445036bb9882485133750a14a5b3da30efeae2df (diff)
Sync toplevel with upstream GCC.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog164
-rw-r--r--[-rwxr-xr-x]config/acinclude.m40
-rw-r--r--config/bitfields.m425
-rw-r--r--config/bootstrap-asan.mk4
-rw-r--r--config/bootstrap-lto-noplugin.mk6
-rw-r--r--config/bootstrap-lto.mk10
-rw-r--r--config/bootstrap-mpx.mk9
-rw-r--r--config/bootstrap-ubsan.mk3
-rw-r--r--config/dfp.m42
-rw-r--r--config/elf.m47
-rw-r--r--config/gcc-plugin.m4113
-rw-r--r--config/gettext.m44
-rw-r--r--config/iconv.m447
-rw-r--r--config/isl.m463
-rw-r--r--config/mh-alpha-linux3
-rw-r--r--config/mh-darwin31
-rw-r--r--config/mt-gnu2
-rw-r--r--config/mt-ospace4
-rw-r--r--config/picflag.m415
-rw-r--r--config/plugins.m426
-rw-r--r--config/po.m44
-rw-r--r--config/sjlj.m412
-rw-r--r--config/stdint.m42
-rw-r--r--config/target-posix12
-rw-r--r--config/tcl.m44
-rw-r--r--config/warnings.m4112
-rw-r--r--config/zlib.m427
27 files changed, 620 insertions, 91 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 18388d20e..9b3964a60 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,7 +1,167 @@
+2015-10-21 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
+
+ * bootstrap-asan.mk: Replace ASAN_OPTIONS=detect_leaks with
+ LSAN_OPTIONS=detect_leaks.
+
+2015-08-24 Yaakov Selkowitz <yselkowi@redhat.com>
+
+ * iconv.m4 (AM_ICONV_LINK): Use in-tree libiconv when present.
+
+2015-07-24 Micahel Darling <darlingm@gmail.com>
+
+ PR other/66259
+ * gettext.m4: Reflects renaming of configure.in to configure.ac
+ * po.m4: Likewise
+ * stdint.m4: Likewise
+ * tcl.m4: Likewise
+
+2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * zlib.m4: Sync with binutils-gdb.
+
+2015-06-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * dfp.m4 (enable_decimal_float): Also set to yes for
+ i?86*-*-elfiamcu target.
+
+2015-05-27 Jason Merrill <jason@redhat.com>
+
+ PR bootstrap/66304
+ * warnings.m4 (ACX_PROG_CXX_WARNING_OPTS)
+ (ACX_PROG_CXX_WARNINGS_ARE_ERRORS)
+ (ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC): New.
+ (ACX_PROG_CC_WARNING_OPTS, ACX_PROG_CC_WARNING_ALMOST_PEDANTIC)
+ (ACX_PROG_CC_WARNINGS_ARE_ERRORS): Push into C language context.
+
+2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sjlj.m4: New file.
+
+2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * bitfields.m4: Change int to long long, and use bitfields of
+ width 1 instead of 0.
+
+2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * bitfields.m4: New file.
+
+2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * bootstrap-mpx.mk: New file.
+
+2015-04-10 Jakub Jelinek <jakub@redhat.com>
+ Iain Sandoe <iain@codesourcery.com>
+
+ PR target/65351
+ * mh-darwin: Only apply -mdynamic-no-pic for m32 Darwin when the
+ compiler in use supports -mno-dynamic-no-pic.
+ * picflag.m4: Only append -mno-dynamic-no-pic for Darwin when
+ -mdynamic-no-pic is present in CFLAGS.
+
+2015-04-07 Jakub Jelinek <jakub@redhat.com>
+ Iain Sandoe <iain@codesourcery.com>
+
+ PR target/65351
+ * picflag.m4: Append -mno-dynamic-no-pic for Darwin.
+
+2015-03-25 Uros Bizjak <ubizjak@gmail.com>
+
+ PR bootstrap/65537
+ * bootstrap-lto-noplugin.mk: New build configuration.
+
+2015-02-18 Thomas Schwinge <thomas@codesourcery.com>
+
+ * elf.m4 (ACX_ELF_TARGET_IFELSE): nvptx-*-none isn't ELF.
+
+2014-11-17 Bob Dunlop <bob.dunlop@xyzzy.org.uk>
+
+ * mt-ospace (CFLAGS_FOR_TARGET): Append -g -Os rather than
+ overwriting.
+ (CXXFLAGS_FOR_TARGET): Similarly.
+
+2014-11-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/63888
+ * bootstrap-asan.mk (ASAN_OPTIONS): Export "detect_leaks=0".
+
+2014-11-13 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * target-posix: New file.
+
+2014-11-11 Tobias Burnus <burnus@net-b.de>
+
+ * cloog.m4: Remove.
+
+2014-10-27 Tom Tromey <tromey@redhat.com>
+
+ * gcc-plugin.m4: New file.
+
+2014-09-01 Andi Kleen <ak@linux.intel.com>
+
+ * bootstrap-lto.mk: Implement slim bootstrap.
+
+2014-08-21 Bin Cheng <bin.cheng@arm.com>
+
+ * isl.m4 (ISL_CHECK_VERSION): Check link of isl library
+ for cross_compiling.
+
+2014-08-19 Alan Modra <amodra@gmail.com>
+
+ * plugins.m4 (AC_PLUGINS): If plugins are enabled, add -ldl to
+ LIBS via AC_SEARCH_LIBS.
+
+2014-08-18 Roman Gareev <gareevroman@gmail.com>
+
+ * cloog.m4: Remove the path to isllibs from clooglibs.
+ * isl.m4: Add paths to islinc, isllibs.
+
+2014-08-14 Alan Modra <amodra@gmail.com>
+
+ * plugins.m4: Test for dlfcn.h or windows.h here to set default
+ for --enable-plugins. Report error if someone tries to enable
+ plugins on a host we don't support.
+
+2014-07-26 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/47230
+ * mh-alpha-linux: New file.
+
2014-05-14 Sandra Loosemore <sandra@codesourcery.com>
* mt-nios2-elf: New file.
+2014-04-25 Marc Glisse <marc.glisse@inria.fr>
+
+ PR target/43538
+ * mt-gnu: Don't reset CXXFLAGS_FOR_TARGET.
+
+2013-12-07 Mike Frysinger <vapier@gentoo.org>
+
+ * acinclude.m4: Remove +x file mode.
+
+2013-11-29 Marek Polacek <polacek@redhat.com>
+
+ * bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Remove -lpthread -ldl.
+ Add -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/.
+
+2013-11-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ * bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add
+ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/.
+
+2013-11-19 Marek Polacek <polacek@redhat.com>
+
+ * bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl.
+
+2013-11-18 Jan Hubicka <jh@suse.cz>
+
+ * bootstrap-lto.mk: Use -ffat-lto-objects.
+
+2013-11-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * picflag.m4 (m68k-*-*): Use default PIC flag.
+
2013-09-29 Iain Sandoe <iain@codesourcery.com>
* mh-darwin (BOOT_CFLAGS): Only add -mdynamic-no-pic for m32 hosts.
@@ -22,6 +182,10 @@
* bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.
+2013-01-23 Shenghou Ma <minux.ma@gmail.com>
+
+ * isl.m4: don't echo $CFLAGS for ISL_CHECK_VERSION.
+
2013-01-15 Richard Biener <rguenther@suse.de>
PR other/55973
diff --git a/config/acinclude.m4 b/config/acinclude.m4
index 8242b2c7a..8242b2c7a 100755..100644
--- a/config/acinclude.m4
+++ b/config/acinclude.m4
diff --git a/config/bitfields.m4 b/config/bitfields.m4
new file mode 100644
index 000000000..8185cd302
--- /dev/null
+++ b/config/bitfields.m4
@@ -0,0 +1,25 @@
+dnl Copyright (C) 2015 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Define HAVE_BITFIELD_TYPE_MATTERS if the type of bitfields effects their
+# alignment.
+
+AC_DEFUN([gt_BITFIELD_TYPE_MATTERS],
+[
+ AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
+ [
+ AC_TRY_COMPILE(
+ [struct foo1 { char x; char y:1; char z; };
+struct foo2 { char x; long long int y:1; char z; };
+int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ],
+ [], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
+ ])
+ if test $gt_cv_bitfield_type_matters = yes; then
+ AC_DEFINE(HAVE_BITFIELD_TYPE_MATTERS, 1,
+ [Define if the type of bitfields effects alignment.])
+ fi
+])
diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk
index e3f34f5ad..70baaf9bb 100644
--- a/config/bootstrap-asan.mk
+++ b/config/bootstrap-asan.mk
@@ -1,7 +1,11 @@
# This option enables -fsanitize=address for stage2 and stage3.
+# Suppress LeakSanitizer in bootstrap.
+export LSAN_OPTIONS="detect_leaks=0"
+
STAGE2_CFLAGS += -fsanitize=address
STAGE3_CFLAGS += -fsanitize=address
POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \
+ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/ \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs
diff --git a/config/bootstrap-lto-noplugin.mk b/config/bootstrap-lto-noplugin.mk
new file mode 100644
index 000000000..a5073365b
--- /dev/null
+++ b/config/bootstrap-lto-noplugin.mk
@@ -0,0 +1,6 @@
+# This option enables LTO for stage2 and stage3 on
+# hosts without linker plugin support.
+
+STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGEprofile_CFLAGS += -fno-lto
diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk
index bbd3515ea..9e065e1d8 100644
--- a/config/bootstrap-lto.mk
+++ b/config/bootstrap-lto.mk
@@ -1,5 +1,13 @@
-# This option enables LTO for stage2 and stage3.
+# This option enables LTO for stage2 and stage3 in slim mode
STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
STAGEprofile_CFLAGS += -fno-lto
+
+# assumes the host supports the linker plugin
+LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+LTO_RANLIB = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ranlib$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+
+LTO_EXPORTS = AR="$(LTO_AR)"; export AR; \
+ RANLIB="$(LTO_RANLIB)"; export RANLIB;
+LTO_FLAGS_TO_PASS = AR="$(LTO_AR)" RANLIB="$(LTO_RANLIB)"
diff --git a/config/bootstrap-mpx.mk b/config/bootstrap-mpx.mk
new file mode 100644
index 000000000..acc2a2e7a
--- /dev/null
+++ b/config/bootstrap-mpx.mk
@@ -0,0 +1,9 @@
+# This option enables -fcheck-pointer-bounds -mmpx for stage2 and stage3.
+
+STAGE2_CFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1
+STAGE3_CFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1
+POSTSTAGE1_LDFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1 \
+ -static-libmpx -static-libmpxwrappers \
+ -B$$r/prev-$(TARGET_SUBDIR)/libmpx \
+ -B$$r/prev-$(TARGET_SUBDIR)/libmpx/mpxrt/.libs \
+ -B$$r/prev-$(TARGET_SUBDIR)/libmpx/mpxwrap/.libs
diff --git a/config/bootstrap-ubsan.mk b/config/bootstrap-ubsan.mk
index 2d21e832e..d2615e8f8 100644
--- a/config/bootstrap-ubsan.mk
+++ b/config/bootstrap-ubsan.mk
@@ -2,6 +2,7 @@
STAGE2_CFLAGS += -fsanitize=undefined
STAGE3_CFLAGS += -fsanitize=undefined
-POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -lpthread \
+POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan \
+ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/ \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/.libs
diff --git a/config/dfp.m4 b/config/dfp.m4
index 48683f0f9..5b29089ce 100644
--- a/config/dfp.m4
+++ b/config/dfp.m4
@@ -21,7 +21,7 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
[
case $1 in
powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
- i?86*-*-gnu* | \
+ i?86*-*-elfiamcu | i?86*-*-gnu* | \
i?86*-*-mingw* | x86_64*-*-mingw* | \
i?86*-*-cygwin* | x86_64*-*-cygwin*)
enable_decimal_float=yes
diff --git a/config/elf.m4 b/config/elf.m4
index da051cbe6..1772a4431 100644
--- a/config/elf.m4
+++ b/config/elf.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2010, 2011, 2015 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
@@ -7,6 +7,8 @@ dnl the same distribution terms as the rest of that program.
dnl From Paolo Bonzini.
+dnl Is this an ELF target supporting the LTO plugin?
+
dnl usage: ACX_ELF_TARGET_IFELSE([if-elf], [if-not-elf])
AC_DEFUN([ACX_ELF_TARGET_IFELSE], [
AC_REQUIRE([AC_CANONICAL_TARGET])
@@ -15,7 +17,8 @@ target_elf=no
case $target in
*-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \
*-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \
- alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux*)
+ alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux* | \
+ nvptx-*-none)
target_elf=no
;;
*)
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
new file mode 100644
index 000000000..dd06a58cd
--- /dev/null
+++ b/config/gcc-plugin.m4
@@ -0,0 +1,113 @@
+# gcc-plugin.m4 -*- Autoconf -*-
+# Check whether GCC is able to be built with plugin support.
+
+dnl Copyright (C) 2014 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Check for plugin support.
+# Respects --enable-plugin.
+# Sets the shell variables enable_plugin and pluginlibs.
+AC_DEFUN([GCC_ENABLE_PLUGINS],
+ [# Check for plugin support
+ AC_ARG_ENABLE(plugin,
+ [AS_HELP_STRING([--enable-plugin], [enable plugin support])],
+ enable_plugin=$enableval,
+ enable_plugin=yes; default_plugin=yes)
+
+ pluginlibs=
+
+ case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+ export_sym_check="nm${exeext} -g"
+ elif test x$host = x$target; then
+ export_sym_check="$gcc_cv_nm -g"
+ else
+ export_sym_check=
+ fi
+ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+ elif test x$host = x$target; then
+ export_sym_check="$gcc_cv_objdump -T"
+ else
+ export_sym_check=
+ fi
+ ;;
+ esac
+
+ if test x"$enable_plugin" = x"yes"; then
+
+ AC_MSG_CHECKING([for exported symbols])
+ if test "x$export_sym_check" != x; then
+ echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
+ ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest$ac_exeext > /dev/null 2>&1
+ if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
+ : # No need to use a flag
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([for -rdynamic])
+ ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest$ac_exeext > /dev/null 2>&1
+ if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
+ plugin_rdynamic=yes
+ pluginlibs="-rdynamic"
+ else
+ plugin_rdynamic=no
+ enable_plugin=no
+ fi
+ AC_MSG_RESULT([$plugin_rdynamic])
+ fi
+ else
+ AC_MSG_RESULT([unable to check])
+ fi
+
+ # Check -ldl
+ saved_LIBS="$LIBS"
+ AC_SEARCH_LIBS([dlopen], [dl])
+ if test x"$ac_cv_search_dlopen" = x"-ldl"; then
+ pluginlibs="$pluginlibs -ldl"
+ fi
+ LIBS="$saved_LIBS"
+
+ # Check that we can build shared objects with -fPIC -shared
+ saved_LDFLAGS="$LDFLAGS"
+ saved_CFLAGS="$CFLAGS"
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+ CFLAGS="$CFLAGS -fPIC"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -fPIC"
+ LDFLAGS="$LDFLAGS -fPIC -shared"
+ ;;
+ esac
+ AC_MSG_CHECKING([for -fPIC -shared])
+ AC_TRY_LINK(
+ [extern int X;],[return X == 0;],
+ [AC_MSG_RESULT([yes]); have_pic_shared=yes],
+ [AC_MSG_RESULT([no]); have_pic_shared=no])
+ if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
+ pluginlibs=
+ enable_plugin=no
+ fi
+ LDFLAGS="$saved_LDFLAGS"
+ CFLAGS="$saved_CFLAGS"
+
+ # If plugin support had been requested but not available, fail.
+ if test x"$enable_plugin" = x"no" ; then
+ if test x"$default_plugin" != x"yes"; then
+ AC_MSG_ERROR([
+ Building GCC with plugin support requires a host that supports
+ -fPIC, -shared, -ldl and -rdynamic.])
+ fi
+ fi
+ fi
+])
diff --git a/config/gettext.m4 b/config/gettext.m4
index 16070b40a..45fa6b4ab 100644
--- a/config/gettext.m4
+++ b/config/gettext.m4
@@ -81,7 +81,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl Ideally we would do this search only after the
dnl if test "$USE_NLS" = "yes"; then
dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
- dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT
dnl the configure script would need to contain the same shell code
dnl again, outside any 'if'. There are two solutions:
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
@@ -303,7 +303,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATOBJEXT)
- dnl For backward compatibility. Some configure.ins may be using this.
+ dnl For backward compatibility. Some configure.acs may be using this.
nls_cv_header_intl=
nls_cv_header_libgt=
diff --git a/config/iconv.m4 b/config/iconv.m4
index c5f357982..5f9304a6b 100644
--- a/config/iconv.m4
+++ b/config/iconv.m4
@@ -7,6 +7,7 @@ dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
+dnl with modifications to support building with in-tree libiconv
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
@@ -28,24 +29,51 @@ AC_DEFUN([AM_ICONV_LINK],
dnl accordingly.
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
- dnl Add $INCICONV to CPPFLAGS before performing the following checks,
- dnl because if the user has installed libiconv and not disabled its use
- dnl via --without-libiconv-prefix, he wants to use it. The first
- dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
- am_save_CPPFLAGS="$CPPFLAGS"
- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
-
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
+ dnl Add $INCICONV to CPPFLAGS before performing the first check,
+ dnl because if the user has installed libiconv and not disabled its use
+ dnl via --without-libiconv-prefix, he wants to use it. This first
+ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+ am_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCICONV"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
+ CPPFLAGS="$am_save_CPPFLAGS"
+
+ if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then
+ for _libs in .libs _libs; do
+ am_save_CPPFLAGS="$CPPFLAGS"
+ am_save_LIBS="$LIBS"
+ CPPFLAGS="$CPPFLAGS -I../libiconv/include"
+ LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ INCICONV="-I../libiconv/include"
+ LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a
+ LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBS="$am_save_LIBS"
+ if test "$am_cv_func_iconv" = "yes"; then
+ break
+ fi
+ done
+ fi
+
if test "$am_cv_func_iconv" != yes; then
+ am_save_CPPFLAGS="$CPPFLAGS"
am_save_LIBS="$LIBS"
+ CPPFLAGS="$LIBS $INCICONV"
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
@@ -54,6 +82,7 @@ AC_DEFUN([AM_ICONV_LINK],
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
+ CPPFLAGS="$am_save_CPPFLAGS"
LIBS="$am_save_LIBS"
fi
])
@@ -61,12 +90,10 @@ AC_DEFUN([AM_ICONV_LINK],
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
fi
if test "$am_cv_lib_iconv" = yes; then
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_MSG_CHECKING([how to link with libiconv])
AC_MSG_RESULT([$LIBICONV])
else
- dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
- dnl either.
- CPPFLAGS="$am_save_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
diff --git a/config/isl.m4 b/config/isl.m4
index f45854d22..92524af32 100644
--- a/config/isl.m4
+++ b/config/isl.m4
@@ -19,23 +19,23 @@
# ISL_INIT_FLAGS ()
# -------------------------
-# Provide configure switches for ISL support.
+# Provide configure switches for isl support.
# Initialize isllibs/islinc according to the user input.
AC_DEFUN([ISL_INIT_FLAGS],
[
AC_ARG_WITH([isl-include],
[AS_HELP_STRING(
[--with-isl-include=PATH],
- [Specify directory for installed ISL include files])])
+ [Specify directory for installed isl include files])])
AC_ARG_WITH([isl-lib],
[AS_HELP_STRING(
[--with-isl-lib=PATH],
- [Specify the directory for the installed ISL library])])
+ [Specify the directory for the installed isl library])])
AC_ARG_ENABLE(isl-version-check,
[AS_HELP_STRING(
[--disable-isl-version-check],
- [disable check for ISL version])],
+ [disable check for isl version])],
ENABLE_ISL_CHECK=$enableval,
ENABLE_ISL_CHECK=yes)
@@ -58,22 +58,24 @@ AC_DEFUN([ISL_INIT_FLAGS],
if test "x${with_isl_lib}" != x; then
isllibs="-L$with_isl_lib"
fi
- dnl If no --with-isl flag was specified and there is in-tree ISL
+ dnl If no --with-isl flag was specified and there is in-tree isl
dnl source, set up flags to use that and skip any version tests
- dnl as we cannot run them before building ISL.
+ dnl as we cannot run them before building isl.
if test "x${islinc}" = x && test "x${isllibs}" = x \
&& test -d ${srcdir}/isl; then
isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
ENABLE_ISL_CHECK=no
- AC_MSG_WARN([using in-tree ISL, disabling version check])
+ AC_MSG_WARN([using in-tree isl, disabling version check])
fi
+
+ isllibs="${isllibs} -lisl"
]
)
# ISL_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
# ----------------------------------------------------
-# Provide actions for failed ISL detection.
+# Provide actions for failed isl detection.
AC_DEFUN([ISL_REQUESTED],
[
AC_REQUIRE([ISL_INIT_FLAGS])
@@ -90,20 +92,9 @@ AC_DEFUN([ISL_REQUESTED],
]
)
-# _ISL_CHECK_CT_PROG(MAJOR, MINOR)
-# --------------------------------------------
-# Helper for verifying ISL compile time version.
-m4_define([_ISL_CHECK_CT_PROG],[AC_LANG_PROGRAM(
- [#include <isl/version.h>
- #include <string.h>],
- [if (strncmp (isl_version (), "isl-$1.$2", strlen ("isl-$1.$2")) != 0)
- return 1;
- ])])
-
-# ISL_CHECK_VERSION ISL_CHECK_VERSION (MAJOR, MINOR)
+# ISL_CHECK_VERSION ISL_CHECK_VERSION ()
# ----------------------------------------------------------------
-# Test the found ISL to be exact of version MAJOR.MINOR and at least
-# REVISION.
+# Test whether isl contains functionality added to the minimum expected version.
AC_DEFUN([ISL_CHECK_VERSION],
[
if test "${ENABLE_ISL_CHECK}" = yes ; then
@@ -112,16 +103,32 @@ AC_DEFUN([ISL_CHECK_VERSION],
_isl_saved_LIBS=$LIBS
CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}"
- LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
- LIBS="${_isl_saved_LIBS} -lisl"
+ LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs} ${gmplibs}"
+ LIBS="${_isl_saved_LIBS} -lisl -lgmp"
- AC_MSG_CHECKING([for version $1.$2 of ISL])
- AC_RUN_IFELSE([_ISL_CHECK_CT_PROG($1,$2)],
- [gcc_cv_isl=yes],
- [gcc_cv_isl=no],
- [gcc_cv_isl=yes])
+ AC_MSG_CHECKING([for isl 0.16, 0.15, or deprecated 0.14])
+ AC_TRY_LINK([#include <isl/ctx.h>],
+ [isl_ctx_get_max_operations (isl_ctx_alloc ());],
+ [gcc_cv_isl=yes],
+ [gcc_cv_isl=no])
AC_MSG_RESULT([$gcc_cv_isl])
+ if test "${gcc_cv_isl}" = no ; then
+ AC_MSG_RESULT([recommended isl version is 0.16 or 0.15, the minimum required isl version 0.14 is deprecated])
+ fi
+
+ AC_MSG_CHECKING([for isl 0.16 or 0.15])
+ AC_TRY_LINK([#include <isl/schedule.h>],
+ [isl_options_set_schedule_serialize_sccs (NULL, 0);],
+ [ac_has_isl_options_set_schedule_serialize_sccs=yes],
+ [ac_has_isl_options_set_schedule_serialize_sccs=no])
+ AC_MSG_RESULT($ac_has_isl_options_set_schedule_serialize_sccs)
+
+ if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
+ islver="0.15"
+ AC_SUBST([islver])
+ fi
+
CFLAGS=$_isl_saved_CFLAGS
LDFLAGS=$_isl_saved_LDFLAGS
LIBS=$_isl_saved_LIBS
diff --git a/config/mh-alpha-linux b/config/mh-alpha-linux
new file mode 100644
index 000000000..9a9244baa
--- /dev/null
+++ b/config/mh-alpha-linux
@@ -0,0 +1,3 @@
+# Prevent GPREL16 relocation truncation
+LDFLAGS += -Wl,--no-relax
+BOOT_LDFLAGS += -Wl,--no-relax
diff --git a/config/mh-darwin b/config/mh-darwin
index a039f2014..148b73038 100644
--- a/config/mh-darwin
+++ b/config/mh-darwin
@@ -1,18 +1,29 @@
# The -mdynamic-no-pic ensures that the compiler executable is built without
# position-independent-code -- the usual default on Darwin. This fix speeds
-# compiles by 3-5%.
-BOOT_CFLAGS += \
+# compiles by 3-5%. Don't add it if the compiler doesn't also support
+# -mno-dynamic-no-pic to undo it.
+DARWIN_MDYNAMIC_NO_PIC := \
`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
- echo -mdynamic-no-pic ;; esac;`
+ $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
+ && echo -mdynamic-no-pic ;; esac`
+DARWIN_GCC_MDYNAMIC_NO_PIC := \
+`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
+ $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
+ || echo -mdynamic-no-pic ;; esac`
# ld on Darwin versions >= 10.7 defaults to PIE executables. Disable this for
# gcc components, since it is incompatible with our pch implementation.
-BOOT_LDFLAGS += \
-`case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
+DARWIN_NO_PIE := `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
+
+BOOT_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
+BOOT_LDFLAGS += $(DARWIN_NO_PIE)
# Similarly, for cross-compilation.
-STAGE1_CFLAGS += \
-`case ${host} in i?86-*-darwin* | powerpc-*-darwin*)\
- echo -mdynamic-no-pic ;; esac;`
-STAGE1_LDFLAGS += \
-`case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
+STAGE1_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
+STAGE1_LDFLAGS += $(DARWIN_NO_PIE)
+
+# Without -mno-dynamic-no-pic support, add -mdynamic-no-pic just to later
+# stages when we know it is built with gcc.
+STAGE2_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
+STAGE3_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
+STAGE4_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
diff --git a/config/mt-gnu b/config/mt-gnu
index 15bf41716..5c696f51b 100644
--- a/config/mt-gnu
+++ b/config/mt-gnu
@@ -1 +1 @@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE
diff --git a/config/mt-ospace b/config/mt-ospace
index 7f091041d..ce29ff431 100644
--- a/config/mt-ospace
+++ b/config/mt-ospace
@@ -1,3 +1,3 @@
# Build libraries optimizing for space, not speed.
- CFLAGS_FOR_TARGET = -g -Os
- CXXFLAGS_FOR_TARGET = -g -Os
+ CFLAGS_FOR_TARGET += -g -Os
+ CXXFLAGS_FOR_TARGET += -g -Os
diff --git a/config/picflag.m4 b/config/picflag.m4
index 2ee5cd078..2f5b9721e 100644
--- a/config/picflag.m4
+++ b/config/picflag.m4
@@ -7,9 +7,15 @@ AC_DEFUN([_GCC_PICFLAG], [
case "${$2}" in
# PIC is the default on some targets or must not be used.
*-*-darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- $1=-fno-common
+ # For darwin, common symbols are not allowed in MH_DYLIB files
+ case "${CFLAGS}" in
+ # If we are using a compiler supporting mdynamic-no-pic
+ # and the option has been tested as safe to add, then cancel
+ # it here, since the code generated is incompatible with shared
+ # libs.
+ *-mdynamic-no-pic*) $1='-fno-common -mno-dynamic-no-pic' ;;
+ *) $1=-fno-common ;;
+ esac
;;
alpha*-dec-osf5*)
# PIC is the default.
@@ -50,9 +56,6 @@ case "${$2}" in
i[[34567]]86-*-* | x86_64-*-*)
$1=-fpic
;;
- m68k-*-*)
- $1=-fpic
- ;;
# FIXME: Override -fPIC default in libgcc only?
sh-*-linux* | sh[[2346lbe]]*-*-linux*)
$1=-fpic
diff --git a/config/plugins.m4 b/config/plugins.m4
index 7ee8412aa..513c690e1 100644
--- a/config/plugins.m4
+++ b/config/plugins.m4
@@ -1,11 +1,21 @@
AC_DEFUN([AC_PLUGINS],
[
-AC_ARG_ENABLE([plugins],
-AS_HELP_STRING([--enable-plugins], [Enable support for plugins (defaults no)]),
-[case "${enableval}" in
- yes | "") plugins=yes ;;
- no) plugins=no ;;
- *) plugins=yes ;;
- esac],
-[plugins=no])
+ maybe_plugins=no
+ AC_CHECK_HEADERS([dlfcn.h], [maybe_plugins=yes], [], [AC_INCLUDES_DEFAULT])
+ AC_CHECK_HEADERS([windows.h], [maybe_plugins=yes], [], [AC_INCLUDES_DEFAULT])
+
+ AC_ARG_ENABLE([plugins],
+ AS_HELP_STRING([--enable-plugins], [Enable support for plugins]),
+ [case "${enableval}" in
+ no) plugins=no ;;
+ *) plugins=yes
+ if test "$maybe_plugins" != "yes" ; then
+ AC_MSG_ERROR([Building with plugin support requires a host that supports dlopen.])
+ fi ;;
+ esac],
+ [plugins=$maybe_plugins]
+ )
+ if test "$plugins" = "yes"; then
+ AC_SEARCH_LIBS([dlopen], [dl])
+ fi
])
diff --git a/config/po.m4 b/config/po.m4
index 2edd5a7d3..6ceef420f 100644
--- a/config/po.m4
+++ b/config/po.m4
@@ -117,14 +117,14 @@ AC_DEFUN([AM_PO_SUBDIRS],
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
# The LINGUAS file contains the set of available languages.
if test -n "$OBSOLETE_ALL_LINGUAS"; then
- test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.ac is obsolete" || echo "setting ALL_LINGUAS in configure.ac is obsolete"
fi
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
# Hide the ALL_LINGUAS assigment from automake.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
else
- # The set of available languages was given in configure.in.
+ # The set of available languages was given in configure.ac.
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
fi
case "$ac_given_srcdir" in
diff --git a/config/sjlj.m4 b/config/sjlj.m4
new file mode 100644
index 000000000..71c8b319b
--- /dev/null
+++ b/config/sjlj.m4
@@ -0,0 +1,12 @@
+dnl Check if the compiler is configured for setjmp/longjmp exceptions.
+AC_DEFUN([GCC_CHECK_SJLJ_EXCEPTIONS],
+ [AC_CACHE_CHECK([whether the compiler is configured for setjmp/longjmp exceptions],
+ ac_cv_sjlj_exceptions,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifdef __USING_SJLJ_EXCEPTIONS__
+ this will fail
+ #endif]],
+ [[int i;]])],
+ [ac_cv_sjlj_exceptions=no],
+ [ac_cv_sjlj_exceptions=yes])])])
diff --git a/config/stdint.m4 b/config/stdint.m4
index 61898a75f..59f435954 100644
--- a/config/stdint.m4
+++ b/config/stdint.m4
@@ -39,7 +39,7 @@ dnl If your installed header files require the stdint-types you will want to
dnl create an installable file mylib-int.h that all your other installable
dnl header may include. So, for a library package named "mylib", just use
dnl GCC_HEADER_STDINT(mylib-int.h)
-dnl in configure.in and install that header file in Makefile.am along with
+dnl in configure.ac and install that header file in Makefile.am along with
dnl the other headers (mylib.h). The mylib-specific headers can simply
dnl use "#include <mylib-int.h>" to obtain the stdint-types.
dnl
diff --git a/config/target-posix b/config/target-posix
new file mode 100644
index 000000000..2fba066c6
--- /dev/null
+++ b/config/target-posix
@@ -0,0 +1,12 @@
+case "${target}" in
+ *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
+ ;;
+ *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
+ ;;
+ *-*-solaris2* | *-*-hpux11*)
+ ;;
+ *-*-darwin* | *-*-aix*)
+ ;;
+ *)
+ UNSUPPORTED=1 ;;
+ esac
diff --git a/config/tcl.m4 b/config/tcl.m4
index 59a0c7e0a..4542a4b23 100644
--- a/config/tcl.m4
+++ b/config/tcl.m4
@@ -2136,7 +2136,7 @@ dnl # preprocessing tests use only CPPFLAGS.
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
fi
-dnl Not at all clear what this was doing in Tcl's configure.in
+dnl Not at all clear what this was doing in Tcl's configure.ac
dnl or why it was needed was needed. In any event, this sort of
dnl things needs to be done in the big loop above.
dnl REMOVE THIS BLOCK LATER! (mdejong)
@@ -3235,7 +3235,7 @@ AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [
# created. Accumulates.
#
# Requires presence of SC_OUTPUT_COMMANDS_PRE at the end
-# of configure.in (right before AC_OUTPUT).
+# of configure.ac (right before AC_OUTPUT).
#
#--------------------------------------------------------------------
diff --git a/config/warnings.m4 b/config/warnings.m4
index b64b594e6..ce007f9b7 100644
--- a/config/warnings.m4
+++ b/config/warnings.m4
@@ -18,11 +18,12 @@
#along with GCC; see the file COPYING3. If not see
#<http://www.gnu.org/licenses/>.
-# ACX_PROG_CC_WARNING_OPTS(WARNINGS, [VARIABLE = WARN_CFLAGS)
+# ACX_PROG_CC_WARNING_OPTS(WARNINGS, [VARIABLE = WARN_CFLAGS])
# Sets @VARIABLE@ to the subset of the given options which the
# compiler accepts.
AC_DEFUN([ACX_PROG_CC_WARNING_OPTS],
[AC_REQUIRE([AC_PROG_CC])dnl
+AC_LANG_PUSH(C)
m4_pushdef([acx_Var], [m4_default([$2], [WARN_CFLAGS])])dnl
AC_SUBST(acx_Var)dnl
m4_expand_once([acx_Var=
@@ -48,6 +49,7 @@ for real_option in $1; do
done
CFLAGS="$save_CFLAGS"
m4_popdef([acx_Var])dnl
+AC_LANG_POP(C)
])# ACX_PROG_CC_WARNING_OPTS
# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC])
@@ -55,6 +57,7 @@ m4_popdef([acx_Var])dnl
# and accepts all of those options simultaneously, otherwise to nothing.
AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
[AC_REQUIRE([AC_PROG_CC])dnl
+AC_LANG_PUSH(C)
m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl
AC_SUBST(acx_Var)dnl
m4_expand_once([acx_Var=
@@ -77,6 +80,7 @@ AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
AS_VAR_POPDEF([acx_Pedantic])dnl
m4_popdef([acx_Woptions])dnl
m4_popdef([acx_Var])dnl
+AC_LANG_POP(C)
])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
# ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z], [VARIABLE = WERROR])
@@ -88,6 +92,7 @@ m4_popdef([acx_Var])dnl
# appeared on the configure command line.
AC_DEFUN([ACX_PROG_CC_WARNINGS_ARE_ERRORS],
[AC_REQUIRE([AC_PROG_CC])dnl
+AC_LANG_PUSH(C)
m4_pushdef([acx_Var], [m4_default([$2], [WERROR])])dnl
AC_SUBST(acx_Var)dnl
m4_expand_once([acx_Var=
@@ -114,4 +119,109 @@ AS_IF([test $enable_werror_always = yes],
[acx_Var="$acx_Var${acx_Var:+ }-Werror"])
AS_VAR_POPDEF([acx_GCCvers])])
m4_popdef([acx_Var])dnl
+AC_LANG_POP(C)
])# ACX_PROG_CC_WARNINGS_ARE_ERRORS
+
+# ACX_PROG_CXX_WARNING_OPTS(WARNINGS, [VARIABLE = WARN_CXXFLAGS])
+# Sets @VARIABLE@ to the subset of the given options which the
+# compiler accepts.
+AC_DEFUN([ACX_PROG_CXX_WARNING_OPTS],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_LANG_PUSH(C++)
+m4_pushdef([acx_Var], [m4_default([$2], [WARN_CXXFLAGS])])dnl
+AC_SUBST(acx_Var)dnl
+m4_expand_once([acx_Var=
+],m4_quote(acx_Var=))dnl
+save_CXXFLAGS="$CXXFLAGS"
+for real_option in $1; do
+ # Do the check with the no- prefix removed since gcc silently
+ # accepts any -Wno-* option on purpose
+ case $real_option in
+ -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+ *) option=$real_option ;;
+ esac
+ AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
+ AC_CACHE_CHECK([whether $CXX supports $option], acx_Woption,
+ [CXXFLAGS="$option"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_VAR_SET(acx_Woption, yes)],
+ [AS_VAR_SET(acx_Woption, no)])
+ ])
+ AS_IF([test AS_VAR_GET(acx_Woption) = yes],
+ [acx_Var="$acx_Var${acx_Var:+ }$real_option"])
+ AS_VAR_POPDEF([acx_Woption])dnl
+done
+CXXFLAGS="$save_CXXFLAGS"
+m4_popdef([acx_Var])dnl
+AC_LANG_POP(C++)
+])# ACX_PROG_CXX_WARNING_OPTS
+
+# ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC])
+# Append to VARIABLE "-pedantic" + the argument, if the compiler is G++
+# and accepts all of those options simultaneously, otherwise to nothing.
+AC_DEFUN([ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_LANG_PUSH(C++)
+m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl
+AC_SUBST(acx_Var)dnl
+m4_expand_once([acx_Var=
+],m4_quote(acx_Var=))dnl
+# Do the check with the no- prefix removed from the warning options
+# since gcc silently accepts any -Wno-* option on purpose
+m4_pushdef([acx_Woptions], [m4_bpatsubst([$1], [-Wno-], [-W])])dnl
+AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_]acx_Woptions)dnl
+AS_IF([test "$GXX" = yes],
+[AC_CACHE_CHECK([whether $CXX supports -pedantic ]acx_Woptions, acx_Pedantic,
+[save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="-pedantic acx_Woptions"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_VAR_SET(acx_Pedantic, yes)],
+ [AS_VAR_SET(acx_Pedantic, no)])
+CXXFLAGS="$save_CXXFLAGS"])
+AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
+ [acx_Var="$acx_Var${acx_Var:+ }-pedantic $1"])
+])
+AS_VAR_POPDEF([acx_Pedantic])dnl
+m4_popdef([acx_Woptions])dnl
+m4_popdef([acx_Var])dnl
+AC_LANG_POP(C++)
+])# ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC
+
+# ACX_PROG_CXX_WARNINGS_ARE_ERRORS([x.y.z], [VARIABLE = WERROR])
+# sets @VARIABLE@ to "-Werror" if the compiler is G++ >=x.y.z, or if
+# --enable-werror-always was given on the command line, otherwise
+# to nothing.
+# If the argument is the word "manual" instead of a version number,
+# then @VARIABLE@ will be set to -Werror only if --enable-werror-always
+# appeared on the configure command line.
+AC_DEFUN([ACX_PROG_CXX_WARNINGS_ARE_ERRORS],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_LANG_PUSH(C++)
+m4_pushdef([acx_Var], [m4_default([$2], [WERROR])])dnl
+AC_SUBST(acx_Var)dnl
+m4_expand_once([acx_Var=
+],m4_quote(acx_Var=))dnl
+AC_ARG_ENABLE(werror-always,
+ AS_HELP_STRING([--enable-werror-always],
+ [enable -Werror despite compiler version]),
+[], [enable_werror_always=no])
+AS_IF([test $enable_werror_always = yes],
+ [acx_Var="$acx_Var${acx_Var:+ }-Werror"])
+ m4_if($1, [manual],,
+ [AS_VAR_PUSHDEF([acx_GXXvers], [acx_cv_prog_cxx_gxx_$1_or_newer])dnl
+ AC_CACHE_CHECK([whether $CXX is G++ >=$1], acx_GXXvers,
+ [set fnord `echo $1 | tr '.' ' '`
+ shift
+ AC_PREPROC_IFELSE(
+[#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ \
+ < [$]1 * 10000 + [$]2 * 100 + [$]3
+#error insufficient
+#endif],
+ [AS_VAR_SET(acx_GXXvers, yes)],
+ [AS_VAR_SET(acx_GXXvers, no)])])
+ AS_IF([test AS_VAR_GET(acx_GXXvers) = yes],
+ [acx_Var="$acx_Var${acx_Var:+ }-Werror"])
+ AS_VAR_POPDEF([acx_GXXvers])])
+m4_popdef([acx_Var])dnl
+AC_LANG_POP(C++)
+])# ACX_PROG_CXX_WARNINGS_ARE_ERRORS
diff --git a/config/zlib.m4 b/config/zlib.m4
index b0174994e..afa57d112 100644
--- a/config/zlib.m4
+++ b/config/zlib.m4
@@ -1,18 +1,19 @@
-dnl A function to check for zlib availability. zlib is used by default
-dnl unless the user configured with --disable-nls.
+dnl A function to check if the system's zlib library should be used. The
+dnl builtin zlib dnl is used by default unless the user configured with
+dnl --with-system-zlib.
AC_DEFUN([AM_ZLIB],
[
- # See if the user specified whether he wants zlib support or not.
- AC_ARG_WITH(zlib,
- [ --with-zlib include zlib support (auto/yes/no) [default=auto]],
- [], [with_zlib=auto])
-
- if test "$with_zlib" != "no"; then
- AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
- if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then
- AC_MSG_ERROR([zlib (libz) library was explicitly requested but not found])
- fi
+ # Use the system's zlib library.
+ zlibdir="-L\$(top_builddir)/../zlib"
+ zlibinc="-I\$(top_srcdir)/../zlib"
+ AC_ARG_WITH(system-zlib,
+ [AS_HELP_STRING([--with-system-zlib], [use installed libz])],
+ if test x$with_system_zlib = xyes ; then
+ zlibdir=
+ zlibinc=
fi
+ )
+ AC_SUBST(zlibdir)
+ AC_SUBST(zlibinc)
])
-