2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([murphy], m4_esyscmd([build-aux/git-version-gen .tarball-version]))
8 AC_CONFIG_SRCDIR([src])
9 AC_CONFIG_MACRO_DIR([m4])
10 AC_CONFIG_HEADER([src/config.h])
11 AM_INIT_AUTOMAKE([-Wno-portability])
13 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
15 m4_define(version_major, `echo $VERSION | cut -d. -f1 | cut -d- -f1`)
16 m4_define(version_minor, `echo $VERSION | cut -d. -f2 | cut -d- -f1`)
17 m4_define(version_patch, `echo $VERSION | cut -d. -f3 | cut -d- -f1`)
20 AC_SUBST(VERSION_MAJOR, version_major)
21 AC_SUBST(VERSION_MINOR, version_minor)
22 AC_SUBST(VERSION_PATCH, version_patch)
23 AC_SUBST(VERSION_FULL, version_major.version_minor.version_patch)
25 MURPHY_VERSION_INFO="0:0:0"
26 AC_SUBST(MURPHY_VERSION_INFO)
28 # Disable static libraries.
31 # Checks for programs.
34 # We need AC_PROG_CXX if Qt support is enabled but (at least some
35 # versions of autotools) cannot handle conditional use of this.
46 # Check that we have flex/bison and not lex/yacc.
47 AC_MSG_CHECKING([for flex vs. lex])
50 AC_MSG_ERROR([looks like you're missing flex])
53 AC_MSG_RESULT([ok, looks like we have flex])
56 AC_MSG_ERROR([flex is required])
60 AC_MSG_CHECKING([for bison vs. yacc])
63 AC_MSG_ERROR([looks like you're missing bison])
66 AC_MSG_RESULT([ok, looks like we have bison])
69 AC_MSG_ERROR([bison is required])
73 # Guesstimate native compiler if we're cross-compiling.
74 if test "$cross_compiling" != "no"; then
75 AC_MSG_NOTICE([Looks like we're being cross-compiled...])
76 if test -z "$CC_FOR_BUILD"; then
80 AC_MSG_NOTICE([Looks like we're doing a native compilation...])
83 AC_SUBST(CC_FOR_BUILD)
84 UNSHAVED_CC_FOR_BUILD="$CC_FOR_BUILD"
86 # Make first invocation of PKG_CHECK_MODULES 'if-then-else-fi'-safe.
89 # Checks for libraries.
90 AC_CHECK_LIB([dl], [dlopen dlclose dlsym dlerror])
92 # Checks for header files.
94 AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h sys/statvfs.h sys/vfs.h syslog.h unistd.h])
96 # Checks for typedefs, structures, and compiler characteristics.
106 AC_CHECK_MEMBERS([struct stat.st_rdev])
111 AC_CHECK_TYPES([ptrdiff_t])
113 # Checks for library functions.
114 AC_FUNC_ERROR_AT_LINE
116 if test "$cross_compiling" = "no"; then
120 AC_CHECK_FUNCS([clock_gettime memmove memset regcomp strcasecmp strchr strdup strrchr strtol strtoul])
122 # Check and enable extra compiler warnings if they are supported.
123 AC_ARG_ENABLE(extra-warnings,
124 [ --enable-extra-warnings enable extra compiler warnings],
125 [extra_warnings=$enableval], [extra_warnings=auto])
128 warncflags="-Wall -Wextra"
129 if test "$extra_warnings" != "no"; then
130 save_CPPFLAGS="$CPPFLAGS"
131 for opt in $warncflags; do
132 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
133 [WARNING_CFLAGS="$WARNING_CFLAGS $opt"])
135 CPPFLAGS="$save_CPPFLAGS"
138 AC_SUBST(WARNING_CFLAGS)
140 # By default try to find the system default Lua (assumed to be
141 # called lua(.pc). If that is not found, try to look for
142 # packages lua5.2 and lua5.1, which can be found in Debian-based
145 # You can override this using the --with-lua option. For instance
146 # to use Lua 5.1 on Ubuntu while having 5.2 installed, you'd use
149 [ --with-lua build with specified Lua (pkgconfig filename without .pc suffix)],
150 [with_lua=$withval], [with_lua=default])
152 if test "x$with_lua" = "xdefault"; then
153 # Check for "lua" first, then "lua5.2" and finally for "lua5.1"
154 AC_MSG_NOTICE([Checking for an installed Lua...])
155 PKG_CHECK_MODULES([LUA], [lua >= 5.1.1],
157 [PKG_CHECK_MODULES([LUA52], [lua5.2],
159 LUA_CFLAGS=$LUA52_CFLAGS
160 LUA_LIBS=$LUA52_LIBS],
161 [PKG_CHECK_MODULES([LUA51], [lua5.1 >= 5.1.1],
163 LUA_CFLAGS=$LUA51_CFLAGS
164 LUA_LIBS=$LUA51_LIBS],
165 [AC_MSG_ERROR(Package requirement (lua >= 5.1.1) was not met!)])
169 # Check for pre-defined Lua.
170 AC_MSG_NOTICE([Compiling with Lua package $with_lua.])
171 PKG_CHECK_MODULES(LUA, $with_lua >= 5.1.1)
177 # Check if potentially GPL bits are allowed to be enabled.
179 [ --enable-gpl enable linking against GPL code],
180 [enable_gpl=$enableval], [enable_gpl=no])
182 # Check if original libdbus-based DBUS support was enabled.
183 AC_ARG_ENABLE(libdbus,
184 [ --enable-libdbus enable libdbus-based D-BUS support],
185 [enable_libdbus=$enableval], [enable_libdbus=no])
187 if test "$enable_libdbus" = "yes"; then
188 if test "$enable_gpl" = "no"; then
189 AC_MSG_ERROR([libdbus D-Bus support requires the --enable-gpl option.])
191 PKG_CHECK_MODULES(LIBDBUS, dbus-1 >= 0.70)
193 DBUS_SESSION_DIR="`pkg-config --variable session_bus_services_dir dbus-1`"
194 AC_SUBST(DBUS_SESSION_DIR)
196 AC_DEFINE([LIBDBUS_ENABLED], 1, [Enable libdbus D-Bus support ?])
198 AC_MSG_NOTICE([libdbus-based D-Bus support is disabled.])
201 AM_CONDITIONAL(LIBDBUS_ENABLED, [test "$enable_libdbus" = "yes"])
202 AC_SUBST(LIBDBUS_ENABLED)
203 AC_SUBST(LIBDBUS_CFLAGS)
204 AC_SUBST(LIBDBUS_LIBS)
206 # Check if systemd-bus-based D-Bus support was enabled.
208 [ --enable-sdbus enable systemd-based D-BUS support],
209 [enable_sdbus=$enableval], [enable_sdbus=no])
211 if test "$enable_sdbus" = "yes"; then
212 PKG_CHECK_MODULES(SDBUS, libsystemd-bus)
213 AC_DEFINE([SDBUS_ENABLED], 1, [Enable systemd-bus support ?])
215 if test -z "$DBUS_SESSION_DIR"; then
216 # Try to determine the session bus service directory.
217 DBUS_SESSION_DIR="`pkg-config --variable \
218 session_bus_services_dir dbus-1`"
219 if test "$?" != "0" -o -z "$DBUS_SESSION_DIR"; then
220 DBUS_SESSION_DIR="/usr/share/dbus-1/services"
222 AC_SUBST(DBUS_SESSION_DIR)
225 AC_MSG_NOTICE([libsystemd-bus based D-Bus support is disabled.])
228 AM_CONDITIONAL(SDBUS_ENABLED, [test "$enable_sdbus" = "yes"])
229 AC_SUBST(SDBUS_ENABLED)
230 AC_SUBST(SDBUS_CFLAGS)
233 # Check if PulseAudio mainloop support was enabled.
235 [ --enable-pulse enable PulseAudio mainloop support],
236 [enable_pulse=$enableval], [enable_pulse=auto])
238 if test "$enable_pulse" != "no"; then
239 PKG_CHECK_MODULES(PULSE, libpulse >= 0.9.22,
240 [have_pulse=yes], [have_pulse=no])
241 if test "$have_pulse" = "no" -a "$enable_pulse" = "yes"; then
242 AC_MSG_ERROR([PulseAudio development libraries not found.])
245 if test "$enable_gpl" = "no"; then
246 if test "$enable_pulse" = "yes"; then
247 AC_MSG_ERROR([PulseAudio support requires the --enable-gpl option.])
252 enable_pulse="$have_pulse"
255 AC_MSG_NOTICE([PulseAudio mainloop support is disabled.])
258 if test "$enable_pulse" = "yes"; then
259 AC_DEFINE([PULSE_ENABLED], 1, [Enable PulseAudio mainloop support ?])
261 AM_CONDITIONAL(PULSE_ENABLED, [test "$enable_pulse" = "yes"])
262 AC_SUBST(PULSE_ENABLED)
263 AC_SUBST(PULSE_CFLAGS)
266 # Check if EFL/ecore mainloop support was enabled.
268 [ --enable-ecore enable EFL/ecore mainloop support],
269 [enable_ecore=$enableval], [enable_ecore=auto])
272 if test "$enable_ecore" != "no"; then
273 # We are using features which are present only at ecore 1.2 onwards.
274 PKG_CHECK_MODULES(ECORE, ecore >= 1.2,
275 [have_ecore=yes], [have_ecore=no])
276 if test "$have_ecore" = "no" -a "$enable_ecore" = "yes"; then
277 AC_MSG_ERROR([EFL/ecore development libraries not found.])
280 enable_ecore="$have_ecore"
282 AC_MSG_NOTICE([EFL/ecore mainloop support is disabled.])
285 if test "$enable_ecore" = "yes"; then
286 AC_DEFINE([ECORE_ENABLED], 1, [Enable EFL/ecore mainloop support ?])
288 AM_CONDITIONAL(ECORE_ENABLED, [test "$enable_ecore" = "yes"])
289 AC_SUBST(ECORE_ENABLED)
290 AC_SUBST(ECORE_CFLAGS)
293 # Check if glib mainloop support was enabled.
295 [ --enable-glib enable glib mainloop support],
296 [enable_glib=$enableval], [enable_glib=auto])
298 if test "$enable_glib" != "no"; then
299 PKG_CHECK_MODULES(GLIB, glib-2.0,
300 [have_glib=yes], [have_glib=no])
301 if test "$have_glib" = "no" -a "$enable_glib" = "yes"; then
302 AC_MSG_ERROR([glib development libraries not found.])
305 enable_glib="$have_glib"
307 AC_MSG_NOTICE([glib mainloop support is disabled.])
310 if test "$enable_glib" = "yes"; then
311 AC_DEFINE([GLIB_ENABLED], 1, [Enable glib mainloop support ?])
313 AM_CONDITIONAL(GLIB_ENABLED, [test "$enable_glib" = "yes"])
314 AC_SUBST(GLIB_ENABLED)
315 AC_SUBST(GLIB_CFLAGS)
318 # Check if qt mainloop support was enabled.
320 [ --enable-qt enable qt mainloop support],
321 [enable_qt=$enableval], [enable_qt=auto])
323 if test "$enable_qt" != "no"; then
324 PKG_CHECK_MODULES(QTCORE, QtCore,
325 [have_qt=yes], [have_qt=no])
326 if test "$have_qt" = "no" -a "$enable_qt" = "yes"; then
327 AC_MSG_ERROR([Qt(Core) development libraries not found.])
332 AC_MSG_NOTICE([Qt mainloop support is disabled.])
335 if test "$enable_qt" = "yes"; then
336 AC_DEFINE([QT_ENABLED], 1, [Enable qt mainloop support ?])
337 QT_MOC="`pkg-config --variable moc_location QtCore`"
340 AM_CONDITIONAL(QT_ENABLED, [test "$enable_qt" = "yes"])
342 AC_SUBST(QTCORE_CFLAGS)
343 AC_SUBST(QTCORE_LIBS)
345 # Check if building murphy-console was enabled.
346 AC_ARG_ENABLE(console,
347 [ --enable-console build Murphy console],
348 [enable_console=$enableval], [enable_console=yes])
350 if test "$enable_console" = "no"; then
351 AC_MSG_NOTICE([Murphy console binary is disabled.])
353 AC_MSG_NOTICE([Murphy console binary is enabled.])
356 if test "$enable_console" = "yes"; then
357 AC_DEFINE([CONSOLE_ENABLED], 1, [Build Murphy console ?])
359 AM_CONDITIONAL(CONSOLE_ENABLED, [test "$enable_console" = "yes"])
360 AC_SUBST(CONSOLE_ENABLED)
361 AC_SUBST(READLINE_CFLAGS)
362 AC_SUBST(READLINE_LIBS)
364 # Check for json(-c).
365 PKG_CHECK_MODULES(JSON, [json], [have_json=yes], [have_json=no])
367 if test "$have_json" = "no"; then
368 PKG_CHECK_MODULES(JSON, [json-c >= 0.11])
371 AC_MSG_CHECKING([if json-c has headers under json-c include path])
372 saved_CFLAGS="$CFLAGS"
374 CFLAGS="${JSON_CFLAGS}"
378 [[#include <../json-c/json.h>]],
380 [json_include_jsonc=yes],
381 [json_include_jsonc=no])
382 AC_MSG_RESULT([$json_include_jsonc])
383 CFLAGS="$saved_CFLAGS"
386 if test "$json_include_jsonc" = "yes"; then
387 AC_DEFINE([JSON_INCLUDE_PATH_JSONC], 1, [json headers under json-c ?])
390 AC_MSG_CHECKING([for json_tokener_get_error()])
391 saved_CFLAGS="$CFLAGS"
393 CFLAGS="${JSON_CFLAGS}"
397 [[#include <json.h>]],
398 [[json_tokener *tok = NULL;
399 if (json_tokener_get_error(tok) != json_tokener_success)
403 [have_json_tokener_get_error=yes],
404 [have_json_tokener_get_error=no])
405 AC_MSG_RESULT([$have_json_tokener_get_error])
406 CFLAGS="$saved_CFLAGS"
409 if test "$have_json_tokener_get_error" = "yes"; then
410 AC_DEFINE([HAVE_JSON_TOKENER_GET_ERROR], 1, [json_tokener_get_error ?])
413 # Check if websocket support was/can be enabled.
416 # Check if SMACK support should be enabled.
418 [ --enable-smack enable SMACK support],
419 [enable_smack=$enableval], [enable_smack=auto])
421 if test "$enable_smack" != "no"; then
422 PKG_CHECK_MODULES(SMACK, libsmack, [have_smack=yes], [have_smack=no])
423 if test "$have_smack" = "no" -a "$enable_smack" = "yes"; then
424 AC_MSG_ERROR([SMACK development libraries not found.])
427 enable_smack="$have_smack"
429 AC_MSG_NOTICE([SMACK support is disabled.])
432 if test "$enable_smack" = "yes"; then
433 AC_DEFINE([SMACK_ENABLED], 1, [Enable SMACK support ?])
435 AM_CONDITIONAL(SMACK_ENABLED, [test "$enable_smack" = "yes"])
436 AC_SUBST(SMACK_ENABLED)
437 AC_SUBST(SMACK_CFLAGS)
440 # Check if systemd support should be enabled.
441 AC_ARG_ENABLE(systemd,
442 [ --enable-systemd enable systemd support],
443 [enable_systemd=$enableval], [enable_systemd=auto])
445 if test "$enable_systemd" != "no"; then
446 PKG_CHECK_MODULES(SYSTEMD, libsystemd-journal libsystemd-daemon,
447 [have_systemd=yes], [have_systemd=no])
448 if test "$have_systemd" = "no" -a "$enable_systemd" = "yes"; then
449 AC_MSG_ERROR([systemd development libraries not found.])
452 enable_systemd="$have_systemd"
454 AC_MSG_NOTICE([systemd support is disabled.])
457 if test "$enable_systemd" = "yes"; then
458 AC_DEFINE([SYSTEMD_ENABLED], 1, [Enable systemd support ?])
460 AM_CONDITIONAL(SYSTEMD_ENABLED, [test "$enable_systemd" = "yes"])
461 AC_SUBST(SYSTEMD_ENABLED)
462 AC_SUBST(SYSTEMD_CFLAGS)
463 AC_SUBST(SYSTEMD_LIBS)
465 # Check if telephony was enabled.
466 AC_ARG_ENABLE(telephony,
467 [ --enable-telephony enable telephony support],
468 [enable_telephony=$enableval], [enable_telephony=no])
470 if test "$enable_telephony" = "yes"; then
471 if test "$enable_gpl" = "no"; then
472 AC_MSG_ERROR([Telephony support requires the --enable-gpl option.])
474 PKG_CHECK_MODULES(OFONO, ofono >= 1.1)
476 AC_MSG_NOTICE([Telephony support is disabled.])
479 if test "$enable_telephony" = "yes"; then
480 AC_DEFINE([TELEPHONY_ENABLED], 1, [Enable D-BUS support ?])
483 AM_CONDITIONAL(TELEPHONY_ENABLED, [test "$enable_telephony" = "yes"])
484 AC_SUBST(TELEPHONY_ENABLED)
485 AC_SUBST(TELEPHONY_CFLAGS)
486 AC_SUBST(TELEPHONY_LIBS)
488 PKG_CHECK_MODULES(AUL, aul,
489 [have_aul=yes], [have_aul=no])
490 enable_aul="$have_aul"
491 if test "$enable_aul" = "yes"; then
492 AC_DEFINE([AUL_ENABLED], 1, [Enable Application Utility Library support ?])
494 AM_CONDITIONAL(AUL_ENABLED, [test "$enable_aul" = "yes"])
495 AC_SUBST(AUL_ENABLED)
499 PKG_CHECK_MODULES(TZCONFIG, libtzplatform-config,
500 [have_tzconfig=yes], [have_tzconfig=no])
501 enable_tzconfig="$have_tzconfig"
502 if test "$enable_tzconfig" = "yes"; then
503 AC_DEFINE([TZCONFIG_ENABLED], 1, [Enable Tizen configuration support ?])
505 AM_CONDITIONAL(TZCONFIG_ENABLED, [test "$enable_tzconfig" = "yes"])
506 AC_SUBST(TZCONFIG_ENABLED)
507 AC_SUBST(TZCONFIG_CFLAGS)
508 AC_SUBST(TZCONFIG_LIBS)
510 # Check if system-controller (plugin) support should be enabled.
511 AC_ARG_ENABLE(system-controller,
512 [ --enable-system-controller enable system-controller support],
513 [enable_systemctl=$enableval], [enable_systemctl=no])
515 if test "$enable_systemctl" = "yes"; then
516 if test "$enable_websockets" != "yes"; then
517 AC_MSG_ERROR([System controller requires websocket support.])
519 if test "$have_aul" != "yes"; then
520 AC_MSG_ERROR([System controller requires AUL support.])
522 AC_MSG_NOTICE([System-controller support is enabled.])
523 AC_DEFINE([SYSTEMCTL_ENABLED], 1, [Enable system-controller support ?])
524 PKG_CHECK_MODULES(WAYLAND_CLIENT, wayland-client)
525 PKG_CHECK_MODULES(LIBXML2, libxml-2.0)
527 IVI_EXTENSION_PROTOCOL, ivi-extension-protocol,
528 [weston_ico_plugins=no], [weston_ico_plugins=yes]
530 AC_CHECK_HEADER([ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h])
531 if test "$weston_ico_plugins" != "yes"; then
532 AC_MSG_NOTICE([System-controller uses GENIVI shell.])
534 PKG_CHECK_MODULES(AIL, ail)
536 AC_MSG_NOTICE([System-controller support is disabled.])
539 AM_CONDITIONAL(SYSTEMCTL_ENABLED, [test "$enable_systemctl" = "yes"])
540 AM_CONDITIONAL(WESTON_ICO_PLUGINS,[test "$weston_ico_plugins" = "yes"])
541 AC_SUBST(SYSTEMCTL_ENABLED)
542 AC_SUBST(WESTON_ICO_PLUGINS)
543 AC_SUBST(WAYLAND_CLIENT_CFLAGS)
544 AC_SUBST(WAYLAND_CLIENT_LIBS)
545 AC_SUBST(IVI_EXTENSION_PROTOCOL_CFLAGS)
546 AC_SUBST(IVI_EXTENSION_PROTOCOL_LIBS)
547 AC_SUBST(LIBXML2_CFLAGS)
548 AC_SUBST(LIBXML2_LIBS)
552 # Check if system-monitor (plugin) support should be enabled.
553 AC_ARG_ENABLE(system-monitor,
554 [ --enable-system-monitor enable system-monitor support],
555 [enable_sysmon=$enableval], [enable_sysmon=yes])
557 if test "$enable_sysmon" = "yes"; then
558 AC_MSG_NOTICE([System-monitor support is enabled.])
559 AC_DEFINE([SYSMON_ENABLED], 1, [Enable system-monitor support ?])
561 AC_MSG_NOTICE([System-monitor support is disabled.])
564 AM_CONDITIONAL(SYSMON_ENABLED, [test "$enable_sysmon" = "yes"])
565 AC_SUBST(SYSMON_ENABLED)
568 # Check if dlog support was enabled.
570 [ --enable-dlog enable dlog support],
571 [enable_dlog=$enableval], [enable_dlog=auto])
573 if test "$enable_dlog" != "no"; then
574 PKG_CHECK_MODULES(DLOG, dlog,
575 [have_dlog=yes], [have_dlog=no])
576 if test "$have_dlog" = "no" -a "$enable_dlog" = "yes"; then
577 AC_MSG_ERROR([dlog development libraries not found.])
580 enable_dlog="$have_dlog"
582 AC_MSG_NOTICE([dlog support is disabled.])
585 if test "$enable_dlog" = "yes"; then
586 AC_DEFINE([DLOG_ENABLED], 1, [Enable dlog support ?])
588 AM_CONDITIONAL(DLOG_ENABLED, [test "$enable_dlog" = "yes"])
589 AC_SUBST(DLOG_ENABLED)
590 AC_SUBST(DLOG_CFLAGS)
593 # Check if Audio Session Manager plugin was enabled.
594 AC_ARG_ENABLE(resource-asm,
595 [ --enable-resource-asm build Murphy Audio Session Manager plugin],
596 [enable_resource_asm=$enableval], [enable_resource_asm=no])
598 if test "$enable_resource_asm" != "no"; then
599 PKG_CHECK_MODULES(AUDIO_SESSION_MANAGER, audio-session-mgr,
600 [have_resource_asm=yes], [have_resource_asm=no])
601 if test "$have_resource_asm" = "no" -a "$enable_resource_asm" = "yes"; then
602 AC_MSG_ERROR([Audio Session Manager development libraries not found.])
604 AC_SUBST(AUDIO_SESSION_MANAGER_CFLAGS)
605 AC_SUBST(AUDIO_SESSION_MANAGER_LIBS)
607 enable_resource_asm="$have_resource_asm"
609 AC_MSG_NOTICE([Audio Session Manager support is disabled.])
611 if test "$enable_resource_asm" = "yes"; then
612 AC_DEFINE([RESOURCE_ASM_ENABLED], 1, [Enable Audio Session Manager support ?])
614 AM_CONDITIONAL(RESOURCE_ASM_ENABLED, [test "$enable_resource_asm" = "yes"])
615 AC_SUBST(RESOURCE_ASM_ENABLED)
617 # Set up murphy CFLAGS and LIBS.
620 AC_SUBST(MURPHY_CFLAGS)
621 AC_SUBST(MURPHY_LIBS)
623 # Allow substitution for LIBDIR and SYSCONFDIR.
624 AC_MSG_CHECKING([libdir])
625 AC_MSG_RESULT([$libdir])
626 AC_SUBST(LIBDIR, [$libdir])
627 AC_MSG_CHECKING([sysconfdir])
628 AC_MSG_RESULT([$sysconfdir])
629 AC_SUBST(SYSCONFDIR, [$sysconfdir])
631 #Check whether we build resources or not
632 AC_ARG_WITH(resources,
633 [ --with-resources wheter to build resource management support],
634 [with_resources=$withval],[with_resources=yes])
636 AM_CONDITIONAL(BUILD_RESOURCES, [ test x$with_resources = "xyes" ])
639 # Check which plugins should be disabled.
640 AC_ARG_WITH(disabled-plugins,
641 [ --with-disabled-plugins=<plugin-list> specify which plugins to disable],
642 [disabled_plugins=$withval],[disabled_plugins=none])
644 # Check which plugins should be compiled as standalone DSOs.
645 AC_ARG_WITH(dynamic-plugins,
646 [ --with-dynamic-plugins=<plugin-list> specify which plugins compile as DSOs],
647 [dynamic_plugins=$withval],[dynamic_plugins=none])
649 all_plugins=$(find src/plugins/. -name plugin-*.c 2>/dev/null | \
650 sed 's#^.*/plugin-##g;s#\.c$##g' | tr '\n' ' ')
652 #echo "all plugins: [$all_plugins]"
654 case $dynamic_plugins in
655 all) dynamic_plugins="$all_plugins";;
656 none) dynamic_plugins="";;
662 for plugin in $all_plugins; do
665 for p in ${dynamic_plugins//,/ }; do
666 if test "$plugin" = "$p"; then
671 for p in ${disabled_plugins//,/ }; do
672 if test "$plugin" = "$p"; then
678 internal) internal="$internal$it$plugin"; it=" ";;
679 external) external="$external$et$plugin"; et=" ";;
680 disabled) disabled="$disabled$dt$plugin"; dt=" ";;
684 DISABLED_PLUGINS="$disabled"
685 INTERNAL_PLUGINS="$internal"
686 EXTERNAL_PLUGINS="$external"
689 function check_if_disabled() {
690 for p in $DISABLED_PLUGINS; do
691 if test "$1" = "$p"; then
699 function check_if_internal() {
700 for p in $INTERNAL_PLUGINS; do
701 if test "$1" = "$p"; then
709 AM_CONDITIONAL(DISABLED_PLUGIN_TEST, [check_if_disabled test])
710 AM_CONDITIONAL(DISABLED_PLUGIN_DBUS, [check_if_disabled dbus])
711 AM_CONDITIONAL(DISABLED_PLUGIN_GLIB, [check_if_disabled glib])
712 AM_CONDITIONAL(DISABLED_PLUGIN_CONSOLE, [check_if_disabled console])
713 AM_CONDITIONAL(DISABLED_PLUGIN_DLOG, [check_if_disabled dlog])
714 AM_CONDITIONAL(DISABLED_PLUGIN_RESOURCE_DBUS, [check_if_disabled resource-dbus])
715 AM_CONDITIONAL(DISABLED_PLUGIN_RESOURCE_WRT, [check_if_disabled resource-wrt])
716 AM_CONDITIONAL(DISABLED_PLUGIN_AMB, [check_if_disabled amb])
717 AM_CONDITIONAL(DISABLED_PLUGIN_DOMAIN_CONTROL,
718 [check_if_disabled domain-control])
719 AM_CONDITIONAL(DISABLED_PLUGIN_SYSTEMD, [check_if_disabled systemd])
720 AM_CONDITIONAL(DISABLED_PLUGIN_TELEPHONY, [check_if_disabled telephony])
721 AM_CONDITIONAL(DISABLED_PLUGIN_RESOURCE_ASM, [check_if_disabled resource-asm])
722 AM_CONDITIONAL(DISABLED_PLUGIN_SYSTEMCTL, [test $enable_systemctl != yes])
723 AM_CONDITIONAL(DISABLED_PLUGIN_SYSMON, [test $enable_sysmon != yes])
725 AM_CONDITIONAL(BUILTIN_PLUGIN_TEST, [check_if_internal test])
726 AM_CONDITIONAL(BUILTIN_PLUGIN_DBUS, [check_if_internal dbus])
727 AM_CONDITIONAL(BUILTIN_PLUGIN_GLIB, [check_if_internal glib])
728 AM_CONDITIONAL(BUILTIN_PLUGIN_CONSOLE, [check_if_internal console])
729 AM_CONDITIONAL(BUILTIN_PLUGIN_DLOG, [check_if_internal dlog])
730 AM_CONDITIONAL(BUILTIN_PLUGIN_RESOURCE_DBUS, [check_if_internal resource-dbus])
731 AM_CONDITIONAL(BUILTIN_PLUGIN_RESOURCE_WRT, [check_if_internal resource-wrt])
732 AM_CONDITIONAL(BUILTIN_PLUGIN_AMB, [check_if_internal amb])
733 AM_CONDITIONAL(BUILTIN_PLUGIN_DOMAIN_CONTROL,
734 [check_if_internal domain-control])
735 AM_CONDITIONAL(BUILTIN_PLUGIN_LUA, [check_if_internal lua])
736 AM_CONDITIONAL(BUILTIN_PLUGIN_SYSTEMD, [check_if_internal systemd])
737 AM_CONDITIONAL(BUILTIN_PLUGIN_TELEPHONY, [check_if_internal telephony])
738 AM_CONDITIONAL(BUILTIN_PLUGIN_RESOURCE_ASM, [check_if_internal resource-asm])
739 AM_CONDITIONAL(BUILTIN_PLUGIN_SYSTEMCTL, [check_if_internal system-controller])
740 AM_CONDITIONAL(BUILTIN_PLUGIN_SYSMON, [check_if_internal system-monitor])
742 # Check for Check (unit test framework).
743 PKG_CHECK_MODULES(CHECK,
745 [has_check="yes"], [has_check="no"])
746 AM_CONDITIONAL(HAVE_CHECK, test "x$has_check" = "xyes")
748 AC_SUBST(CHECK_CFLAGS)
751 if test "x$has_check" = "xno"; then
752 AC_MSG_WARN([Check framework not found, unit tests are DISABLED.])
755 # Check for documentation tools
756 AC_ARG_WITH([documentation],
757 [AS_HELP_STRING([--with-documentation],
758 [generate pdf, html and other doc files])],
760 [with_documentation=auto]
763 AS_IF( [ test x$with_documentation = xno ],
764 [ has_doc_tools="no" ],
765 [ AC_PATH_TOOL([MRP_DOXYGEN], doxygen)
766 AC_PATH_TOOL([MRP_LYX], lyx)
767 AC_PATH_TOOL([MRP_INKSCAPE], inkscape)
768 AC_PATH_TOOL([MRP_PYTHON], python)
769 AC_PATH_TOOL([MRP_TOUCH], touch)
770 AC_PATH_TOOL([MRP_DBLATEX], dblatex)
771 AC_PATH_TOOL([MRP_XMLTO], xmlto)
773 AS_IF( [ test x$MRP_DOXYGEN = x -o x$MRP_LYX = x -o \
774 x$MRP_INKSCAPE = x -o x$MRP_PYTHON = x -o \
776 [ has_doc_tools="no";
777 AC_MSG_WARN([Some essential doc-tool is missing]) ],
778 [ has_doc_tools="yes";
783 AS_IF( [ test x$has_doc_tools == "xno" -o x$MRP_DBLATEX = x ],
784 [ can_make_pdfs="no";
785 AC_WARN([No PDF documentation will be generated]) ],
786 [ can_make_pdfs="yes"]
789 AS_IF([ test x$has_doc_tools == "xno" -o x$MRP_XMLTO = x ],
790 [ can_make_html="no";
791 AC_WARN([No HTML documentation will be generated]) ],
792 [ can_make_html="yes" ]
796 AM_CONDITIONAL(BUILD_DOCUMENTATION, [ test x$has_doc_tools = "xyes" ])
797 AM_CONDITIONAL(BUILD_PDF_DOCUMENTS, [ test x$can_make_pdfs = "xyes" ])
798 AM_CONDITIONAL(BUILD_HTML_DOCUMENTS, [ test x$can_make_html = "xyes" ])
800 AC_SUBST(MRP_DOCDIR, [`pwd`/doc])
801 AC_SUBST(MRP_FIGDIR, [$MRP_DOCDIR/common/figures])
802 AC_SUBST(MRP_MAKE_DOCRULES, [$MRP_DOCDIR/Makefile.rules])
803 AC_SUBST(MRP_DOCSCRIPT_DIR, [$MRP_DOCDIR/scripts])
804 AC_SUBST(MRP_ABNF, [$MRP_DOCSCRIPT_DIR/abnf.py])
805 AC_SUBST(MRP_DBLYXFIX, [$MRP_DOCSCRIPT_DIR/dblyxfix.py])
806 AC_SUBST(MRP_DOXML2DB, [$MRP_DOCSCRIPT_DIR/doxml2db.py])
807 AC_SUBST(MRP_DOXYDEPS, [$MRP_DOCSCRIPT_DIR/doxydeps.py])
811 SHAVE_INIT([build-aux], [enable])
813 # Create murphy symlink to match domain controller's
814 # placing with how it is installed.
815 if test ! -L murphy/domain-control; then
816 AC_MSG_NOTICE([Symlinking src/plugins/domain-control to src/domain-control...])
818 ln -s plugins/domain-control domain-control
822 # Create murphy symlink to src.
823 if test ! -L murphy; then
824 AC_MSG_NOTICE([Symlinking src to murphy...])
829 AC_CONFIG_FILES([build-aux/shave
830 build-aux/shave-libtool
834 src/common/tests/Makefile
835 src/core/tests/Makefile
836 src/core/lua-decision/tests/Makefile
837 src/daemon/tests/Makefile
838 src/plugins/tests/Makefile
839 src/common/murphy-common.pc
840 src/common/murphy-libdbus.pc
841 src/common/murphy-dbus-libdbus.pc
842 src/common/murphy-dbus-sdbus.pc
843 src/common/murphy-pulse.pc
844 src/common/murphy-ecore.pc
845 src/common/murphy-glib.pc
846 src/common/murphy-qt.pc
847 src/core/murphy-core.pc
848 src/core/lua-utils/murphy-lua-utils.pc
849 src/core/lua-decision/murphy-lua-decision.pc
850 src/breedline/breedline.pc
851 src/breedline/breedline-murphy.pc
852 src/breedline/breedline-glib.pc
853 src/breedline/tests/Makefile
854 src/murphy-db/Makefile
855 src/murphy-db/mdb/Makefile
856 src/murphy-db/mqi/Makefile
857 src/murphy-db/mql/Makefile
858 src/murphy-db/include/Makefile
859 src/murphy-db/tests/Makefile
860 src/resolver/murphy-resolver.pc
861 src/resolver/tests/Makefile
862 src/plugins/domain-control/murphy-domain-controller.pc
863 src/plugins/resource-asm/Makefile
865 doc/plugin-developer-guide/Makefile
866 doc/plugin-developer-guide/db/Makefile
867 doc/plugin-developer-guide/doxml/Makefile
868 src/plugins/resource-native/libmurphy-resource/murphy-resource.pc
869 packaging.in/org.Murphy.conf
874 # Display the configuration.
875 echo "----- configuration -----"
876 echo "Extra C warnings flags: $WARNING_CFLAGS"
877 echo "Cross-compiling: $cross_compiling"
878 if test "$cross_compiling" != "no"; then
879 echo " * native compiler: $UNSHAVED_CC_FOR_BUILD"
881 echo "Lua (pkgconfig file) to use: $with_lua"
882 echo " * cflags: $LUA_CFLAGS"
883 echo " * libs: $LUA_LIBS"
884 echo "D-Bus (libdbus) support: $enable_libdbus"
885 echo "D-Bus (systemd-bus) support: $enable_sdbus"
886 echo "PulseAudio mainloop support: $enable_pulse"
887 echo "EFL/ecore mainloop support: $enable_ecore"
888 echo "glib mainloop support: $enable_glib"
889 echo "Qt mainloop support: $enable_qt"
890 echo "Murphy console plugin and client: $enable_console"
891 echo "Resource management support: $with_resources"
892 echo "Websockets support: $enable_websockets"
893 echo "systemd support: $enable_systemd"
894 echo "Telephony support: $enable_telephony"
895 echo "System controller support: $enable_systemctl"
896 echo "System monitor support: $enable_sysmon"
899 for plugin in ${INTERNAL_PLUGINS:-none}; do
903 for plugin in ${EXTERNAL_PLUGINS:-none}; do
907 for plugin in ${DISABLED_PLUGINS:-none}; do