From 121cc9da92153028182d59ebdaf4a3df44576fea Mon Sep 17 00:00:00 2001 From: Miroslav Kubelik Date: Mon, 26 Sep 2011 22:47:43 +0000 Subject: [PATCH] config - simpler lib searching #22683 git-svn-id: http://svn.php.net/repository/pecl/rrd/trunk@317361 c90b9560-bf6c-de11-be94-00142212c4b1 --- config.m4 | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/config.m4 b/config.m4 index 689e37c..deec05f 100644 --- a/config.m4 +++ b/config.m4 @@ -17,43 +17,26 @@ fi if test "$PHP_RRD" != "no"; then if test "$PHP_RRD" != "yes"; then - AC_MSG_CHECKING(if rrdtool specified path is valid) - if test -r $PHP_RRD/include/rrd.h && test -f $PHP_RRD/lib/librrd.$SHLIB_SUFFIX_NAME -o -f $PHP_RRD/lib/librrd.a; then # path given as parameter - RRDTOOL_DIR=$PHP_RRD + AC_MSG_CHECKING(if rrdtool specified path is valid) + if test -r "$PHP_RRD/include/rrd.h"; then RRDTOOL_INCDIR=$PHP_RRD/include - RRDTOOL_LIBDIR=$PHP_RRD/lib - AC_MSG_RESULT([yes]) + RRDTOOL_LIBDIR=$PHP_RRD/$PHP_LIBDIR + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) AC_MSG_ERROR([The specified RRDTool path is invalid or the installation is incomplete Please specify another path or reinstall the rrdtool distribution]) fi else - dnl Header path - AC_MSG_CHECKING([for rrdtool header files in default path]) - for i in /usr/local/rrdtool /usr/local /usr /opt ""; do - test -r $i/include/rrd.h && RRDTOOL_DIR=$i && RRDTOOL_INCDIR=$i/include + AC_MSG_CHECKING([for rrdtool header files in default paths]) + for i in /usr /usr/local /usr/local/rrdtool /opt; do + test -r $i/include/rrd.h && RRDTOOL_LIBDIR=$i/$PHP_LIBDIR && RRDTOOL_INCDIR=$i/include done if test -z "$RRDTOOL_INCDIR"; then AC_MSG_RESULT([not found]) AC_MSG_ERROR([Please reinstall the rrdtool distribution]) else - AC_MSG_RESULT(found in $RRDTOOL_INCDIR) - fi - dnl Library path - AC_MSG_CHECKING([for rrdtool library files in default paths]) - for i in librrd.$SHLIB_SUFFIX_NAME librrd.a; do - if test -f $libdir/$i; then - RRDTOOL_LIBDIR=$libdir/$i - elif test -f $RRDTOOL_DIR/lib/$i; then - RRDTOOL_LIBDIR=$RRDTOOL_DIR/lib - fi - done - if test -z "$RRDTOOL_LIBDIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please reinstall the rrdtool distribution]) - else - AC_MSG_RESULT(found in $RRDTOOL_LIBDIR) + AC_MSG_RESULT(found in $RRDTOOL_INCDIR) fi fi @@ -68,7 +51,7 @@ if test "$PHP_RRD" != "no"; then ], [ AC_MSG_ERROR([wrong rrd lib version or lib not found]) ], [ - -L$RRDTOOL_LIBDIR -lrrd + -L$RRDTOOL_LIBDIR ]) dnl save temporary LDFLAGS, necessary for PHP_CHECK_FUNC