config - simpler lib searching #22683

git-svn-id: http://svn.php.net/repository/pecl/rrd/trunk@317361 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Miroslav Kubelik
2011-09-26 22:47:43 +00:00
parent 3e3df6c4d5
commit 121cc9da92

View File

@@ -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