]> err.no Git - sope/blobdiff - configure
fixed Xcode build, bumped dyld versions
[sope] / configure
index ba11180548508556cc3c3d51f81cbf199b795dc9..abe881a265134335fda12ee9eb7ed4bd63287fab 100755 (executable)
--- a/configure
+++ b/configure
@@ -17,10 +17,13 @@ ARG_PREFIX=""
 ARG_GSMAKE="$GNUSTEP_MAKEFILES"
 ARG_CFGMAKE="$PWD/config.make"
 ARG_WITH_GNUSTEP=0
+ARG_WITH_DEBUG=0
 
 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
 DARG_IS_FHS=1
 
+NGSTREAMS_DIR="./sope-core/NGStreams"
+
 # ******************** usage ********************
 
 function usage() {
@@ -43,6 +46,7 @@ Installation directories:
   --gsmake=PATH           path to gnustep-make tree
   --configmake=PATH       path to the config file being created
   --with-gnustep          install in GNUstep tree
+  --enable-debug          turn on debugging and compile time warnings
 
 _ACEOF
 
@@ -60,6 +64,12 @@ function printParas() {
   else
     echo "  FHS:    install in GNUstep tree"; 
   fi
+
+  if test $ARG_WITH_DEBUG = 1; then 
+    echo "  debug:  yes";
+  else
+    echo "  debug:  no";
+  fi
   
   echo "  prefix: $ARG_PREFIX"
   echo "  gstep:  $ARG_GSMAKE"
@@ -87,7 +97,19 @@ _ACEOFWARN
 
 function validateGNUstepArgs() {
   # GNUstep make
-  if test -d $ARG_GSMAKE; then
+  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
@@ -127,7 +149,7 @@ function validateArgs() {
         else
           DARG_IS_FHS=1;
           ARG_PREFIX="/usr/local/"
-         echo "Note: will install in $ARG_PREFIX"
+         echo "Note: will install in default location: $ARG_PREFIX"
          echo ""
        fi
        ;;
@@ -171,9 +193,9 @@ function cfgwrite() {
 
 function genConfigMake() {
   # we ignore the following vars also patches by gstep-make:
-  #   GUILE_LOAD_PATH
   #   PATH
   #   DYLD_LIBRARY_PATH
+  #   GUILE_LOAD_PATH
   #   CLASSPATH
   
   if test $ARG_BEQUIET != 1; then
@@ -181,21 +203,49 @@ function genConfigMake() {
   fi
   
   echo "# GNUstep environment configuration" > $ARG_CFGMAKE
-  cfgwrite "#   created by: '$CFG_ARGS'";
-  cfgwrite "";
+  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 "# 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 ""
+  
+  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 runIt() {
@@ -209,6 +259,17 @@ function runIt() {
     fi
   else
     genConfigMake;
+    
+    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
 }
 
@@ -241,6 +302,9 @@ function processOption() {
         ARG_WITH_GNUSTEP=1
         DARG_IS_FHS=0
        ;;
+    "x--enable-debug")
+        ARG_WITH_DEBUG=1
+       ;;
 
     *) echo "error: cannot process argument: $1"; exit 1; ;;
   esac