OSDN Git Service

2011-11-23 François Dumont <fdumont@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / configure
index 77a4abf..5221836 100755 (executable)
@@ -707,7 +707,6 @@ BASIC_FILE_H
 CSTDIO_H
 SECTION_FLAGS
 WERROR
-glibcxx_thread_h
 glibcxx_PCHFLAGS
 GLIBCXX_BUILD_PCH_FALSE
 GLIBCXX_BUILD_PCH_TRUE
@@ -741,6 +740,7 @@ AR
 AS
 LN_S
 toplevel_srcdir
+toplevel_builddir
 glibcxx_srcdir
 glibcxx_builddir
 ac_ct_CXX
@@ -865,7 +865,7 @@ with_libiconv_prefix
 with_system_libunwind
 enable_linux_futex
 enable_symvers
-enable_visibility
+enable_libstdcxx_visibility
 with_gxx_include_dir
 enable_version_specific_runtime_libs
 '
@@ -1554,7 +1554,8 @@ Optional Features:
   --enable-symvers[=STYLE]
                           enables symbol versioning of the shared library
                           [default=yes]
-  --enable-visibility     enables visibility safe usage [default=yes]
+  --enable-libstdcxx-visibility
+                          enables visibility safe usage [default=yes]
   --enable-version-specific-runtime-libs
                           Specify that runtime libraries should be installed
                           in a compiler-specific directory
@@ -4870,11 +4871,13 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
     \\/$* | ?:\\/*) glibcxx_srcdir=${srcdir} ;;
     *) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
   esac
+  toplevel_builddir=${glibcxx_builddir}/..
   toplevel_srcdir=${glibcxx_srcdir}/..
 
 
 
 
+
   # We use these options to decide which functions to include.  They are
   # set from the top level.
 
@@ -9699,7 +9702,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
@@ -10615,7 +10618,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -10633,7 +10636,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -11485,7 +11488,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11488 "configure"
+#line 11491 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11591,7 +11594,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11594 "configure"
+#line 11597 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12523,7 +12526,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         esac
         ;;
 
-      freebsd[12]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
        # switch to ELF
         ld_shlibs_CXX=no
@@ -14298,7 +14301,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -14316,7 +14319,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -14949,7 +14952,7 @@ fi
     #
     # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
     cat > conftest.$ac_ext << EOF
-#line 14952 "configure"
+#line 14955 "configure"
 struct S { ~S(); };
 void bar();
 void foo()
@@ -15077,23 +15080,6 @@ $as_echo_n "checking for thread model used by GCC... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $target_thread_file" >&5
 $as_echo "$target_thread_file" >&6; }
 
-  if test $target_thread_file != single; then
-
-$as_echo "#define HAVE_GTHR_DEFAULT 1" >>confdefs.h
-
-  fi
-
-  glibcxx_thread_h=gthr-$target_thread_file.h
-
-    gthread_file=${toplevel_srcdir}/gcc/${glibcxx_thread_h}
-  if grep __GTHREADS $gthread_file >/dev/null 2>&1 ; then
-    enable_thread=yes
-  else
-   enable_thread=no
-  fi
-
-
-
 
 
   ac_ext=cpp
@@ -15317,7 +15303,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 15320 "configure"
+#line 15306 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -15354,7 +15340,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15357 "configure"
+#line 15343 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -15391,7 +15377,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15394 "configure"
+#line 15380 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -15429,7 +15415,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15432 "configure"
+#line 15418 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -15505,7 +15491,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15508 "configure"
+#line 15494 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -15547,7 +15533,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 15550 "configure"
+#line 15536 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
@@ -15581,7 +15567,7 @@ $as_echo "$enable_int128" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 15584 "configure"
+#line 15570 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
 done
 
 
+  # Check for the existence of the <stdalign.h> header.
+  for ac_header in stdalign.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "stdalign.h" "ac_cv_header_stdalign_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdalign_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDALIGN_H 1
+_ACEOF
+
+fi
+
+done
+
+
   CXXFLAGS="$ac_save_CXXFLAGS"
   ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -19821,7 +19821,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
   ac_save_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc"
+  CXXFLAGS="$CXXFLAGS -fno-exceptions \
+       -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc"
 
   target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
   case $target_thread_file in
@@ -20132,6 +20133,256 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
+
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  ac_save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SC_NPROC_ONLN" >&5
+$as_echo_n "checking for _SC_NPROC_ONLN... " >&6; }
+  if test "${glibcxx_cv_SC_NPROC_ONLN+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+int
+main ()
+{
+int n = sysconf(_SC_NPROC_ONLN);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_SC_NPROC_ONLN=yes
+else
+  glibcxx_cv_SC_NPROC_ONLN=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  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.  */
+#include <unistd.h>
+int
+main ()
+{
+int n = sysconf(_SC_NPROC_ONLN);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_SC_NPROC_ONLN=yes
+else
+  glibcxx_cv_SC_NPROC_ONLN=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+  if test $glibcxx_cv_SC_NPROC_ONLN = yes; then
+
+$as_echo "#define _GLIBCXX_USE_SC_NPROC_ONLN 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_SC_NPROC_ONLN" >&5
+$as_echo "$glibcxx_cv_SC_NPROC_ONLN" >&6; }
+
+  CXXFLAGS="$ac_save_CXXFLAGS"
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  ac_save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthreads_num_processors_np" >&5
+$as_echo_n "checking for pthreads_num_processors_np... " >&6; }
+  if test "${glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+int n = pthread_num_processors_np();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=yes
+else
+  glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  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.  */
+#include <pthread.h>
+int
+main ()
+{
+int n = pthread_num_processors_np();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=yes
+else
+  glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+  if test $glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP = yes; then
+
+$as_echo "#define _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP" >&5
+$as_echo "$glibcxx_cv_PTHREADS_NUM_PROCESSORS_NP" >&6; }
+
+  CXXFLAGS="$ac_save_CXXFLAGS"
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  ac_save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hw.ncpu sysctl" >&5
+$as_echo_n "checking for hw.ncpu sysctl... " >&6; }
+  if test "${glibcxx_cv_SYSCTL_HW_NCPU+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <stddef.h>
+       #include <sys/sysctl.h>
+
+int
+main ()
+{
+
+       int count;
+       size_t size = sizeof(count);
+       int mib[] = { CTL_HW, HW_NCPU };
+       sysctl(mib, 2, &count, &size, NULL, 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_SYSCTL_HW_NCPU=yes
+else
+  glibcxx_cv_SYSCTL_HW_NCPU=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  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.  */
+
+       #include <stddef.h>
+       #include <sys/sysctl.h>
+
+int
+main ()
+{
+
+       int count;
+       size_t size = sizeof(count);
+       int mib[] = { CTL_HW, HW_NCPU };
+       sysctl(mib, 2, &count, &size, NULL, 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_SYSCTL_HW_NCPU=yes
+else
+  glibcxx_cv_SYSCTL_HW_NCPU=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+  if test $glibcxx_cv_SYSCTL_HW_NCPU = yes; then
+
+$as_echo "#define _GLIBCXX_USE_SYSCTL_HW_NCPU 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_SYSCTL_HW_NCPU" >&5
+$as_echo "$glibcxx_cv_SYSCTL_HW_NCPU" >&6; }
+
+  CXXFLAGS="$ac_save_CXXFLAGS"
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
 # Check for available headers.
 for ac_header in endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
 locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
@@ -64895,21 +65146,21 @@ $as_echo "$glibcxx_ptrdiff_t_is_i" >&6; }
 
 
 
- # Check whether --enable-visibility was given.
-if test "${enable_visibility+set}" = set; then :
-  enableval=$enable_visibility;
+ # Check whether --enable-libstdcxx-visibility was given.
+if test "${enable_libstdcxx_visibility+set}" = set; then :
+  enableval=$enable_libstdcxx_visibility;
       case "$enableval" in
        yes|no) ;;
-       *) as_fn_error "Argument to enable/disable visibility must be yes or no" "$LINENO" 5 ;;
+       *) as_fn_error "Argument to enable/disable libstdcxx-visibility must be yes or no" "$LINENO" 5 ;;
       esac
 
 else
-  enable_visibility=yes
+  enable_libstdcxx_visibility=yes
 fi
 
 
 
-if test x$enable_visibility = xyes ; then
+if test x$enable_libstdcxx_visibility = xyes ; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5
 $as_echo_n "checking whether the target supports hidden visibility... " >&6; }
 if test "${glibcxx_cv_have_attribute_visibility+set}" = set; then :
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_have_attribute_visibility" >&5
 $as_echo "$glibcxx_cv_have_attribute_visibility" >&6; }
   if test $glibcxx_cv_have_attribute_visibility = no; then
-    enable_visibility=no
+    enable_libstdcxx_visibility=no
   fi
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: visibility supported: $enable_visibility" >&5
-$as_echo "$as_me: visibility supported: $enable_visibility" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: visibility supported: $enable_libstdcxx_visibility" >&5
+$as_echo "$as_me: visibility supported: $enable_libstdcxx_visibility" >&6;}
 
 
 ac_ldbl_compat=no
@@ -65934,7 +66185,7 @@ else
 fi
 
 
-    if test $enable_visibility = yes; then
+    if test $enable_libstdcxx_visibility = yes; then
   ENABLE_VISIBILITY_TRUE=
   ENABLE_VISIBILITY_FALSE='#'
 else