1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
dnl
dnl $Id$
dnl
PHP_ARG_WITH(pdflib,for PDFlib support,
[ --with-pdflib[=DIR] Include PDFlib support.])
if test -z "$PHP_JPEG_DIR"; then
PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
[ --with-jpeg-dir[=DIR] PDFLIB: define libjpeg install directory.
(OPTIONAL for PDFlib v4)], no, no)
fi
if test -z "$PHP_PNG_DIR"; then
PHP_ARG_WITH(png-dir, for the location of libpng,
[ --with-png-dir[=DIR] PDFLIB: define libpng install directory.
(OPTIONAL for PDFlib v4)], no, no)
fi
if test -z "$PHP_ZLIB_DIR"; then
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)
fi
PHP_ARG_WITH(tiff-dir, for the location of libtiff,
[ --with-tiff-dir[=DIR] PDFLIB: define libtiff install directory.
(OPTIONAL for PDFlib v4)], no, no)
if test "$PHP_PDFLIB" != "no"; then
PHP_NEW_EXTENSION(pdf, pdf.c, $ext_shared)
PHP_SUBST(PDF_SHARED_LIBADD)
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, PDF_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, PDF_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, PDF_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, PDF_SHARED_LIBADD)
fi
dnl #
dnl # The main PDFlib configure
dnl #
dnl # MacOSX requires this
case $host_alias in
*darwin*)
PHP_ADD_FRAMEWORK(CoreServices)
PHP_ADD_FRAMEWORK(ApplicationServices)
;;
esac
case $PHP_PDFLIB in
yes)
AC_CHECK_LIB(pdf, PDF_show_boxed, [
AC_DEFINE(HAVE_PDFLIB,1,[ ])
PHP_ADD_LIBRARY(pdf,, PDF_SHARED_LIBADD)
],[
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.
])
])
;;
*)
if test -f "$PHP_PDFLIB/include/pdflib.h" ; then
PHP_CHECK_LIBRARY(pdf, PDF_show_boxed,
[
AC_DEFINE(HAVE_PDFLIB,1,[ ])
PHP_ADD_LIBRARY_WITH_PATH(pdf, $PHP_PDFLIB/lib, PDF_SHARED_LIBADD)
PHP_ADD_INCLUDE($PHP_PDFLIB/include)
],[
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.
])
],[
-L$PHP_PDFLIB/lib $PDF_SHARED_LIBADD
])
else
AC_MSG_ERROR([pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory.])
fi
;;
esac
fi
|