blob: 0e37ddd8f56eaa686172c8821b4deabc8dabc77a [file] [log] [blame]
Tambet Ingocc314582008-07-31 09:43:00 +03001AC_PREREQ(2.52)
2
Dan Williamsa919c832010-01-19 15:03:20 -08003AC_INIT(ModemManager, 0.3, dcbw@redhat.com, ModemManager)
Dan Williams3cdfba22009-07-09 11:22:10 -04004AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2])
Tambet Ingocc314582008-07-31 09:43:00 +03005AM_MAINTAINER_MODE
6
Michael Biebl22f6ab42010-01-27 15:48:10 -08007AC_CONFIG_MACRO_DIR([m4])
8
Tambet Ingocc314582008-07-31 09:43:00 +03009AC_CONFIG_HEADERS(config.h)
10
11dnl Required programs
12AC_PROG_CC
13AM_PROG_CC_C_O
14AC_PROG_INSTALL
15AC_PROG_LIBTOOL
16
Dan Williamsf715e0d2009-12-01 11:25:28 -080017PKG_CHECK_MODULES(MM, dbus-glib-1 >= 0.75 glib-2.0 >= 2.18 gmodule-2.0 gobject-2.0)
Dan Williams924814c2009-06-18 14:25:30 -040018
19PKG_CHECK_MODULES(GUDEV, gudev-1.0)
20AC_SUBST(GUDEV_CFLAGS)
21AC_SUBST(GUDEV_LIBS)
Tambet Ingocc314582008-07-31 09:43:00 +030022
Tambet Ingoa93f0842008-08-13 10:05:31 +030023AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
24
25if test -n "$with_dbus_sys_dir" ; then
26 DBUS_SYS_DIR="$with_dbus_sys_dir"
27else
28 DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
29fi
30AC_SUBST(DBUS_SYS_DIR)
31
Dan Williams50105ae2009-07-07 10:45:44 -040032AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is]))
33
34if test -n "$with_udev_base_dir" ; then
35 UDEV_BASE_DIR="$with_udev_base_dir"
36else
37 UDEV_BASE_DIR="/lib/udev"
38fi
39AC_SUBST(UDEV_BASE_DIR)
40
Tambet Ingoda3bbdc2008-09-16 13:03:38 +030041GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
42AC_SUBST(GLIB_GENMARSHAL)
43
Dan Williams71cbcb82009-12-21 11:18:38 -080044# PPPD
45AC_CHECK_HEADERS(pppd/pppd.h, have_pppd_headers="yes", have_pppd_headers="no")
46AM_CONDITIONAL(HAVE_PPPD_H, test "x$have_pppd_headers" = "xyes")
47case $have_pppd_headers in
48 yes) ;;
49 *)
50 have_pppd_headers=no
51 ;;
52esac
53
54AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
55
Dan Williamsa8fc7ec2009-12-20 00:17:12 -080056if test -n "$with_pppd_plugin_dir" ; then
57 PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
58else
59 PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.4"
60fi
61AC_SUBST(PPPD_PLUGIN_DIR)
62
Tambet Ingobe059f72008-07-31 17:14:50 +030063AC_ARG_WITH(docs, AC_HELP_STRING([--with-docs], [Build ModemManager documentation]))
64AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes")
65case $with_docs in
66 yes) ;;
67 *)
68 with_docs=no
69 ;;
70esac
71
Dan Williams216e49f2010-01-05 14:29:19 -060072dnl
73dnl Tests
74dnl
75AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build ModemManager tests]))
76AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
77case $with_tests in
78 yes)
79 with_tests=yes
80 ;;
81 *)
82 with_tests=no
83 ;;
84esac
85
Michael Biebl22e68782010-01-27 15:48:55 -080086NM_COMPILER_WARNINGS
87
Tambet Ingocc314582008-07-31 09:43:00 +030088AC_CONFIG_FILES([
89Makefile
Tambet Ingoda3bbdc2008-09-16 13:03:38 +030090marshallers/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +030091src/Makefile
Dan Williams216e49f2010-01-05 14:29:19 -060092src/tests/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +030093plugins/Makefile
Tambet Ingof0a2dc62008-07-31 14:03:37 +030094test/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +030095introspection/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +030096])
97AC_OUTPUT
Dan Williams71cbcb82009-12-21 11:18:38 -080098
99echo
100echo Building with D-Bus system directory: ${DBUS_SYS_DIR}
101echo
102echo Building with udev base directory: ${UDEV_BASE_DIR}
103echo
104echo Building documentation: ${with_docs}
105echo
106echo Building PPP-enabled tests: ${have_pppd_headers}
107echo
108