1 AC_INIT(Loudmouth, 1.2.0, loudmouth)
3 AC_COPYRIGHT([Copyright (C) 2003-2007 Imendio AB])
5 AC_CONFIG_SRCDIR(loudmouth/loudmouth.h)
6 AM_CONFIG_HEADER(config.h)
7 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define)
20 if test "$os_win32" = "yes"; then
21 if test "$enable_static" = "yes" -o "$enable_static" = ""; then
22 AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
26 if test "$enable_shared" = "no"; then
27 AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
32 CFLAGS="$CFLAGS -mms-bitfields"
33 LDFLAGS="$LDFLAGS -no-undefined"
44 AC_CHECK_HEADERS([arpa/inet.h fcntl.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
45 AC_CHECK_HEADERS([winsock2.h])
47 if test "$ac_cv_header_winsock2_h" = "yes"; then
48 # If we have <winsock2.h>, assume we find the functions
49 # in -lws2_32 (ws2_32 is winsock v2, wsock32 is v1.1)
50 LIBS="-lws2_32 -lgdi32 $LIBS"
56 if test "x$GCC" = "xyes"; then
58 *[\ \ ]-Wall[\ \ ]*) ;;
59 *) CFLAGS="$CFLAGS -Wall" ;;
69 LIBTASN1_REQUIRED=0.2.6
71 AC_SUBST(GLIB2_REQUIRED)
72 AC_SUBST(GNUTLS_REQUIRED)
73 AC_SUBST(LIBTASN1_REQUIRED)
77 PKG_CHECK_MODULES(LOUDMOUTH, glib-2.0 >= $GLIB2_REQUIRED)
79 PKG_CHECK_MODULES(LIBIDN, libidn, have_idn=yes, have_idn=no)
80 if test "x$have_idn" = "xyes"; then
81 AC_DEFINE(HAVE_IDN, 1, [Define if IDN support is included])
84 # Check Unit test framework (defined in acinclude.m4)
85 IDT_PATH_CHECK(0.9.2, have_check=yes, have_check=no)
87 AM_CONDITIONAL(HAVE_CHECK, test x$have_check = xyes)
92 dnl define a MAINT-like variable REBUILD which is set if Perl
93 dnl and awk are found, so autogenerated sources can be rebuilt
94 AC_ARG_ENABLE(rebuilds,
95 AS_HELP_STRING([--enable-rebuilds=@<:@no/yes/auto@:>@],
96 [Enable source autogeneration rules [[default=yes]]]), ,
100 if test "x$enable_rebuilds" = "xyes" && \
102 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
103 test -n "$AWK" ; then
109 dnl +--------------------------------------------------------+
110 dnl | Checking for libnsl and libsocket need on some systems |-
111 dnl +--------------------------------------------------------+
112 AC_CHECK_LIB(nsl,gethostbyname)
113 AC_CHECK_LIB(socket,socket)
115 dnl +--------------------------------------------------------+
116 dnl | Checking for SSL support |-
117 dnl +--------------------------------------------------------+
119 AS_HELP_STRING([--with-ssl=@<:@gnutls|openssl|no@:>@],
120 [Which SSL implementation to use [[default=gnutls]]]),
124 AC_ARG_WITH(openssl-includes,
125 AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
126 [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
129 AC_ARG_WITH(openssl-libs,
130 AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
131 [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
135 if test "x$ac_ssl" = "xgnutls"; then
137 AM_PATH_LM_LIBGNUTLS($GNUTLS_REQUIRED, have_libgnutls=yes, have_libgnutls=no)
138 if test "x$have_libgnutls" = "xyes"; then
139 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
140 LIBS="$LIBS $LIBGNUTLS_LIBS"
141 AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
144 AC_MSG_ERROR([GnuTLS was not found, use
145 --with-ssl=[[no|openssl]] to build without SSL support or
148 elif test "$ac_ssl" = "openssl"; then
150 AC_CHECK_HEADERS([openssl/ssl.h])
156 [SSL_LIB="-lssl -lcrypto"
157 AC_DEFINE(HAVE_OPENSSL,
165 if test "x$have_openssl" = "xno"; then
166 AC_MSG_ERROR([OpenSSL was not found, use --with-ssl=[[no|gnutls]] to
167 build without SSL support or with GnuTLS])
169 LIBS="$OLDLIBS $SSL_LIB"
173 echo "Disabling SSL support"
176 if test x$enable_ssl != xno; then
177 AC_DEFINE(HAVE_SSL, 1, [whether to use SSL support.])
179 if test x$ac_ssl != xno; then
180 AC_MSG_ERROR([No SSL implementation was found, if you do not want to build with SSL use --with-ssl=no])
184 AM_CONDITIONAL(USE_OPENSSL, test x$enable_ssl = xOpenSSL)
185 AM_CONDITIONAL(USE_GNUTLS, test x$enable_ssl = xGnuTLS)
188 dnl | Build Flags |--------------------------------------------
191 CFLAGS="$CFLAGS $WARN_CFLAGS"
196 dnl -----------------------------------------------------------
199 dnl | Debug output |-------------------------------------------
203 AS_HELP_STRING([--enable-debug=@<:@no/yes/auto@:>@],
204 [Enable debugging [[default=yes]]]), ,
207 if test x$enable_debug = xno ; then
208 echo "Debugging disabled"
209 LOUDMOUTH_CFLAGS="$LOUDMOUTH_CFLAGS -DLM_NO_DEBUG"
211 echo "Debugging enabled"
214 AC_SUBST(LOUDMOUTH_CFLAGS)
215 AC_SUBST(LOUDMOUTH_LIBS)
220 docs/reference/Makefile
224 tests/parser-tests/Makefile
228 dnl ==========================================================================
231 Loudmouth $VERSION from Imendio AB
232 =====================================
236 Have IDN support: ${have_idn}
237 Enable SSL ${enable_ssl}
238 Enable Debug: ${enable_debug}
239 Enable Unit Tests: ${have_check}
240 Enable Documentation ${enable_gtk_doc}
242 Now type 'make' to build Loudmouth