~ubuntu-branches/ubuntu/gutsy/php5/gutsy

« back to all changes in this revision

Viewing changes to ext/gd/config.m4

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, CVE-2007-0905, CVE-2007-0906, CVE-2007-0909, CVE-2007-0910
  • Date: 2007-02-20 17:54:46 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070220175446-nudqyuv0dfowel3r
Tags: 5.2.1-0ubuntu1
* New upstream security/bugfix release:
  - safe_mode & open_basedir bypasses inside the session extension
    [CVE-2007-0905]
  - multiple buffer overflows in various extensions and functions
    [CVE-2007-0906]
  - underflow in the internal sapi_header_op() function [CVE-2007-0907]
  - information disclosure in the wddx extension [CVE-2007-0908]
  - string format vulnerability in *print() functions on 64 bit systems
    [CVE-2007-0909]
  - possible clobbering of super-globals in several code paths
    [CVE-2007-0910]
* Adapted patches to new upstream release:
  - 006-debian_quirks.patch
  - 034-apache2_umask_fix.patch
  - 044-strtod_arm_fix.patch
* Drop 109-libdb4.4.patch: Obsolete, upstream now checks for db 4.5 and 4.4.
* Drop 114-zend_alloc.c_m68k_alignment.patch and
  115-zend_alloc.c_memleak.patch: Applied upstream.
* Add debian/patches/000upstream-str_ireplace_offbyone.patch:
  - Fix off-by-one in str_ireplace(), a regression introduced in 5.2.1.
  - Patch taken from upstream CVS:
    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.630&r2=1.631
  - CVE-2007-0911
* debian/control: Set Ubuntu maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl
2
 
dnl $Id: config.m4,v 1.154.2.1 2005/11/29 18:25:59 tony2001 Exp $
 
2
dnl $Id: config.m4,v 1.154.2.1.2.1 2006/12/26 10:42:50 pajoye Exp $
3
3
dnl
4
4
 
5
5
dnl
6
6
dnl Configure options
7
 
dnl 
 
7
dnl
8
8
 
9
9
PHP_ARG_WITH(gd, for GD support,
10
10
[  --with-gd[=DIR]         Include GD support where DIR is GD install prefix.
21
21
fi
22
22
 
23
23
if test -z "$PHP_ZLIB_DIR"; then
24
 
  PHP_ARG_WITH(zlib-dir, for the location of libz, 
 
24
  PHP_ARG_WITH(zlib-dir, for the location of libz,
25
25
  [  --with-zlib-dir[=DIR]     GD: Set the path to libz install prefix], no, no)
26
26
fi
27
27
 
30
30
 
31
31
PHP_ARG_WITH(ttf, for FreeType 1.x support,
32
32
[  --with-ttf[=DIR]          GD: Include FreeType 1.x support], no, no)
33
 
  
 
33
 
34
34
PHP_ARG_WITH(freetype-dir, for FreeType 2,
35
35
[  --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix], no, no)
36
36
 
43
43
PHP_ARG_ENABLE(gd-jis-conv, whether to enable JIS-mapped Japanese font support in GD,
44
44
[  --enable-gd-jis-conv      GD: Enable JIS-mapped Japanese font support], no, no)
45
45
 
46
 
dnl  
47
 
dnl Checks for the configure options 
48
 
dnl 
 
46
dnl
 
47
dnl Checks for the configure options
 
48
dnl
 
49
 
 
50
AC_DEFUN([PHP_GD_ZLIB],[
 
51
        if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
 
52
                if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
 
53
                        PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
 
54
                        PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
 
55
                elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
 
56
                        PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
 
57
                        PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
 
58
                else
 
59
                        AC_MSG_ERROR([Can't find zlib headers under "$PHP_ZLIB_DIR"])
 
60
                fi
 
61
        else
 
62
                for i in /usr/local /usr; do
 
63
                        if test -f "$i/include/zlib/zlib.h"; then
 
64
                                PHP_ZLIB_DIR="$i"
 
65
                                PHP_ZLIB_INCDIR="$i/include/zlib"
 
66
                        elif test -f "$i/include/zlib.h"; then
 
67
                                PHP_ZLIB_DIR="$i"
 
68
                                PHP_ZLIB_INCDIR="$i/include"
 
69
                        fi
 
70
                done
 
71
        fi
 
72
])
49
73
 
50
74
AC_DEFUN([PHP_GD_JPEG],[
51
75
  if test "$PHP_JPEG_DIR" != "no"; then
63
87
      PHP_ADD_INCLUDE($GD_JPEG_DIR/include)
64
88
      PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
65
89
    ],[
66
 
      AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.]) 
 
90
      AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.])
67
91
    ],[
68
92
      -L$GD_JPEG_DIR/$PHP_LIBDIR
69
93
    ])
70
 
  else 
 
94
  else
71
95
    AC_MSG_RESULT([If configure fails try --with-jpeg-dir=<DIR>])
72
96
  fi
73
97
])
97
121
      PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
98
122
      PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
99
123
    ],[
100
 
      AC_MSG_ERROR([Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.]) 
 
124
      AC_MSG_ERROR([Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.])
101
125
    ],[
102
126
      -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz -L$GD_PNG_DIR/$PHP_LIBDIR
103
127
    ])
104
128
 
105
 
  else 
 
129
  else
106
130
    AC_MSG_RESULT([If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>])
107
131
  fi
108
132
])
126
150
      AC_MSG_ERROR([xpm.h not found.])
127
151
    fi
128
152
 
129
 
    PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage, 
 
153
    PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage,
130
154
    [
131
155
      PHP_ADD_INCLUDE($GD_XPM_INC)
132
156
      PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
133
157
      PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
134
158
    ],[
135
 
      AC_MSG_ERROR([Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.]) 
 
159
      AC_MSG_ERROR([Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.])
136
160
    ],[
137
161
      -L$GD_XPM_DIR/$PHP_LIBDIR -lX11
138
162
    ])
139
 
  else 
 
163
  else
140
164
    AC_MSG_RESULT(If configure fails try --with-xpm-dir=<DIR>)
141
165
  fi
142
166
])
186
210
        break
187
211
      fi
188
212
    done
189
 
    
 
213
 
190
214
    if test -n "$FREETYPE2_DIR" ; then
191
215
      PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
192
216
      PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
196
220
    else
197
221
      AC_MSG_ERROR([freetype2 not found!])
198
222
    fi
199
 
  else 
 
223
  else
200
224
    AC_MSG_RESULT([If configure fails try --with-freetype-dir=<DIR>])
201
225
  fi
202
226
])
209
233
    done
210
234
 
211
235
    if test -z "$GD_T1_DIR"; then
212
 
      AC_MSG_ERROR([Your t1lib distribution is not installed correctly. Please reinstall it.]) 
 
236
      AC_MSG_ERROR([Your t1lib distribution is not installed correctly. Please reinstall it.])
213
237
    fi
214
238
 
215
239
    PHP_CHECK_LIBRARY(t1, T1_StrError,
218
242
      PHP_ADD_INCLUDE($GD_T1_DIR/include)
219
243
      PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
220
244
    ],[
221
 
      AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.]) 
 
245
      AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.])
222
246
    ],[
223
247
      -L$GD_T1_DIR/$PHP_LIBDIR
224
248
    ])
265
289
 
266
290
dnl
267
291
dnl Main GD configure
268
 
dnl 
 
292
dnl
269
293
 
270
294
if test "$PHP_GD" = "yes"; then
271
295
  GD_MODULE_TYPE=builtin
281
305
 
282
306
dnl PNG is required by GD library
283
307
  test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes
284
 
      
 
308
 
285
309
dnl Various checks for GD features
 
310
  PHP_GD_ZLIB
286
311
  PHP_GD_TTSTR
287
312
  PHP_GD_JISX0208
288
313
  PHP_GD_JPEG
297
322
  AC_DEFINE(HAVE_LIBGD13,             1, [ ])
298
323
  AC_DEFINE(HAVE_LIBGD15,             1, [ ])
299
324
  AC_DEFINE(HAVE_LIBGD20,             1, [ ])
300
 
  AC_DEFINE(HAVE_LIBGD204,            1, [ ])  
 
325
  AC_DEFINE(HAVE_LIBGD204,            1, [ ])
301
326
  AC_DEFINE(HAVE_GD_IMAGESETTILE,     1, [ ])
302
327
  AC_DEFINE(HAVE_GD_IMAGESETBRUSH,    1, [ ])
303
328
  AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])
329
354
    AC_DEFINE(HAVE_GD_XPM, 1, [ ])
330
355
    GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_XPM"
331
356
  fi
332
 
  
 
357
 
333
358
  if test -n "$FREETYPE2_DIR"; then
334
359
    AC_DEFINE(HAVE_GD_STRINGFT,   1, [ ])
335
360
    AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])
352
377
  extra_sources="gdcache.c"
353
378
 
354
379
dnl Various checks for GD features
 
380
  PHP_GD_ZLIB
355
381
  PHP_GD_TTSTR
356
382
  PHP_GD_JPEG
357
383
  PHP_GD_PNG
378
404
    AC_MSG_ERROR([Unable to find gd.h anywhere under $PHP_GD])
379
405
  else
380
406
    AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $PHP_GD])
381
 
  fi 
 
407
  fi
382
408
 
383
409
  PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE)
384
410
 
416
442
    GD_HEADER_DIRS="ext/gd/"
417
443
    GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS"
418
444
    PHP_ADD_INCLUDE($GD_INCLUDE)
419
 
  
 
445
 
420
446
    PHP_CHECK_LIBRARY(gd, gdImageCreate, [], [
421
447
      AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])
422
448
    ], [ -L$GD_LIB $GD_SHARED_LIBADD ])