* configure.ac: Avoid improper use of -fXXX-runtime. Add -x objective-c

when testing Objective-C programs (Followup for bug #11188).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20447 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2004-12-13 04:39:55 +00:00
parent 3ae6ffea81
commit bedca778cd
3 changed files with 23 additions and 18 deletions

View file

@ -1,3 +1,8 @@
2004-12-12 Adam Fedor <fedor@gnu.org>
* configure.ac: Avoid improper use of -fXXX-runtime. Add -x objective-c
when testing Objective-C programs (Followup for bug #11188).
2004-12-09 Matt Rice <ratmice@yahoo.com>
* Source/NSUndoManager.m

18
configure vendored
View file

@ -2734,12 +2734,12 @@ if test "$OBJC_RUNTIME_LIB" = "nx" -o "$OBJC_RUNTIME_LIB" = "apple"; then
echo "$as_me:$LINENO: result: NeXT" >&5
echo "${ECHO_T}NeXT" >&6
LIBOBJC='-lobjc'
CPPFLAGS="$CPPFLAGS -fnext-runtime -DNeXT_RUNTIME"
OBJCFLAGS="-fnext-runtime -DNeXT_RUNTIME"
else
echo "$as_me:$LINENO: result: GNU" >&5
echo "${ECHO_T}GNU" >&6
LIBOBJC='-lobjc'
CPPFLAGS="$CPPFLAGS -fgnu-runtime"
OBJCFLAGS="-fgnu-runtime"
fi
#--------------------------------------------------------------------
@ -7416,7 +7416,7 @@ echo $ECHO_N "checking whether objc really works... $ECHO_C" >&6
saved_LIBS="$LIBS"
saved_CPPFLAGS="$CPPFLAGS"
LIBS="$LIBS $LIBOBJC"
CPPFLAGS="$CPPFLAGS -x objective-c"
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c"
if test x"$objc_threaded" != x""; then
LIBS="$LIBS $objc_threaded"
fi
@ -7541,8 +7541,7 @@ fi
CPPFLAGS="$saved_CPPFLAGS"
# Don't revert LIBS, need it for the next test
# Don't revert any Objective-C flags as they are used in the next test
#---------------------------------------------------------------------
# Guess if we are using a compiler which has the (GNU extension) +load
@ -7550,8 +7549,6 @@ CPPFLAGS="$saved_CPPFLAGS"
# Defines HAVE_LOAD_METHOD if +load methods are called before main.
# Needed by NSProcessInfo.m
#---------------------------------------------------------------------
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -x objective-c"
echo "$as_me:$LINENO: checking if +load method is executed before main" >&5
echo $ECHO_N "checking if +load method is executed before main... $ECHO_C" >&6
if test "${objc_load_method_worked+set}" = set; then
@ -7606,8 +7603,7 @@ else
echo "${ECHO_T}no" >&6
fi
CPPFLAGS="$saved_CPPFLAGS"
# Don't revert LIBS, need it for the next test
# Don't revert any Objective-C flags as they are used in the next test
#--------------------------------------------------------------------
# This function needed by NSLock.m for conditioned wait
@ -7739,6 +7735,7 @@ rm -f conftest*
LIBS="$saved_LIBS"
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
# Generic settings needed by NSZone.m
@ -13841,6 +13838,8 @@ if test $have_libffi = no; then
fi
have_forward_hook=yes
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c"
echo "$as_me:$LINENO: checking \"for forwarding callback in runtime\"" >&5
echo $ECHO_N "checking \"for forwarding callback in runtime\"... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
@ -13882,6 +13881,7 @@ if test $have_forward_hook = no; then
enable_libffi=no
enable_ffcall=no
fi
CPPFLAGS="$saved_CPPFLAGS"
echo "$as_me:$LINENO: checking \"FFI library usage\"" >&5
echo $ECHO_N "checking \"FFI library usage\"... $ECHO_C" >&6

View file

@ -95,11 +95,11 @@ AC_MSG_CHECKING(the Objective-C runtime)
if test "$OBJC_RUNTIME_LIB" = "nx" -o "$OBJC_RUNTIME_LIB" = "apple"; then
AC_MSG_RESULT(NeXT)
LIBOBJC='-lobjc'
CPPFLAGS="$CPPFLAGS -fnext-runtime -DNeXT_RUNTIME"
OBJCFLAGS="-fnext-runtime -DNeXT_RUNTIME"
else
AC_MSG_RESULT(GNU)
LIBOBJC='-lobjc'
CPPFLAGS="$CPPFLAGS -fgnu-runtime"
OBJCFLAGS="-fgnu-runtime"
fi
#--------------------------------------------------------------------
@ -408,7 +408,7 @@ AC_MSG_CHECKING(whether objc really works)
saved_LIBS="$LIBS"
saved_CPPFLAGS="$CPPFLAGS"
LIBS="$LIBS $LIBOBJC"
CPPFLAGS="$CPPFLAGS -x objective-c"
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c"
if test x"$objc_threaded" != x""; then
LIBS="$LIBS $objc_threaded"
fi
@ -460,8 +460,7 @@ fi
AC_SUBST(NX_CONST_STRING_OBJCFLAGS)
AC_SUBST(NX_CONST_STRING_CLASS)
CPPFLAGS="$saved_CPPFLAGS"
# Don't revert LIBS, need it for the next test
# Don't revert any Objective-C flags as they are used in the next test
#---------------------------------------------------------------------
# Guess if we are using a compiler which has the (GNU extension) +load
@ -469,8 +468,6 @@ CPPFLAGS="$saved_CPPFLAGS"
# Defines HAVE_LOAD_METHOD if +load methods are called before main.
# Needed by NSProcessInfo.m
#---------------------------------------------------------------------
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -x objective-c"
AC_MSG_CHECKING(if +load method is executed before main)
AC_CACHE_VAL(objc_load_method_worked,
AC_TRY_RUN([#include "$srcdir/config/config.loadtest.m"],
@ -486,8 +483,7 @@ else
AC_MSG_RESULT(no)
fi
CPPFLAGS="$saved_CPPFLAGS"
# Don't revert LIBS, need it for the next test
# Don't revert any Objective-C flags as they are used in the next test
#--------------------------------------------------------------------
# This function needed by NSLock.m for conditioned wait
@ -501,6 +497,7 @@ AC_EGREP_HEADER(objc_get_uninstalled_dtable, objc/objc-api.h,
[ Define if objc-api.h defines this function]),)
LIBS="$saved_LIBS"
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
# Generic settings needed by NSZone.m
@ -982,6 +979,8 @@ if test $have_libffi = no; then
fi
have_forward_hook=yes
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c"
AC_MSG_CHECKING("for forwarding callback in runtime")
AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward.m"],
have_forward_hook=yes, have_forward_hook=no)
@ -990,6 +989,7 @@ if test $have_forward_hook = no; then
enable_libffi=no
enable_ffcall=no
fi
CPPFLAGS="$saved_CPPFLAGS"
AC_MSG_CHECKING("FFI library usage")
WITH_FFI=none