X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=firmjni%2FREADME;h=1ebcdeafff2812c097e6fc8a1daca0dad9347326;hb=e5f718c34a60a13348086f4f5c2862ec9ff2e604;hp=f9be7230278e1909580350d92a912ec3bee633ab;hpb=731688b640632624bf9d77544654cd663c335364;p=libfirm diff --git a/firmjni/README b/firmjni/README index f9be72302..1ebcdeaff 100644 --- a/firmjni/README +++ b/firmjni/README @@ -1,26 +1,41 @@ +This directory contains tools to generate a Java Native Interface for +libfirm. -Call - sh build_firm_jni -to generate a Java native interface for firm. +The tools generate for each libfirm header file a Java class +containing native method calls and static fields. The native methods +are derived from the methods in the corresponding libfirm header. The +method names are generated by replacing all occurences of '_x' by 'X'. +(The libfirm headers may not contain method names that only differ by +capitalizing the letter after an underscore.) The static fields are +derived from the enumerators in libfirm. -This script still contains various IPD specific settings, -e.g. oaths to the header files needed for JNI. This will be changed -at some point. +The generator copies the comments from the header files to the Java +files. Sometimes it places the comments slightly wrong, i.e. a bit +too high or too low. As the comments are directly copied they refer +to the C names. -Generating the JNI requires various syntactic properties of the -header files that restrict legal C. +Generating the JNI requires various syntactic properties of the header +files that restrict legal C. These restrictions will be relaxed at +some point. -Do not use methods that generate a non null terminated String -from Idents (as idToStr). This will probably cause a segmentation -fault. +Do not use methods that accept or return function pointers. -Some methods generated might not work yet. Please report this to -goetz@ipd.info.uni-karlsruhe.de +Some other methods generated might not work yet. Please report this +to goetz@ipd.info.uni-karlsruhe.de. -For now _all_ enumerators are generated into _all_ classes. -This results from deficiencies in the crecoder and will be removed -at some place. +WARNING: + +For now _all_ enumerators are generated into _all_ classes. This +results from deficiencies in the crecoder and will be removed at some +place. Use only the enumerators defined in the corresponding c headers. E.g., irm_X is defined in irmode.h, so use Irmode.irm_X, but not Type.irm_X or any other definition in the java files. + +======================================================================== + +Call "make" in the build directory to generate the Java native +interface for firm. Call "make test" to test the interface. + +========================================================================