From 4790fa3e19396c5970c9af0227d8f7987a692d4b Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 16 Mar 2005 12:54:13 +0000 Subject: [PATCH] added dependency checking, added strip=yes support git-svn-id: http://svn.opengroupware.org/SOPE/trunk@658 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- configure | 71 ++++++++++++++++++- maintenance/dummytool.m | 7 ++ .../NGMimeRFC822DateHeaderFieldParser.m | 9 ++- 3 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 maintenance/dummytool.m diff --git a/configure b/configure index abe881a2..b8b54759 100755 --- a/configure +++ b/configure @@ -17,7 +17,8 @@ ARG_PREFIX="" ARG_GSMAKE="$GNUSTEP_MAKEFILES" ARG_CFGMAKE="$PWD/config.make" ARG_WITH_GNUSTEP=0 -ARG_WITH_DEBUG=0 +ARG_WITH_DEBUG=1 +ARG_WITH_STRIP=1 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh" DARG_IS_FHS=1 @@ -47,6 +48,7 @@ Installation directories: --configmake=PATH path to the config file being created --with-gnustep install in GNUstep tree --enable-debug turn on debugging and compile time warnings + --enable-strip turn on stripping of debug symbols _ACEOF @@ -70,6 +72,11 @@ function printParas() { else echo " debug: no"; fi + if test $ARG_WITH_STRIP = 1; then + echo " strip: yes"; + else + echo " strip: no"; + fi echo " prefix: $ARG_PREFIX" echo " gstep: $ARG_GSMAKE" @@ -232,6 +239,15 @@ function genConfigMake() { fi cfgwrite "" + if test $ARG_WITH_STRIP = 1; then + cfgwrite "# configured to produce stripped code"; + cfgwrite "strip:=yes" + else + cfgwrite "# configured not to strip code"; + cfgwrite "strip:=no" + fi + cfgwrite "" + cfgwrite "# enforce shared libraries"; cfgwrite "shared:=yes" cfgwrite "" @@ -248,6 +264,49 @@ function genConfigMake() { cfgwrite "PATH:=\$(GNUSTEP_SYSTEM_ROOT)/Tools:\$(PATH)" } +function checkLinking() { + local oldpwd=$PWD + local tmpdir=".configure-test-$$" + + mkdir $tmpdir + cd $tmpdir + cp ../maintenance/dummytool.m . + + tmpmake="GNUmakefile" + echo >$tmpmake "include ../config.make" + echo >>$tmpmake "include \$(GNUSTEP_MAKEFILES)/common.make" + echo >>$tmpmake "TOOL_NAME := linktest" + echo >>$tmpmake "linktest_OBJC_FILES := dummytool.m" + echo >>$tmpmake "linktest_TOOL_LIBS += -l$1" + echo >>$tmpmake "SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib" + echo >>$tmpmake "include \$(GNUSTEP_MAKEFILES)/tool.make" + + make -s messages=yes -f $tmpmake linktest >out.log 2>err.log + LINK_RESULT=$? + + if test $LINK_RESULT = 0; then + echo "$2 library found: $1" + else + if test "x$2" = "xrequired"; then + echo "failed to link $2 library: $1" + rm ../config.make + exit 1 + else + echo "failed to link $2 library: $1" + fi + fi + + cd $oldpwd + rm -rf $tmpdir +} + +function checkDependencies() { + checkLinking "xml2" required; + checkLinking "ldap" required; + checkLinking "ssl" required; # TODO: make optional + checkLinking "pq" required; # TODO: make optional +} + function runIt() { if test $ARG_BEQUIET != 1; then printParas; @@ -259,6 +318,7 @@ function runIt() { fi else genConfigMake; + checkDependencies; if test -x $NGSTREAMS_DIR/configure; then if test $ARG_BEQUIET != 1; then @@ -305,6 +365,15 @@ function processOption() { "x--enable-debug") ARG_WITH_DEBUG=1 ;; + "x--disable-debug") + ARG_WITH_DEBUG=0 + ;; + "x--enable-strip") + ARG_WITH_STRIP=1 + ;; + "x--disable-strip") + ARG_WITH_STRIP=0 + ;; *) echo "error: cannot process argument: $1"; exit 1; ;; esac diff --git a/maintenance/dummytool.m b/maintenance/dummytool.m new file mode 100644 index 00000000..94f1e8b0 --- /dev/null +++ b/maintenance/dummytool.m @@ -0,0 +1,7 @@ +// Note: do not remove, used by ../configure + +#import + +int main(int argc, char **argv) { + return 0; +} diff --git a/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m b/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m index 2ec5d382..2029b567 100644 --- a/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m +++ b/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m @@ -271,8 +271,8 @@ static NSTimeZone *parseTimeZone(unsigned char *s, unsigned int len) { } ts = [[NSString alloc] initWithCString:buf]; } -#if 0 - NSLog(@"RFC822 TZ Parser: expensive: '%@'", ts); +#if 1 + NSLog(@"%s: RFC822 TZ Parser: expensive: '%@'", __PRETTY_FUNCTION__, ts); #endif tz = [NSTimeZone timeZoneWithAbbreviation:ts]; [ts release]; @@ -342,7 +342,10 @@ static NSTimeZone *parseTimeZone(unsigned char *s, unsigned int len) { ; if (*pe == 0) goto failed; *pe = '\0'; - monthOfYear = parseMonthOfYear(bytes, (pe - bytes)); + if ((monthOfYear = parseMonthOfYear(bytes, (pe - bytes))) == 0) { + [self logWithFormat:@"WARNING(%s): cannot parse month in date: %@", + __PRETTY_FUNCTION__, _data]; + } bytes = pe + 1; /* parse year */ -- 2.39.5