1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(../../src/c++/common/base/base64.cpp)
4 AM_INIT_AUTOMAKE(funambol, 2.0)
5 AM_CONFIG_HEADER(config.h)
7 dnl Checks for programs.
10 dnl AM_GNU_GETTEXT - not currently used
12 dnl we use libcurl on all posix but Mac
16 *apple-darwin*) use_mac_ta="yes" ;;
17 *) use_libcurl="yes" ;;
20 dnl check for libcurl now instead of during make
21 if test "x$use_libcurl" = "xyes"; then
22 AC_MSG_CHECKING([for libcurl])
23 if CURL_LDFLAGS=`sh -c 'curl-config --libs' 2>&AS_MESSAGE_LOG_FD` && \
24 CURL_CFLAGS=`sh -c 'curl-config --cflags' 2>&AS_MESSAGE_LOG_FD`; then
25 AC_MSG_RESULT([found])
26 AC_SUBST(CURL_LDFLAGS)
29 AC_MSG_RESULT([missing])
30 AC_MSG_ERROR([libcurl is required, check that its development package is installed and curl-config is in your PATH])
34 if test "x$use_mac_ta" = "xyes"; then
35 CURL_LDFLAGS="-framework CoreServices"
36 AC_SUBST(CURL_LDFLAGS)
40 dnl Check for certain headers.
41 AC_CHECK_HEADERS(time.h)
43 AC_ARG_ENABLE(unit-tests,
44 AS_HELP_STRING([--enable-unit-tests],
45 [enables tests embedded in the source code of the library (changes content of the library)]),
46 enable_unit_tests="$enableval", enable_unit_tests="no")
47 AC_ARG_ENABLE(integration-tests,
48 AS_HELP_STRING([--enable-integration-tests],
49 [enables tests outside of the library (can be used together with normal builds of the library)]),
50 enable_integration_tests="$enableval", enable_integration_tests="no")
52 AS_HELP_STRING([--enable-assert],
53 [turn on assertions]),
54 enable_assert="$enableval", enable_assert="no")
56 if test $enable_assert == "no"; then
57 AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])
60 # Optionally use wchar_t for unicode strings
62 AS_HELP_STRING([--enable-wchar],
63 [enable Unicode wchar usage]),
64 enable_wchar="$enableval", enable_wchar="no")
66 if test $enable_wchar == "yes"; then
67 AC_DEFINE(USE_WCHAR, 1, [Define to 1 if unicode wchar_t should be used.])
68 AC_CHECK_HEADERS(wchar.h)
72 if test $enable_unit_tests == "yes" || test $enable_integration_tests == yes; then
73 CPPUNIT_CXXFLAGS=`cppunit-config --cflags` || AC_MSG_ERROR("cppunit-config --cflags failed - is it installed?")
74 CPPUNIT_LDFLAGS=`cppunit-config --libs` || AC_MSG_ERROR("cppunit-config --libs failed - is it installed?")
75 CPPUNIT_TESTS=client-test
76 AC_CHECK_HEADERS(signal.h)
78 AC_SUBST(CPPUNIT_CXXFLAGS)
79 AC_SUBST(CPPUNIT_LDFLAGS)
80 AC_SUBST(CPPUNIT_TESTS)
82 if test $enable_unit_tests == "yes"; then
83 AC_DEFINE(ENABLE_UNIT_TESTS, 1, [enable unit tests inside the library's source code])
85 if test $enable_integration_tests == "yes"; then
86 AC_DEFINE(ENABLE_INTEGRATION_TESTS, 1, [enable unit tests outside of the library's source code])
90 AC_OUTPUT(Makefile src/Makefile include/Makefile test/Makefile)