7181501: Add some GenerateNativeHeader annotations and misc Mac adjustments to makefiles
authorerikj
Tue, 03 Jul 2012 16:01:59 -0700
changeset 13166 8470c1078142
parent 13165 679567fae315
child 13167 efec101d7d87
7181501: Add some GenerateNativeHeader annotations and misc Mac adjustments to makefiles Reviewed-by: ohair
jdk/src/macosx/native/jobjc/build.xml
jdk/src/macosx/native/jobjc/src/core/PrimitiveCoder.hs
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/CFType.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Coder.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/FFIType.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Function.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/ID.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Invoke.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/JObjCRuntime.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/MacOSXFramework.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NSClass.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeArgumentBuffer.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeBuffer.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeObjectLifecycleManager.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Opaque.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Pointer.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/PrimitiveCoder.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/SEL.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Struct.java
jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Subclassing.java
jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/FrameworkClassFile.java
jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Clazz.java
jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/ComplexCoderDescriptor.java
--- a/jdk/src/macosx/native/jobjc/build.xml	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/build.xml	Tue Jul 03 16:01:59 2012 -0700
@@ -140,8 +140,16 @@
     <!-- Compile PrimitiveCoder first to work around javac bug. -->
     <javac srcdir="${core.src}" destdir="${core.bin}" source="1.5" target="1.5" debug="${compile.debug}"
            includes="**/PrimitiveCoder.java"
-           includeantruntime="false" />
-    <javac srcdir="${core.src}" destdir="${core.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false" />
+           includeantruntime="false">
+      <classpath>
+        <path location="${obj}/../langtools/dist/lib/classes.jar"/>
+      </classpath>
+    </javac>
+    <javac srcdir="${core.src}" destdir="${core.bin}" source="1.5" target="1.5" debug="${compile.debug}" includeantruntime="false">
+      <classpath>
+        <path location="${obj}/../langtools/dist/lib/classes.jar"/>
+      </classpath>
+    </javac>
 
     <exec executable="/usr/bin/perl" outputproperty="core.classes" failonerror="true">
       <arg value="${src}/extract_classes.pl"/>
--- a/jdk/src/macosx/native/jobjc/src/core/PrimitiveCoder.hs	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/PrimitiveCoder.hs	Tue Jul 03 16:01:59 2012 -0700
@@ -2,7 +2,7 @@
 
 {-
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011,2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -196,6 +196,8 @@
 c2java ntype =
     unlines [
  "// native " ++ ntypeS ++ " -> java " ++ jprimS,
+ "/* No native methods here, but the constants are needed in the supporting JNI code */",
+ "@GenerateNativeHeader",
  "public static final class " ++ className ++ " extends PrimitiveCoder<" ++ jclassS ++ ">{",
  "\tpublic static final " ++ className ++ " INST = new " ++ className ++ "();",
  "\tpublic " ++ className ++ "(){ super("++ffitypeVal ntype++", \"" ++ [encoding ntype] ++ "\", "++jclassS++".class, "++jprimS++".class); }",
@@ -246,10 +248,13 @@
   putStrLn "package com.apple.jobjc;"
 
   putStrLn "import com.apple.jobjc.JObjCRuntime.Width;"
+  putStrLn "import javax.tools.annotation.GenerateNativeHeader;"
 
   putStrLn "// Auto generated by PrimitiveCoder.hs"
   putStrLn "// Do not edit by hand."
 
+  putStrLn "/* No native methods here, but the constants are needed in the supporting JNI code */"
+  putStrLn "@GenerateNativeHeader"
   putStrLn "public abstract class PrimitiveCoder<T> extends Coder<T>{"
 
   putStrLn "\tpublic PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){"
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/CFType.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/CFType.java	Tue Jul 03 16:01:59 2012 -0700
@@ -24,6 +24,10 @@
  */
 package com.apple.jobjc;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class CFType extends Pointer<Void> {
     protected CFType(long ptr) { super(ptr); }
     protected CFType(Pointer<?> ptr) { super(ptr.ptr); }
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Coder.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Coder.java	Tue Jul 03 16:01:59 2012 -0700
@@ -35,6 +35,7 @@
 import com.apple.jobjc.PrimitiveCoder.SIntCoder;
 import com.apple.jobjc.PrimitiveCoder.SLongLongCoder;
 import com.apple.jobjc.PrimitiveCoder.SShortCoder;
+import javax.tools.annotation.GenerateNativeHeader;
 
 public abstract class Coder<T> {
     private static native long getNativeFFITypePtrForCode(final int code);
@@ -142,6 +143,8 @@
 
     //
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class VoidCoder extends Coder<Object>{
         public static final VoidCoder INST = new VoidCoder();
         public VoidCoder(){ super(FFI_VOID, "v", Void.class, void.class); }
@@ -150,6 +153,8 @@
         @Override public void push(JObjCRuntime runtime, long addr, Object x) { throw new RuntimeException("Trying to push a Void."); }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class UnknownCoder extends Coder<Object> {
         public static final UnknownCoder INST = new UnknownCoder();
         public UnknownCoder(){ super(-1, "?", null, null); }
@@ -158,6 +163,8 @@
         @Override public Object pop(JObjCRuntime runtime, long addr) { throw new RuntimeException("Coder not implemented"); }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class PrimitivePointerCoder extends Coder<Long> {
         public static final PrimitivePointerCoder INST = new PrimitivePointerCoder();
         public PrimitivePointerCoder(){ super(Coder.FFI_PTR, "^?", Long.class, long.class); }
@@ -187,6 +194,8 @@
         @Override public void push(JObjCRuntime runtime, long addr, Long x) { push(runtime, addr, (long) x); }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class PointerCoder extends Coder<Pointer> {
         public static final PointerCoder INST = new PointerCoder();
         public PointerCoder(){ super(FFI_PTR, "^?", Pointer.class); }
@@ -200,6 +209,8 @@
         }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class SELCoder extends Coder<SEL> {
         public static final SELCoder INST = new SELCoder();
         public SELCoder(){ super(FFI_PTR, ":", SEL.class); }
@@ -213,6 +224,8 @@
         }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static abstract class StructCoder extends Coder<Struct> {
         private final FFIType ffiType;
         final int sizeof;
@@ -254,6 +267,8 @@
         }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class IDCoder extends Coder<ID>{
         public static final IDCoder INST = new IDCoder();
         public IDCoder(){ super(FFI_PTR, "@", ID.class); }
@@ -272,6 +287,8 @@
         }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class NSClassCoder extends Coder<NSClass>{
         public static final NSClassCoder INST = new NSClassCoder();
         public NSClassCoder(){ super(FFI_PTR, "#", NSClass.class); }
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/FFIType.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/FFIType.java	Tue Jul 03 16:01:59 2012 -0700
@@ -26,6 +26,10 @@
 
 import com.apple.jobjc.Coder.PrimitivePointerCoder;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 class FFIType{
     private static native void makeFFIType(long ffi_type_buf, long elements_buf);
     private static native int  getFFITypeSizeof();
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Function.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Function.java	Tue Jul 03 16:01:59 2012 -0700
@@ -24,6 +24,10 @@
  */
 package com.apple.jobjc;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class Function {
     private static native long getFxnPtrForFunctionName(final String functionName);
     private static native long getFxnPtrForFunctionNameAndLib(final long libPtr, final String functionName);
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/ID.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/ID.java	Tue Jul 03 16:01:59 2012 -0700
@@ -29,6 +29,10 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class ID extends Pointer<Void>{
     static native String getNativeDescription(final long objPtr);
 
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Invoke.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Invoke.java	Tue Jul 03 16:01:59 2012 -0700
@@ -30,12 +30,18 @@
 import com.apple.jobjc.Coder.SELCoder;
 import com.apple.jobjc.Coder.StructCoder;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public abstract class Invoke {
     public abstract void invoke(NativeArgumentBuffer argBuf);
     public abstract void invoke(NativeArgumentBuffer buffer, Struct retvalStruct);
 
     //
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class FunCall extends Invoke{
         static native void invoke(long cifPtr, long fxnPtr, long retValPtr, long argsPtr);
 
@@ -72,6 +78,8 @@
         }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class MsgSend extends Invoke{
         static{ System.load("/usr/lib/libobjc.dylib"); }
 
@@ -157,6 +165,8 @@
         }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static final class MsgSendSuper extends Invoke{
         static{ System.load("/usr/lib/libobjc.dylib"); }
 
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/JObjCRuntime.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/JObjCRuntime.java	Tue Jul 03 16:01:59 2012 -0700
@@ -31,10 +31,16 @@
 
 import sun.misc.Unsafe;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public final class JObjCRuntime {
     static { System.loadLibrary("JObjC"); }
 
+    @GenerateNativeHeader
     public static enum Arch{ ppc, i386, x86_64 };
+    @GenerateNativeHeader
     public static enum Width{ W32, W64 };
 
     public static final Arch ARCH = getArch();
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/MacOSXFramework.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/MacOSXFramework.java	Tue Jul 03 16:01:59 2012 -0700
@@ -25,6 +25,10 @@
 package com.apple.jobjc;
 
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class MacOSXFramework {
     private static native long retainFramework(final String frameworkName);
     private static native void releaseFramework(final long frameworkPtr);
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NSClass.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NSClass.java	Tue Jul 03 16:01:59 2012 -0700
@@ -27,7 +27,13 @@
 import java.lang.ref.WeakReference;
 import java.lang.reflect.Constructor;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class NSClass<T extends ID> extends ID {
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static class NSClassNotFoundException extends RuntimeException{
         public NSClassNotFoundException(String m){ super(m); }
         public NSClassNotFoundException(String m, Throwable cause){ super(m, cause); }
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeArgumentBuffer.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeArgumentBuffer.java	Tue Jul 03 16:01:59 2012 -0700
@@ -28,6 +28,10 @@
 
 import com.apple.jobjc.Coder.PrimitivePointerCoder;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public final class NativeArgumentBuffer{
     private static final ThreadLocal<NativeArgumentBuffer> threadLocal = new ThreadLocal<NativeArgumentBuffer>();
 
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeBuffer.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeBuffer.java	Tue Jul 03 16:01:59 2012 -0700
@@ -27,9 +27,13 @@
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
 /**
  * A wrapper around a direct ByteBuffer and its native pointer. For documentation, @see java.nio.ByteBuffer
  */
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class NativeBuffer {
     static native long getPtrOfBuffer(final ByteBuffer byteBuffer);
 
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeObjectLifecycleManager.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/NativeObjectLifecycleManager.java	Tue Jul 03 16:01:59 2012 -0700
@@ -24,6 +24,10 @@
  */
 package com.apple.jobjc;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public abstract class NativeObjectLifecycleManager {
     private static native void retainNativeObject(final long ptr);
     private static native void releaseNativeObject(final long ptr);
@@ -33,6 +37,8 @@
     abstract void end(final long ptr);
     boolean shouldPreRetain() { return false; }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static class CFRetainRelease extends NativeObjectLifecycleManager {
         public static final NativeObjectLifecycleManager INST = new CFRetainRelease();
         @Override void begin(final long ptr) { retainNativeObject(ptr); }
@@ -40,12 +46,16 @@
         @Override boolean shouldPreRetain() { return true; }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static class Free extends NativeObjectLifecycleManager {
         public static final NativeObjectLifecycleManager INST = new Free();
         @Override void begin(final long ptr) { }
         @Override void end(final long ptr) { freeNativeObject(ptr); }
     }
 
+    /* No native methods here, but the constants are needed in the supporting JNI code */
+    @GenerateNativeHeader
     public static class Nothing extends NativeObjectLifecycleManager {
         public static final NativeObjectLifecycleManager INST = new Nothing();
         @Override void begin(final long ptr) { }
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Opaque.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Opaque.java	Tue Jul 03 16:01:59 2012 -0700
@@ -24,6 +24,10 @@
  */
 package com.apple.jobjc;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class Opaque extends Pointer<Void> {
     protected Opaque(long ptr) { super(ptr); }
     protected Opaque(Pointer<?> ptr) { super(ptr.ptr); }
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Pointer.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Pointer.java	Tue Jul 03 16:01:59 2012 -0700
@@ -24,6 +24,10 @@
  */
 package com.apple.jobjc;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class Pointer <T> implements Comparable<Pointer<T>>{
     long ptr;
 
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/PrimitiveCoder.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/PrimitiveCoder.java	Tue Jul 03 16:01:59 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011,2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,11 @@
  */
 package com.apple.jobjc;
 import com.apple.jobjc.JObjCRuntime.Width;
+import javax.tools.annotation.GenerateNativeHeader;
 // Auto generated by PrimitiveCoder.hs
 // Do not edit by hand.
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public abstract class PrimitiveCoder<T> extends Coder<T>{
     public PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){
         super(ffiTypeCode, objCEncoding, jclass, jprim);
@@ -127,6 +130,8 @@
 
 
 // native BOOL -> java boolean
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class BoolCoder extends PrimitiveCoder<Boolean>{
     public static final BoolCoder INST = new BoolCoder();
     public BoolCoder(){ super(FFI_SINT8, "B", Boolean.class, boolean.class); }
@@ -170,6 +175,8 @@
 }
 
 // native schar -> java byte
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class SCharCoder extends PrimitiveCoder<Byte>{
     public static final SCharCoder INST = new SCharCoder();
     public SCharCoder(){ super(FFI_SINT8, "c", Byte.class, byte.class); }
@@ -213,6 +220,8 @@
 }
 
 // native uchar -> java byte
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class UCharCoder extends PrimitiveCoder<Byte>{
     public static final UCharCoder INST = new UCharCoder();
     public UCharCoder(){ super(FFI_UINT8, "C", Byte.class, byte.class); }
@@ -256,6 +265,8 @@
 }
 
 // native sshort -> java short
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class SShortCoder extends PrimitiveCoder<Short>{
     public static final SShortCoder INST = new SShortCoder();
     public SShortCoder(){ super(FFI_SINT16, "s", Short.class, short.class); }
@@ -299,6 +310,8 @@
 }
 
 // native ushort -> java short
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class UShortCoder extends PrimitiveCoder<Short>{
     public static final UShortCoder INST = new UShortCoder();
     public UShortCoder(){ super(FFI_UINT16, "S", Short.class, short.class); }
@@ -342,6 +355,8 @@
 }
 
 // native sint -> java int
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class SIntCoder extends PrimitiveCoder<Integer>{
     public static final SIntCoder INST = new SIntCoder();
     public SIntCoder(){ super(FFI_SINT32, "i", Integer.class, int.class); }
@@ -385,6 +400,8 @@
 }
 
 // native uint -> java int
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class UIntCoder extends PrimitiveCoder<Integer>{
     public static final UIntCoder INST = new UIntCoder();
     public UIntCoder(){ super(FFI_UINT32, "I", Integer.class, int.class); }
@@ -428,6 +445,8 @@
 }
 
 // native slong -> java long
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class SLongCoder extends PrimitiveCoder<Long>{
     public static final SLongCoder INST = new SLongCoder();
     public SLongCoder(){ super((JObjCRuntime.IS64 ? (FFI_SINT64) : (FFI_SINT32)), "l", Long.class, long.class); }
@@ -477,6 +496,8 @@
 }
 
 // native ulong -> java long
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class ULongCoder extends PrimitiveCoder<Long>{
     public static final ULongCoder INST = new ULongCoder();
     public ULongCoder(){ super((JObjCRuntime.IS64 ? (FFI_UINT64) : (FFI_UINT32)), "L", Long.class, long.class); }
@@ -526,6 +547,8 @@
 }
 
 // native slonglong -> java long
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class SLongLongCoder extends PrimitiveCoder<Long>{
     public static final SLongLongCoder INST = new SLongLongCoder();
     public SLongLongCoder(){ super(FFI_SINT64, "q", Long.class, long.class); }
@@ -569,6 +592,8 @@
 }
 
 // native ulonglong -> java long
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class ULongLongCoder extends PrimitiveCoder<Long>{
     public static final ULongLongCoder INST = new ULongLongCoder();
     public ULongLongCoder(){ super(FFI_UINT64, "Q", Long.class, long.class); }
@@ -612,6 +637,8 @@
 }
 
 // native float -> java float
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class FloatCoder extends PrimitiveCoder<Float>{
     public static final FloatCoder INST = new FloatCoder();
     public FloatCoder(){ super(FFI_FLOAT, "f", Float.class, float.class); }
@@ -655,6 +682,8 @@
 }
 
 // native double -> java double
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public static final class DoubleCoder extends PrimitiveCoder<Double>{
     public static final DoubleCoder INST = new DoubleCoder();
     public DoubleCoder(){ super(FFI_DOUBLE, "d", Double.class, double.class); }
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/SEL.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/SEL.java	Tue Jul 03 16:01:59 2012 -0700
@@ -24,6 +24,10 @@
  */
 package com.apple.jobjc;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public class SEL {
     static native long getSelectorPtr(String selectorName);
     static native String getSelectorName(long ptr);
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Struct.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Struct.java	Tue Jul 03 16:01:59 2012 -0700
@@ -24,9 +24,13 @@
  */
 package com.apple.jobjc;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
 /**
  * A struct is malloced on the C heap and accessed in Java through a ByteBuffer.
  */
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 public abstract class Struct{
     protected final NativeBuffer raw;
     private final JObjCRuntime runtime;
--- a/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Subclassing.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/core/java/com/apple/jobjc/Subclassing.java	Tue Jul 03 16:01:59 2012 -0700
@@ -33,6 +33,10 @@
 import com.apple.jobjc.Coder.VoidCoder;
 import com.apple.jobjc.Invoke.MsgSend;
 
+import javax.tools.annotation.GenerateNativeHeader;
+
+/* No native methods here, but the constants are needed in the supporting JNI code */
+@GenerateNativeHeader
 final class Subclassing {
     static native long allocateClassPair(long superClass, String name);
     static native boolean addIVarForJObj(long clazz);
--- a/jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/FrameworkClassFile.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/classes/FrameworkClassFile.java	Tue Jul 03 16:01:59 2012 -0700
@@ -28,6 +28,7 @@
 import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.TreeSet;
 
 import com.apple.internal.jobjc.generator.FunctionGenerator;
 import com.apple.internal.jobjc.generator.Utils;
@@ -130,7 +131,11 @@
             }
         }
 
-        for (final Clazz clazz : framework.classes) {
+        /**
+         * Order classes to get stable output
+         */
+        TreeSet<Clazz> sortedClasses = new TreeSet<Clazz>(framework.classes);
+        for (final Clazz clazz : sortedClasses) {
             final String classClassName = clazz.name + "Class";
             out.println(JavaLang.makeSingleton("_" + classClassName, clazz.name, classClassName, "getRuntime()"));
         }
--- a/jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Clazz.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/Clazz.java	Tue Jul 03 16:01:59 2012 -0700
@@ -147,4 +147,8 @@
 
         return null;
     }
+
+    int compareTo(Clazz o) {
+      return toString().compareTo(o.toString());
+    }
 }
--- a/jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/ComplexCoderDescriptor.java	Tue Jul 03 11:45:34 2012 -0700
+++ b/jdk/src/macosx/native/jobjc/src/generator/java/com/apple/internal/jobjc/generator/model/coders/ComplexCoderDescriptor.java	Tue Jul 03 16:01:59 2012 -0700
@@ -25,7 +25,7 @@
 package com.apple.internal.jobjc.generator.model.coders;
 
 import java.util.HashMap;
-import java.util.HashSet;
+import java.util.TreeSet;
 import java.util.Map;
 import java.util.Set;
 
@@ -40,7 +40,7 @@
  */
 public class ComplexCoderDescriptor extends CoderDescriptor {
     static Map<Pair<NType,NType>, ComplexCoderDescriptor> cache = new HashMap<Pair<NType,NType>, ComplexCoderDescriptor>();
-    static Set<MixedEncodingDescriptor> mixedEncodingDescriptors = new HashSet<MixedEncodingDescriptor>();
+    static Set<MixedEncodingDescriptor> mixedEncodingDescriptors = new TreeSet<MixedEncodingDescriptor>();
 
     public static Set<MixedEncodingDescriptor> getMixedEncoders() { return mixedEncodingDescriptors; }
 
@@ -76,7 +76,7 @@
     // ** Subclasses
     // -------------
 
-    public static class MixedEncodingDescriptor extends ComplexCoderDescriptor {
+    public static class MixedEncodingDescriptor extends ComplexCoderDescriptor implements java.lang.Comparable {
         protected final PrimitiveCoderDescriptor desc32;
 
         public MixedEncodingDescriptor(final PrimitiveCoderDescriptor desc32, final PrimitiveCoderDescriptor desc64) {
@@ -97,5 +97,6 @@
         }
 
         static String getBaseNameOfCoder(final String coderName) { return coderName.substring(0, coderName.indexOf("Coder")); }
+        public int compareTo(Object _o) { MixedEncodingDescriptor o = (MixedEncodingDescriptor)_o; return getMixedName().compareTo(o.getMixedName()); }
     }
 }