From 2d36ca0815fe86557ca3768afcb89bf9aab1693e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 14 May 2010 04:02:41 +0200 Subject: Fix build HOWTO --- doc/HowToBuild.html | 188 +++++++++++++++++++++++++++++++++++----------------- make/build-jogl.xml | 8 +-- 2 files changed, 130 insertions(+), 66 deletions(-) diff --git a/doc/HowToBuild.html b/doc/HowToBuild.html index f0b381d74..ede11653a 100644 --- a/doc/HowToBuild.html +++ b/doc/HowToBuild.html @@ -1,51 +1,114 @@ + -How to build the JOGL OpenGL binding for Java +How to build the JOGL OpenGL binding for Java on the Desktop -

How to build the JOGL OpenGL binding for Java

+

How to build the JOGL OpenGL binding for Java on the Desktop


+The embedded device HOWTO will reside in its own documentation soon. +

Platform and Component Requirements

+

+Here is a list of platforms and components, we were able to build JOGL on,
+if not stated otherwise.
-The following are the supported build environments and -platforms for JOGL. All require the ANTLR parser generator and the Ant build system version 1.6 or -later to be installed.

-

@@ -55,51 +118,51 @@ build system, but are not officially supported.

+

Build Steps

+

-Here are the steps that are required in order to build the JOGL OpenGL -binding from a fresh copy of the source distribution, which can be -obtained either from -GIT or an -archived build. +Here are the steps that are required in order to build JOGL.

-JOGL depends on our GlueGen project, which can be optained either from -GIT or an -archived build. -

    -
  1. Install the JDK:
    the JOGL build requires JDK 1.4.2 or later. On AMD64 platforms such as Linux/AMD64, Solaris/AMD64 and Windows/AMD64, the build requires the Sun JDK 5.0 or later, as the 1.4.2 releases did not have an AMD64-specific JVM. On these platforms, it is also currently necessary to have e.g. bin/amd64/java in your PATH, although from a technical standpoint this could be worked around in the build process. -
  2. Install Ant:
    Download and unpack the latest version of Ant from http://ant.apache.org and add the bin/ subdirectory to your PATH environment variable. -
  3. Install ANTLR:
    Download and unpack the latest version of ANTLR from http://www.antlr.org. Only the jar file is needed. - -
  4. Unset your CLASSPATH environment variable:
    The Ant build requires that the JOGL jars not be visible on the classpath. On Unix, type unsetenv CLASSPATH into a csh or tcsh shell, or unset CLASSPATH into a Bourne shell. On Windows, type set CLASSPATH= into a command prompt. - -
  5. Check out the GlueGen source tree:
    JOGL relies on the GlueGen project to autogenerate most of the Java and JNI code for the OpenGL interface. The jogl/ and gluegen/ workspaces must be side-by-side in order for JOGL to build properly. - -
  6. Copy and edit gluegen.properties:
    - Copy make/gluegen.properties from the GlueGen workspace into your home directory (pointed to by the Java system property user.home).
    - Edit the copy to change the location of the ANTLR jar file (typically $HOME/antlr-2.7.2/antlr.jar). - -
  7. Copy and edit jogl.properties:
    - Copy make/jogl.properties into your home directory (pointed to by the Java system property user.home).
    - Edit the copy to change any settings that are necessary, in particular the setting of win32.c.compiler on Windows platforms (one of "vc6", "vc7", "vc8", "vc8_x64", or "mingw"). Note that on Windows 64-bit platforms the Professional edition of the Microsoft compilers is required. -
      -
    • The Windows build requires one of Microsoft Visual C++ 6, 7 (Visual Studio .NET), 8 (Microsoft Visual C++ 2005) or the free MinGW (http://www.mingw.org/) compilers to be installed. Choose the appropriate setting of win32.c.compiler for the compiler being used. The C compiler executable (cl.exe, gcc.exe) must be in your PATH; see below. -
    • When building with VC6, VC7, or VC8, you must first run the vcvars32.bat environment variable setup script from the appropriate version of Visual C++. The Windows C compiler you choose in jogl.properties (i.e., win32.c.compiler=vc6) must match the version of the compiler from which you executed vcvars32.bat. No error checking is done on the compiler version used, so please be careful. -
    - -
  8. Build the source tree:
    Open a command shell in the "make" directory of the source tree and type "ant". +
  9. Optain the source code using git: +
    + It is crucial that you checkout the source code under a common root directory: +
    +        /home/dude/projects/jogamp> git clone git://github.com/sgothel/gluegen.git  gluegen
    +        /home/dude/projects/jogamp> git clone git://github.com/sgothel/jogl.git jogl 
    +    
    + Now you should have following directory structure: +
    +        /home/dude/projects/jogamp
    +        /home/dude/projects/jogamp/gluegen
    +        /home/dude/projects/jogamp/jogl
    +    
  10. + +
  11. Unset your CLASSPATH environment variable:
    The Ant build requires that the JOGL jars not be visible on the classpath. On Unix, type unsetenv CLASSPATH into a csh or tcsh shell, or unset CLASSPATH into a Bourne shell. On Windows, type set CLASSPATH= into a command prompt.
  12. + +
  13. Optional Copy and edit gluegen.properties:
    + To specify different basic options for components and compilers,
    + copy gluegen/make/gluegen.properties into your home directory (pointed to by the Java system property user.home).
  14. + +
  15. Optional Copy and edit jogl.properties:
    + To specify different basic options for the build,
    + copy jogl/make/jogl.properties into your home directory (pointed to by the Java system property user.home).
    + Edit the copy to change desired settings.
  16. + +
  17. Build the source tree:
    Open a command shell in the "jogl/make" directory of the source tree and type "ant".
      -
    • An experimental binding to the high-level Cg language by NVidia corporation can be generated by specifying -Djogl.cg=1 to ant; e.g. ant -Djogl.cg=1. The Cg binding has been tested on Windows, Linux, and Mac OS X. -
    +
  18. An experimental binding to the high-level Cg language by NVidia corporation can be generated by specifying -Djogl.cg=1 to ant; e.g. ant -Djogl.cg=1. The Cg binding has been tested on Windows, Linux, and Mac OS X.
  19. + -
  20. Add JOGL and the GlueGen runtime to your CLASSPATH:
    To be able to use JOGL once built, you must add the build process' resulting jogl.jar (.../jogl/build/jogl.jar) and gluegen-rt.jar (.../gluegen/build/gluegen-rt.jar) to your CLASSPATH environment variable. -
  21. Add JOGL and the GlueGen runtime to your PATH, LD_LIBRARY_PATH, or DYLD_LIBRARY_PATH:
    To be able to use JOGL once built, you must also add the build process's JNI code library directories (.../jogl/build/obj and .../gluegen/build/obj) to your PATH (on Windows), LD_LIBRARY_PATH (on most Unix platforms), or DYLD_LIBRARY_PATH (on Mac OS X) environment variable. +
  22. Test your build:
    Stay in your command shell in the "jogl/make" directory of the source tree and type "ant junit.run".
  23. -
  24. Test if everything's working:
    To test if everything went well, you should check out the source code for the jogl-demos project (available at http://download.java.net/media/jogl/demos/www/), build the demos using the supplied instructions, and run the Gears demo ("java demos.gears.Gears"). -
  25. Build Javadoc:
    "ant javadoc" will produce the end-user documentation for JOGL along with some auxiliary utility packages. The developers' documentation, including that for the GlueGen tool, can be generated for your current platform using one of the following commands: "ant javadoc.dev.win32", "ant javadoc.dev.x11", or "ant javadoc.dev.macosx". (The javadoc for the Cg binding can be built by inserting -Djogl.cg=1 into the command line as above.) +
  26. Build Javadoc:
    Stay in your command shell in the "jogl/make" directory of the source tree and type "ant javadoc". This will produce the end-user documentation for JOGL along with some auxiliary utility packages.
Note that there are a lot of warnings produced by ANTLR about the @@ -128,7 +191,8 @@ directory of the JRE/JDK. On Windows and Linux, delete any ANTLR jars from jre/l -- Christopher Kline and Kenneth Russell, June 2003 (revised November 2006) +- Christopher Kline and Kenneth Russell, June 2003 (revised November 2006)
+- Sven Gothel, May 2010
diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 6c0755f8e..960b3f1fa 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -18,7 +18,7 @@ - be run from the "make" directory. - - Public targets: - - all: (default; autodetects OS and chooses C compiler from jogl.properties) + - all: (default; autodetects OS and chooses C compiler from gluegen.properties) - clean: clean all built - javadoc: create the standard developer Javadoc (recommended) - (Note: should build all first - may be dependence in the future) @@ -28,11 +28,11 @@ - to create the Javadoc for the platform on which you are - currently running. - - - Note: on Windows the "win32.c.compiler" property in jogl.properties + - Note: on Windows the "win32.c.compiler" property in gluegen.properties - is required to select the appropriate C compiler. See the example - - jogl.properties in this directory for valid values. On Mac OS X + - gluegen.properties in this directory for valid values. On Mac OS X - universal binaries may also be built by setting the "macosxfat" - - property in jogl.properties; again see the example file in this + - property in gluegen.properties; again see the example file in this - directory. - - Optional properties: -- cgit v1.2.3