gdb/testsuite/
[binutils-gdb.git] / gold / configure
index 59f52a54a5a366052f2692e2de1cf06bbf8b92d6..eb8f01ed7b9182b55eff912e234fca30652ae4ac 100755 (executable)
@@ -668,10 +668,22 @@ LDFLAGS
 CFLAGS
 CC
 TARGETOBJS
+DEFAULT_TARGET_X86_64_FALSE
+DEFAULT_TARGET_X86_64_TRUE
+DEFAULT_TARGET_SPARC_FALSE
+DEFAULT_TARGET_SPARC_TRUE
+DEFAULT_TARGET_POWERPC_FALSE
+DEFAULT_TARGET_POWERPC_TRUE
+DEFAULT_TARGET_I386_FALSE
+DEFAULT_TARGET_I386_TRUE
+DEFAULT_TARGET_ARM_FALSE
+DEFAULT_TARGET_ARM_TRUE
 PLUGINS_FALSE
 PLUGINS_TRUE
 THREADS_FALSE
 THREADS_TRUE
+installed_linker
+install_as_default
 am__untar
 am__tar
 AMTAR
@@ -749,6 +761,7 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 with_sysroot
+enable_gold
 enable_threads
 enable_plugins
 enable_targets
@@ -1393,6 +1406,7 @@ 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-gold[=ARG]     build gold [ARG={both}[/{gold,ld}]]
   --enable-threads        multi-threaded linking
   --enable-plugins        linker plugins
   --enable-targets        alternative target configurations
@@ -3217,6 +3231,33 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+# Check whether --enable-gold was given.
+if test "${enable_gold+set}" = set; then :
+  enableval=$enable_gold; case "${enableval}" in
+ yes)
+   install_as_default=gold
+   installed_linker=ld
+   ;;
+ both/gold)
+   install_as_default=yes
+   installed_linker=ld.gold
+   ;;
+ both|both/ld)
+   install_as_default=no
+   installed_linker=ld.gold
+   ;;
+ *)
+   as_fn_error "invalid --enable-gold argument" "$LINENO" 5
+   ;;
+ esac
+else
+  install_as_default=gold
+ installed_linker=ld
+fi
+
+
+
+
 # Check whether --enable-threads was given.
 if test "${enable_threads+set}" = set; then :
   enableval=$enable_threads; case "${enableval}" in
@@ -3354,11 +3395,62 @@ for targ in $target $canon_targets; do
        default_size=$targ_size
        default_big_endian=$targ_big_endian
        default_osabi=$targ_osabi
+
+        if test "$targ_obj" = "arm"; then
+  DEFAULT_TARGET_ARM_TRUE=
+  DEFAULT_TARGET_ARM_FALSE='#'
+else
+  DEFAULT_TARGET_ARM_TRUE='#'
+  DEFAULT_TARGET_ARM_FALSE=
+fi
+
+        if test "$targ_obj" = "i386"; then
+  DEFAULT_TARGET_I386_TRUE=
+  DEFAULT_TARGET_I386_FALSE='#'
+else
+  DEFAULT_TARGET_I386_TRUE='#'
+  DEFAULT_TARGET_I386_FALSE=
+fi
+
+        if test "$targ_obj" = "powerpc"; then
+  DEFAULT_TARGET_POWERPC_TRUE=
+  DEFAULT_TARGET_POWERPC_FALSE='#'
+else
+  DEFAULT_TARGET_POWERPC_TRUE='#'
+  DEFAULT_TARGET_POWERPC_FALSE=
+fi
+
+        if test "$targ_obj" = "sparc"; then
+  DEFAULT_TARGET_SPARC_TRUE=
+  DEFAULT_TARGET_SPARC_FALSE='#'
+else
+  DEFAULT_TARGET_SPARC_TRUE='#'
+  DEFAULT_TARGET_SPARC_FALSE=
+fi
+
+        if test "$targ_obj" = "x86_64"; then
+  DEFAULT_TARGET_X86_64_TRUE=
+  DEFAULT_TARGET_X86_64_FALSE='#'
+else
+  DEFAULT_TARGET_X86_64_TRUE='#'
+  DEFAULT_TARGET_X86_64_FALSE=
+fi
+
       fi
     fi
   fi
 done
 
+# Remove any duplicates.
+to=""
+for t in $targetobjs; do
+  case " $to " in
+  *" $t "*) ;;
+  *) to="$to $t" ;;
+  esac
+done
+targetobjs=$to
+
 if test -n "$targ_32_little"; then
 
 $as_echo "#define HAVE_TARGET_32_LITTLE 1" >>confdefs.h
@@ -5994,7 +6086,32 @@ else
 fi
 
 
- if test "$target_cpu" = "x86_64"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc >= 4.1" >&5
+$as_echo_n "checking for gcc >= 4.1... " >&6; }
+if test "${gold_cv_prog_gcc41+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if !defined __GNUC__
+error
+#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
+error
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gold_cv_prog_gcc41=yes
+else
+  gold_cv_prog_gcc41=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gold_cv_prog_gcc41" >&5
+$as_echo "$gold_cv_prog_gcc41" >&6; }
+
+ if test "$target_cpu" = "x86_64" -a "$gold_cv_prog_gcc41" = "yes"; then
   MCMODEL_MEDIUM_TRUE=
   MCMODEL_MEDIUM_FALSE='#'
 else
@@ -6220,6 +6337,18 @@ fi
 
 
 GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+__GNUC__
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "^[0-3]$" >/dev/null 2>&1; then :
+
+else
+  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow"
+fi
+rm -f conftest*
+
 
 # Check whether --enable-werror was given.
 if test "${enable_werror+set}" = set; then :
@@ -6231,7 +6360,7 @@ if test "${enable_werror+set}" = set; then :
 fi
 
 
-# Enable -Wno-format by default when using gcc on mingw
+# Disable -Wformat by default when using gcc on mingw
 case "${host}" in
   *-*-mingw32*)
     if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
@@ -6280,7 +6409,7 @@ fi
 
 
 
-WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//'`
+WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//' -e 's/-Wshadow//'`
 
 
 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
@@ -6650,7 +6779,7 @@ fi
 
 done
 
-for ac_func in mallinfo posix_fallocate
+for ac_func in mallinfo posix_fallocate readv sysconf times
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -6824,6 +6953,40 @@ $as_echo "#define HAVE_TEMPLATE_ATTRIBUTES 1" >>confdefs.h
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat::st_mtim." >&5
+$as_echo_n "checking for struct stat::st_mtim.... " >&6; }
+if test "${gold_cv_stat_st_mtim+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/stat.h>
+long bar() { struct stat s; return (long)(s.st_mtim.tv_sec + s.st_mtim.tv_sec);}
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  gold_cv_stat_st_mtim=yes
+else
+  gold_cv_stat_st_mtim=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gold_cv_stat_st_mtim" >&5
+$as_echo "$gold_cv_stat_st_mtim" >&6; }
+if test "$gold_cv_stat_st_mtim" = "yes"; then
+
+$as_echo "#define HAVE_STAT_ST_MTIM 1" >>confdefs.h
+
+fi
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6970,6 +7133,26 @@ if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${DEFAULT_TARGET_ARM_TRUE}" && test -z "${DEFAULT_TARGET_ARM_FALSE}"; then
+  as_fn_error "conditional \"DEFAULT_TARGET_ARM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DEFAULT_TARGET_I386_TRUE}" && test -z "${DEFAULT_TARGET_I386_FALSE}"; then
+  as_fn_error "conditional \"DEFAULT_TARGET_I386\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DEFAULT_TARGET_POWERPC_TRUE}" && test -z "${DEFAULT_TARGET_POWERPC_FALSE}"; then
+  as_fn_error "conditional \"DEFAULT_TARGET_POWERPC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DEFAULT_TARGET_SPARC_TRUE}" && test -z "${DEFAULT_TARGET_SPARC_FALSE}"; then
+  as_fn_error "conditional \"DEFAULT_TARGET_SPARC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DEFAULT_TARGET_X86_64_TRUE}" && test -z "${DEFAULT_TARGET_X86_64_FALSE}"; then
+  as_fn_error "conditional \"DEFAULT_TARGET_X86_64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   as_fn_error "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5