]> err.no Git - scalable-opengroupware.org/commitdiff
added configure script and config.make includes
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 25 Mar 2005 23:08:53 +0000 (23:08 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 25 Mar 2005 23:08:53 +0000 (23:08 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@646 d1b88da0-ebda-0310-925b-ed51d893ca5b

15 files changed:
SOGo/GNUmakefile
SOGo/Main/GNUmakefile
SOGo/OGoContentStore/GNUmakefile
SOGo/Protocols/GNUmakefile
SOGo/Protocols/common.make
SOGo/Protocols/iCalHTTP/GNUmakefile
SOGo/SoObjects/GNUmakefile
SOGo/SoObjects/Mailer/SOGoMailManager.m
SOGo/SoObjects/SOGo/GNUmakefile
SOGo/SoObjects/common.make
SOGo/UI/GNUmakefile
SOGo/UI/MailerUI/UIxMailListView.m
SOGo/UI/SOGoUI/GNUmakefile
SOGo/UI/common.make
SOGo/configure [new file with mode: 0755]

index 759d931be72ac6acc1bd3790063e7380ae84150d..78ec6851dda7b81ce8e6317139465428e390ebcd 100644 (file)
@@ -1,5 +1,6 @@
 # GNUstep makefile
 
+-include config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 
 SUBPROJECTS = \
index cf52df32f48a958dddfbf360d4d40b647cb35ec3..9a8d7e92587c23788f9dfc2e33db856012c56802 100644 (file)
@@ -1,5 +1,6 @@
 # GNUstep makefile
 
+-include ../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 include ../Version
 include ./Version
index ce0d78d20400001d7ee82be98259de7cb5a71dd4..a2641c04059fa0c8d622005f76d8c1632d505227 100644 (file)
@@ -1,5 +1,6 @@
 # GNUstep makefile
 
+-include ../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 include ./Version
 
index 906e9fdb76d3a0f2dc5093b773bfd9eb1dace119..25f185f51e8d4dc47888465a30e09bbad97f06fd 100644 (file)
@@ -1,8 +1,9 @@
-# $Id: GNUmakefile 274 2004-08-26 13:10:49Z znek $
+# GNUstep makefile
 
+-include ../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 
-SUBPROJECTS = \
-       iCalHTTP        \
+SUBPROJECTS += \
+       iCalHTTP
 
 include $(GNUSTEP_MAKEFILES)/aggregate.make
index ab0672039b5447edb5bf031c4eb112936500743a..e4de57d0ae99f455c1a587c03c3efdd678db43b5 100644 (file)
@@ -1,5 +1,6 @@
 # common make file for Protocol bundles
 
+-include ../../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 include ../../Version
 include ./Version
index 116d6c58c3011d2adacc53887ff93c18c163f574..1467684a641bbfbe52779083a48cc98c135acf2a 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: GNUmakefile 365 2004-10-06 10:53:34Z znek $
+# GNUstep makefiles
 
 include ../common.make
 
index 2f060092d8afe684539fd731e55fff0b84aef16a..e685b16b1ade19746ab0d8e3a79917a1bf7e16bb 100644 (file)
@@ -1,5 +1,6 @@
-# $Id$
+# GNUstep makefile
 
+-include ../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 
 SUBPROJECTS = \
index 3f35e7afa39e19066c5a24fa6b27aecdd2a3e744..ba7a75785652aa8896fcb059c92966f4ef05ad0b 100644 (file)
@@ -775,6 +775,8 @@ static NSString       *imap4Separator  = nil;
                        reason:@"copy operation failed"];
   }
   
+  // TODO: need to flush some caches?
+  
   return nil;
 }
 
index 5ab355358eb0e5b6de66fab3921aa28a4ee11547..d68deca6335553190ca636ffe96b37976a13badf 100644 (file)
@@ -1,5 +1,6 @@
 # GNUstep makefile
 
+-include ../../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 -include ../../Version
 -include ./Version
index fa42fa194f3dd29cbb6478387244edd629f369e8..6cbb8c3e672f9add105dfc46e3e2c7919b2346ce 100644 (file)
@@ -1,5 +1,6 @@
 # common make file for SoObject bundles
 
+-include ../../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 include ../../Version
 include ./Version
index 0cfcf7ff994332537d4631581695979038d28dac..a11e17395b62bc5cc019cf53989748801b9c64f2 100644 (file)
@@ -1,5 +1,6 @@
 # GNUstep makefile
 
+-include ../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 
 SUBPROJECTS += \
index 495e7dbdc85d62819df4813f4be753a0200f128c..5fe52e5b21add768c4bc32657597074e37b30da4 100644 (file)
@@ -50,6 +50,7 @@
 #include "common.h"
 #include <SoObjects/Mailer/SOGoMailFolder.h>
 #include <SoObjects/Mailer/SOGoMailObject.h>
+#include <NGObjWeb/SoObject+SoDAV.h>
 
 @implementation UIxMailListView
 
index bf26801f215e97b557f587f3d3938a4f5883d8a5..e624bf639aeccf285423ad6852444e9941b7cfc1 100644 (file)
@@ -1,6 +1,9 @@
 # GNUstep makefile
 
+-include ../../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
+include ../../Version
+include ./Version 
 
 LIBRARY_NAME = libSOGoUI
 
index bdb1b862b27f931d571d2c532b54fe86b10e7ed0..72153ffddae377edca529fee0da7ab80da2c558b 100644 (file)
@@ -1,5 +1,6 @@
 # common make file for UI bundles
 
+-include ../../config.make
 include $(GNUSTEP_MAKEFILES)/common.make
 include ../../Version
 include ./Version
diff --git a/SOGo/configure b/SOGo/configure
new file mode 100755 (executable)
index 0000000..3126203
--- /dev/null
@@ -0,0 +1,418 @@
+#!/bin/bash
+
+#
+# Note: When adding make options to this script, ensure that the source still
+#       compiles without those options! (and just with GNUstep.sh being
+#       sourced)
+#       We do not want to force people to run configure.
+#
+
+# ******************** variables ****************
+
+CFG_ARGS="$0 $1 $2 $3 $4 $5 $6 $7 $8 $9"
+
+ARG_BEQUIET=0
+ARG_NOCREATE=0
+ARG_PREFIX=""
+ARG_GSMAKE="$GNUSTEP_MAKEFILES"
+ARG_CFGMAKE="$PWD/config.make"
+ARG_WITH_GNUSTEP=1
+ARG_WITH_DEBUG=1
+ARG_WITH_STRIP=1
+
+DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
+DARG_IS_FHS=1
+
+NGSTREAMS_DIR="./sope-core/NGStreams"
+LINK_SYSLIBDIRS="-L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/lib"
+
+# ******************** usage ********************
+
+function usage() {
+  cat <<_ACEOF
+\`configure' configures a GNUstep-make based sourcetree for installation.
+
+Usage: $0 [OPTION]...
+
+Note: You do not need to configure this source tree, as another option
+      just ensure that the GNUstep.sh of your GNUstep make installation
+      is properly sourced prior running make.
+
+Configuration:
+  -h, --help              display this help and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+  -n, --no-create         do not create output files
+
+Installation directories:
+  --prefix=PREFIX        install files in PREFIX [/usr/local]
+  --gsmake=PATH           path to gnustep-make tree
+  --configmake=PATH       path to the config file being created
+  --without-gnustep       install in GNUstep tree
+  --enable-debug          turn on debugging and compile time warnings
+  --enable-strip          turn on stripping of debug symbols
+
+_ACEOF
+
+  exit 0;
+}
+
+# ******************** running ********************
+
+function printParas() {
+  echo "Configuration:"
+  if test $ARG_BEQUIET  = 1; then echo "  will be quite.";  fi
+  if test $ARG_NOCREATE = 1; then echo "  won't create files"; fi
+  if test $DARG_IS_FHS = 1;  then
+    echo "  FHS:    install in FHS root"; 
+  else
+    echo "  FHS:    install in GNUstep tree"; 
+  fi
+
+  if test $ARG_WITH_DEBUG = 1; then 
+    echo "  debug:  yes";
+  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"
+  echo "  config: $ARG_CFGMAKE"
+  echo "  script: $DARG_GNUSTEP_SH"
+  echo ""
+}
+
+function warnOnFHSPrefix() {
+  cat <<_ACEOFWARN
+Warning: you are configuring for a non standard FHS style prefix.
+         prefix: $ARG_PREFIX
+
+Some code in SOPE only looks in /usr and /usr/local for resources and is
+therefore incompatible with arbitary install pathes.
+
+If you want to have the flexibility of installation in arbitary pathes just
+configure GNUstep-make and source the GNUstep.sh script prior executing tools
+to ensure a proper environment.
+All SOPE based code is completely relocatable when being used in a GNUstep
+environment.
+
+_ACEOFWARN
+}
+
+function validateGNUstepArgs() {
+  # GNUstep make
+  if test "x$ARG_GSMAKE" = "x"; then
+    if test -f $HOME/OGoRoot/Library/Makefiles/GNUstep.sh; then
+      ARG_GSMAKE="$HOME/OGoRoot/Library/Makefiles/"
+    elif test -f $HOME/GNUstep/Library/Makefiles/GNUstep.sh; then
+      ARG_GSMAKE="$HOME/GNUstep/Library/Makefiles/"
+    elif test -f /usr/GNUstep/System/Library/Makefiles/GNUstep.sh; then
+      ARG_GSMAKE="/usr/GNUstep/System/Library/Makefiles/"
+    else
+      echo "error: please specify a GNUstep make tree!"
+      exit 1
+    fi
+    DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
+  elif test -d $ARG_GSMAKE; then
+    if test -f $ARG_GSMAKE/GNUstep.sh; then
+      DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
+    elif test -f $ARG_GSMAKE/Library/Makefiles/GNUstep.sh; then
+      ARG_GSMAKE="$ARG_GSMAKE/Library/Makefiles"
+      DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
+    else
+      echo "error: specified directory contains no GNUstep.sh: $ARG_GSMAKE"
+      exit 1
+    fi
+  else
+    echo "error: specified GNUstep make tree does not exist: $ARG_GSMAKE"
+    exit 1
+  fi
+}
+
+function setupAppleArgs() {
+  ARG_WITH_STRIP=0
+  ARG_WITH_GNUSTEP=1
+  
+  if test "xLIBRARY_COMBO" != "apple-apple-nil"; then
+    if test "xLIBRARY_COMBO" != "apple-apple-apple"; then
+      echo "WARNING: detected unusual GNUstep setup: $LIBRARY_COMBO"
+      echo ""
+    fi
+  fi
+}
+
+function validateArgs() {
+  # validate prefix (could be better?)
+  case "x$ARG_PREFIX" in
+    "x/usr/local"|"x/usr/local/")
+        DARG_IS_FHS=1;
+       ;;
+    "x/usr"|"x/usr/")
+        DARG_IS_FHS=1;
+       ;;
+    "x$GNUSTEP_USER_ROOT"|"x$GNUSTEP_LOCAL_ROOT"|"x$GNUSTEP_SYSTEM_ROOT")
+        DARG_IS_FHS=0;
+       ARG_WITH_GNUSTEP=1;
+       ;;
+    "x")
+        if test $ARG_WITH_GNUSTEP = 1; then
+          DARG_IS_FHS=0;
+          ARG_PREFIX="$GNUSTEP_LOCAL_ROOT"
+          if test $ARG_BEQUIET != 1; then
+           echo "Note: will install in GNUSTEP_LOCAL_ROOT: $ARG_PREFIX"
+           echo ""
+         fi
+        else
+          DARG_IS_FHS=1;
+          ARG_PREFIX="/usr/local/"
+         echo "Note: will install in default location: $ARG_PREFIX"
+         echo ""
+       fi
+       ;;
+    *)
+        if test $ARG_WITH_GNUSTEP = 1; then
+         echo "error: specified --with-gnustep, but specified prefix is not"
+         echo "       a GNUstep root: '$ARG_PREFIX'"
+         exit 1
+        else
+          if test $ARG_BEQUIET != 1; then
+           warnOnFHSPrefix;
+          fi
+         DARG_IS_FHS=1;
+        fi
+       ;;
+  esac
+  
+  if test $ARG_WITH_GNUSTEP = 1; then
+    if test $DARG_IS_FHS = 1; then
+      echo "error: configured for FHS root _and_ GNUstep tree. Choose one!"
+      exit 1
+    fi
+  fi
+}
+
+function printGNUstepSetup() {
+  echo "GNUstep environment:"
+  echo "  system: ${GNUSTEP_SYSTEM_ROOT}"
+  echo "  local:  ${GNUSTEP_LOCAL_ROOT}"
+  echo "  user:   ${GNUSTEP_USER_ROOT}"
+  echo "  path:   ${GNUSTEP_PATHLIST}"
+  echo "  flat:   ${GNUSTEP_FLATTENED}"
+  echo "  arch:   ${GNUSTEP_HOST}"
+  echo "  combo:  ${LIBRARY_COMBO}"
+  echo ""
+}
+
+function cfgwrite() {
+  echo "$1" >> $ARG_CFGMAKE
+}
+
+function genConfigMake() {
+  # we ignore the following vars also patches by gstep-make:
+  #   PATH
+  #   DYLD_LIBRARY_PATH
+  #   GUILE_LOAD_PATH
+  #   CLASSPATH
+  
+  if test $ARG_BEQUIET != 1; then
+    echo "creating: $ARG_CFGMAKE"
+  fi
+  
+  echo "# GNUstep environment configuration" > $ARG_CFGMAKE
+  cfgwrite "#   created by: '$CFG_ARGS'"
+  cfgwrite ""
+  
+  cfgwrite "# Note: you can override any option as a 'make' parameter, eg:"
+  cfgwrite "#         make debug=yes"
+  cfgwrite ""
+  
+  #cfgwrite "# print on the cmdline that this file is being used"
+  #cfgwrite "all :: "
+  #cfgwrite "  @echo Local GNUstep config.make is active"
+  #cfgwrite ""
+  
+  # TODO: should be also write a GNUSTEP_INSTALLATION_DIR / BUNDLE_INSTALL_DIR?
+  
+  if test $DARG_IS_FHS = 1; then
+    cfgwrite "# configured for FHS install"
+    cfgwrite "FHS_INSTALL_ROOT:=$ARG_PREFIX"
+    cfgwrite ""
+  fi
+  
+  if test $ARG_WITH_DEBUG = 1; then
+    cfgwrite "# configured to produce debugging code";
+    cfgwrite "debug:=yes"
+  else
+    cfgwrite "# configured to produce non-debugging code";
+    cfgwrite "debug:=no"
+  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 ""
+  
+  cfgwrite "# GNUstep environment variables:";
+  for i in `env | grep GNUSTEP_ | sort`; do
+    MAKE_ASSI="`echo $i | sed s/=/:=/`"
+    cfgwrite "${MAKE_ASSI}";
+  done
+  cfgwrite "LIBRARY_COMBO=$LIBRARY_COMBO"
+  cfgwrite ""
+  
+  cfgwrite "# avoid a gstep-make warning"
+  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      += ${LINK_SYSLIBDIRS}"
+  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 "SaxObjC" required;
+  checkLinking "NGLdap"  required;
+}
+
+function runIt() {
+  if test $ARG_BEQUIET != 1; then
+    printParas;
+  fi
+  
+  if test $ARG_NOCREATE = 1; then 
+    if test $ARG_BEQUIET != 1; then
+      echo "not creating the config file ...";
+    fi
+  else
+    genConfigMake;
+    #checkDependencies;
+    
+    if test -x $NGSTREAMS_DIR/configure; then
+      if test $ARG_BEQUIET != 1; then
+        echo -n "configuring NGStreams library .."
+        old="$PWD"
+        cd $NGSTREAMS_DIR
+        ./configure >$old/config-NGStreams.log
+        cd $old
+        echo ".. done (log in config-NGStreams.log)."
+      fi
+    fi
+  fi
+}
+
+# ******************** options ********************
+
+function extractFuncValue() {
+  VALUE="`echo "$1" | sed "s/[^=]*=//g"`"
+}
+
+function processOption() {
+  case "x$1" in
+    "x--help"|"x-h")
+       usage;
+       ;;
+    "x--quiet"|"x--silent"|"x-q") ARG_BEQUIET=1;  ;;
+    "x--no-create"|"x-n")        ARG_NOCREATE=1; ;;
+    x--prefix=*)
+       extractFuncValue $1;
+        ARG_PREFIX="$VALUE";
+       ;;
+    x--gsmake=*)
+       extractFuncValue $1;
+        ARG_GSMAKE="$VALUE";
+       ;;
+    x--configmake=*)
+       extractFuncValue $1;
+        ARG_CFGMAKE="$VALUE";
+       ;;
+    "x--with-gnustep")
+        ARG_WITH_GNUSTEP=1
+        DARG_IS_FHS=0
+       ;;
+    "x--without-gnustep")
+        ARG_WITH_GNUSTEP=0
+        DARG_IS_FHS=1
+       ;;
+    "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
+}
+
+for i in $@; do
+  processOption $i;
+done
+
+# load GNUstep environment
+validateGNUstepArgs
+# first we load the GNUstep.sh environment
+source $DARG_GNUSTEP_SH
+if test $ARG_BEQUIET != 1; then
+  printGNUstepSetup;
+fi
+
+# setup some GNUstep dependend defaults
+if test "x$GNUSTEP_HOST_VENDOR" = "xapple"; then
+  setupAppleArgs;
+fi
+
+# ensure the parameters make sense
+validateArgs
+
+# start it
+runIt