2005-10-07 18:59:50 +00:00
|
|
|
dnl config.m4 for extension gnupg
|
2016-05-03 07:50:01 +00:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
case $host_os in
|
2020-02-13 05:43:38 +00:00
|
|
|
*BSD* | *bsd)
|
2016-05-03 07:50:01 +00:00
|
|
|
GNUPG_DL=""
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
GNUPG_DL="-ldl"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2005-10-07 18:59:50 +00:00
|
|
|
|
|
|
|
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
|
2022-02-20 21:06:23 +00:00
|
|
|
SEARCH_PATH="/usr/local /usr /opt /opt/homebrew"
|
2018-06-05 16:56:58 +00:00
|
|
|
SEARCH_FOR="include/gpgme.h"
|
|
|
|
SEARCH_FOR_ALT="include/gpgme/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
|
2018-06-05 16:56:58 +00:00
|
|
|
if test -r $i/$SEARCH_FOR_ALT; then
|
|
|
|
GNUPG_DIR=$i
|
|
|
|
AC_MSG_RESULT(found in $i)
|
|
|
|
fi
|
2005-10-07 18:59:50 +00:00
|
|
|
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
|
|
|
|
|
2020-12-27 18:55:28 +00:00
|
|
|
PHP_ADD_INCLUDE($GNUPG_DIR/include)
|
2005-10-07 18:59:50 +00:00
|
|
|
|
2021-02-22 08:00:22 +00:00
|
|
|
dnl enable largefile support on 32-bits platform
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
|
2021-02-19 06:17:46 +00:00
|
|
|
dnl gpgme_op_passwd is not used but was added in 1.3.0
|
2005-10-15 14:42:04 +00:00
|
|
|
LIBNAME=gpgme
|
2021-02-19 06:17:46 +00:00
|
|
|
LIBSYMBOL=gpgme_op_passwd
|
2005-10-07 18:59:50 +00:00
|
|
|
|
|
|
|
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
|
|
|
|
[
|
2018-06-05 16:56:58 +00:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GNUPG_DIR/$PHP_LIBDIR, GNUPG_SHARED_LIBADD)
|
2005-10-07 18:59:50 +00:00
|
|
|
AC_DEFINE(HAVE_GNUPGLIB,1,[ ])
|
|
|
|
],[
|
2021-02-19 06:17:46 +00:00
|
|
|
AC_MSG_ERROR([wrong gpgme lib version or lib not found (version >= 1.3 required)])
|
2005-10-07 18:59:50 +00:00
|
|
|
],[
|
2018-06-05 16:56:58 +00:00
|
|
|
-L$GNUPG_DIR/$PHP_LIBDIR -lm $GNUPG_DL
|
2005-10-07 18:59:50 +00:00
|
|
|
])
|
|
|
|
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
|
2013-07-02 15:33:55 +00:00
|
|
|
|
|
|
|
AC_ARG_WITH([gpg], [AS_HELP_STRING([--with-gpg],
|
|
|
|
[path to gpg v1.x])], [], [with_gpg=no])
|
|
|
|
|
|
|
|
AC_PATH_PROG(GNUPG_PATH, gpg)
|
|
|
|
if test "$with_gpg" != "no"; then
|
|
|
|
if test "$with_gpg" != "yes"; then
|
|
|
|
if test -x "$with_gpg"; then
|
|
|
|
ac_cv_path_GNUPG_PATH=$with_gpg
|
|
|
|
else
|
|
|
|
if test -x "$ac_cv_path_GNUPG_PATH"; then
|
|
|
|
AC_MSG_RESULT($with_gpg invalid: using $ac_cv_path_GNUPG_PATH)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT($with_gpg invalid)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test -x "$ac_cv_path_GNUPG_PATH"; then
|
2018-06-05 16:56:58 +00:00
|
|
|
AC_DEFINE_UNQUOTED([GNUPG_PATH], ["$ac_cv_path_GNUPG_PATH"], [Path to gpg binary])
|
2013-07-02 15:33:55 +00:00
|
|
|
fi
|
|
|
|
fi
|