pdf configuration problem
| From: | Michal Kolodziejczyk | Date: | Fri, 26 Nov 1999 08:56:07 +0000 |
| Subject: | pdf configuration problem | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6910@lists.php.net to get a copy of this message | ||
Hello,
I was trying to build latest PHP4 (from cvs) with pdflib (2.01), but the
configuration script failed, because the test C program wasn't linked with
libtiff (and it seems from config.log it should). The fix which works for
me is to add "-ltiff" after each "-lz" in ext/pdf/config.m4.
This fixes the "configure --with-pdf=/usr" script.
But then there is another error while linking the libphp4 file - there is
missing "-lz" needed for pdflib (I have configured php4 without zlib
support). So I have added "-lz" in some places (probably more than I
should) in the same ext/pdf/config.m4 file.
Below is the patch which works for me, hope it will be helpful.
--- ext/pdf/config.m4.org Thu Nov 25 23:04:28 1999
+++ ext/pdf/config.m4 Fri Nov 26 00:15:01 1999
@@ -13,7 +13,7 @@
yes)
AC_MSG_RESULT(yes)
PHP_EXTENSION(pdf)
- AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="-L/usr/local -lpdf
-lz"],
+ AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="-L/usr/local -lpdf -lz
-ltiff -ljpeg"],
[AC_MSG_ERROR(pdflib extension requires pdflib 2.x. You may as well need libtiff and
libjpeg. In such a case use the options --with-tiff-dir=<DIR> and
--with-jpeg-dir=<DIR>)])
EXTRA_LIBS="$EXTRA_LIBS $PDFLIB_LIBS"
;;
@@ -34,7 +34,7 @@
withval="/usr/local"
fi
AC_CHECK_LIB(z,deflate, [PDFLIB_LIBS="-L$withval/lib
-lz"],[AC_MSG_RESULT(no)],)
- LIBS="$LIBS -L$withval/lib -lz"
+ LIBS="$LIBS -L$withval/lib -lz -ltiff -ljpeg"
],[
AC_MSG_RESULT(no)
AC_MSG_WARN(If configure fails try --with-zlib=<DIR>)
@@ -42,7 +42,7 @@
else
echo "checking for libz needed by pdflib 2.x... already zlib support"
PDFLIB_LIBS="$ZLIB_LIBS"
- LIBS="$LIBS -lz"
+ LIBS="$LIBS -lz -ltiff -ljpeg"
fi
AC_MSG_CHECKING([for libjpeg (needed by pdflib 2.x)])
@@ -67,8 +67,8 @@
if test -z $withval; then
withval="/usr/local"
fi
- LIBS="$LIBS -L$withval/lib -ltiff -ljpeg"
- AC_CHECK_LIB(tiff,TIFFOpen, [PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib
-ltiff"],[AC_MSG_RESULT(no)],)
+ LIBS="$LIBS -L$withval/lib -ltiff -ljpeg -lz"
+ AC_CHECK_LIB(tiff,TIFFOpen, [PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -ltiff -ljpeg
-lz"],[AC_MSG_RESULT(no)],)
],[
AC_MSG_RESULT(no)
AC_MSG_WARN(If configure fails try --with-tiff-dir=<DIR>)
@@ -76,7 +76,7 @@
withval=$old_withval
LIBS="$LIBS -L$withval/lib"
- AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="$PDFLIB_LIBS
-L$withval/lib -lpdf"],
+ AC_CHECK_LIB(pdf, PDF_close, [AC_DEFINE(HAVE_PDFLIB) PDFLIB_LIBS="$PDFLIB_LIBS
-L$withval/lib -lpdf -ltiff -ljpeg -lz"],
[AC_MSG_ERROR(pdflib extension requires pdflib 2.x.)])
LIBS=$old_LIBS
EXTRA_LIBS="$EXTRA_LIBS $PDFLIB_LIBS"
Michal
--
_/ _/ _/_/_/ ----- Michal Kolodziejczyk, miko@wp.pl -----
_/ _/ _/ _/ _/ Wirtualna Polska S.A. http://www.wp.pl
_/_/_/_/ _/_/_/ ul. Uphagena 2, 80-237 Gdansk, tel/fax. (58) 3455545
_/ _/ _/ --------==* Moja WP: http://moja.wp.pl
*==----------