2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([Xestia Address Book], [0.05], [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 # Checks for libraries.
41 # Check for C++11 support for the compiler.
43 CPPFLAGS="$CPPFLAGS -std=c++11"
44 CXXFLAGS="$CXXFLAGS -std=c++11"
46 # Checks for header files.
47 AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility])
49 AC_CHECK_HEADER([thread], [], [echo "The C++ compiler does not support C++11 extensions which is
50 needed for Xestia Address Book. Please install or use a
51 compiler that supports C++11 extensions."
57 AM_PATH_WXCONFIG($reqwx, wxWin=1)
58 if test "$wxWin" != 1; then
60 wxWidgets must be installed on your system.
62 Please check that wx-config is in path, the directory where wxWidgets libraries
63 are installed (returned by 'wx-config --libs' or 'wx-config --static --libs'
64 command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version
69 CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
70 CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
71 CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
76 AC_CHECK_LIB([sfml-audio], [main], [], [echo "The SFML libraries must be installed on your system.
77 Please check that this library is installed properly before
78 running configure again."
82 AC_CHECK_HEADER([SFML/Audio.hpp], [], [echo "The SFML library headers must be installed on your system.
83 Please check that the library headers are installed properly
84 before running configure again."
92 AC_CHECK_LIB([curl], [main], [], [echo "The cURL library must be installed on your system.
93 Please check that this library is installed properly before
94 running configure again."
98 AC_CHECK_HEADER([curl/curl.h], [], [echo "The cURL library headers must be installed on your system.
99 Please check that the library headers are installed properly
100 before running configure again."
104 AC_CHECK_PROG([FOUND_CURLCONFIG], [curl-config], [yes], [no])
105 AM_CONDITIONAL([FOUND_CURLCONFIG_RES], [test x$FOUND_CURLCONFIG = xyes])
107 AM_COND_IF([FOUND_CURLCONFIG_RES], [], [echo "Cannot find the curl-config program on your system.
108 If it is installed on your system, adjust your PATH environment
109 variable before running configure again."
115 AC_CHECK_PROG([FOUND_FILE], [file], [yes], [no])
116 AM_CONDITIONAL([FOUND_FILE_RES], [test x$FOUND_FILE = xyes])
118 AM_COND_IF([FOUND_FILE_RES], [], [echo "Cannot find the file program on your system.
119 If it is installed on your system, adjust your PATH environment
120 variable before running configure again."
124 # uuidgen application
126 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no])
127 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
129 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system.
130 If it is installed on your system, adjust your PATH environment
131 variable before running configure again."
135 # Checks for typedefs, structures, and compiler characteristics.
139 # Check for Google Test and if it exists, enable the tests.
142 AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no])
148 CPPFLAGS=`xml2-config --cflags`
150 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no])
151 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
153 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
154 If it is installed on your system, adjust your PATH environment
155 variable before running configure again."
159 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
160 Please check that this library is installed properly before
161 running configure again."
165 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
166 Please check that the library headers are installed properly
167 before running configure again."
173 # Setup the debug setting.
175 AC_ARG_ENABLE([debug],
176 [ --enable-debug Enable debugging features for the build.],
177 [case "${enableval}" in
180 *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
183 # Checks for library functions.
185 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
186 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
187 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
188 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
190 AM_CONDITIONAL([GTEST_FOUND], [test x$gtestfound = xyes])
191 AM_COND_IF([GTEST_FOUND], [AC_SUBST([GTEST], [`cat tests/test.commands`])],
192 [AC_SUBST([GTEST], ["echo \"Google Test was not found on the system.\""])])
193 AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
195 AC_CONFIG_FILES([Makefile])