Changeset 198

Show
Ignore:
Timestamp:
01/16/03 08:47:46 (6 years ago)
Author:
jajcus
Message:

- pkg-config support for libgadu detection

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/configure.ac

    r195 r198  
    1414AM_PATH_GLIB([1.2.0],[],AC_MSG_ERROR("You need glib >= 1.2.0 to compile this.")) 
    1515 
    16 # Checks for libraries. 
    17 AC_ARG_WITH(pthread, 
    18   [  --with-pthread          Assume libgadu is compiled with pthread],[],[ 
    19         AC_MSG_CHECKING([If libgadu is compiled with pthread support]) 
    20         jk_gg_pthread=no 
    21         if test -x /usr/bin/ldd ; then 
    22                 for l in /usr/lib/libgadu.so /usr/local/lib/libgadu.so ; do 
    23                         if test -f $l ; then 
    24                                 if /usr/bin/ldd $l | grep -q "pthread" ; then    
    25                                         jk_gg_pthread=yes 
    26                                 fi 
    27                                 break; 
    28                         fi 
    29                 done 
    30         fi 
    31         if test "x$jk_gg_pthread" = "xyes" ; then 
    32                 AC_MSG_RESULT([yes]) 
    33                 with_pthread=yes 
    34         else     
    35                 with_pthread=no 
    36                 AC_MSG_RESULT([no]) 
    37         fi 
    38 ]) 
    39  
    40 if test "x$with_pthread" = "xyes"; then 
    41   AC_CHECK_HEADER(pthread.h, [ 
    42     AC_CHECK_LIB(pthread, pthread_create, [ 
    43       AC_DEFINE(HAVE_PTHREAD, 1, [Define if you want to use pthread in resolver]) 
    44       LIBS="$LIBS -lpthread" 
    45       jk_use_pthread="yes" 
    46     ],[ 
    47       jk_use_pthread="no" 
    48     ]) 
    49   ]) 
    50 else 
    51         jk_use_pthread="no" 
    52 fi 
    53  
    54 if test "x$jk_use_pthread" = "xyes"; then 
    55         AC_MSG_WARN([Jggtrans _will_ be compiled with pthread]) 
    56 else 
    57         AC_MSG_WARN([jggtrans _will_not_ be compiled with pthread]) 
    58 fi 
    59 AC_MSG_WARN([  if this doesn't match libgadu configuration jggtrans may crash]) 
    60  
    61 AC_CHECK_LIB([gadu], [gg_change_info],[],AC_MSG_ERROR("You need libgadu (from ekg>=20020807 package) to compile this.")) 
     16PKG_CHECK_MODULES(JK_LIBGADU, libgadu >= 20030113) 
     17AC_SUBST(JK_LIBGADU_LIBS) 
     18AC_SUBST(JK_LIBGADU_CFLAGS) 
    6219 
    6320AC_ARG_ENABLE([debug],AC_HELP_STRING([--disable-debug],[Disable debugging code])) 
     
    10158AC_CHECK_FUNCS([select socket],[],AC_MSG_ERROR("Some functions needed are missing")) 
    10259AC_CHECK_FUNCS([memset strchr],[],AC_MSG_ERROR("Some functions needed are missing")) 
    103 AC_CHECK_LIB([gadu], [gg_event_free],[],AC_MSG_ERROR("You need libgadu>=20020807.")) 
    10460 
    10561AC_CONFIG_SUBDIRS([libxode]) 
  • trunk/src/Makefile.am

    r162 r198  
    4848encodingtest_LDADD=$(GLIB_LIBS) 
    4949 
    50 INCLUDES=$(GLIB_CFLAGS) -I$(top_srcdir)/libxode/include 
     50INCLUDES=$(GLIB_CFLAGS) $(JK_LIBGADU_CFLAGS) -I$(top_srcdir)/libxode/include 
    5151 
    5252jggtrans_CFLAGS=-DVERSION="\"$(VERSION)\"" -DSYSCONFDIR=\"$(sysconfdir)\" 
    53 jggtrans_LDADD=$(GLIB_LIBS) $(top_builddir)/libxode/src/libxode.la 
     53jggtrans_LDADD=$(GLIB_LIBS) $(JK_LIBGADU_LIBS) $(top_builddir)/libxode/src/libxode.la 
    5454 
    5555