OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / libssp / configure
index d5e8384..78abc70 100755 (executable)
@@ -606,6 +606,7 @@ toolexeclibdir
 toolexecdir
 enable_static
 enable_shared
+lt_host_flags
 OTOOL64
 OTOOL
 LIPO
@@ -625,6 +626,10 @@ LIBTOOL
 ssp_have_usable_vsnprintf
 EGREP
 GREP
+LIBSSP_USE_SYMVER_SUN_FALSE
+LIBSSP_USE_SYMVER_SUN_TRUE
+LIBSSP_USE_SYMVER_GNU_FALSE
+LIBSSP_USE_SYMVER_GNU_TRUE
 LIBSSP_USE_SYMVER_FALSE
 LIBSSP_USE_SYMVER_TRUE
 CPP
@@ -729,6 +734,7 @@ enable_version_specific_runtime_libs
 enable_maintainer_mode
 enable_multilib
 enable_dependency_tracking
+enable_symvers
 enable_shared
 enable_static
 with_pic
@@ -1367,6 +1373,7 @@ Optional Features:
   --enable-multilib       build many library versions (default)
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
+  --disable-symvers       disable symbol versioning for libssp
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
@@ -4093,19 +4100,59 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5
 $as_echo_n "checking whether symbol versioning is supported... " >&6; }
-cat > conftest.map <<EOF
+# Check whether --enable-symvers was given.
+if test "${enable_symvers+set}" = set; then :
+  enableval=$enable_symvers; ssp_use_symver=$enableval
+else
+  ssp_use_symver=yes
+fi
+
+if test "x$ssp_use_symver" != xno; then
+  if test x$gcc_no_link = xyes; then
+    # If we cannot link, we cannot build shared libraries, so do not use
+    # symbol versioning.
+    ssp_use_symver=no
+  else
+    save_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+    cat > conftest.map <<EOF
 FOO_1.0 {
   global: *foo*; bar; local: *;
 };
 EOF
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
-if test x$gcc_no_link = xyes; then
-  # If we cannot link, we cannot build shared libraries, so do not use
-  # symbol versioning.
-  ssp_use_symver=no
+    if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo;
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ssp_use_symver=gnu
 else
-  if test x$gcc_no_link = xyes; then
+  ssp_use_symver=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    if test x$ssp_use_symver = xno; then
+      case "$target_os" in
+        solaris2*)
+          LDFLAGS="$save_LDFLAGS"
+          LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+          # Sun ld cannot handle wildcards and treats all entries as undefined.
+          cat > conftest.map <<EOF
+FOO_1.0 {
+  global: foo; local: *;
+};
+EOF
+          if test x$gcc_no_link = xyes; then
   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
 fi
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4120,17 +4167,21 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ssp_use_symver=yes
+  ssp_use_symver=sun
 else
   ssp_use_symver=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+         ;;
+      esac
+    fi
+    LDFLAGS="$save_LDFLAGS"
+  fi
 fi
-LDFLAGS="$save_LDFLAGS"
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ssp_use_symver" >&5
 $as_echo "$ssp_use_symver" >&6; }
- if test "x$ssp_use_symver" = xyes; then
+ if test "x$ssp_use_symver" != xno; then
   LIBSSP_USE_SYMVER_TRUE=
   LIBSSP_USE_SYMVER_FALSE='#'
 else
@@ -4138,6 +4189,22 @@ else
   LIBSSP_USE_SYMVER_FALSE=
 fi
 
+ if test "x$ssp_use_symver" = xgnu; then
+  LIBSSP_USE_SYMVER_GNU_TRUE=
+  LIBSSP_USE_SYMVER_GNU_FALSE='#'
+else
+  LIBSSP_USE_SYMVER_GNU_TRUE='#'
+  LIBSSP_USE_SYMVER_GNU_FALSE=
+fi
+
+ if test "x$ssp_use_symver" = xsun; then
+  LIBSSP_USE_SYMVER_SUN_TRUE=
+  LIBSSP_USE_SYMVER_SUN_FALSE='#'
+else
+  LIBSSP_USE_SYMVER_SUN_TRUE='#'
+  LIBSSP_USE_SYMVER_SUN_FALSE=
+fi
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
@@ -4423,7 +4490,7 @@ if test x$gcc_no_link = xyes; then
   $as_echo "#define HAVE_STRNCAT 1" >>confdefs.h
 
 else
-  for ac_func in mempcpy strncpy strncat
+  for ac_func in memmove mempcpy strncpy strncat
 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"
@@ -8785,10 +8852,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       ;;
 
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -8801,7 +8864,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
@@ -9710,10 +9773,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -9721,7 +9780,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -9739,7 +9798,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -10591,7 +10650,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10594 "configure"
+#line 10653 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10697,7 +10756,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10700 "configure"
+#line 10759 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10937,6 +10996,28 @@ CC="$lt_save_CC"
 
 
 
+case $host in
+  *-cygwin* | *-mingw*)
+    # 'host' will be top-level target in the case of a target lib,
+    # we must compare to with_cross_host to decide if this is a native
+    # or cross-compiler and select where to install dlls appropriately.
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"';
+    else
+      lt_host_flags='-no-undefined -bindir "$(bindir)"';
+    fi
+    ;;
+  *)
+    lt_host_flags=
+    ;;
+esac
+
+
+
+
+
+
 # Calculate toolexeclibdir
 # Also toolexecdir, though it's only used in toolexeclibdir
 case ${version_specific_libs} in
@@ -11096,6 +11177,14 @@ if test -z "${LIBSSP_USE_SYMVER_TRUE}" && test -z "${LIBSSP_USE_SYMVER_FALSE}";
   as_fn_error "conditional \"LIBSSP_USE_SYMVER\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${LIBSSP_USE_SYMVER_GNU_TRUE}" && test -z "${LIBSSP_USE_SYMVER_GNU_FALSE}"; then
+  as_fn_error "conditional \"LIBSSP_USE_SYMVER_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBSSP_USE_SYMVER_SUN_TRUE}" && test -z "${LIBSSP_USE_SYMVER_SUN_FALSE}"; then
+  as_fn_error "conditional \"LIBSSP_USE_SYMVER_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0