From 01f0481db1542c0a8ef47b951f74c006d189e567 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 8 Feb 2006 00:57:35 +0000 Subject: [PATCH] Build system cleanup, initial piece of automatic build test system (thanks xachen) minor mod- I kept build.sh in the root dir for now. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@560 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- Makefile.am | 18 +++++++++--------- Makefile.in | 18 +++++++++--------- build/build.sh | 1 + buildlib.sh => build/buildlib.sh | 0 checkversion.sh => build/checkversion.sh | 0 modmake.sh => build/modmake.sh | 0 build/thisbuild-init.sh | 11 +++++++++++ src/mod/codecs/mod_g729/Makefile | 2 +- src/mod/codecs/mod_gsm/Makefile | 2 +- src/mod/codecs/mod_ilbc/Makefile | 2 +- src/mod/codecs/mod_speex/Makefile | 2 +- src/mod/dialplans/mod_pcre/Makefile | 2 +- src/mod/endpoints/mod_exosip/Makefile | 6 +++--- src/mod/endpoints/mod_iax/Makefile | 2 +- src/mod/endpoints/mod_portaudio/Makefile | 2 +- src/mod/event_handlers/mod_xmpp_event/Makefile | 2 +- src/mod/formats/mod_sndfile/Makefile | 2 +- 17 files changed, 42 insertions(+), 30 deletions(-) create mode 100755 build/build.sh rename buildlib.sh => build/buildlib.sh (100%) rename checkversion.sh => build/checkversion.sh (100%) rename modmake.sh => build/modmake.sh (100%) create mode 100755 build/thisbuild-init.sh diff --git a/Makefile.am b/Makefile.am index 14beb1068a..a54e0812d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -108,10 +108,10 @@ CLEANFILES = src/include/switch_version.h version: Makefile - ./checkversion.sh + ./build/checkversion.sh newversion: Makefile - ./checkversion.sh force + ./build/checkversion.sh force $(MAKE) .nodepends: @@ -123,10 +123,10 @@ yesdepends: rm .nodepends .depend: - MAKE=$(MAKE) ./buildlib.sh . install sqlite-3.2.8.tar.gz --prefix=$(PREFIX) --disable-tcl --enable-threadsafe - MAKE=$(MAKE) ./buildlib.sh . install apr-1.2.2.tar.gz --prefix=$(PREFIX) - MAKE=$(MAKE) ./buildlib.sh . install apr-util-1.2.2.tar.gz --with-apr=../apr-1.2.2 --prefix=$(PREFIX) - MAKE=$(MAKE) ./buildlib.sh . libresample-0.1.3.tgz --prefix=$(PREFIX) + MAKE=$(MAKE) ./build/buildlib.sh . install sqlite-3.2.8.tar.gz --prefix=$(PREFIX) --disable-tcl --enable-threadsafe + MAKE=$(MAKE) ./build/buildlib.sh . install apr-1.2.2.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) ./build/buildlib.sh . install apr-util-1.2.2.tar.gz --with-apr=../apr-1.2.2 --prefix=$(PREFIX) + MAKE=$(MAKE) ./build/buildlib.sh . libresample-0.1.3.tgz --prefix=$(PREFIX) cp libs/libresample-0.1.3/*.a $(PREFIX)/lib cp libs/libresample-0.1.3/include/* $(PREFIX)/include ranlib $(PREFIX)/lib/libresample.a @@ -137,10 +137,10 @@ depends: .depend modules: $(NAME) @echo making modules - @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making $$i ; MAKE=$(MAKE) DYLD_LIBRARY_PATH="$(PREFIX)/lib:$DYLD_LIBRARY_PATH" LD_LIBRARY_PATH="$(PREFIX)/lib:$LD_LIBRARY_PATH" PREFIX="$(PREFIX)" BASE="$(PWD)" OSARCH="$(OSARCH)" SOLINK="$(SOLINK)" LDFLAGS="$(AM_LDFLAGS) -lfreeswitch" CFLAGS="$(AM_CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i || exit 1; done + @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making $$i ; MAKE=$(MAKE) DYLD_LIBRARY_PATH="$(PREFIX)/lib:$DYLD_LIBRARY_PATH" LD_LIBRARY_PATH="$(PREFIX)/lib:$LD_LIBRARY_PATH" PREFIX="$(PREFIX)" BASE="$(PWD)" OSARCH="$(OSARCH)" SOLINK="$(SOLINK)" LDFLAGS="$(AM_LDFLAGS) -lfreeswitch" CFLAGS="$(AM_CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/build/modmake.sh $(PWD) $$i || exit 1; done modclean: - @cd src/mod && for i in `find . -type d -name mod_\*` ; do echo making clean $$i ; MAKE=$(MAKE) SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i clean || exit 1; done + @cd src/mod && for i in `find . -type d -name mod_\*` ; do echo making clean $$i ; MAKE=$(MAKE) SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/build/modmake.sh $(PWD) $$i clean || exit 1; done everything: install install_mod @@ -156,7 +156,7 @@ install_mod: modules @mkdir -p $(PREFIX) $(PREFIX)/conf $(PREFIX)/mod $(PREFIX)/db $(PREFIX)/bin @if [ -f .libs/$(NAME) ] ; then /bin/cp -p .libs/$(NAME) $(PREFIX)/bin ; else /bin/cp -p ./$(NAME) $(PREFIX)/bin ; fi @echo Installing Modules - @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making clean $$i ; PREFIX=$(PREFIX) MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i install || exit 1; done + @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making clean $$i ; PREFIX=$(PREFIX) MOD="$$i" $(PWD)/build/modmake.sh $(PWD) $$i install || exit 1; done @echo done dox: diff --git a/Makefile.in b/Makefile.in index 1206054875..e17c839031 100644 --- a/Makefile.in +++ b/Makefile.in @@ -984,10 +984,10 @@ uninstall-info: uninstall-info-recursive version: Makefile - ./checkversion.sh + ./build/checkversion.sh newversion: Makefile - ./checkversion.sh force + ./build/checkversion.sh force $(MAKE) .nodepends: @@ -999,10 +999,10 @@ yesdepends: rm .nodepends .depend: - MAKE=$(MAKE) ./buildlib.sh . install sqlite-3.2.8.tar.gz --prefix=$(PREFIX) --disable-tcl --enable-threadsafe - MAKE=$(MAKE) ./buildlib.sh . install apr-1.2.2.tar.gz --prefix=$(PREFIX) - MAKE=$(MAKE) ./buildlib.sh . install apr-util-1.2.2.tar.gz --with-apr=../apr-1.2.2 --prefix=$(PREFIX) - MAKE=$(MAKE) ./buildlib.sh . libresample-0.1.3.tgz --prefix=$(PREFIX) + MAKE=$(MAKE) ./build/buildlib.sh . install sqlite-3.2.8.tar.gz --prefix=$(PREFIX) --disable-tcl --enable-threadsafe + MAKE=$(MAKE) ./build/buildlib.sh . install apr-1.2.2.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) ./build/buildlib.sh . install apr-util-1.2.2.tar.gz --with-apr=../apr-1.2.2 --prefix=$(PREFIX) + MAKE=$(MAKE) ./build/buildlib.sh . libresample-0.1.3.tgz --prefix=$(PREFIX) cp libs/libresample-0.1.3/*.a $(PREFIX)/lib cp libs/libresample-0.1.3/include/* $(PREFIX)/include ranlib $(PREFIX)/lib/libresample.a @@ -1012,10 +1012,10 @@ depends: .depend modules: $(NAME) @echo making modules - @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making $$i ; MAKE=$(MAKE) DYLD_LIBRARY_PATH="$(PREFIX)/lib:$DYLD_LIBRARY_PATH" LD_LIBRARY_PATH="$(PREFIX)/lib:$LD_LIBRARY_PATH" PREFIX="$(PREFIX)" BASE="$(PWD)" OSARCH="$(OSARCH)" SOLINK="$(SOLINK)" LDFLAGS="$(AM_LDFLAGS) -lfreeswitch" CFLAGS="$(AM_CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i || exit 1; done + @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making $$i ; MAKE=$(MAKE) DYLD_LIBRARY_PATH="$(PREFIX)/lib:$DYLD_LIBRARY_PATH" LD_LIBRARY_PATH="$(PREFIX)/lib:$LD_LIBRARY_PATH" PREFIX="$(PREFIX)" BASE="$(PWD)" OSARCH="$(OSARCH)" SOLINK="$(SOLINK)" LDFLAGS="$(AM_LDFLAGS) -lfreeswitch" CFLAGS="$(AM_CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/build/modmake.sh $(PWD) $$i || exit 1; done modclean: - @cd src/mod && for i in `find . -type d -name mod_\*` ; do echo making clean $$i ; MAKE=$(MAKE) SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i clean || exit 1; done + @cd src/mod && for i in `find . -type d -name mod_\*` ; do echo making clean $$i ; MAKE=$(MAKE) SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/build/modmake.sh $(PWD) $$i clean || exit 1; done everything: install install_mod @@ -1031,7 +1031,7 @@ install_mod: modules @mkdir -p $(PREFIX) $(PREFIX)/conf $(PREFIX)/mod $(PREFIX)/db $(PREFIX)/bin @if [ -f .libs/$(NAME) ] ; then /bin/cp -p .libs/$(NAME) $(PREFIX)/bin ; else /bin/cp -p ./$(NAME) $(PREFIX)/bin ; fi @echo Installing Modules - @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making clean $$i ; PREFIX=$(PREFIX) MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i install || exit 1; done + @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making clean $$i ; PREFIX=$(PREFIX) MOD="$$i" $(PWD)/build/modmake.sh $(PWD) $$i install || exit 1; done @echo done dox: diff --git a/build/build.sh b/build/build.sh new file mode 100755 index 0000000000..864dbeac2e --- /dev/null +++ b/build/build.sh @@ -0,0 +1 @@ +cd .. && make depends && make install modules install_mod diff --git a/buildlib.sh b/build/buildlib.sh similarity index 100% rename from buildlib.sh rename to build/buildlib.sh diff --git a/checkversion.sh b/build/checkversion.sh similarity index 100% rename from checkversion.sh rename to build/checkversion.sh diff --git a/modmake.sh b/build/modmake.sh similarity index 100% rename from modmake.sh rename to build/modmake.sh diff --git a/build/thisbuild-init.sh b/build/thisbuild-init.sh new file mode 100755 index 0000000000..fcebfa6bef --- /dev/null +++ b/build/thisbuild-init.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# This script is used so the thisbuild compile project can have multiple +# architectures compile the software to check portability. Please leave +# this file in tact! - Justin + +./build.sh 2>&1 +ojnk=$? + +echo "Return Code: $ojnk" + diff --git a/src/mod/codecs/mod_g729/Makefile b/src/mod/codecs/mod_g729/Makefile index 74f1c384f9..41f9ed7fe7 100644 --- a/src/mod/codecs/mod_g729/Makefile +++ b/src/mod/codecs/mod_g729/Makefile @@ -4,7 +4,7 @@ LDFLAGS +=-lg729 all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install codec/libg729 --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install codec/libg729 --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o diff --git a/src/mod/codecs/mod_gsm/Makefile b/src/mod/codecs/mod_gsm/Makefile index b8e3538d1b..ecde72dba7 100644 --- a/src/mod/codecs/mod_gsm/Makefile +++ b/src/mod/codecs/mod_gsm/Makefile @@ -3,7 +3,7 @@ LDFLAGS +=-lgsm all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install codec/gsm --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install codec/gsm --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o diff --git a/src/mod/codecs/mod_ilbc/Makefile b/src/mod/codecs/mod_ilbc/Makefile index 4d14a5647e..d0bb991cb6 100644 --- a/src/mod/codecs/mod_ilbc/Makefile +++ b/src/mod/codecs/mod_ilbc/Makefile @@ -3,7 +3,7 @@ LDFLAGS +=-lilbc all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install codec/ilbc --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install codec/ilbc --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o diff --git a/src/mod/codecs/mod_speex/Makefile b/src/mod/codecs/mod_speex/Makefile index 785c07bcfe..48a0222b43 100644 --- a/src/mod/codecs/mod_speex/Makefile +++ b/src/mod/codecs/mod_speex/Makefile @@ -1,7 +1,7 @@ all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install speex-1.1.11.1.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install speex-1.1.11.1.tar.gz --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o diff --git a/src/mod/dialplans/mod_pcre/Makefile b/src/mod/dialplans/mod_pcre/Makefile index bdad22b6bc..14ab852215 100644 --- a/src/mod/dialplans/mod_pcre/Makefile +++ b/src/mod/dialplans/mod_pcre/Makefile @@ -3,7 +3,7 @@ LDFLAGS += -lpcre -L/usr/local/lib all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install pcre-6.4.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install pcre-6.4.tar.gz --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o diff --git a/src/mod/endpoints/mod_exosip/Makefile b/src/mod/endpoints/mod_exosip/Makefile index 9299735eeb..1ccf2e3f00 100644 --- a/src/mod/endpoints/mod_exosip/Makefile +++ b/src/mod/endpoints/mod_exosip/Makefile @@ -10,9 +10,9 @@ endif all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install jrtplib --prefix=$(PREFIX) --disable-gst - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install libosip2-2.2.2.tar.gz --prefix=$(PREFIX) - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install libeXosip2-2.2.2.tar.gz --disable-josua --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install jrtplib --prefix=$(PREFIX) --disable-gst + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libosip2-2.2.2.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libeXosip2-2.2.2.tar.gz --disable-josua --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c diff --git a/src/mod/endpoints/mod_iax/Makefile b/src/mod/endpoints/mod_iax/Makefile index fd355e65fa..33feebad9e 100644 --- a/src/mod/endpoints/mod_iax/Makefile +++ b/src/mod/endpoints/mod_iax/Makefile @@ -3,7 +3,7 @@ LDFLAGS += -liax -L/usr/local/lib all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install iax --enable-newjb --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install iax --enable-newjb --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o diff --git a/src/mod/endpoints/mod_portaudio/Makefile b/src/mod/endpoints/mod_portaudio/Makefile index 732a9d1da8..a46332cdb2 100644 --- a/src/mod/endpoints/mod_portaudio/Makefile +++ b/src/mod/endpoints/mod_portaudio/Makefile @@ -4,7 +4,7 @@ MYOBJS = pablio.o ringbuffer.o all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install portaudio.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install portaudio.tar.gz --prefix=$(PREFIX) %.o: %.c $(CC) -fPIC $(CFLAGS) -c -o $@ $< diff --git a/src/mod/event_handlers/mod_xmpp_event/Makefile b/src/mod/event_handlers/mod_xmpp_event/Makefile index af038f7248..7716982650 100644 --- a/src/mod/event_handlers/mod_xmpp_event/Makefile +++ b/src/mod/event_handlers/mod_xmpp_event/Makefile @@ -3,7 +3,7 @@ LDFLAGS += -liksemel -L/usr/local/lib all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install iksemel-1.2.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install iksemel-1.2.tar.gz --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o diff --git a/src/mod/formats/mod_sndfile/Makefile b/src/mod/formats/mod_sndfile/Makefile index 56649b478d..1eb595d036 100644 --- a/src/mod/formats/mod_sndfile/Makefile +++ b/src/mod/formats/mod_sndfile/Makefile @@ -3,7 +3,7 @@ LDFLAGS += -lsndfile -L/usr/local/lib all: depends $(MODNAME).so depends: - MAKE=$(MAKE) $(BASE)/buildlib.sh $(BASE) install libsndfile-1.0.12.tar.gz --prefix=$(PREFIX) + MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install libsndfile-1.0.12.tar.gz --prefix=$(PREFIX) $(MODNAME).so: $(MODNAME).c $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o