diff --git a/mbuni/configure.ac b/mbuni/configure.ac index aeaa8d9..4f1dd7d 100644 --- a/mbuni/configure.ac +++ b/mbuni/configure.ac @@ -35,7 +35,7 @@ AC_PROG_LIBTOOL AC_PROG_RANLIB dnl add mmlib to the include path -INCLUDES='-I$(top_srcdir)/mmlib -I$(top_builddir)/mmlib' +INCLUDES='-I$(top_srcdir)/mmlib -I$(top_builddir)/mmsc -I$(top_srcdir)/mmsc -I$(top_builddir)/mmsbox -I$(top_srcdir)/mmlib -I$(top_builddir)/mmsbox' AC_SUBST([INCLUDES]) @@ -323,6 +323,31 @@ AC_CHECK_LIB([pq], [PQexec], [has_pgsql=true]) AM_CONDITIONAL([BUILD_PGSQLQ], [test x$has_pgsql = xtrue]) +# Look for curl lib +AC_PATH_PROG(CURL_CONFIG, curl-config, no, [${PATH}]) +if test "$CURL_CONFIG" != "no"; then + dnl curl-config found + AC_MSG_CHECKING([curl lib version]) + curl_version=`$CURL_CONFIG --version` + AC_MSG_RESULT([$curl_version]) + AC_MSG_CHECKING([curl libs]) + if $CURL_CONFIG --libs &>/dev/null ; then + curl_libs=`$CURL_CONFIG --libs` + AC_MSG_RESULT([$curl_libs]) + LIBS="$LIBS $curl_libs" + fi + AC_MSG_CHECKING([curl includes]) + if $CURL_CONFIG --cflags &>/dev/null ; then + curl_cflags=`$CURL_CONFIG --cflags` + CFLAGS="$curl_cflags $CFLAGS" + AC_MSG_RESULT([$curl_cflags]) + fi +fi + +AC_CHECK_LIB([curl], [curl_global_init], [has_libcurl=true]) + +AM_CONDITIONAL([BUILD_MMSBOXMM1], [test x$has_libcurl = xtrue]) + dnl Add mbuni version to Cflags # CFLAGS="$CFLAGS -DMBUNI_VERSION=\"$M_VERSION\"" AC_DEFINE_UNQUOTED(MBUNI_VERSION, "$M_VERSION", "Mbuni Version") @@ -330,7 +355,7 @@ AC_DEFINE_UNQUOTED(MBUNI_VERSION, "$M_VERSION", "Mbuni Version") dnl May be we need to check for media conversion tools (imagemagick, etc)? -AC_CONFIG_FILES([Makefile autotools/Makefile doc/Makefile doc/examples/Makefile doc/images/Makefile mmlib/Makefile mmsc/Makefile mmsbox/Makefile extras/Makefile extras/pgsql-queue/Makefile]) +AC_CONFIG_FILES([Makefile autotools/Makefile doc/Makefile doc/examples/Makefile doc/images/Makefile mmlib/Makefile mmsc/Makefile mmsbox/Makefile extras/Makefile extras/pgsql-queue/Makefile extras/mmsbox-mm1/Makefile]) AC_OUTPUT diff --git a/mbuni/extras/Makefile.am b/mbuni/extras/Makefile.am index a87d096..823ace9 100644 --- a/mbuni/extras/Makefile.am +++ b/mbuni/extras/Makefile.am @@ -1,4 +1,7 @@ if BUILD_PGSQLQ X = pgsql-queue endif -SUBDIRS = $(X) +if BUILD_MMSBOXMM1 + Y = mmsbox-mm1 +endif +SUBDIRS = $(X) $(Y) diff --git a/mbuni/extras/mmsbox-mm1/Makefile b/mbuni/extras/mmsbox-mm1/Makefile deleted file mode 100644 index 8bdcd95..0000000 --- a/mbuni/extras/mmsbox-mm1/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# MM1 connectivity stuff Makefile (c) 2007 Digital Solutions - -KANNELCONF = gw-config -CURLCONF = curl-config -CC = gcc -MBUNIDIR = ../.. -LIBTOOL = libtool -ARCH = $(shell uname -s) -CFLAGS = -Wall -fPIC -I$(MBUNIDIR) -g -I$(MBUNIDIR)/mmlib -I$(MBUNIDIR)/mmsbox `$(KANNELCONF) --cflags | sed 's/-O2//g'` `$(CURLCONF) --cflags` - -ifeq ($(ARCH),Darwin) - XLDFLAGS=-dynamiclib -Wl,-flat_namespace,-undefined,suppress -arch i386 -arch ppc - LIB_EXT=dylib - CFLAGS+=-DDARWIN=1 -arch ppc -arch i386 -else - XLDFLAGS=-shared -Wl,-undefined,suppress - LIB_EXT=so -endif - -LIB = libmmsbox_mm1.$(LIB_EXT) - -ALL: $(LIB) - -$(LIB): mmsbox_mm1.o - $(CC) $(XLDFLAGS) -o $@ $? -L$(MBUNIDIR)/mmlib `$(CURLCONF) --libs` - -clean: - rm -f *.o *~ -clobber: clean - rm -f $(LIB) diff --git a/mbuni/extras/mmsbox-mm1/Makefile.am b/mbuni/extras/mmsbox-mm1/Makefile.am new file mode 100644 index 0000000..8578175 --- /dev/null +++ b/mbuni/extras/mmsbox-mm1/Makefile.am @@ -0,0 +1,3 @@ +lib_LTLIBRARIES = libmmsbox_mm1.la +libmmsbox_mm1_la_SOURCES = mmsbox_mm1.c +libmmsbox_mm1_la_LDFLAGS = -module