1 AC_INIT(Loudmouth, 1.1.1, loudmouth)
3 AC_COPYRIGHT([Copyright (C) 2003-2006 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 # Check Unit test framework (defined in acinclude.m4)
80 IDT_PATH_CHECK(0.9.2, have_check=yes, have_check=no)
82 AM_CONDITIONAL(HAVE_CHECK, test x$have_check = xyes)
87 dnl define a MAINT-like variable REBUILD which is set if Perl
88 dnl and awk are found, so autogenerated sources can be rebuilt
89 AC_ARG_ENABLE(rebuilds,
90 AS_HELP_STRING([--enable-rebuilds=@<:@no/yes/auto@:>@],
91 [Enable source autogeneration rules [[default=yes]]]), ,
95 if test "x$enable_rebuilds" = "xyes" && \
97 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
104 dnl +--------------------------------------------------------+
105 dnl | Checking for libnsl and libsocket need on some systems |-
106 dnl +--------------------------------------------------------+
107 AC_CHECK_LIB(nsl,gethostbyname)
108 AC_CHECK_LIB(socket,socket)
110 dnl +--------------------------------------------------------+
111 dnl | Checking for SSL support |-
112 dnl +--------------------------------------------------------+
114 AS_HELP_STRING([--with-ssl=@<:@gnutls|openssl|no@:>@],
115 [Which SSL implementation to use [[default=gnutls]]]),
119 AC_ARG_WITH(openssl-includes,
120 AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
121 [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
124 AC_ARG_WITH(openssl-libs,
125 AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
126 [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
130 if test "x$ac_ssl" = "xgnutls"; then
132 AM_PATH_LM_LIBGNUTLS($GNUTLS_REQUIRED, have_libgnutls=yes, have_libgnutls=no)
133 if test "x$have_libgnutls" = "xyes"; then
134 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
135 LIBS="$LIBS $LIBGNUTLS_LIBS"
136 AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
139 AC_MSG_ERROR([GnuTLS was not found, use
140 --with-ssl=[[no|openssl]] to build without SSL support or
143 elif test "$ac_ssl" = "openssl"; then
145 AC_CHECK_HEADERS([openssl/ssl.h])
151 [SSL_LIB="-lssl -lcrypto"
152 AC_DEFINE(HAVE_OPENSSL,
160 if test "x$have_openssl" = "xno"; then
161 AC_MSG_ERROR([OpenSSL was not found, use --with-ssl=[[no|gnutls]] to
162 build without SSL support or with GnuTLS])
164 LIBS="$OLDLIBS $SSL_LIB"
168 echo "Disabling SSL support"
171 if test x$enable_ssl != xno; then
172 AC_DEFINE(HAVE_SSL, 1, [whether to use SSL support.])
174 if test x$ac_ssl != xno; then
175 AC_MSG_ERROR([No SSL implementation was found, if you do not want to build with SSL use --with-ssl=no])
179 AM_CONDITIONAL(USE_OPENSSL, test x$enable_ssl = xOpenSSL)
180 AM_CONDITIONAL(USE_GNUTLS, test x$enable_ssl = xGnuTLS)
183 dnl | Build Flags |--------------------------------------------
186 CFLAGS="$CFLAGS $WARN_CFLAGS"
191 dnl -----------------------------------------------------------
194 dnl | Debug output |-------------------------------------------
198 AS_HELP_STRING([--enable-debug=@<:@no/yes/auto@:>@],
199 [Enable debugging [[default=yes]]]), ,
202 if test x$enable_debug = xno ; then
203 echo "Debugging disabled"
204 LOUDMOUTH_CFLAGS="$LOUDMOUTH_CFLAGS -DLM_NO_DEBUG"
206 echo "Debugging enabled"
209 AC_SUBST(LOUDMOUTH_CFLAGS)
210 AC_SUBST(LOUDMOUTH_LIBS)
213 dnl +--------------------------------------+
214 dnl | Check if we shoudl build C# bindings |-------------------
215 dnl +--------------------------------------+
218 dnl | mono setup |--------------------------------------------
220 dnl AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings [default=auto]], enable_mono="$enableval", enable_mono=auto)
222 dnl if test "x$enable_mono" != "xno"; then
223 dnl PKG_CHECK_MODULES(,gtk-sharp,have_mono=yes,have_mono=no)
225 dnl if test "x$have_mono" = "xyes"; then
226 dnl AC_PATH_PROG(MCS, mcs, no)
227 dnl AC_PATH_PROG(MONO, mono, no)
233 dnl if test "x$enable_mono" = "xyes"; then
234 dnl AC_MSG_CHECKING(for mono environment)
235 dnl if test "x$have_mono" = "xno"; then
236 dnl AC_MSG_ERROR([not found])
240 dnl AM_CONDITIONAL(HAVE_MONO, test x$have_mono = xyes)
245 docs/reference/Makefile
252 dnl ==========================================================================
255 Loudmouth $VERSION from Imendio AB
256 =====================================
260 Enable SSL ${enable_ssl}
261 Enable Debug: ${enable_debug}
262 Enable Unit Tests: ${have_check}
263 Enable Documentation ${enable_gtk_doc}
265 Now type 'make' to build Loudmouth