[asterisk-commits] trunk r34492 - in /trunk: apps/ build_tools/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jun 16 09:17:44 MST 2006


Author: russell
Date: Fri Jun 16 11:17:43 2006
New Revision: 34492

URL: http://svn.digium.com/view/asterisk?rev=34492&view=rev
Log:
add support for setting the CFLAGS for voicemail storage options in menuselect

Thanks to kpfleming for the Makefile magic :)

Added:
    trunk/build_tools/get_makeopts   (with props)
    trunk/build_tools/get_moduleinfo   (with props)
Removed:
    trunk/build_tools/get_moduledeps
Modified:
    trunk/apps/Makefile
    trunk/apps/app_voicemail.c
    trunk/build_tools/prep_moduledeps

Modified: trunk/apps/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/apps/Makefile?rev=34492&r1=34491&r2=34492&view=diff
==============================================================================
--- trunk/apps/Makefile (original)
+++ trunk/apps/Makefile Fri Jun 16 11:17:43 2006
@@ -15,16 +15,9 @@
 
 SELECTED_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
 
-# If you have UnixODBC you can use ODBC voicemail
-# storage
-#
-# Uncomment to use ODBC storage
-#CFLAGS+=-DUSE_ODBC_STORAGE
-# Uncomment for extended ODBC voicemail storage
-#CFLAGS+=-DEXTENDED_ODBC_STORAGE
-# See doc/README.odbcstorage for more information
+MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
 
-MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
+app_voicemail.o: CFLAGS+=$(patsubst %,-D%,$(MENUSELECT_app_voicemail))
 
 all: $(MODS)
 

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=34492&r1=34491&r2=34492&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri Jun 16 11:17:43 2006
@@ -40,6 +40,23 @@
  * 12-04-2006 : Support for Polish added by DIR (www.dir.pl)
  *				 Bartosz Supczinski <Bartosz.Supczinski at dir.pl>
  */
+
+/*** MAKEOPTS
+<category name="MENUSELECT_app_voicemail" displayname="Voicemail Build Options" positive_output="yes" force_clean_on_change="yes">
+	<member name="IMAP_STORAGE" displayname="Storage of Voicemail using IMAP">
+		<depend>cc-client</depend>
+		<defaultenabled>no</defaultenabled>
+	</member>
+	<member name="ODBC_STORAGE" displayname="Storage of Voicemail using ODBC">
+		<depend>unixodbc</depend>
+		<defaultenabled>no</defaultenabled>
+	</member>
+	<member name="EXTENDED_ODBC_STORAGE" displayname="Storage of Voicemail using ODBC (extended)">
+		<depend>unixodbc</depend>
+		<defaultenabled>no</defaultenabled>
+	</member>
+</category>
+ ***/
 
 #include "asterisk.h"
 
@@ -77,7 +94,7 @@
 #include "asterisk/stringfields.h"
 #include "asterisk/smdi.h"
 #define SMDI_MWI_WAIT_TIMEOUT 1000 /* 1 second */
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 #include "asterisk/res_odbc.h"
 #endif
 
@@ -289,7 +306,7 @@
 
 static void apply_options(struct ast_vm_user *vmu, const char *options);
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 static char odbc_database[80];
 static char odbc_table[80];
 #define RETRIEVE(a,b) retrieve_file(a,b)
@@ -838,7 +855,7 @@
 }
 
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 static int retrieve_file(char *dir, int msgnum)
 {
 	int x = 0;
@@ -1290,7 +1307,7 @@
 		}
 		fdlen = lseek(fd, 0, SEEK_END);
 		lseek(fd, 0, SEEK_SET);
-		printf("Length is %d\n", fdlen);
+		printf("Length is %zd\n", fdlen);
 		fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED,fd, 0);
 		if (!fdm) {
 			ast_log(LOG_WARNING, "Memory map failed!\n");
@@ -2015,7 +2032,7 @@
 	return (id >= 0 && id < (sizeof(msgs)/sizeof(msgs[0]))) ? msgs[id] : "Unknown";
 }
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
 {
 	int x = -1;
@@ -6183,7 +6200,7 @@
 			astsearch = "no";
 		ast_set2_flag((&globalflags), ast_true(astsearch), VM_SEARCH);
 
-#ifdef USE_ODBC_STORAGE
+#ifdef ODBC_STORAGE
 		strcpy(odbc_database, "asterisk");
 		if ((thresholdstr = ast_variable_retrieve(cfg, "general", "odbcstorage"))) {
 			ast_copy_string(odbc_database, thresholdstr, sizeof(odbc_database));
@@ -6614,7 +6631,7 @@
 
 	ast_install_vm_functions(has_voicemail, inboxcount, messagecount);
 
-#if defined(USE_ODBC_STORAGE) && !defined(EXTENDED_ODBC_STORAGE)
+#if defined(ODBC_STORAGE) && !defined(EXTENDED_ODBC_STORAGE)
 	ast_log(LOG_WARNING, "The current ODBC storage table format will be changed soon."
 				"Please update your tables as per the README and edit the apps/Makefile "
 				"and uncomment the line containing EXTENDED_ODBC_STORAGE to enable the "

Added: trunk/build_tools/get_makeopts
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/get_makeopts?rev=34492&view=auto
==============================================================================
--- trunk/build_tools/get_makeopts (added)
+++ trunk/build_tools/get_makeopts Fri Jun 16 11:17:43 2006
@@ -1,0 +1,3 @@
+/\/\*\*\* MAKEOPTS/ {printit=1; next}
+/\*\*\*\// {exit}
+// {if (printit) print}

Propchange: trunk/build_tools/get_makeopts
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/build_tools/get_makeopts
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/build_tools/get_makeopts
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: trunk/build_tools/get_moduleinfo
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/get_moduleinfo?rev=34492&view=auto
==============================================================================
--- trunk/build_tools/get_moduleinfo (added)
+++ trunk/build_tools/get_moduleinfo Fri Jun 16 11:17:43 2006
@@ -1,0 +1,3 @@
+/\/\*\*\* MODULEINFO/ {printit=1; next}
+/\*\*\*\// {exit}
+// {if (printit) print}

Propchange: trunk/build_tools/get_moduleinfo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/build_tools/get_moduleinfo
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/build_tools/get_moduleinfo
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: trunk/build_tools/prep_moduledeps
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/prep_moduledeps?rev=34492&r1=34491&r2=34492&view=diff
==============================================================================
--- trunk/build_tools/prep_moduledeps (original)
+++ trunk/build_tools/prep_moduledeps Fri Jun 16 11:17:43 2006
@@ -39,15 +39,21 @@
 		get_description ${file}
 		desc=${TDESC}
 		echo -e "\t\t<member name=\"${fname%%.c}\" displayname=\"${desc}\">"
-		awk -f build_tools/get_moduledeps ${file}
+		awk -f build_tools/get_moduleinfo ${file}
 		echo -e "\t\t</member>"
 	done
 	echo -e "\t</category>"
+
+	for file in ${dir}/${prefix}*.c
+	do
+		awk -f build_tools/get_makeopts ${file} >> .makeoptstmp
+	done
 }
 
 echo "<?xml version="1.0"?>"
 echo
 echo "<menu>"
+rm -f .makeoptstmp
 process_dir apps app APPS Applications
 process_dir cdr cdr CDR "Call Detail Recording"
 process_dir channels chan CHANNELS "Channel Drivers"
@@ -58,4 +64,6 @@
 process_dir res res RES "Resource Modules"
 cat build_tools/cflags.xml
 cat sounds/sounds.xml
+cat .makeoptstmp
+rm -f .makeoptstmp
 echo "</menu>"



More information about the asterisk-commits mailing list