Add doc/version.xml.in file
[framework/connectivity/connman.git] / configure.ac
1 AC_PREREQ(2.50)
2 AC_INIT()
3
4 AM_INIT_AUTOMAKE(connman, 0.0)
5 AM_CONFIG_HEADER(config.h)
6
7 AM_MAINTAINER_MODE
8
9 AC_PREFIX_DEFAULT(/usr/local)
10
11 if (test "${CFLAGS}" = ""); then
12         CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2"
13 fi
14
15 AC_LANG_C
16
17 AC_PROG_CC
18 AC_PROG_CC_PIE
19 AC_PROG_INSTALL
20
21 m4_define([_LT_AC_TAGCONFIG], [])
22 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
23
24 AC_DISABLE_STATIC
25 AC_PROG_LIBTOOL
26
27 GTK_DOC_CHECK
28
29 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
30                         [enable compiling with debugging information]), [
31         if (test "${enableval}" = "yes" &&
32                                 test "${ac_cv_prog_cc_g}" = "yes"); then
33                 CFLAGS="$CFLAGS -g -O0"
34         fi
35 ])
36
37 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
38                         [enable position independent executables flag]), [
39         if (test "${enableval}" = "yes" &&
40                                 test "${ac_cv_prog_cc_pie}" = "yes"); then
41                 CFLAGS="$CFLAGS -fPIE"
42                 LDFLAGS="$LDFLAGS -pie"
43         fi
44 ])
45
46 AC_PATH_PROG(DHCLIENT, [dhclient])
47 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant])
48
49 PKG_CHECK_MODULES(GLIB, glib-2.0, dummy=yes,
50                                 AC_MSG_ERROR(glib is required))
51 AC_SUBST(GLIB_CFLAGS)
52 AC_SUBST(GLIB_LIBS)
53
54 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
55                                 AC_MSG_ERROR(gthread is required))
56 AC_SUBST(GTHREAD_CFLAGS)
57 AC_SUBST(GTHREAD_LIBS)
58
59 PKG_CHECK_MODULES(GMODULE, gmodule-2.0, dummy=yes,
60                                 AC_MSG_ERROR(gmodule is required))
61 AC_SUBST(GMODULE_CFLAGS)
62 AC_SUBST(GMODULE_LIBS)
63
64 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
65                                 AC_MSG_ERROR(libdbus is required))
66 AC_SUBST(DBUS_CFLAGS)
67 AC_SUBST(DBUS_LIBS)
68
69 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
70 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
71
72 PKG_CHECK_MODULES(HAL, hal >= 0.5.8, hal_found=yes, hal_found=no)
73 AC_SUBST(HAL_CFLAGS)
74 AC_SUBST(HAL_LIBS)
75 AM_CONDITIONAL(HAL, test "${hal_found}" = "yes")
76
77 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no)
78 AC_SUBST(POLKIT_CFLAGS)
79 AC_SUBST(POLKIT_LIBS)
80 AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes")
81
82 PKG_CHECK_MODULES(SQLITE, sqlite3, sqlite_found=yes, sqlite_found=no)
83 AC_SUBST(SQLITE_CFLAGS)
84 AC_SUBST(SQLITE_LIBS)
85
86 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
87                 test/Makefile plugins/Makefile scripts/Makefile scripts/connman
88                                 src/connman.service doc/version.xml connman.pc)