aboutsummaryrefslogtreecommitdiff
path: root/flow-native/src
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2015-12-08 21:44:31 -0800
committerJakob Odersky <jodersky@gmail.com>2015-12-08 21:44:31 -0800
commiteab2e148c7605ca0fd836bbe9230734895cce7d0 (patch)
treed7b2a00c2890830fd60a3ba811141ceb48a5d650 /flow-native/src
parent230e840e09eda41f95bb813ff666fc58c663c095 (diff)
downloadakka-serial-eab2e148c7605ca0fd836bbe9230734895cce7d0.tar.gz
akka-serial-eab2e148c7605ca0fd836bbe9230734895cce7d0.tar.bz2
akka-serial-eab2e148c7605ca0fd836bbe9230734895cce7d0.zip
Use sbt-jni plugin
Diffstat (limited to 'flow-native/src')
-rw-r--r--flow-native/src/.gitignore31
-rw-r--r--flow-native/src/Makefile.am11
-rwxr-xr-xflow-native/src/bootstrap3
-rw-r--r--flow-native/src/configure.ac48
-rw-r--r--flow-native/src/debian/changelog6
-rw-r--r--flow-native/src/debian/compat1
-rw-r--r--flow-native/src/debian/control17
-rw-r--r--flow-native/src/debian/copyright36
-rwxr-xr-xflow-native/src/debian/rules21
-rwxr-xr-xflow-native/src/pkg/mkpkg20
-rw-r--r--flow-native/src/readme.md3
-rw-r--r--flow-native/src/src/Makefile.am9
-rw-r--r--flow-native/src/src/com_github_jodersky_flow_internal_NativeSerial.h (renamed from flow-native/src/com_github_jodersky_flow_internal_NativeSerial.h)0
-rw-r--r--flow-native/src/src/flow.h (renamed from flow-native/src/flow.h)0
-rw-r--r--flow-native/src/src/flow_jni.c (renamed from flow-native/src/flow_jni.c)0
-rw-r--r--flow-native/src/src/platform/posix/flow.c (renamed from flow-native/src/platform/posix/flow.c)0
-rw-r--r--flow-native/src/src/platform/windows/README (renamed from flow-native/src/platform/windows/README)0
-rw-r--r--flow-native/src/src/platform/windows/flow.c.disabled (renamed from flow-native/src/platform/windows/flow.c.disabled)0
18 files changed, 198 insertions, 8 deletions
diff --git a/flow-native/src/.gitignore b/flow-native/src/.gitignore
new file mode 100644
index 0000000..b8d894c
--- /dev/null
+++ b/flow-native/src/.gitignore
@@ -0,0 +1,31 @@
+/autom4te.cache
+/libtool
+/aclocal.m4
+/config.sub
+/config.log
+/config.guess
+/config.status
+/config.h.in
+/config.h
+/configure
+/depcomp
+/install-sh
+/ltmain.sh
+/missing
+/stamp-h1
+/compile
+/m4
+!/m4/ax_jni_include_dir.m4
+
+Makefile.in
+Makefile
+.deps
+.libs
+*.o
+*.la
+*.lo
+*.so*
+*.dylib
+*.a
+*~
+
diff --git a/flow-native/src/Makefile.am b/flow-native/src/Makefile.am
index 9fefbd1..e06bd75 100644
--- a/flow-native/src/Makefile.am
+++ b/flow-native/src/Makefile.am
@@ -1,9 +1,4 @@
-lib_LTLIBRARIES = libflow3.la
+AUTOMAKE_OPTIONS = foreign
+ACLOCAL_AMFLAGS = -I m4
-libflow3_la_SOURCES = flow_jni.c platform/posix/flow.c flow.h com_github_jodersky_flow_internal_NativeSerial.h
-
-if ENABLE_VERSIONED_LIB
-libflow3_la_LDFLAGS = -version-info 0:1:0
-else
-libflow3_la_LDFLAGS = -avoid-version
-endif \ No newline at end of file
+SUBDIRS = src \ No newline at end of file
diff --git a/flow-native/src/bootstrap b/flow-native/src/bootstrap
new file mode 100755
index 0000000..d4d064f
--- /dev/null
+++ b/flow-native/src/bootstrap
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+autoreconf -vfi \ No newline at end of file
diff --git a/flow-native/src/configure.ac b/flow-native/src/configure.ac
new file mode 100644
index 0000000..1b622c4
--- /dev/null
+++ b/flow-native/src/configure.ac
@@ -0,0 +1,48 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.68])
+AC_INIT(flow, [3.0.1], [jodersky@gmail.com])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([src/flow_jni.c])
+
+AM_INIT_AUTOMAKE
+
+AC_CONFIG_HEADERS([config.h])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h sys/file.h termios.h unistd.h])
+#AC_CHECK_HEADERS([jni.h],,AC_MSG_WARN(No jni.h found. Is a JDK installed?))
+
+LT_INIT([disable-static])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_INLINE
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([select])
+
+AX_JNI_INCLUDE_DIR
+for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+do
+ CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
+done
+
+AC_ARG_ENABLE([versioned-lib],
+ [AS_HELP_STRING([--disable-versioned-lib], [Disable producing versioned library files.])],
+ [:],
+ [enable_versioned_lib=yes])
+
+AM_CONDITIONAL([ENABLE_VERSIONED_LIB], [test "$enable_versioned_lib" = "yes"])
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([src/Makefile])
+AC_OUTPUT
diff --git a/flow-native/src/debian/changelog b/flow-native/src/debian/changelog
new file mode 100644
index 0000000..00bb566
--- /dev/null
+++ b/flow-native/src/debian/changelog
@@ -0,0 +1,6 @@
+flow (3.0.1) UNRELEASED; urgency=low
+
+ * Initial release.
+ * Fix termios initialization issue.
+
+ -- Jakob Odersky <jodersky@gmail.com> Sun, 11 Jan 2015 10:56:29 +0100
diff --git a/flow-native/src/debian/compat b/flow-native/src/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/flow-native/src/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/flow-native/src/debian/control b/flow-native/src/debian/control
new file mode 100644
index 0000000..f335e0e
--- /dev/null
+++ b/flow-native/src/debian/control
@@ -0,0 +1,17 @@
+Source: flow
+Maintainer: Jakob Odersky <jodersky@gmail.com>
+Section: java
+Priority: optional
+Build-Depends: debhelper (>= 9), java7-jdk | openjdk-7-jdk
+Standards-Version: 3.9.6
+Homepage: https://github.com/jodersky/flow
+Vcs-Git: git://github.com/jodersky/flow.git
+
+Package: libflow3-jni
+Architecture: any
+Section: java
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Provides the native backend and JNI bindings for flow.
+ This package contains a native library to fully enable flow, a
+ serial communication library for Scala. \ No newline at end of file
diff --git a/flow-native/src/debian/copyright b/flow-native/src/debian/copyright
new file mode 100644
index 0000000..d26a00a
--- /dev/null
+++ b/flow-native/src/debian/copyright
@@ -0,0 +1,36 @@
+Format: http://dep.debian.net/deps/dep5
+Upstream-Name: flow
+Source: https://github.com/jodersky/flow
+
+Files: *
+Copyright: 2014 Jakob Odersky <jodersky@gmail.com>
+License: BSD-3-Clause
+
+Files: debian/*
+Copyright: 2014 Jakob Odersky <jodersky@gmail.com>
+License: BSD-3-Clause
+
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
diff --git a/flow-native/src/debian/rules b/flow-native/src/debian/rules
new file mode 100755
index 0000000..c062736
--- /dev/null
+++ b/flow-native/src/debian/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
+
+# override library install directory
+override_dh_auto_configure:
+ dh_auto_configure -- --libdir=/usr/lib/jni
+
+# used to suppress ldconfig warnings in preinst and postrm
+override_dh_makeshlibs:
+ dh_makeshlibs -X/usr/lib/jni
diff --git a/flow-native/src/pkg/mkpkg b/flow-native/src/pkg/mkpkg
new file mode 100755
index 0000000..c82d9cb
--- /dev/null
+++ b/flow-native/src/pkg/mkpkg
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# This script produces a .pkg installable package on a mac.
+
+# Name of the package
+PACKAGE=flow3
+
+# Place to install libraries (should be on java.library.path)
+LIBDIR=/Library/Java/Extensions
+
+# Temporary directory to install libraries
+TEMPDIR=`pwd`/out
+
+mkdir ${TEMPDIR} && \
+cd .. && \
+./configure --libdir=${LIBDIR} && \
+make && \
+DESTDIR=${TEMPDIR} make install && \
+productbuild --root=pkg ${PACKAGE}.pkg
+
diff --git a/flow-native/src/readme.md b/flow-native/src/readme.md
new file mode 100644
index 0000000..4bee987
--- /dev/null
+++ b/flow-native/src/readme.md
@@ -0,0 +1,3 @@
+# Native backend for flow
+
+Refer to Documentation/building.md for information on how to build.
diff --git a/flow-native/src/src/Makefile.am b/flow-native/src/src/Makefile.am
new file mode 100644
index 0000000..9fefbd1
--- /dev/null
+++ b/flow-native/src/src/Makefile.am
@@ -0,0 +1,9 @@
+lib_LTLIBRARIES = libflow3.la
+
+libflow3_la_SOURCES = flow_jni.c platform/posix/flow.c flow.h com_github_jodersky_flow_internal_NativeSerial.h
+
+if ENABLE_VERSIONED_LIB
+libflow3_la_LDFLAGS = -version-info 0:1:0
+else
+libflow3_la_LDFLAGS = -avoid-version
+endif \ No newline at end of file
diff --git a/flow-native/src/com_github_jodersky_flow_internal_NativeSerial.h b/flow-native/src/src/com_github_jodersky_flow_internal_NativeSerial.h
index 04364fb..04364fb 100644
--- a/flow-native/src/com_github_jodersky_flow_internal_NativeSerial.h
+++ b/flow-native/src/src/com_github_jodersky_flow_internal_NativeSerial.h
diff --git a/flow-native/src/flow.h b/flow-native/src/src/flow.h
index 44e2a47..44e2a47 100644
--- a/flow-native/src/flow.h
+++ b/flow-native/src/src/flow.h
diff --git a/flow-native/src/flow_jni.c b/flow-native/src/src/flow_jni.c
index 8ec2aed..8ec2aed 100644
--- a/flow-native/src/flow_jni.c
+++ b/flow-native/src/src/flow_jni.c
diff --git a/flow-native/src/platform/posix/flow.c b/flow-native/src/src/platform/posix/flow.c
index a2a239c..a2a239c 100644
--- a/flow-native/src/platform/posix/flow.c
+++ b/flow-native/src/src/platform/posix/flow.c
diff --git a/flow-native/src/platform/windows/README b/flow-native/src/src/platform/windows/README
index 3d24410..3d24410 100644
--- a/flow-native/src/platform/windows/README
+++ b/flow-native/src/src/platform/windows/README
diff --git a/flow-native/src/platform/windows/flow.c.disabled b/flow-native/src/src/platform/windows/flow.c.disabled
index 86a267c..86a267c 100644
--- a/flow-native/src/platform/windows/flow.c.disabled
+++ b/flow-native/src/src/platform/windows/flow.c.disabled