Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit testing. Unit testing is under inital development.
[xestiaab/.git] / source / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.68])
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.
12 AC_PROG_CXX
13 AC_PROG_CC
14 AC_PROG_CPP
16 # Check prefix directories.
18 if test "x$prefix" = "xNONE" ; then
19         prefix="/usr/local"
20 fi
22 if test "x$exec_prefix" = "xNONE" ; then
23         exec_prefix=$prefix
24 fi
26 PREFIX=$prefix
27 AC_SUBST([PREFIX])
29 if test "x$bindir" = "xNONE" ; then
30         bindir="/bin"
31 fi
32 BINDIR=`eval echo $bindir`
33 AC_SUBST([BINDIR])
35 # Checks for libraries.
37 # wxWidgets
39 AC_LANG_PUSH([C++])
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."
52         exit -1
53         ])
55 AM_OPTIONS_WXCONFIG
56 reqwx=3.0.0
57 AM_PATH_WXCONFIG($reqwx, wxWin=1)
58 if test "$wxWin" != 1; then
59         AC_MSG_ERROR([
60 wxWidgets must be installed on your system.
61  
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 
65 is $reqwx or above.
66                 ])
67 fi
69 CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
70 CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
71 CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
72 LIBS="$LIBS $WX_LIBS"
74 # SFML Audio Library
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."
79         exit -1
80         ])
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."
85         exit -1
86         ])
88 AC_LANG_POP([C++])
90 # curl Library
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."
95         exit -1
96         ])
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."
101         exit -1
102         ])
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."
110         exit -1
111         ])
113 # file application
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."
121         exit -1
122         ])
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."
132         exit -1
133         ])
135 # Checks for typedefs, structures, and compiler characteristics.
136 AC_HEADER_STDBOOL
137 AC_C_INLINE
139 # Check for Google Test and if it exists, enable the tests.
141 AC_LANG_PUSH([C++])
142 AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no])
143 AC_LANG_POP([C++])
145 # libxml2 Library
147 CPPFLAGSOLD=CPPFLAGS
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."
156         exit -1
157         ])
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."
162         exit -1
163         ])
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."
168         exit -1
169         ])
171 CPPFLAGS=CPPFLAGSOLD
173 # Setup the debug setting.
175 AC_ARG_ENABLE([debug],
176 [  --enable-debug          Enable debugging features for the build.],
177 [case "${enableval}" in
178         yes) debug=true;;
179         no)  debug=false;;
180         *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
181  esac],[debug=false])
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])
196 AC_OUTPUT
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy