Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6948 closed enhancement (fixed)

Java bindings : add a target to main makefile.vc

Reported by: bugbuster Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 2.2.0
Severity: normal Keywords:
Cc:

Description

This patch adds two targets to the main makefile.vc (for Windows) in order to compile Java bindings :

  • java
  • java_install

Attachments (2)

diff_makefile.patch (1.5 KB ) - added by bugbuster 7 years ago.
git_diff_bindings.patch (4.1 KB ) - added by bugbuster 7 years ago.

Download all attachments as: .zip

Change History (8)

by bugbuster, 7 years ago

Attachment: diff_makefile.patch added

comment:1 by Even Rouault, 7 years ago

Do we really need those 2 steps :

$(INSTALL)    *.java $(GDAL_HOME)\java\src
$(INSTALL) /e org    "$(GDAL_HOME)\java\src\org\"

The .java files in swig/java are just used as templates to build the javadoc. And the content of swig/java/org is compressed in gdal.jar ultimately

Regarding the top level makefile.vc and swig/makefile.vc, I think what could be nice instead of having Java specific stuff there, is to have a "bindings" and "install-bindings" target that would use a BINDINGS variable that would be set in nmake.opt / nmake.local and could list the various languages to build.

comment:2 by bugbuster, 7 years ago

About your 1st comment: you may be right. I just used the target we have been using on our project for a while. And I am not a Java specialist :-/

About your 2nd comment: you are definitely right. I was just not able to test other bindings in my Windows configuration (Windows 8 64 bits, Visual C++ 2015 64 bits)

Just to mention it, I have tried to compile the python bindings. It took me some time to find out a python installation which is compatible with my compiler (see http://p-nand-q.com/python/building-python-27-with-visual_studio.html). Furthermore, I do not know exactly what should be "installed" for python bindings.

comment:3 by Even Rouault, 7 years ago

I don't necessarily request that you make the job for other bindings, but at least some "framework" so that it can potentially be used for others.

Normally for Python, "$(PYDIR)\python.exe setup.py install" (after the build) should be sufficient. Possibly with a --prefix= switch to avoid installing directly in the directory of the Python installation.

comment:4 by bugbuster, 7 years ago

I have completed the proposed patch :

  • nmake.opt : new variable BINDINGS for the list of bindings we want to generate,
  • makefile.vc : three new targets bindings, bindings_install and bindings_clean,
  • swig/makefile.vc : three new targets python_install, csharp_installand java_install,
  • swig/java/makefile.vc : new target ìnstall.

Note : I have only tested javaand python targets

by bugbuster, 7 years ago

Attachment: git_diff_bindings.patch added

comment:5 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 39499:

Windows makefiles: add new targets bindings, bindings_install and bindings_clean that depend on the new BINDINGS option in nmake.opt (patch by Phillipe Ghesquiere, fixes #6948)

comment:6 by Even Rouault, 7 years ago

I've applied your patch in trunk r39499 with just commenting out BINDINGS, so that people redefine it in their nmake.local with appropriate values. Thanks !

Note: See TracTickets for help on using tickets.