mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-07 15:01:10 +00:00
Portability tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33999 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4cc58b721a
commit
1d6c3a2a72
7 changed files with 3052 additions and 17069 deletions
|
@ -40,10 +40,15 @@
|
||||||
</chapter>
|
</chapter>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
#import "GNUstepBase/Unicode.h"
|
#import "GNUstepBase/Unicode.h"
|
||||||
|
|
||||||
|
#ifndef _XOPEN_SOURCE
|
||||||
|
#define _XOPEN_SOURCE=600
|
||||||
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBXML
|
#ifdef HAVE_LIBXML
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,14 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
|
#ifndef _XOPEN_SOURCE
|
||||||
|
#define _XOPEN_SOURCE=600
|
||||||
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#import "Foundation/NSDictionary.h"
|
#import "Foundation/NSDictionary.h"
|
||||||
#import "Foundation/NSError.h"
|
#import "Foundation/NSError.h"
|
||||||
#import "GSPrivate.h"
|
#import "GSPrivate.h"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
#define EXPOSE_NSURLConnection_IVARS 1
|
#define EXPOSE_NSURLConnection_IVARS 1
|
||||||
|
#import "Foundation/NSError.h"
|
||||||
#import "Foundation/NSRunLoop.h"
|
#import "Foundation/NSRunLoop.h"
|
||||||
#import "GSURLPrivate.h"
|
#import "GSURLPrivate.h"
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@ void __objc_update_dispatch_table_for_class(Class);
|
||||||
extern struct sarray *__objc_uninstalled_dtable;
|
extern struct sarray *__objc_uninstalled_dtable;
|
||||||
extern objc_mutex_t __objc_runtime_mutex;
|
extern objc_mutex_t __objc_runtime_mutex;
|
||||||
|
|
||||||
static void createNSBlockSubclass(Class superclass, Class newClass,
|
static void
|
||||||
|
createNSBlockSubclass(Class superclass, Class newClass,
|
||||||
Class metaClass, char *name)
|
Class metaClass, char *name)
|
||||||
{
|
{
|
||||||
// Initialize the metaclass
|
// Initialize the metaclass
|
||||||
|
|
|
@ -601,6 +601,7 @@
|
||||||
|
|
||||||
#import "Foundation/NSArray.h"
|
#import "Foundation/NSArray.h"
|
||||||
#import "Foundation/NSAutoreleasePool.h"
|
#import "Foundation/NSAutoreleasePool.h"
|
||||||
|
#import "Foundation/NSData.h"
|
||||||
#import "Foundation/NSDictionary.h"
|
#import "Foundation/NSDictionary.h"
|
||||||
#import "Foundation/NSEnumerator.h"
|
#import "Foundation/NSEnumerator.h"
|
||||||
#import "Foundation/NSFileManager.h"
|
#import "Foundation/NSFileManager.h"
|
||||||
|
|
63
configure.ac
63
configure.ac
|
@ -1080,6 +1080,7 @@ AC_LANG_POP(C)
|
||||||
|
|
||||||
|
|
||||||
AC_PATH_PROG(WHOAMI, whoami, echo, $PATH:/usr/ucb)
|
AC_PATH_PROG(WHOAMI, whoami, echo, $PATH:/usr/ucb)
|
||||||
|
AC_PATH_PROG(PKGCONFIG, pkg-config, yes, no)
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# specific target_os options
|
# specific target_os options
|
||||||
|
@ -1597,13 +1598,13 @@ if test x"$objc_threaded" != x""; then
|
||||||
LIBS="$LIBS $objc_threaded"
|
LIBS="$LIBS $objc_threaded"
|
||||||
fi
|
fi
|
||||||
LIBS="$LIBS $extra_LIBS"
|
LIBS="$LIBS $extra_LIBS"
|
||||||
AC_CACHE_VAL(objc_works,
|
AC_CACHE_VAL(gs_cv_objc_works,
|
||||||
AC_TRY_RUN([#include "$srcdir/config/config.objc.m"],
|
AC_TRY_RUN([#include "$srcdir/config/config.objc.m"],
|
||||||
objc_works=yes,
|
gs_cv_objc_works=yes,
|
||||||
objc_works=no,
|
gs_cv_objc_works=no,
|
||||||
objc_works=yes)
|
gs_cv_objc_works=yes)
|
||||||
)
|
)
|
||||||
if test $objc_works = yes; then
|
if test $gs_cv_objc_works = yes; then
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
@ -1632,13 +1633,13 @@ else
|
||||||
strclass_CPPFLAGS="$CPPFLAGS"
|
strclass_CPPFLAGS="$CPPFLAGS"
|
||||||
CPPFLAGS="$CPPFLAGS -fconstant-string-class=FooConstantString"
|
CPPFLAGS="$CPPFLAGS -fconstant-string-class=FooConstantString"
|
||||||
AC_MSG_CHECKING(if the compiler supports -fconstant-string-class)
|
AC_MSG_CHECKING(if the compiler supports -fconstant-string-class)
|
||||||
AC_CACHE_VAL(objc_compiler_supports_constant_string_class,
|
AC_CACHE_VAL(gs_cv_objc_compiler_supports_constant_string_class,
|
||||||
AC_TRY_RUN([#include "$srcdir/config/config.constant-string-class.m"],
|
AC_TRY_RUN([#include "$srcdir/config/config.constant-string-class.m"],
|
||||||
objc_compiler_supports_constant_string_class=yes,
|
gs_cv_objc_compiler_supports_constant_string_class=yes,
|
||||||
objc_compiler_supports_constant_string_class=no,
|
gs_cv_objc_compiler_supports_constant_string_class=no,
|
||||||
objc_compiler_supports_constant_string_class=no)
|
gs_cv_objc_compiler_supports_constant_string_class=no)
|
||||||
)
|
)
|
||||||
if test $objc_compiler_supports_constant_string_class = yes; then
|
if test $gs_cv_objc_compiler_supports_constant_string_class = yes; then
|
||||||
NX_CONST_STRING_OBJCFLAGS="-fconstant-string-class=NSConstantString"
|
NX_CONST_STRING_OBJCFLAGS="-fconstant-string-class=NSConstantString"
|
||||||
NX_CONST_STRING_CLASS=NSConstantString
|
NX_CONST_STRING_CLASS=NSConstantString
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
@ -1671,13 +1672,13 @@ AC_SUBST(NX_CONST_STRING_CLASS)
|
||||||
# Needed by NSProcessInfo.m
|
# Needed by NSProcessInfo.m
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
AC_MSG_CHECKING(if +load method is executed before main)
|
AC_MSG_CHECKING(if +load method is executed before main)
|
||||||
AC_CACHE_VAL(objc_load_method_worked,
|
AC_CACHE_VAL(gs_cv_objc_load_method_worked,
|
||||||
AC_TRY_RUN([#include "$srcdir/config/config.loadtest.m"],
|
AC_TRY_RUN([#include "$srcdir/config/config.loadtest.m"],
|
||||||
objc_load_method_worked=yes,
|
gs_cv_objc_load_method_worked=yes,
|
||||||
objc_load_method_worked=no,
|
gs_cv_objc_load_method_worked=no,
|
||||||
objc_load_method_worked=no)
|
gs_cv_objc_load_method_worked=no)
|
||||||
)
|
)
|
||||||
if test $objc_load_method_worked = yes; then
|
if test $gs_cv_objc_load_method_worked = yes; then
|
||||||
AC_DEFINE(HAVE_LOAD_METHOD,1,
|
AC_DEFINE(HAVE_LOAD_METHOD,1,
|
||||||
[Define if your Obj-C compiler calls +load methods before main])
|
[Define if your Obj-C compiler calls +load methods before main])
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
@ -2238,7 +2239,7 @@ AC_CHECK_FUNCS(realpath)
|
||||||
# Used in critical cases by NSProcessInfo.m
|
# Used in critical cases by NSProcessInfo.m
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
AC_MSG_CHECKING(program_invocation_name in C Library)
|
AC_MSG_CHECKING(program_invocation_name in C Library)
|
||||||
AC_CACHE_VAL(program_invocation_name_worked,
|
AC_CACHE_VAL(gs_cv_program_invocation_name_worked,
|
||||||
[AC_TRY_RUN([
|
[AC_TRY_RUN([
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
int
|
int
|
||||||
|
@ -2247,8 +2248,8 @@ main (int argc, char *argv[])
|
||||||
extern char *program_invocation_name;
|
extern char *program_invocation_name;
|
||||||
return (strcmp (program_invocation_name, argv[0]));
|
return (strcmp (program_invocation_name, argv[0]));
|
||||||
}
|
}
|
||||||
], program_invocation_name_worked=yes, program_invocation_name_worked=no, program_invocation_name_worked=no)])
|
], gs_cv_program_invocation_name_worked=yes, gs_cv_program_invocation_name_worked=no, gs_cv_program_invocation_name_worked=no)])
|
||||||
if test $program_invocation_name_worked = yes; then
|
if test $gs_cv_program_invocation_name_worked = yes; then
|
||||||
AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
|
AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
|
||||||
[Define if your Lib C defines program_invocation_name])
|
[Define if your Lib C defines program_invocation_name])
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
@ -2357,7 +2358,7 @@ GS_FAKE_MAIN=0
|
||||||
if test "$enable_fake_main" = "yes"; then
|
if test "$enable_fake_main" = "yes"; then
|
||||||
GS_FAKE_MAIN=1
|
GS_FAKE_MAIN=1
|
||||||
elif test "$enable_pass_arguments" = "no"; then
|
elif test "$enable_pass_arguments" = "no"; then
|
||||||
if test "$objc_load_method_worked" = yes -a \( "$ac_cv_sys_procfs" = yes -o "$have_kvm_env" = 1 -o "$ac_cv_sys_procfs_psinfo" = yes \); then
|
if test "$gs_cv_objc_load_method_worked" = yes -a \( "$ac_cv_sys_procfs" = yes -o "$have_kvm_env" = 1 -o "$ac_cv_sys_procfs_psinfo" = yes \); then
|
||||||
GS_FAKE_MAIN=0
|
GS_FAKE_MAIN=0
|
||||||
if test "$have_kvm_env" = "1"; then
|
if test "$have_kvm_env" = "1"; then
|
||||||
AC_MSG_WARN([Using libkvm which is known to be buggy on some systems consider configuring with --enable-fake-main instead.])
|
AC_MSG_WARN([Using libkvm which is known to be buggy on some systems consider configuring with --enable-fake-main instead.])
|
||||||
|
@ -2734,7 +2735,7 @@ AC_SUBST(HAVE_LIBXML)
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Check recent libgnutls for SSL streams.
|
# Check recent libgnutls for SSL streams.
|
||||||
# See DEPENDENCIES POLICY at the start of thsi file.
|
# See DEPENDENCIES POLICY at the start of this file.
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
AC_ARG_ENABLE(tls,
|
AC_ARG_ENABLE(tls,
|
||||||
[ --disable-tls Disable use of GNUTLS],,
|
[ --disable-tls Disable use of GNUTLS],,
|
||||||
|
@ -2746,7 +2747,21 @@ if test $enable_tls = yes; then
|
||||||
saved_LIBS="$LIBS"
|
saved_LIBS="$LIBS"
|
||||||
saved_CFLAGS="$CFLAGS"
|
saved_CFLAGS="$CFLAGS"
|
||||||
|
|
||||||
# AM_PATH_TLS(2.0.1, enable_libgnutls=yes, enable_libgnutls=no)
|
HAVE_GNUTLS=0
|
||||||
|
if test $PKGCONFIG = yes; then
|
||||||
|
if pkg-config --exists gnutls; then
|
||||||
|
AC_MSG_CHECKING(gnutls support)
|
||||||
|
HAVE_GNUTLS=1
|
||||||
|
TLS_CFLAGS=`pkg-config --cflags gnutls`
|
||||||
|
TLS_LIBS=`pkg-config --clibs gnutls`
|
||||||
|
CPPFLAGS="$CPPFLAGS $TLS_CFLAGS"
|
||||||
|
INCLUDE_FLAGS="$INCLUDE_FLAGS $TLS_CFLAGS"
|
||||||
|
LIBS="$TLS_LIBS $LIBS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $HAVE_GNUTLS = 0; then
|
||||||
|
# AM_PATH_TLS(2.0.1, enable_libgnutls=yes, enable_libgnutls=no)
|
||||||
AM_PATH_TLS(1.4.0, enable_libgnutls=yes, enable_libgnutls=no)
|
AM_PATH_TLS(1.4.0, enable_libgnutls=yes, enable_libgnutls=no)
|
||||||
if test $enable_libgnutls = yes; then
|
if test $enable_libgnutls = yes; then
|
||||||
CPPFLAGS="$CPPFLAGS $TLS_CFLAGS"
|
CPPFLAGS="$CPPFLAGS $TLS_CFLAGS"
|
||||||
|
@ -2770,17 +2785,21 @@ if test $enable_tls = yes; then
|
||||||
# Restore the CFLAGS and LIBS because AM_PATH_TLS messes them
|
# Restore the CFLAGS and LIBS because AM_PATH_TLS messes them
|
||||||
LIBS="$saved_LIBS"
|
LIBS="$saved_LIBS"
|
||||||
CFLAGS="$saved_CFLAGS"
|
CFLAGS="$saved_CFLAGS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test $HAVE_GNUTLS = 0; then
|
||||||
|
AC_MSG_WARN([Missing support for TLS functionality.])
|
||||||
echo
|
echo
|
||||||
echo "You may not want to build base without libgnutls."
|
echo "You may not want to build base without libgnutls."
|
||||||
echo "Doing so will disable SSL support in the NSStream class."
|
echo "Doing so will disable SSL support in the NSStream class."
|
||||||
echo "If you really want to build -base without TLS support,"
|
echo "If you really want to build -base without TLS support,"
|
||||||
echo "add --disable-tls to the configure arguments."
|
echo "add --disable-tls to the configure arguments."
|
||||||
AC_MSG_WARN([Missing support for TLS functionality.])
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
AC_MSG_WARN([Disabled support for TLS funtionality.])
|
AC_MSG_WARN([Disabled support for TLS funtionality.])
|
||||||
HAVE_GNUTLS=0
|
HAVE_GNUTLS=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(HAVE_GNUTLS)
|
AC_SUBST(HAVE_GNUTLS)
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue