@@ -6,32 +6,33 @@ PHP_ARG_WITH(libmpdec-path, for libmpdec custom path,
66
77if test "$PHP_DECIMAL" != "no"; then
88
9+ MACHINE_INCLUDES=$($CC -dumpmachine)
910 AC_MSG_CHECKING ( [ for libmpdec library in default path] )
1011 for i in $PHP_LIBMPDEC_PATH /usr /usr/local/; do
1112 if test -r $i/$PHP_LIBDIR/libmpdec.$SHLIB_SUFFIX_NAME || test -r $i/$PHP_LIBDIR/libmpdec.a; then
1213 LIBMPDEC_DIR=$i/$PHP_LIBDIR
14+ LIBMPDEC_INC=$i/include
1315 AC_MSG_RESULT ( found in $LIBMPDEC_DIR )
1416 break
1517 elif test -r $i/lib/libmpdec.$SHLIB_SUFFIX_NAME || test -r $i/lib/libmpdec.a; then
1618 LIBMPDEC_DIR=$i/lib
19+ LIBMPDEC_INC=$i/include
20+ AC_MSG_RESULT ( found in $LIBMPDEC_DIR )
21+ break
22+ elif test -r $i/lib/$MACHINE_INCLUDES/libmpdec.so ; then
23+ LIBMPDEC_DIR=$i/lib/$MACHINE_INCLUDES
24+ LIBMPDEC_INC=$i/include/$MACHINE_INCLUDES
1725 AC_MSG_RESULT ( found in $LIBMPDEC_DIR )
1826 break
1927 fi
2028 done
2129
22- MACHINE_INCLUDES=$($CC -dumpmachine)
23- if test -z "$LIBMPDEC_DIR" && test -r /usr/lib/$MACHINE_INCLUDES/libmpdec.so ; then
24- dnl deb/travis specific case
25- LIBMPDEC_DIR=/usr/lib/$MACHINE_INCLUDES
26- LIBMPDEC_INC=/usr/include/$MACHINE_INCLUDES
27- AC_MSG_RESULT ( found in $LIBMPDEC_DIR )
2830
29- elif test -z "$LIBMPDEC_DIR"; then
31+ if test -z "$LIBMPDEC_DIR"; then
3032 AC_MSG_RESULT ( [ Could not find libmpdec] )
3133 AC_MSG_ERROR ( [ Please reinstall the libmpdec distribution from http://www.bytereef.org/mpdecimal/] )
3234
3335 else
34- LIBMPDEC_INC=$(dirname $LIBMPDEC_DIR)/include
3536 AC_MSG_CHECKING ( [ for libmpdec headers in default path] )
3637 if test -r $LIBMPDEC_INC/mpdecimal.h; then
3738 PHP_ADD_INCLUDE(LIBMPDEC_INC)
0 commit comments