mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
The start of adding in MacOSX compatibility. No objections on the
php-dev list from the sent patch for a week. Test and fix.
This commit is contained in:
parent
db8bf2647a
commit
299494ea5e
2 changed files with 268 additions and 192 deletions
|
@ -1,48 +1,42 @@
|
|||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(java, for JAVA support,
|
||||
[ --with-java[=DIR] Include Java support. DIR is the JDK base install directory.
|
||||
This extension is always built as shared.])
|
||||
|
||||
if test "$PHP_JAVA" != "no"; then
|
||||
|
||||
pltform=`uname -s 2>/dev/null`
|
||||
java_libext=libjava.so
|
||||
case $pltform in
|
||||
AIX) java_libext=libjava.a ;;
|
||||
HP-UX) java_libext=libjava.sl ;;
|
||||
esac
|
||||
|
||||
AC_DEFUN(JAVA_FIND_JAR, [
|
||||
AC_MSG_CHECKING([Java Jar location])
|
||||
if test "$PHP_JAVA" = "yes"; then
|
||||
if JAVA_JAR=`which jar 2>/dev/null`; then
|
||||
JAVA_JAR="$JAVA_JAR cf"
|
||||
else
|
||||
JAVA_JAR=
|
||||
fi
|
||||
PHP_JAVAC=`which javac`
|
||||
if test -z "$PHP_JAVAC"; then
|
||||
AC_MSG_ERROR([Unable to locate the javac binary in your system path
|
||||
Either adjust your Java installation or provide the Java installation path,
|
||||
e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
||||
fi
|
||||
PHP_JAVA=`cd \`dirname \\\`which javac\\\`\`/..;pwd`
|
||||
else
|
||||
test -x $PHP_JAVA/bin/jar && JAVA_JAR="$PHP_JAVA/bin/jar cf"
|
||||
fi
|
||||
|
||||
# substitute zip for systems which don't have jar
|
||||
dnl
|
||||
dnl substitue zip for systems which don't have jar
|
||||
dnl
|
||||
if test -z "$JAVA_JAR"; then
|
||||
JAVA_JAR='zip -q0'
|
||||
fi
|
||||
|
||||
if test -x $PHP_JAVA/bin/javac; then
|
||||
JAVA_C=$PHP_JAVA/bin/javac
|
||||
else
|
||||
AC_MSG_ERROR([Can not find the javac binary under $PHP_JAVA/bin/])
|
||||
PHP_SUBST(JAVA_JAR)
|
||||
fi
|
||||
AC_MSG_RESULT(`echo $JAVA_JAR`)
|
||||
])
|
||||
|
||||
AC_DEFUN(JAVA_FIND_C, [
|
||||
AC_MSG_CHECKING([Java C location])
|
||||
JAVA_C=`which javac`
|
||||
if test -z "$JAVA_C"; then
|
||||
AC_MSG_ERROR([Unable to locate the javac binary in your system path
|
||||
Either adjust your Java installation or provide the Java installation path,
|
||||
e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
||||
fi
|
||||
|
||||
PHP_SUBST(JAVA_C)
|
||||
AC_MSG_RESULT(`echo $JAVA_C`)
|
||||
])
|
||||
|
||||
AC_DEFUN(JAVA_CHECK_LIB, [
|
||||
AC_MSG_CHECKING([Checking for libjava])
|
||||
if test -d $PHP_JAVA/lib/kaffe; then
|
||||
PHP_ADD_LIBPATH($PHP_JAVA/lib)
|
||||
JAVA_CFLAGS=-DKAFFE
|
||||
|
@ -55,15 +49,17 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
test -f $PHP_JAVA/lib/$JAVA_LIB && JAVA_LIBPATH=$PHP_JAVA/lib
|
||||
test -f $PHP_JAVA/lib/kaffe/$JAVA_LIB && JAVA_LIBPATH=$PHP_JAVA/lib/kaffe
|
||||
|
||||
# accomodate old versions of kaffe which don't support jar
|
||||
dnl
|
||||
dnl accomodate old versions of kaffe which don't support jar
|
||||
dnl
|
||||
if kaffe -version 2>&1 | grep 1.0b > /dev/null; then
|
||||
JAVA_JAR='zip -q0'
|
||||
fi
|
||||
|
||||
elif test -f $PHP_JAVA/lib/$java_libext; then
|
||||
JAVA_LIB=java
|
||||
JAVA_LIBPATH=$PHP_JAVA/lib
|
||||
JAVA_INCLUDE=-I$PHP_JAVA/include
|
||||
|
||||
test -f $PHP_JAVA/lib/classes.zip && JAVA_CFLAGS=-DJNI_11
|
||||
test -f $PHP_JAVA/lib/jvm.jar && JAVA_CFLAGS=-DJNI_12
|
||||
test -f $PHP_JAVA/lib/classes.zip && JAVA_CLASSPATH=$PHP_JAVA/lib/classes.zip
|
||||
|
@ -72,12 +68,13 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
for i in $PHP_JAVA/include/*; do
|
||||
test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE $i"
|
||||
done
|
||||
|
||||
else
|
||||
|
||||
dnl
|
||||
dnl We have to find everything
|
||||
dnl
|
||||
for i in `find $PHP_JAVA/include -type d`; do
|
||||
test -f $i/jni.h && JAVA_INCLUDE=-I$i
|
||||
test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE -I$i"
|
||||
test -f $i/jni_md.h && JAVE_INCLUDE="$JAVA_INCLUDE -I$i"
|
||||
done
|
||||
|
||||
for i in `find $PHP_JAVA/. -type d`; do
|
||||
|
@ -89,6 +86,7 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
if test -f $i/$java_libext; then
|
||||
JAVA_LIB=java
|
||||
JAVA_LIBPATH=$i
|
||||
|
||||
test -d $i/hotspot && PHP_ADD_LIBPATH($i/hotspot)
|
||||
test -d $i/classic && PHP_ADD_LIBPATH($i/classic)
|
||||
test -d $i/server && PHP_ADD_LIBPATH($i/server)
|
||||
|
@ -103,7 +101,46 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
|
||||
JAVA_CFLAGS="$JAVA_CFLAGS -D_REENTRANT"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
PHP_ARG_WITH(java, for Java support,
|
||||
[ --with-java[=DIR] Include Java support. DIR is the JDK base install directory.
|
||||
This extension is always built as shared.])
|
||||
|
||||
if test "$PHP_JAVA" != "no"; then
|
||||
platform=`uname -s 2>/dev/null`
|
||||
java_libext=libjava.so
|
||||
case $platform in
|
||||
AIX) java_libext=libjava.a ;;
|
||||
HP-UX) java_libext=libjava.sl ;;
|
||||
Darwin) java_libext=libjava.jnilib ;;
|
||||
esac
|
||||
|
||||
JAVA_FIND_JAR()
|
||||
JAVA_FIND_C()
|
||||
|
||||
if test "$platform" = "Darwin"; then
|
||||
AC_CHECK_HEADERS([JavaVM/JavaVM.h])
|
||||
AC_CHECK_HEADERS([JavaVM/jni.h])
|
||||
JAVA_CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar
|
||||
PHP_CHECK_FRAMEWORK("JavaVM", JNI_CreateJavaVM,[AC_DEFINE(HAVE_JAVA,1,[ ])])
|
||||
PHP_ADD_FRAMEWORK("JavaVM")
|
||||
else
|
||||
dnl
|
||||
dnl it can't be no, and now we test to make sure it can't be yes
|
||||
dnl if it isn't 'yes' well, we just have to build a path using which
|
||||
dnl if it is 'yes' we have a path provided to us, now run free!
|
||||
dnl
|
||||
if test "$PHP_JAVA" = "yes"; then
|
||||
dnl
|
||||
dnl Give us the basepath for where javac is!
|
||||
dnl
|
||||
PHP_JAVA=`cd \`dirname \\\`which javac\\\`\`/..;pwd`
|
||||
else
|
||||
test -x $PHP_JAVA/bin/jar && JAVA_JAR="$PHP_JAVA/bin/jar cf"
|
||||
fi
|
||||
JAVA_CHECK_LIB()
|
||||
AC_DEFINE(HAVE_JAVA,1,[ ])
|
||||
|
||||
if test -z "$JAVA_LIBPATH"; then
|
||||
|
@ -112,21 +149,22 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
|
||||
PHP_ADD_LIBPATH($JAVA_LIBPATH)
|
||||
JAVA_CFLAGS="$JAVA_CFLAGS '-DJAVALIB=\"$JAVA_LIBPATH/$java_libext\"'"
|
||||
fi
|
||||
|
||||
if test "$PHP_SAPI" != "servlet"; then
|
||||
PHP_NEW_EXTENSION(java, java.c, shared,, $JAVA_CFLAGS $JAVA_INCLUDE)
|
||||
|
||||
if test "$PHP_SAPI" = "cgi"; then
|
||||
if test "$platform" != "Darwin"; then
|
||||
PHP_ADD_LIBRARY($JAVA_LIB)
|
||||
fi
|
||||
fi
|
||||
|
||||
INSTALL_IT="$INSTALL_IT; \$(srcdir)/build/shtool mkdir -p -f -m 0755 \$(INSTALL_ROOT)\$(libdir)"
|
||||
INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 \$(srcdir)/ext/java/php_java.jar \$(INSTALL_ROOT)\$(libdir)"
|
||||
fi
|
||||
|
||||
PHP_SUBST(JAVA_CLASSPATH)
|
||||
PHP_SUBST(JAVA_JAR)
|
||||
PHP_SUBST(JAVA_C)
|
||||
|
||||
PHP_ADD_MAKEFILE_FRAGMENT
|
||||
fi
|
||||
|
|
|
@ -1,48 +1,42 @@
|
|||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(java, for JAVA support,
|
||||
[ --with-java[=DIR] Include Java support. DIR is the JDK base install directory.
|
||||
This extension is always built as shared.])
|
||||
|
||||
if test "$PHP_JAVA" != "no"; then
|
||||
|
||||
pltform=`uname -s 2>/dev/null`
|
||||
java_libext=libjava.so
|
||||
case $pltform in
|
||||
AIX) java_libext=libjava.a ;;
|
||||
HP-UX) java_libext=libjava.sl ;;
|
||||
esac
|
||||
|
||||
AC_DEFUN(JAVA_FIND_JAR, [
|
||||
AC_MSG_CHECKING([Java Jar location])
|
||||
if test "$PHP_JAVA" = "yes"; then
|
||||
if JAVA_JAR=`which jar 2>/dev/null`; then
|
||||
JAVA_JAR="$JAVA_JAR cf"
|
||||
else
|
||||
JAVA_JAR=
|
||||
fi
|
||||
PHP_JAVAC=`which javac`
|
||||
if test -z "$PHP_JAVAC"; then
|
||||
AC_MSG_ERROR([Unable to locate the javac binary in your system path
|
||||
Either adjust your Java installation or provide the Java installation path,
|
||||
e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
||||
fi
|
||||
PHP_JAVA=`cd \`dirname \\\`which javac\\\`\`/..;pwd`
|
||||
else
|
||||
test -x $PHP_JAVA/bin/jar && JAVA_JAR="$PHP_JAVA/bin/jar cf"
|
||||
fi
|
||||
|
||||
# substitute zip for systems which don't have jar
|
||||
dnl
|
||||
dnl substitue zip for systems which don't have jar
|
||||
dnl
|
||||
if test -z "$JAVA_JAR"; then
|
||||
JAVA_JAR='zip -q0'
|
||||
fi
|
||||
|
||||
if test -x $PHP_JAVA/bin/javac; then
|
||||
JAVA_C=$PHP_JAVA/bin/javac
|
||||
else
|
||||
AC_MSG_ERROR([Can not find the javac binary under $PHP_JAVA/bin/])
|
||||
PHP_SUBST(JAVA_JAR)
|
||||
fi
|
||||
AC_MSG_RESULT(`echo $JAVA_JAR`)
|
||||
])
|
||||
|
||||
AC_DEFUN(JAVA_FIND_C, [
|
||||
AC_MSG_CHECKING([Java C location])
|
||||
JAVA_C=`which javac`
|
||||
if test -z "$JAVA_C"; then
|
||||
AC_MSG_ERROR([Unable to locate the javac binary in your system path
|
||||
Either adjust your Java installation or provide the Java installation path,
|
||||
e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
||||
fi
|
||||
|
||||
PHP_SUBST(JAVA_C)
|
||||
AC_MSG_RESULT(`echo $JAVA_C`)
|
||||
])
|
||||
|
||||
AC_DEFUN(JAVA_CHECK_LIB, [
|
||||
AC_MSG_CHECKING([Checking for libjava])
|
||||
if test -d $PHP_JAVA/lib/kaffe; then
|
||||
PHP_ADD_LIBPATH($PHP_JAVA/lib)
|
||||
JAVA_CFLAGS=-DKAFFE
|
||||
|
@ -55,15 +49,17 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
test -f $PHP_JAVA/lib/$JAVA_LIB && JAVA_LIBPATH=$PHP_JAVA/lib
|
||||
test -f $PHP_JAVA/lib/kaffe/$JAVA_LIB && JAVA_LIBPATH=$PHP_JAVA/lib/kaffe
|
||||
|
||||
# accomodate old versions of kaffe which don't support jar
|
||||
dnl
|
||||
dnl accomodate old versions of kaffe which don't support jar
|
||||
dnl
|
||||
if kaffe -version 2>&1 | grep 1.0b > /dev/null; then
|
||||
JAVA_JAR='zip -q0'
|
||||
fi
|
||||
|
||||
elif test -f $PHP_JAVA/lib/$java_libext; then
|
||||
JAVA_LIB=java
|
||||
JAVA_LIBPATH=$PHP_JAVA/lib
|
||||
JAVA_INCLUDE=-I$PHP_JAVA/include
|
||||
|
||||
test -f $PHP_JAVA/lib/classes.zip && JAVA_CFLAGS=-DJNI_11
|
||||
test -f $PHP_JAVA/lib/jvm.jar && JAVA_CFLAGS=-DJNI_12
|
||||
test -f $PHP_JAVA/lib/classes.zip && JAVA_CLASSPATH=$PHP_JAVA/lib/classes.zip
|
||||
|
@ -72,12 +68,13 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
for i in $PHP_JAVA/include/*; do
|
||||
test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE $i"
|
||||
done
|
||||
|
||||
else
|
||||
|
||||
dnl
|
||||
dnl We have to find everything
|
||||
dnl
|
||||
for i in `find $PHP_JAVA/include -type d`; do
|
||||
test -f $i/jni.h && JAVA_INCLUDE=-I$i
|
||||
test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE -I$i"
|
||||
test -f $i/jni_md.h && JAVE_INCLUDE="$JAVA_INCLUDE -I$i"
|
||||
done
|
||||
|
||||
for i in `find $PHP_JAVA/. -type d`; do
|
||||
|
@ -89,6 +86,7 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
if test -f $i/$java_libext; then
|
||||
JAVA_LIB=java
|
||||
JAVA_LIBPATH=$i
|
||||
|
||||
test -d $i/hotspot && PHP_ADD_LIBPATH($i/hotspot)
|
||||
test -d $i/classic && PHP_ADD_LIBPATH($i/classic)
|
||||
test -d $i/server && PHP_ADD_LIBPATH($i/server)
|
||||
|
@ -103,7 +101,46 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
|
||||
JAVA_CFLAGS="$JAVA_CFLAGS -D_REENTRANT"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
PHP_ARG_WITH(java, for Java support,
|
||||
[ --with-java[=DIR] Include Java support. DIR is the JDK base install directory.
|
||||
This extension is always built as shared.])
|
||||
|
||||
if test "$PHP_JAVA" != "no"; then
|
||||
platform=`uname -s 2>/dev/null`
|
||||
java_libext=libjava.so
|
||||
case $platform in
|
||||
AIX) java_libext=libjava.a ;;
|
||||
HP-UX) java_libext=libjava.sl ;;
|
||||
Darwin) java_libext=libjava.jnilib ;;
|
||||
esac
|
||||
|
||||
JAVA_FIND_JAR()
|
||||
JAVA_FIND_C()
|
||||
|
||||
if test "$platform" = "Darwin"; then
|
||||
AC_CHECK_HEADERS([JavaVM/JavaVM.h])
|
||||
AC_CHECK_HEADERS([JavaVM/jni.h])
|
||||
JAVA_CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar
|
||||
PHP_CHECK_FRAMEWORK("JavaVM", JNI_CreateJavaVM,[AC_DEFINE(HAVE_JAVA,1,[ ])])
|
||||
PHP_ADD_FRAMEWORK("JavaVM")
|
||||
else
|
||||
dnl
|
||||
dnl it can't be no, and now we test to make sure it can't be yes
|
||||
dnl if it isn't 'yes' well, we just have to build a path using which
|
||||
dnl if it is 'yes' we have a path provided to us, now run free!
|
||||
dnl
|
||||
if test "$PHP_JAVA" = "yes"; then
|
||||
dnl
|
||||
dnl Give us the basepath for where javac is!
|
||||
dnl
|
||||
PHP_JAVA=`cd \`dirname \\\`which javac\\\`\`/..;pwd`
|
||||
else
|
||||
test -x $PHP_JAVA/bin/jar && JAVA_JAR="$PHP_JAVA/bin/jar cf"
|
||||
fi
|
||||
JAVA_CHECK_LIB()
|
||||
AC_DEFINE(HAVE_JAVA,1,[ ])
|
||||
|
||||
if test -z "$JAVA_LIBPATH"; then
|
||||
|
@ -112,21 +149,22 @@ e.g. --with-java=/java expecting /java/bin/ to contain the binaries])
|
|||
|
||||
PHP_ADD_LIBPATH($JAVA_LIBPATH)
|
||||
JAVA_CFLAGS="$JAVA_CFLAGS '-DJAVALIB=\"$JAVA_LIBPATH/$java_libext\"'"
|
||||
fi
|
||||
|
||||
if test "$PHP_SAPI" != "servlet"; then
|
||||
PHP_NEW_EXTENSION(java, java.c, shared,, $JAVA_CFLAGS $JAVA_INCLUDE)
|
||||
|
||||
if test "$PHP_SAPI" = "cgi"; then
|
||||
if test "$platform" != "Darwin"; then
|
||||
PHP_ADD_LIBRARY($JAVA_LIB)
|
||||
fi
|
||||
fi
|
||||
|
||||
INSTALL_IT="$INSTALL_IT; \$(srcdir)/build/shtool mkdir -p -f -m 0755 \$(INSTALL_ROOT)\$(libdir)"
|
||||
INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 \$(srcdir)/ext/java/php_java.jar \$(INSTALL_ROOT)\$(libdir)"
|
||||
fi
|
||||
|
||||
PHP_SUBST(JAVA_CLASSPATH)
|
||||
PHP_SUBST(JAVA_JAR)
|
||||
PHP_SUBST(JAVA_C)
|
||||
|
||||
PHP_ADD_MAKEFILE_FRAGMENT
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue