aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-04-17 15:34:23 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-04-17 15:34:23 +0200
commit0e60d964b3a95065b6164e5e9dd77b72a162d8f9 (patch)
tree11e78ee5fe2874652e233dd665208bb4cb1efc10
parentf8e7f2ebe118208da0f664dbbfa7b00f43c71338 (diff)
build: MBIM support is auto
Use it if found, don't use it if not found. Can be explicitly requested with --with-mbim.
-rw-r--r--configure.ac39
1 files changed, 25 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index e7826f3e..4699042f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,21 +171,32 @@ case $with_tests in
esac
dnl
-dnl MBIM support (enabled by default)
+dnl MBIM support (auto by default)
dnl
-AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=yes])
-AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
-case $with_mbim in
- yes)
- PKG_CHECK_MODULES(MBIM, mbim-glib)
- AC_DEFINE(WITH_MBIM, 1, [Define if you want MBIM support])
- AC_SUBST(MBIM_CFLAGS)
- AC_SUBST(MBIM_LIBS)
- ;;
- *)
- with_mbim=no
- ;;
-esac
+AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=auto])
+if (test "${with_mbim}" != "no"); then
+ PKG_CHECK_MODULES(MBIM,
+ [mbim-glib],
+ [have_libmbim_glib=yes],
+ [have_libmbim_glib=no])
+ AC_SUBST(MBIM_CFLAGS)
+ AC_SUBST(MBIM_LIBS)
+
+ if (test "${have_libmbim_glib}" = "no"); then
+ if (test "${with_mbim}" = "yes"); then
+ AC_MSG_ERROR([Couldn't find libmbim-glib])
+ else
+ with_mbim="no"
+ fi
+ else
+ with_mbim="yes"
+ fi
+fi
+
+if (test "${with_mbim}" = "yes"); then
+ AC_DEFINE(WITH_MBIM, 1, [Define if you want MBIM support])
+fi
+AM_CONDITIONAL(WITH_MBIM, test "${with_mbim}" = "yes")
dnl
dnl QMI support (enabled by default)