aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: 8a25723ef4abd9286ea0ba5809cb3c2a61b524bc (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
AC_PREREQ([2.61])
AC_INIT([ContextKit], [0.2.10~unreleased], [marius.vollmer@nokia.com], ContextKit)

AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2 tar-ustar 1.9])

AC_CONFIG_MACRO_DIR([m4])

AC_PROG_CC
CFLAGS="$CXXFLAGS -Wall"
AC_PROG_CXX
CXXFLAGS="$CXXFLAGS -Wall"
AC_PROG_LIBTOOL
AM_PATH_PYTHON

# vala compiler (>= 0.7.1)
AX_FEATURE_DISABLEABLE([vala], [BUILD_VALA], [disable building of vala sources])
AX_DISABLE_FEATURE_ON_PROG([Vala compiler], [BUILD_VALA], [VALAC], [valac], [0.7.1])
AM_CONDITIONAL(CONTEXTKIT_BUILD_VALA, test "$missing_deps_BUILD_VALA" = "")

# check for libraries
PKG_CHECK_MODULES_SUBST([GLIB], [glib-2.0 >= 2.12.0])
PKG_CHECK_MODULES_SUBST([GOBJECT], [gobject-2.0 >= 2.12.0])
PKG_CHECK_MODULES_SUBST([GDBUS], [dbus-glib-1])
PKG_CHECK_MODULES_SUBST([GEE], [gee-1.0 >= 0.1.3])
PKG_CHECK_MODULES_SUBST([HAL], [hal])
PKG_CHECK_MODULES_SUBST([QtTest], [QtTest])
PKG_CHECK_MODULES_SUBST([QtCore], [QtCore])
PKG_CHECK_MODULES_SUBST([QtDBus], [QtDBus])
PKG_CHECK_MODULES_SUBST([QtXml], [QtXml])
AC_PROG_QT_MOC
AC_PROG_QT_UIC
AC_PROG_QT_RCC
AC_CHECK_LIB([cdb], [cdb_make_start], [CDB_LIBS=-lcdb], [AC_MSG_ERROR([Can't find cdb library])])
AC_SUBST([CDB_LIBS])

# tools for documentation
AX_FEATURE_DISABLEABLE([doc], [BUILD_DOCS], [disable building of documentation])
AC_MSG_CHECKING([for gtk-doc])
PKG_CHECK_EXISTS([gtk-doc >= 1.9],[AC_MSG_RESULT([yes])],
                          [AC_MSG_RESULT([no])
                           missing_deps_BUILD_DOCS="$missing_deps_BUILD_DOCS, gtk-doc >= 1.9"])
HTML_DIR="${datadir}/gtk-doc/html"
AC_SUBST([HTML_DIR])
AX_DISABLE_FEATURE_ON_PROG([Dot drawing tool], [BUILD_DOCS], [DOT], [dot])
AX_DISABLE_FEATURE_ON_PROG([Asciidoc], [BUILD_DOCS], [ASCIIDOC], [asciidoc], [8.2.7])
AX_DISABLE_FEATURE_ON_PROG([source-highlight], [BUILD_DOCS], [SOURCE_HIGHLIGHT], [source-highlight])
AX_DISABLE_FEATURE_ON_PROG([xsltproc], [BUILD_DOCS], [XSLTPROC], [xsltproc])
AX_DISABLE_FEATURE_ON_PROG([xmllint], [BUILD_DOCS], [XMLLINT], [xmllint])
AX_DISABLE_FEATURE_ON_PROG([doxygen], [BUILD_DOCS], [DOXYGEN], [doxygen])
AM_CONDITIONAL([CONTEXTKIT_BUILD_DOCS], [test "$missing_deps_BUILD_DOCS" = ""])
AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test "$missing_deps_BUILD_DOCS" = ""])
AM_CONDITIONAL([ENABLE_GTK_DOC], [test "$missing_deps_BUILD_DOCS" = ""])

# coverage tools
AX_FEATURE_DISABLEABLE([coverage], [COVERAGE], [disable unittests' coverage support])
AX_DISABLE_FEATURE_ON_PROG([GCov coverage recording tool], [COVERAGE], [GCOV], [gcov])
AX_DISABLE_FEATURE_ON_PROG([LCov coverage visualization tool], [COVERAGE], [LCOV], [lcov])
AM_CONDITIONAL([CONTEXTKIT_COVERAGE], [test "$missing_deps_COVERAGE" = ""])

AC_CONFIG_FILES([
        Makefile
        contextd/Makefile
        contextd/org.freedesktop.ContextKit.contextd.service
        contextprovider-1.0.pc
        doc/Makefile
        doc/reference/Makefile
        doc/reference/libcontextprovider/Makefile
        fake-provider/Makefile
        libcontextprovider/Makefile
        libcontextsubscriber/Makefile
        libcontextsubscriber/cli/Makefile
        libcontextsubscriber/contextsubscriber-1.0.pc
        libcontextsubscriber/customer-tests/Makefile
        libcontextsubscriber/customer-tests/update-contextkit-providers/Makefile
        libcontextsubscriber/doc/Makefile
        libcontextsubscriber/man/Makefile
        libcontextsubscriber/src/Makefile
        libcontextsubscriber/unit-tests/Makefile
        libcontextsubscriber/unit-tests/cdbreader/Makefile
        libcontextsubscriber/unit-tests/cdbwriter/Makefile
        libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-dynamic/Makefile
        libcontextsubscriber/unit-tests/contextpropertyinfo-cdb-static/Makefile
        libcontextsubscriber/unit-tests/contextpropertyinfo-xml-dynamic/Makefile
        libcontextsubscriber/unit-tests/contextpropertyinfo-xml-static/Makefile
        libcontextsubscriber/unit-tests/contextregistryinfo-cdb-dynamic/Makefile
        libcontextsubscriber/unit-tests/contextregistryinfo-cdb-static/Makefile
        libcontextsubscriber/unit-tests/contextregistryinfo-xml-dynamic/Makefile
        libcontextsubscriber/unit-tests/contextregistryinfo-xml-static/Makefile
        libcontextsubscriber/unit-tests/handlesignalrouter/Makefile
        libcontextsubscriber/unit-tests/propertyhandle/Makefile
        libcontextsubscriber/unit-tests/propertyprovider/Makefile
        libcontextsubscriber/unit-tests/util/Makefile
        libcontextsubscriber/multithreading-tests/Makefile
        libcontextsubscriber/multithreading-tests/new-property-in-thread/Makefile
        libcontextsubscriber/multithreading-tests/old-property-in-thread/Makefile
        libcontextsubscriber/multithreading-tests/single-thread/Makefile
        libcontextsubscriber/multithreading-tests/stress-test/Makefile
        libcontextsubscriber/multithreading-tests/wait-for-subscription-only-in-thread/Makefile
        libcontextsubscriber/multithreading-tests/wait-for-subscription-thread/Makefile
        libcontextsubscriber/update-contextkit-providers/Makefile
        python/Makefile
        spec/Makefile
        tests/Makefile
        tests/contextd_tests/Makefile
        tests/customer-tests/Makefile
        tests/customer-tests/contextd/Makefile
        tests/customer-tests/libcontextprovider/Makefile
        tests/customer-tests/libcontextprovider/stubs/Makefile
        tests/customer-tests/libcontextprovider/testfw/Makefile
        tests/unit_tests/Makefile
        tools/Makefile
        tools/loadmem/Makefile
        vapi/Makefile
])

AC_OUTPUT

AX_FEATURE_SUMMARIZE([BUILD_DOCS],
                     [Building of documentation is enabled],
                     [Documentation won't be built])

AX_FEATURE_SUMMARIZE([BUILD_VALA],
                     [Building of vala sources is enabled],
                     [Vala sources won't be built])

AX_FEATURE_SUMMARIZE([COVERAGE],
                     [Unit testing coverage support is enabled],
                     [Coverage won't be supported during unit testing])