SEEN-Database: refactor database interface for remembering whether we already aggrega...
[citadel.git] / citadel / scripts / mk_module_init.sh
index 3ed51024c54c832a5bc47c95c8e36c07ac77c3b7..cc51ae933916b291a9d829643fb75878c1ca829c 100755 (executable)
@@ -30,7 +30,7 @@ U_FILE="$CUR_DIR/modules_upgrade.c"
 
 /usr/bin/printf "Scanning extension modules for entry points.\n"
 
-STATIC_FIRST_MODULES="citserver control modules euidindex file_ops msgbase room_ops user_ops nttlist"
+STATIC_FIRST_MODULES="citserver control modules euidindex file_ops msgbase room_ops user_ops nttlist database"
 DYNAMIC_MODULES=`grep CTDL_MODULE_INIT modules/*/*.c |$SED 's;.*(\(.*\));\1;'`
 if test -d user_modules; then 
     USER_MODULES=`grep CTDL_MODULE_INIT user_modules/*/*.c |$SED 's;.*(\(.*\));\1;'`
@@ -129,6 +129,8 @@ cat <<EOF >> $H_FILE
 EOF
 done
 
+grep CTDL_MODULE_UPGRADE *.c modules/*/*.c  |$SED 's;.*(\(.*\));\CTDL_MODULE_UPGRADE(\1)\;\n;' >> $H_FILE
+
 cat <<EOF >> $H_FILE
 
 
@@ -150,7 +152,7 @@ cat <<EOF  >$MOD_FILE
 SERV_MODULES = \\
 EOF
 
-echo modules/*/*.c | $SED "s;\.c ;.o \\\\\n;g" >> $MOD_FILE
+echo modules/*/*.c | $SED -e "s;\.c ;.o \\\\\n;g" -e "s;\.c;.o;" >> $MOD_FILE
 echo >> $MOD_FILE
 
 
@@ -170,7 +172,6 @@ cat <<EOF  >$SRC_FILE
 SOURCES = \\
 EOF
 
-
 echo modules/*/*.c | $SED "s;\.c ;.c \\\\\n;g" >> $SRC_FILE
 echo >> $SRC_FILE
 
@@ -213,7 +214,7 @@ EOF
 
 # Add this entry point to the .c file
 
-grep CTDL_MODULE_UPGRADE *.c modules/*/*.c  |$SED 's;.*(\(.*\));\tpMod = CTDL_UPGRADE_CALL(\1)\;\n\tMOD_syslog(LOG_INFO, "%s\\n", pmod)\;\n;' >> $U_FILE
+grep CTDL_MODULE_UPGRADE *.c modules/*/*.c  |$SED 's;.*(\(.*\));\tpMod = CTDL_UPGRADE_CALL(\1)\;\n\tMOD_syslog(LOG_INFO, "%s\\n", pMod)\;\n;' >> $U_FILE
 
 #close the upgrade file
 /usr/bin/printf "}\n" >> $U_FILE