2005-10-07 18:59:50 +00:00
|
|
|
dnl $Id$
|
|
|
|
dnl config.m4 for extension gnupg
|
|
|
|
|
|
|
|
PHP_ARG_WITH(gnupg, for gnupg support,
|
2006-03-16 15:52:43 +00:00
|
|
|
[ --with-gnupg[=dir] Include gnupg support])
|
2005-10-07 18:59:50 +00:00
|
|
|
|
|
|
|
if test "$PHP_GNUPG" != "no"; then
|
2006-02-02 13:00:21 +00:00
|
|
|
SEARCH_PATH="/usr/local/include /usr/include /usr/local/include/gpgme/ /usr/include/gpgme/"
|
|
|
|
SEARCH_FOR="gpgme.h"
|
2005-10-15 14:42:04 +00:00
|
|
|
if test -r $PHP_GNUPG/$SEARCH_FOR; then
|
2005-10-07 18:59:50 +00:00
|
|
|
GNUPG_DIR=$PHP_GNUPG
|
2005-10-15 14:42:04 +00:00
|
|
|
else
|
2005-10-07 18:59:50 +00:00
|
|
|
AC_MSG_CHECKING([for gnupg files in default path])
|
|
|
|
for i in $SEARCH_PATH ; do
|
|
|
|
if test -r $i/$SEARCH_FOR; then
|
|
|
|
GNUPG_DIR=$i
|
|
|
|
AC_MSG_RESULT(found in $i)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$GNUPG_DIR"; then
|
|
|
|
AC_MSG_RESULT([not found])
|
2005-11-12 14:05:49 +00:00
|
|
|
AC_MSG_ERROR([Please reinstall the gpgme distribution])
|
2005-10-07 18:59:50 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
PHP_ADD_INCLUDE($GNUPG_DIR/include)
|
|
|
|
|
2005-10-15 14:42:04 +00:00
|
|
|
LIBNAME=gpgme
|
|
|
|
LIBSYMBOL=gpgme_check_version
|
2005-10-07 18:59:50 +00:00
|
|
|
|
|
|
|
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
|
|
|
|
[
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GNUPG_DIR/lib, GNUPG_SHARED_LIBADD)
|
|
|
|
AC_DEFINE(HAVE_GNUPGLIB,1,[ ])
|
|
|
|
],[
|
2005-10-15 14:42:04 +00:00
|
|
|
AC_MSG_ERROR([wrong gpgme lib version or lib not found])
|
2005-10-07 18:59:50 +00:00
|
|
|
],[
|
|
|
|
-L$GNUPG_DIR/lib -lm -ldl
|
|
|
|
])
|
|
|
|
PHP_SUBST(GNUPG_SHARED_LIBADD)
|
|
|
|
|
2005-10-10 17:47:21 +00:00
|
|
|
PHP_NEW_EXTENSION(gnupg, [gnupg.c gnupg_keylistiterator.c], $ext_shared)
|
2005-10-07 18:59:50 +00:00
|
|
|
fi
|