Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Version 0.07 release
[xestiacalendar/.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 Calendar], [0.02], [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 AC_LANG_POP([C++])
82 # curl Library
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."
87         exit -1
88         ])
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."
93         exit -1
94         ])
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."
102         exit -1
103         ])
105 # SQLite Library
107 AC_CHECK_LIB([sqlite3], [main], [], [echo "The SQLite library must be installed on your system.
108 Please check that this library is installed properly before
109 running configure again."
110         exit -1
111         ])
113 AC_CHECK_HEADER([sqlite3.h], [], [echo "The SQLite library headers must be installed on your system.
114 Please check that the library headers are installed properly
115 before running configure again."
116         exit -1
117         ])
119 # uuidgen application
121 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no]) 
122 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
124 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen 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 # Checks for typedefs, structures, and compiler characteristics.
131 AC_HEADER_STDBOOL
132 AC_C_INLINE
134 # Check for Google Test and if it exists, enable the tests.
136 AC_LANG_PUSH([C++])
137 AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no])
138 AC_LANG_POP([C++])
140 # libxml2 Library
142 CPPFLAGSOLD=CPPFLAGS
143 CPPFLAGS=`xml2-config --cflags`
145 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no]) 
146 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
148 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
149 If it is installed on your system, adjust your PATH environment
150 variable before running configure again."
151         exit -1
152         ])
154 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
155 Please check that this library is installed properly before
156 running configure again."
157         exit -1
158         ])
160 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
161 Please check that the library headers are installed properly
162 before running configure again."
163         exit -1
164         ])
166 CPPFLAGS=CPPFLAGSOLD
168 # Setup the debug setting.
170 AC_ARG_ENABLE([debug],
171 [  --enable-debug          Enable debugging features for the build.],
172 [case "${enableval}" in
173         yes) debug=true;;
174         no)  debug=false;;
175         *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
176  esac],[debug=false])
178 # Checks for library functions.
180 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
181 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
182 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
183 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
185 #AM_CONDITIONAL([GTEST_FOUND], [test x$gtestfound = xyes])
186 #AM_COND_IF([GTEST_FOUND], [AC_SUBST([GTEST], [`cat tests/test.commands`])], 
187 #       [AC_SUBST([GTEST], ["   @echo \"Google Test was not found on the system. Unable to build tests.\""])])
188 #AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
190 AC_CONFIG_FILES([Makefile tests/Makefile])
191 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