basic cleanup

a missing gpgme-lib gets now correctly reported
This commit is contained in:
Thilo Raufeisen 2005-10-15 14:42:04 +00:00
parent d8d905f6e7
commit 665caa4026

View file

@ -1,31 +1,15 @@
dnl $Id$ dnl $Id$
dnl config.m4 for extension gnupg dnl config.m4 for extension gnupg
dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.
dnl If your extension references something external, use with:
PHP_ARG_WITH(gnupg, for gnupg support, PHP_ARG_WITH(gnupg, for gnupg support,
dnl Make sure that the comment is aligned:
[ --with-gnupg Include gnupg support]) [ --with-gnupg Include gnupg support])
dnl Otherwise use enable:
dnl PHP_ARG_ENABLE(gnupg, whether to enable gnupg support,
dnl Make sure that the comment is aligned:
dnl [ --enable-gnupg Enable gnupg support])
if test "$PHP_GNUPG" != "no"; then if test "$PHP_GNUPG" != "no"; then
dnl Write more examples of tests here... SEARCH_PATH="/usr/local /usr"
SEARCH_FOR="/include/gpgme.h"
dnl # --with-gnupg -> check with-path if test -r $PHP_GNUPG/$SEARCH_FOR; then
SEARCH_PATH="/usr/local /usr" # you might want to change this
SEARCH_FOR="/include/gpgme.h" # you most likely want to change this
if test -r $PHP_GNUPG/$SEARCH_FOR; then # path given as parameter
GNUPG_DIR=$PHP_GNUPG GNUPG_DIR=$PHP_GNUPG
else # search default path list else
AC_MSG_CHECKING([for gnupg files in default path]) AC_MSG_CHECKING([for gnupg files in default path])
for i in $SEARCH_PATH ; do for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then if test -r $i/$SEARCH_FOR; then
@ -40,19 +24,17 @@ if test "$PHP_GNUPG" != "no"; then
AC_MSG_ERROR([Please reinstall the gnupg distribution]) AC_MSG_ERROR([Please reinstall the gnupg distribution])
fi fi
dnl # --with-gnupg -> add include path
PHP_ADD_INCLUDE($GNUPG_DIR/include) PHP_ADD_INCLUDE($GNUPG_DIR/include)
dnl # --with-gnupg -> check for lib and symbol presence LIBNAME=gpgme
LIBNAME=gpgme # you may want to change this LIBSYMBOL=gpgme_check_version
LIBSYMBOL=gpgme_check_version # you most likely want to change this
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[ [
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GNUPG_DIR/lib, GNUPG_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GNUPG_DIR/lib, GNUPG_SHARED_LIBADD)
AC_DEFINE(HAVE_GNUPGLIB,1,[ ]) AC_DEFINE(HAVE_GNUPGLIB,1,[ ])
],[ ],[
AC_MSG_ERROR([wrong gnupg lib version or lib not found]) AC_MSG_ERROR([wrong gpgme lib version or lib not found])
],[ ],[
-L$GNUPG_DIR/lib -lm -ldl -L$GNUPG_DIR/lib -lm -ldl
]) ])