Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Updated build system to properly include checking of libxml2 via xml2-config --cflags
[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.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.
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 AC_CHECK_HEADER([thread], [], [echo "The C++ compiler does not support C++11 extensions which is
47 needed for Xestia Address Book. Please install or use a 
48 compiler that supports C++11 extensions."
49         exit -1
50         ])
52 AM_OPTIONS_WXCONFIG
53 reqwx=3.0.0
54 AM_PATH_WXCONFIG($reqwx, wxWin=1)
55 if test "$wxWin" != 1; then
56         AC_MSG_ERROR([
57 wxWidgets must be installed on your system.
58  
59 Please check that wx-config is in path, the directory where wxWidgets libraries 
60 are installed (returned by 'wx-config --libs' or 'wx-config --static --libs' 
61 command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version 
62 is $reqwx or above.
63                 ])
64 fi
66 CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
67 CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
68 CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
69 LIBS="$LIBS $WX_LIBS"
71 # SFML Audio Library
73 AC_CHECK_LIB([sfml-audio], [main], [], [echo "The SFML libraries must be installed on your system.
74 Please check that this library is installed properly before
75 running configure again."
76         exit -1
77         ])
79 AC_CHECK_HEADER([SFML/Audio.hpp], [], [echo "The SFML library headers must be installed on your system.
80 Please check that the library headers are installed properly
81 before running configure again."
82         exit -1
83         ])
85 AC_LANG_PUSH([C++])
87 # curl Library
89 AC_CHECK_LIB([curl], [main], [], [echo "The cURL library must be installed on your system.
90 Please check that this library is installed properly before
91 running configure again."
92         exit -1
93         ])
95 AC_CHECK_HEADER([curl/curl.h], [], [echo "The cURL library headers must be installed on your system.
96 Please check that the library headers are installed properly
97 before running configure again."
98         exit -1
99         ])
101 AC_CHECK_PROG([FOUND_CURLCONFIG], [curl-config], [yes], [no]) 
102 AM_CONDITIONAL([FOUND_CURLCONFIG_RES], [test x$FOUND_CURLCONFIG = xyes])
104 AM_COND_IF([FOUND_CURLCONFIG_RES], [], [echo "Cannot find the curl-config program on your system.
105 If it is installed on your system, adjust your PATH environment
106 variable before running configure again."
107         exit -1
108         ])
110 # libxml2 Library
112 CPPFLAGSOLD=CPPFLAGS
113 CPPFLAGS=`xml2-config --cflags`
115 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no]) 
116 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
118 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config 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 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
125 Please check that this library is installed properly before
126 running configure again."
127         exit -1
128         ])
130 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
131 Please check that the library headers are installed properly
132 before running configure again."
133         exit -1
134         ])
136 CPPFLAGS=CPPFLAGSOLD
138 # file application
140 AC_CHECK_PROG([FOUND_FILE], [file], [yes], [no]) 
141 AM_CONDITIONAL([FOUND_FILE_RES], [test x$FOUND_FILE = xyes])
143 AM_COND_IF([FOUND_FILE_RES], [], [echo "Cannot find the file program on your system.
144 If it is installed on your system, adjust your PATH environment
145 variable before running configure again."
146         exit -1
147         ])
149 # uuidgen application
151 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no]) 
152 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
154 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system.
155 If it is installed on your system, adjust your PATH environment
156 variable before running configure again."
157         exit -1
158         ])
160 # Checks for header files.
161 AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility])
163 # Checks for typedefs, structures, and compiler characteristics.
164 AC_HEADER_STDBOOL
165 AC_C_INLINE
167 # Setup the debug setting.
169 AC_ARG_ENABLE([debug],
170 [  --enable-debug          Enable debugging features for the build.],
171 [case "${enableval}" in
172         yes) debug=true;;
173         no)  debug=false;;
174         *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
175  esac],[debug=false])
177 # Checks for library functions.
179 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
180 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
181 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
182 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
184 AC_CONFIG_FILES([Makefile])
185 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