diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 216 |
1 files changed, 183 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac index f9694cd..2996a12 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,7 @@ m4_include(config/override.m4) m4_include(config/proginstall.m4) m4_include(config/elf.m4) m4_include(config/ax_cxx_compile_stdcxx.m4) +m4_include(config/clang-plugin.m4) m4_include(config/gcc-plugin.m4) m4_include([libtool.m4]) m4_include([ltoptions.m4]) @@ -162,6 +163,7 @@ target_libraries="target-libgcc \ target-libgfortran \ target-libffi \ target-libobjc \ + target-libgcobol \ target-libada \ target-libgm2 \ target-libgo \ @@ -621,6 +623,13 @@ case "${target}" in ;; esac +cpu_type=`echo ${host} | sed 's/-.*$//'` +# Special case cpu_type for x86_64 as it shares AUTO_PROFILE from i386. +if test "${cpu_type}" = "x86_64" ; then + cpu_type="i386" +fi +AC_SUBST(cpu_type) + # Disable libssp for some systems. case "${target}" in avr-*-*) @@ -657,10 +666,6 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then # VxWorks uses the Dinkumware C++ library. noconfigdirs="$noconfigdirs target-libstdc++-v3" ;; - amdgcn*-*-*) - # Not ported/fails to build when using newlib. - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; arm*-wince-pe*) # the C++ libraries don't build on top of CE's C libraries noconfigdirs="$noconfigdirs target-libstdc++-v3" @@ -677,6 +682,21 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then esac fi +# Disable Ada/GNAT on systems where it is known to not work. +# For testing, you can override this with --enable-languages=ada. +case ,${enable_languages}, in + *,ada,*) + ;; + *) + case "${target}" in + amdgcn*-*-* \ + | nvptx*-*-* ) + unsupported_languages="$unsupported_languages ada" + ;; + esac + ;; +esac + # Disable C++ on systems where it is known to not work. # For testing, you can override this with --enable-languages=c++. case ,${enable_languages}, in @@ -705,6 +725,16 @@ case ,${enable_languages}, in ;; esac +# Disable libobjc for some systems where it is known to not work. +case "${target}" in + amdgcn*-*-*) + noconfigdirs="$noconfigdirs target-libobjc" + ;; + nvptx*-*-*) + noconfigdirs="$noconfigdirs target-libobjc" + ;; +esac + # Disable D on systems where it is known to not work. # For testing, you can override this with --enable-languages=d. case ,${enable_languages}, in @@ -736,6 +766,23 @@ if test -d ${srcdir}/libphobos; then fi fi +# Disable libgcobol on unsupported systems. +# For testing, you can override this with --enable-libgcobol. +if test -d ${srcdir}/libgcobol; then + if test x$enable_libgcobol = x; then + AC_MSG_CHECKING([for libgcobol support]) + if (srcdir=${srcdir}/libgcobol; \ + . ${srcdir}/configure.tgt; \ + test -n "$UNSUPPORTED") + then + AC_MSG_RESULT([no]) + noconfigdirs="$noconfigdirs target-libgcobol" + else + AC_MSG_RESULT([yes]) + fi + fi +fi + # Disable Fortran for some systems. case "${target}" in mmix-*-*) @@ -747,6 +794,38 @@ case "${target}" in ;; esac +# Always enable COBOL for --enable-languages=*cobol* +# Otherwise, enable COBOL only for known architectures +case ,${enable_languages}, in + *,cobol,*) + case ,${enable_languages}, in + *,c++,*) + ;; + *) + # We have an explicit cobol, but no c++. We need c++, because cobol + # requires libstdc++ + enable_languages="$enable_languages,c++" + ;; + esac + ;; + *) + case "${target}" in + aarch64-*-linux*|x86_64-*-linux*) + ;; + *-*-*) + unsupported_languages="$unsupported_languages cobol" + ;; + esac + case "${host}" in + aarch64-*-linux*|x86_64-*-linux*) + ;; + *-*-*) + unsupported_languages="$unsupported_languages cobol" + ;; + esac + ;; +esac + # Disable libffi for some systems. case "${target}" in powerpc-*-darwin*) @@ -782,6 +861,9 @@ case "${target}" in alpha*-*-*vms*) noconfigdirs="$noconfigdirs target-libffi" ;; + amdgcn*-*-*) + noconfigdirs="$noconfigdirs target-libffi" + ;; arm*-*-freebsd*) noconfigdirs="$noconfigdirs target-libffi" ;; @@ -825,6 +907,9 @@ case "${target}" in mmix-*-*) noconfigdirs="$noconfigdirs target-libffi" ;; + nvptx*-*-*) + noconfigdirs="$noconfigdirs target-libffi" + ;; powerpc-*-aix*) ;; rs6000-*-aix*) @@ -872,9 +957,15 @@ if test x$enable_libgo = x; then *-*-cygwin* | *-*-mingw*) noconfigdirs="$noconfigdirs target-libgo" ;; + amdgcn*-*-*) + noconfigdirs="$noconfigdirs target-libgo" + ;; bpf-*-*) noconfigdirs="$noconfigdirs target-libgo" ;; + nvptx*-*-*) + noconfigdirs="$noconfigdirs target-libgo" + ;; esac fi @@ -1230,10 +1321,6 @@ case "${target}" in # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; - # This is temporary until we can link against shared libraries - powerpcle-*-solaris*) - noconfigdirs="$noconfigdirs gdb sim tcl tk itcl" - ;; powerpc-*-beos*) noconfigdirs="$noconfigdirs gdb" ;; @@ -1276,7 +1363,7 @@ case "${target}" in noconfigdirs="$noconfigdirs gprof" ;; nvptx*-*-*) - noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" + noconfigdirs="$noconfigdirs target-libssp" ;; sh-*-*) case "${target}" in @@ -1361,11 +1448,12 @@ if test "${build}" != "${host}" ; then CC_FOR_BUILD=${CC_FOR_BUILD-gcc} CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CC_FOR_BUILD) -E}" CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} + DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool} DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil} GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran} GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo} GDC_FOR_BUILD=${GDC_FOR_BUILD-gdc} - DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool} + GNATMAKE_FOR_BUILD=${GNATMAKE_FOR_BUILD-gnatmake} LD_FOR_BUILD=${LD_FOR_BUILD-ld} NM_FOR_BUILD=${NM_FOR_BUILD-nm} RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib} @@ -1376,11 +1464,12 @@ else AS_FOR_BUILD="\$(AS)" CC_FOR_BUILD="\$(CC)" CXX_FOR_BUILD="\$(CXX)" + DLLTOOL_FOR_BUILD="\$(DLLTOOL)" DSYMUTIL_FOR_BUILD="\$(DSYMUTIL)" GFORTRAN_FOR_BUILD="\$(GFORTRAN)" GOC_FOR_BUILD="\$(GOC)" GDC_FOR_BUILD="\$(GDC)" - DLLTOOL_FOR_BUILD="\$(DLLTOOL)" + GNATMAKE_FOR_BUILD="\$(GNATMAKE)" LD_FOR_BUILD="\$(LD)" NM_FOR_BUILD="\$(NM)" RANLIB_FOR_BUILD="\$(RANLIB)" @@ -2059,16 +2148,16 @@ fi AC_SUBST(PICFLAG) -# Check for libdiagnostics support. -AC_MSG_CHECKING([whether to enable libdiagnostics]) -AC_ARG_ENABLE(libdiagnostics, -[AS_HELP_STRING([--enable-libdiagnostics], - [build libdiagnostics shared library])], -enable_libdiagnostics=$enableval, -enable_libdiagnostics=no) +# Check for libgdiagnostics support. +AC_MSG_CHECKING([whether to enable libgdiagnostics]) +AC_ARG_ENABLE(libgdiagnostics, +[AS_HELP_STRING([--enable-libgdiagnostics], + [build libgdiagnostics shared library])], +enable_libgdiagnostics=$enableval, +enable_libgdiagnostics=no) -if test x$enable_libdiagnostics = xyes; then - # Disable libdiagnostics if -enable-host-shared not specified +if test x$enable_libgdiagnostics = xyes; then + # Disable libgdiagnostics if -enable-host-shared not specified # but not if building for Mingw. All code in Windows # is position independent code (PIC). case $target in @@ -2076,12 +2165,12 @@ if test x$enable_libdiagnostics = xyes; then *) if test x$host_shared != xyes; then AC_MSG_ERROR([ -Enabling libdiagnostics requires --enable-host-shared. +Enabling libgdiagnostics 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 libdiagnostics and the regular compiler, it is often +If you want to build both libgdiagnostics 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.]) @@ -2089,8 +2178,8 @@ directories, to avoid imposing the performance cost of ;; esac fi -AC_MSG_RESULT($enable_libdiagnostics) -AC_SUBST(enable_libdiagnostics) +AC_MSG_RESULT($enable_libgdiagnostics) +AC_SUBST(enable_libgdiagnostics) # Rust requires -ldl and -lpthread if you are using an old glibc that does not include them by @@ -2607,6 +2696,16 @@ case ,${enable_languages}, in # Disable target libgrust if we're not building target libstdc++. noconfigdirs="$noconfigdirs target-libgrust" ;; + *) + case "${target}" in + amdgcn*-*-* \ + | nvptx*-*-* ) + # Build fails in 'libgrust/libproc_macro_internal/': + # sorry, unimplemented: exception handling not supported + noconfigdirs="$noconfigdirs target-libgrust" + ;; + esac + ;; esac ;; esac @@ -3730,13 +3829,17 @@ if test x"${build}" = x"${host}" ; then LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} fi -# On Canadian crosses, we'll be searching the right directories for -# the previously-installed cross compiler, so don't bother to add -# flags for directories within the install tree of the compiler -# being built; programs in there won't even run. -if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then +if test -d ${srcdir}/gcc; then + # On Canadian crosses, we'll be searching the right directories for the + # previously-installed cross compiler, so don't bother to add flags for + # executable directories within the install tree of the compiler being built; + # programs in there won't even run. + if test "${build}" = "${host}"; then + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/' + fi + # Search for pre-installed headers if nothing else fits. - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include' + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include' fi if test "x${use_gnu_ld}" = x && @@ -3812,6 +3915,7 @@ AC_SUBST(DSYMUTIL_FOR_BUILD) AC_SUBST(GFORTRAN_FOR_BUILD) AC_SUBST(GOC_FOR_BUILD) AC_SUBST(GDC_FOR_BUILD) +AC_SUBST(GNATMAKE_FOR_BUILD) AC_SUBST(LDFLAGS_FOR_BUILD) AC_SUBST(LD_FOR_BUILD) AC_SUBST(NM_FOR_BUILD) @@ -3909,18 +4013,30 @@ AC_SUBST(GDCFLAGS) GDCFLAGS=${GDCFLAGS-${CFLAGS}} AC_SUBST(PKG_CONFIG_PATH) -GCC_PLUGIN_OPTION(PLUGIN_OPTION) +# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the +# wrong PLUGIN_OPTION with clang. +CLANG_PLUGIN_FILE(PLUGIN_FILE) +if test -n "$PLUGIN_FILE"; then + PLUGIN_OPTION="--plugin $PLUGIN_FILE" +else + GCC_PLUGIN_OPTION(PLUGIN_OPTION) +fi AR_PLUGIN_OPTION= +NM_PLUGIN_OPTION= RANLIB_PLUGIN_OPTION= if test -n "$PLUGIN_OPTION"; then if $AR --help 2>&1 | grep -q "\--plugin"; then AR_PLUGIN_OPTION="$PLUGIN_OPTION" fi + if $NM --help 2>&1 | grep -q "\--plugin"; then + NM_PLUGIN_OPTION="$PLUGIN_OPTION" + fi if $RANLIB --help 2>&1 | grep -q "\--plugin"; then RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" fi fi AC_SUBST(AR_PLUGIN_OPTION) +AC_SUBST(NM_PLUGIN_OPTION) AC_SUBST(RANLIB_PLUGIN_OPTION) # Target tools. @@ -3966,12 +4082,24 @@ GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar]) GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new]) GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/]) dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS -GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX, +case $target in + *-*-darwin*) + GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX, + [gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -B$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -B$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -B$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs], + c++) + GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX, + [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -B$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -B$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -B$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs], + c++) + ;; + *) + GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX, [gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs], c++) -GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX, + GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX, [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs], c++) + ;; +esac GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool]) GCC_TARGET_TOOL(dsymutil, DSYMUTIL_FOR_TARGET, DSYMUTIL) GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/]) @@ -4003,6 +4131,27 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} +# Try CLANG_PLUGIN_FILE_FOR_TARGET first since GCC_PLUGIN_OPTION_FOR_TARGET +# may return the wrong PLUGIN_OPTION_FOR_TARGET with clang. +CLANG_PLUGIN_FILE_FOR_TARGET(PLUGIN_FILE_FOR_TARGET) +if test -n "$PLUGIN_FILE_FOR_TARGET"; then + PLUGIN_OPTION_FOR_TARGET="--plugin $PLUGIN_FILE_FOR_TARGET" +else + GCC_PLUGIN_OPTION_FOR_TARGET(PLUGIN_OPTION_FOR_TARGET) +fi +if test -n "$PLUGIN_OPTION_FOR_TARGET"; then + AR_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" + NM_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" + RANLIB_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" +else + AR_PLUGIN_OPTION_FOR_TARGET= + NM_PLUGIN_OPTION_FOR_TARGET= + RANLIB_PLUGIN_OPTION_FOR_TARGET= +fi +AC_SUBST(AR_PLUGIN_OPTION_FOR_TARGET) +AC_SUBST(NM_PLUGIN_OPTION_FOR_TARGET) +AC_SUBST(RANLIB_PLUGIN_OPTION_FOR_TARGET) + # When building target libraries, except in a Canadian cross, we use # the same toolchain as the compiler we just built. COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)' @@ -4112,6 +4261,7 @@ compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*" compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/M2Version*" compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/SYSTEM*" compare_exclusions="$compare_exclusions | gcc/m2/gm2version*" +compare_exclusions="$compare_exclusions | gcc/cobol/parse\$(objext)" case "$target" in hppa*64*-*-hpux*) ;; powerpc*-ibm-aix*) compare_exclusions="$compare_exclusions | *libgomp*\$(objext)" ;; |