summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 136bc56f777b827a26b1997df8415ecfe749080d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
AC_PREREQ(2.59)

AC_INIT([json-dbus-bridge-examples], 1.0.0, [bugs@pengutronix.de])
AC_CONFIG_SRCDIR([services/python/hello-world.py])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST

AM_MAINTAINER_MODE
AM_SILENT_RULES([yes])

CFLAGS="${CFLAGS} -W -Wall"

#
# Checks for programs.
#
AC_CHECK_PROG([HAVE_PYTHON],[python],[yes],[no])
if test "x$HAVE_PYTHON" != "xyes"; then
	AC_MSG_ERROR([Python not found.])
fi

AC_PATH_PROG([LIGHTTPD],[lighttpd],,$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
if test -z "$LIGHTTPD"; then
	AC_MSG_ERROR([lighttpd not found. Define LIGHTTPD=/path/to/lighttpd or make sure lighttpd is in \$PATH])
fi
AC_ARG_VAR([LIGHTTPD], [lighttpd web server])
AC_SUBST(LIGHTTPD)

AC_PATH_PROG([JSON_DBUS_BRIDGE],[json-dbus-bridge],,)
if test -z "$JSON_DBUS_BRIDGE"; then
	AC_MSG_ERROR([json-dbus-bridge not found. Set JSON_DBUS_BRIDGE=/path/to/json-dbus-bridge or make sure json-dbus-bridge is in \$PATH])
fi
AC_ARG_VAR([JSON_DBUS_BRIDGE], [json-dbus-bridge FCGI application])
AC_SUBST(JSON_DBUS_BRIDGE)

AC_PATH_PROGS([QMAKE],[qmake-qt4 qmake],,)
if test -z "$QMAKE"; then
	AC_MSG_ERROR([qmake (Qt4) not found. Define QMAKE=/path/to/qmake or make sure qmake is in \$PATH])
fi
"$QMAKE" -v 2>&1 | grep -q "Using Qt version 4"
if test $? -ne 0 ; then
	AC_MSG_ERROR([$QMAKE is not qmake from Qt4. Define QMAKE=/path/to/qmake or make sure the correct qmake is found.])
fi
AC_ARG_VAR([QMAKE], [qmake from Qt4])
AC_SUBST(QMAKE)
export QMAKE

AC_ARG_WITH([qooxdoo-sdk],AS_HELP_STRING([--with-qooxdoo-sdk=PATH], [Path to qooxdoo sdk]),
	if test -x "$withval/tool/bin/generator.py"; then
		QOOXDOO_SDK="$withval"
	else
		AC_MSG_ERROR(["$withval" contains no valid qooxdoo sdk.])
	fi,
	AC_MSG_ERROR([qooxdoo sdk not found. Please use --with-qooxdoo-sdk=PATH])
)
AC_SUBST(QOOXDOO_SDK)

AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])

AC_CONFIG_FILES([
	Makefile
	lighttpd/lighttpd.conf
	services/Makefile
	services/python/Makefile
	services/qt4/Makefile
	web-gui/Makefile
	web-gui/hello-world/Makefile
	web-gui/hello-world/config.json
	web-gui/calculator/Makefile
	web-gui/calculator/config.json
	web-gui/live/Makefile
	web-gui/live/config.json
	web-gui/logging/Makefile
	web-gui/logging/config.json
])
AC_CONFIG_FILES([run.sh],[chmod +x run.sh])
AC_CONFIG_FILES([web-gui/hello-world/generate.py],[chmod +x web-gui/hello-world/generate.py])
AC_CONFIG_FILES([web-gui/calculator/generate.py],[chmod +x web-gui/calculator/generate.py])
AC_CONFIG_FILES([web-gui/live/generate.py],[chmod +x web-gui/live/generate.py])
AC_CONFIG_FILES([web-gui/logging/generate.py],[chmod +x web-gui/logging/generate.py])
AC_CONFIG_COMMANDS([services/qt4/dbus-info-service/Makefile], [(cd services/qt4/dbus-info-service && $QMAKE ../../../${srcdir}/services/qt4/dbus-info-service/dbus-info-service.pro)])

AC_OUTPUT