Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 1 | AC_PREREQ(2.52) |
| 2 | |
Dan Williams | a919c83 | 2010-01-19 15:03:20 -0800 | [diff] [blame] | 3 | AC_INIT(ModemManager, 0.3, dcbw@redhat.com, ModemManager) |
Dan Williams | 3cdfba2 | 2009-07-09 11:22:10 -0400 | [diff] [blame] | 4 | AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 5 | AM_MAINTAINER_MODE |
| 6 | |
Michael Biebl | 22f6ab4 | 2010-01-27 15:48:10 -0800 | [diff] [blame^] | 7 | AC_CONFIG_MACRO_DIR([m4]) |
| 8 | |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 9 | AC_CONFIG_HEADERS(config.h) |
| 10 | |
| 11 | dnl Required programs |
| 12 | AC_PROG_CC |
| 13 | AM_PROG_CC_C_O |
| 14 | AC_PROG_INSTALL |
| 15 | AC_PROG_LIBTOOL |
| 16 | |
Dan Williams | f715e0d | 2009-12-01 11:25:28 -0800 | [diff] [blame] | 17 | PKG_CHECK_MODULES(MM, dbus-glib-1 >= 0.75 glib-2.0 >= 2.18 gmodule-2.0 gobject-2.0) |
Dan Williams | 924814c | 2009-06-18 14:25:30 -0400 | [diff] [blame] | 18 | |
| 19 | PKG_CHECK_MODULES(GUDEV, gudev-1.0) |
| 20 | AC_SUBST(GUDEV_CFLAGS) |
| 21 | AC_SUBST(GUDEV_LIBS) |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 22 | |
Tambet Ingo | a93f084 | 2008-08-13 10:05:31 +0300 | [diff] [blame] | 23 | AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is])) |
| 24 | |
| 25 | if test -n "$with_dbus_sys_dir" ; then |
| 26 | DBUS_SYS_DIR="$with_dbus_sys_dir" |
| 27 | else |
| 28 | DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d" |
| 29 | fi |
| 30 | AC_SUBST(DBUS_SYS_DIR) |
| 31 | |
Dan Williams | 50105ae | 2009-07-07 10:45:44 -0400 | [diff] [blame] | 32 | AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is])) |
| 33 | |
| 34 | if test -n "$with_udev_base_dir" ; then |
| 35 | UDEV_BASE_DIR="$with_udev_base_dir" |
| 36 | else |
| 37 | UDEV_BASE_DIR="/lib/udev" |
| 38 | fi |
| 39 | AC_SUBST(UDEV_BASE_DIR) |
| 40 | |
Tambet Ingo | da3bbdc | 2008-09-16 13:03:38 +0300 | [diff] [blame] | 41 | GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` |
| 42 | AC_SUBST(GLIB_GENMARSHAL) |
| 43 | |
Dan Williams | 71cbcb8 | 2009-12-21 11:18:38 -0800 | [diff] [blame] | 44 | # PPPD |
| 45 | AC_CHECK_HEADERS(pppd/pppd.h, have_pppd_headers="yes", have_pppd_headers="no") |
| 46 | AM_CONDITIONAL(HAVE_PPPD_H, test "x$have_pppd_headers" = "xyes") |
| 47 | case $have_pppd_headers in |
| 48 | yes) ;; |
| 49 | *) |
| 50 | have_pppd_headers=no |
| 51 | ;; |
| 52 | esac |
| 53 | |
| 54 | AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory])) |
| 55 | |
Dan Williams | a8fc7ec | 2009-12-20 00:17:12 -0800 | [diff] [blame] | 56 | if test -n "$with_pppd_plugin_dir" ; then |
| 57 | PPPD_PLUGIN_DIR="$with_pppd_plugin_dir" |
| 58 | else |
| 59 | PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.4" |
| 60 | fi |
| 61 | AC_SUBST(PPPD_PLUGIN_DIR) |
| 62 | |
Dan Williams | bef9c48 | 2009-02-10 06:48:56 -0500 | [diff] [blame] | 63 | AC_ARG_ENABLE(more-warnings, |
| 64 | AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes) |
| 65 | AC_MSG_CHECKING(for more warnings, including -Werror) |
| 66 | if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then |
| 67 | AC_MSG_RESULT(yes) |
| 68 | CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS" |
| 69 | |
| 70 | for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \ |
| 71 | -Wdeclaration-after-statement -Wstrict-prototypes \ |
| 72 | -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \ |
| 73 | -fno-strict-aliasing; do |
| 74 | SAVE_CFLAGS="$CFLAGS" |
| 75 | CFLAGS="$CFLAGS $option" |
| 76 | AC_MSG_CHECKING([whether gcc understands $option]) |
| 77 | AC_TRY_COMPILE([], [], |
| 78 | has_option=yes, |
Dan Williams | 71cbcb8 | 2009-12-21 11:18:38 -0800 | [diff] [blame] | 79 | has_option=no) |
Dan Williams | bef9c48 | 2009-02-10 06:48:56 -0500 | [diff] [blame] | 80 | if test $has_option = no; then |
| 81 | CFLAGS="$SAVE_CFLAGS" |
| 82 | fi |
| 83 | AC_MSG_RESULT($has_option) |
| 84 | unset has_option |
| 85 | unset SAVE_CFLAGS |
| 86 | done |
| 87 | unset option |
| 88 | else |
| 89 | AC_MSG_RESULT(no) |
| 90 | fi |
| 91 | |
Tambet Ingo | be059f7 | 2008-07-31 17:14:50 +0300 | [diff] [blame] | 92 | AC_ARG_WITH(docs, AC_HELP_STRING([--with-docs], [Build ModemManager documentation])) |
| 93 | AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes") |
| 94 | case $with_docs in |
| 95 | yes) ;; |
| 96 | *) |
| 97 | with_docs=no |
| 98 | ;; |
| 99 | esac |
| 100 | |
Dan Williams | 216e49f | 2010-01-05 14:29:19 -0600 | [diff] [blame] | 101 | dnl |
| 102 | dnl Tests |
| 103 | dnl |
| 104 | AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build ModemManager tests])) |
| 105 | AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes") |
| 106 | case $with_tests in |
| 107 | yes) |
| 108 | with_tests=yes |
| 109 | ;; |
| 110 | *) |
| 111 | with_tests=no |
| 112 | ;; |
| 113 | esac |
| 114 | |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 115 | AC_CONFIG_FILES([ |
| 116 | Makefile |
Tambet Ingo | da3bbdc | 2008-09-16 13:03:38 +0300 | [diff] [blame] | 117 | marshallers/Makefile |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 118 | src/Makefile |
Dan Williams | 216e49f | 2010-01-05 14:29:19 -0600 | [diff] [blame] | 119 | src/tests/Makefile |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 120 | plugins/Makefile |
Tambet Ingo | f0a2dc6 | 2008-07-31 14:03:37 +0300 | [diff] [blame] | 121 | test/Makefile |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 122 | introspection/Makefile |
Tambet Ingo | cc31458 | 2008-07-31 09:43:00 +0300 | [diff] [blame] | 123 | ]) |
| 124 | AC_OUTPUT |
Dan Williams | 71cbcb8 | 2009-12-21 11:18:38 -0800 | [diff] [blame] | 125 | |
| 126 | echo |
| 127 | echo Building with D-Bus system directory: ${DBUS_SYS_DIR} |
| 128 | echo |
| 129 | echo Building with udev base directory: ${UDEV_BASE_DIR} |
| 130 | echo |
| 131 | echo Building documentation: ${with_docs} |
| 132 | echo |
| 133 | echo Building PPP-enabled tests: ${have_pppd_headers} |
| 134 | echo |
| 135 | |