X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fconfigure.ac;h=1e6f2636fba0c30f7ffe150d3975001848bfeaca;hb=402f6a9e6b225e401135286881427884dad42680;hp=dbc825adfc6d18be49350fb13db7c0c8c3c278a8;hpb=04a4c50efa63213eddc3d99a1022116e6e253910;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/configure.ac b/gcc/configure.ac index dbc825adfc6..1e6f2636fba 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to generate a configuration script. # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. #This file is part of GCC. @@ -145,6 +145,15 @@ if test x${gcc_gxx_include_dir} = x; then fi fi +gcc_gxx_include_dir_add_sysroot=0 +if test "${with_sysroot+set}" = set; then + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` + if test "${gcc_gxx_without_sysroot}"; then + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + gcc_gxx_include_dir_add_sysroot=1 + fi +fi + AC_ARG_WITH(cpp_install_dir, [AC_HELP_STRING([--with-cpp-install-dir=DIR], [install the user visible C preprocessor in DIR @@ -222,7 +231,7 @@ fi AC_ARG_WITH(demangler-in-ld, [AS_HELP_STRING([--with-demangler-in-ld], [try to use demangler in GNU ld])], demangler_in_ld="$with_demangler_in_ld", -demangler_in_ld=no) +demangler_in_ld=yes) # ---------------------- # Find default assembler @@ -297,6 +306,10 @@ case "$CC" in esac AC_SUBST(CFLAGS) +# Determine PICFLAG for target gnatlib. +GCC_PICFLAG_FOR_TARGET +AC_SUBST(PICFLAG_FOR_TARGET) + # ------------------------- # Check C compiler features # ------------------------- @@ -325,10 +338,11 @@ GCC_STDINT_TYPES # * 'long long' # * variadic macros # * overlong strings +# * C++11 narrowing conversions in { } # So, we only use -pedantic if we can disable those warnings. ACX_PROG_CC_WARNING_OPTS( - m4_quote(m4_do([-W -Wall -Wwrite-strings -Wcast-qual])), [loose_warn]) + m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual])), [loose_warn]) ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])), [c_loose_warn]) @@ -353,6 +367,10 @@ fi AC_SUBST(warn_cflags) AC_SUBST(warn_cxxflags) +# Disable exceptions and RTTI if building with g++ +ACX_PROG_CC_WARNING_OPTS( + m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags]) + # Enable expensive internal checks is_release= if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then @@ -638,6 +656,10 @@ AC_ARG_ENABLE(fixed-point, [], [ case $target in + arm*) + enable_fixed_point=yes + ;; + mips*-*-*) case $host in mips*-sgi-irix*) @@ -717,9 +739,27 @@ AC_ARG_ENABLE(shared, ], [enable_shared=yes]) AC_SUBST(enable_shared) +AC_ARG_WITH([native-system-header-dir], + [ --with-native-system-header-dir=dir + use dir as the directory to look for standard + system header files in. Defaults to /usr/include.], +[ + case ${with_native_system_header_dir} in + yes|no) AC_MSG_ERROR([bad value ${withval} given for --with-native-system-header-dir]) ;; + /* | [[A-Za-z]]:[[\\/]]*) ;; + *) AC_MSG_ERROR([--with-native-system-header-dir argument ${withval} must be an absolute directory]) ;; + esac + configured_native_system_header_dir="${withval}" +], [configured_native_system_header_dir=]) + AC_ARG_WITH(build-sysroot, [AS_HELP_STRING([--with-build-sysroot=sysroot], - [use sysroot as the system root during the build])]) + [use sysroot as the system root during the build])], + [if test x"$withval" != x ; then + SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval" + fi], + [SYSROOT_CFLAGS_FOR_TARGET=]) +AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) AC_ARG_WITH(sysroot, [AS_HELP_STRING([[--with-sysroot[=DIR]]], @@ -795,7 +835,7 @@ esac], [enable_languages=c]) AC_ARG_WITH(multilib-list, -[AS_HELP_STRING([--with-multilib-list], [select multilibs (SH only)])], +[AS_HELP_STRING([--with-multilib-list], [select multilibs (SH and x86-64 only)])], :, with_multilib_list=default) @@ -816,17 +856,7 @@ esac gcc_AC_PROG_LN_S ACX_PROG_LN($LN_S) AC_PROG_RANLIB -case "${host}" in -*-*-darwin*) - # By default, the Darwin ranlib will not treat common symbols as - # definitions when building the archive table of contents. Other - # ranlibs do that; pass an option to the Darwin ranlib that makes - # it behave similarly. - ranlib_flags="-c" - ;; -*) - ranlib_flags="" -esac +ranlib_flags="" AC_SUBST(ranlib_flags) gcc_AC_PROG_INSTALL @@ -970,6 +1000,14 @@ GNAT_LIBEXC="$LIBS" LIBS="$save_LIBS" AC_SUBST(GNAT_LIBEXC) +# To support -mcpu=native on Solaris/SPARC, we need libkstat. +save_LIBS="$LIBS" +LIBS= +AC_SEARCH_LIBS(kstat_open, kstat) +EXTRA_GCC_LIBS="$LIBS" +LIBS="$save_LIBS" +AC_SUBST(EXTRA_GCC_LIBS) + # Some systems put ldexp and frexp in libm instead of libc; assume # they're both in the same place. jcf-dump needs them. save_LIBS="$LIBS" @@ -1006,7 +1044,7 @@ define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \ sysconf strsignal getrusage nl_langinfo \ gettimeofday mbstowcs wcswidth mmap setlocale \ - gcc_UNLOCKED_FUNCS) + gcc_UNLOCKED_FUNCS madvise) if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, @@ -1041,7 +1079,14 @@ case "${host}" in esac AC_FUNC_FORK -AM_ICONV +# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different +# iconv() prototype. +AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"], + [AC_LANG_PUSH([C++]) + AM_ICONV + AC_LANG_POP([C++])], + [AM_ICONV]) + # Until we have in-tree GNU iconv: LIBICONV_DEP= AC_SUBST(LIBICONV_DEP) @@ -1053,8 +1098,10 @@ AM_LANGINFO_CODESET # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" +saved_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include" gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \ - strsignal strstr strverscmp \ + strsignal strstr stpcpy strverscmp \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[ #include "ansidecl.h" @@ -1105,6 +1152,21 @@ gcc_AC_CHECK_DECLS(sigaltstack, , ,[ #include ]) +# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which hides the madvise() +# prototype. +AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"], + [AC_LANG_PUSH([C++]) + gcc_AC_CHECK_DECLS(madvise, , ,[ + #include "ansidecl.h" + #include "system.h" + ]) + AC_LANG_POP([C++])], + [gcc_AC_CHECK_DECLS(madvise, , ,[ + #include "ansidecl.h" + #include "system.h" + ]) +]) + # More time-related stuff. AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -1131,10 +1193,9 @@ if test $gcc_cv_type_clock_t = yes; then [Define if defines clock_t.]) fi -# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. +# Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" - -gcc_AC_INITFINI_ARRAY +CXXFLAGS="$saved_CXXFLAGS" # mkdir takes a single argument on some systems. gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG @@ -1173,11 +1234,6 @@ if test $force_sjlj_exceptions = yes; then [Define 0/1 to force the choice for exception handling model.]) fi -# For platforms with the unwind ABI which includes an unwind library, -# libunwind, we can choose to use the system libunwind. -# config.gcc also contains tests of with_system_libunwind. -GCC_CHECK_UNWIND_GETIPINFO - # -------------------------------------------------------- # Build, host, and target specific configuration fragments # -------------------------------------------------------- @@ -1213,6 +1269,11 @@ if test x"$tmake_file" = x then tmake_file=$cpu_type/t-$cpu_type fi +# Support --enable-initfini-array. +if test x$enable_initfini_array != xno; then + tm_file="${tm_file} initfini-array.h" +fi + if test x"$dwarf2" = xyes then tm_file="$tm_file tm-dwarf2.h" fi @@ -1308,6 +1369,12 @@ if test "$host_xm_file" != "$build_xm_file"; then fi fi +if test -n "$configured_native_system_header_dir"; then + native_system_header_dir=$configured_native_system_header_dir +fi +NATIVE_SYSTEM_HEADER_DIR="$native_system_header_dir" +AC_SUBST(NATIVE_SYSTEM_HEADER_DIR) + case ${host} in powerpc*-*-darwin*) AC_CACHE_CHECK([whether mcontext_t fields have underscores], @@ -1340,7 +1407,7 @@ case ${enable_threads} in # default target_thread_file='single' ;; - aix | dce | lynx | mipssde | nks | posix | posix95 | rtems | \ + aix | dce | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; @@ -1356,19 +1423,6 @@ if test x${thread_file} = x; then thread_file=${target_thread_file} fi -# Make gthr-default.h if we have a thread file. -gthread_flags= -if test $thread_file != single; then - echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h-t - if diff gthr-default.h-t gthr-default.h 2>/dev/null; then - rm -f gthr-default.h-t - else - mv -f gthr-default.h-t gthr-default.h - fi - gthread_flags=-DHAVE_GTHR_DEFAULT -fi -AC_SUBST(gthread_flags) - # -------- # UNSORTED # -------- @@ -1511,6 +1565,11 @@ fi cat > plugin-version.h <