Packaging: add missing dependency on pkgconfig
[profile/ivi/node-startup-controller.git] / configure.ac
1 dnl ***************************
2 dnl *** Version information ***
3 dnl ***************************
4 m4_define([node_startup_controller_version_api_major], [1])
5 m4_define([node_startup_controller_version_major], [1])
6 m4_define([node_startup_controller_version_minor], [0])
7 m4_define([node_startup_controller_version_micro], [2])
8 m4_define([node_startup_controller_version], [node_startup_controller_version_major().node_startup_controller_version_minor().node_startup_controller_version_micro()])
9
10 dnl ***************************
11 dnl *** Initialize autoconf ***
12 dnl ***************************
13 AC_COPYRIGHT([Copyright (c) 2012 GENIVI <genivi-dev@mail.genivi.org>])
14 AC_INIT([node-startup-controller], [node_startup_controller_version], [genivi-dev@mail.genivi.org])
15 AC_PREREQ([2.50])
16 AC_CANONICAL_TARGET()
17
18 dnl ***************************
19 dnl *** Initialize automake ***
20 dnl ***************************
21 AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
22 AC_CONFIG_MACRO_DIR([m4])
23 AC_SUBST([ACLOCAL_AMFLAGS], ["$ACLOCAL_FLAGS -I m4"])
24 AM_CONFIG_HEADER([config.h])
25 AM_MAINTAINER_MODE()
26 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
27
28 dnl **********************************
29 dnl *** Subst node-startup-controller version ***
30 dnl **********************************
31 NODE_STARTUP_CONTROLLER_VERSION_MAJOR=node_startup_controller_version_major()
32 NODE_STARTUP_CONTROLLER_VERSION_MINOR=node_startup_controller_version_minor()
33 NODE_STARTUP_CONTROLLER_VERSION_MICRO=node_startup_controller_version_micro()
34 NODE_STARTUP_CONTROLLER_VERSION_API_MAJOR=node_startup_controller_version_api_major()
35 NODE_STARTUP_CONTROLLER_VERSION_API=$NODE_STARTUP_CONTROLLER_VERSION_API_MAJOR
36 AC_SUBST([NODE_STARTUP_CONTROLLER_VERSION_MAJOR])
37 AC_SUBST([NODE_STARTUP_CONTROLLER_VERSION_MINOR])
38 AC_SUBST([NODE_STARTUP_CONTROLLER_VERSION_MICRO])
39 AC_SUBST([NODE_STARTUP_CONTROLLER_VERSION_API_MAJOR])
40 AC_SUBST([NODE_STARTUP_CONTROLLER_VERSION_API])
41
42 dnl ********************************
43 dnl *** Check for basic programs ***
44 dnl ********************************
45 AM_PROG_AS()
46 AC_PROG_CC()
47 AM_PROG_CC_C_O()
48 AC_PROG_INSTALL()
49
50 dnl ***********************
51 dnl *** Prepare libtool ***
52 dnl ***********************
53 LT_PREREQ([2.2.6])
54 LT_INIT([disable-static])
55
56 dnl ***************************************
57 dnl *** Check for standard header files ***
58 dnl ***************************************
59 AC_HEADER_STDC()
60 AC_CHECK_HEADERS([stdlib.h])
61
62 dnl ************************************
63 dnl *** Check for standard functions ***
64 dnl ************************************
65 AC_CHECK_FUNCS([])
66
67 dnl *************************
68 dnl *** Check for GTK-Doc ***
69 dnl *************************
70 GTK_DOC_CHECK([1.14])
71
72 dnl *******************************
73 dnl *** Check for gdbus-codegen ***
74 dnl *******************************
75 AC_ARG_VAR([GDBUS_CODEGEN], [Tool to generate C bindings from XML D-Bus interface definitions])
76 AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen], [no])
77 if test x"$GDBUS_CODEGEN" = x"no"; then
78   AC_MSG_ERROR([could not find gdbus-codegen in \$PATH. You can run
79   ./configure GDBUS_CODEGEN=/path/to/gdbus-codegen to define
80   a custom location for it.])
81 fi
82
83 dnl ***********************************
84 dnl *** Check for required packages ***
85 dnl ***********************************
86 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.30.0])
87 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.30.0])
88 PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0])
89 PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon >= 183])
90 PKG_CHECK_MODULES([DLT], [automotive-dlt >= 2.2.0])
91
92 dnl *********************************************
93 dnl *** Include GLib/GSettings specific stuff ***
94 dnl *********************************************
95 GLIB_GSETTINGS
96
97 dnl ***********************************
98 dnl *** Check for debugging support ***
99 dnl ***********************************
100 AC_ARG_ENABLE([debug],
101               AC_HELP_STRING([--enable-debug@:@=no|yes@:>@],
102                              [Build with debugging support @<:@default=m4_default([$1], [no])@:>@]),
103               [enable_debug=$enableval], [enable_debug=m4_default([$1], [no])])
104 AC_MSG_CHECKING([whether to build with debugging support])
105 if test x"$enable_debug" = x"yes"; then
106   AC_DEFINE([DEBUG], [1], [Define for debugging support])
107
108   CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
109   CFLAGS="$CFLAGS -Werror -Wall -Wextra \
110             -Wno-missing-field-initializers \
111             -Wno-unused-parameter -Wold-style-definition \
112             -Wdeclaration-after-statement \
113             -Wmissing-declarations \
114             -Wmissing-noreturn -Wpointer-arith \
115             -Wcast-align -Wformat-security \
116             -Winit-self -Wmissing-include-dirs -Wundef \
117             -Wmissing-format-attribute -Wnested-externs \
118             -fstack-protector"
119
120   AC_MSG_RESULT([yes])
121 else
122   AC_MSG_RESULT([no])
123 fi
124
125 dnl ***************************************************
126 dnl *** Configure option for prioritising LUC types ***
127 dnl ***************************************************
128 AC_ARG_WITH([prioritised-luc-types],
129             [AS_HELP_STRING([--with-prioritised-luc-types=LIST],
130                             [Comma-separated list of LUC types to be prioritised during start-up])],
131             [with_prioritised_luc_types=$withval], [with_prioritised_luc_types=])
132 AC_DEFINE_UNQUOTED([PRIORITISED_LUC_TYPES],
133                    ["$with_prioritised_luc_types"],
134                    [Prioritised LUC types])
135
136 AC_OUTPUT([
137 Makefile
138 node-startup-controller/busconf/Makefile
139 node-startup-controller/Makefile
140 common/Makefile
141 docs/Makefile
142 docs/reference/Makefile
143 docs/reference/node-startup-controller/Makefile
144 docs/reference/node-startup-controller/version.xml
145 legacy-app-handler/Makefile
146 nsm-dummy/busconf/Makefile
147 nsm-dummy/Makefile
148 tests/Makefile
149 tests/node-startup-controller/Makefile
150 tests/legacy-app-handler/Makefile
151 ])