I'm a long time java-bridge user, and I've recently needed to get it ported
to FreeBSD 7.0/amd64. I'm current working against php-java-bridge_5.2.2 as
5.3.x seems to have other build failures (and 5.2 will work fine for now.)
The package builds fine out of the box with no modifications, but it does
not detect the JNI extension which is enabled on our JDK. This means that
libnatcJavaBridge.so is not built. Furthermore this issue was only
happening on amd64 boxes -- JNI is detected properly on i386.
I dove into this last night and it turns out that the test for jni in
tests.m4/java_check_jni.m4 calls GCC with no compiler flags. This works
fine on i386, but fails on amd64 because we need the -fPIC flag to build a
shared library correctly. Once fixed, php-java-brdge builds fine and
libnatcJavaBridge.so is built correctly. If I'm not mistaken, it's now
working just fine :)
Below is my patch against php-java-bridge-5.2.2. I'll give this a whirl
against 5.3.x sometime when I have more free time. I'm not entirely sure
this is the best way to accomplish this, but it is working for me on
FreeBSD 7.0 on i386 and amd64 hosts.
For future reference...it doesn't look like anyone uses the SF bug
tracker...is this mailing list the best place to submit patches? If not,
let me know where :)
Cheers,
Patrick van Staveren
--- tests.m4/java_check_jni.m4.orig 2008-10-08 03:26:29.000000000 +0000
+++ tests.m4/java_check_jni.m4 2008-10-08 03:26:45.000000000 +0000
@@ -12,11 +12,11 @@
have_jni=no
if test "$have_ar" = "yes"; then
if test "$PHP_JAVA" != "yes"; then
- $CC -olibjni.so $JAVA_INCLUDES -shared jni.c 2>test.log
+ $CC $lt_prog_compiler_pic -olibjni.so $JAVA_INCLUDES -shared jni.c
2>test.log
$PHP_JAVA/bin/javac jni.java 2>>test.log
LD_LIBRARY_PATH=`pwd` $PHP_JAVA/bin/java -Djava.library.path=`pwd` jni
2>>test.log && have_jni=yes
else
- $CC -olibjni.so -shared jni.c 2>test.log && have_jni=yes
+ $CC $lt_prog_compiler_pic -olibjni.so -shared jni.c 2>test.log &&
have_jni=yes
fi
fi
rm -f libjni.so jni.java jni.c test.log
http://www.mintel.com
providing insight + impact
Chicago Office:
Mintel International Group Ltd (Mintel)
351 Hubbard Street, Floor 8
Chicago, IL 60610
USA
Tel: 312 932 0400
Fax: 312 932 0469
London Office:
Mintel International Group Ltd (Mintel)
18-19 Long Lane
London
EC1A 9PL
UK
Tel: 020 7606 4533
Fax: 020 7606 5932
Notice
********
This email may contain information that is privileged,
confidential or otherwise protected from disclosure. It
must not be used by, or its contents copied or disclosed
to, persons other than the addressee. If you have received
this email in error please notify the sender immediately
and delete the email. Any views or opinions expressed in
this message are solely those of the author, and do not
necessarily reflect those of Mintel.
No Mintel staff are authorised to make purchases using
email or over the internet, and any contracts so performed
are invalid.
Warning
**********
It is the responsibility of the recipient to ensure that
the onward transmission, opening or use of this message
and any attachments will not adversely affect their systems
or data. Please carry out such virus and other checks, as
you consider appropriate.
|