]> err.no Git - sope/commitdiff
added dependency checking, added strip=yes support
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 16 Mar 2005 12:54:13 +0000 (12:54 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 16 Mar 2005 12:54:13 +0000 (12:54 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@658 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

configure
maintenance/dummytool.m [new file with mode: 0644]
sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m

index abe881a265134335fda12ee9eb7ed4bd63287fab..b8b54759b730d3996609a399d03f6bfbfd1add01 100755 (executable)
--- 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 (file)
index 0000000..94f1e8b
--- /dev/null
@@ -0,0 +1,7 @@
+// Note: do not remove, used by ../configure
+
+#import <Foundation/Foundation.h>
+
+int main(int argc, char **argv) {
+  return 0;
+}
index 2ec5d382231788be112bdc7845b399661c3dfa4b..2029b5672152a957a602cc6b96d84819e1e759a4 100644 (file)
@@ -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 */