Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Updated build system.
[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 AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
113 Please check that this library is installed properly before
114 running configure again."
115         exit -1
116         ])
118 AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
119 Please check that the library headers are installed properly
120 before running configure again."
121         exit -1
122         ])
124 AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no]) 
125 AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
127 AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
128 If it is installed on your system, adjust your PATH environment
129 variable before running configure again."
130         exit -1
131         ])
133 # uuidgen application
135 AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no]) 
136 AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes])
138 AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system.
139 If it is installed on your system, adjust your PATH environment
140 variable before running configure again."
141         exit -1
142         ])
144 # Checks for header files.
145 AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility])
147 # Checks for typedefs, structures, and compiler characteristics.
148 AC_HEADER_STDBOOL
149 AC_C_INLINE
151 # Setup the debug setting.
153 AC_ARG_ENABLE([debug],
154 [  --enable-debug          Enable debugging features for the build.],
155 [case "${enableval}" in
156         yes) debug=true;;
157         no)  debug=false;;
158         *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
159  esac],[debug=false])
161 # Checks for library functions.
163 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
164 AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["-Os"])])
165 AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
166 AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
168 AC_CONFIG_FILES([Makefile])
169 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