summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-01-24 11:28:46 -0600
committerDan Williams <dcbw@redhat.com>2012-01-24 11:28:46 -0600
commit79cb265379685c057a6429718e2c11fa070f384c (patch)
treee574e4c316754b3aceef05e2534d1548387acded
parent7d6d3fd47e32c3f1d4b3c011f85d896437b151f9 (diff)
downloadModemManager-79cb265379685c057a6429718e2c11fa070f384c.tar.gz
wmc: allow building libwmc standalone
-rw-r--r--libwmc/AUTHORS0
-rw-r--r--libwmc/ChangeLog0
-rw-r--r--libwmc/NEWS0
-rw-r--r--libwmc/README0
-rwxr-xr-xlibwmc/autogen.sh22
-rw-r--r--libwmc/configure.ac49
-rw-r--r--libwmc/tests/Makefile.am13
7 files changed, 80 insertions, 4 deletions
diff --git a/libwmc/AUTHORS b/libwmc/AUTHORS
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/libwmc/AUTHORS
diff --git a/libwmc/ChangeLog b/libwmc/ChangeLog
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/libwmc/ChangeLog
diff --git a/libwmc/NEWS b/libwmc/NEWS
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/libwmc/NEWS
diff --git a/libwmc/README b/libwmc/README
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/libwmc/README
diff --git a/libwmc/autogen.sh b/libwmc/autogen.sh
new file mode 100755
index 000000000..df15fcec2
--- /dev/null
+++ b/libwmc/autogen.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+# NOTE
+# This autogen.sh is only used when building libwmc separately from ModemManager
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+REQUIRED_AUTOMAKE_VERSION=1.7
+PKG_NAME=libwmc
+
+(test -f $srcdir/configure.ac \
+ && test -f $srcdir/src/com.c) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+}
+
+(cd $srcdir;
+ autoreconf --install --symlink &&
+ autoreconf &&
+ ./configure --enable-maintainer-mode $@
+)
diff --git a/libwmc/configure.ac b/libwmc/configure.ac
new file mode 100644
index 000000000..667d644e2
--- /dev/null
+++ b/libwmc/configure.ac
@@ -0,0 +1,49 @@
+# NOTE
+# This configure.ac is only used when building libqcdm separately from
+# ModemManager.
+#
+
+AC_PREREQ(2.52)
+
+AC_INIT(libwmc, 0.1, dcbw@redhat.com, libwmc)
+AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AM_MAINTAINER_MODE
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_CONFIG_HEADERS(config.h)
+
+dnl Define _GNU_SOURCE for various things like strcasestr()
+AC_GNU_SOURCE
+
+dnl Required programs
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+
+dnl
+dnl Tests
+dnl
+AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build libqcdm tests]))
+AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
+case $with_tests in
+ yes)
+ with_tests=yes
+ PKG_CHECK_MODULES(MM, glib-2.0 >= 2.20)
+ ;;
+ *)
+ with_tests=no
+ ;;
+esac
+
+AM_CONDITIONAL(STANDALONE, test "yes" = "yes")
+
+AC_CONFIG_FILES([
+Makefile
+src/Makefile
+tests/Makefile
+])
+AC_OUTPUT
+
diff --git a/libwmc/tests/Makefile.am b/libwmc/tests/Makefile.am
index faef9aa01..f1791be68 100644
--- a/libwmc/tests/Makefile.am
+++ b/libwmc/tests/Makefile.am
@@ -1,5 +1,6 @@
INCLUDES = \
- -I$(top_srcdir)/libwmc/src
+ -I$(top_srcdir)/libwmc/src \
+ -I$(top_srcdir)/src
noinst_PROGRAMS = test-wmc
@@ -17,9 +18,13 @@ test_wmc_SOURCES = \
test_wmc_CPPFLAGS = \
$(MM_CFLAGS)
-test_wmc_LDADD = \
- $(top_builddir)/libwmc/src/libwmc.la \
- $(MM_LIBS)
+test_wmc_LDADD = $(MM_LIBS)
+
+if STANDALONE
+test_wmc_LDADD += $(top_builddir)/src/libwmc.la
+else
+test_wmc_LDADD += $(top_builddir)/libwmc/src/libwmc.la
+endif
if WITH_TESTS