]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - configure
sh.c: Do not include algorithm.
[thirdparty/gcc.git] / configure
index 55fca62a5d6d59c5ea17e2dc56229a247755a774..96225b570ddb245daa99c0c0682e7c4efeb7f0c6 100755 (executable)
--- a/configure
+++ b/configure
@@ -642,12 +642,10 @@ CXXFLAGS_FOR_TARGET
 CFLAGS_FOR_TARGET
 DEBUG_PREFIX_CFLAGS_FOR_TARGET
 SYSROOT_CFLAGS_FOR_TARGET
-stage1_languages
 extra_host_libiberty_configure_flags
+stage1_languages
 extra_linker_plugin_flags
 extra_linker_plugin_configure_flags
-clooginc
-clooglibs
 islinc
 isllibs
 poststage1_ldflags
@@ -674,6 +672,7 @@ LDFLAGS
 CFLAGS
 CC
 EXTRA_CONFIGARGS_LIBJAVA
+extra_liboffloadmic_configure_flags
 target_subdir
 host_subdir
 build_subdir
@@ -747,6 +746,8 @@ ospace_frag'
 ac_user_opts='
 enable_option_checking
 with_build_libsubdir
+enable_as_accelerator_for
+enable_offload_targets
 enable_gold
 enable_ld
 enable_libquadmath
@@ -754,6 +755,7 @@ enable_libquadmath_support
 enable_libada
 enable_libssp
 enable_libstdcxx
+enable_liboffloadmic
 enable_static_libjava
 enable_bootstrap
 with_mpc
@@ -772,14 +774,10 @@ with_stage1_libs
 with_stage1_ldflags
 with_boot_libs
 with_boot_ldflags
-with_cloog
 with_isl
 with_isl_include
 with_isl_lib
 enable_isl_version_check
-with_cloog_include
-with_cloog_lib
-enable_cloog_version_check
 enable_lto
 enable_linker_plugin_configure_flags
 enable_linker_plugin_flags
@@ -1466,6 +1464,13 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-as-accelerator-for=ARG
+                          build as offload target compiler. Specify offload
+                          host triple by ARG
+  --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
   --enable-gold[=ARG]     build gold [ARG={default,yes,no}]
   --enable-ld[=ARG]       build ld [ARG={default,yes,no}]
   --disable-libquadmath   do not build libquadmath directory
@@ -1474,13 +1479,13 @@ Optional Features:
   --enable-libada         build libada directory
   --enable-libssp         build libssp directory
   --disable-libstdcxx     do not build libstdc++-v3 directory
+  --enable-liboffloadmic=ARG
+                          build liboffloadmic [ARG={no,host,target}]
   --enable-static-libjava[=ARG]
                           build static libjava [default=no]
   --enable-bootstrap      enable bootstrapping [yes if native build]
   --disable-isl-version-check
                           disable check for ISL version
-  --disable-cloog-version-check
-                          disable check for CLooG version
   --enable-lto            enable link time optimization support
   --enable-linker-plugin-configure-flags=FLAGS
                           additional flags for configuring linker plugins
@@ -1538,20 +1543,12 @@ Optional Packages:
   --with-boot-libs=LIBS   libraries for stage2 and later
   --with-boot-ldflags=FLAGS
                           linker flags for stage2 and later
-  --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
   --with-isl=PATH         Specify prefix directory for the installed ISL
                           package. Equivalent to
                           --with-isl-include=PATH/include plus
                           --with-isl-lib=PATH/lib
   --with-isl-include=PATH Specify directory for installed ISL include files
   --with-isl-lib=PATH     Specify the directory for the installed ISL library
-  --with-cloog-include=PATH
-                          Specify directory for installed CLooG include files
-  --with-cloog-lib=PATH   Specify the directory for the installed CLooG
-                          library
   --with-build-sysroot=SYSROOT
                           use sysroot as the system root during the build
   --with-debug-prefix-map='A=B C=D ...'
@@ -2713,14 +2710,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
 #f
-host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl cloog libelf libiconv"
+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
@@ -2728,7 +2725,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"
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
@@ -2744,6 +2741,7 @@ target_libraries="target-libgcc \
                target-newlib \
                target-libgomp \
                target-libcilkrts \
+               target-liboffloadmic \
                target-libatomic \
                target-libitm \
                target-libstdc++-v3 \
@@ -2893,6 +2891,26 @@ case ${with_newlib} in
   yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
 esac
 
+# Check whether --enable-as-accelerator-for was given.
+if test "${enable_as_accelerator_for+set}" = set; then :
+  enableval=$enable_as_accelerator_for; ENABLE_AS_ACCELERATOR_FOR=$enableval
+else
+  ENABLE_AS_ACCELERATOR_FOR=no
+fi
+
+
+# Check whether --enable-offload-targets was given.
+if test "${enable_offload_targets+set}" = set; then :
+  enableval=$enable_offload_targets;
+  if test x"$enable_offload_targets" = x; then
+    as_fn_error "no offload targets specified" "$LINENO" 5
+  fi
+
+else
+  enable_offload_targets=
+fi
+
+
 # Handle --enable-gold, --enable-ld.
 # --disable-gold [--enable-ld]
 #     Build only ld.  Default option.
@@ -2940,7 +2958,8 @@ case "${ENABLE_GOLD}" in
     if test "$is_elf" = "yes"; then
       # Check for target supported by gold.
       case "${target}" in
-        i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* | tilegx*-*-*)
+        i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
+        | aarch64*-*-* | tilegx*-*-*)
          configdirs="$configdirs gold"
          if test x${ENABLE_GOLD} = xdefault; then
            default_ld=gold
@@ -3062,6 +3081,44 @@ if test "${ENABLE_LIBSTDCXX}" = "no" ; then
   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.
+# Check whether --enable-liboffloadmic was given.
+if test "${enable_liboffloadmic+set}" = set; then :
+  enableval=$enable_liboffloadmic; case "$enableval" in
+  no | host | target)
+    enable_liboffloadmic=$enableval ;;
+  *)
+    as_fn_error "--enable-liboffloadmic=no/host/target" "$LINENO" 5 ;;
+esac
+else
+  if test "${ENABLE_AS_ACCELERATOR_FOR}" != "no"; 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
+fi
+
+
+
 # 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
@@ -3155,6 +3212,25 @@ $as_echo "yes" >&6; }
     fi
 fi
 
+# Disable liboffloadmic on unsupported systems.
+if test -d ${srcdir}/liboffloadmic; then
+    if test x$enable_liboffloadmic != xno; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for liboffloadmic support" >&5
+$as_echo_n "checking for liboffloadmic support... " >&6; }
+       if (srcdir=${srcdir}/liboffloadmic; \
+               . ${srcdir}/configure.tgt; \
+               test -n "$UNSUPPORTED")
+       then
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+           noconfigdirs="$noconfigdirs target-liboffloadmic"
+       else
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       fi
+    fi
+fi
+
 # Disable libitm on unsupported systems.
 if test -d ${srcdir}/libitm; then
     if test x$enable_libitm = x; then
@@ -3412,6 +3488,14 @@ case "${target}" in
     ;;
 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.
 # For testing, you can easily override this with --enable-libgo.
 if test x$enable_libgo = x; then
@@ -3770,6 +3854,10 @@ case "${target}" in
   mips*-*-*)
     noconfigdirs="$noconfigdirs gprof"
     ;;
+  nvptx*-*-*)
+    # nvptx is just a compiler
+    noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
+    ;;
   sh-*-* | sh64-*-*)
     case "${target}" in
       sh*-*-elf)
@@ -5777,15 +5865,8 @@ fi
 
 
 
-# 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
-
-
-# Check whether --with-cloog was given.
-if test "${with_cloog+set}" = set; then :
-  withval=$with_cloog;
-fi
+# GCC GRAPHITE dependency ISL.
+# Basic setup is inlined here, actual checks are in config/isl.m4
 
 
 # Check whether --with-isl was given.
@@ -5920,161 +6001,18 @@ $as_echo "$gcc_cv_isl" >&6; }
   fi
 
 
-
-  if test "x$gcc_cv_isl" != "xno"; then
-    # Check for CLOOG
-
-
-# Check whether --with-cloog-include was given.
-if test "${with_cloog_include+set}" = set; then :
-  withval=$with_cloog_include;
-fi
-
-
-# Check whether --with-cloog-lib was given.
-if test "${with_cloog_lib+set}" = set; then :
-  withval=$with_cloog_lib;
-fi
-
-
-  # Check whether --enable-cloog-version-check was given.
-if test "${enable_cloog_version_check+set}" = set; then :
-  enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval
-else
-  ENABLE_CLOOG_CHECK=yes
 fi
 
-
-  # Initialize clooglibs and clooginc.
-  case $with_cloog in
-    no)
-      clooglibs=
-      clooginc=
-      ;;
-    "" | yes)
-      ;;
-    *)
-      clooglibs="-L$with_cloog/lib"
-      clooginc="-I$with_cloog/include"
-      ;;
-  esac
-  if test "x${with_cloog_include}" != x ; then
-    clooginc="-I$with_cloog_include"
-  fi
-  if test "x${with_cloog_lib}" != x; then
-    clooglibs="-L$with_cloog_lib"
-  fi
-        if test "x${clooginc}" = x && test "x${clooglibs}" = x \
-     && test -d ${srcdir}/cloog; then
-     clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
-     clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include'
-    ENABLE_CLOOG_CHECK=no
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using in-tree CLooG, disabling version check" >&5
-$as_echo "$as_me: WARNING: using in-tree CLooG, disabling version check" >&2;}
-  fi
-
-  clooginc="-DCLOOG_INT_GMP ${clooginc}"
-  clooglibs="${clooglibs} -lcloog-isl"
-
-
-
-
-
-  if test "${ENABLE_CLOOG_CHECK}" = yes ; then
-    _cloog_saved_CFLAGS=$CFLAGS
-    _cloog_saved_LDFLAGS=$LDFLAGS
-
-    CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${islinc} ${gmpinc}"
-    LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${isllibs} ${gmplib}"
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.18.1 of CLooG" >&5
-$as_echo_n "checking for version 0.18.1 of CLooG... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include "cloog/version.h"
-int
-main ()
-{
-#if CLOOG_VERSION_MAJOR != 0 \
-    || CLOOG_VERSION_MINOR != 18 \
-    || CLOOG_VERSION_REVISION < 1
-    choke me
-   #endif
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gcc_cv_cloog=yes
-else
-  gcc_cv_cloog=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog" >&5
-$as_echo "$gcc_cv_cloog" >&6; }
-
-    CFLAGS=$_cloog_saved_CFLAGS
-    LDFLAGS=$_cloog_saved_LDFLAGS
-  fi
-
-
-
-
-
-
-
-  if test "x${with_cloog}" = xno; then
-    graphite_requested=no
-  elif test "x${with_cloog}" != x \
-    || test "x${with_cloog_include}" != x \
-    || test "x${with_cloog_lib}" != x ; then
-    graphite_requested=yes
-  else
-    graphite_requested=no
-  fi
-
-
-
-  if test "${gcc_cv_cloog}" = no ; then
-    clooglibs=
-    clooginc=
-  fi
-
-  if test "${graphite_requested}" = yes \
-    && test "x${clooglibs}" = x \
-    && test "x${clooginc}" = x ; then
-
-      as_fn_error "Unable to find a usable CLooG.  See config.log for details." "$LINENO" 5
-  fi
-
-
-  fi
-fi
-
-# If the ISL check failed, disable builds of in-tree
-# variants of both ISL and CLooG
+# If the ISL check failed, disable builds of in-tree variant of ISL
 if test "x$with_isl" = xno ||
    test "x$gcc_cv_isl" = xno; then
-  noconfigdirs="$noconfigdirs cloog isl"
+  noconfigdirs="$noconfigdirs isl"
   islinc=
-  clooginc=
-  clooglibs=
-fi
-
-# If the CLooG check failed, disable builds of in-tree
-# variants of CLooG
-if test "x$with_cloog" = xno ||
-   test "x$gcc_cv_cloog" = xno; then
-  noconfigdirs="$noconfigdirs cloog isl"
-  clooginc=
-  clooglibs=
 fi
 
 
 
 
-
-
 # Check for LTO support.
 # Check whether --enable-lto was given.
 if test "${enable_lto+set}" = set; then :
@@ -6251,7 +6189,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,*) ;;
@@ -6259,11 +6196,9 @@ 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
 
-
   missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
   potential_languages=,c,
 
@@ -6477,7 +6412,7 @@ case ,${enable_languages},:${enable_objc_gc} in
     ;;
 esac
 
-# Disable libcilkrts, 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++,*)
     # Disable libcilkrts, libitm, libsanitizer if we're not building libstdc++
@@ -6489,7 +6424,7 @@ case ,${enable_languages}, in
     esac
     ;;
   *)
-    noconfigdirs="$noconfigdirs target-libcilkrts target-libitm target-libsanitizer target-libvtv"
+    noconfigdirs="$noconfigdirs target-libcilkrts target-liboffloadmic target-libitm target-libsanitizer target-libvtv"
     ;;
 esac
 
@@ -6576,6 +6511,17 @@ then
   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
+
+
 # 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
@@ -7285,7 +7231,7 @@ do
 
 
     case $lib in
-    mpc | mpfr | gmp | isl | 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
@@ -7378,8 +7324,10 @@ tbaseargs="$tbaseargs --disable-option-checking"
 
 # 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