From: roques at mti dot ag
Operating system: Debian GNU/Linux Sarge
PHP version: 4.3.7RC1
PHP Bug Type: Compile Failure
Bug description: Compiling informix extension fails if compiling out of tree
Description:
------------
1) A harmless error in the Makefile, which only occurs on out of tree
builds is not ignored and causes make to abort.
2) The resulting module is empty, because HAVE_IFX is not defined, because
config.h is not included.
Both of these problems can be fixed by applying the following patch:
diff -wurd php-4.3.7RC1.orig/ext/informix/Makefile.frag
php-4.3.7RC1/ext/informix/Makefile.frag
--- php-4.3.7RC1.orig/ext/informix/Makefile.frag 2002-06-13
20:01:41.000000000 -0400
+++ php-4.3.7RC1/ext/informix/Makefile.frag 2004-05-28
19:17:05.000000000 -0400
@@ -1,7 +1,9 @@
+OVERALL_TARGET += $(srcdir)/ifx.c
$(srcdir)/ifx.c: $(srcdir)/ifx.ec $(builddir)/libphpifx.a
(if test -d $(INFORMIXDIR); then \
- THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS)
$(srcdir)/ifx.ec; mv ifx.c $@; \
+ THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS)
$(srcdir)/ifx.ec; \
+ mv ifx.c $@ || true; \
else \
touch $@; \
fi)
diff -wurd php-4.3.7RC1.orig/ext/informix/ifx.ec
php-4.3.7RC1/ext/informix/ifx.ec
--- php-4.3.7RC1.orig/ext/informix/ifx.ec 2003-11-02
19:14:06.000000000 -0400
+++ php-4.3.7RC1/ext/informix/ifx.ec 2004-05-28 19:17:05.000000000
-0400
@@ -37,6 +37,10 @@
/* prevent mod_ssl.h's header file from being included. */
#define AP_HOOK_H
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "php.h"
#include "php_globals.h"
#include "ext/standard/php_standard.h"
Reproduce code:
---------------
curry:/tmp% cp -a php-4.3.7RC1/ext/informix /tmp
curry:/tmp% cd informix
curry:/tmp/informix% phpize
Configuring for:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20021010
curry:/tmp/informix% ./configure
[...]
curry:/tmp/informix% make
/bin/sh /tmp/informix/libtool --mode=link gcc
/usr/local/informix/lib/esql/checkapi.o -o libphpifx.a
mkdir .libs
ar cru libphpifx.a
ranlib libphpifx.a
(if test -d /usr/local/informix; then \
THREADLIB=POSIX /usr/local/informix/bin/esql -e -EDHAVE_IFX_IUS
/tmp/informix/ifx.ec; mv ifx.c /tmp/informix/ifx.c; \
else \
touch /tmp/informix/ifx.c; \
fi)
mv: `ifx.c' and `/tmp/informix/ifx.c' are the same file
make: *** [/tmp/informix/ifx.c] Error 1
This is the first problem. It can be fixed by replacing:
mv ifx.c $@
with
mv ifx.c $@ || true
to make make ignore the error, or by explicitely telling make to ignore
all errors in this recipe.
When this problem has been fixed make generates a shared PHP-extension
named informix.so. This extension is unusable, becuase it is empty. The
reason for this is, that ifx.ec does not include config.h and thus
HAVE_IFX in not defined and the contents of the module is ommitted.
--
Edit bug report at http://bugs.php.net/?id=28564&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28564&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28564&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28564&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28564&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28564&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28564&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28564&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28564&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28564&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28564&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28564&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28564&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28564&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28564&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28564&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28564&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28564&r=float