Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[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 if test "x$datarootdir" = "xNONE" ; then
36         datarootdir="/share"
37 fi
38 DATAROOTDIR=`eval echo $datarootdir`
39 AC_SUBST([DATAROOTDIR])
41 # Checks for libraries.
43 # wxWidgets
45 AC_LANG_PUSH([C++])
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."
58         exit -1
59         ])
61 AM_OPTIONS_WXCONFIG
62 reqwx=3.0.0
63 AM_PATH_WXCONFIG($reqwx, wxWin=1)
64 if test "$wxWin" != 1; then
65         AC_MSG_ERROR([
66 wxWidgets must be installed on your system.
67  
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 
71 is $reqwx or above.
72                 ])
73 fi
75 CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
76 CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
77 CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
78 LIBS="$LIBS $WX_LIBS"
80 # SFML Audio Library
82 PKG_CHECK_MODULES([SFML], [sfml-all >= 2.4.1])
84 AC_CHECK_LIB([sfml-audio], [main], [], [echo "The SFML libraries must be installed on your system.
85 Please check that this library is installed properly before
86 running configure again."
87         exit -1
88         ])
90 AC_CHECK_HEADER([SFML/Audio.hpp], [], [echo "The SFML library headers must be installed on your system.
91 Please check that the library headers are installed properly
92 before running configure again."
93         exit -1
94         ])
96 AC_LANG_POP([C++])
98 # curl Library
100 PKG_CHECK_MODULES([CURL], [libcurl >= 7.54.1])
102 AC_CHECK_LIB([curl], [main], [], [echo "The cURL library must be installed on your system.
103 Please check that this library is installed properly before
104 running configure again."
105         exit -1
106         ])
108 AC_CHECK_HEADER([curl/curl.h], [], [echo "The cURL library headers must be installed on your system.
109 Please check that the library headers are installed properly
110 before running configure again."
111         exit -1
112         ])
114 AC_CHECK_PROG([FOUND_CURLCONFIG], [curl-config], [yes], [no]) 
115 AM_CONDITIONAL([FOUND_CURLCONFIG_RES], [test x$FOUND_CURLCONFIG = xyes])
117 AM_COND_IF([FOUND_CURLCONFIG_RES], [], [echo "Cannot find the curl-config program on your system.
118 If it is installed on your system, adjust your PATH environment
119 variable before running configure again."
120         exit -1
121         ])
123 # file application
125 AC_CHECK_PROG([FOUND_FILE], [file], [yes], [no]) 
126 AM_CONDITIONAL([FOUND_FILE_RES], [test x$FOUND_FILE = xyes])
128 AM_COND_IF([FOUND_FILE_RES], [], [echo "Cannot find the file program on your system.
129 If it is installed on your system, adjust your PATH environment
130 variable before running configure again."
131         exit -1
132         ])
134 # uuidgen application
136 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no]) 
137 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
139 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system.
140 If it is installed on your system, adjust your PATH environment
141 variable before running configure again."
142         exit -1
143         ])
145 # Checks for typedefs, structures, and compiler characteristics.
146 AC_HEADER_STDBOOL
147 AC_C_INLINE
149 # Check for Google Test and if it exists, enable the tests.
151 AC_LANG_PUSH([C++])
152 AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no])
153 AC_LANG_POP([C++])
155 # libxml2 Library
157 CPPFLAGSOLD=CPPFLAGS
158 CPPFLAGS=`xml2-config --cflags`
160 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no]) 
161 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
163 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
164 If it is installed on your system, adjust your PATH environment
165 variable before running configure again."
166         exit -1
167         ])
169 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
170 Please check that this library is installed properly before
171 running configure again."
172         exit -1
173         ])
175 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
176 Please check that the library headers are installed properly
177 before running configure again."
178         exit -1
179         ])
181 CPPFLAGS=CPPFLAGSOLD
183 # Setup the debug setting.
185 AC_ARG_ENABLE([debug],
186 [  --enable-debug          Enable debugging features for the build.],
187 [case "${enableval}" in
188         yes) debug=true;;
189         no)  debug=false;;
190         *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
191  esac],[debug=false])
193 # Checks for library functions.
195 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
196 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
197 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
198 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
200 AM_CONDITIONAL([GTEST_FOUND], [test x$gtestfound = xyes])
201 AM_COND_IF([GTEST_FOUND], [AC_SUBST([GTEST], [`cat tests/test.commands`])], 
202         [AC_SUBST([GTEST], ["   @echo \"Google Test was not found on the system. Unable to build tests.\""])])
203 AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
205 AC_CONFIG_FILES([Makefile tests/Makefile])
206 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