2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([Xestia Address Book], [0.01], [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 # Checks for libraries.
22 # Check for C++11 support for the compiler.
24 CPPFLAGS="$CPPFLAGS -std=c++11"
25 CXXFLAGS="$CXXFLAGS -std=c++11"
27 AC_CHECK_HEADER([thread], [], [echo "The C++ compiler does not support C++11 extensions which is
28 needed for Xestia Address Book. Please install or use a
29 compiler that supports C++11 extensions."
35 AM_PATH_WXCONFIG($reqwx, wxWin=1)
36 if test "$wxWin" != 1; then
38 wxWidgets must be installed on your system.
40 Please check that wx-config is in path, the directory where wxWidgets libraries
41 are installed (returned by 'wx-config --libs' or 'wx-config --static --libs'
42 command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version
47 CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
48 CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
49 CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
54 AC_CHECK_LIB([sfml-audio], [main], [], [echo "The SFML libraries must be installed on your system.
55 Please check that this library is installed properly before
56 running configure again."
60 AC_CHECK_HEADER([SFML/Audio.hpp], [], [echo "The SFML library headers must be installed on your system.
61 Please check that the library headers are installed properly
62 before running configure again."
68 AC_CHECK_LIB([ossp-uuid++], [main], [], [echo "The OSSP UUID C++ library must be installed on your system.
69 Please check that this library is installed properly before
70 running configure again."
74 AC_CHECK_HEADER([ossp/uuid++.hh], [], [echo "The OSSP UUID C++ library headers must be installed on your system.
75 Please check that the library headers are installed properly
76 before running configure again."
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([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
108 Please check that this library is installed properly before
109 running configure again."
113 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
114 Please check that the library headers are installed properly
115 before running configure again."
119 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no])
120 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
122 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
123 If it is installed on your system, adjust your PATH environment
124 variable before running configure again."
128 # Checks for header files.
129 AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility])
131 # Checks for typedefs, structures, and compiler characteristics.
135 # Setup the debug setting.
137 AC_ARG_ENABLE([debug],
138 [ --enable-debug Enable a debugging build],
139 [case "${enableval}" in
142 *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
145 # Checks for library functions.
147 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
148 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
149 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
150 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
152 AC_CONFIG_FILES([Makefile])