diff --git a/build/modmake.rules.in b/build/modmake.rules.in index 00b1071195..9f345371eb 100644 --- a/build/modmake.rules.in +++ b/build/modmake.rules.in @@ -52,7 +52,7 @@ TOUCH_TARGET=if test -f "$@" ; then touch "$@" ; fi ; MAKE_OPTS = `test -n "$(VERBOSE)" || echo -s` RECURSE_MODNAME=`pwd | sed -e 's|^.*/||'` RECURSE_SOURCEFILE=`if test -f $$modname.cpp; then echo $$modname.cpp; else echo $$modname.c; fi` -RECURSE_OUR_DEPS=`test -z "$(WANT_CURL)" || if test ! -z "$(LIBCURL_DEPS)"; then echo $(CURLLA); fi` +RECURSE_OUR_DEPS=`test -z "$(WANT_CURL)" || if test ! -z "$(LIBCURL_DEPS)"; then echo $(CURLLA); fi ` RECURSE_OUR_CFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL_CPPFLAGS) ; $(LOCAL_INSERT_CFLAGS) ` RECURSE_OUR_LDFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL) ; $(LOCAL_INSERT_LDFLAGS) ` RECURSE_MAKE=modname="$(RECURSE_MODNAME)" ; \ @@ -61,7 +61,9 @@ RECURSE_MAKE=modname="$(RECURSE_MODNAME)" ; \ ourdefs="$(RECURSE_OUR_DEPS)" ; \ ourcflags="$(RECURSE_OUR_CFLAGS)" ; \ ourldflags="$(RECURSE_OUR_LDFLAGS)" ; \ - $(MAKE) $(MAKE_OPTS) MODNAME="$$modname" SOURCEFILE="$$sourcefile" OUR_DEPS="$$ourdefs" OUR_CFLAGS="$$ourcflags" OUR_LDFLAGS="$$ourldflags" + insertobjs="`$(LOCAL_INSERT_OBJS)`" ; \ + $(MAKE) $(MAKE_OPTS) MODNAME="$$modname" SOURCEFILE="$$sourcefile" \ + OUR_DEPS="$$ourdefs" OUR_CFLAGS="$$ourcflags" OUR_LDFLAGS="$$ourldflags" OUR_OBJS="$$insertobjs" all: Makefile @$(RECURSE_MAKE) all-modules || exit 1 @@ -104,14 +106,14 @@ LINK_OUTPUT_REDIR=> .libs/$(MODNAME).log || error="yes" ; \ exit 1 ;\ fi -$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(LIBS) $(LOCAL_LIBADD) $(OUR_DEPS) $(LOCAL_OBJS) $(SOURCEFILE) $(MODNAME).o +$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(LIBS) $(LOCAL_LIBADD) $(OUR_DEPS) $(LOCAL_OBJS) $(OUR_OBJS) $(SOURCEFILE) $(MODNAME).o @echo Creating $@... @test -d .libs || mkdir .libs @error="";\ if test -f $(CSOURCEFILE); then \ - $(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\ + $(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\ else \ - $(CXXLINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\ + $(CXXLINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LINK_OUTPUT_REDIR) ;\ fi; mod_clean: diff --git a/src/mod/event_handlers/mod_cdr/Makefile b/src/mod/event_handlers/mod_cdr/Makefile index 6de5933e2e..544608db25 100644 --- a/src/mod/event_handlers/mod_cdr/Makefile +++ b/src/mod/event_handlers/mod_cdr/Makefile @@ -10,10 +10,8 @@ LOCAL_OBJS=cdrcontainer.o basecdr.o baseregistry.o pddcdr.o csvcdr.o xmlcdr.o sq #LOCAL_CFLAGS += -DSWITCH_QUEUE_ENHANCED #LOCAL_LDFLAGS += -lcurl -ifneq ($(shell which mysql_config),) - LOCAL_CFLAGS += $(shell mysql_config --include) - LOCAL_LDFLAGS += $(shell mysql_config --libs) - LOCAL_OBJS += mysqlcdr.o -endif +LOCAL_INSERT_CFLAGS=mysql_config="\`which mysql-config 2>/dev/null \`"; if test -n "$$mysql_config"; then echo "\`mysql_config --include\`" ; fi +LOCAL_INSERT_LDFLAGS=mysql_config="\`which mysql-config 2>/dev/null \`"; if test -n "$$mysql_config"; then echo "\`mysql_config --libs\`" ; fi +LOCAL_INSERT_OBJS=mysql_config="\`which mysql-config 2>/dev/null \`"; if test -n "$$mysql_config"; then echo "mysqlcdr.o" ; fi include ../../../../build/modmake.rules