diff --git a/config.m4 b/config.m4 index f7d1873..ee878a1 100644 --- a/config.m4 +++ b/config.m4 @@ -42,3 +42,24 @@ if test "$PHP_GNUPG" != "no"; then PHP_NEW_EXTENSION(gnupg, [gnupg.c gnupg_keylistiterator.c], $ext_shared) fi + +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 + AC_DEFINE_UNQUOTED([GNUPG_PATH], ["$ac_cv_path_GNUPG_PATH"], [Path to gpg v1.x]) + fi +fi