-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from lwindg/master
Add autoconf rule
- Loading branch information
Showing
10 changed files
with
176 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SUBDIRS = src | ||
dist_doc_DATA = README CHANGES BUGS | ||
|
||
etcdir = /etc | ||
etc_DATA = $(PACKAGE).conf | ||
|
||
EXTRA_DIST = $(dist_doc_DATA) $(etc_DATA) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- Autoconf -*- | ||
# Process this file with autoconf to produce a configure script. | ||
|
||
AC_PREREQ([2.69]) | ||
AC_INIT([sanji-controller], [1.0.1], [[email protected]]) | ||
AM_INIT_AUTOMAKE([1.11 foreign]) | ||
AC_CONFIG_SRCDIR([src/sanji_controller.c]) | ||
AC_CONFIG_HEADERS([config.h]) | ||
|
||
# Checks for programs. | ||
AC_PROG_AWK | ||
AC_PROG_CC | ||
AC_PROG_RANLIB | ||
AC_PROG_INSTALL | ||
AC_PROG_MAKE_SET | ||
|
||
# Checks for libraries. | ||
AC_SUBST(mosquitto_LIBS) | ||
AC_CHECK_LIB([rt], [clock_gettime]) | ||
AC_CHECK_LIB([jansson], [json_object]) | ||
AC_CHECK_LIB([mosquitto], [mosquitto_lib_init], | ||
[mosquitto_LIBS="-lmosquitto"], | ||
AC_ERROR([Misssing mosquitto client library])) | ||
|
||
# Checks for header files. | ||
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h utime.h]) | ||
|
||
# Checks for typedefs, structures, and compiler characteristics. | ||
AC_CHECK_HEADER_STDBOOL | ||
AC_C_INLINE | ||
AC_TYPE_OFF_T | ||
AC_TYPE_PID_T | ||
AC_TYPE_SIZE_T | ||
AC_TYPE_UINT16_T | ||
AC_TYPE_UINT32_T | ||
AC_TYPE_UINT64_T | ||
AC_TYPE_UINT8_T | ||
|
||
# Checks for library functions. | ||
AC_FUNC_FORK | ||
AC_FUNC_MALLOC | ||
AC_FUNC_REALLOC | ||
AC_FUNC_STRERROR_R | ||
AC_CHECK_FUNCS([clock_gettime gethostname memmove memset strchr strerror strrchr utime]) | ||
|
||
AC_CONFIG_FILES([Makefile | ||
src/Makefile | ||
src/lib/Makefile]) | ||
AC_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ Section: libs | |
Homepage: http://www.moxa.com | ||
#Vcs-Git: [email protected]:Sanji-IO/sanji-controller.git | ||
#Vcs-Browser: | ||
X-Python-Version: >= 2.5 | ||
|
||
Package: sanji-controller | ||
Section: libs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
#export DH_VERBOSE=1 | ||
|
||
%: | ||
dh $@ | ||
dh $@ --with autotools-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0 (native) | ||
3.0 (quilt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
[global] | ||
|
||
# ================================================================= | ||
# Connection | ||
# ================================================================= | ||
|
||
# MQTT broker IP. | ||
host = '127.0.0.1' | ||
|
||
# MQTT broker port. | ||
port = 1883 | ||
|
||
# Retry times to connect MQTT broker | ||
# Max to 65535. If you want to try forever, use -1. | ||
retry = -1 | ||
|
||
|
||
# ================================================================= | ||
# MQTT | ||
# ================================================================= | ||
|
||
# Keep alive in seconds to MQTT broker. | ||
# Max to 65535. | ||
keepalive = 600 | ||
|
||
# On connection, a client sets the "clean session" flag, | ||
# which is sometimes also known as the "clean start" flag. | ||
# | ||
# If clean session is set to false, then the connection is treated as durable. | ||
# This means that when the client disconnects, any subscriptions it has will | ||
# remain and any subsequent QoS 1 or 2 messages will be stored | ||
# until it connects again in the future. If clean session is true, | ||
# then all subscriptions will be removed for the client when it disconnects. | ||
clean_session = true | ||
|
||
# QoS for subscription and publication. | ||
# | ||
# Higher levels of QoS are more reliable, | ||
# but involve higher latency and have higher bandwidth requirements. | ||
# 0: The broker/client will deliver the message once, with no confirmation. | ||
# 1: The broker/client will deliver the message at least once, with confirmation required. | ||
# 2: The broker/client will deliver the message exactly once by using a four step handshake. | ||
sub_qos = 2 | ||
pub_qos = 1 | ||
|
||
# Set the client id for this bridge connection. If not defined, this defaults | ||
# to 'controller'. | ||
cliet_id = | ||
|
||
# Username and password (requires MQTT 3.1 broker). | ||
username = | ||
password = | ||
|
||
|
||
# ================================================================= | ||
# Sanji Controller | ||
# ================================================================= | ||
|
||
# The inverval in milliseconds for sanji controller to refresh sessions. | ||
# | ||
# Sanji controller will refresh every session status in order to | ||
# drop TTL session, do heart beat with MQTT broker, | ||
# and some protocol layer procedure. | ||
# | ||
# Noted, refresh interval MUST less then keepalive time. | ||
# Max to 65535. | ||
refresh_interval = 1000 | ||
|
||
|
||
# ================================================================= | ||
# MISC | ||
# ================================================================= | ||
|
||
# Local id for extra topic | ||
local_id = | ||
|
||
# Enable mosquitto debug function. | ||
mosq_debug = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
SUBDIRS = lib | ||
|
||
libdir = lib | ||
bin_PROGRAMS = sanji-controller | ||
sanji_controller_SOURCES = \ | ||
debug.h \ | ||
error.h \ | ||
http.h \ | ||
list.h \ | ||
sanji_controller.h sanji_controller.c \ | ||
resource.h resource.c \ | ||
component.h component.c \ | ||
session.h session.c \ | ||
ini.h ini.c | ||
sanji_controller_LDFLAGS = $(mosquitto_LIBS) $(jansson_LIBS) | ||
sanji_controller_LDADD = $(libdir)/libsanjimisc.a | ||
|
||
AM_CPPFLAGS = -I$(libdir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
noinst_LIBRARIES = libsanjimisc.a | ||
libsanjimisc_a_SOURCES = \ | ||
bswap.h \ | ||
typedefs.h \ | ||
crc16.h crc16.c \ | ||
daemonize.h daemonize.c \ | ||
dt.h dt.c \ | ||
time_util.h time_util.c \ | ||
lock.h lock.c \ | ||
pid.h pid.c \ | ||
text_util.h text_util.c \ | ||
strext.h strext.c \ | ||
random_util.h random_util.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters