diff options
-rw-r--r-- | ext/pdf/config.m4 | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/ext/pdf/config.m4 b/ext/pdf/config.m4 index a7d92971ff..43e0b18e83 100644 --- a/ext/pdf/config.m4 +++ b/ext/pdf/config.m4 @@ -1,24 +1,22 @@ dnl $Id$ -AC_MSG_CHECKING(whether to include Pdflib 3.x support) - -PHP_ARG_WITH(pdflib,whether to include pdflib support, +PHP_ARG_WITH(pdflib,whether to include PDFlib support, [ --with-pdflib[=DIR] Include pdflib 3.x support. DIR is the pdflib - base install directory, defaults to /usr/local - Set DIR to "shared" to build as dl, or "shared,DIR" + base install directory, defaults to /usr/local + Set DIR to "shared" to build as dl, or "shared,DIR" to build as dl and still specify DIR.]) case "$PHP_PDFLIB" in - no) - AC_MSG_RESULT(no) ;; yes) - AC_MSG_RESULT(yes) PHP_EXTENSION(pdf, $ext_shared) old_LDFLAGS=$LDFLAGS - old_LIBS=$LIBS - LIBS="$LIBS -ltiff -ljpeg -lpng -lz" - AC_CHECK_LIB(pdf, PDF_show_boxed, [AC_DEFINE(HAVE_PDFLIB,1,[ ])], - [AC_MSG_ERROR(pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg. If so, use the options --with-tiff-dir=<DIR> and --with-jpeg-dir=<DIR>)]) + old_LIBS=$LIBS + LIBS="$LIBS -ltiff -ljpeg -lpng -lz" + AC_CHECK_LIB(pdf, PDF_show_boxed, [ + AC_DEFINE(HAVE_PDFLIB,1,[ ]) + ],[ + AC_MSG_ERROR(pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg. If so, use the options --with-tiff-dir=<DIR> and --with-jpeg-dir=<DIR>) + ]) LIBS=$old_LIBS LDFLAGS=$old_LDFLAGS PHP_SUBST(PDFLIB_SHARED_LIBADD) @@ -31,7 +29,6 @@ PHP_ARG_WITH(pdflib,whether to include pdflib support, *) test -f $withval/include/pdflib.h && PDFLIB_INCLUDE="$withval/include" if test -n "$PDFLIB_INCLUDE" ; then - AC_MSG_RESULT(yes) PHP_EXTENSION(pdf, $ext_shared) old_withval=$withval @@ -112,13 +109,15 @@ PHP_ARG_WITH(pdflib,whether to include pdflib support, old_LIBS=$LIBS LIBS="$LIBS -L$withval/lib" - AC_CHECK_LIB(pdf, PDF_show_boxed, [AC_DEFINE(HAVE_PDFLIB,1,[ ]) PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -lpdf"], - [AC_MSG_ERROR(pdflib extension requires pdflib 3.x.)]) + AC_CHECK_LIB(pdf, PDF_show_boxed, [ + AC_DEFINE(HAVE_PDFLIB,1,[ ]) + PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -lpdf" + ],[ + AC_MSG_ERROR(pdflib extension requires pdflib 3.x.) + ]) LIBS=$old_LIBS - PHP_SUBST(PDFLIB_SHARED_LIBADD) + PHP_SUBST(PDFLIB_SHARED_LIBADD) AC_ADD_LIBRARY_WITH_PATH(pdf, $withval/lib, PDFLIB_SHARED_LIBADD) AC_ADD_INCLUDE($PDFLIB_INCLUDE) - else - AC_MSG_RESULT(no) fi ;; esac |