php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28564 Compiling informix extension fails if compiling out of tree
Submitted: 2004-05-29 01:21 UTC Modified: 2004-05-30 19:57 UTC
From: roques at mti dot ag Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.3.7RC1 OS: Debian GNU/Linux Sarge
Private report: No CVE-ID:
 [2004-05-29 01:21 UTC] roques at mti dot ag
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.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-30 19:57 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 18:01:55 2014 UTC