experimental configure option

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29994 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-03-17 15:34:51 +00:00
parent 20864d7e59
commit 8b6d77380c
5 changed files with 111 additions and 39 deletions

View file

@ -1,11 +1,21 @@
2010-03-17 Richard Frith-Macdonald <rfm@gnu.org>
* configure:
* configure.ac:
* Headers/Additions/GNUstepBase/GSConfig.h.in:
* Headers/Additions/GNUstepBase/GSVersionMacros.h:
Add experimental --enable-mixedabi configure option for building
with the nonfragile abi, but able to link with other code which
is built with the fragile abi.
2010-03-17 Richard Frith-Macdonald <rfm@gnu.org> 2010-03-17 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSConnection.m: Fix for memory leak ... autorelease * Source/NSConnection.m: Fix for memory leak ... autorelease
objects returned by method in remote process because the invocation objects returned by method in remote process because the invocation
won't do it for us (we call -setReturnValue: which will have the invocation won't do it for us (we call -setReturnValue: which will have the
retain the object, so when it releases it again later the retain count is invocation retain the object, so when it releases it again later
the same as at the point when we decoded the object, and another release the retain count is the same as at the point when we decoded the
is needed). object, and another release is needed).
I'm not certain this fix is right, but it seems ok. I'm not certain this fix is right, but it seems ok.
2010-03-13 Yavor Doganov <yavor@gnu.org> (tiny change) 2010-03-13 Yavor Doganov <yavor@gnu.org> (tiny change)

View file

@ -221,6 +221,7 @@ typedef struct {
#define OBJC2RUNTIME @OBJC2RUNTIME@ #define OBJC2RUNTIME @OBJC2RUNTIME@
#define BASE_NATIVE_OBJC_EXCEPTIONS @BASE_NATIVE_OBJC_EXCEPTIONS@ #define BASE_NATIVE_OBJC_EXCEPTIONS @BASE_NATIVE_OBJC_EXCEPTIONS@
#define GS_NONFRAGILE @GS_NONFRAGILE@ #define GS_NONFRAGILE @GS_NONFRAGILE@
#define GS_MIXEDABI @GS_MIXEDABI@
#import <GNUstepBase/preface.h> #import <GNUstepBase/preface.h>

View file

@ -193,6 +193,10 @@
#import <GNUstepBase/GSConfig.h> #import <GNUstepBase/GSConfig.h>
#endif #endif
#ifndef __has_feature
#define __has_feature(x) 0
#endif
/* The following is for deciding whether private instance variables /* The following is for deciding whether private instance variables
* should be visible ... if we are building with a compiler which * should be visible ... if we are building with a compiler which
* does not define __has_feature then we know we don't have non-fragile * does not define __has_feature then we know we don't have non-fragile
@ -204,18 +208,20 @@
* before including the header, so that the ivars are always available * before including the header, so that the ivars are always available
* in the class source itsself * in the class source itsself
*/ */
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#if (__has_feature(objc_nonfragile_abi) || __has_feature(objc_nonfragile_abi2)) #if GS_MIXEDABI
#if !GS_NONFRAGILE # undef GS_NONFRAGILE
#error "You are now using the objc-nonfragile-abi but your gnustep-base was not configured to use it." # define GS_NONFRAGILE 0 /* Mixed is treated as fragile */
#endif
#else #else
#if GS_NONFRAGILE # if (__has_feature(objc_nonfragile_abi)||__has_feature(objc_nonfragile_abi2))
#error "Your gnustep-base was configured for the objc-nonfragile-abi but you are not using it now." # if !GS_NONFRAGILE
#endif # error "You are now using the objc-nonfragile-abi but your gnustep-base was not configured to use it."
# endif
# else
# if GS_NONFRAGILE
# error "Your gnustep-base was configured for the objc-nonfragile-abi but you are not using it now."
# endif
# endif
#endif #endif
#define GS_EXPOSE(X) (!GS_NONFRAGILE || defined(EXPOSE_##X##_IVARS)) #define GS_EXPOSE(X) (!GS_NONFRAGILE || defined(EXPOSE_##X##_IVARS))

56
configure vendored
View file

@ -651,6 +651,7 @@ build_alias
host_alias host_alias
target_alias target_alias
BASE_NATIVE_OBJC_EXCEPTIONS BASE_NATIVE_OBJC_EXCEPTIONS
BASE_NONFRAGILE_ABI
build build
build_cpu build_cpu
build_vendor build_vendor
@ -709,6 +710,7 @@ NX_CONST_STRING_CLASS
OBJC2RUNTIME OBJC2RUNTIME
OBJCFLAGS OBJCFLAGS
GS_NONFRAGILE GS_NONFRAGILE
GS_MIXEDABI
HAVE_OBJC_SYNC_ENTER HAVE_OBJC_SYNC_ENTER
GS_SIZEOF_MUTEX_T GS_SIZEOF_MUTEX_T
GS_SIZEOF_COND_T GS_SIZEOF_COND_T
@ -1336,6 +1338,10 @@ if test -n "$ac_init_help"; then
Optional Features: Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-mixedabi
Enables the use both fragile and nonfragile ABI (base built using
the nonfragile ABI, but in a way permitting linking with other
modules built using the fragile ABI.
--enable-bfd --enable-bfd
Enables the use of libbfd to provide symbolic stack traces. Enables the use of libbfd to provide symbolic stack traces.
Enabling this option provides support for symbolic stack traces Enabling this option provides support for symbolic stack traces
@ -1889,6 +1895,16 @@ else
fi fi
nonfragile=`gnustep-config --objc-flags | grep _NONFRAGILE_ABI 2>&5`
if test -z "$nonfragile"; then
nonfragile=no
BASE_NONFRAGILE_ABI=0
else
nonfragile=yes
BASE_NONFRAGILE_ABI=1
fi
if test -z "$GNUSTEP_MAKEFILES"; then if test -z "$GNUSTEP_MAKEFILES"; then
{ { echo "$as_me:$LINENO: error: You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" >&5 { { echo "$as_me:$LINENO: error: You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" >&5
echo "$as_me: error: You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" >&2;} echo "$as_me: error: You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" >&2;}
@ -9282,11 +9298,14 @@ else
fi fi
saved_CPPFLAGS="$CPPFLAGS" GS_NONFRAGILE=0
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -fobjc-nonfragile-abi -x objective-c" GS_MIXEDABI=0
{ echo "$as_me:$LINENO: checking for non-fragile-abi support" >&5 if test "$nonfragile" = "yes"; then
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -fobjc-nonfragile-abi -x objective-c"
{ echo "$as_me:$LINENO: checking for non-fragile-abi support" >&5
echo $ECHO_N "checking for non-fragile-abi support... $ECHO_C" >&6; } echo $ECHO_N "checking for non-fragile-abi support... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5 See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling echo "$as_me: error: cannot run test program while cross compiling
@ -9329,17 +9348,28 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
fi fi
CPPFLAGS="$saved_CPPFLAGS" CPPFLAGS="$saved_CPPFLAGS"
if test $non_fragile = yes; then if test $non_fragile = yes; then
OBJCFLAGS="$OBJCFLAGS -fobjc-nonfragile-abi" OBJCFLAGS="$OBJCFLAGS -fobjc-nonfragile-abi"
GS_NONFRAGILE=1 GS_NONFRAGILE=1
# Check whether --enable-mixedabi was given.
if test "${enable_mixedabi+set}" = set; then
enableval=$enable_mixedabi;
else else
GS_NONFRAGILE=0 enable_mixedabi=$PASS_ARG
fi fi
{ echo "$as_me:$LINENO: result: $non_fragile" >&5 if test $enable_mixedabi = yes; then
GS_MIXEDABI=1
fi
fi
{ echo "$as_me:$LINENO: result: $non_fragile" >&5
echo "${ECHO_T}$non_fragile" >&6; } echo "${ECHO_T}$non_fragile" >&6; }
fi
# Don't revert any Objective-C flags as they are used in the next test # Don't revert any Objective-C flags as they are used in the next test
@ -21942,6 +21972,7 @@ build_alias!$build_alias$ac_delim
host_alias!$host_alias$ac_delim host_alias!$host_alias$ac_delim
target_alias!$target_alias$ac_delim target_alias!$target_alias$ac_delim
BASE_NATIVE_OBJC_EXCEPTIONS!$BASE_NATIVE_OBJC_EXCEPTIONS$ac_delim BASE_NATIVE_OBJC_EXCEPTIONS!$BASE_NATIVE_OBJC_EXCEPTIONS$ac_delim
BASE_NONFRAGILE_ABI!$BASE_NONFRAGILE_ABI$ac_delim
build!$build$ac_delim build!$build$ac_delim
build_cpu!$build_cpu$ac_delim build_cpu!$build_cpu$ac_delim
build_vendor!$build_vendor$ac_delim build_vendor!$build_vendor$ac_delim
@ -22000,7 +22031,6 @@ NX_CONST_STRING_CLASS!$NX_CONST_STRING_CLASS$ac_delim
OBJC2RUNTIME!$OBJC2RUNTIME$ac_delim OBJC2RUNTIME!$OBJC2RUNTIME$ac_delim
OBJCFLAGS!$OBJCFLAGS$ac_delim OBJCFLAGS!$OBJCFLAGS$ac_delim
GS_NONFRAGILE!$GS_NONFRAGILE$ac_delim GS_NONFRAGILE!$GS_NONFRAGILE$ac_delim
HAVE_OBJC_SYNC_ENTER!$HAVE_OBJC_SYNC_ENTER$ac_delim
_ACEOF _ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@ -22042,6 +22072,8 @@ _ACEOF
ac_delim='%!_!# ' ac_delim='%!_!# '
for ac_last_try in false false false false false :; do for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF cat >conf$$subs.sed <<_ACEOF
GS_MIXEDABI!$GS_MIXEDABI$ac_delim
HAVE_OBJC_SYNC_ENTER!$HAVE_OBJC_SYNC_ENTER$ac_delim
GS_SIZEOF_MUTEX_T!$GS_SIZEOF_MUTEX_T$ac_delim GS_SIZEOF_MUTEX_T!$GS_SIZEOF_MUTEX_T$ac_delim
GS_SIZEOF_COND_T!$GS_SIZEOF_COND_T$ac_delim GS_SIZEOF_COND_T!$GS_SIZEOF_COND_T$ac_delim
HAVE_PTS_STREAM_MODULES!$HAVE_PTS_STREAM_MODULES$ac_delim HAVE_PTS_STREAM_MODULES!$HAVE_PTS_STREAM_MODULES$ac_delim
@ -22087,7 +22119,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF _ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 43; then if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 45; then
break break
elif $ac_last_try; then elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View file

@ -54,6 +54,16 @@ else
fi fi
AC_SUBST(BASE_NATIVE_OBJC_EXCEPTIONS) AC_SUBST(BASE_NATIVE_OBJC_EXCEPTIONS)
nonfragile=`gnustep-config --objc-flags | grep _NONFRAGILE_ABI 2>&5`
if test -z "$nonfragile"; then
nonfragile=no
BASE_NONFRAGILE_ABI=0
else
nonfragile=yes
BASE_NONFRAGILE_ABI=1
fi
AC_SUBST(BASE_NONFRAGILE_ABI)
if test -z "$GNUSTEP_MAKEFILES"; then if test -z "$GNUSTEP_MAKEFILES"; then
AC_MSG_ERROR([You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!]) AC_MSG_ERROR([You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!])
fi fi
@ -672,21 +682,34 @@ else
fi fi
AC_SUBST(OBJC2RUNTIME) AC_SUBST(OBJC2RUNTIME)
saved_CPPFLAGS="$CPPFLAGS" GS_NONFRAGILE=0
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -fobjc-nonfragile-abi -x objective-c" GS_MIXEDABI=0
AC_MSG_CHECKING(for non-fragile-abi support) if test "$nonfragile" = "yes"; then
AC_RUN_IFELSE([#include "$srcdir/config/config.non-fragile-ivars.m"], saved_CPPFLAGS="$CPPFLAGS"
non_fragile=yes, non_fragile=no) CPPFLAGS="$CPPFLAGS $OBJCFLAGS -fobjc-nonfragile-abi -x objective-c"
CPPFLAGS="$saved_CPPFLAGS" AC_MSG_CHECKING(for non-fragile-abi support)
if test $non_fragile = yes; then AC_RUN_IFELSE([#include "$srcdir/config/config.non-fragile-ivars.m"],
OBJCFLAGS="$OBJCFLAGS -fobjc-nonfragile-abi" non_fragile=yes, non_fragile=no)
AC_SUBST(OBJCFLAGS) CPPFLAGS="$saved_CPPFLAGS"
GS_NONFRAGILE=1 if test $non_fragile = yes; then
else OBJCFLAGS="$OBJCFLAGS -fobjc-nonfragile-abi"
GS_NONFRAGILE=0 AC_SUBST(OBJCFLAGS)
GS_NONFRAGILE=1
AC_ARG_ENABLE(mixedabi,
[ --enable-mixedabi
Enables the use both fragile and nonfragile ABI (base built using
the nonfragile ABI, but in a way permitting linking with other
modules built using the fragile ABI.],,
enable_mixedabi=$PASS_ARG)
if test $enable_mixedabi = yes; then
GS_MIXEDABI=1
fi
fi
AC_MSG_RESULT($non_fragile)
fi fi
AC_SUBST(GS_NONFRAGILE) AC_SUBST(GS_NONFRAGILE)
AC_MSG_RESULT($non_fragile) AC_SUBST(GS_MIXEDABI)
# Don't revert any Objective-C flags as they are used in the next test # Don't revert any Objective-C flags as they are used in the next test