$NetBSD: patch-ad,v 1.3 2009/09/06 12:17:17 asau Exp $ --- configure.in.orig 2007-05-18 12:08:26.000000000 +0400 +++ configure.in 2009-09-06 16:03:10.000000000 +0400 @@ -34,6 +34,7 @@ AC_HEADER_STDC AC_PROG_INTLTOOL AM_PROG_LIBTOOL +PKG_PROG_PKG_CONFIG dnl ------------------------------------ dnl | check for compiler characteristics |------------------------------------- @@ -84,28 +85,6 @@ dnl -------------------------------- -dnl | check for neccessary libraries |----------------------------------------- -dnl -------------------------------- - -AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"]) - -AC_LANG([C++]) - -AC_PATH_CLN(1.1.0, [ - LIBS="$LIBS $CLN_LIBS" - CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS" - AC_DEFINE(HAVE_LIBCLN,1,[If CLN can be used]) -], AC_MSG_ERROR([No suitable installed version of CLN could be found.])) - - -PKG_CHECK_MODULES(GLIB, [ - glib-2.0 - libxml-2.0 >= 2.3.8 - ]) -AC_SUBST(GLIB_CFLAGS) -AC_SUBST(GLIB_LIBS) - -dnl -------------------------------- dnl | check for readline |----------------------------------------- dnl -------------------------------- @@ -230,6 +209,30 @@ INTLTOOL_QALCULATE_DEFINITIONS_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-defs/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-defs/.intltool-merge-cache $(top_srcdir)/po-defs $< [$]@' AC_SUBST(INTLTOOL_QALCULATE_DEFINITIONS_RULE) +dnl -------------------------------- +dnl | check for neccessary libraries |----------------------------------------- +dnl -------------------------------- + +AC_LANG([C++]) + +if pkg-config --atleast-version=1.1.0 cln; then + CLN_CPPFLAGS="`pkg-config --cflags cln`" + CLN_LIBS="`pkg-config --libs cln`" + LIBS="$LIBS `pkg-config --libs cln`" + CPPFLAGS="$CPPFLAGS `pkg-config --cflags cln`" + AC_DEFINE(HAVE_LIBCLN,1,[If CLN can be used]) +else AC_MSG_ERROR([No suitable installed version of CLN could be found.]) +fi +AC_SUBST(CLN_CPPFLAGS) +AC_SUBST(CLN_LIBS) + +PKG_CHECK_MODULES(GLIB, [ + glib-2.0 + libxml-2.0 >= 2.3.8 + ]) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + dnl -------- dnl | output |----------------------------------------------------------------- dnl --------