From 46f371b311eb36a66630d8b7aa6ee7b6b45b2a32 Mon Sep 17 00:00:00 2001 From: Fabian Freyer Date: Fri, 8 Aug 2014 19:42:33 +0300 Subject: [PATCH] autotools: cleaned up configure.ac and Makefile.am --- Makefile.am | 2 +- configure.ac | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index b166417..09f5880 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 798c10f..16bb133 100644 --- a/configure.ac +++ b/configure.ac @@ -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])