Make it easy to make --disable-werror the default for both binutils and gdb
[platform/upstream/binutils.git] / binutils / configure
index b191a61..1272e53 100755 (executable)
@@ -604,6 +604,7 @@ LTLIBOBJS
 LIBOBJS
 EMULATION_VECTOR
 EMULATION
+OBJDUMP_PRIVATE_OFILES
 OBJDUMP_DEFS
 BUILD_INSTALL_MISC
 BUILD_MISC
@@ -770,10 +771,12 @@ enable_fast_install
 with_gnu_ld
 enable_libtool_lock
 enable_targets
+enable_deterministic_archives
 enable_werror
 enable_build_warnings
 enable_nls
 enable_maintainer_mode
+with_zlib
 enable_rpath
 with_libiconv_prefix
 '
@@ -1416,6 +1419,8 @@ Optional Features:
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --enable-targets        alternative target configurations
+  --enable-deterministic-archives
+                          ar and ranlib default to -D behavior
   --enable-werror         treat compile warnings as errors
   --enable-build-warnings enable build-time compiler warnings
   --disable-nls           do not use Native Language Support
@@ -1429,6 +1434,7 @@ Optional Packages:
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-zlib             include zlib support (auto/yes/no) default=auto
   --with-gnu-ld           assume the C compiler uses GNU ld default=no
   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
@@ -3232,7 +3238,7 @@ if test "$ac_res" != no; then :
 fi
 
 
-BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[        ]*\([^  ]*\)[   ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
+BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
 am__api_version='1.11'
 
 # Find a good install program.  We prefer a C program (faster),
@@ -6966,7 +6972,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -6982,9 +6988,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
            LD="${LD-ld} -m elf_i386_fbsd"
            ;;
          x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*linux*)
+           LD="${LD-ld} -m elf32lppclinux"
            ;;
-         ppc64-*linux*|powerpc64-*linux*)
+         powerpc64-*linux*)
            LD="${LD-ld} -m elf32ppclinux"
            ;;
          s390x-*linux*)
@@ -7003,7 +7019,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
          x86_64-*linux*)
            LD="${LD-ld} -m elf_x86_64"
            ;;
-         ppc*-*linux*|powerpc*-*linux*)
+         powerpcle-*linux*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*linux*)
            LD="${LD-ld} -m elf64ppc"
            ;;
          s390*-*linux*|s390*-*tpf*)
@@ -8252,6 +8271,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
        # AIX 5 now supports IA64 processor
        lt_prog_compiler_static='-Bstatic'
       fi
+      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -9433,7 +9453,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
       hardcode_minus_L=yes
@@ -10346,7 +10366,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -10364,7 +10384,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -11198,7 +11218,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11201 "configure"
+#line 11221 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11304,7 +11324,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11307 "configure"
+#line 11327 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11552,6 +11572,28 @@ if test "${enable_targets+set}" = set; then :
 esac
 fi
 
+# Check whether --enable-deterministic-archives was given.
+if test "${enable_deterministic_archives+set}" = set; then :
+  enableval=$enable_deterministic_archives;
+if test "${enableval}" = no; then
+  default_ar_deterministic=0
+else
+  default_ar_deterministic=1
+fi
+else
+  default_ar_deterministic=0
+fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_AR_DETERMINISTIC $default_ar_deterministic
+_ACEOF
+
+
+
+# Set the 'development' global.
+. $srcdir/../bfd/development.sh
 
 GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11587,8 +11629,8 @@ case "${host}" in
   *) ;;
 esac
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" -a "$development" = true ; then
     ERROR_ON_WARNING=yes
 fi
 
@@ -11629,6 +11671,8 @@ fi
 ac_config_headers="$ac_config_headers config.h:config.in"
 
 
+
+
 if test -z "$target" ; then
     as_fn_error "Unrecognized target system type; please check config.sub." "$LINENO" 5
 fi
@@ -11840,7 +11884,7 @@ if test "$LEX" = :; then
   LEX=${am_missing_run}flex
 fi
 
-ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW bg"
+ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW hr"
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
 USE_NLS=no
@@ -12411,7 +12455,7 @@ case "${host}" in
 esac
 
 
-for ac_header in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h
+for ac_header in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h locale.h sys/param.h wchar.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12466,6 +12510,38 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5
+$as_echo_n "checking whether string.h and strings.h may both be included... " >&6; }
+if test "${gcc_cv_header_string+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+#include <strings.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gcc_cv_header_string=yes
+else
+  gcc_cv_header_string=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_string" >&5
+$as_echo "$gcc_cv_header_string" >&6; }
+if test $gcc_cv_header_string = yes; then
+
+$as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h
+
+fi
+
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
@@ -12656,7 +12732,7 @@ _ACEOF
 
 fi
 
-for ac_func in sbrk utimes setmode getc_unlocked strcoll
+for ac_func in sbrk utimes setmode getc_unlocked strcoll setlocale
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -12683,6 +12759,32 @@ $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
 
 fi
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
+$as_echo_n "checking for mbstate_t... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+int
+main ()
+{
+mbstate_t teststate;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  have_mbstate_t=yes
+else
+  have_mbstate_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_mbstate_t" >&5
+$as_echo "$have_mbstate_t" >&6; }
+  if test x"$have_mbstate_t" = xyes; then
+
+$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
+
+  fi
 
 # Some systems have frexp only in -lm, not in -lc.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing frexp" >&5
@@ -12742,6 +12844,40 @@ if test "$ac_res" != no; then :
 fi
 
 
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
+$as_echo_n "checking for LC_MESSAGES... " >&6; }
+if test "${am_cv_val_LC_MESSAGES+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <locale.h>
+int
+main ()
+{
+return LC_MESSAGES
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  am_cv_val_LC_MESSAGES=yes
+else
+  am_cv_val_LC_MESSAGES=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5
+$as_echo "$am_cv_val_LC_MESSAGES" >&6; }
+  if test $am_cv_val_LC_MESSAGES = yes; then
+
+$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
+
+  fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for time_t in time.h" >&5
 $as_echo_n "checking for time_t in time.h... " >&6; }
 if test "${bu_cv_decl_time_t_time_h+set}" = set; then :
@@ -12876,6 +13012,16 @@ $as_echo "#define HAVE_GOOD_UTIME_H 1" >>confdefs.h
 
 fi
 
+ac_fn_c_check_decl "$LINENO" "environ" "ac_cv_have_decl_environ" "$ac_includes_default"
+if test "x$ac_cv_have_decl_environ" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ENVIRON $ac_have_decl
+_ACEOF
 ac_fn_c_check_decl "$LINENO" "fprintf" "ac_cv_have_decl_fprintf" "$ac_includes_default"
 if test "x$ac_cv_have_decl_fprintf" = x""yes; then :
   ac_have_decl=1
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_FPRINTF $ac_have_decl
 _ACEOF
-ac_fn_c_check_decl "$LINENO" "stpcpy" "ac_cv_have_decl_stpcpy" "$ac_includes_default"
-if test "x$ac_cv_have_decl_stpcpy" = x""yes; then :
+ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STPCPY $ac_have_decl
+#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
 _ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strstr" = x""yes; then :
+ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getenv" = x""yes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRSTR $ac_have_decl
+#define HAVE_DECL_GETENV $ac_have_decl
 _ACEOF
 ac_fn_c_check_decl "$LINENO" "sbrk" "ac_cv_have_decl_sbrk" "$ac_includes_default"
 if test "x$ac_cv_have_decl_sbrk" = x""yes; then :
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_SBRK $ac_have_decl
 _ACEOF
-ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getenv" = x""yes; then :
+ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_snprintf" = x""yes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETENV $ac_have_decl
+#define HAVE_DECL_SNPRINTF $ac_have_decl
 _ACEOF
-ac_fn_c_check_decl "$LINENO" "environ" "ac_cv_have_decl_environ" "$ac_includes_default"
-if test "x$ac_cv_have_decl_environ" = x""yes; then :
+ac_fn_c_check_decl "$LINENO" "stpcpy" "ac_cv_have_decl_stpcpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_stpcpy" = x""yes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ENVIRON $ac_have_decl
+#define HAVE_DECL_STPCPY $ac_have_decl
 _ACEOF
-ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then :
+ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strnlen" = x""yes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
+#define HAVE_DECL_STRNLEN $ac_have_decl
 _ACEOF
-ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
-if test "x$ac_cv_have_decl_snprintf" = x""yes; then :
+ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strstr" = x""yes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SNPRINTF $ac_have_decl
+#define HAVE_DECL_STRSTR $ac_have_decl
 _ACEOF
 ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
 if test "x$ac_cv_have_decl_vsnprintf" = x""yes; then :
@@ -12971,7 +13117,19 @@ _ACEOF
 # Link in zlib if we can.  This allows us to read compressed debug
 # sections.  This is used only by readelf.c (objdump uses bfd for
 # reading compressed sections).
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5
+
+  # See if the user specified whether he wants zlib support or not.
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib;
+else
+  with_zlib=auto
+fi
+
+
+  if test "$with_zlib" != "no"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5
 $as_echo_n "checking for library containing zlibVersion... " >&6; }
 if test "${ac_cv_search_zlibVersion+set}" = set; then :
   $as_echo_n "(cached) " >&6
@@ -13038,6 +13196,11 @@ done
 
 fi
 
+    if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then
+      as_fn_error "zlib (libz) library was explicitly requested but not found" "$LINENO" 5
+    fi
+  fi
+
 
 
 case "${host}" in
@@ -13779,6 +13942,9 @@ BUILD_DLLWRAP=
 BUILD_MISC=
 BUILD_INSTALL_MISC=
 OBJDUMP_DEFS=
+OBJDUMP_PRIVATE_VECTORS=
+OBJDUMP_PRIVATE_OFILES=
+od_vectors=
 
 for targ in $target $canon_targets
 do
@@ -13796,6 +13962,7 @@ do
        fi
        DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
        BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
+       od_vectors="$od_vectors objdump_private_desc_xcoff"
     else
        case $targ in
        i[3-7]86*-*-netware*)
          NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
          ;;
        esac
+
        case $targ in
        *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
        esac
+
        case $targ in
        arm-epoc-pe*)
          BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@@ -13846,7 +14015,7 @@ do
          BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
          BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
          ;;
-       x86_64-*-mingw*)
+       x86_64-*-mingw* | x86_64-*-cygwin*)
          BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          if test -z "$DLLTOOL_DEFAULT"; then
            DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
          BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
          ;;
        powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
-         BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
+         case "$BUILD_INSTALL_MISC" in
+           *embedspu*) ;;
+           *) BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
+         esac
          ;;
        sh*-*-pe)
          BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
          ;;
        esac
+
+       # Add objdump private vectors.
+       case $targ in
+       powerpc-*-aix*)
+         od_vectors="$od_vectors objdump_private_desc_xcoff"
+         ;;
+        *-*-darwin*)
+         od_vectors="$od_vectors objdump_private_desc_mach_o"
+         ;;
+       esac
     fi
 done
 
+# Uniq objdump private vector, build objdump target ofiles.
+od_files=
+f=""
+for i in $od_vectors ; do
+    case " $f " in
+    *" $i "*) ;;
+    *)
+       f="$f $i"
+       OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
+       case $i in
+       objdump_private_desc_xcoff)
+           od_files="$od_files od-xcoff" ;;
+       objdump_private_desc_mach_o)
+           od_files="$od_files od-macho" ;;
+       *) as_fn_error "*** unknown private vector $i" "$LINENO" 5 ;;
+       esac
+       ;;
+    esac
+done
+
+# Uniq objdump target ofiles
+f=""
+for i in $od_files ; do
+    case " $f " in
+    *" $i "*) ;;
+    *)
+       f="$f $i"
+       OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
+       ;;
+    esac
+done
+
 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
 
 if test "${with_windres+set}" = set; then
@@ -13944,6 +14158,9 @@ if test "${with_windmc+set}" = set; then
          BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
 fi
 
+OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
+
+