diff -r 78a0ce4fd551 -r f214e7bac2ea Makefile.am --- a/Makefile.am Tue Jun 14 17:25:06 2011 +0200 +++ b/Makefile.am Tue Jun 14 12:27:35 2011 -0400 @@ -1287,7 +1287,12 @@ stamps/bootstrap-directory-ecj.stamp: st ln -sf $(XALAN2_JAR) $(ECJ_BOOT_DIR)/lib/endorsed/xalan-j2.jar && \ ln -sf $(XALAN2_SERIALIZER_JAR) \ $(ECJ_BOOT_DIR)/lib/endorsed/xalan-j2-serializer.jar && \ - ln -sf $(XERCES2_JAR) $(ECJ_BOOT_DIR)/lib/endorsed/xerces-j2.jar + ln -sf $(XERCES2_JAR) $(ECJ_BOOT_DIR)/lib/endorsed/xerces-j2.jar && \ + if test -n "$(XML_COMMONS_APIS_JAR)"; \ + then \ + ln -sf $(XML_COMMONS_APIS_JAR) \ + $(ECJ_BOOT_DIR)/lib/endorsed/xml-commons-apis.jar; \ + fi mkdir -p $(ECJ_BOOT_DIR)/jre/lib && \ cp $(SYSTEM_JDK_DIR)/jre/lib/rt.jar $(ECJ_BOOT_DIR)/jre/lib/rt.jar && \ ln -sf $(SYSTEM_JDK_DIR)/jre/lib/$(JRE_ARCH_DIR) \ diff -r 78a0ce4fd551 -r f214e7bac2ea acinclude.m4 --- a/acinclude.m4 Tue Jun 14 17:25:06 2011 +0200 +++ b/acinclude.m4 Tue Jun 14 12:27:35 2011 -0400 @@ -725,6 +725,43 @@ AC_DEFUN([IT_FIND_XERCES2_JAR], AC_SUBST(XERCES2_JAR) ]) +AC_DEFUN([IT_FIND_XML_COMMONS_APIS_JAR], +[ + AC_MSG_CHECKING([for an xml-commons-apis jar]) + AC_ARG_WITH([xml-commons-apis-jar], + [AS_HELP_STRING(--with-xml-commons-apis-jar,specify location of the xml-commons-apis jar)], + [ + if test -f "${withval}" || test -h "${withval}" ; then + XML_COMMONS_APIS_JAR="${withval}" + fi + ], + [ + XML_COMMONS_APIS_JAR= + ]) + if test -z "${XML_COMMONS_APIS_JAR}"; then + if test -e "/usr/share/java/xml-commons-apis.jar"; then + XML_COMMONS_APIS_JAR=/usr/share/java/xml-commons-apis.jar + elif test -e "/usr/share/java/xml-apis.jar"; then + XML_COMMONS_APIS_JAR=/usr/share/java/xml-apis.jar + elif test -e "/usr/share/xml-commons/lib/xml-apis.jar"; then + XML_COMMONS_APIS_JAR=/usr/share/xml-commons/lib/xml-apis.jar + elif test -e "/usr/share/java/xml-apis-ext.jar"; then + XML_COMMONS_APIS_JAR=/usr/share/java/xml-apis-ext.jar + elif test -e "/usr/share/java/xml-commons-external.jar"; then + XML_COMMONS_APIS_JAR=/usr/share/java/xml-commons-external.jar + elif test -e "/usr/share/java/apache-xml-commons-apis.jar"; then + XML_COMMONS_APIS_JAR=/usr/share/java/apache-xml-commons-apis.jar + else + AC_MSG_RESULT(no) + fi + fi + if test -z "${XML_COMMONS_APIS_JAR}"; then + AC_MSG_ERROR("An xml-commons-apis jar was not found.") + fi + AC_MSG_RESULT(${XML_COMMONS_APIS_JAR}) + AC_SUBST(XML_COMMONS_APIS_JAR) +]) + AC_DEFUN([IT_FIND_RHINO_JAR], [ AC_MSG_CHECKING([whether to include Javascript support via Rhino]) @@ -1374,6 +1411,62 @@ AM_CONDITIONAL([LACKS_$1], test x"${it_c AC_PROVIDE([$0])dnl ]) +dnl Generic macro to instantiate a Java class +dnl Takes three arguments: the name of the macro, +dnl the name of the class and the instantiation +dnl paramaters. The macro name is usually the +dnl name of the class with '.' replaced by '_' +dnl and all letters capitalised. +dnl Also takes optional classpath paramater. +dnl e.g. IT_CHECK_FOR_INSTANTIABLE_CLASS([JAVA_LANG_INTEGER], +dnl [java.lang.Integer],[0],[./bin]) +AC_DEFUN([IT_CHECK_IF_INSTANTIABLE],[ +AC_CACHE_CHECK([if $2 is instantiable], it_cv_$1, [ +CLASS=Test.java +BYTECODE=$(echo $CLASS|sed 's#\.java##') +mkdir tmp.$$ +cd tmp.$$ +cat << \EOF > $CLASS +[/* [#]line __oline__ "configure" */ +public class Test +{ + public static void main(String[] args) + { + new $2($3); + } +} +] +EOF + +if test -z $4; then + WITH_CLASSPATH=. +else + WITH_CLASSPATH=$4:. +fi + +if $JAVAC -cp $WITH_CLASSPATH $JAVACFLAGS -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then + if $JAVA -classpath $WITH_CLASSPATH $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then + it_cv_$1=yes; + else + it_cv_$1=no; + fi +else + it_cv_$1=no; +fi +]) +rm -f $CLASS *.class +cd .. +rmdir tmp.$$ + +if test x"${it_cv_$1}" = "xyes" +then + $1_INSTANTIABLE=yes +else + $1_INSTANTIABLE=no +fi +AC_PROVIDE([$0])dnl +]) + # Finds number of available processors using sysconf AC_DEFUN_ONCE([IT_FIND_NUMBER_OF_PROCESSORS],[ IT_FIND_TOOL([GETCONF], [getconf]) diff -r 78a0ce4fd551 -r f214e7bac2ea configure.ac --- a/configure.ac Tue Jun 14 17:25:06 2011 +0200 +++ b/configure.ac Tue Jun 14 12:27:35 2011 -0400 @@ -159,6 +159,15 @@ if test "x$enable_bootstrap" = "xyes"; t IT_FIND_XALAN2_JAR IT_FIND_XALAN2_SERIALIZER_JAR IT_FIND_XERCES2_JAR + IT_CHECK_IF_INSTANTIABLE([ORG_APACHE_XERCES_DOM_DEFERREDDOCUMENTIMPL], +[org.apache.xerces.dom.DeferredDocumentImpl],[], +[$XALAN2_JAR:$XALAN2_SERIALIZER_JAR:$XERCES2_JAR]) + if test x"${ORG_APACHE_XERCES_DOM_DEFERREDDOCUMENTIMPL_INSTANTIABLE}" = "xno" + then + IT_FIND_XML_COMMONS_APIS_JAR + else + XML_COMMONS_APIS_JAR= + fi fi AC_CONFIG_FILES([javac], [chmod +x javac]) AC_CONFIG_FILES([javap], [chmod +x javap])