]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Added some netsplit handling stuff (untested)
[user/henk/code/inspircd.git] / configure
index af9f2695048d6c28d405d7ba32766c99691ed8e6..941d3e9da7c9256b2297cf0477811c5a70b04000 100755 (executable)
--- a/configure
+++ b/configure
@@ -7,15 +7,8 @@
 #
 # $Id$
 #
-# Some shell code based on the configure script of IRC Services.
-# IRC Services is copyright (c) 1996-2002 Andrew Church. 
-# E-mail: <achurch@achurch.org>
-#
-#
 ########################################
 
-# echo -e "\033[1;37mtest\033[0;37m"
-
 echo "Configuring default values..."
 
 ME=`pwd`
@@ -28,6 +21,7 @@ NICK_LENGT=32
 CHAN_LENGT=64
 MAX_CHANNE=20
 MAXI_MODES=20
+OSNAME=`(uname -s) 2>/dev/null` || OSNAME="unknown"
 
 if [ -z $MAX_CLIENT_T ] ; then
         MAX_CLIENT_T=1024
@@ -43,7 +37,43 @@ if [ -e ".config.cache" -a -z "$CLEAN" ] ; then
     . .config.cache 
 fi
 
-OSNAME=`(uname -s) 2>/dev/null` || OSNAME="unknown"
+if [ "$1" = "-update" -o "$2" = "-update" ] ; then
+   # They wanna update their Makefile.. good for 'em
+   # Make sure .config.cache exists
+   if [ ! -e ".config.cache" ] ; then
+     echo "You have not run ./configure before. Please do this before trying to run the update script."
+     exit 0
+   fi
+   # Right, load the cache values
+   . .config.cache
+   # Check for modules
+
+   case "$OSNAME" in
+           (FreeBSD)
+                   LDLIBS="-Ldl"
+                   FLAGS="-fPIC -frtti -O3"
+                   MAKEPROG="gmake"
+                   ;;
+           (*)
+                   LDLIBS="-ldl"
+                   FLAGS="-fPIC -frtti -O3"
+                   MAKEPROG="make"
+                   ;;
+   esac
+
+   MODULES=""
+   for module in src/modules/*.cpp ; do
+           mod=`echo $module | sed 's/.cpp/.so/' | sed 's/src\/modules\///'`
+           MODULES="$MODULES $mod"
+   done
+
+   # Write the new makefile.
+   . .Makefile.inc
+   echo "Complete."
+   exit 1; 
+fi
+
+
 if [ -z $MAX_CLIENT ] ; then
         MAX_CLIENT=$MAX_CLIENT_T
 fi
@@ -364,6 +394,11 @@ touch include/inspircd_config.h
 
 echo "Preparing Variables for the Makefile"
 
+if [ "$CONFIG_DIR" != "$ME/conf" ] ; then
+    COPY_CONF=1
+fi
+
+
 case "$OSNAME" in
        (FreeBSD)
                LDLIBS="-Ldl"