diff options
-rw-r--r-- | acinclude.m4 | 19 | ||||
-rw-r--r-- | ext/curl/config.m4 | 2 | ||||
-rw-r--r-- | ext/fdf/config.m4 | 2 | ||||
-rw-r--r-- | ext/gd/config.m4 | 9 | ||||
-rw-r--r-- | ext/mcrypt/config.m4 | 4 | ||||
-rw-r--r-- | ext/pdf/config.m4 | 8 | ||||
-rw-r--r-- | ext/satellite/config.m4 | 4 | ||||
-rw-r--r-- | ext/sybase_ct/config.m4 | 4 | ||||
-rw-r--r-- | ext/vpopmail/config.m4 | 7 |
9 files changed, 41 insertions, 18 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index fc6f41e82f..771f48e55f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1122,3 +1122,22 @@ AC_DEFUN(PHP_FOPENCOOKIE,[ fi ]) + + +dnl +dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]]) +dnl +dnl Wrapper for AC_CHECK_LIB +dnl +AC_DEFUN(PHP_CHECK_LIBRARY, [ + save_old_LDFLAGS=$LDFLAGS + LDFLAGS="$5 $LDFLAGS" + AC_CHECK_LIB([$1],[$2],[ + LDFLAGS=$save_old_LDFLAGS + $3 + ],[ + LDFLAGS=$save_old_LDFLAGS + $4 + ])dnl +]) + diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index 729e45e04c..46a9066853 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -43,7 +43,7 @@ if test "$PHP_CURL" != "no"; then PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, CURL_SHARED_LIBADD) - AC_CHECK_LIB(curl,curl_easy_perform, + PHP_CHECK_LIBRARY(curl,curl_easy_perform, [ AC_DEFINE(HAVE_CURL,1,[ ]) ],[ diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4 index 139458c8c5..b6569b6697 100644 --- a/ext/fdf/config.m4 +++ b/ext/fdf/config.m4 @@ -19,7 +19,7 @@ if test "$PHP_FDFTK" != "no"; then FDFLIBRARY="" for i in fdftk FdfTk; do - AC_CHECK_LIB($i, FDFOpen, [FDFLIBRARY=$i], [], [-L$FDFTK_DIR/lib -lm]) + PHP_CHECK_LIBRARY($i, FDFOpen, [FDFLIBRARY=$i], [], [-L$FDFTK_DIR/lib -lm]) done if test -z "$FDFLIBRARY"; then diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index e551f6781a..50c7bd8016 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -12,7 +12,7 @@ AC_DEFUN(PHP_GD_JPEG,[ test -f "$i/lib/libjpeg.s?" -o -f "$i/lib/libjpeg.a" && GD_JPEG_DIR=$i done - AC_CHECK_LIB(jpeg,jpeg_read_header, + PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, [ PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/lib, GD_SHARED_LIBADD) ],[ @@ -39,7 +39,7 @@ AC_DEFUN(PHP_GD_PNG,[ AC_MSG_ERROR(PNG support requires ZLIB. Use --with-zlib-dir=<DIR>) fi - AC_CHECK_LIB(png,png_info_init, + PHP_CHECK_LIBRARY(png,png_info_init, [ PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, GD_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/lib, GD_SHARED_LIBADD) @@ -48,6 +48,7 @@ AC_DEFUN(PHP_GD_PNG,[ ],[ -L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib ]) + else AC_MSG_RESULT(If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>) fi @@ -62,7 +63,7 @@ AC_DEFUN(PHP_GD_XPM,[ test -f "$i/lib/libXpm.s?" -o -f "$i/lib/libXpm.a" && GD_XPM_DIR=$i done - AC_CHECK_LIB(Xpm,XpmFreeXpmImage, + PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage, [ PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/lib, GD_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/lib, GD_SHARED_LIBADD) @@ -143,7 +144,7 @@ AC_DEFUN(PHP_GD_T1LIB,[ done if test -n "$T1_DIR"; then - AC_CHECK_LIB(t1, T1_LoadFont, + PHP_CHECK_LIBRARY(t1, T1_LoadFont, [ AC_DEFINE(HAVE_LIBT1,1,[ ]) PHP_ADD_INCLUDE("$T1_DIR/include") diff --git a/ext/mcrypt/config.m4 b/ext/mcrypt/config.m4 index 8b26ee67da..e98b77ebf8 100644 --- a/ext/mcrypt/config.m4 +++ b/ext/mcrypt/config.m4 @@ -17,12 +17,12 @@ if test "$PHP_MCRYPT" != "no"; then AC_MSG_ERROR(mcrypt.h not found. Please reinstall libmcrypt.) fi - AC_CHECK_LIB(mcrypt, mcrypt_module_open, + PHP_CHECK_LIBRARY(mcrypt, mcrypt_module_open, [ PHP_ADD_LIBRARY(ltdl,, MCRYPT_SHARED_LIBADD) AC_DEFINE(HAVE_LIBMCRYPT24,1,[ ]) ],[ - AC_CHECK_LIB(mcrypt, init_mcrypt, + PHP_CHECK_LIBRARY(mcrypt, init_mcrypt, [ AC_DEFINE(HAVE_LIBMCRYPT22,1,[ ]) ],[ diff --git a/ext/pdf/config.m4 b/ext/pdf/config.m4 index 834236be48..1cb4efc40a 100644 --- a/ext/pdf/config.m4 +++ b/ext/pdf/config.m4 @@ -43,7 +43,7 @@ if test "$PHP_PDFLIB" != "no"; then [ --with-jpeg-dir[=DIR] PDFLIB: define libjpeg install directory]) if test "$PHP_JPEG_DIR" != "no"; then - AC_CHECK_LIB(jpeg,jpeg_read_header, + PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, [ PHP_ADD_LIBRARY_WITH_PATH(jpeg, $PHP_JPEG_DIR/lib, PDFLIB_SHARED_LIBADD) ],[ @@ -65,7 +65,7 @@ if test "$PHP_PDFLIB" != "no"; then [ --with-png-dir[=DIR] PDFLIB: define libpng install directory]) if test "$PHP_PNG_DIR" != "no"; then - AC_CHECK_LIB(png,png_create_info_struct, + PHP_CHECK_LIBRARY(png,png_create_info_struct, [ PHP_ADD_LIBRARY_WITH_PATH(png, $PHP_PNG_DIR/lib, PDFLIB_SHARED_LIBADD) ],[ @@ -87,7 +87,7 @@ if test "$PHP_PDFLIB" != "no"; then [ --with-tiff-dir[=DIR] PDFLIB: define libtiff install directory]) if test "$PHP_TIFF_DIR" != "no"; then - AC_CHECK_LIB(tiff,TIFFOpen, + PHP_CHECK_LIBRARY(tiff,TIFFOpen, [ PHP_ADD_LIBRARY_WITH_PATH(tiff, $PHP_TIFF_DIR/lib, PDFLIB_SHARED_LIBADD) ],[ @@ -105,7 +105,7 @@ if test "$PHP_PDFLIB" != "no"; then fi - AC_CHECK_LIB(pdf, PDF_show_boxed, + PHP_CHECK_LIBRARY(pdf, PDF_show_boxed, [ AC_DEFINE(HAVE_PDFLIB,1,[ ]) PHP_ADD_LIBRARY_WITH_PATH(pdf, $PHP_PDFLIB/lib, PDFLIB_SHARED_LIBADD) diff --git a/ext/satellite/config.m4 b/ext/satellite/config.m4 index ca3fecae0f..d3830e6686 100644 --- a/ext/satellite/config.m4 +++ b/ext/satellite/config.m4 @@ -68,9 +68,9 @@ if test "$PHP_SATELLITE" != "no"; then SATELLITE_CONFIG(libIDL, $ORBIT_PATH/bin, , [Please (re)install libIDL]) dnl check for symbol giop_skip_atexit in libIIOP - AC_CHECK_LIB(IIOP, giop_skip_atexit, [true], [ + PHP_CHECK_LIBRARY(IIOP, giop_skip_atexit, [], [ AC_MSG_ERROR([You need a CVS version of ORBit, please read ext/satellite/README]) - ], "$ORBIT_LIBS" ) + ], "$ORBIT_LIBS" ) AC_DEFINE(HAVE_SATELLITE,1,[ ]) fi diff --git a/ext/sybase_ct/config.m4 b/ext/sybase_ct/config.m4 index d2ba808fe7..c924d0eaa3 100644 --- a/ext/sybase_ct/config.m4 +++ b/ext/sybase_ct/config.m4 @@ -34,6 +34,6 @@ if test "$PHP_SYBASE_CT" != "no"; then $SYBASE_CT_LIBS ]) - AC_CHECK_LIB(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - AC_CHECK_LIB(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) + PHP_CHECK_LIBRARY(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) + PHP_CHECK_LIBRARY(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) fi diff --git a/ext/vpopmail/config.m4 b/ext/vpopmail/config.m4 index 7e123b7e1d..8580924bf6 100644 --- a/ext/vpopmail/config.m4 +++ b/ext/vpopmail/config.m4 @@ -43,8 +43,11 @@ if test "$PHP_VPOPMAIL" != "no"; then AC_DEFINE(HAVE_VPOPMAIL_VAUTH,1,[Whether vpopmail has vauth.h]) fi dnl check for valias functions in the -lvpopmail - AC_CHECK_LIB(vpopmail, valias_select, - [ AC_DEFINE(HAVE_VPOPMAIL_VALIAS,1,[Whether vpopmail has valias support]) ],[],[ -L$VPOPMAIL_LIB_DIR ]) + PHP_CHECK_LIBRARY(vpopmail, valias_select, [ + AC_DEFINE(HAVE_VPOPMAIL_VALIAS,1,[Whether vpopmail has valias support]) + ],[], + -L$VPOPMAIL_LIB_DIR + ]) PHP_ADD_INCLUDE($VPOPMAIL_INC_DIR) |