AC_INIT(loudmouth/lm-message.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(loudmouth, 1.0.5)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
AM_PATH_GLIB_2_0
IDT_COMPILE_WARNINGS
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
GLIB2_REQUIRED=2.4.0
GNUTLS_REQUIRED=1.0.0
LIBTASN1_REQUIRED=0.2.6
AC_SUBST(GLIB2_REQUIRED)
AC_SUBST(GNUTLS_REQUIRED)
AC_SUBST(LIBTASN1_REQUIRED)
LM_CHECK_TIMEZONE
PKG_CHECK_MODULES(LOUDMOUTH, glib-2.0 >= $GLIB2_REQUIRED)
# Check Unit test framework (defined in acinclude.m4)
IDT_PATH_CHECK(0.9.2, have_check=yes, have_check=no)
AM_CONDITIONAL(HAVE_CHECK, test x$have_check = xyes)
dnl +--------------------+
dnl | Check for gtk-doc. |-------------------------------
dnl +--------------------+
AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
if test "x$with_html_dir" = "x" ; then
HTML_DIR='${datadir}/gtk-doc/html'
else
HTML_DIR=$with_html_dir
fi
AC_SUBST(HTML_DIR)
gtk_doc_min_version=1.0
AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
if pkg-config --atleast-version=$gtk_doc_min_version gtk-doc; then
AC_MSG_RESULT(yes)
GTKDOC=true
else
AC_MSG_RESULT(no)
GTKDOC=false
fi
dnl Let people disable the gtk-doc stuff.
AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=no]], enable_gtk_doc="$enableval", enable_gtk_doc=no)
if test x$enable_gtk_doc = xauto ; then
if test x$GTKDOC = xtrue ; then
enable_gtk_doc=yes
else
enable_gtk_doc=no
fi
fi
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
dnl define a MAINT-like variable REBUILD which is set if Perl
dnl and awk are found, so autogenerated sources can be rebuilt
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
test -n "$PERL" && \
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
test -n "$AWK" ; then
REBUILD=
fi
AC_SUBST(REBUILD)
dnl +--------------------------------------------------------+
dnl | Checking for libnsl and libsocket need on some systems |-
dnl +--------------------------------------------------------+
AC_CHECK_LIB(nsl,gethostbyname)
AC_CHECK_LIB(socket,socket)
dnl +--------------------------------------------------------+
dnl | Checking for SSL (through GnuTLS) support |
dnl +--------------------------------------------------------+
AC_ARG_WITH(ssl, [ --with-ssl=no/yes define whether to look for SSL, default=yes],
ac_ssl=$withval,
ac_ssl=yes
)
enable_ssl=no
if test x$ac_ssl != xno; then
AM_PATH_LM_LIBGNUTLS($GNUTLS_REQUIRED, have_libgnutls=yes, have_libgnutls=no)
if test x$have_libgnutls = xyes; then
CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
LIBS="$LIBS $LIBGNUTLS_LIBS"
AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
enable_ssl=yes
else
echo "Couldn't find GnuTLS, disabling SSL support"
fi
else
echo "Disabling SSL support"
fi
dnl +-------------+
dnl | Build Flags |--------------------------------------------
dnl +-------------+
DOC_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $WARN_CFLAGS"
AC_SUBST(DOC_CFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
dnl -----------------------------------------------------------
dnl +--------------+
dnl | Debug output |-------------------------------------------
dnl +--------------+
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debug output [default=yes]],
enable_debug="$enableval", enable_debug=yes, enable_debug=no)
if test x$enable_debug = xno ; then
echo "Debugging disabled"
LOUDMOUTH_CFLAGS="$LOUDMOUTH_CFLAGS -DLM_NO_DEBUG"
else
echo "Debugging enabled"
fi
AC_SUBST(LOUDMOUTH_CFLAGS)
AC_SUBST(LOUDMOUTH_LIBS)
dnl Gtk doc
GTK_DOC_CHECK(1.0)
dnl +--------------------------------------+
dnl | Check if we shoudl build C# bindings |-------------------
dnl +--------------------------------------+
dnl --------------
dnl | mono setup |--------------------------------------------
dnl --------------
dnl AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings [default=auto]], enable_mono="$enableval", enable_mono=auto)
dnl if test "x$enable_mono" != "xno"; then
dnl PKG_CHECK_MODULES(,gtk-sharp,have_mono=yes,have_mono=no)
dnl if test "x$have_mono" = "xyes"; then
dnl AC_PATH_PROG(MCS, mcs, no)
dnl AC_PATH_PROG(MONO, mono, no)
dnl fi
dnl else
dnl have_mono=no
dnl fi
dnl if test "x$enable_mono" = "xyes"; then
dnl AC_MSG_CHECKING(for mono environment)
dnl if test "x$have_mono" = "xno"; then
dnl AC_MSG_ERROR([not found])
dnl fi
dnl fi
dnl AM_CONDITIONAL(HAVE_MONO, test x$have_mono = xyes)
AC_OUTPUT([
Makefile
docs/Makefile
docs/reference/Makefile
loudmouth/Makefile
examples/Makefile
tests/Makefile
loudmouth-1.0.pc
loudmouth.spec])
dnl ==========================================================================
echo "
Loudmouth $VERSION from Imendio AB
=====================================
prefix: ${prefix}
compiler: ${CC}
Enable SSL ${enable_ssl}
Enable Debug: ${enable_debug}
Enable Unit Tests: ${have_check}
Now type 'make' to build Loudmouth
"