mostly fixups for ICU

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31742 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-12-16 10:09:43 +00:00
parent c4fdcb6d93
commit 62de5b485f
13 changed files with 16749 additions and 2825 deletions

View file

@ -1,3 +1,20 @@
2010-12-16 Richard Frith-Macdonald <rfm@gnu.org>
* configure.ac: Remove redundant/incorrect define of HAVE_ICU.
Require ICU version 4.6 or later.
Add comments describing how external dependencies are handled.
* configure: Regenerate
* Headers/Additions/GNUstepBase/config.h.in: Regenerate
* config.mak.in: Update for consistency
* base.make.in: ditto
* Headers/Additions/GNUstepBase/GSConfig.h.in: ditto
* Source/GSHTTPURLHandle.m: Improve debug logging a little
* Source/NSXMLParser.m: Improve error handling. Use sloppy parser.
* Source/NSRegularExpression.m: Use GS_USE_ICU and nnever HAVE_ICU
* Source/NSCalendar.m: ditto
* Source/NSLocale.m: ditto
* Source/GSICUString.m: ditto
2010-12-15 Stefan Bidigaray <stefanbidi@gmail.com>
* Source/GNUmakefile: Install NSCalendar.h.

View file

@ -221,6 +221,8 @@ typedef struct {
#define BASE_NATIVE_OBJC_EXCEPTIONS @BASE_NATIVE_OBJC_EXCEPTIONS@
#define GS_NONFRAGILE @GS_NONFRAGILE@
#define GS_MIXEDABI @GS_MIXEDABI@
#define GS_USE_LIBXML @HAVE_LIBXML@
#define GS_USE_GNUTLS @HAVE_GNUTLS@
#define GS_USE_AVAHI @HAVE_AVAHI@
#define GS_USE_MDNS @HAVE_MDNS@
#define GS_USE_ICU @HAVE_ICU@

View file

@ -277,9 +277,6 @@
/* Define if you have this function */
#undef HAVE_ICONV
/* Define if using International Components for Unicode */
#undef HAVE_ICU
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
@ -609,6 +606,9 @@
/* Define if libobjc has the _objc_unexpected_exception callback */
#undef HAVE_UNEXPECTED
/* Define to 1 if you have the <unicode/ucal.h> header file. */
#undef HAVE_UNICODE_UCAL_H
/* Define to 1 if you have the <unicode/ucurr.h> header file. */
#undef HAVE_UNICODE_UCURR_H
@ -621,9 +621,6 @@
/* Define to 1 if you have the <unicode/uregex.h> header file. */
#undef HAVE_UNICODE_UREGEX_H
/* Define to 1 if you have the <unicode/ucal.h> header file. */
#undef HAVE_UNICODE_UCAL_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@ -675,9 +672,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION

View file

@ -1016,6 +1016,9 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
[nc removeObserver: self name: nil object: sock];
if ([sock sslConnect] == NO)
{
if (debug)
NSLog(@"%@ %p %s Failed to make ssl connect",
NSStringFromSelector(_cmd), self, keepalive?"K":"");
[self endLoadInBackground];
[self backgroundLoadDidFailWithReason:
@"Failed to make ssl connect"];

View file

@ -1,5 +1,5 @@
#import "config.h"
#if HAVE_ICU
#import "common.h"
#if GS_USE_ICU == 1
#import "GSICUString.h"
/**

View file

@ -45,7 +45,7 @@
@implementation NSCalendar (PrivateMethods)
- (void) _openUCalendar
{
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
if (_cal == NULL)
{
NSString *tzName;
@ -69,7 +69,7 @@
- (void) _closeUCalendar
{
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
ucal_close (_cal);
_cal = NULL;
#endif
@ -201,7 +201,7 @@
- (NSUInteger) firstWeekday
{
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
[self _openUCalendar];
return ucal_getAttribute (_cal, UCAL_FIRST_DAY_OF_WEEK);
#endif
@ -210,7 +210,7 @@
- (void) setFirstWeekday: (NSUInteger) weekday
{
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
[self _openUCalendar];
ucal_setAttribute (_cal, UCAL_FIRST_DAY_OF_WEEK, (int32_t)weekday);
#endif
@ -219,7 +219,7 @@
- (NSUInteger) minimumDaysInFirstWeek
{
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
[self _openUCalendar];
return ucal_getAttribute (_cal, UCAL_MINIMAL_DAYS_IN_FIRST_WEEK);
#endif
@ -228,7 +228,7 @@
- (void) setMinimumDaysInFirstWeek: (NSUInteger) mdw
{
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
[self _openUCalendar];
ucal_setAttribute (_cal, UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, (int32_t)mdw);
#endif

View file

@ -95,7 +95,7 @@ NSString * const NSISO8601Calendar = @"";
# include <unicode/ucurr.h>
#endif
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
//
// ICU Component Keywords
//
@ -601,7 +601,7 @@ static NSRecursiveLock *classLock = nil;
[classLock lock];
if (nil == systemLocale)
{
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
systemLocale = [[NSLocale alloc] initWithLocaleIdentifier: @""];
#endif
}
@ -793,7 +793,7 @@ static NSRecursiveLock *classLock = nil;
- (id) objectForKey: (id) key
{
id result = nil;
#if defined(HAVE_ICU)
#if GS_USE_ICU == 1
if (key == NSLocaleIdentifier)
return _localeId;

View file

@ -1,5 +1,5 @@
#include "config.h"
#if HAVE_ICU
#include "common.h"
#if GS_USE_ICU == 1
#include "unicode/uregex.h"
#if (U_ICU_VERSION_MAJOR_NUM > 4 || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 4))

View file

@ -46,7 +46,7 @@ NSString* const NSXMLParserErrorDomain = @"NSXMLParserErrorDomain";
static NSNull *null = nil;
#if defined(HAVE_LIBXML)
#if 0 && defined(HAVE_LIBXML)
/* We support a strict libxml2 based parser ... but sometimes we need a
* sloppier parser which copes with bad XML generated by Apple's software,
@ -510,7 +510,7 @@ static NSNull *null = nil;
- (NSError*) parserError
{
return nil; // FIXME
return (nil == myHandler) ? nil : myHandler->_lastError;
}
- (void) setDelegate: (id)delegate
@ -875,10 +875,13 @@ static SEL foundIgnorableSel;
- (BOOL) _parseError: (NSString *)message code: (NSInteger)code
{
NSDictionary *info = nil;
message = [NSString stringWithFormat: @"line %d, column %d ... %@",
this->line, this->column, message];
#if EXTRA_DEBUG
NSLog(@"XML parseError: %@", message);
#endif
NSDictionary *info = nil;
[this->error release];
if (message != nil)

View file

@ -54,4 +54,5 @@ endif
GNUSTEP_BASE_HAVE_LIBXML=@HAVE_LIBXML@
GNUSTEP_BASE_HAVE_MDNS=@HAVE_MDNS@
GNUSTEP_BASE_HAVE_AVAHI=@HAVE_AVAHI@
GNUSTEP_BASE_HAVE_UCI=@HAVE_UCI@
endif # BASE_MAKE_LOADED

View file

@ -21,7 +21,6 @@ OBJC2RUNTIME=@OBJC2RUNTIME@
OBJCSYNC=@OBJCSYNC@
WARN_FLAGS=@WARN_FLAGS@
HAVE_ICU=@HAVE_ICU@
HAVE_INET_PTON=@HAVE_INET_PTON@
HAVE_INET_NTOP=@HAVE_INET_NTOP@
HAVE_OBJC_SYNC_ENTER=@HAVE_OBJC_SYNC_ENTER@
@ -36,6 +35,9 @@ GNUSTEP_INSTALL_GDOMAP_AS_SETUID=@GNUSTEP_INSTALL_GDOMAP_AS_SETUID@
GNUSTEP_BASE_HAVE_LIBXML=@HAVE_LIBXML@
GNUSTEP_BASE_HAVE_GNUTLS=@HAVE_GNUTLS@
GNUSTEP_BASE_HAVE_MDNS=@HAVE_MDNS@
GNUSTEP_BASE_HAVE_AVAHI=@HAVE_AVAHI@
GNUSTEP_BASE_HAVE_ICU=@HAVE_ICU@
# Default to building only -baseadd
# on non *-gnu-* library combos

19452
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -22,6 +22,41 @@
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02111 USA
#
# DEPENDENCIES POLICY
#
# Generally the aim in the base library is to minimise dependencies on
# external libraries which may not come as standard on all systems, and
# you should not, as a rule, add such dependencies.
#
# However, in some cases there are large areas of functionality where it
# would just be too much effort to implement things ourselves and it makes
# sense to use external software to do the job.
#
# In such cases this configure.ac script should include options to allow
# people to build with the dependency or to disable those parts of the
# base library which require the external dependency and build without it.
# The configure script should support a --disable-xxx option in such a case,
# where 'xxx' is the name of the dependency.
#
# Where a dependency is introduced this script should do this by setting
# HAVE_XXX to 1 or 0 and calling AC_SUBST(XXX) to substitute the information
# into the make files:
# config.mak.in: used to build the base library itsself
# base.make.in: the makefile fragment used to build software which uses base
# These files then define GNUSTEP_BASE_HAVE_XXX to 1 or 0 so that the variable
# may be used to control conditional compilation of particular files.
#
# In addition the values should be substituted into the header file
# Headers/Additions/GNUstepBase/GSConfig.h.in so that it can define a
# preprocessor constant of the form GS_USE_XXX to 1 or 0, providing a
# standard mechanism for parts of a paritcvular file to compile to make
# use of the external code or not.
# This file is included by all the base library source code, and may also
# be included by code which uses the base library.
#
builtin(include, config/objc-con-autoload.m4)dnl
builtin(include, config/objc-sys-dynamic.m4)dnl
builtin(include, config/procfs-exe-link.m4)dnl
@ -2472,8 +2507,8 @@ fi
#--------------------------------------------------------------------
# Check recent libxml for Properytlists, GSXML, GSDoc etc.
# See DEPENDENCIES POLICY at the start of thsi file.
#--------------------------------------------------------------------
AC_ARG_ENABLE(xml,
[ --disable-xml Compile even if XML-dependencies are not met],,
enable_xml=yes)
@ -2544,8 +2579,8 @@ AC_SUBST(HAVE_LIBXML)
#--------------------------------------------------------------------
# Check recent libgnutls for SSL streams.
# See DEPENDENCIES POLICY at the start of thsi file.
#--------------------------------------------------------------------
AC_ARG_ENABLE(tls,
[ --disable-tls Disable use of GNUTLS],,
enable_tls=yes)
@ -2595,6 +2630,7 @@ AC_SUBST(HAVE_GNUTLS)
#--------------------------------------------------------------------
# Check for NSNetServices
# See DEPENDENCIES POLICY at the start of thsi file.
#--------------------------------------------------------------------
HAVE_MDNS=0
HAVE_AVAHI=0
@ -2625,7 +2661,8 @@ if test $enable_zeroconf = yes; then
fi
fi
fi
# If we have both APIs, perfer Avahi, because the mDNS API is most certainly the compatability one
# If we have both APIs, prefer Avahi, because the mDNS API
# is most certainly the compatability one
if test "$have_avahi" = "yes" && test "$have_mdns" = "yes"; then
LIBS="$AVAHI_LIBS $LIBS"
HAVE_MDNS=0
@ -2638,6 +2675,7 @@ AC_SUBST(HAVE_MDNS)
AC_SUBST(HAVE_AVAHI)
#--------------------------------------------------------------------
# Check for International Components for Unicode
# See DEPENDENCIES POLICY at the start of thsi file.
#--------------------------------------------------------------------
HAVE_ICU=0
AC_ARG_ENABLE(icu,
@ -2645,14 +2683,12 @@ AC_ARG_ENABLE(icu,
enable_icu=yes)
if test $enable_icu = yes; then
AC_CHECK_ICU(4.0, have_icu=yes, have_icu=no)
AC_CHECK_ICU(4.6, have_icu=yes, have_icu=no)
if test "$have_icu" = "yes"; then
AC_MSG_RESULT(yes)
AC_CHECK_HEADERS(unicode/uloc.h unicode/ulocdata.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h)
LIBS="$LIBS $ICU_LIBS"
HAVE_ICU=1
AC_DEFINE(HAVE_ICU,1,
[Define if using International Components for Unicode])
else
AC_MSG_RESULT(no)
fi