1 dnl Process this file with autoconf to produce a configure script.
3 # (C) 2005-2006 Mandriva Conectiva S.A.
4 # (C) 2006 Ademar de Souza Reis Jr. <ademar@ademar.org>
6 # Based on sniffdet configure.ac: http://sniffdet.sourceforge.net
7 # Licensed under GNU-GPL
9 AC_INIT(Library gcalendar, 0.9.4,[], libgcal)
12 AC_CONFIG_SRCDIR([src/gcal.c])
13 AC_CONFIG_AUX_DIR([scripts])
14 AC_CONFIG_MACRO_DIR([m4])
16 AM_INIT_AUTOMAKE([1.7.9])
18 AC_CONFIG_HEADERS([config.h])
23 dnl Checks for programs.
30 dnl Check if pkg-config is installed
31 AC_CHECK_PROG(PKGCONFIG, pkg-config, yes, no)
32 if test $PKGCONFIG = "no"; then
33 AC_MSG_ERROR("*** pkg-config not found! ***")
36 dnl Checks for header files.
37 AC_CHECK_HEADERS([limits.h netdb.h netinet/in.h stdlib.h string.h sys/time.h unistd.h dlfcn.h syslog.h sys/param.h])
38 AC_CHECK_HEADERS([pcap.h])
40 dnl Checks for typedefs, structures, and compiler characteristics.
47 AC_CHECK_FUNCS([alarm gettimeofday memset strndup inet_ntoa])
48 AC_CHECK_FUNCS([strstr select strerror])
50 dnl Checks for libraries.
52 # if the library supports pkg-config, it's nice and easy
53 PKG_CHECK_MODULES(LIBCURL, libcurl,, \
54 AC_MSG_ERROR("*** libcurl not found! You need it to build $PACKAGE_NAME. ***"))
55 AC_SUBST(LIBCURL_CFLAGS)
56 AC_SUBST(LIBCURL_LIBS)
59 PKG_CHECK_MODULES(LIBXML, libxml-2.0,, \
60 AC_MSG_ERROR("*** libxml2 not found! You need it to build $PACKAGE_NAME. ***"))
61 AC_SUBST(LIBXML_CFLAGS)
64 # if configuring with debug code for CURL
65 AC_ARG_ENABLE(curldebug, AS_HELP_STRING([--enable-curldebug],[Enable CURL debug, printing requests and data]),,[enable_curldebug=no])
66 if test "x$enable_curldebug" = "xyes"; then
67 AC_DEFINE(GCAL_DEBUG_CURL, [], [Define if curl debug code is active])
68 echo "curl debug mode... yes"
70 echo "curl debug mode... no"
73 AM_CONDITIONAL(GCAL_DEBUG_CURL, test "x$enable_curldebug" = "xyes")
75 # enable configure options and automake conditionals useful for developers
76 # look at m4/auxdevel.m4 for detailed documentation
77 AC_SUBST(csourcedir, $srcdir/src)
78 AC_SUBST(headerdir, $srcdir/inc)
79 AC_SUBST(utestdir, $srcdir/utests)
83 AC_DEVEL_DEFINE_INSTALL_DIRS
85 AC_CONFIG_FILES([Makefile
88 libgcal-uninstalled.pc])
92 $PACKAGE_NAME $PACKAGE_VERSION configuration:
93 -----------------------------
94 Source code location: ${srcdir}
95 Host System Type: ${host}
97 Standard CFLAGS: ${CFLAGS} ${ac_devel_default_warnings} ${LIBCURL_CFLAGS} ${LIBXML_CFLAGS}
98 Libraries: ${LIBCURL_LIBS} ${LIBXML_LIBS}
99 Install path (prefix): ${prefix}
102 Now type 'make' to build $PACKAGE_NAME $PACKAGE_VERSION.