WTF do you mean, optional?
-Andrei
On Sep 13, 2005, at 2:50 AM, Jani Taskinen wrote:
sniper Tue Sep 13 05:50:59 2005 EDT
Modified files:
/php-src configure.in
Log:
Cleanup the configure mess, preparing for making unicode OPTIONAL
http://cvs.php.net/diff.php/php-src/configure.in?r1=1.586&r2=1.587&ty=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.586 php-src/configure.in:1.587
--- php-src/configure.in:1.586 Mon Aug 15 19:36:52 2005
+++ php-src/configure.in Tue Sep 13 05:50:53 2005
@@ -1,4 +1,4 @@
- ## $Id: configure.in,v 1.586 2005/08/15 23:36:52 sniper Exp $ -*-
autoconf -*-
+ ## $Id: configure.in,v 1.587 2005/09/13 09:50:53 sniper Exp $ -*-
autoconf -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -765,45 +765,57 @@
AC_MSG_RESULT([$PHP_VERSIONING])
dnl ## check for ICU library location
-dnl ## until we bundle it
-PHP_ARG_WITH(icu-dir,[location of ICU headers and libraries],
-[ --with-icu-dir=DIR Specify where ICU libraries and headers
can be found], DEFAULT, no)
+AC_MSG_CHECKING([for location of ICU headers and libraries])
+AC_ARG_WITH(icu-dir,
+[ --with-icu-dir=DIR Specify where ICU libraries and headers
can be found],
+[
+ if test "x$withval" != "xyes"; then
+ PHP_ICU_DIR=$withval
+ else
+ PHP_ICU_DIR=DEFAULT
+ fi
+], [
+ PHP_ICU_DIR=DEFAULT
+])
+
if test "$PHP_ICU_DIR" = "DEFAULT"; then
- AC_MSG_CHECKING(for ICU in default path)
- for i in /usr/local /usr; do
- if test -r $i/include/unicode/utypes.h; then
- ICU_DIR=$i
- AC_MSG_RESULT(found in $i)
- break
+ ICU_CONFIG=icu-config
+ for i in /usr/local/bin /usr/bin; do
+ if test -x "$i/icu-config"; then
+ ICU_CONFIG=$i/icu-config
+ break;
fi
done
else
- if test -f $PHP_ICU_DIR/include/unicode/utypes.h; then
- ICU_DIR=$PHP_ICU_DIR
- fi
+ ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
fi
-if test -z "$ICU_DIR"; then
- AC_MSG_RESULT(not found)
- AC_MSG_ERROR([Please specify where ICU libraries and header file
are located])
-fi
-ICU_CONFIG="icu-config"
-if ! test -x "$ICU_DIR/bin/$ICU_CONFIG"; then
- AC_MSG_ERROR([$ICU_CONFIG not found.])
-elif ${ICU_DIR}/bin/icu-config --ldflags > /dev/null 2>&1; then
- ICU_CONFIG=${ICU_DIR}/bin/icu-config
-fi
-AC_MSG_CHECKING(for ICU 3.4 or greater)
-icu_version_full=`$ICU_CONFIG --version`
-icu_version=`echo ${icu_version_full} | awk 'BEGIN { FS = "."; } {
printf "%d", ($1 * 1000 + $2) ;}'`
-if test "$icu_version" -ge 3004; then
- AC_MSG_RESULT($icu_version_full found)
- ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
+
+dnl Trust icu-config to know better what the install prefix is..
+icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
+if test -z "$icu_install_prefix"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Please specify the correct ICU install prefix.])
else
- AC_MSG_ERROR(ICU version 3.4 or later is required,
$icu_full_version found)
+ AC_MSG_RESULT([found in $icu_install_prefix])
+
+ dnl Check ICU version
+ AC_MSG_CHECKING([for ICU 3.4 or greater])
+ icu_version_full=`$ICU_CONFIG --version`
+ ac_IFS=$IFS
+ IFS="."
+ set $icu_version_full
+ IFS=$ac_IFS
+ icu_version=`expr [$]1 \* 1000 + [$]2`
+ AC_MSG_RESULT([found $icu_version_full])
+ if test "$icu_version" -lt "3004"; then
+ AC_MSG_ERROR([ICU version 3.4 or later is required])
+ fi
+
+ ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
+ ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
+ PHP_EVAL_INCLINE($ICU_INCS)
+ PHP_EVAL_LIBLINE($ICU_LIBS)
fi
-PHP_ADD_INCLUDE($ICU_DIR/include)
-PHP_EVAL_LIBLINE($ICU_LIBS, ICU_SHARED_LIBADD)
-PHP_SUBST(ICU_SHARED_LIBADD)
divert(5)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php