]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/configure
Add configure flag to enable gnu hash style by default.
[thirdparty/binutils-gdb.git] / ld / configure
index 640902b85835e77a279a24de7aa1642f465c26f0..de709d3a82c82b09e0c65daeaf82ee9d09eaf240 100755 (executable)
@@ -790,6 +790,7 @@ enable_got
 enable_compressed_debug_sections
 enable_new_dtags
 enable_relro
+enable_default_hash_style
 enable_werror
 enable_build_warnings
 enable_nls
@@ -1450,6 +1451,8 @@ Optional Features:
                           compress debug sections by default]
   --enable-new-dtags      set DT_RUNPATH instead of DT_RPATH by default]
   --enable-relro          enable -z relro in ELF linker by default
+  --enable-default-hash-style={sysv,gnu,both}
+                          use this default hash style
   --enable-werror         treat compile warnings as errors
   --enable-build-warnings enable build-time compiler warnings
   --disable-nls           do not use Native Language Support
@@ -11722,7 +11725,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11725 "configure"
+#line 11728 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11828,7 +11831,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11831 "configure"
+#line 11834 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15564,6 +15567,34 @@ if test "${enable_relro+set}" = set; then :
 esac
 fi
 
+# Decide which "--hash-style" to use by default
+# Provide a configure time option to override our default.
+# Check whether --enable-default-hash-style was given.
+if test "${enable_default_hash_style+set}" = set; then :
+  enableval=$enable_default_hash_style; case "${enable_default_hash_style}" in
+  sysv | gnu | both) ;;
+  *) as_fn_error "bad value ${enable_default_hash_style} for enable-default-hash-style option" "$LINENO" 5 ;;
+esac
+else
+  case "${target}" in
+  # Enable gnu hash only on GNU targets, but not mips
+  mips*-*-*) enable_default_hash_style=sysv ;;
+  *-*-gnu* | *-*-linux* | *-*-nacl*) enable_default_hash_style=both ;;
+  *) enable_default_hash_style=sysv ;;
+esac
+fi
+
+
+case "${enable_default_hash_style}" in
+  sysv | both) ac_default_emit_sysv_hash=1 ;;
+  *) ac_default_emit_sysv_hash=0 ;;
+esac
+
+case "${enable_default_hash_style}" in
+  gnu | both) ac_default_emit_gnu_hash=1 ;;
+  *) ac_default_emit_gnu_hash=0 ;;
+esac
+
 
 # Set the 'development' global.
 . $srcdir/../bfd/development.sh
@@ -17228,6 +17259,18 @@ _ACEOF
 
 
 
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_EMIT_SYSV_HASH $ac_default_emit_sysv_hash
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_EMIT_GNU_HASH $ac_default_emit_gnu_hash
+_ACEOF
+
+
+