Index: configure.ac =================================================================== RCS file: /cvsroot/gaim/gaim/configure.ac,v retrieving revision 1.270 diff -u -p -r1.270 configure.ac --- configure.ac 26 Aug 2004 04:59:29 -0000 1.270 +++ configure.ac 26 Aug 2004 15:34:10 -0000 @@ -45,19 +45,6 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h locale.h signal.h stdint.h) -dnl Check for SILC includes -AC_ARG_WITH(silc-includes, [ --with-silc-includes=DIR - Compile the SILC plugin against includes in DIR ], [ac_silc_includes="$withval"], [ac_silc_includes="no"]) -SILC_INCLUDES="" -if test "$ac_silc_includes" != "no"; then - SILC_INCLUDES="-I$ac_silc_includes" -fi -CPPFLAGS_save="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $SILC_INCLUDES" -AC_CHECK_HEADER(silcincludes.h, [silcincludes=yes]) -CPPFLAGS="$CPPFLAGS_save" -AC_SUBST(SILC_INCLUDES) - dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_STRUCT_TM @@ -109,15 +96,40 @@ AC_TRY_COMPILE([ ]) ]) -dnl check for SILC client libraries +dnl Check for SILC client includes and libraries +AC_ARG_WITH(silc-includes, [ --with-silc-includes=DIR + Compile the SILC plugin against includes in DIR ], [ac_silc_includes="$withval"], [ac_silc_includes="no"]) AC_ARG_WITH(silc-libs, [ --with-silc-libs=DIR Compile the SILC plugin against the SILC libs in DIR], [ac_silc_libs="$withval"], [ac_silc_libs="no"]) +SILC_CFLAGS="" SILC_LIBS="" -if test "$ac_silc_libs" != "no"; then - SILC_LIBS="-L$ac_silc_libs" +if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then + silc_manual_check="yes" +else + silc_manual_check="no" +fi +if test "x$silc_manual_check" = "xno"; then + PKG_CHECK_MODULES(SILC, silc, [ + have_silc="yes" + silcincludes="yes" + silcclient="yes" + ], have_silc="no") +else + if test "$ac_silc_includes" != "no"; then + SILC_CFLAGS="-I$ac_silc_includes" + fi + CPPFLAGS_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SILC_CFLAGS" + AC_CHECK_HEADER(silcincludes.h, [silcincludes=yes]) + CPPFLAGS="$CPPFLAGS_save" + + if test "$ac_silc_libs" != "no"; then + SILC_LIBS="-L$ac_silc_libs" + fi + SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread -ldl" + AC_CHECK_LIB(silcclient, silc_client_init, [silcclient=yes], , $SILC_LIBS) fi -SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread -ldl" -AC_CHECK_LIB(silcclient, silc_client_init, [silcclient=yes], , $SILC_LIBS) AC_SUBST(SILC_LIBS) +AC_SUBST(SILC_CFLAGS) AC_ARG_ENABLE(distrib,,,enable_distrib=no) AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes") Index: src/protocols/silc/Makefile.am =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/silc/Makefile.am,v retrieving revision 1.4 diff -u -p -r1.4 Makefile.am --- src/protocols/silc/Makefile.am 22 Jun 2004 21:12:31 -0000 1.4 +++ src/protocols/silc/Makefile.am 26 Aug 2004 15:34:10 -0000 @@ -10,7 +10,7 @@ libsilcgaim_la_LDFLAGS = -module -avoid- if STATIC_SILC -st = -DGAIM_STATIC_PRPL $(SILC_INCLUDES) +st = -DGAIM_STATIC_PRPL $(SILC_CFLAGS) noinst_LIBRARIES = libsilcgaim.a pkg_LTLIBRARIES = @@ -20,7 +20,7 @@ libsilcgaim_a_LIBADD = $(SILC_LIBS) else -st = $(SILC_INCLUDES) +st = $(SILC_CFLAGS) pkg_LTLIBRARIES = libsilcgaim.la noinst_LIBRARIES =