2001-05-10 08:55:48 +08:00
|
|
|
dnl
|
1999-04-22 10:48:28 +08:00
|
|
|
dnl $Id$
|
2001-05-10 08:55:48 +08:00
|
|
|
dnl
|
1999-04-22 10:48:28 +08:00
|
|
|
|
2001-11-30 12:46:36 +08:00
|
|
|
PHP_ARG_WITH(pdflib,for PDFlib support,
|
|
|
|
[ --with-pdflib[=DIR] Include PDFlib support.])
|
2002-06-29 09:19:35 +08:00
|
|
|
|
|
|
|
PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
|
|
|
|
[ --with-jpeg-dir[=DIR] PDFLIB: define libjpeg install directory.
|
2002-09-05 02:47:28 +08:00
|
|
|
(OPTIONAL for PDFlib v4)], no, no)
|
2002-06-29 09:19:35 +08:00
|
|
|
|
|
|
|
PHP_ARG_WITH(png-dir, for the location of libpng,
|
|
|
|
[ --with-png-dir[=DIR] PDFLIB: define libpng install directory.
|
2002-09-05 02:47:28 +08:00
|
|
|
(OPTIONAL for PDFlib v4)], no, no)
|
2002-10-17 12:21:53 +08:00
|
|
|
|
|
|
|
PHP_ARG_WITH(zlib-dir, for the location of libz,
|
|
|
|
[ --with-zlib-dir[=DIR] PDFLIB: define libz install directory.
|
|
|
|
(OPTIONAL for PDFlib v4)], no, no)
|
2002-06-29 09:19:35 +08:00
|
|
|
|
|
|
|
PHP_ARG_WITH(tiff-dir, for the location of libtiff,
|
|
|
|
[ --with-tiff-dir[=DIR] PDFLIB: define libtiff install directory.
|
2002-09-05 02:47:28 +08:00
|
|
|
(OPTIONAL for PDFlib v4)], no, no)
|
2001-02-13 01:50:39 +08:00
|
|
|
|
2001-11-30 12:46:36 +08:00
|
|
|
if test "$PHP_PDFLIB" != "no"; then
|
2001-05-10 08:55:48 +08:00
|
|
|
|
2002-09-05 02:47:28 +08:00
|
|
|
PHP_NEW_EXTENSION(pdf, pdf.c, $ext_shared)
|
2001-11-30 12:46:36 +08:00
|
|
|
PHP_SUBST(PDFLIB_SHARED_LIBADD)
|
2001-05-10 08:55:48 +08:00
|
|
|
|
2001-11-30 12:46:36 +08:00
|
|
|
dnl #
|
|
|
|
dnl # Optional libraries for PDFlib
|
|
|
|
dnl #
|
|
|
|
|
|
|
|
dnl # libjpeg
|
|
|
|
if test "$PHP_JPEG_DIR" != "no"; then
|
|
|
|
PHP_CHECK_LIBRARY(jpeg,jpeg_read_header,
|
|
|
|
[
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(jpeg, $PHP_JPEG_DIR/lib, PDFLIB_SHARED_LIBADD)
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([libjpeg not found!])
|
|
|
|
],[
|
|
|
|
-L$PHP_JPEG_DIR/lib
|
|
|
|
])
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([If configure fails, try --with-jpeg-dir=<DIR>])
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl # libpng
|
|
|
|
if test "$PHP_PNG_DIR" != "no"; then
|
|
|
|
PHP_CHECK_LIBRARY(png,png_create_info_struct,
|
|
|
|
[
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(png, $PHP_PNG_DIR/lib, PDFLIB_SHARED_LIBADD)
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([libpng not found!])
|
|
|
|
],[
|
|
|
|
-L$PHP_PNG_DIR/lib
|
|
|
|
])
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([If configure fails, try --with-png-dir=<DIR>])
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl # libtiff
|
|
|
|
if test "$PHP_TIFF_DIR" != "no"; then
|
|
|
|
PHP_CHECK_LIBRARY(tiff,TIFFOpen,
|
|
|
|
[
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(tiff, $PHP_TIFF_DIR/lib, PDFLIB_SHARED_LIBADD)
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([libtiff not found!])
|
|
|
|
],[
|
|
|
|
-L$PHP_TIFF_DIR/lib
|
|
|
|
])
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([If configure fails, try --with-tiff-dir=<DIR>])
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl # zlib
|
|
|
|
AC_MSG_CHECKING([for the location of zlib])
|
|
|
|
if test "$PHP_ZLIB_DIR" = "no"; then
|
|
|
|
AC_MSG_RESULT([no. If configure fails, try --with-zlib-dir=<DIR>])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([$PHP_ZLIB_DIR])
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, PDFLIB_SHARED_LIBADD)
|
|
|
|
fi
|
2001-05-10 08:55:48 +08:00
|
|
|
|
2001-11-30 12:46:36 +08:00
|
|
|
dnl #
|
|
|
|
dnl # The main PDFlib configure
|
|
|
|
dnl #
|
2001-11-13 21:59:13 +08:00
|
|
|
|
2001-11-30 12:46:36 +08:00
|
|
|
case $PHP_PDFLIB in
|
2001-10-09 20:24:44 +08:00
|
|
|
yes)
|
2001-12-04 07:54:10 +08:00
|
|
|
AC_CHECK_LIB(pdf, PDF_show_boxed, [
|
2001-10-09 20:24:44 +08:00
|
|
|
AC_DEFINE(HAVE_PDFLIB,1,[ ])
|
2001-11-13 21:59:13 +08:00
|
|
|
PHP_ADD_LIBRARY(pdf,, PDFLIB_SHARED_LIBADD)
|
2001-10-09 20:24:44 +08:00
|
|
|
],[
|
2001-11-30 12:46:36 +08:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz.
|
|
|
|
Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
|
|
|
|
See config.log for more information.
|
|
|
|
])
|
2001-10-09 20:24:44 +08:00
|
|
|
])
|
2001-11-30 12:46:36 +08:00
|
|
|
;;
|
2001-10-09 20:24:44 +08:00
|
|
|
*)
|
2001-11-30 12:46:36 +08:00
|
|
|
if test -f "$PHP_PDFLIB/include/pdflib.h" ; then
|
|
|
|
|
|
|
|
PHP_CHECK_LIBRARY(pdf, PDF_show_boxed,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_PDFLIB,1,[ ])
|
2001-11-13 21:59:13 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(pdf, $PHP_PDFLIB/lib, PDFLIB_SHARED_LIBADD)
|
2001-11-30 12:46:36 +08:00
|
|
|
PHP_ADD_INCLUDE($PHP_PDFLIB/include)
|
2001-10-09 20:24:44 +08:00
|
|
|
],[
|
2001-11-30 12:46:36 +08:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz.
|
|
|
|
Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
|
|
|
|
See config.log for more information.
|
|
|
|
])
|
2001-11-13 21:59:13 +08:00
|
|
|
],[
|
2002-08-18 13:13:05 +08:00
|
|
|
-L$PHP_PDFLIB/lib $PDFLIB_SHARED_LIBADD
|
2001-10-09 20:24:44 +08:00
|
|
|
])
|
2001-11-13 21:59:13 +08:00
|
|
|
else
|
2001-11-30 12:46:36 +08:00
|
|
|
AC_MSG_ERROR([pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory.])
|
2001-11-13 21:59:13 +08:00
|
|
|
fi
|
2001-11-30 12:46:36 +08:00
|
|
|
;;
|
2001-10-09 20:24:44 +08:00
|
|
|
esac
|
|
|
|
fi
|
2002-06-29 00:47:36 +08:00
|
|
|
|