| 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.")) |
|---|
| | 16 | PKG_CHECK_MODULES(JK_LIBGADU, libgadu >= 20030113) |
|---|
| | 17 | AC_SUBST(JK_LIBGADU_LIBS) |
|---|
| | 18 | AC_SUBST(JK_LIBGADU_CFLAGS) |
|---|