]> git.pld-linux.org Git - packages/php.git/blob - php-cpdf-fix.patch
- fix for current libtool versions
[packages/php.git] / php-cpdf-fix.patch
1 --- php-4.3.0/ext/cpdf/config.m4.orig   Wed Mar 13 10:18:53 2002
2 +++ php-4.3.0/ext/cpdf/config.m4        Thu Jan  2 13:12:16 2003
3 @@ -1,70 +1,97 @@
4  dnl $Id$
5  
6 -AC_MSG_CHECKING(for cpdflib support)
7 -AC_ARG_WITH(cpdflib,
8 -[  --with-cpdflib[=DIR]    Include cpdflib support (requires cpdflib >= 2).],
9 -[
10 -  case $withval in
11 -    no)
12 -      AC_MSG_RESULT(no) ;;
13 +PHP_ARG_WITH(cpdflib, for cpdflib support,
14 +[  --with-cpdflib[=DIR]    Include cpdflib support (requires cpdflib >= 2).])
15 +
16 +if test "$PHP_CPDFLIB" != "no"; then
17 +
18 +  PHP_NEW_EXTENSION(cpdf, cpdf.c, $ext_shared)
19 +  PHP_SUBST(CPDF_SHARED_LIBADD)
20 +
21 +  dnl # libjpeg
22 +    
23 +  PHP_ARG_WITH(jpeg-dir, for the location of libjpeg, 
24 +  [  --with-jpeg-dir[=DIR]     PDFLIB: define libjpeg install directory. (OPTIONAL for PDFlib v4)])
25 +
26 +  if test "$PHP_JPEG_DIR" != "no"; then
27 +    PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, 
28 +    [
29 +      PHP_ADD_LIBRARY_WITH_PATH(jpeg, $PHP_JPEG_DIR/lib, CPDF_SHARED_LIBADD)
30 +    ],[
31 +      AC_MSG_ERROR([libjpeg not found!])
32 +    ],[
33 +      -L$PHP_JPEG_DIR/lib
34 +    ])
35 +  else
36 +    AC_MSG_WARN([If configure fails, try --with-jpeg-dir=<DIR>])
37 +  fi
38 +
39 +  dnl # libpng
40 +
41 +  PHP_ARG_WITH(png-dir, for the location of libpng, 
42 +  [  --with-png-dir[=DIR]      PDFLIB: define libpng install directory.  (OPTIONAL for PDFlib v4)])
43
44 +  if test "$PHP_PNG_DIR" != "no"; then
45 +    PHP_CHECK_LIBRARY(png,png_create_info_struct, 
46 +    [
47 +      PHP_ADD_LIBRARY_WITH_PATH(png, $PHP_PNG_DIR/lib, CPDF_SHARED_LIBADD)
48 +    ],[
49 +      AC_MSG_ERROR([libpng not found!])
50 +    ],[
51 +      -L$PHP_PNG_DIR/lib
52 +    ])
53 +  else
54 +    AC_MSG_WARN([If configure fails, try --with-png-dir=<DIR>])
55 +  fi
56 +
57 +  dnl # libtiff
58 +
59 +  PHP_ARG_WITH(tiff-dir, for the location of libtiff,
60 +  [  --with-tiff-dir[=DIR]     PDFLIB: define libtiff install directory. (OPTIONAL for PDFlib v4)])
61 +
62 +  if test "$PHP_TIFF_DIR" != "no"; then
63 +    PHP_CHECK_LIBRARY(tiff,TIFFOpen, 
64 +    [
65 +      PHP_ADD_LIBRARY_WITH_PATH(tiff, $PHP_TIFF_DIR/lib, CPDF_SHARED_LIBADD)
66 +    ],[
67 +      AC_MSG_ERROR([libtiff not found!])
68 +    ],[
69 +      -L$PHP_TIFF_DIR/lib
70 +    ])
71 +  else
72 +    AC_MSG_WARN([If configure fails, try --with-tiff-dir=<DIR>])
73 +  fi
74 +
75 +  dnl # zlib
76
77 +  AC_MSG_CHECKING([for the location of zlib])
78 +  if test "$PHP_ZLIB_DIR" = "no"; then
79 +    AC_MSG_RESULT([no. If configure fails, try --with-zlib-dir=<DIR>])
80 +  else           
81 +    AC_MSG_RESULT([$PHP_ZLIB_DIR])
82 +    PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, CPDF_SHARED_LIBADD)
83 +  fi
84 +
85 +  case $PHP_CPDFLIB in
86      yes)
87 -      AC_MSG_RESULT(yes)
88 -      PHP_NEW_EXTENSION(cpdf, cpdf.c)
89        AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
90          [AC_MSG_ERROR([Cpdf module requires cpdflib >= 2.])])
91 +      PHP_ADD_LIBRARY(cpdf,, CPDF_SHARED_LIBADD)
92 -      PHP_ADD_LIBRARY(cpdf)
93 -      PHP_ADD_LIBRARY(tiff)
94 -      PHP_ADD_LIBRARY(jpeg)
95        ;;
96      *)
97 -      test -f $withval/include/cpdflib.h && CPDFLIB_INCLUDE=$withval/include
98 -      if test -n "$CPDFLIB_INCLUDE" ; then
99 -        AC_MSG_RESULT(yes)
100 -        PHP_NEW_EXTENSION(cpdf, cpdf.c)
101 -        old_LIBS=$LIBS
102 -        old_withval=$withval
103 -
104 -        AC_MSG_CHECKING([for libjpeg (needed by cpdflib 2.x)])
105 -        AC_ARG_WITH(jpeg-dir,
106 -        [  --with-jpeg-dir[=DIR]   jpeg dir for cpdflib 2.x],[
107 -          AC_MSG_RESULT(yes)
108 -          if test -z $withval; then
109 -            withval=/usr/local
110 -          fi
111 -          LIBS="$LIBS -L$withval/lib"
112 -          AC_CHECK_LIB(jpeg,jpeg_read_header, ,[AC_MSG_RESULT(no)],)
113 -          PHP_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib)
114 -        ],[
115 -          AC_MSG_RESULT(no)
116 -          AC_MSG_WARN(If configure fails try --with-jpeg-dir=<DIR>)
117 -        ]) 
118 -
119 -        AC_MSG_CHECKING([for libtiff (needed by cpdflib 2.x)])
120 -        AC_ARG_WITH(tiff-dir,
121 -        [  --with-tiff-dir[=DIR]   tiff dir for cpdflib 2.x],[
122 -          AC_MSG_RESULT(yes)
123 -          if test -z $withval; then
124 -            withval=/usr/local
125 -          fi
126 -          LIBS="$LIBS -L$withval/lib"
127 -          AC_CHECK_LIB(tiff,TIFFOpen, ,[AC_MSG_RESULT(no)],)
128 -          PHP_ADD_LIBRARY_WITH_PATH(tiff, $withval/lib)
129 -        ],[
130 -          AC_MSG_RESULT(no)
131 -          AC_MSG_WARN(If configure fails try --with-tiff-dir=<DIR>)
132 -        ]) 
133 -        withval=$old_withval
134 -
135 -          LIBS="$LIBS -L$withval/lib"
136 -        AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
137 -          [AC_MSG_ERROR([Cpdflib module requires cpdflib >= 2.])])
138 -        LIBS=$old_LIBS
139 -        PHP_ADD_LIBRARY_WITH_PATH(cpdf, $withval/lib)
140 -        PHP_ADD_INCLUDE($CPDFLIB_INCLUDE)
141 +      if test -f "$PHP_CPDFLIB/include/cpdflib.h"; then
142 +        PHP_CHECK_LIBRARY(cpdf, cpdf_open,[
143 +         AC_DEFINE(HAVE_PDFLIB,1,[ ])
144 +         PHP_ADD_LIBRARY_WITH_PATH(cpdf, $PHP_CPDFLIB/lib, CPDF_SHARED_LIBADD)
145 +         PHP_ADD_INCLUDE($PHP_CPDFLIB/include)
146 +       ],[
147 +          AC_MSG_ERROR([Cpdflib module requires cpdflib >= 2.])
148 +       ],[
149 +         -L$PHP_PDFLIB/lib
150 +       ])
151        else
152 -        AC_MSG_RESULT(no)
153 -      fi ;;
154 +        AC_MSG_ERROR([cpdflib.h not found! Check the path passed to --with-cpdflib=<PATH>. PATH should be the install prefix directory.])
155 +      fi
156 +      ;;
157    esac
158 -],[
159 -  AC_MSG_RESULT(no)
160 -])
161 +fi
This page took 0.056098 seconds and 3 git commands to generate.