[asterisk-commits] branch group/autoconf_and_menuselect r11037 - in /team/group/autoconf_and_men...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Feb 24 12:53:36 MST 2006


Author: russell
Date: Fri Feb 24 13:53:29 2006
New Revision: 11037

URL: http://svn.digium.com/view/asterisk?rev=11037&view=rev
Log:
make it so the main Makefile can inclue menuselect-deps

Modified:
    team/group/autoconf_and_menuselect/Makefile
    team/group/autoconf_and_menuselect/apps/Makefile
    team/group/autoconf_and_menuselect/autoconf/menuselect-deps.in
    team/group/autoconf_and_menuselect/build_tools/menuselect.c
    team/group/autoconf_and_menuselect/cdr/Makefile
    team/group/autoconf_and_menuselect/channels/Makefile
    team/group/autoconf_and_menuselect/formats/Makefile
    team/group/autoconf_and_menuselect/pbx/Makefile
    team/group/autoconf_and_menuselect/res/Makefile
    team/group/autoconf_and_menuselect/utils/Makefile

Modified: team/group/autoconf_and_menuselect/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/Makefile (original)
+++ team/group/autoconf_and_menuselect/Makefile Fri Feb 24 13:53:29 2006
@@ -185,7 +185,10 @@
 
 ifneq ($(wildcard menuselect.makeopts),)
   include menuselect.makeopts
-  ASTCFLAGS+= $(MAKEOPTS_CFLAGS)
+endif
+
+ifneq ($(wildcard autoconf/menuselect-deps),)
+  include autoconf/menuselect-deps
 endif
 
 ifeq ($(OSARCH),Linux)
@@ -436,7 +439,7 @@
 
 CFLAGS+=-DT38_SUPPORT
 
-_all: all
+_all: menuselect-deps all
 	@echo " +--------- Asterisk Build Complete ---------+"  
 	@echo " + Asterisk has successfully been built, but +"  
 	@echo " + cannot be run before being installed by   +"  
@@ -446,6 +449,9 @@
 	@echo " +-------------------------------------------+"  
 
 all: cleantest depend asterisk subdirs 
+
+menuselect-deps:
+	@test -f autoconf/menuselect-deps || ( echo "You must run ./configure before building Asterisk!" && exit 1 )
 
 #ifneq ($(wildcard tags),)
 ctags: tags

Modified: team/group/autoconf_and_menuselect/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/Makefile (original)
+++ team/group/autoconf_and_menuselect/apps/Makefile Fri Feb 24 13:53:29 2006
@@ -14,6 +14,25 @@
 MODS:=$(patsubst %.c,%.so,$(wildcard app_*.c))
 
 MODS:=$(filter-out $(MENUSELECT_APPS),$(MODS))
+
+#
+# Experimental things
+#
+MODS:=$(filter-out app_ivrdemo.so,$(MODS))
+MODS:=$(filter-out app_skel.so,$(MODS))
+MODS:=$(filter-out app_rpt.so,$(MODS))
+
+ifndef WITHOUT_ZAPTEL
+ZAPAVAIL:=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)
+endif
+
+ifeq (${ZAPAVAIL},)
+  MODS:=$(filter-out app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so,$(MODS))
+endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+  MODS:=$(filter-out app_osplookup.so,$(MODS))
+endif
 
 ifneq (${WITH_SMDI},)
   CFLAGS+=-DWITH_SMDI

Modified: team/group/autoconf_and_menuselect/autoconf/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/autoconf/menuselect-deps.in?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/autoconf/menuselect-deps.in (original)
+++ team/group/autoconf_and_menuselect/autoconf/menuselect-deps.in Fri Feb 24 13:53:29 2006
@@ -1,40 +1,24 @@
-<?xml version="1.0"?>
-
-<oggvorbis>@PBX_OGGVORBIS@</oggvorbis>
-<zaptel>@PBX_ZAPTEL@</zaptel>
-<unixodbc>@PBX_UNIXODBC@</unixodbc>
-<pgsql>@PBX_PGSQL@</pgsql>
-<sqlite>@PBX_SQLITE@</sqlite>
-<freetds>@PBX_FREETDS@</freetds>
-
-<asound>@PBX_ASOUND@</asound>
-
-<vpbapi>@PBX_VPBAPI@</vpbapi>
-<nbs>@PBX_NBS@</nbs>
-
-<ossaudio>@PBX_OSSAUDIO@</ossaudio>
-
-<libpri>@PBX_LIBPRI@</libpri>
-
-<libmfcr2>@PBX_LIBMFCR2@</libmfcr2>
-
-<libspeex>@PBX_LIBSPEEX@</libspeex>
-
-<libvorbis>@PBX_LIBVORBIS@</libvorbis>
-
-<libosptk>@PBX_LIBOSPTK@</libosptk>
-
-<libpopt>@PBX_LIBPOPT@</libpopt>
-<libnewt>@PBX_LIBNEWT@</libnewt>
-
-<poll>@PBX_POLL@</poll>
-
-<ptlib>@PBX_PTLIB@</ptlib>
-<h323>@PBX_H323@</h323>
-
-<curl>@PBX_CURL@</curl>
-<gtk>@PBX_GTK@</gtk>
-
-<qt>@PBX_QT@</qt>
-<kde>@PBX_KDE@</kde>
-
+ASOUND=@PBX_ASOUND@
+CURL=@PBX_CURL@
+FREETDS=@PBX_FREETDS@
+GTK=@PBX_GTK@
+H323=@PBX_H323@
+KDE=@PBX_KDE@
+LIBMFCR2=@PBX_LIBMFCR2@
+LIBNEWT=@PBX_LIBNEWT@
+LIBOSPTK=@PBX_LIBOSPTK@
+LIBPOPT=@PBX_LIBPOPT@
+LIBPRI=@PBX_LIBPRI@
+LIBSPEEX=@PBX_LIBSPEEX@
+LIBVORBIS=@PBX_LIBVORBIS@
+NBS=@PBX_NBS@
+OGGVORBIS=@PBX_OGGVORBIS@
+OSSAUDIO=@PBX_OSSAUDIO@
+PGSQL=@PBX_PGSQL@
+POLL=@PBX_POLL@
+PTLIB=@PBX_PTLIB@
+QT=@PBX_QT@
+SQLITE=@PBX_SQLITE@
+UNIXODBC=@PBX_UNIXODBC@
+VPBAPI=@PBX_VPBAPI@
+ZAPTEL=@PBX_ZAPTEL@

Modified: team/group/autoconf_and_menuselect/build_tools/menuselect.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/build_tools/menuselect.c?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/menuselect.c (original)
+++ team/group/autoconf_and_menuselect/build_tools/menuselect.c Fri Feb 24 13:53:29 2006
@@ -310,42 +310,65 @@
 	struct category *cat;
 	struct member *mem;
 	struct depend *dep;
-	mxml_node_t *root, *curnode;
 	FILE *f;
+	struct dep_file {
+		char name[32];
+		int met;
+		AST_LIST_ENTRY(dep_file) list;
+	} *dep_file;
+	AST_LIST_HEAD_NOLOCK_STATIC(deps_file, dep_file);
+	char buf[80];
+	char *p;
 
 	if (!(f = fopen(MENUSELECT_DEPS, "r"))) {
 		fprintf(stderr, "Unable to open '%s' for reading!  Did you run ./configure ?\n", MENUSELECT_DEPS);
 		return -1;
 	}
 
-	if (!(root = mxmlLoadFile(NULL, f, MXML_OPAQUE_CALLBACK))) {
-		close(f);
-		return -1;
-	}
-
+	/* Build a dependency list from the file generated by configure */	
+	memset(buf, 0, sizeof(buf));
+	while (fgets(buf, sizeof(buf), f)) {
+		p = buf;
+		strsep(&p, "=");
+		if (!p)
+			continue;
+		if (!(dep_file = my_calloc(1, sizeof(*dep_file))))
+			break;
+		strncpy(dep_file->name, buf, sizeof(dep_file->name) - 1);
+		dep_file->met = !strcmp(p, "1");
+		AST_LIST_INSERT_TAIL(&deps_file, dep_file, list);
+		memset(buf, 0, sizeof(buf));
+	}
+
+	close(f);
+
+	/* Process dependencies of all modules */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
 			AST_LIST_TRAVERSE(&mem->deps, dep, list) {
 				mem->depsfailed = 1;
-				curnode = mxmlFindElement(root, root, dep->name, NULL, NULL, MXML_DESCEND);
-				if (curnode && curnode->child && !strcasecmp("1", curnode->child->value.opaque)) {
-					mem->depsfailed = 0;
-					continue; /* This dependency is matched, so keep checking */
+				AST_LIST_TRAVERSE(&deps_file, dep_file, list) {
+					if (!strcasecmp(dep_file->name, dep->name)) {
+						if (dep_file->met)
+							mem->depsfailed = 0;
+						break;
+					}
 				}
-				break; /* This depencency is not met, no need to keep checking */
+				if (mem->depsfailed)
+					break; /* This dependency is not met, so we can stop now */
 			}
 			if (mem->depsfailed)
-				mem->enabled = 0;
-		}
-	}
-
-
-	/* We save all of the other trees because we use them later.  We don't need this tree anymore. */
-	mxmlDelete(root);
-
-	close(f);
-
-	return 0;
+				mem->enabled = 0; /* Automatically disable it if dependencies not met */
+		}
+	}
+
+	/* Free the dependency list we built from the file */
+	AST_LIST_TRAVERSE_SAFE_BEGIN(&deps_file, dep_file, list) {
+		free(dep_file);
+	}
+	AST_LIST_TRAVERSE_SAFE_END
+
+	return 0;	
 }
 
 /*! \brief Iterate through all of the input makeopts files and call the parse function on them */

Modified: team/group/autoconf_and_menuselect/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/cdr/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/cdr/Makefile (original)
+++ team/group/autoconf_and_menuselect/cdr/Makefile Fri Feb 24 13:53:29 2006
@@ -15,7 +15,20 @@
 
 MODS:=$(filter-out $(MENUSELECT_CDR),$(MODS))
 
-ifeq ($(findstring cdr_tds.so,$(MODS)),)
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
+  MODS:=$(filter-out cdr_odbc.so,$(MODS))
+endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include $(CROSS_COMPILE_TARGET)/usr/include/pgsql $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql $(CROSS_COMPILE_TARGET)/opt/pgsql/include $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+  MODS:=$(filter-out cdr_pgsql.so,$(MODS))
+endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sqlite.h),)
+  MODS:=$(filter-out cdr_sqlite.so,$(MODS))
+endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tds.h),)
+  MODS:=$(filter-out cdr_tds.so,$(MODS))
   NOTDS=1
 endif
 

Modified: team/group/autoconf_and_menuselect/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/Makefile (original)
+++ team/group/autoconf_and_menuselect/channels/Makefile Fri Feb 24 13:53:29 2006
@@ -72,6 +72,10 @@
 CFLAGS+=-DWITH_SMDI
 endif
 
+ifeq ($(wildcard h323/libchanh323.a),)
+  MODS:=$(filter-out chan_h323.so,$(MODS))
+endif
+
 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),)
   MODS:=$(filter-out chan_misdn.so,$(MODS))
 else
@@ -79,6 +83,10 @@
 endif
 
 CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/alsa/asoundlib.h),)
+  MODS:=$(filter-out chan_alsa.so,$(MODS))
+endif
 
 ifndef WITHOUT_PRI
 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1 $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
@@ -115,6 +123,12 @@
   CFLAGS+=-DIAX_TRUNKING
 endif
 
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/vpbapi.h),)
+  MODS:=$(filter-out chan_vpb.so,$(MODS))
+else
+  CFLAGS+=-DLINUX
+endif
+
 CFLAGS+=-DCRYPTO
 
 ifneq ($(OSARCH),CYGWIN)
@@ -124,6 +138,10 @@
 CFLAGS+=#-DVOFRDUMPER
 
 ZAPDIR=/usr/lib
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/nbs.h),)
+  MODS:=$(filter-out chan_nbs.so,$(MODS))
+endif
 
 ifndef OPENH323DIR
   OPENH323DIR=$(HOME)/openh323

Modified: team/group/autoconf_and_menuselect/formats/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/formats/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/formats/Makefile (original)
+++ team/group/autoconf_and_menuselect/formats/Makefile Fri Feb 24 13:53:29 2006
@@ -14,6 +14,13 @@
 MODS:=$(patsubst %.c,%.so,$(wildcard format_*.c))
 
 MODS:=$(filter-out $(MENUSELECT_FORMATS),$(MODS))
+
+#
+# OGG/Vorbis format
+#
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/vorbis/codec.h),)
+  MODS:=$(filter-out format_ogg_vorbis.so,$(MODS))
+endif
 
 GSMLIB=../codecs/gsm/lib/libgsm.a
 

Modified: team/group/autoconf_and_menuselect/pbx/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/pbx/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/pbx/Makefile (original)
+++ team/group/autoconf_and_menuselect/pbx/Makefile Fri Feb 24 13:53:29 2006
@@ -14,6 +14,16 @@
 MODS:=$(patsubst %.c,%.so,$(wildcard pbx_*.c))
 
 MODS:=$(filter-out $(MENUSELECT_PBX),$(MODS))
+
+#GTK=$(shell $(CROSS_COMPILE_BIN)gtk-config --cflags >/dev/null 2>/dev/null && echo "OK")
+ifeq (${GTK},)
+  MODS:=$(filter-out pbx_gtkconsole.so,$(MODS))
+endif
+
+#KDE=$(shell [ "$$QTDIR" != "" ] && echo "OK")
+ifeq (${GTK},)
+  MODS:=$(filter-out pbx_kdeconsole.so,$(MODS))
+endif
 
 GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
 GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`

Modified: team/group/autoconf_and_menuselect/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/res/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/res/Makefile (original)
+++ team/group/autoconf_and_menuselect/res/Makefile Fri Feb 24 13:53:29 2006
@@ -15,7 +15,10 @@
 
 MODS:=$(filter-out $(MENUSELECT_RES),$(MODS))
 
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
+  MODS:=$(filter-out res_odbc.so,$(MODS))
+  MODS:=$(filter-out res_config_odbc.so,$(MODS))
+else
   ifeq (${OSARCH},FreeBSD)
     MODS:=$(filter-out $(shell if test ${BSDVERSION} -lt 500000 ; then echo "res_config_odbc.so"; fi),$(MODS))
   endif
@@ -27,6 +30,13 @@
 endif
 
 OSPLIB:=$(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libosptk.a $(CROSS_COMPILE_TARGET)/usr/local/lib/libosptk.a)
+ifeq (${OSPLIB},)
+  MODS:=$(filter-out res_osp.so,$(MODS))
+endif
+
+ifeq (${WITH_SMDI},)
+  MODS:=$(filter-out res_smdi.so,$(MODS))
+endif
 
 ifeq (${OSARCH},CYGWIN)
   CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols

Modified: team/group/autoconf_and_menuselect/utils/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/utils/Makefile?rev=11037&r1=11036&r2=11037&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/utils/Makefile (original)
+++ team/group/autoconf_and_menuselect/utils/Makefile Fri Feb 24 13:53:29 2006
@@ -16,16 +16,24 @@
 #
 CFLAGS+=-DNO_AST_MM
 
-TARGET=astman smsq stereorize streamplayer
+UTILS:=astman smsq stereorize streamplayer
 
-TARGET:=$(filter-out $(MENUSELECT_UTILS),$(TARGET))
+UTILS:=$(filter-out $(MENUSELECT_UTILS),$(UTILS))
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
+  UTILS:=$(filter-out smsq,$(UTILS))
+endif
+
+ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
+  UTILS:=$(filter-out astman,$(UTILS))
+endif
 
 ifeq (${OSARCH},SunOS)
   SOL=../strcompat.o
   SOLLIBS=-lsocket -lnsl
 endif
 
-all: depend $(TARGET)
+all: depend $(UTILS)
 
 install:
 	for x in $(TARGET); do \
@@ -35,7 +43,7 @@
 	done 
 
 uninstall:
-	for x in $(TARGET); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done
+	for x in $(UTILS); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done
 
 clean-depend:
 	rm -f .depend



More information about the asterisk-commits mailing list