commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1189887 - in /commons/sandbox/runtime/trunk: build.xml src/build/org/apache/commons/runtime/ant/SystemIdTask.java src/main/java/org/apache/commons/runtime/SystemId.java src/main/native/Makefile.unx.in
Date Thu, 27 Oct 2011 17:38:33 GMT
Author: mturk
Date: Thu Oct 27 17:38:32 2011
New Revision: 1189887

URL: http://svn.apache.org/viewvc?rev=1189887&view=rev
Log:
Allow creating multilib builds

Modified:
    commons/sandbox/runtime/trunk/build.xml
    commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SystemId.java
    commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in

Modified: commons/sandbox/runtime/trunk/build.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/build.xml?rev=1189887&r1=1189886&r2=1189887&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/build.xml (original)
+++ commons/sandbox/runtime/trunk/build.xml Thu Oct 27 17:38:32 2011
@@ -302,8 +302,13 @@ The Apache Software Foundation (http://w
     <!-- ================================================================== -->
     <target name="native-jar" depends="compile"
         description="Generates the Jar file">
-        <copy todir="${build.dest}/java/${build.package.path}/platform/${systemid.os}/${systemid.cpu}">
-            <fileset dir="${runtime.library.path}">
+        <copy todir="${build.dest}/java/${build.package.path}/platform/${systemid.os}/${systemid.cpu32}">
+            <fileset erroronmissingdir="false" dir="${runtime.library.path}32">
+                <include name="*.${systemid.so}"/>
+            </fileset>
+        </copy>
+        <copy todir="${build.dest}/java/${build.package.path}/platform/${systemid.os}/${systemid.cpu32}">
+            <fileset erroronmissingdir="false" dir="${runtime.library.path}64">
                 <include name="*.${systemid.so}"/>
             </fileset>
         </copy>
@@ -451,8 +456,8 @@ The Apache Software Foundation (http://w
                 <classfileset dir="${build.dest}/test">
                     <include name="**/*.class"/>
                 </classfileset>
-                <env key="PATH" path="${runtime.library.path}:${java.library.path}:${env.PATH}"/>
-                <jvmarg value="-Djava.library.path=${runtime.library.path}"/>
+                <env key="PATH" path="${runtime.library.path}${systemid.data.model}:${java.library.path}:${env.PATH}"/>
+                <jvmarg value="-Djava.library.path=${runtime.library.path}${systemid.data.model}"/>
                 <jvmarg value="-Xmx512m"/>
                 <jvmarg line="${args}"/>
             </testng>
@@ -534,8 +539,8 @@ The Apache Software Foundation (http://w
               fork="yes"
               failonerror="${test.failonerror}">
             <classpath refid="examples.classpath"/>
-            <env key="PATH" path="${runtime.library.path}:${java.library.path}:${env.PATH}"/>
-            <jvmarg value="-Djava.library.path=${runtime.library.path}"/>
+            <env key="PATH" path="${runtime.library.path}${systemid.data.model}:${java.library.path}:${env.PATH}"/>
+            <jvmarg value="-Djava.library.path=${runtime.library.path}${systemid.data.model}"/>
             <jvmarg value="-Xmx512m"/>
             <arg line="${args}"/>
         </java>

Modified: commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java?rev=1189887&r1=1189886&r2=1189887&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java
(original)
+++ commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java
Thu Oct 27 17:38:32 2011
@@ -122,7 +122,7 @@ public class SystemIdTask extends Task i
             syscpu = "x86";
             if (name.startsWith("Mac OS")) {
                 if (data.equals("64"))
-                    syscpu = "x86_64";
+                    syscpu = "x64";
             }
         }
         else if (arch.startsWith("PA_RISC")) {
@@ -132,7 +132,7 @@ public class SystemIdTask extends Task i
                 syscpu = "parisc";
         }
         else if (arch.startsWith("IA64"))
-            syscpu = "ia64";
+            syscpu = "i64";
         else if (arch.startsWith("sparc")) {
             if (data.equals("64"))
                 syscpu = "sparc64";
@@ -146,7 +146,7 @@ public class SystemIdTask extends Task i
                 syscpu = "ppc";
         }
         else if (arch.equals("amd64"))
-            syscpu = "x86_64";
+            syscpu = "x64";
         else
             syscpu = arch;
         return syscpu;
@@ -180,6 +180,38 @@ public class SystemIdTask extends Task i
         return ext;
     }
 
+    private static String getProcessor32()
+    {
+        getProcessor();
+        if (syscpu.equals("x86") || syscpu.equals("x64"))
+            return "x86";
+        if (syscpu.equals("i32") || syscpu.equals("i64"))
+            return "i32";
+        if (syscpu.startsWith("sparc"))
+            return "sparc";
+        if (syscpu.startsWith("ppc"))
+            return "ppc";
+        if (syscpu.startsWith("parisc"))
+            return "parisc";
+        return syscpu;
+    }
+
+    private static String getProcessor64()
+    {
+        getProcessor();
+        if (syscpu.equals("x86") || syscpu.equals("x64"))
+            return "x64";
+        if (syscpu.equals("i32") || syscpu.equals("i64"))
+            return "i64";
+        if (syscpu.startsWith("sparc"))
+            return "sparc64";
+        if (syscpu.startsWith("ppc"))
+            return "ppc64";
+        if (syscpu.startsWith("parisc"))
+            return "parisc64";
+        return syscpu;
+    }
+    
     public void setPrefix(String prefix)
     {
         this.prefix = prefix;
@@ -207,6 +239,8 @@ public class SystemIdTask extends Task i
             throw new BuildException("Missing prefix attribute");
         getProject().setNewProperty(prefix + ".so",  getSoExtension());
         getProject().setNewProperty(prefix + ".cpu", getProcessor());
+        getProject().setNewProperty(prefix + ".cpu32", getProcessor32());
+        getProject().setNewProperty(prefix + ".cpu64", getProcessor64());
         getProject().setNewProperty(prefix + ".os",  getSysname());
         getProject().setNewProperty(prefix + ".data.model", getDataModel());
         getProject().setNewProperty(prefix + ".OS",  getSysname().toUpperCase());

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SystemId.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SystemId.java?rev=1189887&r1=1189886&r2=1189887&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SystemId.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SystemId.java Thu
Oct 27 17:38:32 2011
@@ -120,7 +120,7 @@ public final class SystemId
             cpu = "x86";
             if (sys.equals("darwin")) {
                 if (sdm.equals("64"))
-                    cpu = "x86_64";
+                    cpu = "x64";
             }
         }
         else if (arch.startsWith("PA_RISC")) {
@@ -130,7 +130,7 @@ public final class SystemId
                 cpu = "parisc";
         }
         else if (arch.startsWith("IA64"))
-            cpu = "ia64";
+            cpu = "i64";
         else if (arch.startsWith("sparc")) {
             if (sdm.equals("64"))
                 cpu = "sparc64";
@@ -144,7 +144,7 @@ public final class SystemId
                 cpu = "ppc";
         }
         else if (arch.equals("amd64"))
-            cpu = "x86_64";
+            cpu = "x64";
         else
             cpu = arch;
         return cpu;
@@ -160,7 +160,7 @@ public final class SystemId
         if (sys.equals("windows")) {
             if (cpu.equals("x86"))
                 pid = 0x10000;
-            else if (cpu.equals("ia64"))
+            else if (cpu.equals("i64"))
                 pid = 0x10011;
             else
                 pid = 0x10010;
@@ -168,7 +168,7 @@ public final class SystemId
         else if (sys.equals("linux")) {
             if (cpu.equals("x86"))
                 pid = 0x20100;
-            else if (cpu.equals("ia64"))
+            else if (cpu.equals("i64"))
                 pid = 0x20112;
             else
                 pid = 0x20111;
@@ -186,7 +186,7 @@ public final class SystemId
         else if (sys.equals("darwin")) {
             if (cpu.equals("x86"))
                 pid = 0x20400;
-            else if (cpu.equals("x86_64"))
+            else if (cpu.equals("x64"))
                 pid = 0x20410;
             else
                 pid = 0x20401;
@@ -194,7 +194,7 @@ public final class SystemId
         else if (sys.equals("bsd")) {
             if (cpu.equals("x86"))
                 pid = 0x20800;
-            else if (cpu.equals("x86_64"))
+            else if (cpu.equals("x64"))
                 pid = 0x20810;
             else
                 pid = 0x20801;

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in?rev=1189887&r1=1189886&r2=1189887&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in Thu Oct 27 17:38:32 2011
@@ -28,7 +28,7 @@ SRCDIRS=\
 	$(TOPDIR)/srclib/zlib \
 	$(TOPDIR)/srclib/zlib/unix
 
-OUTLIBDIR=$(TOPDIR)/.libs
+OUTLIBDIR=$(TOPDIR)/.libs$(BITS)
 SHAREDLL0=lib$(DLLNAME)$(SO)
 SHAREDLL1=$(SHAREDLL0).$(VERSION_MAJOR)
 SHAREDLIB=$(OUTLIBDIR)/$(SHAREDLL0).$(VERSION)



Mime
View raw message