2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([Xestia Calendar], [0.02], [bugs@xestia.co.uk])
6 #AC_CONFIG_SRCDIR([version.h])
7 #AC_CONFIG_HEADERS([config.h])
9 AC_DEFINE([DEBUG], [1], [Enable debugging build so errors can be examined in detail.])
11 # Checks for programs.
16 # Check prefix directories.
18 if test "x$prefix" = "xNONE" ; then
22 if test "x$exec_prefix" = "xNONE" ; then
29 if test "x$bindir" = "xNONE" ; then
32 BINDIR=`eval echo $bindir`
35 if test "x$datarootdir" = "xNONE" ; then
38 DATAROOTDIR=`eval echo $datarootdir`
39 AC_SUBST([DATAROOTDIR])
41 # Checks for libraries.
47 # Check for C++11 support for the compiler.
49 CPPFLAGS="$CPPFLAGS -std=c++11"
50 CXXFLAGS="$CXXFLAGS -std=c++11"
52 # Checks for header files.
53 AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility])
55 AC_CHECK_HEADER([thread], [], [echo "The C++ compiler does not support C++11 extensions which is
56 needed for Xestia Address Book. Please install or use a
57 compiler that supports C++11 extensions."
63 AM_PATH_WXCONFIG($reqwx, wxWin=1)
64 if test "$wxWin" != 1; then
66 wxWidgets must be installed on your system.
68 Please check that wx-config is in path, the directory where wxWidgets libraries
69 are installed (returned by 'wx-config --libs' or 'wx-config --static --libs'
70 command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version
75 CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
76 CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
77 CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
84 AC_CHECK_LIB([curl], [main], [], [echo "The cURL library must be installed on your system.
85 Please check that this library is installed properly before
86 running configure again."
90 AC_CHECK_HEADER([curl/curl.h], [], [echo "The cURL library headers must be installed on your system.
91 Please check that the library headers are installed properly
92 before running configure again."
96 AC_CHECK_PROG([FOUND_CURLCONFIG], [curl-config], [yes], [no])
97 AM_CONDITIONAL([FOUND_CURLCONFIG_RES], [test x$FOUND_CURLCONFIG = xyes])
99 AM_COND_IF([FOUND_CURLCONFIG_RES], [], [echo "Cannot find the curl-config program on your system.
100 If it is installed on your system, adjust your PATH environment
101 variable before running configure again."
107 AC_CHECK_LIB([sqlite3], [main], [], [echo "The SQLite library must be installed on your system.
108 Please check that this library is installed properly before
109 running configure again."
113 AC_CHECK_HEADER([sqlite3.h], [], [echo "The SQLite library headers must be installed on your system.
114 Please check that the library headers are installed properly
115 before running configure again."
119 # uuidgen application
121 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no])
122 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
124 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system.
125 If it is installed on your system, adjust your PATH environment
126 variable before running configure again."
130 # Checks for typedefs, structures, and compiler characteristics.
134 # Check for Google Test and if it exists, enable the tests.
137 AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no])
143 CPPFLAGS=`xml2-config --cflags`
145 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no])
146 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
148 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
149 If it is installed on your system, adjust your PATH environment
150 variable before running configure again."
154 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
155 Please check that this library is installed properly before
156 running configure again."
160 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
161 Please check that the library headers are installed properly
162 before running configure again."
168 # Setup the debug setting.
170 AC_ARG_ENABLE([debug],
171 [ --enable-debug Enable debugging features for the build.],
172 [case "${enableval}" in
175 *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
178 # Checks for library functions.
180 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
181 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
182 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
183 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
185 #AM_CONDITIONAL([GTEST_FOUND], [test x$gtestfound = xyes])
186 #AM_COND_IF([GTEST_FOUND], [AC_SUBST([GTEST], [`cat tests/test.commands`])],
187 # [AC_SUBST([GTEST], [" @echo \"Google Test was not found on the system. Unable to build tests.\""])])
188 #AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
190 AC_CONFIG_FILES([Makefile])
191 #AC_CONFIG_FILES([Makefile tests/Makefile])