]> granicus.if.org Git - php/commitdiff
make ZEND_SIGNALS configurable, off by default
authorStanislav Malyshev <stas@php.net>
Thu, 16 Feb 2012 01:51:45 +0000 (01:51 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 16 Feb 2012 01:51:45 +0000 (01:51 +0000)
also make ZEND_SIGNALS enabled and disabled binary-compatible

Zend/Zend.m4
Zend/zend.h
main/main.c

index 67b9ba09d76bb9f3742dc8599910b330bff2f273..945409eb1e1351493b096a97c6c3594d92a5412f 100644 (file)
@@ -393,14 +393,20 @@ int main()
 AC_CHECK_FUNCS(mremap)
 
 
+AC_ARG_ENABLE(zend-signals,
+[  --enable-zend-signals   Use zend signal handling],[
+  ZEND_SIGNALS=$enableval
+],[
+  ZEND_SIGNALS=no
+])  
+
 AC_CHECK_FUNC(sigaction, [
-       ZEND_SIGNALS=yes
-       AC_DEFINE(ZEND_SIGNALS, 1, [Use zend signal handling])
        AC_DEFINE(HAVE_SIGACTION, 1, [Whether sigaction() is available])
 ], [
        ZEND_SIGNALS=no
 ])
 if test "$ZEND_SIGNALS" = "yes"; then
+       AC_DEFINE(ZEND_SIGNALS, 1, [Use zend signal handling])
        CFLAGS="$CFLAGS -DZEND_SIGNALS"
 fi
 
index e8bd10725e4227c23beadd58122fc9278f9524d5..3226f8ce03ec4251ba425b02580f6cb05eeab042 100644 (file)
@@ -531,10 +531,8 @@ typedef struct _zend_utility_functions {
        int (*write_function)(const char *str, uint str_length);
        FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
        void (*message_handler)(long message, const void *data TSRMLS_DC);
-#ifndef ZEND_SIGNALS
        void (*block_interruptions)(void);
        void (*unblock_interruptions)(void);
-#endif
        int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
        void (*ticks_function)(int ticks);
        void (*on_timeout)(int seconds TSRMLS_DC);
@@ -677,10 +675,8 @@ BEGIN_EXTERN_C()
 extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
 extern ZEND_API zend_write_func_t zend_write;
 extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
-#ifndef ZEND_SIGNALS
 extern ZEND_API void (*zend_block_interruptions)(void);
 extern ZEND_API void (*zend_unblock_interruptions)(void);
-#endif
 extern ZEND_API void (*zend_ticks_function)(int ticks);
 extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
 extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
index 1f1101ef611e83a59f755deccecc5f221c9913a4..ac78976e899ce1ea2f4d0d02f9684b058f1afd13 100644 (file)
@@ -1999,10 +1999,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
        zuf.write_function = php_output_wrapper;
        zuf.fopen_function = php_fopen_wrapper_for_zend;
        zuf.message_handler = php_message_handler_for_zend;
-#ifndef ZEND_SIGNALS
        zuf.block_interruptions = sapi_module.block_interruptions;
        zuf.unblock_interruptions = sapi_module.unblock_interruptions;
-#endif
        zuf.get_configuration_directive = php_get_configuration_directive_for_zend;
        zuf.ticks_function = php_run_ticks;
        zuf.on_timeout = php_on_timeout;