From b552cb3a6c7570a15e16f30ef0b8ef71d57141af Mon Sep 17 00:00:00 2001 From: Michal Bielicki Date: Mon, 18 Feb 2008 14:58:41 +0000 Subject: [PATCH] Make libdir and bindir being accepted by libs and modules add a setting called --modinstdir to be able to define where modules get installed git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7663 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- Makefile.am | 14 +++++++++----- build/modmake.rules.in | 13 +++++++------ configure.in | 14 ++++++++++---- libs/curl/lib/config.h.in | 10 +++++----- libs/js/nsprpub/config/rules.mk | 2 +- libs/xmlrpc-c/xmlrpc_amconfig.h.in | 2 +- src/Makefile.am | 2 -- src/mod/asr_tts/mod_openmrcp/Makefile | 1 - src/mod/endpoints/mod_sofia/Makefile.am | 2 +- src/mod/languages/mod_spidermonkey/Makefile | 4 ++-- 10 files changed, 36 insertions(+), 28 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6fc95f2091..e0b78224ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,6 +31,9 @@ sounds-install: sounds-en-us-callie-8000-install moh: sounds-music-8000 moh-install: sounds-music-8000-install +libdir = @libdir@ +bindir = @bindir@ +includedir = @includedir@ libfreeswitch_la_SOURCES = \ src/switch_apr.c \ src/switch_buffer.c \ @@ -198,6 +201,7 @@ install-data-local: @for x in mod db log log/xml_cdr bin scripts grammar recordings ; do \ $(mkinstalldirs) $(DESTDIR)$(prefix)/$$x ; \ done + $(mkinstalldirs) $(DESTDIR)@modinstdir@ test -d $(DESTDIR)$(prefix)/conf || $(MAKE) samples-conf test -d $(DESTDIR)$(prefix)/htdocs || $(MAKE) samples-htdocs @@ -334,10 +338,10 @@ dox: scripts/fsxs: scripts/fsxs.in @echo creating fsxs - @sed -e "s,@MODULES_DIR\@,$(PREFIX)/mod," \ - -e "s,@LIB_DIR\@,$(PREFIX)/lib," \ - -e "s,@BIN_DIR\@,$(PREFIX)/bin," \ - -e "s,@INC_DIR\@,$(PREFIX)/include," \ + @sed -e "s,@MODULES_DIR\@,@modinstdir@," \ + -e "s,@LIB_DIR\@,@libdir@," \ + -e "s,@BIN_DIR\@,@bindir@," \ + -e "s,@INC_DIR\@,@includedir@," \ -e "s,@CFG_DIR\@,$(PREFIX)/conf," \ -e "s,@DB_DIR\@,$(PREFIX)/db," \ -e "s,@PREFIX\@,$(PREFIX)," \ @@ -365,7 +369,7 @@ megaclean: eclean modclean rm -f `find ./libs -name \*.la` libclean: - @for file in `ls ./libs`; do pushd "./libs/"$$file; make clean; popd; done + @for file in `ls ./libs`; do pushd "./libs/"$$file; make clean; rm -f .built; popd; done modules.conf: if test -f $@; then touch $@; else cp build/modules.conf.in $@ ;fi diff --git a/build/modmake.rules.in b/build/modmake.rules.in index 008b710731..2ca0b99a8e 100644 --- a/build/modmake.rules.in +++ b/build/modmake.rules.in @@ -24,9 +24,10 @@ CURLLA=$(CURL_DIR)/lib/libcurl.la LIBS=$(switch_builddir)/libfreeswitch.la DEFS=@DEFS@ PREFIX = @prefix@ +MODINSTDIR = @modinstdir@ -DYLD_LIBRARY_PATH=$(PREFIX)/lib:$DYLD_LIBRARY_PATH -LD_LIBRARY_PATH=$(PREFIX)/lib:$LD_LIBRARY_PATH +DYLD_LIBRARY_PATH=${_libdir}:$DYLD_LIBRARY_PATH +LD_LIBRARY_PATH=${_libdir}:$LD_LIBRARY_PATH OSARCH=`uname -s` DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@ SOLINK = @SOLINK@ @@ -119,14 +120,14 @@ $(MODNAME).$(DYNAMIC_LIB_EXTEN): $(LIBS) $(LOCAL_LIBADD) $(OUR_DEPS) $(LOCAL_OBJ mod_clean: @rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *.lo *~ .libs $(LOCAL_OBJS) -mod_install: $(DESTDIR)$(PREFIX)/mod/$(MODNAME).$(DYNAMIC_LIB_EXTEN) +mod_install: $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(DYNAMIC_LIB_EXTEN) -$(DESTDIR)$(PREFIX)/mod/$(MODNAME).$(DYNAMIC_LIB_EXTEN):$(MODNAME).$(DYNAMIC_LIB_EXTEN) +$(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(DYNAMIC_LIB_EXTEN):$(MODNAME).$(DYNAMIC_LIB_EXTEN) @echo installing $< - @$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/mod >/dev/null + @$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(MODINSTDIR) >/dev/null mod_uninstall: - @$(LTUNINSTALL) $(DESTDIR)$(PREFIX)/mod/$(MODNAME).$(DYNAMIC_LIB_EXTEN) + @$(LTUNINSTALL) $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(DYNAMIC_LIB_EXTEN) # define these in your makefile if you wish local_all local_depend local_clean depend_install local_install local_distclean local_extraclean local_uninstall: diff --git a/configure.in b/configure.in index 7a7be66294..a64a471802 100644 --- a/configure.in +++ b/configure.in @@ -30,8 +30,11 @@ switch_builddir=`pwd` AC_SUBST(switch_srcdir) AC_SUBST(switch_builddir) -moddir=$prefix/mod -AC_SUBST(moddir) +# Where to install the modules +AC_ARG_WITH(modinstdir, [ --with-modinstdir (default=$prefix/mod)], modinstdir=$withval, modinstdir="${prefix}/mod") + +AC_SUBST(modinstdir) +AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modinstdir}",[where to install the modules to]) #Set default language AC_LANG_C @@ -66,7 +69,7 @@ AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"]) # Optional Features AC_ARG_ENABLE(resample, -[AC_HELP_STRING([--enable-resample],[build with embedded resamper])],[enable_resample="$enable_resample"],[enable_resample="yes"]) +[AC_HELP_STRING([--enable-resample],[build with embedded resampler])],[enable_resample="$enable_resample"],[enable_resample="yes"]) # We should add checking for out of tree libresample here RESAMPLE_LIB= @@ -383,6 +386,9 @@ AC_SUBST(int64_t_fmt) AC_SUBST(uint64_t_fmt) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) +AC_SUBST(libdir) +AC_SUBST(bindir) +AC_SUBST(includedir) AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat) AC_PATH_PROGS(TAR, gtar tar) @@ -476,7 +482,7 @@ AC_CONFIG_SUBDIRS(libs/sofia-sip) AC_CONFIG_SUBDIRS(libs/speex) AC_CONFIG_SUBDIRS(libs/xmlrpc-c) AC_CONFIG_SUBDIRS(libs/portaudio) -#AC_CONFIG_SUBDIRS(libs/openmrcp) +AC_CONFIG_SUBDIRS(libs/openmrcp) AC_CONFIG_SUBDIRS(libs/openzap) AC_OUTPUT diff --git a/libs/curl/lib/config.h.in b/libs/curl/lib/config.h.in index 8602189707..4bc60b0df1 100644 --- a/libs/curl/lib/config.h.in +++ b/libs/curl/lib/config.h.in @@ -621,16 +621,16 @@ /* Define to the function return type for send. */ #undef SEND_TYPE_RETV -/* The size of a `curl_off_t', as computed by sizeof. */ +/* The size of `curl_off_t', as computed by sizeof. */ #undef SIZEOF_CURL_OFF_T -/* The size of a `long', as computed by sizeof. */ +/* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of a `size_t', as computed by sizeof. */ +/* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T -/* The size of a `time_t', as computed by sizeof. */ +/* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T /* Define to 1 if you have the ANSI C header files. */ @@ -685,7 +685,7 @@ /* type to use in place of in_addr_t if not defined */ #undef in_addr_t -/* Define to `unsigned' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t /* type to use in place of socklen_t if not defined */ diff --git a/libs/js/nsprpub/config/rules.mk b/libs/js/nsprpub/config/rules.mk index 40ddff631c..be5374dfc8 100644 --- a/libs/js/nsprpub/config/rules.mk +++ b/libs/js/nsprpub/config/rules.mk @@ -232,7 +232,7 @@ install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS) # $(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir) #endif ifdef RELEASE_LIBS - $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(prefix)/lib + $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir) endif +$(LOOP_OVER_DIRS) diff --git a/libs/xmlrpc-c/xmlrpc_amconfig.h.in b/libs/xmlrpc-c/xmlrpc_amconfig.h.in index 99479b65af..b73edb35a9 100644 --- a/libs/xmlrpc-c/xmlrpc_amconfig.h.in +++ b/libs/xmlrpc-c/xmlrpc_amconfig.h.in @@ -81,5 +81,5 @@ /* Version number of package */ #undef VERSION -/* Define to `unsigned' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t diff --git a/src/Makefile.am b/src/Makefile.am index 245b3685ae..b7c8acd0d8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1 @@ SUBDIRS = mod - - diff --git a/src/mod/asr_tts/mod_openmrcp/Makefile b/src/mod/asr_tts/mod_openmrcp/Makefile index a18ca9ed4e..a17d4c6e1f 100644 --- a/src/mod/asr_tts/mod_openmrcp/Makefile +++ b/src/mod/asr_tts/mod_openmrcp/Makefile @@ -39,4 +39,3 @@ $(SOFIALA): $(SOFIA_DIR) $(SOFIA_DIR)/.update ../../../../libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h: $(SOFIALA) - diff --git a/src/mod/endpoints/mod_sofia/Makefile.am b/src/mod/endpoints/mod_sofia/Makefile.am index 98cf98859d..b25c429347 100644 --- a/src/mod/endpoints/mod_sofia/Makefile.am +++ b/src/mod/endpoints/mod_sofia/Makefile.am @@ -8,7 +8,7 @@ AM_MAKEFLAGS=`test -n "$(VERBOSE)" || echo -s` # Dirty trick to override the link output LIBS+=> $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" -o "$$error" = "yes";then cat $(MODNAME).log;fi;if test "$$error" = "yes";then exit 1;fi -moddir=$(prefix)/mod +moddir=@modinstdir@ MODNAME=mod_sofia diff --git a/src/mod/languages/mod_spidermonkey/Makefile b/src/mod/languages/mod_spidermonkey/Makefile index 811ac16b5e..975b45d3e8 100644 --- a/src/mod/languages/mod_spidermonkey/Makefile +++ b/src/mod/languages/mod_spidermonkey/Makefile @@ -6,9 +6,9 @@ LOCAL_LIBADD= include sm.mak -depend_install: $(DESTDIR)$(PREFIX)/lib/libjs.la +depend_install: $(DESTDIR)$(libdir)/libjs.la -$(DESTDIR)$(PREFIX)/lib/libjs.la: $(JSLA) +$(DESTDIR)$(libdir)/libjs.la: $(JSLA) cd $(JS_DIR)/nsprpub/ && $(MAKE) install cd $(JS_DIR) && $(MAKE) install