summaryrefslogtreecommitdiff
path: root/ext/mcal/config.m4
diff options
context:
space:
mode:
authorChuck Hagenbuch <chagenbu@php.net>2000-06-13 00:57:58 +0000
committerChuck Hagenbuch <chagenbu@php.net>2000-06-13 00:57:58 +0000
commitd6a55b532c8aaeb1ef62e1e27f67cba9fe839978 (patch)
tree43ec2dc991e235af95dcecf4d3af7d27ab85bbd3 /ext/mcal/config.m4
parentcefc1f2336a3d699710506ba953b106755f5176d (diff)
downloadphp-git-d6a55b532c8aaeb1ef62e1e27f67cba9fe839978.tar.gz
Check more locations. Submitted by Anil Madhavapeddy <anil@recoil.org>
Diffstat (limited to 'ext/mcal/config.m4')
-rw-r--r--ext/mcal/config.m430
1 files changed, 26 insertions, 4 deletions
diff --git a/ext/mcal/config.m4 b/ext/mcal/config.m4
index 3741351130..d47656c2a8 100644
--- a/ext/mcal/config.m4
+++ b/ext/mcal/config.m4
@@ -4,15 +4,37 @@ PHP_ARG_WITH(mcal,for MCAL support,
[ --with-mcal[=DIR] Include MCAL support.])
if test "$PHP_MCAL" != "no"; then
+ MCAL_DEFAULT_SEARCH=/usr/local
if test "$PHP_MCAL" = "yes"; then
- MCAL_DIR=/usr/local
+ MCAL_DIR=$MCAL_DEFAULT_SEARCH
else
AC_EXPAND_PATH($PHP_MCAL, MCAL_DIR)
fi
-
- AC_ADD_INCLUDE($MCAL_DIR)
- AC_ADD_LIBRARY_WITH_PATH(mcal, $MCAL_DIR, MCAL_SHARED_LIBADD)
+
+ for i in $MCAL_DIR $MCAL_DIR/mcal $MCAL_DIR/mcal/include $MCAL_DIR/include; do
+ if test -r "$i/mcal.h"; then
+ MCAL_INCLUDE=$i
+ fi
+ done
+
+ for i in $MCAL_DIR $MCAL_DIR/mcal $MCAL_DIR/mcal/lib $MCAL_DIR/lib; do
+ if test -r "$i/libmcal.a"; then
+ MCAL_LIBRARY=$i
+ fi
+ done
+
+ if test ! -f "$MCAL_INCLUDE/mcal.h"; then
+ AC_MSG_ERROR(Unable to locate your libmcal header files - mcal.h should be in the directory you specify or in the include/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH)
+ fi
+
+ if test ! -f "$MCAL_LIBRARY/libmcal.a"; then
+ AC_MSG_ERROR(Unable to locate your libmcal library files - libmcal.a should be in the directory you specify or in the lib/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH)
+ fi
+
+ AC_ADD_INCLUDE($MCAL_INCLUDE)
+ AC_ADD_LIBRARY_WITH_PATH(mcal, $MCAL_LIBRARY, MCAL_SHARED_LIBADD)
PHP_SUBST(MCAL_SHARED_LIBADD)
AC_DEFINE(HAVE_MCAL,1,[ ])
PHP_EXTENSION(mcal,$ext_shared)
fi
+