mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
First step to restoring the ability to build Java support on Unix:
1) Restore the ability to build CGI as a shared library 2) Correct make dependency rule so that the jar files are included 3) Search for jar executable, and use it, if found Left TODO: actually build the shared libraries
This commit is contained in:
parent
fb6a1b8b83
commit
e6c203832e
@ -618,7 +618,6 @@ enable_static=yes
|
||||
case "$php_build_target" in
|
||||
program)
|
||||
enable_shared=no
|
||||
PHP_PROGRAM=php
|
||||
;;
|
||||
shared)
|
||||
enable_static=no
|
||||
@ -629,6 +628,10 @@ static)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$PHP_SAPI" = "cgi"; then
|
||||
PHP_PROGRAM=php
|
||||
fi
|
||||
|
||||
PHP_REGEX
|
||||
|
||||
case "`uname -s`" in
|
||||
|
@ -4,16 +4,15 @@ topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libjava.la
|
||||
LTLIBRARY_NAME = libphp_java.la
|
||||
LTLIBRARY_SOURCES = java.c
|
||||
LTLIBRARY_LIBADD = $(JAVA_LFLAGS)
|
||||
LTLIBRARY_DEPENDENCIES = php_java.jar
|
||||
|
||||
EXTRA_CFLAGS = $(JAVA_CFLAGS)
|
||||
EXTRA_INCLUDES = $(JAVA_INCLUDE)
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
|
||||
phplib_DATA=php_java.jar
|
||||
php_java.jar : reflect.java
|
||||
@test -e net || mkdir net
|
||||
@test -e net/php || mkdir net/php
|
||||
@ -21,7 +20,7 @@ php_java.jar : reflect.java
|
||||
@echo library=php4>net/php/reflect.properties
|
||||
javac net/php/reflect.java
|
||||
@test ! -f reflect.class || mv reflect.class net/php # bug in KJC javac
|
||||
zip -q0 php_java.jar net/php/*.class net/php/*.properties
|
||||
$(JAVA_JAR) php_java.jar net/php/*.class net/php/*.properties
|
||||
@rm net/php/reflect.*
|
||||
@rmdir net/php
|
||||
@rmdir net
|
||||
|
@ -49,6 +49,13 @@ AC_ARG_WITH(java,
|
||||
fi
|
||||
fi
|
||||
|
||||
# substitute zip for systems which don't have jar in the PATH
|
||||
if JAVA_JAR=`which jar 2>/dev/null`; then
|
||||
JAVA_JAR="$JAVA_JAR cf"
|
||||
else
|
||||
JAVA_JAR='zip -q0'
|
||||
fi
|
||||
|
||||
AC_DEFINE(HAVE_JAVA,1,[ ])
|
||||
PHP_EXTENSION(java, shared)
|
||||
PHP_BUILD_SHARED
|
||||
@ -64,5 +71,5 @@ PHP_SUBST(JAVA_CFLAGS)
|
||||
PHP_SUBST(JAVA_CLASSPATH)
|
||||
PHP_SUBST(JAVA_INCLUDE)
|
||||
PHP_SUBST(JAVA_SHARED)
|
||||
PHP_SUBST(JAVA_LFLAGS)
|
||||
PHP_SUBST(JAVA_JAR)
|
||||
|
||||
|
@ -4,16 +4,15 @@ topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libjava.la
|
||||
LTLIBRARY_NAME = libphp_java.la
|
||||
LTLIBRARY_SOURCES = java.c
|
||||
LTLIBRARY_LIBADD = $(JAVA_LFLAGS)
|
||||
LTLIBRARY_DEPENDENCIES = php_java.jar
|
||||
|
||||
EXTRA_CFLAGS = $(JAVA_CFLAGS)
|
||||
EXTRA_INCLUDES = $(JAVA_INCLUDE)
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
|
||||
phplib_DATA=php_java.jar
|
||||
php_java.jar : reflect.java
|
||||
@test -e net || mkdir net
|
||||
@test -e net/php || mkdir net/php
|
||||
@ -21,7 +20,7 @@ php_java.jar : reflect.java
|
||||
@echo library=php4>net/php/reflect.properties
|
||||
javac net/php/reflect.java
|
||||
@test ! -f reflect.class || mv reflect.class net/php # bug in KJC javac
|
||||
zip -q0 php_java.jar net/php/*.class net/php/*.properties
|
||||
$(JAVA_JAR) php_java.jar net/php/*.class net/php/*.properties
|
||||
@rm net/php/reflect.*
|
||||
@rmdir net/php
|
||||
@rmdir net
|
||||
|
@ -4,16 +4,15 @@ topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libjava.la
|
||||
LTLIBRARY_NAME = libphp_java.la
|
||||
LTLIBRARY_SOURCES = java.c
|
||||
LTLIBRARY_LIBADD = $(JAVA_LFLAGS)
|
||||
LTLIBRARY_DEPENDENCIES = php_java.jar
|
||||
|
||||
EXTRA_CFLAGS = $(JAVA_CFLAGS)
|
||||
EXTRA_INCLUDES = $(JAVA_INCLUDE)
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
|
||||
phplib_DATA=php_java.jar
|
||||
php_java.jar : reflect.java
|
||||
@test -e net || mkdir net
|
||||
@test -e net/php || mkdir net/php
|
||||
@ -21,7 +20,7 @@ php_java.jar : reflect.java
|
||||
@echo library=php4>net/php/reflect.properties
|
||||
javac net/php/reflect.java
|
||||
@test ! -f reflect.class || mv reflect.class net/php # bug in KJC javac
|
||||
zip -q0 php_java.jar net/php/*.class net/php/*.properties
|
||||
$(JAVA_JAR) php_java.jar net/php/*.class net/php/*.properties
|
||||
@rm net/php/reflect.*
|
||||
@rmdir net/php
|
||||
@rmdir net
|
||||
|
@ -49,6 +49,13 @@ AC_ARG_WITH(java,
|
||||
fi
|
||||
fi
|
||||
|
||||
# substitute zip for systems which don't have jar in the PATH
|
||||
if JAVA_JAR=`which jar 2>/dev/null`; then
|
||||
JAVA_JAR="$JAVA_JAR cf"
|
||||
else
|
||||
JAVA_JAR='zip -q0'
|
||||
fi
|
||||
|
||||
AC_DEFINE(HAVE_JAVA,1,[ ])
|
||||
PHP_EXTENSION(java, shared)
|
||||
PHP_BUILD_SHARED
|
||||
@ -64,5 +71,5 @@ PHP_SUBST(JAVA_CFLAGS)
|
||||
PHP_SUBST(JAVA_CLASSPATH)
|
||||
PHP_SUBST(JAVA_INCLUDE)
|
||||
PHP_SUBST(JAVA_SHARED)
|
||||
PHP_SUBST(JAVA_LFLAGS)
|
||||
PHP_SUBST(JAVA_JAR)
|
||||
|
||||
|
@ -6,6 +6,7 @@ VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libsapi.la
|
||||
LTLIBRARY_SOURCES = servlet.c java.c
|
||||
LTLIBRARY_DEPENDENCIES = phpsrvlt.jar
|
||||
|
||||
EXTRA_CFLAGS = $(JAVA_CFLAGS)
|
||||
EXTRA_INCLUDES = $(JAVA_INCLUDE)
|
||||
@ -15,7 +16,6 @@ include $(topsrcdir)/build/ltlib.mk
|
||||
java.c : ../../ext/java/java.c
|
||||
@cp ../../ext/java/java.c .
|
||||
|
||||
phplib_DATA=phpsrvlt.jar
|
||||
phpsrvlt.jar : servlet.java ../../ext/java/reflect.java
|
||||
@test -e net || mkdir net
|
||||
@test -e net/php || mkdir net/php
|
||||
|
Loading…
Reference in New Issue
Block a user