X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fconfigure.ac;h=3b75ca2ad54b761ea9d599011ff861f10e19a21d;hb=0a572071e9c08cfaa3e5d4f1beec9241d03d36a0;hp=c2582f6dcd4bdee5cbd3e8fc2f8285fac3443990;hpb=f465aa76237915dfa58983da02e2ea0707ef0d07;p=xestiaab%2F.git diff --git a/source/configure.ac b/source/configure.ac index c2582f6..3b75ca2 100644 --- a/source/configure.ac +++ b/source/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) -AC_INIT([Xestia Address Book], [0.01], [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]) @@ -43,6 +43,9 @@ AC_LANG_PUSH([C++]) 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." @@ -82,7 +85,7 @@ before running configure again." exit -1 ]) -AC_LANG_PUSH([C++]) +AC_LANG_POP([C++]) # curl Library @@ -107,6 +110,38 @@ 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 @@ -135,35 +170,6 @@ before running configure again." CPPFLAGS=CPPFLAGSOLD -# 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 header files. -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], @@ -181,5 +187,10 @@ AM_COND_IF([DEBUG], [AC_SUBST([DBGOUT], ["-O0 -ggdb"])], [AC_SUBST([DBGOUT], ["- 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]) +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