diff --git a/build/modmake.rules.in b/build/modmake.rules.in index ea77e9573b..67fbecf303 100644 --- a/build/modmake.rules.in +++ b/build/modmake.rules.in @@ -3,6 +3,10 @@ switch_builddir=@switch_builddir@ switch_srcdir=@switch_srcdir@ +build=@build@ +host=@host@ +target=$(host) + CC=@CC@ CXX=@CXX@ AWK=@AWK@ @@ -37,11 +41,15 @@ DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@ LIBTOOL_LIB_EXTEN = @LIBTOOL_LIB_EXTEN@ SOLINK = @SOLINK@ +CFLAGS=@CFLAGS@ LDFLAGS=@SWITCH_AM_LDFLAGS@ @LDFLAGS@ $(OUR_LDFLAGS) ALL_CFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CFLAGS@ @CFLAGS@ -D_GNU_SOURCE $(OUR_CFLAGS) ALL_CXXFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CXXFLAGS@ @CXXFLAGS@ -D_GNU_SOURCE $(OUR_CFLAGS) +DEFAULT_ARGS:= --build=$(build) --host=$(host) --target=$(target) --prefix=$(PREFIX) --disable-shared --with-pic +DEFAULT_VARS:= CFLAGS="$(ALL_CFLAGS)" CPPFLAGS="$(ALL_CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" CXX="$(CXX)" + COMPILE = $(CC) $(ALL_CFLAGS) $(DEFS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(COMPILE) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(ALL_CFLAGS) $(LDFLAGS) -shared -module -avoid-version -rpath $(MODINSTDIR) -o $@ diff --git a/src/mod/applications/mod_curl/Makefile b/src/mod/applications/mod_curl/Makefile index 9630aaadb1..6f3e3b0d2b 100644 --- a/src/mod/applications/mod_curl/Makefile +++ b/src/mod/applications/mod_curl/Makefile @@ -11,15 +11,13 @@ LOCAL_LIBADD=$(JSONLA) include $(BASE)/build/modmake.rules -DEFAULT_ARGS=--prefix=$(PREFIX) --disable-shared --with-pic - $(LOCAL_OBJS): $(LOCAL_SOURCES) $(JSON_DIR): $(GETLIB) $(json-c).tar.gz $(JSON_DIR)/Makefile: $(JSON_DIR) - cd $(JSON_DIR) && CFLAGS=$(AM_CFLAGS) CC=$(CC) CXX=$(CXX) ./configure --disable-shared --with-pic CPPFLAGS= LDFLAGS= + cd $(JSON_DIR) && $(DEFAULT_VARS) ./configure $(DEFAULT_ARGS) CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(JSONLA): $(JSON_DIR)/Makefile diff --git a/src/mod/applications/mod_memcache/Makefile b/src/mod/applications/mod_memcache/Makefile index f5b41cba36..f9871bcefd 100644 --- a/src/mod/applications/mod_memcache/Makefile +++ b/src/mod/applications/mod_memcache/Makefile @@ -12,15 +12,13 @@ LOCAL_LIBADD=$(MEMCACHEDLA) include $(switch_srcdir)/build/modmake.rules -DEFAULT_ARGS=--prefix=$(PREFIX) --disable-shared --with-pic - $(LOCAL_OBJS): $(LOCAL_SOURCES) $(MEMCACHED_DIR): $(GETLIB) $(MEMCACHED).tar.gz $(MEMCACHED_DIR)/Makefile: $(MEMCACHED_DIR) - cd $(MEMCACHED_DIR) && CFLAGS=$(AM_CFLAGS) CC=$(CC) CXX=$(CXX) ./configure --disable-shared --with-pic --with-memcached=no CPPFLAGS= LDFLAGS= + cd $(MEMCACHED_DIR) && $(DEFAULT_VARS) ./configure $(DEFAULT_ARGS) --with-memcached=no CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(MEMCACHEDLA): $(MEMCACHED_DIR)/Makefile diff --git a/src/mod/applications/mod_soundtouch/Makefile b/src/mod/applications/mod_soundtouch/Makefile index c86b25578d..cc14cf6c6c 100644 --- a/src/mod/applications/mod_soundtouch/Makefile +++ b/src/mod/applications/mod_soundtouch/Makefile @@ -5,13 +5,12 @@ LA=$(DIRECTORY)/source/SoundTouch/.libs/libSoundTouch.a BASE=../../../.. LOCAL_CFLAGS += -I$(DIRECTORY)/include -DINTEGER_SAMPLES LOCAL_LIBADD=$(LA) -DEFAULT_ARGS=--prefix=$(PREFIX) --disable-shared --with-pic include $(BASE)/build/modmake.rules $(DIRECTORY)/Makefile $(DIRECTORY)/config.status: $(GETLIB) $(VERSION).tar.gz - cd $(DIRECTORY) && ./configure $(DEFAULT_ARGS) --enable-integer-samples + cd $(DIRECTORY) && $(DEFAULT_VARS) ./configure $(DEFAULT_ARGS) --enable-integer-samples $(TOUCH_TARGET) $(LA): $(DIRECTORY)/Makefile $(DIRECTORY)/config.status diff --git a/src/mod/directories/mod_ldap/Makefile b/src/mod/directories/mod_ldap/Makefile index d8c5b9e4f1..520638961b 100644 --- a/src/mod/directories/mod_ldap/Makefile +++ b/src/mod/directories/mod_ldap/Makefile @@ -8,16 +8,15 @@ LIBLBERLA=$(LDAP_DIR)/libraries/liblber/liblber.la LOCAL_CFLAGS=-DWITH_OPENLDAP -DLDAP_DEPRECATED -I$(LDAP_DIR)/include -DEFAULT_ARGS= --prefix=$(PREFIX) --disable-shared --with-pic --disable-slapd -DEFAULT_ARGS+= --disable-bdb --disable-hdb - LOCAL_LIBADD=$(LDAPLA) $(LIBLBERLA) include $(switch_srcdir)/build/modmake.rules +DEFAULT_ARGS+= --disable-slapd --disable-bdb --disable-hdb + $(LDAP_DIR): $(GETLIB) $(LDAP).tar.gz - cd $(LDAP_DIR) && CFLAGS="`echo $(CFLAGS) | sed -e 's:-std=c99::'`" ./configure $(DEFAULT_ARGS) + cd $(LDAP_DIR) && $(DEFAULT_VARS) CFLAGS="`echo $(CFLAGS) | sed -e 's:-std=c99::'`" ./configure $(DEFAULT_ARGS) $(LDAPLA) $(LIBLBERLA): $(LDAP_DIR) cd $(LDAP_DIR) && $(MAKE) diff --git a/src/mod/formats/mod_shout/Makefile b/src/mod/formats/mod_shout/Makefile index cf432def3b..4f93838e22 100644 --- a/src/mod/formats/mod_shout/Makefile +++ b/src/mod/formats/mod_shout/Makefile @@ -22,15 +22,13 @@ LOCAL_SOURCES=$(MP3SOURCES) include $(switch_srcdir)/build/modmake.rules -DEFAULT_ARGS=--prefix=$(PREFIX) --disable-shared --with-pic - $(LOCAL_OBJS): $(LOCAL_SOURCES) $(MPG123_DIR): $(GETLIB) $(MPG123).tar.gz $(MPG123_DIR)/Makefile: $(MPG123_DIR) - cd $(MPG123_DIR) && CFLAGS=$(AM_CFLAGS) CC=$(CC) CXX=$(CXX) ./configure --disable-shared --with-pic CPPFLAGS= LDFLAGS= + cd $(MPG123_DIR) && $(DEFAULT_VARS) ./configure $(DEFAULT_ARGS) CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(MPG123LA): $(MPG123_DIR)/Makefile @@ -41,7 +39,7 @@ $(LAME_DIR): $(GETLIB) $(LAME).tar.gz $(LAME_DIR)/Makefile: $(LAME_DIR) - cd $(LAME_DIR) && CC=$(CC) CXX=$(CXX) ./configure $(DEFAULT_ARGS) --disable-decoder CPPFLAGS= LDFLAGS= + cd $(LAME_DIR) && $(DEFAULT_VARS) ./configure $(DEFAULT_ARGS) --disable-decoder CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(LAMELA): $(LAME_DIR)/Makefile @@ -52,7 +50,7 @@ $(SHOUT_DIR): $(GETLIB) $(SHOUT).tar.gz $(SHOUT_DIR)/Makefile: $(SHOUT_DIR) - cd $(SHOUT_DIR) && CC=$(CC) CXX=$(CXX) ./configure $(DEFAULT_ARGS) --without-speex --without-vorbis --without-ogg CPPFLAGS= LDFLAGS= + cd $(SHOUT_DIR) && $(DEFAULT_VARS) ./configure $(DEFAULT_ARGS) --without-speex --without-vorbis --without-ogg CPPFLAGS= LDFLAGS= $(TOUCH_TARGET) $(SHOUTLA): $(SHOUT_DIR)/Makefile diff --git a/src/mod/languages/mod_yaml/Makefile b/src/mod/languages/mod_yaml/Makefile index 1150826b55..c7b99526ec 100644 --- a/src/mod/languages/mod_yaml/Makefile +++ b/src/mod/languages/mod_yaml/Makefile @@ -10,7 +10,7 @@ include $(BASE)/build/modmake.rules local_depend: $(LIBYAML_A) $(LIBYAML_A): - cd $(YAMLLIB) && ./configure $(DEFAULT_ARGS) --disable-shared --with-pic + cd $(YAMLLIB) && $(DEFAULT_VARS) ./configure $(DEFAULT_ARGS) cd $(YAMLLIB) && $(MAKE) yamlclean: diff --git a/src/mod/xml_int/mod_xml_ldap/Makefile b/src/mod/xml_int/mod_xml_ldap/Makefile index 16e527ed4d..1c4aa5f1d1 100644 --- a/src/mod/xml_int/mod_xml_ldap/Makefile +++ b/src/mod/xml_int/mod_xml_ldap/Makefile @@ -9,16 +9,15 @@ LIBLUTILA=$(LDAP_DIR)/libraries/liblutil/liblutil.a LOCAL_CFLAGS=-DWITH_OPENLDAP -DLDAP_DEPRECATED -I$(LDAP_DIR)/include -DEFAULT_ARGS= --prefix=$(PREFIX) --disable-shared --with-pic --disable-slapd -DEFAULT_ARGS+= --disable-slurpd --disable-relay --disable-bdb --disable-hdb - LOCAL_LIBADD=$(LDAPLA) $(LIBLBERLA) $(LIBLUTILA) include $(switch_srcdir)/build/modmake.rules +DEFAULT_ARGS+= --disable-slapd --disable-slurpd --disable-relay --disable-bdb --disable-hdb + $(LDAP_DIR): $(GETLIB) $(LDAP).tar.gz - cd $(LDAP_DIR) && CFLAGS="`echo $(CFLAGS) | sed -e 's:-std=c99::'`" ./configure $(DEFAULT_ARGS) + cd $(LDAP_DIR) && $(DEFAULT_VARS) CFLAGS="`echo $(CFLAGS) | sed -e 's:-std=c99::'`" ./configure $(DEFAULT_ARGS) $(LIBLUTILA) $(LDAPLA) $(LIBLBERLA): $(LDAP_DIR) cd $(LDAP_DIR) && $(MAKE)