Next: 4.1 Compiling ready-to-use wrappers Up: Manual Previous: 3.4 Advanced Topics

# 4. Wrapping Objective-C Libraries

In this chapter we are going to learn how to use JIGS to expose an existing Objective-C library to Java. Technically, we call this procedure wrapping the library.

## 4.0.1 Historical Notes

Building java wrappers for an objective-C library in JIGS used to be strongly coupled with building the library itself. Starting with JIGS 1.4.0, the wrapping mechanism has been redesigned to be totally independent from the original library: building the objective-C library and building the java wrappers for it are now totally independent processes. You can now build the objective-C library, install it, and only later on create java wrappers for the library. You can also easily wrap objective-c libraries which you got in binary form (as soon as you have the header files from them).

You can still build wrappers in the old way by including

    old-java-wrapper.make

rather than `java-wrapper.make`. But please - whenever possible - use the new - much better - way, and please update any old wrapper to the new design. In this manual, we only document the new design. The old backward compatibility code will be dropped at some point in the future.

Subsections

- - 4.0.1 Historical Notes
- 4.1 Compiling ready-to-use wrappers
  - 4.1.1 Creating and compiling the wrappers
  - 4.1.2 Structure of the wrappers
    - 4.1.2.1 The Java subdirectory
    - 4.1.2.2 The Objc subdirectory
- 4.2 The GNUmakefile for java wrappers
- 4.3 Specifying the main library header
- 4.4 Library header name
- 4.5 Library header location
  - 4.5.1 Special header flags
- 4.6 The wrapper directory
- 4.7 The .jigs File
  - 4.7.1 Determining which .jigs file to read
  - 4.7.2 Overview of the .jigs file
  - 4.7.3 The Classes section
    - 4.7.3.1 java name
    - 4.7.3.2 objective-c name
    - 4.7.3.3 initializers
    - 4.7.3.4 class methods
    - 4.7.3.5 instance methods
    - 4.7.3.6 method declarations
    - 4.7.3.7 hardcoded constants
    - 4.7.3.8 enumerations
    - 4.7.3.9 file to include in java code
    - 4.7.3.10 file to include in preamble java code
    - 4.7.3.11 file to include in objective-c code
  - 4.7.4 Method Name Mapping
  - 4.7.5 Prerequisite Libraries
  - 4.7.6 Types
- 4.8 Useful Make Options when Creating Wrappers
  - 4.8.1 Silencing the Wrapper Generator
  - 4.8.2 Enabling Debugging
  - 4.8.3 Turning off the Generation of Quick Reference Doc
- 4.9 Including Special Code in the Wrapper GNUmakefiles
  - 4.9.1 Finding the library
- 4.10 Controlling the Quick Reference Documentation
  - 4.10.1 Generating Documentation for Packages
  - 4.10.2 Installation Directory
- 4.11 Generating RPMs for the wrapper library

Next: 4.1 Compiling ready-to-use wrappers Up: Manual Previous: 3.4 Advanced Topics