#24204 [Asn]: --with-java does not compile on Mac OS X
| From: | kalowsky@php.net | Date: | Thu, 26 Jun 2003 20:16:25 +0000 |
| Subject: | #24204 [Asn]: --with-java does not compile on Mac OS X | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-42577@lists.php.net to get a copy of this message | ||
ID: 24204
Updated by: kalowsky@php.net
Reported By: php_public at macfreek dot nl
Status: Assigned
Bug Type: Java related
Operating System: Mac OS X (10.2.6)
PHP Version: 4.3.2
Assigned To: kalowsky
New Comment:
Oddly enough this only occurs while building the CLI, I can build the
CGI just fine. It looks like the -framework JavaVM is being lost in
the CLI version of the build.
Is there someone more knowledgable with the build structure, more
specifically the CLI, that can shed a little light on this?
Previous Comments:
------------------------------------------------------------------------
[2003-06-16 12:43:59] php_public at macfreek dot nl
Oh yes, this is not the proper fix! That's why I called
it an *ugly* workaround. ;-)
By the way, the file in php-4.3.2/sapi/servlet/
servlet.c will most likely have the same problem.
I would have expected Apple to have made a symbolic
link from /usr/include/JavaVM/jni.h to whereever the
file may reside in the most current release. However,
that is not the case, and Java seem to be installed, so
we apparently have to deal with whatever is available.
The correct solution is probably to add the appropriate
-I option to the linker, by altering the configure
file.
------------------------------------------------------------------------
[2003-06-16 07:43:53] kalowsky@php.net
The short of it is, those files are needed, but I believe you're
misunderstanding how frameworks work. By specifying the full path you
are (potentially) invalidating future release of the JavaVM framework.
The proper answer is to figure out why the jni.h file is not being used
by JavaVM framework. I'll try to reproduce it later today.
------------------------------------------------------------------------
[2003-06-16 07:10:17] php_public at macfreek dot nl
Description:
------------
In short, Java does not compile on Mac OS X, because
the Java headers are at an other location then java.c
expects them. configure does work.
Reproduce code:
---------------
On Mac OS X (Darwin):
./configure --with-java=/usr (you can leave the =/usr out).
make
Actual result:
--------------
/Users/freek/Downloads/php-4.3.2/ext/java/java.c:39:24:
JavaVM/jni.h: No such file or directory
This is due to this code:
#if HAVE_JAVAVM_JAVAVM_H
#include <JavaVM/JavaVM.h>
#include <JavaVM/jni.h>
#define JNI_12
#else
#include <jni.h>
#endif
In php_config.h, the precompiler directive
HAVE_JAVAVM_JAVAVM_H was set, even though there is no
file on my system called JavaVM/JavaVM.h
As an ugly workaround, specifying the full path did
work:
#include </System/Library/Frameworks/JavaVM.framework/
Versions/A/Headers/JavaVM.h>
#include </System/Library/Frameworks/JavaVM.framework/
Versions/1.3.1/Headers/jni.h
Apparently, jni.h is not in Java VM 1.4.1, which is
also installed on Mac OS X. But to be honest, I got
crazy about all symbolic links in /System/Library/
Frameworks/JavaVM.framework/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24204&edit=1