Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
xestiaab.1: Added manual page
[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 AC_CHECK_LIB([sfml-audio], [main], [], [echo "The SFML libraries must be installed on your system.
83 Please check that this library is installed properly before
84 running configure again."
85         exit -1
86         ])
88 AC_CHECK_HEADER([SFML/Audio.hpp], [], [echo "The SFML library headers must be installed on your system.
89 Please check that the library headers are installed properly
90 before running configure again."
91         exit -1
92         ])
94 AC_LANG_POP([C++])
96 # curl Library
98 AC_CHECK_LIB([curl], [main], [], [echo "The cURL library must be installed on your system.
99 Please check that this library is installed properly before
100 running configure again."
101         exit -1
102         ])
104 AC_CHECK_HEADER([curl/curl.h], [], [echo "The cURL library headers must be installed on your system.
105 Please check that the library headers are installed properly
106 before running configure again."
107         exit -1
108         ])
110 AC_CHECK_PROG([FOUND_CURLCONFIG], [curl-config], [yes], [no]) 
111 AM_CONDITIONAL([FOUND_CURLCONFIG_RES], [test x$FOUND_CURLCONFIG = xyes])
113 AM_COND_IF([FOUND_CURLCONFIG_RES], [], [echo "Cannot find the curl-config program on your system.
114 If it is installed on your system, adjust your PATH environment
115 variable before running configure again."
116         exit -1
117         ])
119 # file application
121 AC_CHECK_PROG([FOUND_FILE], [file], [yes], [no]) 
122 AM_CONDITIONAL([FOUND_FILE_RES], [test x$FOUND_FILE = xyes])
124 AM_COND_IF([FOUND_FILE_RES], [], [echo "Cannot find the file program on your system.
125 If it is installed on your system, adjust your PATH environment
126 variable before running configure again."
127         exit -1
128         ])
130 # uuidgen application
132 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no]) 
133 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
135 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system.
136 If it is installed on your system, adjust your PATH environment
137 variable before running configure again."
138         exit -1
139         ])
141 # Checks for typedefs, structures, and compiler characteristics.
142 AC_HEADER_STDBOOL
143 AC_C_INLINE
145 # Check for Google Test and if it exists, enable the tests.
147 AC_LANG_PUSH([C++])
148 AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no])
149 AC_LANG_POP([C++])
151 # libxml2 Library
153 CPPFLAGSOLD=CPPFLAGS
154 CPPFLAGS=`xml2-config --cflags`
156 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no]) 
157 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
159 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
160 If it is installed on your system, adjust your PATH environment
161 variable before running configure again."
162         exit -1
163         ])
165 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
166 Please check that this library is installed properly before
167 running configure again."
168         exit -1
169         ])
171 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
172 Please check that the library headers are installed properly
173 before running configure again."
174         exit -1
175         ])
177 CPPFLAGS=CPPFLAGSOLD
179 # Setup the debug setting.
181 AC_ARG_ENABLE([debug],
182 [  --enable-debug          Enable debugging features for the build.],
183 [case "${enableval}" in
184         yes) debug=true;;
185         no)  debug=false;;
186         *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
187  esac],[debug=false])
189 # Checks for library functions.
191 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
192 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
193 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
194 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
196 AM_CONDITIONAL([GTEST_FOUND], [test x$gtestfound = xyes])
197 AM_COND_IF([GTEST_FOUND], [AC_SUBST([GTEST], [`cat tests/test.commands`])], 
198         [AC_SUBST([GTEST], ["   @echo \"Google Test was not found on the system. Unable to build tests.\""])])
199 AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
201 AC_CONFIG_FILES([Makefile tests/Makefile])
202 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