blob: ab2886a7db88265a913595a36af310ad0f38025e [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
Dan Williamsbef9c482009-02-10 06:48:56 -050063AC_ARG_ENABLE(more-warnings,
64AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)
65AC_MSG_CHECKING(for more warnings, including -Werror)
66if 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 Williams71cbcb82009-12-21 11:18:38 -080079 has_option=no)
Dan Williamsbef9c482009-02-10 06:48:56 -050080 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
88else
89 AC_MSG_RESULT(no)
90fi
91
Tambet Ingobe059f72008-07-31 17:14:50 +030092AC_ARG_WITH(docs, AC_HELP_STRING([--with-docs], [Build ModemManager documentation]))
93AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes")
94case $with_docs in
95 yes) ;;
96 *)
97 with_docs=no
98 ;;
99esac
100
Dan Williams216e49f2010-01-05 14:29:19 -0600101dnl
102dnl Tests
103dnl
104AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build ModemManager tests]))
105AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
106case $with_tests in
107 yes)
108 with_tests=yes
109 ;;
110 *)
111 with_tests=no
112 ;;
113esac
114
Tambet Ingocc314582008-07-31 09:43:00 +0300115AC_CONFIG_FILES([
116Makefile
Tambet Ingoda3bbdc2008-09-16 13:03:38 +0300117marshallers/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300118src/Makefile
Dan Williams216e49f2010-01-05 14:29:19 -0600119src/tests/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300120plugins/Makefile
Tambet Ingof0a2dc62008-07-31 14:03:37 +0300121test/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300122introspection/Makefile
Tambet Ingocc314582008-07-31 09:43:00 +0300123])
124AC_OUTPUT
Dan Williams71cbcb82009-12-21 11:18:38 -0800125
126echo
127echo Building with D-Bus system directory: ${DBUS_SYS_DIR}
128echo
129echo Building with udev base directory: ${UDEV_BASE_DIR}
130echo
131echo Building documentation: ${with_docs}
132echo
133echo Building PPP-enabled tests: ${have_pppd_headers}
134echo
135