X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fconfigure.ac;h=5834f8b7cd5e86f9e268e4f97e0050074d38cf3b;hp=e16c5235aa23a362886114cf9ec133c8e57f8d1d;hb=f69e09d827e06435ea94bb73aa71ab5f9d5c035b;hpb=45729fca56479bd9158486e0cda0c4a94b4dd1dc diff --git a/source/configure.ac b/source/configure.ac index e16c523..5834f8b 100644 --- a/source/configure.ac +++ b/source/configure.ac @@ -2,19 +2,64 @@ # 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.05], [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 AC_PROG_CPP +# Check prefix directories. + +if test "x$prefix" = "xNONE" ; then + prefix="/usr/local" +fi + +if test "x$exec_prefix" = "xNONE" ; then + exec_prefix=$prefix +fi + +PREFIX=$prefix +AC_SUBST([PREFIX]) + +if test "x$bindir" = "xNONE" ; then + bindir="/bin" +fi +BINDIR=`eval echo $bindir` +AC_SUBST([BINDIR]) + +if test "x$datarootdir" = "xNONE" ; then + datarootdir="/share" +fi +DATAROOTDIR=`eval echo $datarootdir` +AC_SUBST([DATAROOTDIR]) + # 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" + +# Checks for header files. +AC_CHECK_HEADERS([stdlib.h string.h iostream iomanip ios algorithm map vector utility]) + +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([ @@ -26,36 +71,136 @@ command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version 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 + +PKG_CHECK_MODULES([SFML], [sfml-all >= 2.4.1]) + +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 + ]) + +AC_LANG_POP([C++]) + +# curl Library + +PKG_CHECK_MODULES([CURL], [libcurl >= 7.54.1]) + +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_PROG([WXCONFIG], [wx-config]) -# Checks for header files. -AC_CHECK_HEADERS([stdlib.h string.h]) +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 + ]) + +AC_CHECK_PROG([FOUND_CURLCONFIG], [curl-config], [yes], [no]) +AM_CONDITIONAL([FOUND_CURLCONFIG_RES], [test x$FOUND_CURLCONFIG = xyes]) + +AM_COND_IF([FOUND_CURLCONFIG_RES], [], [echo "Cannot find the curl-config program on your system. +If it is installed on your system, adjust your PATH environment +variable before running configure again." + exit -1 + ]) + +# file application + +AC_CHECK_PROG([FOUND_FILE], [file], [yes], [no]) +AM_CONDITIONAL([FOUND_FILE_RES], [test x$FOUND_FILE = xyes]) + +AM_COND_IF([FOUND_FILE_RES], [], [echo "Cannot find the file program on your system. +If it is installed on your system, adjust your PATH environment +variable before running configure again." + exit -1 + ]) + +# uuidgen application + +AC_CHECK_PROG([FOUND_UUIDGEN], [uuidgen], [yes], [no]) +AM_CONDITIONAL([FOUND_UUIDGEN_RES], [test x$FOUND_UUIDGEN = xyes]) + +AM_COND_IF([FOUND_UUIDGEN_RES], [], [echo "Cannot find the uuidgen program on your system. +If it is installed on your system, adjust your PATH environment +variable before running configure again." + exit -1 + ]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_INLINE +# Check for Google Test and if it exists, enable the tests. + +AC_LANG_PUSH([C++]) +AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no]) +AC_LANG_POP([C++]) + +# libxml2 Library + +CPPFLAGSOLD=CPPFLAGS +CPPFLAGS=`xml2-config --cflags` + +AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no]) +AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes]) + +AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system. +If it is installed on your system, adjust your PATH environment +variable before running configure again." + exit -1 + ]) + +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 + ]) + +CPPFLAGS=CPPFLAGSOLD + +# Setup the debug setting. + +AC_ARG_ENABLE([debug], +[ --enable-debug Enable debugging features for the 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. -AC_CONFIG_FILES([Makefile]) +AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) +AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [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."]) + +AM_CONDITIONAL([GTEST_FOUND], [test x$gtestfound = xyes]) +AM_COND_IF([GTEST_FOUND], [AC_SUBST([GTEST], [`cat tests/test.commands`])], + [AC_SUBST([GTEST], [" @echo \"Google Test was not found on the system. Unable to build tests.\""])]) +AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]); + +AC_CONFIG_FILES([Makefile tests/Makefile]) AC_OUTPUT