On Mon, Sep 17, 2012 at 4:50 PM, Philip Olson <[email protected]> wrote:
>
> On Sep 17, 2012, at 8:30 AM, jpauli wrote:
>
>> On Mon, Sep 17, 2012 at 2:48 PM, Hannes Magnusson
>> <[email protected]> wrote:
>>> On Mon, Sep 17, 2012 at 9:59 AM, jpauli <[email protected]> wrote:
>>>>>
>>>>> I'm confused.. --enable-all is already supported, just like --disable-all
>>>>> ?
>>>>>
>>>>> -Hannes
>>>>
>>>> AFAIR no :) We have a --disable-all , but no --enable-all.
>>>>
>>>> I'm +1 to add such an option if possible :)
>>>
>>>
>>> Can you please explain to me how it is not working?
>>>
>>> ~/Sources/php/php-5.3 (PHP-5.3) $ ./configure --enable-all
>>> configure: error: Cannot find enchant
>>>
>>> And no, ext/enchant is not enabled by default.
>>
>> So the answer is : there is --enable-all switch , but it's not listed
>> in the --help output
>
> Hello all,
>
> Interesting, I didn't think it existed but now realize why. It's not
> documented and it's not very useful.
>
> There's an old feature request (I wrote it so am surprised I forgot
> this exists) about differentiating between --with and --enable,
> along with checking if those are actually available on the system:
>
> https://bugs.php.net/24337
> https://bugs.php.net/33186
>
> Awhile ago Rasmus mentioned an idea about creating a shell script that'd
> check which options do (and do not) pass configure. I'm not sure how to
> do that but maybe someone else does. Just imagine being able to enable
> all possible extensions available on a system.. great for 'make test' :)
Something like the attached patch could work, but that means we would
have to update all the config.m4s :]
-Hannes
diff --git a/acinclude.m4 b/acinclude.m4
index adb9599..dd5af3b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2727,8 +2727,8 @@ AC_DEFUN([PHP_CHECK_CONFIGURE_OPTIONS],[
;;
esac
case $arg_name in
- # Allow --disable-all / --enable-all
- enable-all[)];;
+ # Allow --disable-all / --enable-all / --enable-all-available
+ enable-all|enable-all-available[)];;
# Allow certain libtool options
enable-libtool-lock | with-pic | with-tags | enable-shared |
enable-static | enable-fast-install | with-gnu-ld[)];;
@@ -2969,3 +2969,20 @@ $ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
EOF
])
+
+
+dnl
+dnl PHP_EXTTENSION_NOT_AVAILABLE(message)
+dnl
+dnl Wrapper for AC_MSG_[WARN|ERROR] depending if we are trying
+dnl to enable all available extensions on the platform, or explicitly
+dnl enabling the extension.
+dnl
+AC_DEFUN([PHP_EXTTENSION_NOT_AVAILABLE],[
+ if test "$PHP_ENABLE_ALL_AVAILABLE" = "yes"; then
+ AC_MSG_WARN($1)
+ else
+ AC_MSG_ERROR($1)
+ fi
+])
+
diff --git a/configure.in b/configure.in
index e5e1cd6..10e4e5f 100644
--- a/configure.in
+++ b/configure.in
@@ -1011,6 +1011,15 @@ AC_ARG_ENABLE(all,
PHP_ENABLE_ALL=$enableval
])
+AC_ARG_ENABLE(all-available,
+[ --enable-all-available Enable all extensions available on the platform
+], [
+ if test "$enableval" = "yes"; then
+ PHP_ENABLE_ALL=$enableval
+ fi
+ PHP_ENABLE_ALL_AVAILABLE=$enableval
+])
+
# reading config stubs
esyscmd(./build/config-stubs ext)
diff --git a/ext/enchant/config.m4 b/ext/enchant/config.m4
index cc40d0b..7b2990a 100755
--- a/ext/enchant/config.m4
+++ b/ext/enchant/config.m4
@@ -24,19 +24,19 @@ if test "$PHP_ENCHANT" != "no"; then
done
if test -z "$ENCHANT_DIR"; then
- AC_MSG_ERROR(Cannot find enchant)
- fi
-
- ENCHANT_LIBDIR=$ENCHANT_DIR/lib
+ PHP_EXTTENSION_NOT_AVAILABLE(Cannot find enchant)
+ else
+ ENCHANT_LIBDIR=$ENCHANT_DIR/lib
- AC_DEFINE(HAVE_ENCHANT,1,[ ])
- PHP_SUBST(ENCHANT_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR,
ENCHANT_SHARED_LIBADD)
- PHP_ADD_INCLUDE($ENCHANT_INCDIR)
- PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param,
- [
- AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ ])
- AC_DEFINE(ENCHANT_VERSION_STRING, "1.5.x", [ ])
- ], [], [ -L$ENCHANT_LIB $ENCHANT_SHARED_LIBADD])
+ AC_DEFINE(HAVE_ENCHANT,1,[ ])
+ PHP_SUBST(ENCHANT_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR,
ENCHANT_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($ENCHANT_INCDIR)
+ PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param,
+ [
+ AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ ])
+ AC_DEFINE(ENCHANT_VERSION_STRING, "1.5.x", [ ])
+ ], [], [ -L$ENCHANT_LIB $ENCHANT_SHARED_LIBADD])
+ fi
fi
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php