build: don't require pppd headers to build

If they're not there, just ignore them and don't build the PPP-enabled
bits of the test tool.
This commit is contained in:
Dan Williams
2009-12-21 11:18:38 -08:00
parent 791faca8fa
commit 71cbcb834c
2 changed files with 28 additions and 1 deletions

View File

@@ -39,6 +39,18 @@ AC_SUBST(UDEV_BASE_DIR)
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL) AC_SUBST(GLIB_GENMARSHAL)
# PPPD
AC_CHECK_HEADERS(pppd/pppd.h, have_pppd_headers="yes", have_pppd_headers="no")
AM_CONDITIONAL(HAVE_PPPD_H, test "x$have_pppd_headers" = "xyes")
case $have_pppd_headers in
yes) ;;
*)
have_pppd_headers=no
;;
esac
AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
if test -n "$with_pppd_plugin_dir" ; then if test -n "$with_pppd_plugin_dir" ; then
PPPD_PLUGIN_DIR="$with_pppd_plugin_dir" PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
else else
@@ -62,7 +74,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_CHECKING([whether gcc understands $option]) AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [], AC_TRY_COMPILE([], [],
has_option=yes, has_option=yes,
has_option=no,) has_option=no)
if test $has_option = no; then if test $has_option = no; then
CFLAGS="$SAVE_CFLAGS" CFLAGS="$SAVE_CFLAGS"
fi fi
@@ -93,3 +105,14 @@ test/Makefile
introspection/Makefile introspection/Makefile
]) ])
AC_OUTPUT AC_OUTPUT
echo
echo Building with D-Bus system directory: ${DBUS_SYS_DIR}
echo
echo Building with udev base directory: ${UDEV_BASE_DIR}
echo
echo Building documentation: ${with_docs}
echo
echo Building PPP-enabled tests: ${have_pppd_headers}
echo

View File

@@ -1,3 +1,5 @@
if HAVE_PPPD_H
pppd_plugindir = $(PPPD_PLUGIN_DIR) pppd_plugindir = $(PPPD_PLUGIN_DIR)
pppd_plugin_LTLIBRARIES = mm-test-pppd-plugin.la pppd_plugin_LTLIBRARIES = mm-test-pppd-plugin.la
@@ -8,6 +10,8 @@ mm_test_pppd_plugin_la_CPPFLAGS = $(MM_CFLAGS)
mm_test_pppd_plugin_la_LDFLAGS = -module -avoid-version mm_test_pppd_plugin_la_LDFLAGS = -module -avoid-version
mm_test_pppd_plugin_la_LIBADD = $(MM_LIBS) mm_test_pppd_plugin_la_LIBADD = $(MM_LIBS)
endif
noinst_PROGRAMS = lsudev noinst_PROGRAMS = lsudev
lsudev_SOURCES = lsudev.c lsudev_SOURCES = lsudev.c
lsudev_CPPFLAGS = $(GUDEV_CFLAGS) lsudev_CPPFLAGS = $(GUDEV_CFLAGS)