cvs: pecl /rpc/java config.w32

From: Date: Tue, 23 Dec 2003 01:58:38 +0000
Subject: cvs: pecl /rpc/java config.w32
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-611@lists.php.net to get a copy of this message
wez Mon Dec 22 20:58:38 2003 EDT Added files: /pecl/rpc/java config.w32 Log: Allow java extension to build with new build system. Would appreciate it if someone could test if it really works in PHP 5 under win32. Index: pecl/rpc/java/config.w32 +++ pecl/rpc/java/config.w32 // vim:ft=javascript // $Id: config.w32,v 1.1 2003/12/23 01:58:38 wez Exp $ ARG_WITH('java', 'Java extension --with-java=[JAVAHOME]', 'no'); function find_java_home(hint_path) { if (hint_path != "yes") { return hint_path; } hint_path = WshShell.Environment("Process").Item("JAVA_HOME"); if (FSO.FolderExists(hint_path)) { return hint_path; } // Lets look under ProgramFiles dir for a dir matching "j2sdk*". // Within that dir, we expect to find a folder matching "j2sdk*" // and within that we hope to find bin/javac.exe var potentials = glob(PROGRAM_FILES + "\\j2sdk*\\j2sdk*"); var i; var p; for (i = 0; i < potentials.length; i++) { p = potentials[i] + "\\bin\\javac.exe"; if (FSO.FileExists(p)) { return potentials[i]; } } return false; } if (PHP_JAVA != "no") { if (PHP_JAVA == "yes") { PHP_JAVA = find_java_home(PHP_JAVA); } if (CHECK_HEADER_ADD_INCLUDE("jni.h", "CFLAGS_JAVA", PHP_JAVA + "\\include") && CHECK_HEADER_ADD_INCLUDE("jni_md.h", "CFLAGS_JAVA", PHP_JAVA + "\\include\\win32")) { EXTENSION('java', 'java.c', true); ext_javac_flags = PHP_DEBUG == "yes" ? "-g" : "-O"; // hack for use by sapi/servlet ext_java_dirname = configure_module_dirname; // Add some Makefile hackery for java reflection MFO.WriteLine("$(BUILD_DIR)\\php_java.jar: " + configure_module_dirname + "\\reflect.java"); MFO.WriteLine("\tif not exist $(BUILD_DIR)\\net mkdir $(BUILD_DIR)\\net"); MFO.WriteLine("\tif not exist $(BUILD_DIR)\\net\\php mkdir $(BUILD_DIR)\\net\\php"); MFO.WriteLine("\tcopy " + configure_module_dirname + "\\reflect.java $(BUILD_DIR)\\net\\php > NUL"); MFO.WriteLine("\techo library=php_java > $(BUILD_DIR)\\net\\php\\reflect.properties"); MFO.WriteLine("\tcd $(BUILD_DIR)"); MFO.WriteLine("\t\"" + PHP_JAVA + "\\bin\\javac\" " + ext_javac_flags + " net\\php\\reflect.java"); MFO.WriteLine("\t\"" + PHP_JAVA + "\\bin\\jar\" c0f php_java.jar net\\php\\*.class net\\php\\*.properties"); MFO.WriteLine("\terase net\\php\\reflect.*"); MFO.WriteLine("\trmdir /s /q net\\php"); MFO.WriteLine("\trmdir /s /q net"); MFO.WriteLine("\tcd .."); // Add dep to get this thing built ADD_FLAG('DEPS_JAVA', '$(BUILD_DIR)\\php_java.jar'); AC_DEFINE('HAVE_JAVA', 1); } else { WARNING("Could not find Java headers/libraries"); } }

« previous php.pecl.cvs (#611) next »