mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-30 20:10:53 +00:00
backport configure updates from trunk
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@25122 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
59329fcb69
commit
ad75f69f6a
6 changed files with 6559 additions and 8093 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
||||||
|
2007-05-02 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
|
* configure.ac: Set GNUSTEP_MAKEFILES to CURRENT_GNUSTEP_MAKEFILES
|
||||||
|
before sourcing GNUstep.sh. Fixes building when paths to hardcode
|
||||||
|
in the library are different from paths used when building,
|
||||||
|
typically a case when packaging. (backport from trunk)
|
||||||
|
* configure: regenerate
|
||||||
|
|
||||||
|
2007-04-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/thr-pthread.m: Set thread attributes detached to avoid memory
|
||||||
|
leak as suggested by Chris Ball <cball@borderlinetech.ca>
|
||||||
|
(backport from trunk)
|
||||||
|
|
||||||
|
2007-04-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* config/config.forward2.m: Test for forward2 function in runtime.
|
||||||
|
* configure.ac: Run forward2 test
|
||||||
|
* Headers/Additions/GNUstepBase/config.h.in: record forward2 test.
|
||||||
|
|
||||||
2007-04-15 Richard Frith-Macdonald <rfm@gnu.org>
|
2007-04-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* configure.ac: check for wide character support in printf
|
* configure.ac: check for wide character support in printf
|
||||||
|
|
|
@ -196,6 +196,9 @@
|
||||||
/* Define to 1 if you have the <float.h> header file. */
|
/* Define to 1 if you have the <float.h> header file. */
|
||||||
#undef HAVE_FLOAT_H
|
#undef HAVE_FLOAT_H
|
||||||
|
|
||||||
|
/* Define if libobjc has the __objc_msg_forward2 function */
|
||||||
|
#undef HAVE_FORWARD2
|
||||||
|
|
||||||
/* Define to 1 if you have the `getcwd' function. */
|
/* Define to 1 if you have the `getcwd' function. */
|
||||||
#undef HAVE_GETCWD
|
#undef HAVE_GETCWD
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* Key structure for maintaining thread specific storage */
|
/* Key structure for maintaining thread specific storage */
|
||||||
static pthread_key_t _objc_thread_storage;
|
static pthread_key_t _objc_thread_storage;
|
||||||
|
static pthread_attr_t _objc_thread_attribs;
|
||||||
|
|
||||||
/* Global exit status. */
|
/* Global exit status. */
|
||||||
int __objc_thread_exit_status = 0;
|
int __objc_thread_exit_status = 0;
|
||||||
|
@ -188,7 +189,21 @@ int
|
||||||
__objc_init_thread_system(void)
|
__objc_init_thread_system(void)
|
||||||
{
|
{
|
||||||
/* Initialize the thread storage key */
|
/* Initialize the thread storage key */
|
||||||
return pthread_key_create(&_objc_thread_storage, NULL);
|
if (pthread_key_create(&_objc_thread_storage, NULL) == 0)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The normal default detach state for threads is PTHREAD_CREATE_JOINABLE
|
||||||
|
* which causes threads to not die when you think they should.
|
||||||
|
*/
|
||||||
|
if (pthread_attr_init(&_objc_thread_attribs) == 0)
|
||||||
|
{
|
||||||
|
if (pthread_attr_setdetachstate(&_objc_thread_attribs,
|
||||||
|
PTHREAD_CREATE_DETACHED) == 0)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close the threads subsystem. */
|
/* Close the threads subsystem. */
|
||||||
|
@ -196,11 +211,15 @@ int
|
||||||
__objc_close_thread_system(void)
|
__objc_close_thread_system(void)
|
||||||
{
|
{
|
||||||
/* Destroy the thread storage key */
|
/* Destroy the thread storage key */
|
||||||
/* Not implemented yet */
|
if (pthread_key_delete(_objc_thread_storage) == 0)
|
||||||
/* return pthread_key_delete(&_objc_thread_storage); */
|
{
|
||||||
|
if (pthread_attr_destroy(&_objc_thread_attribs) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Backend thread functions */
|
/* Backend thread functions */
|
||||||
|
|
||||||
/* Create a new thread of execution. */
|
/* Create a new thread of execution. */
|
||||||
|
@ -210,7 +229,8 @@ __objc_thread_detach(void (*func)(void *arg), void *arg)
|
||||||
objc_thread_t thread_id;
|
objc_thread_t thread_id;
|
||||||
pthread_t new_thread_handle;
|
pthread_t new_thread_handle;
|
||||||
|
|
||||||
if (!(pthread_create(&new_thread_handle, NULL, (void *)func, arg)))
|
if (!(pthread_create(&new_thread_handle, &_objc_thread_attribs,
|
||||||
|
(void *)func, arg)))
|
||||||
thread_id = *(objc_thread_t *)&new_thread_handle;
|
thread_id = *(objc_thread_t *)&new_thread_handle;
|
||||||
else
|
else
|
||||||
thread_id = NULL;
|
thread_id = NULL;
|
||||||
|
|
7
config/config.forward2.m
Normal file
7
config/config.forward2.m
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include <objc/objc-api.h>
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
IMP (*__objc_msg_forward1)(id,SEL) = __objc_msg_forward2;
|
||||||
|
return 0;
|
||||||
|
}
|
10
configure.ac
10
configure.ac
|
@ -802,11 +802,12 @@ AC_DEFINE_UNQUOTED(GNUSTEP_TARGET_LOCAL_USERS_DIR,
|
||||||
# ask it to output all variables! That way we have access to (eg)
|
# ask it to output all variables! That way we have access to (eg)
|
||||||
# GNUSTEP_SYSTEM_HEADERS below.
|
# GNUSTEP_SYSTEM_HEADERS below.
|
||||||
#
|
#
|
||||||
# We need to unles any values that we really need, or existing settings
|
# We need to unset any values that we really need, or existing settings
|
||||||
# would be used by GNUstep.sh
|
# would be used by GNUstep.sh
|
||||||
#
|
#
|
||||||
unset GNUSTEP_SYSTEM_HEADERS
|
unset GNUSTEP_SYSTEM_HEADERS
|
||||||
unset GNUSTEP_SYSTEM_LIBRARIES
|
unset GNUSTEP_SYSTEM_LIBRARIES
|
||||||
|
GNUSTEP_MAKEFILES="$CURRENT_GNUSTEP_MAKEFILES"
|
||||||
GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes
|
GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes
|
||||||
. "$CURRENT_GNUSTEP_MAKEFILES/GNUstep.sh"
|
. "$CURRENT_GNUSTEP_MAKEFILES/GNUstep.sh"
|
||||||
unset GNUSTEP_SH_EXPORT_ALL_VARIABLES
|
unset GNUSTEP_SH_EXPORT_ALL_VARIABLES
|
||||||
|
@ -1862,8 +1863,15 @@ have_forward_hook=yes
|
||||||
saved_CPPFLAGS="$CPPFLAGS"
|
saved_CPPFLAGS="$CPPFLAGS"
|
||||||
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c"
|
CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c"
|
||||||
AC_MSG_CHECKING(for forwarding callback in runtime)
|
AC_MSG_CHECKING(for forwarding callback in runtime)
|
||||||
|
AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward2.m"],
|
||||||
|
have_forward_hook=yes, have_forward_hook=no)
|
||||||
|
if test $have_forward_hook = yes; then
|
||||||
|
AC_DEFINE(HAVE_FORWARD2,1,
|
||||||
|
[Define if libobjc has the __objc_msg_forward2 function])
|
||||||
|
else
|
||||||
AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward.m"],
|
AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward.m"],
|
||||||
have_forward_hook=yes, have_forward_hook=no)
|
have_forward_hook=yes, have_forward_hook=no)
|
||||||
|
fi
|
||||||
AC_MSG_RESULT($have_forward_hook)
|
AC_MSG_RESULT($have_forward_hook)
|
||||||
if test $have_forward_hook = no; then
|
if test $have_forward_hook = no; then
|
||||||
enable_libffi=no
|
enable_libffi=no
|
||||||
|
|
Loading…
Reference in a new issue