autotools: cleaned up configure.ac and Makefile.am

This commit is contained in:
Fabian Freyer
2014-08-08 19:42:33 +03:00
committed by Dmitry Podgorny
parent 97c6e6d8d4
commit 46f371b311
2 changed files with 11 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ AM_CFLAGS = -g -Wall
PARSER_CFLAGS=@PARSER_CFLAGS@
PARSER_LIBS=@PARSER_LIBS@
SSL_LIBS = -lssl -lcrypto -lz
SSL_LIBS = @openssl_LIBS@
STROPHE_FLAGS = -I$(top_srcdir)
STROPHE_LIBS = libstrophe.la

View File

@@ -4,14 +4,14 @@ LT_INIT([dlopen])
AC_PROG_CC
AM_PROG_CC_C_O
PKG_PROG_PKG_CONFIG
AC_CANONICAL_HOST
PLATFORM="unknown"
AS_CASE([$host_os],
[freebsd*], [PLATFORM="freebsd"],
[PLATFORM="nix"])
AC_CHECK_HEADER(openssl/ssl.h, [], [AC_MSG_ERROR([couldn't find openssl headers, openssl required])])
PKG_CHECK_MODULES([openssl], [openssl], [], [AC_MSG_ERROR([openssl not found; openssl required])])
PKG_CHECK_MODULES([check], [check >= 0.9.4], [], [AC_MSG_WARN([libcheck not found; unit tests will not be compilable])])
AC_ARG_WITH([libxml2],
@@ -24,26 +24,26 @@ if test "x$with_libxml2" != xno; then
[with_libxml2=yes], [dummy=1])
if test "x$with_libxml2" != xyes; then
old_CFLAGS=$CFLAGS
CFLAGS="-I /usr/include/libxml2"
CFLAGS="-I${includedir}/libxml2"
AC_CHECK_HEADER([libxml/parser.h],
[with_libxml2=yes; libxml2_CFLAGS="-I /usr/include/libxml2"; libxml2_LIBS="-lxml2"],
[AC_MSG_ERROR([couldn't find libxml2])])
[with_libxml2=yes; libxml2_CFLAGS="-I${includedir}/libxml2"; libxml2_LIBS="-lxml2"],
[AC_MSG_ERROR([libxml2 not found.])])
CFLAGS=$old_CFLAGS
fi
else
AC_CHECK_HEADER(expat.h, [], [AC_MSG_ERROR([couldn't find expat headers; expat required])])
PKG_CHECK_MODULES([expat], [expat >= 2.0.0], [], [AC_MSG_ERROR([expat not found; expat required.])])
fi
if test "x$with_libxml2" = xyes; then
with_parser=libxml2
PARSER_NAME=libxml2
PARSER_CFLAGS=\$\(libxml2_CFLAGS\)
PARSER_LIBS=\$\(libxml2_LIBS\)
PARSER_CFLAGS=$libxml2_CFLAGS
PARSER_LIBS=$libxml2_LIBS
else
with_parser=expat
PARSER_NAME=expat
PARSER_CFLAGS=
PARSER_LIBS=-lexpat
PARSER_CFLAGS=$expat_CFLAGS
PARSER_LIBS=$expat_LIBS
fi
AC_MSG_NOTICE([libstrophe will use the $with_parser XML parser])