[mapserver-commits] r13166 - trunk/mapserver/mapscript/java

svn at osgeo.org svn at osgeo.org
Thu Feb 23 08:31:33 EST 2012


Author: unicoletti
Date: 2012-02-23 05:31:33 -0800 (Thu, 23 Feb 2012)
New Revision: 13166

Modified:
   trunk/mapserver/mapscript/java/Makefile.in
   trunk/mapserver/mapscript/java/README
   trunk/mapserver/mapscript/java/javamodule.i
   trunk/mapserver/mapscript/java/makefile.vc
Log:
rename java mapscript shared library (#2595) and add a make install target

Modified: trunk/mapserver/mapscript/java/Makefile.in
===================================================================
--- trunk/mapserver/mapscript/java/Makefile.in	2012-02-23 12:48:30 UTC (rev 13165)
+++ trunk/mapserver/mapscript/java/Makefile.in	2012-02-23 13:31:33 UTC (rev 13166)
@@ -43,27 +43,30 @@
 .SUFFIXES:
 .SUFFIXES: .cpp .c .$(OBJ_SUFFIX)
 
-all: mapscript.jar
+all: javamapscript.jar
 
-libmapscript.la: mapscript_wrap.lo $(MS_LIB)
-	$(LINK) -o $@ mapscript_wrap.lo $(MS_LIB)
+libjavamapscript.la: javamapscript_wrap.lo $(MS_LIB)
+	$(LINK) -o $@ javamapscript_wrap.lo $(MS_LIB)
 
 %.lo: %.c
 	$(LTCC) $(CC) -fno-strict-aliasing -fpic -c $(CFLAGS) $(JAVA_INCLUDE) -c -o $@ $<
 
-mapscript_wrap.c: ../mapscript.i
+javamapscript_wrap.c: ../mapscript.i
 	mkdir -p edu/umn/gis/mapscript 
-	$(SWIG) -java -package edu.umn.gis.mapscript $(DEFINES) -outdir edu/umn/gis/mapscript -o mapscript_wrap.c ../mapscript.i
+	$(SWIG) -java -package edu.umn.gis.mapscript $(DEFINES) -outdir edu/umn/gis/mapscript -o javamapscript_wrap.c ../mapscript.i
 
-mapscript_java: mapscript_wrap.c
+javamapscript_java: javamapscript_wrap.c
 	$(JAVAC) edu/umn/gis/mapscript/*.java
 
-mapscript_javadoc: mapscript_wrap.c
+mapscript_javadoc: javamapscript_wrap.c
 	$(JAVADOC) -d doc -sourcepath edu/umn/gis/mapscript/*.java
 
-mapscript.jar: mapscript_java libmapscript.la
+javamapscript.jar: javamapscript_java libjavamapscript.la
 	$(JAR) cf mapscript.jar edu
 
+install: mapscript.jar
+	$(LTINSTALL) $(INSTALL) libjavamapscript.la $(DESTDIR)$(libdir)
+
 clean:
 	-rm -rf .libs *.lo *.la *.so *.o pygdioctx/*.o pygdioctx/*.lo
 	rm -rf edu *.o *.c *. at SO_EXT@ *.java *.jar *.png
@@ -76,18 +79,18 @@
 test:
 	$(JAVAC) -classpath ./:examples/:./mapscript.jar -d examples/ examples/RFC24.java examples/ConnPool.java examples/DrawMap.java examples/DumpShp.java examples/MakePoint.java examples/QueryByAttribute.java examples/ShapeInfo.java examples/WxSTest.java examples/Metadata.java examples/RunTimeBuiltWMSClient.java
 	$(JAVAC) -encoding utf8 -classpath ./:examples/:./mapscript.jar -d examples/ examples/QueryByAttributeUnicode.java 
-	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. DumpShp ../../tests/point.shp
-	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. ShapeInfo ../../tests/point.shp ../../tests/point.dbf
-	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. DrawMap ../../tests/test.map ./map.png
-	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. ConnPool
-	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. QueryByAttribute ../../tests/test.map
+	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ DumpShp ../../tests/point.shp
+	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ ShapeInfo ../../tests/point.shp ../../tests/point.dbf
+	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ DrawMap ../../tests/test.map ./map.png
+	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ ConnPool
+	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ QueryByAttribute ../../tests/test.map
 ifneq ($(findstring USE_WCS_SVR, $(DEFINES)),)
-	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. WxSTest ../../tests/test.map
+	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ WxSTest ../../tests/test.map
 else
 	@echo "WARN: Skipping WxSTest because OWS is not enabled"
 endif
-	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. RFC24 ../../tests/test.map
-	LC_ALL=en_US.UTF-8 $(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=. QueryByAttributeUnicode data/subset-umlauts.map
+	$(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ RFC24 ../../tests/test.map
+	LC_ALL=en_US.UTF-8 $(JAVA) -classpath ./:examples/:./mapscript.jar -Djava.library.path=.libs/ QueryByAttributeUnicode data/subset-umlauts.map
 else
 test:
 	@echo "To run the tests GDAL and PROJ must be enabled"

Modified: trunk/mapserver/mapscript/java/README
===================================================================
--- trunk/mapserver/mapscript/java/README	2012-02-23 12:48:30 UTC (rev 13165)
+++ trunk/mapserver/mapscript/java/README	2012-02-23 13:31:33 UTC (rev 13166)
@@ -1,18 +1,14 @@
 Java mapscript
 ==============
 
-Before you begin, the JAVA_HOME environment variable must be properly set
-and the Java programs "java" and "javac" must be on your path.
+WARNING: Starting with version 6.1 Mapserver (and Mapscript) uses libtool to build
+the shared libraries. Some files have changed names and the javamapscript.so shared
+library now depends on libmapserver.so.
+The easiest way way to handle the dependency is to simply use the 'make install'
+target.
 
 To generate the SWIG wrappers you need swig > 1.3.24.
 
-+----------------------------------------------------------------------------+
-| IMPORTANT API CHANGE: swig 1.3.24 introduced a new way of wrapping         |
-| enumerations in Java which breaks compatibility with the mapscript         |
-| generated by previous versions of swig.                                    |
-| This will change again in the next major version of mapserver (version 5). |
-+----------------------------------------------------------------------------+
-
 MAPSCRIPT Reference
 -------------------
 
@@ -32,7 +28,7 @@
 Nevertheless it is recommended that you generate your own using the "interface"
 target in the Java Makefile.
 
-Requires swig > 1.3.24. Version 1.3.28 or 1.3.29 are recommended.
+Requires swig > 1.3.24. Version above 1.3.28 or 1.3.29 are recommended.
 
 Installation
 ------------
@@ -41,16 +37,17 @@
 mapscript location and execute:
 
     $ cd mapscript/java
-    $ make interface
     $ make
-    $ make test (optional)
+    $ make test (recommended)
     $ make threadtests (optional)
+    $ make install (recommended)
 
-The 'make interface' step is optional, but strongly recommended, see 'SWIG Wrappers'
-above for the details.
+Copy .libs/libmapscript.so and mapscript.jar to the appropriate location or
+use let make install install them in the configured location (defaults to
+/urs/local/lib).
+Remember to set the appropriate variable (LD_LIBRARY_PATH, java.library.path
+or edit /etc/ld.so.conf) to make sure Java can locate and load the libraries.
 
-Copy libmapscript.so and mapscript.jar to the appropriate location.
-
 Windows
 -------
 

Modified: trunk/mapserver/mapscript/java/javamodule.i
===================================================================
--- trunk/mapserver/mapscript/java/javamodule.i	2012-02-23 12:48:30 UTC (rev 13165)
+++ trunk/mapserver/mapscript/java/javamodule.i	2012-02-23 13:31:33 UTC (rev 13166)
@@ -9,7 +9,7 @@
 
 %pragma(java) jniclasscode=%{
     static {
-        String  library = System.getProperty("mapserver.library.name", "mapscript");
+        String  library = System.getProperty("mapserver.library.name", "javamapscript");
 
         System.loadLibrary(library);
         /* TODO Throw when return value not MS_SUCCESS? */

Modified: trunk/mapserver/mapscript/java/makefile.vc
===================================================================
--- trunk/mapserver/mapscript/java/makefile.vc	2012-02-23 12:48:30 UTC (rev 13165)
+++ trunk/mapserver/mapscript/java/makefile.vc	2012-02-23 13:31:33 UTC (rev 13166)
@@ -22,7 +22,7 @@
 CC=     cl /MD
 LINK=   link
 
-MS_DLL = mapscript.dll
+MS_DLL = javamapscript.dll
 
 LDFLAGS =	/NODEFAULTLIB:"MSVCRTD" /NODEFAULTLIB:libcd /NODEFAULTLIB:libcmtd /NODEFAULTLIB:msvcrtd /NODEFAULTLIB:LIBC /DEBUG
 



More information about the mapserver-commits mailing list