]> err.no Git - sope/commitdiff
if no gstep-make env was found, try to configure the embedded gstep-make
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 8 Aug 2005 13:31:11 +0000 (13:31 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 8 Aug 2005 13:31:11 +0000 (13:31 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1003 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

configure

index 07ccb86362d0e64ceb3bedfe94ae3139faef384d..19825d05a9135d4eeea9ae531324d87c6918d254 100755 (executable)
--- a/configure
+++ b/configure
@@ -23,7 +23,11 @@ ARG_WITH_STRIP=1
 DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
 DARG_IS_FHS=1
 
-NGSTREAMS_DIR="./sope-core/NGStreams"
+SOPE_SRCDIR="$PWD" # TODO: rather use location of configure (using basename)
+NGSTREAMS_DIR="${SOPE_SRCDIR}/sope-core/NGStreams"
+GSTEPMAKE_SRCDIR="${SOPE_SRCDIR}/gnustep-make"
+
+# TODO: add pg_config, mysql_config etc!
 LINK_SYSLIBDIRS="-L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/lib"
 
 # ******************** usage ********************
@@ -103,6 +107,46 @@ environment.
 _ACEOFWARN
 }
 
+function setupInternalGSMake() {
+  if test -d gnustep-make; then
+    SETUP_COMBO="gnu-fd-nil"
+    SETUP_MAKEDIR="${SOPE_SRCDIR}/.gsmake"
+    SETUP_LOGNAME="config-gstepmake.log"
+    if test -d /Developer/Applications/Xcode.app; then
+      # rather weird OSX test, right? ;->
+      SETUP_COMBO="apple-apple-nil"
+    fi
+    pregsmdir="$PWD"
+    
+    echo -n "configuring builtin gnustep-make environment .."
+
+    cd "$GSTEPMAKE_SRCDIR"
+    ./configure >${pregsmdir}/${SETUP_LOGNAME} \
+      --prefix="${SETUP_MAKEDIR}" \
+      --without-system-root \
+      --with-network-root="${SETUP_MAKEDIR}" \
+      --with-local-root="${SETUP_MAKEDIR}" \
+      --with-user-root="${SETUP_MAKEDIR}" \
+      --with-library-combo="${SETUP_COMBO}"
+
+    echo -n ".. install .."
+    make install >>${pregsmdir}/${SETUP_LOGNAME}
+    ARG_GSMAKE="${SETUP_MAKEDIR}/Library/Makefiles/"
+    
+    cd "$pregsmdir"
+    if test -f $ARG_GSMAKE/GNUstep.sh; then
+      echo ".. done (log in ${SETUP_LOGNAME})."
+    else
+      echo "error: failed to setup embedded gnustep-make sources!"
+      cat ${pregsmdir}/${SETUP_LOGNAME}
+      exit 1
+    fi
+  else
+    echo "error: did not find embedded gnustep-make sources!"
+    exit 1
+  fi
+}
+
 function validateGNUstepArgs() {
   # GNUstep make
   if test "x$ARG_GSMAKE" = "x"; then
@@ -113,8 +157,7 @@ function validateGNUstepArgs() {
     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
+      setupInternalGSMake;
     fi
     DARG_GNUSTEP_SH="$ARG_GSMAKE/GNUstep.sh"
   elif test -d $ARG_GSMAKE; then