Newer
Older
*-*-phoenix*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
*-*-rtems*)
Joseph Myers
committed
noconfigdirs="$noconfigdirs target-libgloss"
# The tpf target doesn't support gdb yet.
*-*-tpf*)
noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
*-*-uclinux*)
noconfigdirs="$noconfigdirs target-rda"
# ld works, but does not support shared libraries.
noconfigdirs="$noconfigdirs gas ld"
Joseph Myers
committed
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
Joseph Myers
committed
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
bpf-*-*)
noconfigdirs="$noconfigdirs target-libobjc target-libbacktrace"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
arc*-*-*)
noconfigdirs="$noconfigdirs sim"
;;
Joseph Myers
committed
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs ld target-libgloss"
Georg-Johann Lay
committed
avr-*-*)
if test x${with_avrlibc} != xno; then
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
fi
;;
noconfigdirs="$noconfigdirs target-libgloss"
tic54x-*-*)
noconfigdirs="$noconfigdirs target-libgloss gdb"
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs gdb"
Joseph Myers
committed
noconfigdirs="$noconfigdirs gdb"
ft32-*-*)
noconfigdirs="$noconfigdirs target-rda gprof"
;;
Joseph Myers
committed
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss"
hppa*64*-*-hpux*)
noconfigdirs="$noconfigdirs gdb"
;;
;;
hppa*-*-lites* | \
hppa*64*-*-*)
Rask Ingemann Lambertsen
committed
hppa*-*-pro*)
;;
Joseph Myers
committed
noconfigdirs="$noconfigdirs ld"
Hans-Peter Nilsson
committed
i960-*-*)
noconfigdirs="$noconfigdirs gdb"
Hans-Peter Nilsson
committed
;;
noconfigdirs="$noconfigdirs readline libgui itcl gdb"
# No ld support yet.
noconfigdirs="$noconfigdirs gdb libgui itcl ld"
ia64*-*-*vms*)
# No ld support yet.
noconfigdirs="$noconfigdirs libgui itcl ld"
Kai Tietz
committed
i[[3456789]]86-w64-mingw*)
;;
i[[3456789]]86-*-mingw*)
target_configdirs="$target_configdirs target-winsup"
Ozkan Sezer
committed
;;
*-*-cygwin*)
target_configdirs="$target_configdirs target-libtermcap target-winsup"
noconfigdirs="$noconfigdirs target-libgloss"
Corinna Vinschen
committed
# always build newlib if winsup directory is present.
if test -d "$srcdir/winsup/cygwin"; then
Corinna Vinschen
committed
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
elif test -d "$srcdir/newlib"; then
echo "Warning: winsup/cygwin is missing so newlib can't be built."
Corinna Vinschen
committed
fi
Ozkan Sezer
committed
;;
noconfigdirs="$noconfigdirs target-libgloss"
i[[3456789]]86-*-sco3.2v5*)
# The linker does not yet know about weak symbols in COFF,
# and is not configured to handle mixed ELF and COFF.
noconfigdirs="$noconfigdirs ld target-libgloss"
i[[3456789]]86-*-sco*)
noconfigdirs="$noconfigdirs gprof target-libgloss"
Rainer Orth
committed
i[[3456789]]86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*)
noconfigdirs="$noconfigdirs target-libgloss"
i[[3456789]]86-*-sysv4*)
noconfigdirs="$noconfigdirs target-libgloss"
i[[3456789]]86-*-beos*)
noconfigdirs="$noconfigdirs gdb"
noconfigdirs="$noconfigdirs gdb"
Rask Ingemann Lambertsen
committed
;;
Joseph Myers
committed
noconfigdirs="$noconfigdirs gdb"
noconfigdirs="$noconfigdirs sim"
;;
Francois H. Theron
committed
nfp-*-*)
noconfigdirs="$noconfigdirs ld gas gdb gprof sim"
noconfigdirs="$noconfigdirs $target_libraries"
;;
Stephen Casner
committed
pdp11-*-*)
noconfigdirs="$noconfigdirs gdb gprof"
;;
noconfigdirs="$noconfigdirs gprof"
powerpc*-*-winnt* | powerpc*-*-pe*)
noconfigdirs="$noconfigdirs gdb tcl tk target-libgloss itcl"
# 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"
noconfigdirs="$noconfigdirs gdb"
noconfigdirs="$noconfigdirs gprof"
noconfigdirs="$noconfigdirs gprof"
Joseph Myers
committed
noconfigdirs="$noconfigdirs gprof"
noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
Joseph Myers
committed
noconfigdirs="$noconfigdirs gprof"
mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
if test x$with_newlib = xyes; then
noconfigdirs="$noconfigdirs gprof"
fi
;;
noconfigdirs="$noconfigdirs gprof target-libgloss"
Joseph Myers
committed
noconfigdirs="$noconfigdirs gprof target-libgloss"
noconfigdirs="$noconfigdirs ld gas gprof target-libgloss"
mips*-*-ultrix* | mips*-*-osf* | mips*-*-ecoff* | mips*-*-pe* \
| mips*-*-irix* | mips*-*-lnews* | mips*-*-riscos*)
noconfigdirs="$noconfigdirs ld gas gprof"
;;
Joseph Myers
committed
noconfigdirs="$noconfigdirs gprof"
nvptx*-*-*)
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
;;
Joseph Myers
committed
;;
Joseph Myers
committed
noconfigdirs="$noconfigdirs target-libgloss" ;;
if test x${is_cross_compiler} = xno ; then
noconfigdirs="$noconfigdirs sim"
tilepro*-*-* | tilegx*-*-*)
noconfigdirs="$noconfigdirs sim"
;;
noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
Joseph Myers
committed
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
wasm32-*-*)
noconfigdirs="$noconfigdirs ld"
;;
loongarch*-*-linux*)
;;
loongarch*-*-*)
noconfigdirs="$noconfigdirs gprof"
;;
esac
# If we aren't building newlib, then don't build libgloss, since libgloss
# depends upon some newlib header files.
case "${noconfigdirs}" in
*target-libgloss*) ;;
*target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
# Work in distributions that contain no compiler tools, like Autoconf.
host_makefile_frag=/dev/null
if test -d ${srcdir}/config ; then
case "${host}" in
i[[3456789]]86-*-msdosdjgpp*)
host_makefile_frag="config/mh-djgpp"
;;
*-cygwin*)
Nick Clifton
committed
ACX_CHECK_CYGWIN_CAT_WORKS
host_makefile_frag="config/mh-cygwin"
;;
host_makefile_frag="config/mh-mingw"
host_makefile_frag="config/mh-alpha-linux"
;;
hppa*-hp-hpux*)
host_makefile_frag="config/mh-pa"
;;
hppa*-*)
host_makefile_frag="config/mh-pa"
;;
i?86-*-darwin[[89]]* | i?86-*-darwin1[[0-7]]* | powerpc*-*-darwin*)
host_makefile_frag="config/mh-darwin"
;;
powerpc-*-aix*)
host_makefile_frag="config/mh-ppc-aix"
;;
rs6000-*-aix*)
host_makefile_frag="config/mh-ppc-aix"
;;
AR_FOR_BUILD=${AR_FOR_BUILD-ar}
AS_FOR_BUILD=${AS_FOR_BUILD-as}
CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CC_FOR_BUILD) -E}"
CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
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}
LD_FOR_BUILD=${LD_FOR_BUILD-ld}
NM_FOR_BUILD=${NM_FOR_BUILD-nm}
RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres}
WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc}
AR_FOR_BUILD="\$(AR)"
AS_FOR_BUILD="\$(AS)"
CXX_FOR_BUILD="\$(CXX)"
DSYMUTIL_FOR_BUILD="\$(DSYMUTIL)"
GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
GOC_FOR_BUILD="\$(GOC)"
GDC_FOR_BUILD="\$(GDC)"
DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
LD_FOR_BUILD="\$(LD)"
NM_FOR_BUILD="\$(NM)"
RANLIB_FOR_BUILD="\$(RANLIB)"
WINDRES_FOR_BUILD="\$(WINDRES)"
WINDMC_FOR_BUILD="\$(WINDMC)"
fi
AC_PROG_CC_C99
AC_PROG_CXX
# We must set the default linker to the linker used by gcc for the correct
# operation of libtool. If LD is not defined and we are using gcc, try to
# set the LD default to the ld used by gcc.
if test -z "$LD"; then
if test "$GCC" = yes; then
case $build in
*-*-mingw*)
gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
*)
gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
esac
case $gcc_prog_ld in
# Accept absolute paths.
[[\\/]* | [A-Za-z]:[\\/]*)]
LD="$gcc_prog_ld" ;;
esac
fi
# Check whether -static-libstdc++ -static-libgcc is supported.
have_static_libs=no
if test "$GCC" = yes; then
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([AC_LANG_SOURCE([
#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
#error -static-libstdc++ not implemented
#endif
int main() {}])],
[AC_MSG_RESULT([yes]); have_static_libs=yes],
[AC_MSG_RESULT([no])])
AC_LANG_POP(C++)
LDFLAGS="$saved_LDFLAGS"
fi
Iain Buclaw
committed
ACX_PROG_GDC
ACX_PROG_CMP_IGNORE_INITIAL
AC_ARG_ENABLE([bootstrap],
[AS_HELP_STRING([--enable-bootstrap],
[enable bootstrapping @<:@yes if native build@:>@])],,
enable_bootstrap=default)
# Issue errors and warnings for invalid/strange bootstrap combinations.
if test -r $srcdir/gcc/configure; then
have_compiler=yes
else
have_compiler=no
fi
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
case "$have_compiler:$host:$target:$enable_bootstrap" in
*:*:*:no) ;;
# Default behavior. Enable bootstrap if we have a compiler
# and we are in a native configuration.
yes:$build:$build:default)
enable_bootstrap=yes ;;
*:*:*:default)
enable_bootstrap=no ;;
# We have a compiler and we are in a native configuration, bootstrap is ok
yes:$build:$build:yes)
;;
# Other configurations, but we have a compiler. Assume the user knows
# what he's doing.
yes:*:*:yes)
AC_MSG_WARN([trying to bootstrap a cross compiler])
;;
# No compiler: if they passed --enable-bootstrap explicitly, fail
no:*:*:yes)
AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
# Fail if wrong command line
*)
AC_MSG_ERROR([invalid option for --enable-bootstrap])
;;
esac
# When bootstrapping with GCC, build stage 1 in C++11 mode to ensure that a
# C++11 compiler can still start the bootstrap. Otherwise, if building GCC,
# require C++11 (or higher).
if test "$enable_bootstrap:$GXX" = "yes:yes"; then
elif test "$have_compiler" = yes; then
AX_CXX_COMPILE_STDCXX(11)
Tobias Burnus
committed
if test "${build}" != "${host}"; then
AX_CXX_COMPILE_STDCXX(11, [], [], [_FOR_BUILD])
fi
fi
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
AC_ARG_ENABLE([pgo-build],
[AS_HELP_STRING([--enable-pgo-build[[=lto]]],
[enable the PGO build])],
[enable_pgo_build=$enableval],
[enable_pgo_build=no])
# Issue errors and warnings for invalid/strange PGO build combinations.
case "$have_compiler:$host:$target:$enable_pgo_build" in
*:*:*:no) ;;
# Allow the PGO build only if we aren't building a compiler and
# we are in a native configuration.
no:$build:$build:yes | no:$build:$build:lto) ;;
# Disallow the PGO bootstrap if we are building a compiler.
yes:*:*:yes | yes:*:*:lto)
AC_MSG_ERROR([cannot perform the PGO bootstrap when building a compiler]) ;;
*)
AC_MSG_ERROR([invalid option for --enable-pgo-build])
;;
esac
if test "$enable_pgo_build" != "no"; then
AC_MSG_CHECKING([whether the compiler supports -fprofile-generate])
old_CFLAGS="$CFLAGS"
PGO_BUILD_GEN_CFLAGS="-fprofile-generate"
CFLAGS="$CFLAGS $PGO_BUILD_CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo;])],,
[PGO_BUILD_GEN_CFLAGS=])
CFLAGS="$old_CFLAGS"
if test -n "$PGO_BUILD_GEN_CFLAGS"; then
AC_MSG_RESULT([yes])
PGO_BUILD_USE_CFLAGS="-fprofile-use"
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot perform the PGO build without -fprofile-generate])
fi
if test "$enable_pgo_build" = "lto"; then
AC_MSG_CHECKING([whether the compiler supports -flto=jobserver -ffat-lto-objects])
old_CFLAGS="$CFLAGS"
PGO_BUILD_LTO_CFLAGS="-flto=jobserver -ffat-lto-objects"
CFLAGS="$CFLAGS $PGO_BUILD_LTO_CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo;])],,
[PGO_BUILD_LTO_CFLAGS=])
CFLAGS="$old_CFLAGS"
if test -n "$PGO_BUILD_LTO_CFLAGS"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_WARN([LTO is disabled for the PGO build])
fi
fi
fi
AC_SUBST(PGO_BUILD_GEN_CFLAGS)
AC_SUBST(PGO_BUILD_USE_CFLAGS)
AC_SUBST(PGO_BUILD_LTO_CFLAGS)
# Used for setting $lt_cv_objdir
_LT_CHECK_OBJDIR
# Check for GMP, MPFR and MPC
require_gmp=no
require_mpc=no
if test -d ${srcdir}/gcc ; then
require_gmp=yes
require_mpc=yes
fi
if test -d ${srcdir}/gdb ; then
if test "x$enable_gdb" != xno; then
require_gmp=yes
fi
fi
gmplibs="-lmpfr -lgmp"
if test x"$require_mpc" = "xyes" ; then
gmplibs="-lmpc $gmplibs"
fi
# Specify a location for mpc
# check for this first so it ends up on the link line before mpfr.
AC_ARG_WITH(mpc,
[AS_HELP_STRING([--with-mpc=PATH],
[specify prefix directory for installed MPC package.
Equivalent to --with-mpc-include=PATH/include
plus --with-mpc-lib=PATH/lib])])
AC_ARG_WITH(mpc-include,
[AS_HELP_STRING([--with-mpc-include=PATH],
[specify directory for installed MPC include files])])
AC_ARG_WITH(mpc-lib,
[AS_HELP_STRING([--with-mpc-lib=PATH],
[specify directory for the installed MPC library])])
if test "x$with_mpc" != x; then
gmplibs="-L$with_mpc/lib $gmplibs"
gmpinc="-I$with_mpc/include $gmpinc"
fi
if test "x$with_mpc_include" != x; then
gmpinc="-I$with_mpc_include $gmpinc"
fi
if test "x$with_mpc_lib" != x; then
gmplibs="-L$with_mpc_lib $gmplibs"
fi
if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
gmpinc='-I$$s/mpc/src '"$gmpinc"
# Do not test the mpc version. Assume that it is sufficient, since
# it is in the source tree, and the library has not been built yet
# but it would be included on the link line in the version check below
# hence making the test fail.
have_gmp=yes
# Specify a location for mpfr
# check for this first so it ends up on the link line before gmp.
AC_ARG_WITH(mpfr,
[AS_HELP_STRING([--with-mpfr=PATH],
[specify prefix directory for installed MPFR package.
Equivalent to --with-mpfr-include=PATH/include
plus --with-mpfr-lib=PATH/lib])])
AC_ARG_WITH(mpfr-include,
[AS_HELP_STRING([--with-mpfr-include=PATH],
[specify directory for installed MPFR include files])])
AC_ARG_WITH(mpfr-lib,
[AS_HELP_STRING([--with-mpfr-lib=PATH],
[specify directory for the installed MPFR library])])
if test "x$with_mpfr" != x; then
gmplibs="-L$with_mpfr/lib $gmplibs"
gmpinc="-I$with_mpfr/include $gmpinc"
if test "x$with_mpfr_include" != x; then
gmpinc="-I$with_mpfr_include $gmpinc"
fi
if test "x$with_mpfr_lib" != x; then
gmplibs="-L$with_mpfr_lib $gmplibs"
fi
if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
# MPFR v3.1.0 moved the sources into a src sub-directory.
if ! test -d ${srcdir}/mpfr/src; then
AC_MSG_ERROR([dnl
Building GCC with MPFR in the source tree is only handled for MPFR 3.1.0+.])
fi
gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
# Do not test the mpfr version. Assume that it is sufficient, since
# it is in the source tree, and the library has not been built yet
# but it would be included on the link line in the version check below
# hence making the test fail.
have_gmp=yes
fi
# Specify a location for gmp
AC_ARG_WITH(gmp,
[AS_HELP_STRING([--with-gmp=PATH],
[specify prefix directory for the installed GMP package.
Equivalent to --with-gmp-include=PATH/include
plus --with-gmp-lib=PATH/lib])])
AC_ARG_WITH(gmp-include,
[AS_HELP_STRING([--with-gmp-include=PATH],
[specify directory for installed GMP include files])])
AC_ARG_WITH(gmp-lib,
[AS_HELP_STRING([--with-gmp-lib=PATH],
[specify directory for the installed GMP library])])
if test "x$with_gmp" != x; then
gmplibs="-L$with_gmp/lib $gmplibs"
gmpinc="-I$with_gmp/include $gmpinc"
if test "x$with_gmp_include" != x; then
gmpinc="-I$with_gmp_include $gmpinc"
fi
if test "x$with_gmp_lib" != x; then
gmplibs="-L$with_gmp_lib $gmplibs"
fi
if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
Marc Glisse
committed
extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
# Do not test the gmp version. Assume that it is sufficient, since
# it is in the source tree, and the library has not been built yet
# but it would be included on the link line in the version check below
# hence making the test fail.
have_gmp=yes
fi
if test "x$require_gmp" = xyes && test "x$have_gmp" = xno; then
have_gmp=yes
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $gmpinc"
# Check for the recommended and required versions of GMP.
AC_MSG_CHECKING([for the correct version of gmp.h])
#define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
#define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
#if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
], [AC_TRY_COMPILE([#include <gmp.h>],[
#define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
#define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
#if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
choke me
#endif
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
[AC_MSG_RESULT([no]); have_gmp=no])
# If we have GMP, check the MPFR version.
# Check for the recommended and required versions of MPFR.
AC_MSG_CHECKING([for the correct version of mpfr.h])
AC_TRY_COMPILE([#include <gmp.h>
#if MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)
], [AC_TRY_COMPILE([#include <gmp.h>
#if MPFR_VERSION < MPFR_VERSION_NUM(3,1,6)
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
[AC_MSG_RESULT([no]); have_gmp=no])
fi
# Check for the MPC header version.
if test "x$require_mpc" = xyes && test x"$have_gmp" = xyes ; then
# Check for the recommended and required versions of MPC.
AC_MSG_CHECKING([for the correct version of mpc.h])
AC_TRY_COMPILE([#include <mpc.h>],[
#if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
], [AC_TRY_COMPILE([#include <mpc.h>],[
#if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
choke me
#endif
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
[AC_MSG_RESULT([no]); have_gmp=no])
fi
# Now check the MPFR library.
if test x"$have_gmp" = xyes; then
saved_LIBS="$LIBS"
LIBS="$LIBS $gmplibs"
AC_MSG_CHECKING([for the correct version of the gmp/mpfr libraries])
AC_TRY_LINK([#include <mpfr.h>],[
mpfr_atan2 (n, n, x, MPFR_RNDN);
mpfr_erfc (n, x, MPFR_RNDN);
mpfr_subnormalize (x, t, MPFR_RNDN);
mpfr_clear(n);
mpfr_clear(x);
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
LIBS="$saved_LIBS"
fi
# Now check the MPC library
if test "x$require_mpc" = xyes && test x"$have_gmp" = xyes; then
saved_LIBS="$LIBS"
LIBS="$LIBS $gmplibs"
AC_MSG_CHECKING([for the correct version of the mpc libraries])
AC_TRY_LINK([#include <mpc.h>],[
mpc_t c;
mpc_init2 (c, 53);
mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
mpc_cosh (c, c, MPC_RNDNN);
mpc_pow (c, c, c, MPC_RNDNN);
mpc_acosh (c, c, MPC_RNDNN);
mpc_clear (c);
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
LIBS="$saved_LIBS"
# The library versions listed in the error message below should match
# the HARD-minimums enforced above.
if test -d ${srcdir}/gcc ; then
AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
https://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.])
else
AC_MSG_ERROR([Building GDB requires GMP 4.2+, and MPFR 3.1.0+.
Try the --with-gmp and/or --with-mpfr options to specify
their locations. If you obtained GMP and/or MPFR from a vendor
distribution package, make sure that you have installed both the libraries
and the header files. They may be located in separate packages.])
fi
# Flags needed for both GMP, MPFR and/or MPC.
AC_SUBST(gmplibs)
AC_SUBST(gmpinc)
Kaveh R. Ghazi
committed
AC_SUBST(extra_mpfr_configure_flags)
AC_SUBST(extra_mpc_gmp_configure_flags)
AC_SUBST(extra_mpc_mpfr_configure_flags)
AC_SUBST(extra_isl_gmp_configure_flags)
# Libraries to use for stage1 or when not bootstrapping.
AC_ARG_WITH(stage1-libs,
[AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
[if test "$withval" = "no" -o "$withval" = "yes"; then
stage1_libs=
else
stage1_libs=$withval
fi],
AC_SUBST(stage1_libs)
# Whether or not to use -static-libstdc++ and -static-libgcc. The
# default is yes if gcc is being built; no otherwise. The reason for
# this default is that gdb is sometimes linked against GNU Source
# Highlight, which is a shared library that uses C++ exceptions. In
# this case, -static-libstdc++ will cause crashes.
AC_ARG_WITH(static-standard-libraries,
[AS_HELP_STRING([--with-static-standard-libraries],
[use -static-libstdc++ and -static-libgcc (default=auto)])],
[], [with_static_standard_libraries=auto])
if test "$with_static_standard_libraries" = auto; then
with_static_standard_libraries=$have_compiler
fi
# Linker flags to use for stage1 or when not bootstrapping.
AC_ARG_WITH(stage1-ldflags,
[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
[if test "$withval" = "no" -o "$withval" = "yes"; then
stage1_ldflags=
else
stage1_ldflags=$withval
fi],
[stage1_ldflags=
# In stage 1, default to linking libstdc++ and libgcc statically with GCC
# if supported. But if the user explicitly specified the libraries to use,
# trust that they are doing what they want.
if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
-a "$have_static_libs" = yes; then
stage1_ldflags="-static-libstdc++ -static-libgcc"
fi])
AC_SUBST(stage1_ldflags)
# Libraries to use for stage2 and later builds.
[AS_HELP_STRING([--with-boot-libs=LIBS], [libraries for stage2 and later])],
[if test "$withval" = "no" -o "$withval" = "yes"; then
poststage1_libs=
else
poststage1_libs=$withval
AC_SUBST(poststage1_libs)
Ian Lance Taylor
committed
# Linker flags to use for stage2 and later builds.
AC_ARG_WITH(boot-ldflags,
[AS_HELP_STRING([--with-boot-ldflags=FLAGS],
[linker flags for stage2 and later])],
Ian Lance Taylor
committed
[if test "$withval" = "no" -o "$withval" = "yes"; then
poststage1_ldflags=
else
poststage1_ldflags=$withval
fi],
[poststage1_ldflags=
Ian Lance Taylor
committed
# In stages 2 and 3, default to linking libstdc++ and libgcc
# statically. But if the user explicitly specified the libraries to
# use, trust that they are doing what they want.
if test "$poststage1_libs" = ""; then
Ian Lance Taylor
committed
poststage1_ldflags="-static-libstdc++ -static-libgcc"
fi])
AC_SUBST(poststage1_ldflags)
# Basic setup is inlined here, actual checks are in config/isl.m4
Richard Guenther
committed
AC_ARG_WITH(isl,
[AS_HELP_STRING(
[--with-isl=PATH],
[Specify prefix directory for the installed isl package.
Richard Guenther
committed
Equivalent to --with-isl-include=PATH/include
plus --with-isl-lib=PATH/lib])])
# Treat --without-isl as a request to disable
Richard Guenther
committed
# GRAPHITE support and skip all following checks.
if test "x$with_isl" != "xno"; then
Richard Guenther
committed
dnl Provide configure switches and initialize islinc & isllibs
dnl with user input.
ISL_INIT_FLAGS
dnl Only execute fail-action, if isl has been requested.
AC_MSG_ERROR([Unable to find a usable isl. See config.log for details.])])
# If the isl check failed, disable builds of in-tree variant of isl
Richard Guenther
committed
if test "x$with_isl" = xno ||
test "x$gcc_cv_isl" = xno; then
Richard Guenther
committed
islinc=
fi
AC_SUBST(isllibs)
Richard Guenther
committed
AC_SUBST(islinc)
# Check for LTO support.
AC_ARG_ENABLE(lto,
[AS_HELP_STRING([--enable-lto], [enable link time optimization support])],
enable_lto=$enableval,
enable_lto=yes; default_enable_lto=yes)
ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
build_lto_plugin=yes
],[if test x"$default_enable_lto" = x"yes" ; then
*-apple-darwin[[912]]* | *-cygwin* | *-mingw* | *djgpp*) ;;
# On other non-ELF platforms, LTO has yet to be validated.
*) enable_lto=no ;;
esac
Iain Sandoe
committed
# Apart from ELF platforms, only Windows and Darwin support LTO so far.
# It would also be nice to check the binutils support, but we don't
# have gcc_GAS_CHECK_FEATURE available here. For now, we'll just
# warn during gcc/ subconfigure; unless you're bootstrapping with
# -flto it won't be needed until after installation anyway.
case $target in
*-cygwin* | *-mingw* | *-apple-darwin* | *djgpp*) ;;
*) if test x"$enable_lto" = x"yes"; then
AC_MSG_ERROR([LTO support is not enabled for this target.])
fi
;;
esac
fi
# Among non-ELF, only Windows platforms support the lto-plugin so far.
# Build it unless LTO was explicitly disabled.
*-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;;
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)
# Handle --enable-host-pie
# If host PIE executables are the default (or must be forced on) for some host,
# we must pass that configuration to the gcc directory.
gcc_host_pie=
AC_ARG_ENABLE(host-pie,
[AS_HELP_STRING([--enable-host-pie],
[build position independent host executables])],
[host_pie=$enableval
case $host in
*-*-darwin2*)
if test x$host_pie != xyes ; then
# for Darwin20+ this is required.
AC_MSG_WARN([PIE executables are required for the configured host, host-pie setting ignored.])
gcc_host_pie=--enable-host-pie
fi ;;
*) ;;
esac],
[case $host in
*-*-darwin2*)
# Default to PIE (mandatory for aarch64).
host_pie=yes
gcc_host_pie=--enable-host-pie
;;
*) host_pie=no ;;
esac])
AC_SUBST(host_pie)
AC_SUBST(gcc_host_pie)
Nathan Sidwell
committed
# Enable --enable-host-shared.
# Checked early to determine whether jit is an 'all' language
AC_ARG_ENABLE(host-shared,
[AS_HELP_STRING([--enable-host-shared],
[build host code as shared libraries])],
[host_shared=$enableval
case $host in
x86_64-*-darwin* | aarch64-*-darwin*)
if test x$host_shared != xyes ; then
# PIC is the default, and actually cannot be switched off.
AC_MSG_WARN([PIC code is required for the configured host; host-shared setting ignored.])
host_shared=yes
fi ;;
if test x$host_pie = xyes -a x$host_shared != xyes ; then
AC_MSG_WARN([PIC code is required for PIE host executables host-shared setting ignored.])
*) ;;
esac],
[case $host in
# 64B x86_64 and Aarch64 Darwin default to PIC.
x86_64-*-darwin* | aarch64-*-darwin*) host_shared=yes ;;
# 32B and powerpc64 Darwin must use PIC to link PIE exes.
*-*-darwin*) host_shared=$host_pie ;;
Nathan Sidwell
committed
AC_SUBST(host_shared)
if test x$host_shared = xyes; then
case $host in
*-*-darwin*)
# Since host shared is the default for 64b Darwin, and also enabled for
# host_pie, ensure that we present the PIE flag when host_pie is active.
if test x$host_pie = xyes; then
PICFLAG=-fPIE
fi
;;
*)
PICFLAG=-fPIC
;;
esac
elif test x$host_pie = xyes; then
PICFLAG=-fPIE
else
PICFLAG=
fi
AC_SUBST(PICFLAG)
# If we are building PIC/PIE host executables, and we are building dependent
# libs (e.g. GMP) in-tree those libs need to be configured to generate PIC
# code.
host_libs_picflag=
if test "$host_shared" = "yes" -o "$host_pie" = "yes"; then
host_libs_picflag='--with-pic'
fi
AC_SUBST(host_libs_picflag)
Diego Novillo
committed
# By default, C and C++ are the only stage 1 languages.
stage1_languages=,c,
# Target libraries that we bootstrap.
bootstrap_target_libs=,target-libgcc,
# Figure out what language subdirectories are present.
# Look if the user specified --enable-languages="..."; if not, use
# the environment variable $LANGUAGES if defined. $LANGUAGES might
# go away some day.