PHP_ARG_WITH(shp, for shp support,
[ --with-shp Include shp support])
if test "$PHP_SHP" != "no"; then
# --with-shp -> check with-path
SEARCH_PATH="/usr/local /usr" # you might want to change this
SEARCH_FOR="/include/shapefil.h" # you most likely want to change this
if test -r $PHP_SHP/$SEARCH_FOR; then # path given as parameter
SHP_DIR=$PHP_SHP
else # search default path list
AC_MSG_CHECKING([for shp files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
SHP_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$SHP_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the shp distribution])
fi
# --with-shp -> add include path
PHP_ADD_INCLUDE($SHP_DIR/include)
# --with-shp -> check for lib and symbol presence
LIBNAME=shp # you may want to change this
LIBSYMBOL=SHPOpen # you most likely want to change this
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SHP_DIR/lib, SHP_SHARED_LIBADD)
AC_DEFINE(HAVE_SHPLIB,1,[ ])
],[
AC_MSG_ERROR([wrong shp lib version or lib not found])
],[
-L$SHP_DIR/lib -lm
])
PHP_SUBST(SHP_SHARED_LIBADD)
PHP_NEW_EXTENSION(shp, shp.c, $ext_shared)
fi
syntax highlighted by Code2HTML, v. 0.9.1