summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac327
1 files changed, 245 insertions, 82 deletions
diff --git a/configure.ac b/configure.ac
index 34774d85da..eaf46615e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-# Free Software Foundation, Inc.
+# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+# 2014, 2015 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -29,7 +29,6 @@ m4_include([ltsugar.m4])
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
m4_include([config/isl.m4])
-m4_include([config/cloog.m4])
AC_INIT(move-if-change)
AC_PREREQ(2.64)
@@ -126,14 +125,14 @@ extra_host_args=
# these library is used by various programs built for the build
# environment
#
-build_libs="build-libiberty"
+build_libs="build-libiberty build-libcpp"
# these tools are built for the build environment
build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
# these libraries are used by various programs built for the host environment
-#
-host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl cloog libelf libiconv"
+#f
+host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl libelf libiconv"
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -141,7 +140,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld".
-host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools"
+host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
# libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \
@@ -157,11 +156,13 @@ target_libraries="target-libgcc \
target-newlib \
target-libgomp \
target-libcilkrts \
+ target-liboffloadmic \
target-libatomic \
target-libitm \
target-libstdc++-v3 \
target-libsanitizer \
target-libvtv \
+ target-libmpx \
target-libssp \
target-libquadmath \
target-libgfortran \
@@ -286,6 +287,22 @@ case ${with_newlib} in
yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
esac
+AC_ARG_ENABLE(as-accelerator-for,
+[AS_HELP_STRING([--enable-as-accelerator-for=ARG],
+ [build as offload target compiler.
+ Specify offload host triple by ARG])])
+
+AC_ARG_ENABLE(offload-targets,
+[AS_HELP_STRING([--enable-offload-targets=LIST],
+ [enable offloading to devices from comma-separated LIST of
+ TARGET[=DIR]. Use optional path to find offload target compiler
+ during the build])],
+[
+ if test x"$enable_offload_targets" = x; then
+ AC_MSG_ERROR([no offload targets specified])
+ fi
+], [enable_offload_targets=])
+
# Handle --enable-gold, --enable-ld.
# --disable-gold [--enable-ld]
# Build only ld. Default option.
@@ -436,9 +453,45 @@ AS_HELP_STRING([--disable-libstdcxx],
ENABLE_LIBSTDCXX=$enableval,
ENABLE_LIBSTDCXX=default)
[if test "${ENABLE_LIBSTDCXX}" = "no" ; then
- noconfigdirs="$noconfigdirs libstdc++-v3"
+ noconfigdirs="$noconfigdirs target-libstdc++-v3"
fi]
+# If this is accelerator compiler and its target is intelmic we enable
+# target liboffloadmic by default. If this is compiler with offloading
+# for intelmic we enable host liboffloadmic by default. Otherwise
+# liboffloadmic is disabled by default.
+AC_ARG_ENABLE([liboffloadmic],
+AC_HELP_STRING([[--enable-liboffloadmic[=ARG]]],
+ [build liboffloadmic @<:@ARG={no,host,target}@:>@]),
+[case "$enableval" in
+ no | host | target)
+ enable_liboffloadmic=$enableval ;;
+ *)
+ AC_MSG_ERROR([--enable-liboffloadmic=no/host/target]) ;;
+esac],
+[if test x"$enable_as_accelerator_for" != x; then
+ case "${target}" in
+ *-intelmic-* | *-intelmicemul-*)
+ enable_liboffloadmic=target
+ extra_liboffloadmic_configure_flags="--enable-liboffloadmic=target"
+ ;;
+ *)
+ enable_liboffloadmic=no
+ ;;
+ esac
+else
+ case "${enable_offload_targets}" in
+ *-intelmic-* | *-intelmicemul-*)
+ enable_liboffloadmic=host
+ extra_liboffloadmic_configure_flags="--enable-liboffloadmic=host"
+ ;;
+ *)
+ enable_liboffloadmic=no
+ ;;
+ esac
+fi])
+AC_SUBST(extra_liboffloadmic_configure_flags)
+
# Save it here so that, even in case of --enable-libgcj, if the Java
# front-end isn't enabled, we still get libgcj disabled.
libgcj_saved=$libgcj
@@ -524,6 +577,22 @@ if test -d ${srcdir}/libcilkrts; then
fi
fi
+# Disable liboffloadmic on unsupported systems.
+if test -d ${srcdir}/liboffloadmic; then
+ if test x$enable_liboffloadmic != xno; then
+ AC_MSG_CHECKING([for liboffloadmic support])
+ if (srcdir=${srcdir}/liboffloadmic; \
+ . ${srcdir}/configure.tgt; \
+ test -n "$UNSUPPORTED")
+ then
+ AC_MSG_RESULT([no])
+ noconfigdirs="$noconfigdirs target-liboffloadmic"
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ fi
+fi
+
# Disable libitm on unsupported systems.
if test -d ${srcdir}/libitm; then
if test x$enable_libitm = x; then
@@ -572,6 +641,27 @@ if test -d ${srcdir}/libvtv; then
fi
fi
+
+# Enable libmpx on supported systems by request.
+if test -d ${srcdir}/libmpx; then
+ if test x$enable_libmpx = xyes; then
+ AC_MSG_CHECKING([for libmpx support])
+ if (srcdir=${srcdir}/libmpx; \
+ . ${srcdir}/configure.tgt; \
+ test "$LIBMPX_SUPPORTED" != "yes")
+ then
+ AC_MSG_RESULT([no])
+ noconfigdirs="$noconfigdirs target-libmpx"
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ else
+ noconfigdirs="$noconfigdirs target-libmpx"
+ fi
+fi
+
+
+
# Disable libquadmath for some systems.
case "${target}" in
avr-*-*)
@@ -599,6 +689,10 @@ case "${target}" in
# for explicit misaligned loads.
noconfigdirs="$noconfigdirs target-libssp"
;;
+ visium-*-*)
+ # No hosted I/O support.
+ noconfigdirs="$noconfigdirs target-libssp"
+ ;;
esac
# Disable libstdc++-v3 for some systems.
@@ -711,6 +805,9 @@ case "${target}" in
alpha*-*-*vms*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
+ arm*-*-freebsd*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
arm-wince-pe)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@@ -772,7 +869,15 @@ case "${target}" in
;;
*-*-lynxos*)
noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
+ ;;
+esac
+
+# Disable the go frontend on systems where it is known to not work. Please keep
+# this in sync with contrib/config-list.mk.
+case "${target}" in
+*-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*)
+ unsupported_languages="$unsupported_languages go"
+ ;;
esac
# Disable libgo for some systems where it is known to not work.
@@ -1143,6 +1248,10 @@ case "${target}" in
nds32*-*-*)
noconfigdirs="$noconfigdirs gdb"
;;
+ nvptx*-*-*)
+ # nvptx is just a compiler
+ noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
+ ;;
or1k*-*-*)
noconfigdirs="$noconfigdirs gdb"
;;
@@ -1641,16 +1750,9 @@ AC_ARG_WITH(boot-ldflags,
fi])
AC_SUBST(poststage1_ldflags)
-# GCC GRAPHITE dependences, ISL and CLOOG which in turn requires ISL.
-# Basic setup is inlined here, actual checks are in config/cloog.m4 and
-# config/isl.m4
+# GCC GRAPHITE dependency ISL.
+# Basic setup is inlined here, actual checks are in config/isl.m4
-AC_ARG_WITH(cloog,
- [AS_HELP_STRING(
- [--with-cloog=PATH],
- [Specify prefix directory for the installed CLooG-ISL package.
- Equivalent to --with-cloog-include=PATH/include
- plus --with-cloog-lib=PATH/lib])])
AC_ARG_WITH(isl,
[AS_HELP_STRING(
[--with-isl=PATH],
@@ -1658,59 +1760,29 @@ AC_ARG_WITH(isl,
Equivalent to --with-isl-include=PATH/include
plus --with-isl-lib=PATH/lib])])
-# Treat either --without-cloog or --without-isl as a request to disable
+# Treat --without-isl as a request to disable
# GRAPHITE support and skip all following checks.
-if test "x$with_isl" != "xno" &&
- test "x$with_cloog" != "xno"; then
+if test "x$with_isl" != "xno"; then
# Check for ISL
dnl Provide configure switches and initialize islinc & isllibs
dnl with user input.
ISL_INIT_FLAGS
dnl The versions of ISL that work for Graphite
- ISL_CHECK_VERSION(0,10)
- if test "${gcc_cv_isl}" = no ; then
- ISL_CHECK_VERSION(0,11)
- if test "${gcc_cv_isl}" = no ; then
- ISL_CHECK_VERSION(0,12)
- fi
- fi
+ ISL_CHECK_VERSION()
dnl Only execute fail-action, if ISL has been requested.
ISL_IF_FAILED([
AC_MSG_ERROR([Unable to find a usable ISL. See config.log for details.])])
-
- if test "x$gcc_cv_isl" != "xno"; then
- # Check for CLOOG
- dnl Provide configure switches and initialize clooginc & clooglibs
- dnl with user input.
- CLOOG_INIT_FLAGS
- dnl The versions of CLooG that work for Graphite.
- CLOOG_CHECK_VERSION(0,17,0)
- if test "${gcc_cv_cloog}" = no ; then
- CLOOG_CHECK_VERSION(0,18,0)
- fi
-
- dnl Only execute fail-action, if CLooG has been requested.
- CLOOG_IF_FAILED([
- AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
- fi
fi
-# If either the ISL or the CLooG check failed, disable builds of in-tree
-# variants of both
+# If the ISL check failed, disable builds of in-tree variant of ISL
if test "x$with_isl" = xno ||
- test "x$with_cloog" = xno ||
- test "x$gcc_cv_cloog" = xno ||
test "x$gcc_cv_isl" = xno; then
- noconfigdirs="$noconfigdirs cloog isl"
+ noconfigdirs="$noconfigdirs isl"
islinc=
- clooginc=
- clooglibs=
fi
+AC_SUBST(isllibs)
AC_SUBST(islinc)
-AC_SUBST(clooglibs)
-AC_SUBST(clooginc)
-
# Check for LTO support.
AC_ARG_ENABLE(lto,
@@ -1748,6 +1820,19 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
esac
])
+AC_ARG_ENABLE(linker-plugin-configure-flags,
+ [AS_HELP_STRING([[--enable-linker-plugin-configure-flags=FLAGS]],
+ [additional flags for configuring linker plugins @<:@none@:>@])],
+ extra_linker_plugin_configure_flags=$enableval,
+ extra_linker_plugin_configure_flags=)
+AC_SUBST(extra_linker_plugin_configure_flags)
+AC_ARG_ENABLE(linker-plugin-flags,
+ [AS_HELP_STRING([[--enable-linker-plugin-flags=FLAGS]],
+ [additional flags for configuring and building linker plugins @<:@none@:>@])],
+ extra_linker_plugin_flags=$enableval,
+ extra_linker_plugin_flags=)
+AC_SUBST(extra_linker_plugin_flags)
+
# By default, C and C++ are the only stage 1 languages.
stage1_languages=,c,
@@ -1848,7 +1933,6 @@ if test -d ${srcdir}/gcc; then
new_enable_languages=,c,
# If LTO is enabled, add the LTO front end.
- extra_host_libiberty_configure_flags=
if test "$enable_lto" = "yes" ; then
case ,${enable_languages}, in
*,lto,*) ;;
@@ -1856,10 +1940,16 @@ if test -d ${srcdir}/gcc; then
esac
if test "${build_lto_plugin}" = "yes" ; then
configdirs="$configdirs lto-plugin"
- extra_host_libiberty_configure_flags=--enable-shared
fi
fi
- AC_SUBST(extra_host_libiberty_configure_flags)
+
+ # If we're building an offloading compiler, add the LTO front end.
+ if test x"$enable_as_accelerator_for" != x ; then
+ case ,${enable_languages}, in
+ *,lto,*) ;;
+ *) enable_languages="${enable_languages},lto" ;;
+ esac
+ fi
missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
@@ -2077,11 +2167,19 @@ case ,${enable_languages},:${enable_objc_gc} in
;;
esac
-# Disable libitm, libsanitizer, libvtv if we're not building C++
+# Disable libcilkrts, libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++
case ,${enable_languages}, in
- *,c++,*) ;;
+ *,c++,*)
+ # Disable libcilkrts, libitm, libsanitizer if we're not building libstdc++
+ case "${noconfigdirs}" in
+ *target-libstdc++-v3*)
+ noconfigdirs="$noconfigdirs target-libcilkrts target-libitm target-libsanitizer"
+ ;;
+ *) ;;
+ esac
+ ;;
*)
- noconfigdirs="$noconfigdirs target-libcilkrts target-libitm target-libsanitizer target-libvtv"
+ noconfigdirs="$noconfigdirs target-libcilkrts target-liboffloadmic target-libitm target-libsanitizer target-libvtv"
;;
esac
@@ -2153,6 +2251,32 @@ for i in ${target_configdirs_all} ; do
fi
done
+# libiberty-linker-plugin is special: it doesn't have its own source directory,
+# so we have to add it after the preceding checks.
+if test x"$extra_linker_plugin_flags$extra_linker_plugin_configure_flags" != x
+then
+ case " $configdirs " in
+ *" libiberty "*)
+ # If we can build libiberty, we can also build libiberty-linker-plugin.
+ configdirs="$configdirs libiberty-linker-plugin"
+ extra_linker_plugin_configure_flags="$extra_linker_plugin_configure_flags \
+ --with-libiberty=../libiberty-linker-plugin";;
+ *)
+ AC_MSG_ERROR([libiberty missing]);;
+ esac
+fi
+
+# Sometimes we have special requirements for the host libiberty.
+extra_host_libiberty_configure_flags=
+case " $configdirs " in
+ *" lto-plugin "* | *" libcc1 "*)
+ # When these are to be built as shared libraries, the same applies to
+ # libiberty.
+ extra_host_libiberty_configure_flags=--enable-shared
+ ;;
+esac
+AC_SUBST(extra_host_libiberty_configure_flags)
+
# Produce a warning message for the subdirs we can't configure.
# This isn't especially interesting in the Cygnus tree, but in the individual
# FSF releases, it's important to let people know when their machine isn't
@@ -2226,28 +2350,36 @@ AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
# gcc) are built with "-O2 -g", so include those options when setting
# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
if test "x$CFLAGS_FOR_TARGET" = x; then
- CFLAGS_FOR_TARGET=$CFLAGS
- case " $CFLAGS " in
- *" -O2 "*) ;;
- *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
- esac
- case " $CFLAGS " in
- *" -g "* | *" -g3 "*) ;;
- *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
- esac
+ if test "x${is_cross_compiler}" = xyes; then
+ CFLAGS_FOR_TARGET="-g -O2"
+ else
+ CFLAGS_FOR_TARGET=$CFLAGS
+ case " $CFLAGS " in
+ *" -O2 "*) ;;
+ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
+ esac
+ case " $CFLAGS " in
+ *" -g "* | *" -g3 "*) ;;
+ *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
+ esac
+ fi
fi
AC_SUBST(CFLAGS_FOR_TARGET)
if test "x$CXXFLAGS_FOR_TARGET" = x; then
- CXXFLAGS_FOR_TARGET=$CXXFLAGS
- case " $CXXFLAGS " in
- *" -O2 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
- esac
- case " $CXXFLAGS " in
- *" -g "* | *" -g3 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
- esac
+ if test "x${is_cross_compiler}" = xyes; then
+ CXXFLAGS_FOR_TARGET="-g -O2"
+ else
+ CXXFLAGS_FOR_TARGET=$CXXFLAGS
+ case " $CXXFLAGS " in
+ *" -O2 "*) ;;
+ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
+ esac
+ case " $CXXFLAGS " in
+ *" -g "* | *" -g3 "*) ;;
+ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
+ esac
+ fi
fi
AC_SUBST(CXXFLAGS_FOR_TARGET)
@@ -2579,6 +2711,11 @@ if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
fi
+# If we are building libmpx, bootstrap it.
+if echo " ${target_configdirs} " | grep " libmpx " > /dev/null 2>&1; then
+ bootstrap_target_libs=${bootstrap_target_libs}target-libmpx,
+fi
+
# Determine whether gdb needs tk/tcl or not.
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
# and in that case we want gdb to be built without tk. Ugh!
@@ -2802,7 +2939,7 @@ changequote(,)
changequote([,])
case $lib in
- mpc | mpfr | gmp | cloog)
+ mpc | mpfr | gmp | isl)
# If we're processing --with-$lib, --with-$lib-include or
# --with-$lib-lib, for one of the libs above, and target is
# different from host, don't pass the current argument to any
@@ -2898,8 +3035,10 @@ AC_ARG_VAR([target_configargs],
# For the build-side libraries, we just need to pretend we're native,
# and not use the same cache file. Multilibs are neither needed nor
-# desired.
-build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}"
+# desired. We can't even use the same cache file for all build-side
+# libraries, as they're compiled differently; some with C, some with
+# C++ or with different feature-enabling options.
+build_configargs="$build_configargs --cache-file=./config.cache ${baseargs}"
# For host modules, accept cache file option, or specification as blank.
case "${cache_file}" in
@@ -3272,7 +3411,7 @@ GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
-GCC_TARGET_TOOL(objcopy, OBJCOPY_FOR_TARGET, OBJDUMP, [binutils/objcopy])
+GCC_TARGET_TOOL(objcopy, OBJCOPY_FOR_TARGET, OBJCOPY, [binutils/objcopy])
GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
GCC_TARGET_TOOL(readelf, READELF_FOR_TARGET, READELF, [binutils/readelf])
@@ -3377,6 +3516,30 @@ AC_ARG_ENABLE(host-shared,
[host_shared=$enableval], [host_shared=no])
AC_SUBST(host_shared)
+# PR jit/64780: Require the user to explicitly specify
+# --enable-host-shared if the jit is enabled, hinting
+# that they might want to do a separate configure/build of
+# the jit, to avoid users from slowing down the rest of the
+# compiler by enabling the jit.
+if test ${host_shared} = "no" ; then
+ case "${enable_languages}" in
+ *jit*)
+ AC_MSG_ERROR([
+Enabling language "jit" requires --enable-host-shared.
+
+--enable-host-shared typically slows the rest of the compiler down by
+a few %, so you must explicitly enable it.
+
+If you want to build both the jit and the regular compiler, it is often
+best to do this via two separate configure/builds, in separate
+directories, to avoid imposing the performance cost of
+--enable-host-shared on the regular compiler.])
+ ;;
+ *)
+ ;;
+ esac
+fi
+
# Specify what files to not compare during bootstrap.
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"