[svn-commits] trunk r1179 - in /trunk: ./ build_tools/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Jun 26 07:18:43 MST 2006


Author: russell
Date: Mon Jun 26 09:18:42 2006
New Revision: 1179

URL: http://svn.digium.com/view/zaptel?rev=1179&view=rev
Log:
merge autoconf and menuselect support for zaptel

Happy birthday to me :)

Added:
    trunk/acinclude.m4
      - copied unchanged from r1178, team/group/menuselect/acinclude.m4
    trunk/aclocal.m4
      - copied unchanged from r1178, team/group/menuselect/aclocal.m4
    trunk/bootstrap.sh
      - copied unchanged from r1178, team/group/menuselect/bootstrap.sh
    trunk/build_tools/make_version
      - copied unchanged from r1178, team/group/menuselect/build_tools/make_version
    trunk/build_tools/menuselect-deps.in
      - copied unchanged from r1178, team/group/menuselect/build_tools/menuselect-deps.in
    trunk/config.guess
      - copied unchanged from r1178, team/group/menuselect/config.guess
    trunk/config.sub
      - copied unchanged from r1178, team/group/menuselect/config.sub
    trunk/configure
      - copied unchanged from r1178, team/group/menuselect/configure
    trunk/configure.ac
      - copied unchanged from r1178, team/group/menuselect/configure.ac
    trunk/install-sh
      - copied unchanged from r1178, team/group/menuselect/install-sh
    trunk/makeopts.in
      - copied unchanged from r1178, team/group/menuselect/makeopts.in
    trunk/makeopts.xml
      - copied unchanged from r1178, team/group/menuselect/makeopts.xml
Modified:
    trunk/   (props changed)
    trunk/Makefile
    trunk/build_tools/   (props changed)

Propchange: trunk/
------------------------------------------------------------------------------
--- svn:externals (added)
+++ svn:externals Mon Jun 26 09:18:42 2006
@@ -1,0 +1,2 @@
+menuselect     http://svn.digium.com/svn/menuselect/trunk
+mxml	       http://svn.digium.com/svn/mxml/trunk

Propchange: trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jun 26 09:18:42 2006
@@ -1,3 +1,5 @@
+sethdlc-new
+ztdiag
 zttool
 ztspeed
 ztmonitor
@@ -23,4 +25,10 @@
 version.h
 vpm450m_fw.h
 fw2h
-
+autom4te.cache
+missing
+makeopts
+menuselect.makeopts
+menuselect.makedeps
+config.log
+config.status

Modified: trunk/Makefile
URL: http://svn.digium.com/view/zaptel/trunk/Makefile?rev=1179&r1=1178&r2=1179&view=diff
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Mon Jun 26 09:18:42 2006
@@ -7,7 +7,10 @@
 
 .EXPORT_ALL_VARIABLES:
 
+.PHONY: menuselect distclean dist-clean clean
+
 HOSTCC=gcc
+CC=gcc
 ifeq ($(PWD),)
 PWD=$(shell pwd)
 endif
@@ -56,6 +59,23 @@
   endif
 endif
 
+# If the file .zaptel.makeopts is present in your home directory, you can
+# include all of your favorite menuselect options so that every time you download
+# a new version of Asterisk, you don't have to run menuselect to set them.
+# The file /etc/zaptel.makeopts will also be included but can be overridden
+# by the file in your home directory.
+
+GLOBAL_MAKEOPTS=$(wildcard /etc/zaptel.makeopts)
+USER_MAKEOPTS=$(wildcard ~/.zaptel.makeopts)
+
+ifneq ($(wildcard menuselect.makeopts),)
+  include menuselect.makeopts
+endif
+
+ifneq ($(wildcard makeopts),)
+  include makeopts
+endif
+
 #
 # Features are now configured in zconfig.h
 #
@@ -107,14 +127,11 @@
 LIBTONEZONE_SO_MAJOR_VER:=1
 LIBTONEZONE_SO_MINOR_VER:=0
 
-MODULES:=zaptel tor2 torisa wcusb wcfxo wctdm wctdm24xxp \
-	 ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp pciradio \
-         ztd-loc zttranscode
-#MODULES+=wcfxsusb
-# build ztdummy by default for 2.6 kernels
-ifeq ($(BUILDVER),linux26)
-MODULES+=ztdummy
-endif
+ifneq ($(findstring xpp,$(MENUSELECT_MODULES)),)
+  BUILD_XPP=yes
+  MENUSELECT_MODULES:=$(filter-out xpp,$(MENUSELECT_MODULES))
+endif
+MODULES:=$(MENUSELECT_MODULES)
 
 MODULESO:=$(MODULES:%=%.o)
 MODULESKO:=$(MODULES:%=%.ko)
@@ -140,19 +157,18 @@
 # This line is only meaningful when this Makefile is used as kconfig for 
 # 2.6 build
 
-ifneq (,$(shell [ 0$(SUBLEVEL) -ge 10 ] && [ "$(ARCH)" = 'i386' ] && echo 1))
+ifneq (,$(shell [ 0$(SUBLEVEL) -ge 10 ] && [ "$(ARCH)" = 'i386' ] && [ "x$(BUILD_XPP)" = "xyes" ] && echo 1))
 obj-m+=xpp/
 endif
 
-ifneq (,$(wildcard /usr/include/newt.h))
-ZTTOOL:=zttool
-endif
-BINS:=ztcfg ztmonitor ztspeed $(ZTTOOL) zttest fxotune
-UTILS:=tor2ee ztspeed zttool ztmonitor sethdlc-new \
-  usbfxstest fxstest fxotune fxsdump ztdiag
+BINS:=$(MENUSELECT_UTILS)
+UTILS:=$(filter-out zttool fxstest ztcfg,$(MENUSELECT_UTILS))
 UTILSO:=$(UTILS:%=%.o)
 
-all: modules $(LIBTONEZONE_SO)
+all: menuselect.makeopts 
+	@$(MAKE) _all
+
+_all: modules $(LIBTONEZONE_SO)
 
 programs: $(BINS)
 
@@ -242,9 +258,10 @@
 
 zaptel.c: tones.h 
 
-prereq: tones.h tor2fw.h radfw.h version.h
+prereq: config.status tones.h tor2fw.h radfw.h version.h
 
 zttool.o: zttool.c zaptel.h
+	$(CC) -g -c $(NEWT_INCLUDE) $(CFLAGS) -o $@ $<
 
 ztprovision.o: ztprovision.c zaptel.h
 
@@ -252,7 +269,7 @@
 
 ztspeed: CFLAGS=
 ztspeed.o: CFLAGS=
-zttool: LDFLAGS+=-lnewt
+zttool: LDFLAGS+=$(NEWT_LIB)
 sethdlc-new.o: CFLAGS+=-I$(KINCLUDES)
 
 libtonezone.a: $(TZOBJS)
@@ -336,13 +353,13 @@
 endif
 
 install: all devices
-	install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg
+	$(INSTALL) -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg
 	if [ -f sethdlc-new ]; then \
-		install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \
+		$(INSTALL) -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \
 	elif [ -f sethdlc ]; then \
-		install -D -m 755 sethdlc $(INSTALL_PREFIX)/sbin/sethdlc ; \
-	fi
-	if [ -f zttool ]; then install -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; fi
+		$(INSTALL) -D -m 755 sethdlc $(INSTALL_PREFIX)/sbin/sethdlc ; \
+	fi
+	if [ -f zttool ]; then $(INSTALL) -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; fi
 ifeq ($(BUILDVER),linux26)
 	for x in $(MODULESKO); do \
 		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/extra/$$x ; \
@@ -355,30 +372,30 @@
 	fi
 else
 	for x in $(MODULESO); do \
-		install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/$$x ; \
+		$(INSTALL) -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/$$x ; \
 	done
 endif
 	if ! [ -f wcfxsusb.o ]; then \
 		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.o; \
 	fi; \
 	rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o
-	install -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
+	$(INSTALL) -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
 	[ `id -u` = 0 ] && /sbin/ldconfig || :
 	rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
-	ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
+	$(LN) -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
 		$(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER)
-	ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
+	$(LN) -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
 		$(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
 	if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi
-	install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/zaptel.h
-	install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/torisa.h
+	$(INSTALL) -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/zaptel.h
+	$(INSTALL) -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/torisa.h
 	rm -f $(INSTALL_PREFIX)/usr/include/linux/zaptel.h
 	rm -f $(INSTALL_PREFIX)/usr/include/linux/torisa.h
-	install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
-	install -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
-	install -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8
+	$(INSTALL) -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
+	$(INSTALL) -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
+	$(INSTALL) -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8
 	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
-	[ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
+	[ -f $(CONFIG_FILE) ] || $(INSTALL) -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
 	build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel,$(MODULES))"
 	@if [ -d /etc/modutils ]; then \
 		/sbin/update-modules ; \
@@ -388,20 +405,20 @@
 
 config:
 	if [ -d $(INSTALL_PREFIX)/etc/rc.d/init.d ]; then \
-		install -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/rc.d/init.d/zaptel; \
+		$(INSTALL) -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/rc.d/init.d/zaptel; \
 		$(CHKCONFIG) --add zaptel; \
 	elif [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \
-		install -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \
+		$(INSTALL) -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \
 		$(CHKCONFIG) --add zaptel; \
 	fi 
 	if [ -d /etc/default ] && [ ! -f /etc/default/zaptel ]; then \
-			install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/default/zaptel; \
+			$(INSTALL) -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/default/zaptel; \
 	fi
 	if [ -d /etc/sysconfig ] && [ ! -f /etc/sysconfig/zaptel ]; then \
-		install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \
+		$(INSTALL) -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \
 	fi
 	if [ -d /etc/sysconfig/network-scripts ]; then \
-		install -D -m 755 ifup-hdlc $(INSTALL_PREFIX)/etc/sysconfig/network-scripts/ifup-hdlc; \
+		$(INSTALL) -D -m 755 ifup-hdlc $(INSTALL_PREFIX)/etc/sysconfig/network-scripts/ifup-hdlc; \
 	fi
 
 update:
@@ -409,9 +426,9 @@
 		echo "Updating from Subversion..." ; \
 		svn update | tee update.out; \
 		rm -f .version; \
-		if [ `grep -c ^C update.out` -gt 0 ]; then \
+		if [ `$(GREP) -c ^C update.out` -gt 0 ]; then \
 			echo ; echo "The following files have conflicts:" ; \
-			grep ^C update.out | cut -b4- ; \
+			$(GREP) ^C update.out | cut -b4- ; \
 		fi ; \
 		rm -f update.out; \
 	else \
@@ -420,23 +437,24 @@
 
 # make should *fail* and not silently succeed if a program did not build
 install-programs: $(BINS) $(LIBTONEZONE) libtonezone.a
-	install -d $(BIN_DIR)
-	install $(BINS) $(BIN_DIR)
-	install -d $(LIB_DIR)
-	install -m 755 $(LIBTONEZONE) libtonezone.a $(LIB_DIR)
-	install -d $(INC_DIR)/linux
-	install -m 644 tonezone.h $(INC_DIR)
-	install -m 644 zaptel.h torisa.h $(INC_DIR)/linux
+	$(INSTALL) -d $(BIN_DIR)
+	$(INSTALL) $(BINS) $(BIN_DIR)
+	$(INSTALL) -d $(LIB_DIR)
+	$(INSTALL) -m 755 $(LIBTONEZONE) libtonezone.a $(LIB_DIR)
+	$(INSTALL) -d $(INC_DIR)/linux
+	$(INSTALL) -m 644 tonezone.h $(INC_DIR)
+	$(INSTALL) -m 644 zaptel.h torisa.h $(INC_DIR)/linux
 
 install-modules: install-$(BUILDVER)
 install-linux24: vpm450m_fw.h.o$(MODULES_BUILD)
-	install -d $(MOD_DIR)
-	install -m 644 $(MODULES_BUILD) $(MOD_DIR)
+	$(INSTALL) -d $(MOD_DIR)
+	$(INSTALL) -m 644 $(MODULES_BUILD) $(MOD_DIR)
 
 install-linux26: $(MODULESKO)
 	$(KMAKE_INST)
 
 clean:
+	@$(MAKE) -C menuselect clean
 	rm -f torisatool makefw tor2fw.h radfw.h fw2h
 	rm -f $(BINS)
 	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
@@ -458,4 +476,32 @@
 	rm -rf mISDNuser*
 	rm -f fw2h vpm450m_fw.h
 
+distclean: dist-clean
+
+dist-clean: clean
+	@$(MAKE) -C menuselect dist-clean
+	@$(MAKE) -C mxml clean
+	rm -f makeopts menuselect.makeopts
+	rm -f config.log config.status
 FORCE:
+
+config.status: configure
+	@CFLAGS="" ./configure
+	@echo "****"
+	@echo "**** The configure script was just executed, so 'make' needs to be"
+	@echo "**** restarted."
+	@echo "****"
+	@exit 1
+
+menuselect.makeopts: menuselect/menuselect makeopts.xml
+	@menuselect/menuselect --check-deps ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} $@
+
+menuselect: menuselect/menuselect
+	- at menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
+
+menuselect/menuselect: menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect.h menuselect/linkedlists.h config.status mxml/libmxml.a
+	@CFLAGS="" $(MAKE) -C menuselect menuselect
+
+mxml/libmxml.a:
+	@cd mxml && unset CFLAGS LIBS && test -f config.h || ./configure
+	$(MAKE) -C mxml libmxml.a

Propchange: trunk/build_tools/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jun 26 09:18:42 2006
@@ -1,0 +1,1 @@
+menuselect-deps



More information about the svn-commits mailing list