Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
ed6f4e33
Commit
ed6f4e33
authored
Mar 29, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(java): добился сборки и установки пакета
parent
4fc054de
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
111 additions
and
66 deletions
+111
-66
libuniset2.spec
conf/libuniset2.spec
+24
-4
configure.ac
configure.ac
+12
-1
UniSetDox.cfg.in
docs/UniSetDox.cfg.in
+1
-1
UniSetDoxDevel.cfg.in
docs/UniSetDoxDevel.cfg.in
+1
-1
MANIFEST.MF.in
wrappers/java/MANIFEST.MF.in
+12
-0
Makefile.am
wrappers/java/Makefile.am
+39
-43
UExceptions.i
wrappers/java/UExceptions.i
+3
-0
UModbus.i
wrappers/java/UModbus.i
+10
-11
mk-local.sh
wrappers/java/mk-local.sh
+3
-0
mk.sh
wrappers/java/mk.sh
+3
-2
runme_modbus.java
wrappers/java/runme_modbus.java
+3
-3
No files found.
conf/libuniset2.spec
View file @
ed6f4e33
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
%def_enable mysql
%def_enable mysql
%def_enable sqlite
%def_enable sqlite
%def_enable python
%def_enable python
%def_
dis
able java
%def_
en
able java
%def_enable rrd
%def_enable rrd
%def_enable io
%def_enable io
%def_enable logicproc
%def_enable logicproc
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
Name: libuniset2
Name: libuniset2
Version: 2.0
Version: 2.0
Release: alt23.
1
Release: alt23.
2
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
...
@@ -50,9 +50,11 @@ BuildRequires: librrd-devel
...
@@ -50,9 +50,11 @@ BuildRequires: librrd-devel
%if_enabled python
%if_enabled python
BuildRequires: python-devel
BuildRequires: python-devel
BuildRequires(pre): rpm-build-python
BuildRequires(pre): rpm-build-python
%endif
# swig
%if_enabled java
# add_findprov_lib_path %python_sitelibdir/%oname
BuildRequires(pre): rpm-build-java
# BuildRequires: jpackage-compat
%endif
%endif
%if_enabled docs
%if_enabled docs
...
@@ -99,6 +101,16 @@ Requires: %name = %version-%release
...
@@ -99,6 +101,16 @@ Requires: %name = %version-%release
Python interface for %name
Python interface for %name
%endif
%endif
%if_enabled java
%package -n %name-extension-java
Group: Development/Java
Summary: java wrapper for uniset
Requires: %name = %version-%release
%description -n %name-extension-java
%name-extension-java provides Java bindings for %name though a JNI wrapper.
%endif
%package utils
%package utils
Summary: UniSet utilities
Summary: UniSet utilities
Group: Development/Tools
Group: Development/Tools
...
@@ -321,7 +333,12 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
...
@@ -321,7 +333,12 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%dir %python_sitelibdir/%oname
%dir %python_sitelibdir/%oname
%python_sitelibdir/*
%python_sitelibdir/*
%python_sitelibdir/%oname/*
%python_sitelibdir/%oname/*
%endif
%if_enabled java
%files -n %name-extension-java
%_javadir/*.jar
%_libdir/libjU*.so
%endif
%endif
%if_enabled docs
%if_enabled docs
...
@@ -410,6 +427,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
...
@@ -410,6 +427,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# ..
# ..
%changelog
%changelog
* Sun Mar 29 2015 Pavel Vainerman <pv@altlinux.ru> 2.0-alt23.2
- java bindigs test build
* Sat Mar 28 2015 Pavel Vainerman <pv@altlinux.ru> 2.0-alt23.1
* Sat Mar 28 2015 Pavel Vainerman <pv@altlinux.ru> 2.0-alt23.1
- add java support
- add java support
...
...
configure.ac
View file @
ed6f4e33
...
@@ -172,7 +172,17 @@ if test ${buildjava} = true; then
...
@@ -172,7 +172,17 @@ if test ${buildjava} = true; then
AC_MSG_RESULT([enabled])
AC_MSG_RESULT([enabled])
dnl Java
dnl Java
# PKG_CHECK_MODULES(JAVA,java,,exit)
# PKG_CHECK_MODULES(JAVA,java,,exit)
# AC_CHECK_PROG(SWIG, swig, yes, exit)
# HACK! absolute path!
JAVA_CFLAGS="-I/usr/lib/jdk/include -I/usr/lib/jdk/include/linux"
JAVA_LIBS=
AC_CHECK_PROG(JAR,jar,jar, exit)
AC_CHECK_PROG(JAVAC, javac, javac, exit)
AC_CHECK_PROG(SWIG, swig, swig, exit)
AC_SUBST(JAVA_CFLAGS)
AC_SUBST(JAVA_LIBS)
AC_SUBST(SWIG)
AC_SUBST(JAR)
else
else
AC_MSG_RESULT([disabled])
AC_MSG_RESULT([disabled])
fi
fi
...
@@ -371,6 +381,7 @@ AC_CONFIG_FILES([Makefile
...
@@ -371,6 +381,7 @@ AC_CONFIG_FILES([Makefile
testsuite/Makefile
testsuite/Makefile
wrappers/Makefile
wrappers/Makefile
wrappers/java/Makefile
wrappers/java/Makefile
wrappers/java/MANIFEST.MF
wrappers/python/lib/Makefile
wrappers/python/lib/Makefile
wrappers/python/lib/pyUniSet/Makefile
wrappers/python/lib/pyUniSet/Makefile
wrappers/python/Makefile])
wrappers/python/Makefile])
...
...
docs/UniSetDox.cfg.in
View file @
ed6f4e33
...
@@ -654,7 +654,7 @@ INPUT = DocPages/ \
...
@@ -654,7 +654,7 @@ INPUT = DocPages/ \
../conf \
../conf \
../Utilities \
../Utilities \
../extensions \
../extensions \
../
python
../
wrappers
# This tag can be used to specify the character encoding of the source files
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
...
...
docs/UniSetDoxDevel.cfg.in
View file @
ed6f4e33
...
@@ -654,7 +654,7 @@ INPUT = DocPages/ \
...
@@ -654,7 +654,7 @@ INPUT = DocPages/ \
../conf \
../conf \
../Utilities \
../Utilities \
../extensions \
../extensions \
../
python
../
wrappers
# This tag can be used to specify the character encoding of the source files
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
...
...
wrappers/java/MANIFEST.MF.in
0 → 100644
View file @
ed6f4e33
Manifest-Version: 1.0
Name: ru/etersoft/uniset/
Specification-Title: "Java wrapper for the uniset library"
Specification-Version: "@VERSION@"
Specification-Vendor: "Etersoft"
Implementation-Title: "ru.etersoft.uniset"
Implementation-Version: "@VERSION@"
Implementation-Vendor: "Etersoft"
Extension-List: uniset
uniset-Extension-Name: "ru.etersoft.uniset"
uniset-Implementation-Version: @VERSION@
wrappers/java/Makefile.am
View file @
ed6f4e33
if
DISABLE_JAVA
if
DISABLE_JAVA
else
else
JAVA_CFLAGS
=
-I
/usr/lib/jdk/include
-I
/usr/lib/jdk/include/linux
package_name
=
ru.etersoft.uniset
JAVA_LIBS
=
package_dir
=
ru/etersoft/uniset
#python_SCRIPTS = pyUniSet.java pyUConnector.java pyUModbus.java pyUExceptions.java
# =============================================================
#lib_LTLIBRARIES = libjUConnector.la libjUModbus.la libjUExceptions.la libjUInterface.la
lib_LTLIBRARIES
=
libjUModbus.la
libjUModbus_la_SOURCES
=
UModbus.cc UModbus_wrap.cxx
libjUModbus_la_CXXFLAGS
=
$(UNISET_CFLAGS)
$(UNISET_EXT_CFLAGS)
$(COMCPP_CFLAGS)
$(JAVA_CFLAGS)
libjUModbus_la_LDFLAGS
=
-module
-avoid-version
libjUModbus_la_LIBADD
=
$(UNISET_LIBS)
$(UNISET_EXT_LIBS)
$(COMCPP_LIBS)
$(JAVA_LIBS)
jUniSet.java
:
UInterface_wrap.cxx _jUInterface.la
UModbus_wrap.cxx
:
UInterface.i UModbus.h UModbus.i
mkdir
-p
$(package_dir)
swig
-java
-package
$(package_name)
-outdir
$(package_dir)
-c
++ UModbus.i
jUConnector.java
:
UConnector_wrap.cxx _jUConnector.la
jUModbus.java
:
_jUModbus.la UModbus_wrap.cxx
jUExceptions.java
:
_jUExceptions.la
lib_LTLIBRARIES
=
_jUConnector.la _jUModbus.la _jUExceptions.la _jUInterface.la
_
jUInterface_la_SOURCES
=
JUInterface.cc UInterface_wrap.cxx
#lib
jUInterface_la_SOURCES = JUInterface.cc UInterface_wrap.cxx
_
jUInterface_la_CXXFLAGS
=
$(UNISET_CFLAGS)
$(JAVA_CFLAGS)
#lib
jUInterface_la_CXXFLAGS = $(UNISET_CFLAGS) $(JAVA_CFLAGS)
_
jUInterface_la_LDFLAGS
=
-module
-avoid-version
#lib
jUInterface_la_LDFLAGS = -module -avoid-version
_
jUInterface_la_LIBADD
=
$(UNISET_LIBS)
$(JAVA_LIBS)
#lib
jUInterface_la_LIBADD = $(UNISET_LIBS) $(JAVA_LIBS)
UInterface_wrap.cxx
:
UInterface.i JUInterface.h
#
UInterface_wrap.cxx: UInterface.i JUInterface.h
swig
-java
-c
++ UInterface.i
#
swig -java -c++ UInterface.i
_
jUConnector_la_SOURCES
=
UConnector.cc UConnector_wrap.cxx
#lib
jUConnector_la_SOURCES = UConnector.cc UConnector_wrap.cxx
_
jUConnector_la_CXXFLAGS
=
$(UNISET_CFLAGS)
$(JAVA_CFLAGS)
#lib
jUConnector_la_CXXFLAGS = $(UNISET_CFLAGS) $(JAVA_CFLAGS)
_
jUConnector_la_LDFLAGS
=
-module
-avoid-version
#lib
jUConnector_la_LDFLAGS = -module -avoid-version
_
jUConnector_la_LIBADD
=
$(UNISET_LIBS)
$(JAVA_LIBS)
#lib
jUConnector_la_LIBADD = $(UNISET_LIBS) $(JAVA_LIBS)
UConnector_wrap.cxx
:
UConnector.i UConnector.h
#
UConnector_wrap.cxx: UConnector.i UConnector.h
swig
-java
-c
++ UConnector.i
#
swig -java -c++ UConnector.i
_jUModbus_la_SOURCES
=
UModbus.cc UModbu
s_wrap.cxx
#libjUExceptions_la_SOURCES = UException
s_wrap.cxx
_jUModbus_la_CXXFLAGS
=
$(UNISET_CFLAGS)
$(UNISET_EXT_CFLAGS)
$(COMCPP
_CFLAGS)
$(JAVA_CFLAGS)
#libjUExceptions_la_CXXFLAGS = $(UNISET_CFLAGS) $(UNISET_EXT
_CFLAGS) $(JAVA_CFLAGS)
_jUModbu
s_la_LDFLAGS
=
-module
-avoid-version
#libjUException
s_la_LDFLAGS = -module -avoid-version
_jUModbus_la_LIBADD
=
$(UNISET_LIBS)
$(UNISET_EXT_LIBS)
$(COMCPP
_LIBS)
$(JAVA_LIBS)
#libjUExceptions_la_LIBADD = $(UNISET_LIBS) $(UNISET_EXT
_LIBS) $(JAVA_LIBS)
UModbus_wrap.cxx
:
UInterface.i UModbus.h UModbus.i
#UExceptions_wrap.cxx: UExceptions.i UExceptions.h
swig
-java
-c
++ UModbu
s.i
# swig -java -c++ UException
s.i
_jUExceptions_la_SOURCES
=
UExceptions_wrap.cxx
clean-local
:
_jUExceptions_la_CXXFLAGS
=
$(UNISET_CFLAGS)
$(UNISET_EXT_CFLAGS)
$(JAVA_CFLAGS)
rm
-rf
*
_wrap.cxx
*
.jar classes.list
*
.class ru/
_jUExceptions_la_LDFLAGS
=
-module
-avoid-version
_jUExceptions_la_LIBADD
=
$(UNISET_LIBS)
$(UNISET_EXT_LIBS)
$(JAVA_LIBS)
UExceptions_wrap.cxx
:
UExceptions.i UExceptions.h
javadir
=
@datadir@/java
swig
-java
-c
++ UExceptions.i
java_DATA
=
uniset.jar
clean-local
:
jclasses
:
libjUModbus.la
rm
-rf
*
_wrap.cxx
*
.class
find ru/
-type
f
-name
'*.java'
-print0
| xargs
-0
$(JAVAC)
rm
-rf
`
ls
*
.java |
$(GREP)
-v
runme
*
`
uniset.jar
:
jclasses
find ru
-name
'*.class'
-print
>
classes.list
$(JAR)
cmf MANIFEST.MF
$@
@classes.list
endif
endif
wrappers/java/UExceptions.i
View file @
ed6f4e33
/*
%module mUExceptions
%module mUExceptions
%{
%{
#include "UExceptions.h"
#include "UExceptions.h"
%}
%}
*/
%include "UExceptions.h"
%include "UExceptions.h"
%exception {
%exception {
...
...
wrappers/java/UModbus.i
View file @
ed6f4e33
...
@@ -3,21 +3,19 @@
...
@@ -3,21 +3,19 @@
#include "UModbus.h"
#include "UModbus.h"
%}
%}
/*
%include "UTypes.h"
%include "UExceptions.h"
%include UExceptions.i
%include "UModbus.h"
%pragma(java) jniclasscode=%{
%pragma(java) jniclasscode=%{
static {
static {
try {
try {
System.loadLibrary("m
UModbus");
System.loadLibrary("j
UModbus");
} catch (UnsatisfiedLinkError e) {
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.err.println("
JUModbus.so:
Native code library failed to load. \n" + e);
System.exit(1);
System.exit(1);
}
}
}
}
%}
%}
*/
\ No newline at end of file
%include "UTypes.h"
%include "UExceptions.h"
%include UExceptions.i
%include "UModbus.h"
wrappers/java/mk-local.sh
0 → 100755
View file @
ed6f4e33
#!/bin/sh
javac runme_modbus.java
&&
java
-Djava
.library.path
=
`
pwd
`
/.libs
-cp
.
runme_modbus
wrappers/java/mk.sh
View file @
ed6f4e33
#!/bin/sh
#!/bin/sh
javac runme_modbus.java
&&
java runme_modbus
UJAR
=
"/usr/share/java/uniset.jar:."
\ No newline at end of file
javac
-cp
$UJAR
runme_modbus.java
&&
java
-cp
$UJAR
runme_modbus
wrappers/java/runme_modbus.java
View file @
ed6f4e33
import
ru.etersoft.uniset.*
;
public
class
runme_modbus
{
public
class
runme_modbus
{
public
static
void
main
(
String
argv
[])
{
public
static
void
main
(
String
argv
[])
{
System
.
load
(
"/home/pv/Projects/uniset-2.0/wrappers/java/.libs/_jUModbus.so"
);
System
.
load
(
"/home/pv/Projects/uniset-2.0/wrappers/java/.libs/_jUExceptions.so"
);
UModbus
u
=
new
UModbus
();
UModbus
u
=
new
UModbus
();
u
.
connect
(
"localhost"
,
2048
);
u
.
connect
(
"localhost"
,
2048
);
for
(
int
i
=
0
;
i
<
10
;
i
++
)
for
(
int
i
=
0
;
i
<
10
;
i
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment