OSDN Git Service

Fix for Homebrew. I don't care about another environments. This may be reverted and...
[pf3gnuchains/gcc-fork.git] / libffi / configure
index 43fc0ec..6b38089 100755 (executable)
@@ -8989,10 +8989,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
@@ -9005,7 +9001,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
@@ -9911,10 +9907,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.
@@ -9922,7 +9914,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -9940,7 +9932,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -10774,7 +10766,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10777 "configure"
+#line 10769 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10880,7 +10872,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10883 "configure"
+#line 10875 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11320,7 +11312,7 @@ TARGETDIR="unknown"
 case "$host" in
   alpha*-*-*)
        TARGET=ALPHA; TARGETDIR=alpha;
-       # Support 128-bit long double, changable via command-line switch.
+       # Support 128-bit long double, changeable via command-line switch.
        HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
        ;;
 
@@ -11357,10 +11349,17 @@ case "$host" in
   i?86-*-freebsd* | i?86-*-openbsd*)
        TARGET=X86_FREEBSD; TARGETDIR=x86
        ;;
-  i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
+  i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2*)
        TARGET=X86_WIN32; TARGETDIR=x86
-       # All mingw/cygwin/win32 builds require this for sharedlib
-       AM_LTLDFLAGS="-no-undefined"
+       # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
+       # We must also check with_cross_host to decide if this is a native
+       # or cross-build and select where to install dlls appropriately.
+       if test -n "$with_cross_host" &&
+          test x"$with_cross_host" != x"no"; then
+         AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
+       else
+         AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
+       fi
        ;;
   i?86-*-darwin*)
        TARGET=X86_DARWIN; TARGETDIR=x86
@@ -11384,7 +11383,7 @@ case "$host" in
        TARGET=M68K; TARGETDIR=m68k
        ;;
 
-  mips-sgi-irix5.* | mips-sgi-irix6.*)
+  mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
   mips*-*-linux*)
@@ -11408,6 +11407,9 @@ case "$host" in
   powerpc-*-freebsd*)
        TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
        ;;
+ powerpc64-*-freebsd*)
+       TARGET=POWERPC; TARGETDIR=powerpc
+       ;;
   powerpc*-*-rtems*)
        TARGET=POWERPC; TARGETDIR=powerpc
        ;;
@@ -11433,6 +11435,15 @@ case "$host" in
 
   x86_64-*-cygwin* | x86_64-*-mingw*)
        TARGET=X86_WIN64; TARGETDIR=x86
+       # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
+       # We must also check with_cross_host to decide if this is a native
+       # or cross-build and select where to install dlls appropriately.
+       if test -n "$with_cross_host" &&
+          test x"$with_cross_host" != x"no"; then
+         AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
+       else
+         AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
+       fi
        ;;
 
   x86_64-*-*)
@@ -12397,7 +12408,7 @@ else
 
        libffi_cv_as_x86_pcrel=yes
        echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
-       if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
+       if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
            libffi_cv_as_x86_pcrel=no
        fi
 
@@ -12409,6 +12420,76 @@ $as_echo "$libffi_cv_as_x86_pcrel" >&6; }
 $as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h
 
     fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .ascii pseudo-op support" >&5
+$as_echo_n "checking assembler .ascii pseudo-op support... " >&6; }
+if test "${libffi_cv_as_ascii_pseudo_op+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+       libffi_cv_as_ascii_pseudo_op=unknown
+       # Check if we have .ascii
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+asm (".ascii \\"string\\"");
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libffi_cv_as_ascii_pseudo_op=yes
+else
+  libffi_cv_as_ascii_pseudo_op=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_ascii_pseudo_op" >&5
+$as_echo "$libffi_cv_as_ascii_pseudo_op" >&6; }
+    if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then
+
+$as_echo "#define HAVE_AS_ASCII_PSEUDO_OP 1" >>confdefs.h
+
+    fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .string pseudo-op support" >&5
+$as_echo_n "checking assembler .string pseudo-op support... " >&6; }
+if test "${libffi_cv_as_string_pseudo_op+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+       libffi_cv_as_string_pseudo_op=unknown
+       # Check if we have .string
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+asm (".string \\"string\\"");
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libffi_cv_as_string_pseudo_op=yes
+else
+  libffi_cv_as_string_pseudo_op=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_string_pseudo_op" >&5
+$as_echo "$libffi_cv_as_string_pseudo_op" >&6; }
+    if test "x$libffi_cv_as_string_pseudo_op" = xyes; then
+
+$as_echo "#define HAVE_AS_STRING_PSEUDO_OP 1" >>confdefs.h
+
+    fi
 fi
 
 case "$target" in
@@ -12419,6 +12500,29 @@ $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
      ;;
 esac
 
+if test x$TARGET = xX86_64; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports unwind section type" >&5
+$as_echo_n "checking assembler supports unwind section type... " >&6; }
+if test "${libffi_cv_as_x86_64_unwind_section_type+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+       libffi_cv_as_x86_64_unwind_section_type=yes
+       echo '.section .eh_frame,"a",@unwind' > conftest.s
+       if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
+           libffi_cv_as_x86_64_unwind_section_type=no
+       fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_64_unwind_section_type" >&5
+$as_echo "$libffi_cv_as_x86_64_unwind_section_type" >&6; }
+    if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
+
+$as_echo "#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1" >>confdefs.h
+
+    fi
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5
 $as_echo_n "checking whether .eh_frame section should be read-only... " >&6; }
 if test "${libffi_cv_ro_eh_frame+set}" = set; then :