1999-11-22 15:28:26 +00:00
|
|
|
dnl $Id$
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to include cpdflib support)
|
|
|
|
AC_ARG_WITH(cpdflib,
|
|
|
|
[ --with-cpdflib[=DIR] Include cpdflib support (requires cpdflib >= 2).
|
|
|
|
DIR is the cpdfllib install directory,
|
|
|
|
defaults to /usr.],
|
|
|
|
[
|
|
|
|
case "$withval" in
|
|
|
|
no)
|
|
|
|
AC_MSG_RESULT(no) ;;
|
|
|
|
yes)
|
|
|
|
AC_MSG_RESULT(yes)
|
2000-05-16 08:21:10 +00:00
|
|
|
PHP_EXTENSION(cpdf)
|
1999-12-30 04:07:46 +00:00
|
|
|
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
|
1999-11-22 15:28:26 +00:00
|
|
|
[AC_MSG_ERROR(Cpdf module requires cpdflib >= 2.)])
|
|
|
|
AC_ADD_LIBRARY(cpdf)
|
1999-12-09 07:15:36 +00:00
|
|
|
AC_ADD_LIBRARY(tiff)
|
|
|
|
AC_ADD_LIBRARY(jpeg)
|
1999-11-22 15:28:26 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
test -f $withval/include/cpdflib.h && CPDFLIB_INCLUDE="$withval/include"
|
|
|
|
if test -n "$CPDFLIB_INCLUDE" ; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
PHP_EXTENSION(cpdf)
|
|
|
|
old_LIBS=$LIBS
|
|
|
|
old_withval=$withval
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for libjpeg (needed by cpdflib 2.x)])
|
|
|
|
AC_ARG_WITH(jpeg-dir,
|
|
|
|
[ --with-jpeg-dir[=DIR] jpeg dir for cpdflib 2.x],[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
if test -z $withval; then
|
|
|
|
withval="/usr/local"
|
|
|
|
fi
|
1999-12-09 07:15:36 +00:00
|
|
|
LIBS="$LIBS -L$withval/lib"
|
1999-11-22 15:28:26 +00:00
|
|
|
AC_CHECK_LIB(jpeg,jpeg_read_header, ,[AC_MSG_RESULT(no)],)
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib)
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_WARN(If configure fails try --with-jpeg-dir=<DIR>)
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for libtiff (needed by cpdflib 2.x)])
|
|
|
|
AC_ARG_WITH(tiff-dir,
|
|
|
|
[ --with-tiff-dir[=DIR] tiff dir for cpdflib 2.x],[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
if test -z $withval; then
|
|
|
|
withval="/usr/local"
|
|
|
|
fi
|
1999-12-09 07:15:36 +00:00
|
|
|
LIBS="$LIBS -L$withval/lib"
|
1999-11-22 15:28:26 +00:00
|
|
|
AC_CHECK_LIB(tiff,TIFFOpen, ,[AC_MSG_RESULT(no)],)
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(tiff, $withval/lib)
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_WARN(If configure fails try --with-tiff-dir=<DIR>)
|
|
|
|
])
|
|
|
|
withval=$old_withval
|
|
|
|
|
1999-12-09 07:15:36 +00:00
|
|
|
LIBS="$LIBS -L$withval/lib"
|
1999-12-30 04:07:46 +00:00
|
|
|
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
|
1999-11-22 15:28:26 +00:00
|
|
|
[AC_MSG_ERROR(Cpdflib module requires cpdflib >= 2.)])
|
|
|
|
LIBS=$old_LIBS
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(cpdf, $withval/lib)
|
|
|
|
AC_ADD_INCLUDE($CPDFLIB_INCLUDE)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi ;;
|
|
|
|
esac
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|