Annotation of embedaddon/php/ext/gd/config.m4, revision 1.1.1.3
1.1 misho 1: dnl
1.1.1.2 misho 2: dnl $Id$
1.1 misho 3: dnl
4:
5: dnl
6: dnl Configure options
7: dnl
8:
9: PHP_ARG_WITH(gd, for GD support,
10: [ --with-gd[=DIR] Include GD support. DIR is the GD library base
11: install directory [BUNDLED]])
12:
1.1.1.2 misho 13: if test -z "$PHP_VPX_DIR"; then
14: PHP_ARG_WITH(vpx-dir, for the location of libvpx,
15: [ --with-vpx-dir[=DIR] GD: Set the path to libvpx install prefix], no, no)
16: fi
17:
1.1 misho 18: if test -z "$PHP_JPEG_DIR"; then
19: PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
20: [ --with-jpeg-dir[=DIR] GD: Set the path to libjpeg install prefix], no, no)
21: fi
22:
23: if test -z "$PHP_PNG_DIR"; then
24: PHP_ARG_WITH(png-dir, for the location of libpng,
25: [ --with-png-dir[=DIR] GD: Set the path to libpng install prefix], no, no)
26: fi
27:
28: if test -z "$PHP_ZLIB_DIR"; then
29: PHP_ARG_WITH(zlib-dir, for the location of libz,
30: [ --with-zlib-dir[=DIR] GD: Set the path to libz install prefix], no, no)
31: fi
32:
33: PHP_ARG_WITH(xpm-dir, for the location of libXpm,
34: [ --with-xpm-dir[=DIR] GD: Set the path to libXpm install prefix], no, no)
35:
36: PHP_ARG_WITH(freetype-dir, for FreeType 2,
37: [ --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix], no, no)
38:
39: PHP_ARG_WITH(t1lib, for T1lib support,
40: [ --with-t1lib[=DIR] GD: Include T1lib support. T1lib version >= 5.0.0 required], no, no)
41:
42: PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in GD,
43: [ --enable-gd-native-ttf GD: Enable TrueType string function], no, no)
44:
45: PHP_ARG_ENABLE(gd-jis-conv, whether to enable JIS-mapped Japanese font support in GD,
46: [ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support], no, no)
47:
48: dnl
49: dnl Checks for the configure options
50: dnl
51:
52: AC_DEFUN([PHP_GD_ZLIB],[
53: if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
54: if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
55: PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
56: PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
57: elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
58: PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
59: PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
60: else
61: AC_MSG_ERROR([Can't find zlib headers under "$PHP_ZLIB_DIR"])
62: fi
63: else
64: for i in /usr/local /usr; do
65: if test -f "$i/include/zlib/zlib.h"; then
66: PHP_ZLIB_DIR="$i"
67: PHP_ZLIB_INCDIR="$i/include/zlib"
68: elif test -f "$i/include/zlib.h"; then
69: PHP_ZLIB_DIR="$i"
70: PHP_ZLIB_INCDIR="$i/include"
71: fi
72: done
73: fi
74: ])
75:
1.1.1.2 misho 76: AC_DEFUN([PHP_GD_VPX],[
77: if test "$PHP_VPX_DIR" != "no"; then
78:
79: for i in $PHP_VPX_DIR /usr/local /usr; do
80: test -f $i/include/vpx_codec.h || test -f $i/include/vpx/vpx_codec.h && GD_VPX_DIR=$i && break
81: done
82:
83: if test -z "$GD_VPX_DIR"; then
84: AC_MSG_ERROR([vpx_codec.h not found.])
85: fi
86:
87: PHP_CHECK_LIBRARY(vpx,vpx_codec_destroy,
88: [
89: PHP_ADD_INCLUDE($GD_VPX_DIR/include)
90: PHP_ADD_LIBRARY(pthread)
91: PHP_ADD_LIBRARY_WITH_PATH(vpx, $GD_VPX_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
92: ],[
93: AC_MSG_ERROR([Problem with libvpx.(a|so). Please check config.log for more information.])
94: ],[
95: -L$GD_VPX_DIR/$PHP_LIBDIR
96: ])
97: else
98: AC_MSG_RESULT([If configure fails try --with-vpx-dir=<DIR>])
99: fi
100: ])
101:
1.1 misho 102: AC_DEFUN([PHP_GD_JPEG],[
103: if test "$PHP_JPEG_DIR" != "no"; then
104:
105: for i in $PHP_JPEG_DIR /usr/local /usr; do
106: test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break
107: done
108:
109: if test -z "$GD_JPEG_DIR"; then
110: AC_MSG_ERROR([jpeglib.h not found.])
111: fi
112:
113: PHP_CHECK_LIBRARY(jpeg,jpeg_read_header,
114: [
115: PHP_ADD_INCLUDE($GD_JPEG_DIR/include)
116: PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
117: ],[
118: AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.])
119: ],[
120: -L$GD_JPEG_DIR/$PHP_LIBDIR
121: ])
122: else
123: AC_MSG_RESULT([If configure fails try --with-jpeg-dir=<DIR>])
124: fi
125: ])
126:
127: AC_DEFUN([PHP_GD_PNG],[
128: if test "$PHP_PNG_DIR" != "no"; then
129:
130: for i in $PHP_PNG_DIR /usr/local /usr; do
131: test -f $i/include/png.h && GD_PNG_DIR=$i && break
132: done
133:
134: if test -z "$GD_PNG_DIR"; then
135: AC_MSG_ERROR([png.h not found.])
136: fi
137:
138: if test "$PHP_ZLIB_DIR" = "no"; then
139: AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=<DIR>])
140: fi
141:
142: PHP_CHECK_LIBRARY(png,png_write_image,
143: [
144: PHP_ADD_INCLUDE($GD_PNG_DIR/include)
145: PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
146: PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
147: ],[
148: AC_MSG_ERROR([Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.])
149: ],[
150: -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz -L$GD_PNG_DIR/$PHP_LIBDIR
151: ])
152:
153: else
154: AC_MSG_RESULT([If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>])
155: fi
156: ])
157:
158: AC_DEFUN([PHP_GD_XPM],[
159: if test "$PHP_XPM_DIR" != "no"; then
160:
161: for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
162: test -f $i/$PHP_LIBDIR/libXpm.$SHLIB_SUFFIX_NAME || test -f $i/$PHP_LIBDIR/libXpm.a && GD_XPM_DIR=$i && break
163: done
164:
165: if test -z "$GD_XPM_DIR"; then
166: AC_MSG_ERROR([libXpm.(a|so) not found.])
167: fi
168:
169: for i in include include/X11; do
170: test -f $GD_XPM_DIR/$i/xpm.h && GD_XPM_INC=$GD_XPM_DIR/include
171: done
172:
173: if test -z "$GD_XPM_INC"; then
174: AC_MSG_ERROR([xpm.h not found.])
175: fi
176:
177: PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage,
178: [
179: PHP_ADD_INCLUDE($GD_XPM_INC)
180: PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
181: PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
182: ],[
183: AC_MSG_ERROR([Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.])
184: ],[
185: -L$GD_XPM_DIR/$PHP_LIBDIR -lX11
186: ])
187: else
188: AC_MSG_RESULT(If configure fails try --with-xpm-dir=<DIR>)
189: fi
190: ])
191:
192: AC_DEFUN([PHP_GD_FREETYPE2],[
193: if test "$PHP_FREETYPE_DIR" != "no"; then
194:
195: for i in $PHP_FREETYPE_DIR /usr/local /usr; do
196: if test -f "$i/include/freetype2/freetype/freetype.h"; then
197: FREETYPE2_DIR=$i
198: FREETYPE2_INC_DIR=$i/include/freetype2
199: break
200: fi
201: done
202:
203: if test -z "$FREETYPE2_DIR"; then
204: AC_MSG_ERROR([freetype.h not found.])
205: fi
206:
207: PHP_CHECK_LIBRARY(freetype, FT_New_Face,
208: [
209: PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
210: PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
211: PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
212: AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
213: AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
214: AC_DEFINE(ENABLE_GD_TTF,1,[ ])
215: ],[
216: AC_MSG_ERROR([Problem with freetype.(a|so). Please check config.log for more information.])
217: ],[
218: -L$FREETYPE2_DIR/$PHP_LIBDIR
219: ])
220: else
221: AC_MSG_RESULT([If configure fails try --with-freetype-dir=<DIR>])
222: fi
223: ])
224:
225: AC_DEFUN([PHP_GD_T1LIB],[
226: if test "$PHP_T1LIB" != "no"; then
227:
228: for i in $PHP_T1LIB /usr/local /usr; do
229: test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break
230: done
231:
232: if test -z "$GD_T1_DIR"; then
233: AC_MSG_ERROR([Your t1lib distribution is not installed correctly. Please reinstall it.])
234: fi
235:
236: PHP_CHECK_LIBRARY(t1, T1_StrError,
237: [
238: AC_DEFINE(HAVE_LIBT1,1,[ ])
239: PHP_ADD_INCLUDE($GD_T1_DIR/include)
240: PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
241: ],[
242: AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.])
243: ],[
244: -L$GD_T1_DIR/$PHP_LIBDIR
245: ])
246: fi
247: ])
248:
249: AC_DEFUN([PHP_GD_TTSTR],[
250: if test "$PHP_GD_NATIVE_TTF" = "yes"; then
251: AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
252: fi
253: ])
254:
255: AC_DEFUN([PHP_GD_JISX0208],[
256: if test "$PHP_GD_JIS_CONV" = "yes"; then
257: USE_GD_JIS_CONV=1
258: fi
259: ])
260:
261: AC_DEFUN([PHP_GD_CHECK_VERSION],[
262: PHP_CHECK_LIBRARY(gd, gdImageString16, [AC_DEFINE(HAVE_LIBGD13, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
263: PHP_CHECK_LIBRARY(gd, gdImagePaletteCopy, [AC_DEFINE(HAVE_LIBGD15, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
264: PHP_CHECK_LIBRARY(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
265: PHP_CHECK_LIBRARY(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
266: PHP_CHECK_LIBRARY(gd, gdImageGif, [AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
267: PHP_CHECK_LIBRARY(gd, gdImageWBMP, [AC_DEFINE(HAVE_GD_WBMP, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
268: PHP_CHECK_LIBRARY(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
269: PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
270: PHP_CHECK_LIBRARY(gd, gdImageCreateFromGd2, [AC_DEFINE(HAVE_GD_GD2, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
271: PHP_CHECK_LIBRARY(gd, gdImageCreateTrueColor, [AC_DEFINE(HAVE_LIBGD20, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
272: PHP_CHECK_LIBRARY(gd, gdImageSetTile, [AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
273: PHP_CHECK_LIBRARY(gd, gdImageEllipse, [AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
274: PHP_CHECK_LIBRARY(gd, gdImageSetBrush, [AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
275: PHP_CHECK_LIBRARY(gd, gdImageStringTTF, [AC_DEFINE(HAVE_GD_STRINGTTF, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
276: PHP_CHECK_LIBRARY(gd, gdImageStringFT, [AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
277: PHP_CHECK_LIBRARY(gd, gdImageStringFTEx, [AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
278: PHP_CHECK_LIBRARY(gd, gdImageColorClosestHWB, [AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
279: PHP_CHECK_LIBRARY(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
280: PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
281: PHP_CHECK_LIBRARY(gd, gdCacheCreate, [AC_DEFINE(HAVE_GD_CACHE_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
282: PHP_CHECK_LIBRARY(gd, gdFontCacheShutdown, [AC_DEFINE(HAVE_GD_FONTCACHESHUTDOWN,1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
283: PHP_CHECK_LIBRARY(gd, gdFreeFontCache, [AC_DEFINE(HAVE_GD_FREEFONTCACHE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
284: PHP_CHECK_LIBRARY(gd, gdFontCacheMutexSetup, [AC_DEFINE(HAVE_GD_FONTMUTEX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
285: PHP_CHECK_LIBRARY(gd, gdNewDynamicCtxEx, [AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
1.1.1.3 ! misho 286: PHP_CHECK_LIBRARY(gd, gdImageConvolution, [AC_DEFINE(HAVE_GD_IMAGE_CONVOLUTION, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
! 287: PHP_CHECK_LIBRARY(gd, gdImagePixelate, [AC_DEFINE(HAVE_GD_IMAGE_PIXELATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
1.1 misho 288: ])
289:
290: dnl
291: dnl Main GD configure
292: dnl
293:
294: if test "$PHP_GD" = "yes"; then
295: GD_MODULE_TYPE=builtin
296: extra_sources="libgd/gd.c libgd/gd_gd.c libgd/gd_gd2.c libgd/gd_io.c libgd/gd_io_dp.c \
1.1.1.2 misho 297: libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/webpimg.c libgd/gd_webp.c \
298: libgd/gd_png.c libgd/gd_jpeg.c libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c \
299: libgd/gdfontmb.c libgd/gdfontl.c libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c \
300: libgd/gdcache.c libgd/gdkanji.c libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c \
301: libgd/gd_topal.c libgd/gd_gif_in.c libgd/xbm.c libgd/gd_gif_out.c libgd/gd_security.c \
302: libgd/gd_filter.c libgd/gd_pixelate.c libgd/gd_arc.c libgd/gd_rotate.c libgd/gd_color.c"
1.1 misho 303:
304: dnl check for fabsf and floorf which are available since C99
305: AC_CHECK_FUNCS(fabsf floorf)
306:
307: dnl PNG is required by GD library
308: test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes
309:
310: dnl Various checks for GD features
311: PHP_GD_ZLIB
312: PHP_GD_TTSTR
313: PHP_GD_JISX0208
314: PHP_GD_JPEG
1.1.1.2 misho 315: PHP_GD_VPX
1.1 misho 316: PHP_GD_PNG
317: PHP_GD_XPM
318: PHP_GD_FREETYPE2
319: PHP_GD_T1LIB
320:
321: dnl These are always available with bundled library
322: AC_DEFINE(HAVE_LIBGD, 1, [ ])
323: AC_DEFINE(HAVE_LIBGD13, 1, [ ])
324: AC_DEFINE(HAVE_LIBGD15, 1, [ ])
325: AC_DEFINE(HAVE_LIBGD20, 1, [ ])
326: AC_DEFINE(HAVE_LIBGD204, 1, [ ])
327: AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ])
328: AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ])
329: AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])
330: AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ])
331: AC_DEFINE(HAVE_GD_WBMP, 1, [ ])
332: AC_DEFINE(HAVE_GD_GD2, 1, [ ])
333: AC_DEFINE(HAVE_GD_PNG, 1, [ ])
334: AC_DEFINE(HAVE_GD_XBM, 1, [ ])
335: AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ])
336: AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])
337: AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])
338: AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])
339: AC_DEFINE(HAVE_GD_FONTCACHESHUTDOWN,1, [ ])
340: AC_DEFINE(HAVE_GD_FONTMUTEX, 1, [ ])
341: AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])
342: AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])
343:
344: dnl Make sure the libgd/ is first in the include path
345: GDLIB_CFLAGS="-DHAVE_LIBPNG"
346:
347: dnl Depending which libraries were included to PHP configure,
348: dnl enable the support in bundled GD library
349:
1.1.1.2 misho 350: if test -n "$GD_VPX_DIR"; then
351: AC_DEFINE(HAVE_GD_WEBP, 1, [ ])
352: GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBVPX"
353: fi
354:
1.1 misho 355: if test -n "$GD_JPEG_DIR"; then
356: AC_DEFINE(HAVE_GD_JPG, 1, [ ])
357: GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBJPEG"
358: fi
359:
360: if test -n "$GD_XPM_DIR"; then
361: AC_DEFINE(HAVE_GD_XPM, 1, [ ])
362: GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_XPM"
363: fi
364:
365: if test -n "$FREETYPE2_DIR"; then
366: AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ])
367: AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])
368: AC_DEFINE(ENABLE_GD_TTF, 1, [ ])
369: GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBFREETYPE -DENABLE_GD_TTF"
370: fi
371:
372: if test -n "$USE_GD_JIS_CONV"; then
373: AC_DEFINE(USE_GD_JISX0208, 1, [ ])
374: GDLIB_CFLAGS="$GDLIB_CFLAGS -DJISX0208"
375: fi
376:
377: else
378:
379: if test "$PHP_GD" != "no"; then
380: GD_MODULE_TYPE=external
381: extra_sources="gdcache.c libgd/gd_compat.c libgd/gd_filter.c libgd/gd_pixelate.c libgd/gd_arc.c \
382: libgd/gd_rotate.c libgd/gd_color.c"
383:
384: dnl Various checks for GD features
385: PHP_GD_ZLIB
386: PHP_GD_TTSTR
1.1.1.2 misho 387: PHP_GD_VPX
1.1 misho 388: PHP_GD_JPEG
389: PHP_GD_PNG
390: PHP_GD_XPM
391: PHP_GD_FREETYPE2
392: PHP_GD_T1LIB
393:
394: dnl Header path
395: for i in include/gd1.3 include/gd include gd1.3 gd ""; do
396: test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i"
397: done
398:
399: dnl Library path
400: for i in $PHP_LIBDIR/gd1.3 $PHP_LIBDIR/gd $PHP_LIBDIR gd1.3 gd ""; do
401: test -f "$PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME" || test -f "$PHP_GD/$i/libgd.a" && GD_LIB="$PHP_GD/$i"
402: done
403:
404: if test -n "$GD_INCLUDE" && test -n "$GD_LIB"; then
405: PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD)
406: AC_DEFINE(HAVE_LIBGD,1,[ ])
407: PHP_GD_CHECK_VERSION
408: elif test -z "$GD_INCLUDE"; then
409: AC_MSG_ERROR([Unable to find gd.h anywhere under $PHP_GD])
410: else
411: AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $PHP_GD])
412: fi
413:
414: PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE)
415:
416: dnl
417: dnl Check for gd 2.0.4 greater availability
418: dnl
419: old_CPPFLAGS=$CPPFLAGS
420: CPPFLAGS=-I$GD_INCLUDE
421: AC_TRY_COMPILE([
422: #include <gd.h>
423: #include <stdlib.h>
424: ], [
425: gdIOCtx *ctx;
426: ctx = malloc(sizeof(gdIOCtx));
427: ctx->gd_free = 1;
428: ], [
429: AC_DEFINE(HAVE_LIBGD204, 1, [ ])
430: ])
431: CPPFLAGS=$old_CPPFLAGS
432:
433: fi
434: fi
435:
436: dnl
437: dnl Common for both builtin and external GD
438: dnl
439: if test "$PHP_GD" != "no"; then
440: PHP_NEW_EXTENSION(gd, gd.c $extra_sources, $ext_shared,, \\$(GDLIB_CFLAGS))
441:
442: PHP_ADD_BUILD_DIR($ext_builddir/libgd)
443:
444: if test "$GD_MODULE_TYPE" = "builtin"; then
445: GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS"
446: GD_HEADER_DIRS="ext/gd/ ext/gd/libgd/"
447:
448: PHP_TEST_BUILD(foobar, [], [
449: AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])
450: ], [ $GD_SHARED_LIBADD ], [char foobar () {}])
451: else
452: GD_HEADER_DIRS="ext/gd/"
453: GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS"
454: PHP_ADD_INCLUDE($GD_INCLUDE)
455: PHP_CHECK_LIBRARY(gd, gdImageCreate, [], [
456: AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])
457: ], [ -L$GD_LIB $GD_SHARED_LIBADD ])
458: fi
459:
460: PHP_INSTALL_HEADERS([$GD_HEADER_DIRS])
461: PHP_SUBST(GDLIB_CFLAGS)
462: PHP_SUBST(GD_SHARED_LIBADD)
463: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>