Release 0.1.16-1
[cubi:cubi.git] / configure.ac
1 AC_PREREQ([2.64])
2
3 # Making releases:
4 #   CUBI_MICRO_VERSION += 1;
5 #   CUBI_INTERFACE_AGE += 1;
6 #   CUBI_BINARY_AGE += 1;
7 # if any functions have been added, set CUBI_INTERFACE_AGE to 0.
8 # if backwards compatibility has been broken,
9 # set CUBI_BINARY_AGE and CUBI_INTERFACE_AGE to 0.
10 m4_define([cubi_major_version], [0])
11 m4_define([cubi_minor_version], [1])
12 m4_define([cubi_micro_version], [16])
13 m4_define([cubi_interface_age], [0])
14 m4_define([cubi_binary_age],
15                             [m4_eval(100 * cubi_minor_version + cubi_micro_version)])
16 m4_define([cubi_version],
17                             [cubi_major_version.cubi_minor_version.cubi_micro_version])
18 # This is the X.Y used in -llibcubi-X.Y
19 m4_define([cubi_api_version], [0.1])
20
21 # libtool version related macros
22 m4_define([cubi_lt_release], [cubi_major_version.cubi_minor_version])
23 m4_define([cubi_lt_current],
24                             [m4_eval(100 * cubi_minor_version + cubi_micro_version - cubi_interface_age)])
25 m4_define([cubi_lt_revision], [cubi_interface_age])
26 m4_define([cubi_lt_age], [m4_eval(cubi_binary_age - cubi_interface_age)])
27 m4_define([cubi_lt_current_minus_age],
28                             [m4_eval(cubi_lt_current - cubi_lt_age)])
29
30 AC_INIT([cubi], [cubi_version])
31 AC_CONFIG_MACRO_DIR([m4])
32
33 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
34
35 # enable quiet ("silent") builds, if available
36 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
37
38 CUBI_MAJOR_VERSION=cubi_major_version
39 CUBI_MINOR_VERSION=cubi_minor_version
40 CUBI_MICRO_VERSION=cubi_micro_version
41 CUBI_INTERFACE_AGE=cubi_interface_age
42 CUBI_BINARY_AGE=cubi_binary_age
43 CUBI_VERSION=cubi_version
44 CUBI_API_VERSION=cubi_api_version
45 CUBI_BINARY_VERSION=cubi_binary_version
46 AC_SUBST(CUBI_MAJOR_VERSION)
47 AC_SUBST(CUBI_MINOR_VERSION)
48 AC_SUBST(CUBI_MICRO_VERSION)
49 AC_SUBST(CUBI_INTERFACE_AGE)
50 AC_SUBST(CUBI_BINARY_AGE)
51 AC_SUBST(CUBI_API_VERSION)
52 AC_SUBST(CUBI_VERSION)
53 AC_SUBST(CUBI_BINARY_VERSION)
54
55
56 # libtool versioning
57 LT_RELEASE=cubi_lt_release
58 LT_CURRENT=cubi_lt_current
59 LT_REVISION=cubi_lt_revision
60 LT_AGE=cubi_lt_age
61 LT_CURRENT_MINUS_AGE=cubi_lt_current_minus_age
62 AC_SUBST(LT_RELEASE)
63 AC_SUBST(LT_CURRENT)
64 AC_SUBST(LT_REVISION)
65 AC_SUBST(LT_AGE)
66 AC_SUBST(LT_CURRENT_MINUS_AGE)
67
68 AC_CONFIG_HEADERS([config.h])
69
70 AC_ISC_POSIX
71 AC_HEADER_STDC
72 AC_DISABLE_STATIC
73 AC_PROG_LIBTOOL
74 AC_PROG_CXX
75
76 AM_MAINTAINER_MODE([enable])
77
78 QT_REQUIRED=4.6
79
80 AM_PROG_LIBTOOL
81
82 PKG_CHECK_MODULES(QT_CORE, [QtCore >= $QT_REQUIRED])
83 AC_SUBST(QT_CORE_CFLAGS)
84 AC_SUBST(QT_CORE_LIBS)
85
86 PKG_CHECK_MODULES(QT_TEST, [QtTest >= $QT_REQUIRED])
87 AC_SUBST(QT_TEST_CFLAGS)
88 AC_SUBST(QT_TEST_LIBS)
89
90 PKG_CHECK_MODULES(QT_SPARQL, [QtSparql])
91 AC_SUBST(QT_SPARQL_CFLAGS)
92 AC_SUBST(QT_SPARQL_LIBS)
93
94 AC_PATH_PROG(QMAKE, qmake)
95
96 if test -z $QMAKE; then
97         AC_PATH_PROG(QMAKE, qmake-qt4)
98 fi
99
100 if test -z $QMAKE; then
101         AC_MSG_ERROR([Could not find "qmake" or "qmake-qt4" in PATH])
102 fi
103 AC_SUBST(QMAKE)
104
105 MOC_BIN=$(pkg-config --variable moc_location QtCore)
106 AC_SUBST(MOC_BIN)
107
108 MKSPECSDIR=$(${QMAKE} -query QMAKE_MKSPECS | sed 's/^[^:]+://')
109 AC_SUBST(MKSPECSDIR)
110
111 AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
112 AM_CONDITIONAL(HAVE_DOXYGEN, test "x$have_doxygen" = "xyes")
113
114 AC_ARG_ENABLE(gcov,
115               AS_HELP_STRING([--enable-gcov],
116                              [enable coverage reporting support [[default=no]]]),,
117               [enable_gcov=no])
118 AM_CONDITIONAL(ENABLE_GCOV, test "x$enable_gcov" != "xno")
119
120 if test "x$enable_gcov" != "xno" ; then
121   GCOV_CFLAGS="-ftest-coverage -fprofile-arcs -O0"
122   GCOV_LIBS="-lgcov"
123 else
124   GCOV_CFLAGS=
125   GCOV_LIBS=
126 fi
127
128 AC_SUBST(GCOV_CFLAGS)
129 AC_SUBST(GCOV_LIBS)
130
131 AC_CONFIG_FILES([
132                  Makefile
133                  data/cubi-${CUBI_API_VERSION}.pc:data/cubi.pc.in
134                  data/Makefile
135                  doc/Makefile
136                  meego/libcubi.spec
137                  src/Makefile
138                  tools/Makefile
139                  tools/ontologycompiler/Makefile
140                  tests/Makefile
141                  tests/auto/Makefile
142                  tests/auto/ut_data/Makefile
143                  tests/auto/ut_delete/Makefile
144                  tests/auto/ut_fuzzing/Makefile
145                  tests/auto/ut_insert/Makefile
146                  tests/auto/ut_optim/Makefile
147                  tests/auto/ut_select/Makefile
148                 ])
149
150 AC_OUTPUT
151
152 echo "
153 Cubi is now configured and ready for build!
154
155         Prefix:                             ${prefix}
156         Location of .prf file:              ${MKSPECSDIR}
157         Source code location:               ${srcdir}
158         Compiler:                           ${CC}
159         Build API doc (requires Doxygen):   $have_doxygen
160         Coverage support:                   $enable_gcov
161         Maintainer mode:                    $USE_MAINTAINER_MODE
162 "