fedora-cvs-commits@redhat.com
[Top] [All Lists]

rpms/ant/devel ant.spec, 1.46, 1.47 apache-ant-bz157750.patch, 1.1, 1.2

Subject: rpms/ant/devel ant.spec, 1.46, 1.47 apache-ant-bz157750.patch, 1.1, 1.2
From:
Date: Mon, 6 Jun 2005 05:38:33 -0400
Author: gbenson

Update of /cvs/dist/rpms/ant/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv30174

Modified Files:
        ant.spec apache-ant-bz157750.patch 
Log Message:
Make the javah task fall back to executing javah


Index: ant.spec
===================================================================
RCS file: /cvs/dist/rpms/ant/devel/ant.spec,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- ant.spec    31 May 2005 13:36:59 -0000      1.46
+++ ant.spec    6 Jun 2005 09:38:30 -0000       1.47
@@ -329,14 +329,14 @@
 # Build OPT_JAR_LIST from the contents of /etc/ant.d/
 %patch1 -p1
 
-# fix classpath for java-x.y.z-gcj-compat
+# fix classpath for java-gcj-compat
 if java -version 2>&1 | grep -q "gcj"; then
 %patch2 -p1
 rm -f src/script/ant.orig
 fi
 
-# build the javah task (#157750)
-%patch3 -p1
+# build the javah task (#157750) and make it work with java-gcj-compat
+%patch3 -p1 -b .orig
 
 # clean jar files
 find . -name "*.jar" -exec rm -f {} \;
@@ -627,6 +627,10 @@
 # -----------------------------------------------------------------------------
 
 %changelog
+* Mon Jun  6 2005 Gary Benson <gbenson at redhat.com>
+- Make the javah task fall back to executing javah if
+  com.sun.tools.javah.Main cannot be found.
+
 * Tue May 25 2005 Gary Benson <gbenson at redhat.com> 0:1.6.2-3jpp_9fc
 - Rearrange how BC-compiled stuff is built and installed.
 

apache-ant-bz157750.patch:
 build.xml                                                  |    1 
 src/main/org/apache/tools/ant/taskdefs/optional/Javah.java |   20 +++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

Index: apache-ant-bz157750.patch
===================================================================
RCS file: /cvs/dist/rpms/ant/devel/apache-ant-bz157750.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- apache-ant-bz157750.patch   23 May 2005 12:02:02 -0000      1.1
+++ apache-ant-bz157750.patch   6 Jun 2005 09:38:30 -0000       1.2
@@ -8,3 +8,49 @@
      </or>
    </selector>
  
+--- 
apache-ant-1.6.2/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java~    
   2004-07-16 08:57:36.000000000 +0100
++++ 
apache-ant-1.6.2/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java     
   2005-06-03 15:11:04.000000000 +0100
+@@ -26,6 +26,7 @@
+ import org.apache.tools.ant.BuildException;
+ import org.apache.tools.ant.Project;
+ import org.apache.tools.ant.Task;
++import org.apache.tools.ant.taskdefs.Execute;
+ import org.apache.tools.ant.types.Commandline;
+ import org.apache.tools.ant.types.Path;
+ import org.apache.tools.ant.types.Reference;
+@@ -307,6 +308,8 @@
+         */
+ 
+ 
++        Method runMethod = null;
++        Object javahMain = null;
+         try {
+             Class javahMainClass = null;
+             try {
+@@ -322,12 +325,23 @@
+             Constructor constructor = javahMainClass.getConstructor(strings);
+ 
+             // construct the javah Main instance
+-            Object javahMain = constructor.newInstance(new Object[] 
{cmd.getArguments()});
++            javahMain = constructor.newInstance(
++                new Object[] {cmd.getArguments()});
+ 
+             // find the run method
+-            Method runMethod = javahMainClass.getMethod("run", new Class[0]);
++            runMethod = javahMainClass.getMethod("run", new Class[0]);
++        } catch (Exception ex) {
++            // fall back to executing javah
++        }
+ 
+-            runMethod.invoke(javahMain, new Object[0]);
++        try {
++            if (runMethod != null) {
++                runMethod.invoke(javahMain, new Object[0]);
++            }
++            else {
++                cmd.setExecutable(JavaEnvUtils.getJdkExecutable("javah"));
++                Execute.runCommand(this, cmd.getCommandline());
++            }
+         } catch (Exception ex) {
+             if (ex instanceof BuildException) {
+                 throw (BuildException) ex;

--
fedora-cvs-commits mailing list
fedora-cvs-commits@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-cvs-commits

<Prev in Thread] Current Thread [Next in Thread>
  • rpms/ant/devel ant.spec, 1.46, 1.47 apache-ant-bz157750.patch, 1.1, 1.2, fedora-cvs-commits <=