2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([Xestia Address Book], [0.03], [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 AC_CHECK_HEADER([thread], [], [echo "The C++ compiler does not support C++11 extensions which is
47 needed for Xestia Address Book. Please install or use a
48 compiler that supports C++11 extensions."
54 AM_PATH_WXCONFIG($reqwx, wxWin=1)
55 if test "$wxWin" != 1; then
57 wxWidgets must be installed on your system.
59 Please check that wx-config is in path, the directory where wxWidgets libraries
60 are installed (returned by 'wx-config --libs' or 'wx-config --static --libs'
61 command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version
66 CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
67 CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
68 CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
73 AC_CHECK_LIB([sfml-audio], [main], [], [echo "The SFML libraries must be installed on your system.
74 Please check that this library is installed properly before
75 running configure again."
79 AC_CHECK_HEADER([SFML/Audio.hpp], [], [echo "The SFML library headers must be installed on your system.
80 Please check that the library headers are installed properly
81 before running configure again."
89 AC_CHECK_LIB([curl], [main], [], [echo "The cURL library must be installed on your system.
90 Please check that this library is installed properly before
91 running configure again."
95 AC_CHECK_HEADER([curl/curl.h], [], [echo "The cURL library headers must be installed on your system.
96 Please check that the library headers are installed properly
97 before running configure again."
101 AC_CHECK_PROG([FOUND_CURLCONFIG], [curl-config], [yes], [no])
102 AM_CONDITIONAL([FOUND_CURLCONFIG_RES], [test x$FOUND_CURLCONFIG = xyes])
104 AM_COND_IF([FOUND_CURLCONFIG_RES], [], [echo "Cannot find the curl-config program on your system.
105 If it is installed on your system, adjust your PATH environment
106 variable before running configure again."
113 CPPFLAGS=`xml2-config --cflags`
115 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no])
116 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
118 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
119 If it is installed on your system, adjust your PATH environment
120 variable before running configure again."
124 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
125 Please check that this library is installed properly before
126 running configure again."
130 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
131 Please check that the library headers are installed properly
132 before running configure again."
140 AC_CHECK_PROG([FOUND_FILE], [file], [yes], [no])
141 AM_CONDITIONAL([FOUND_FILE_RES], [test x$FOUND_FILE = xyes])
143 AM_COND_IF([FOUND_FILE_RES], [], [echo "Cannot find the file program on your system.
144 If it is installed on your system, adjust your PATH environment
145 variable before running configure again."
149 # uuidgen application
151 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no])
152 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
154 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system.
155 If it is installed on your system, adjust your PATH environment
156 variable before running configure again."
160 # Checks for header files.
161 AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility])
163 # Checks for typedefs, structures, and compiler characteristics.
167 # Setup the debug setting.
169 AC_ARG_ENABLE([debug],
170 [ --enable-debug Enable debugging features for the build.],
171 [case "${enableval}" in
174 *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
177 # Checks for library functions.
179 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
180 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
181 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
182 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
184 AC_CONFIG_FILES([Makefile])