Changeset 131

Show
Ignore:
Timestamp:
12/06/02 16:02:22 (6 years ago)
Author:
jajcus
Message:

- workaroud for threded/non-threaded libgadu versions incompabilities

Files:

Legend:

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

    r125 r131  
    11# Process this file with autoconf to produce a configure script. 
    2 AC_INIT(jabber-gg-transport, 1.1.0,jajcus@pld.org.pl) 
    3 AM_INIT_AUTOMAKE(jabber-gg-transport, 1.1.0,jajcus@pld.org.pl) 
     2AC_INIT([jabber-gg-transport], [1.2.0-test1], [jajcus@pld.org.pl]) 
    43AC_CONFIG_SRCDIR([src/ggtrans.h]) 
    5 AM_CONFIG_HEADER(config.h) 
     4AM_INIT_AUTOMAKE 
     5AM_CONFIG_HEADER([config.h]) 
    66 
    77# Checks for programs. 
     
    1212AM_PROG_LIBTOOL 
    1313 
    14 AM_PATH_GLIB(1.2.0,[],AC_MSG_ERROR("You need glib >= 1.2.0 to compile this.")) 
     14AM_PATH_GLIB([1.2.0],[],AC_MSG_ERROR("You need glib >= 1.2.0 to compile this.")) 
    1515 
    1616# Checks for libraries. 
    1717AC_CHECK_LIB([gadu], [gg_change_info],[],AC_MSG_ERROR("You need libgadu (from ekg>=20020223 package) to compile this.")) 
    1818 
    19 AC_ARG_ENABLE(debug,AC_HELP_STRING([--disable-debug],[Disable debugging code])) 
     19AC_ARG_WITH(pthread, 
     20  [  --with-pthread          Assume libgadu is compiled with pthread],[],[ 
     21        AC_MSG_CHECKING([If libgadu is compiled with pthread support]) 
     22        jk_gg_pthread=no 
     23        if test -x /usr/bin/ldd ; then 
     24                for l in /usr/lib/libgadu.so /usr/local/lib/libgadu.so ; do 
     25                        if test -f $l ; then 
     26                                if /usr/bin/ldd $l | grep -q "pthread" ; then    
     27                                        jk_gg_pthread=yes 
     28                                fi 
     29                                break; 
     30                        fi 
     31                done 
     32        fi 
     33        if test "x$jk_gg_pthread" = "xyes" ; then 
     34                AC_MSG_RESULT([yes]) 
     35                with_pthread=yes 
     36        else     
     37                with_pthread=no 
     38                AC_MSG_RESULT([no]) 
     39        fi 
     40]) 
    2041 
    21 AC_ARG_WITH(efence,AC_HELP_STRING([--with-efence],[Link against ElectricFence library])) 
     42if test "x$with_pthread" = "xyes"; then 
     43  AC_CHECK_HEADER(pthread.h, [ 
     44    AC_CHECK_LIB(pthread, pthread_create, [ 
     45      AC_DEFINE(HAVE_PTHREAD, 1, [Define if you want to use pthread in resolver]) 
     46      LIBS="$LIBS -lpthread" 
     47      jk_use_pthread="yes" 
     48    ],[ 
     49      jk_use_pthread="no" 
     50    ]) 
     51  ]) 
     52else 
     53        jk_use_pthread="no" 
     54fi 
    2255 
    23 AH_TEMPLATE([DEBUG],[Define to enable debugging code]) 
     56if test "x$jk_use_pthread" = "xyes"; then 
     57        AC_MSG_WARN([Jggtrans _will_ be compiled with pthread]) 
     58else 
     59        AC_MSG_WARN([jggtrans _will_not_ be compiled with pthread]) 
     60fi 
     61AC_MSG_WARN([  if this doesn't match libgadu configuration jggtrans may crash]) 
     62 
     63AC_ARG_ENABLE([debug],AC_HELP_STRING([--disable-debug],[Disable debugging code])) 
     64 
     65AC_ARG_WITH([efence],AC_HELP_STRING([--with-efence],[Link against ElectricFence library])) 
     66 
    2467if test "x$enable_debug" != "xno" ; then 
    25         AC_DEFINE(DEBUG,1
     68        AC_DEFINE(DEBUG,1,[Define to enable debugging code]
    2669fi 
    2770