Adjust g++.old-deja/g++.jason/overload.C
[gcc.git] / libobjc / configure
index ffa3a88cdd4c717eba10b38b464f979151a8d5ed..55fcc33dbe2dddd7fc768ccb43859fbb2b31c4fa 100755 (executable)
@@ -631,6 +631,7 @@ RANLIB
 AR
 AS
 extra_ldflags_libobjc
+lt_host_flags
 OBJEXT
 EXEEXT
 ac_ct_CC
@@ -655,6 +656,7 @@ host
 multi_basedir
 OBJC_BOEHM_GC_INCLUDES
 OBJC_BOEHM_GC
+OBJC_GCFLAGS
 VERSION
 target_subdir
 host_subdir
@@ -719,7 +721,6 @@ enable_fast_install
 with_gnu_ld
 enable_libtool_lock
 enable_tls
-enable_sjlj_exceptions
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1353,8 +1354,6 @@ Optional Features:
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --enable-tls            Use thread-local storage [default=yes]
-  --enable-sjlj-exceptions
-                          force use of builtin_setjmp for exceptions
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -2272,7 +2271,7 @@ target_subdir=${target_noncanonical}
 # We need the following definitions because AC_PROG_LIBTOOL relies on them
 PACKAGE=libobjc
 # Version is pulled out to make it a bit easier to change using sed.
-VERSION=2:0:0
+VERSION=4:0:0
 
 
 # This works around the fact that libtool configuration may change LD
@@ -2319,21 +2318,24 @@ $as_echo "$version_specific_libs" >&6; }
 if test "${enable_objc_gc+set}" = set; then :
   enableval=$enable_objc_gc; case $enable_objc_gc in
   no)
+    OBJC_GCFLAGS=''
     OBJC_BOEHM_GC=''
     OBJC_BOEHM_GC_INCLUDES=''
     ;;
   *)
-    OBJC_BOEHM_GC=libobjc_gc.la
+    OBJC_GCFLAGS='-DOBJC_WITH_GC=1'
+    OBJC_BOEHM_GC='libobjc_gc$(libsuffix).la'
     OBJC_BOEHM_GC_INCLUDES='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include'
     ;;
 esac
 else
-  OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''
+  OBJC_GCFLAGS=''; OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''
 fi
 
 
 
 
+
 # -----------
 # Directories
 # -----------
@@ -3318,14 +3320,36 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 # extra LD Flags which are required for targets
+
+
+
+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
+
+
+
 case "${host}" in
   *-darwin*)
     # Darwin needs -single_module when linking libobjc
-    extra_ldflags_libobjc=-Wl,-single_module
+    extra_ldflags_libobjc='$(lt_host_flags) -Wl,-single_module'
     ;;
   *-cygwin*|*-mingw*)
     # Tell libtool to build DLLs on Windows
-    extra_ldflags_libobjc='-no-undefined -bindir $(bindir)'
+    extra_ldflags_libobjc='$(lt_host_flags)'
     ;;
 esac
 
@@ -6029,7 +6053,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
@@ -6045,9 +6069,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*)
@@ -6066,7 +6100,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*)
@@ -6754,7 +6791,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
        10.0,*86*-darwin8*|10.0,*-darwin[91]*)
          _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-       10.[012]*)
+       10.[012][,.]*)
          _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
        10.*)
          _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
@@ -7587,6 +7624,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*)
@@ -8323,7 +8361,7 @@ _LT_EOF
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
         && test "$tmp_diet" = no
       then
-       tmp_addflag=
+       tmp_addflag=' $pic_flag'
        tmp_sharedflag='-shared'
        case $cc_basename,$host_cpu in
         pgcc*)                         # Portland Group C compiler
@@ -8762,10 +8800,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
@@ -8778,7 +8812,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
@@ -9687,10 +9721,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.
@@ -9698,7 +9728,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -9716,7 +9746,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -10568,7 +10598,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10571 "configure"
+#line 10601 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10674,7 +10704,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10677 "configure"
+#line 10707 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11222,18 +11252,6 @@ done
 # Miscellanea
 # -----------
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread model used by GCC" >&5
-$as_echo_n "checking for thread model used by GCC... " >&6; }
-target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
-{ $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
-
 # Check if we have thread-local storage
 
 
@@ -11444,70 +11462,42 @@ $as_echo "#define HAVE_TLS 1" >>confdefs.h
 
   fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for exception model to use" >&5
-$as_echo_n "checking for exception model to use... " >&6; }
-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 whether --enable-sjlj-exceptions was given.
-if test "${enable_sjlj_exceptions+set}" = set; then :
-  enableval=$enable_sjlj_exceptions; :
-else
-  cat > conftest.$ac_ext << EOF
-#line 11460 "configure"
-@interface Frob
-@end
-@implementation Frob
-@end
-int proc();
-int foo()
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the type of bitfields matters" >&5
+$as_echo_n "checking if the type of bitfields matters... " >&6; }
+if test "${gt_cv_bitfield_type_matters+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+struct foo1 { char x; char y:1; char z; };
+struct foo2 { char x; long long int y:1; char z; };
+int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ];
+int
+main ()
 {
-  @try {
-   return proc();
-  }
-  @catch (Frob* ex) {
-    return 0;
-  }
+
+  ;
+  return 0;
 }
-EOF
-old_CFLAGS="$CFLAGS"
-CFLAGS="-x objective-c -fgnu-runtime -fobjc-exceptions -S"
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
-    enable_sjlj_exceptions=yes
-  elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
-    enable_sjlj_exceptions=no
-  fi
-fi
-CFLAGS="$old_CFLAGS"
-rm -f conftest*
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gt_cv_bitfield_type_matters=yes
+else
+  gt_cv_bitfield_type_matters=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-if test x$enable_sjlj_exceptions = xyes; then
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_bitfield_type_matters" >&5
+$as_echo "$gt_cv_bitfield_type_matters" >&6; }
+  if test $gt_cv_bitfield_type_matters = yes; then
 
-$as_echo "#define SJLJ_EXCEPTIONS 1" >>confdefs.h
+$as_echo "#define HAVE_BITFIELD_TYPE_MATTERS 1" >>confdefs.h
 
-  ac_exception_model_name=sjlj
-elif test x$enable_sjlj_exceptions = xno; then
-  ac_exception_model_name="call frame"
-else
-  as_fn_error "unable to detect exception model" "$LINENO" 5
-fi
-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
+  fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_exception_model_name" >&5
-$as_echo "$ac_exception_model_name" >&6; }
 
 # ------
 # Output