From a395d7db2a623092fe08745812354e9a2ac7a66b Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 17 Apr 2005 22:14:15 +0000 Subject: [PATCH] pkg-config check. --- configure.ad | 48 +++++++++++++++++++++++++++++++++--------------- lib/configure.ad | 3 --- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/configure.ad b/configure.ad index 410d19f2..1dbefe9c 100644 --- a/configure.ad +++ b/configure.ad @@ -25,6 +25,7 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S +AC_PROG_EGREP AC_SUBST(LN_S) AC_PATH_PROG(sedpath, sed) @@ -487,7 +488,6 @@ AC_SUBST(PIDFILE) compile_libs=true #ifndef SILC_DIST_TOOLKIT - AC_ARG_WITH(silc-includes, [ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]], [ac_silc_includes="$withval"], [ac_silc_includes="no"]) @@ -495,25 +495,40 @@ AC_ARG_WITH(silc-libs, [ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]], [ac_silc_libs="$withval"], [ac_silc_libs="no"]) -# -# XXX missing checking the __SILC_WITH_XXX defines from the provided libs -# in order to determine correct libs to link. +if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then -# -# XXX missing pkg-config check. + # Manually provided libs + if test "$ac_silc_includes" != "no"; then + compile_libs=false + SILC_LIB_INCLUDES="-I$ac_silc_includes" + fi + if test "$ac_silc_libs" != "no"; then + compile_libs=false + LIBS="$LIBS -L$ac_silc_libs" + fi -if test "$ac_silc_includes" != "no"; then - compile_libs=false - SILC_LIB_INCLUDES="-I$ac_silc_includes" -fi -if test "$ac_silc_libs" != "no"; then - compile_libs=false - LIBS="$LIBS -L$ac_silc_libs" -fi + # Check libs to link against + f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silcincludes.h` + if test -n "$f"; then + LIBS="$LIBS -lpthread" + fi + f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silcincludes.h` + if test -n "$f"; then + LIBS="$LIBS -ldl" + fi +else + # pkg-config check + PKG_CHECK_MODULES(SILC, silc, compile_libs=false, compile_libs=true) + PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true) + + LIBS="$LIBS $SILC_LIBS" + CFLAGS="$CFLAGS $SILC_CFLAGS" + LIBS="$LIBS $SILCCLIENT_LIBS" + CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS" +fi #endif SILC_DIST_TOOLKIT - # SOCKS4 support checking # SAVE_LIBS="$LIBS" @@ -1080,6 +1095,9 @@ AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR]) ## Misc ## +# Make enable-shared aware +AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes) + # Other configure scripts # diff --git a/lib/configure.ad b/lib/configure.ad index 9433d0b1..dcad3e81 100644 --- a/lib/configure.ad +++ b/lib/configure.ad @@ -84,9 +84,6 @@ AC_SUBST(LIBSILCCLIENT_CURRENT) AC_SUBST(LIBSILCCLIENT_REVISION) AC_SUBST(LIBSILCCLIENT_AGE) -# Make enable-shared aware -AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes) - # Stack trace checking # AC_MSG_CHECKING(whether to enable stack tracing) -- 2.24.0