# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([Xestia Address Book], [1.0], [bugs@xestia.co.uk])
+AC_INIT([Xestia Address Book], [0.01], [bugs@xestia.co.uk])
#AC_CONFIG_SRCDIR([version.h])
#AC_CONFIG_HEADERS([config.h])
+AC_DEFINE([DEBUG], [1], [Enable debugging build so errors can be examined in detail.])
+
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
+# wxWidgets
+
+AC_LANG_PUSH([C++])
+
+# Check for C++11 support for the compiler.
+
+CPPFLAGS="$CPPFLAGS -std=c++11"
+CXXFLAGS="$CXXFLAGS -std=c++11"
+
+AC_CHECK_HEADER([thread], [], [echo "The C++ compiler does not support C++11 extensions which is
+needed for Xestia Address Book. Please install or use a
+compiler that supports C++11 extensions."
+ exit -1
+ ])
+
AM_OPTIONS_WXCONFIG
-reqwx=2.8.0
+reqwx=3.0.0
AM_PATH_WXCONFIG($reqwx, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
is $reqwx or above.
])
fi
-
+
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LIBS="$LIBS $WX_LIBS"
-# FIXME: Replace `main' with a function in `-lboost_filesystem':
-AC_CHECK_LIB([boost_filesystem], [main], [], [
- echo "Error! Boost Filesystem Library (libboost_filesystem) is not installed!
-Please check that this library is installed property before
+# SFML Audio Library
+
+AC_CHECK_LIB([sfml-audio], [main], [], [echo "The SFML libraries must be installed on your system.
+Please check that this library is installed properly before
running configure again."
exit -1
])
-# FIXME: Replace `main' with a function in `-lboost_system':
-AC_CHECK_LIB([boost_system], [main], [], [
- echo "Error! Boost System Library (libboost_system) is not installed!
-Please check that this library is installed property before
+
+AC_CHECK_HEADER([SFML/Audio.hpp], [], [echo "The SFML library headers must be installed on your system.
+Please check that the library headers are installed properly
+before running configure again."
+ exit -1
+ ])
+
+# ossp-uuid Library
+
+AC_CHECK_LIB([ossp-uuid++], [main], [], [echo "The OSSP UUID C++ library must be installed on your system.
+Please check that this library is installed properly before
running configure again."
exit -1
])
-#AC_CHECK_PROG([WXCONFIG], [wx-config])
+
+AC_CHECK_HEADER([ossp/uuid++.hh], [], [echo "The OSSP UUID C++ library headers must be installed on your system.
+Please check that the library headers are installed properly
+before running configure again."
+ exit -1
+ ])
+
+AC_LANG_PUSH([C++])
+
+# curl Library
+
+AC_CHECK_LIB([curl], [main], [], [echo "The cURL library must be installed on your system.
+Please check that this library is installed properly before
+running configure again."
+ exit -1
+ ])
+
+AC_CHECK_HEADER([curl/curl.h], [], [echo "The cURL library headers must be installed on your system.
+Please check that the library headers are installed properly
+before running configure again."
+ exit -1
+ ])
+
+# libxml2 Library
+
+AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
+Please check that this library is installed properly before
+running configure again."
+ exit -1
+ ])
+
+AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
+Please check that the library headers are installed properly
+before running configure again."
+ exit -1
+ ])
# Checks for header files.
-AC_CHECK_HEADERS([stdlib.h string.h])
+AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
+# Setup the debug setting.
+
+AC_ARG_ENABLE([debug],
+[ --enable-debug Enable a debugging build],
+[case "${enableval}" in
+ yes) debug=true;;
+ no) debug=false;;
+ *) AC_MSG_ERROR([invalid value ${enableval} given for --enable-debug]) ;;
+ esac],[debug=false])
+
# Checks for library functions.
+AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
+AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0"])], [AC_SUBST([DBGOUT], ["-Os"])])
+AM_COND_IF([DEBUG], [AC_SUBST([DBGSTATUS], ["DEBUG=true"])], [AC_SUBST([DBGSTATUS], ["DEBUG=false"])])
+AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
+
AC_CONFIG_FILES([Makefile])
AC_OUTPUT