Commit 5d4af5c4 authored by Hanadeev Alexandr's avatar Hanadeev Alexandr Committed by Vinogradov Aleksei

(build): config build for arm

parent c8e01bfe
...@@ -110,6 +110,8 @@ int main( int argc, char** argv ) ...@@ -110,6 +110,8 @@ int main( int argc, char** argv )
if( f485 ) if( f485 )
{ {
#ifndef DISABLE_COMPORT_485F
ComPort485F* cp; ComPort485F* cp;
if( dev == "/dev/ttyS2" ) if( dev == "/dev/ttyS2" )
...@@ -126,6 +128,10 @@ int main( int argc, char** argv ) ...@@ -126,6 +128,10 @@ int main( int argc, char** argv )
mbs.setLog(dlog); mbs.setLog(dlog);
mbs.setVerbose(verb); mbs.setVerbose(verb);
mbs.execute(); mbs.execute();
#else
cerr << "DISABLE_COMPORT_485F" << endl;
return 1;
#endif // #ifndef DISABLE_COMPORT_485F
} }
else else
{ {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
%def_disable netdata %def_disable netdata
%def_enable api %def_enable api
%def_enable logdb %def_enable logdb
%def_enable com485f
%define oname uniset2 %define oname uniset2
...@@ -326,7 +327,7 @@ SharedMemoryPlus extension ('all in one') for libuniset ...@@ -326,7 +327,7 @@ SharedMemoryPlus extension ('all in one') for libuniset
%build %build
%autoreconf %autoreconf
%configure %{subst_enable docs} %{subst_enable mysql} %{subst_enable sqlite} %{subst_enable pgsql} %{subst_enable python} %{subst_enable rrd} %{subst_enable io} %{subst_enable logicproc} %{subst_enable tests} %{subst_enable mqtt} %{subst_enable api} %{subst_enable netdata} %{subst_enable logdb} %configure %{subst_enable docs} %{subst_enable mysql} %{subst_enable sqlite} %{subst_enable pgsql} %{subst_enable python} %{subst_enable rrd} %{subst_enable io} %{subst_enable logicproc} %{subst_enable tests} %{subst_enable mqtt} %{subst_enable api} %{subst_enable netdata} %{subst_enable logdb} %{subst_enable com485f}
%make_build %make_build
# fix for ALTLinux build (noarch) # fix for ALTLinux build (noarch)
......
...@@ -7,6 +7,7 @@ load_mod spec ...@@ -7,6 +7,7 @@ load_mod spec
REL=eter REL=eter
MAILDOMAIN=server MAILDOMAIN=server
OPTS=$*
[ -z "$TOPDIR" ] && TOPDIR=/var/ftp/pub/Ourside [ -z "$TOPDIR" ] && TOPDIR=/var/ftp/pub/Ourside
...@@ -16,10 +17,10 @@ SPECNAME=libuniset2.spec ...@@ -16,10 +17,10 @@ SPECNAME=libuniset2.spec
if [ -z "$PLATFORM" ]; then if [ -z "$PLATFORM" ]; then
PLATFORM=i586 PLATFORM=i586
[[ `uname -m` == "x86_64" ]] && PLATFORM=x86_64 [[ `uname -m` == "x86_64" ]] && PLATFORM=x86_64
[[ `uname -m` == "aarch64" ]] && PLATFORM=aarch64
fi fi
PROJECT=$1 PROJECT=$PKGNAME
test -n "$PROJECT" || PROJECT=$PKGNAME
[ -z "$GEN" ] && GEN=/var/ftp/pub/Ourside/$PLATFORM/genb.sh [ -z "$GEN" ] && GEN=/var/ftp/pub/Ourside/$PLATFORM/genb.sh
[ -a "$GEN" ] || GEN="genbasedir --create --progress --topdir=$TOPDIR $PLATFORM $PROJECT" [ -a "$GEN" ] || GEN="genbasedir --create --progress --topdir=$TOPDIR $PLATFORM $PROJECT"
...@@ -89,7 +90,7 @@ else ...@@ -89,7 +90,7 @@ else
add_changelog_helper "- new build" $SPECNAME add_changelog_helper "- new build" $SPECNAME
fi fi
rpmbb ${UNISET_BUILD_ADDON_OPTIONS} $SPECNAME || fatal "Can't build" rpmbb ${UNISET_BUILD_ADDON_OPTIONS} ${OPTS} $SPECNAME || fatal "Can't build"
cp2ftp cp2ftp
......
#!/bin/sh
./release_helper.sh --disable=com485f --disable=mqtt --disable=docs
...@@ -199,6 +199,31 @@ fi ...@@ -199,6 +199,31 @@ fi
AM_CONDITIONAL(DISABLE_IO, test ${buildio} = false) AM_CONDITIONAL(DISABLE_IO, test ${buildio} = false)
AM_CONDITIONAL(ENABLE_IO, test ${buildio} = true) AM_CONDITIONAL(ENABLE_IO, test ${buildio} = true)
#check sys/io.h support
AC_MSG_CHECKING([sys/io.h support])
buildcom485f=true
#AC_CHECK_HEADERS
AC_ARG_ENABLE(com485f, AC_HELP_STRING([--disable-com485f], [disable sys/io.h support]),
[ if test $enableval = yes; then buildcom485f=true; else buildcom485f=false; fi],[ buildcom485f=true; ])
COMPORT_485F_CFLAGS=
COMPORT_485F_CLIBS=
DISABLE_COMPORT_485F=
if test ${buildcom485f} = true; then
AC_MSG_RESULT([enabled])
else
AC_MSG_RESULT([disabled])
COMPORT_485F_CFLAGS="-DDISABLE_COMPORT_485F"
DISABLE_COMPORT_485F=1
fi
AM_CONDITIONAL(DISABLE_COMPORT_485F, test ${buildcom485f} = false)
AC_SUBST(DISABLE_COMPORT_485F)
AC_SUBST(COMPORT_485F_CFLAGS)
#AC_SUBST(COMPORT_485F_CLIBS)
#check logicproc build #check logicproc build
AC_MSG_CHECKING([build logic processor extension]) AC_MSG_CHECKING([build logic processor extension])
buildlproc=true buildlproc=true
...@@ -415,7 +440,7 @@ CXX_EXTRA_FLAGS="-Wnon-virtual-dtor -Woverloaded-virtual -Woverflow -D_GLIBCXX_U ...@@ -415,7 +440,7 @@ CXX_EXTRA_FLAGS="-Wnon-virtual-dtor -Woverloaded-virtual -Woverflow -D_GLIBCXX_U
# export # export
LDFLAGS="$LDFLAGS ${OMNI_LIBS} ${XML_LIBS} ${SIGC_LIBS} ${COV_LIBS} ${POCO_LIBS} ${EV_LIBS}" LDFLAGS="$LDFLAGS ${OMNI_LIBS} ${XML_LIBS} ${SIGC_LIBS} ${COV_LIBS} ${POCO_LIBS} ${EV_LIBS}"
# all developer liked options add to autogen.sh, please # all developer liked options add to autogen.sh, please
CXXFLAGS="-I\$(top_builddir)/include $CXXFLAGS -funsigned-char -std=c++11 -g -DCATCH_VERSION_MAJOR=${CATCH_VERSION_MAJOR} -D_GNU_SOURCE ${REST_API_CFLAGS} ${OMNI_CFLAGS} ${XML_CFLAGS} ${SIGC_CFLAGS} ${COV_CFLAGS} ${POCO_CFLAGS} ${EV_CFLAGS} $CXX_EXTRA_FLAGS" CXXFLAGS="-I\$(top_builddir)/include $CXXFLAGS -funsigned-char -std=c++11 -g -DCATCH_VERSION_MAJOR=${CATCH_VERSION_MAJOR} -D_GNU_SOURCE ${REST_API_CFLAGS} ${COMPORT_485F_CFLAGS} ${OMNI_CFLAGS} ${XML_CFLAGS} ${SIGC_CFLAGS} ${COV_CFLAGS} ${POCO_CFLAGS} ${EV_CFLAGS} $CXX_EXTRA_FLAGS"
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)
AC_SUBST(CXXFLAGS) AC_SUBST(CXXFLAGS)
......
#ifndef DISABLE_COMPORT_485F
/* /*
* Copyright (c) 2015 Pavel Vainerman. * Copyright (c) 2015 Pavel Vainerman.
* *
...@@ -71,3 +72,4 @@ namespace uniset ...@@ -71,3 +72,4 @@ namespace uniset
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#endif // COMPORT_485F_H_ #endif // COMPORT_485F_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#endif // #ifndef DISABLE_COMPORT_485F
#ifndef DISABLE_COMPORT_485F
/* /*
* Copyright (c) 2015 Pavel Vainerman. * Copyright (c) 2015 Pavel Vainerman.
* *
...@@ -334,3 +335,4 @@ void ComPort485F::reopen() ...@@ -334,3 +335,4 @@ void ComPort485F::reopen()
ComPort::reopen(); ComPort::reopen();
} }
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
#endif // #ifndef DISABLE_COMPORT_485F
...@@ -36,6 +36,7 @@ namespace uniset ...@@ -36,6 +36,7 @@ namespace uniset
{ {
if( use485 ) if( use485 )
{ {
#ifndef DISABLE_COMPORT_485F
ComPort485F* cp; ComPort485F* cp;
if( dev == "/dev/ttyS2" ) if( dev == "/dev/ttyS2" )
...@@ -46,6 +47,9 @@ namespace uniset ...@@ -46,6 +47,9 @@ namespace uniset
throw Exception("Open ComPort FAILED! dev must be /dev/ttyS2 or /dev/tytS3"); throw Exception("Open ComPort FAILED! dev must be /dev/ttyS2 or /dev/tytS3");
port = cp; port = cp;
#else
throw Exception("Open ComPort485F FAILED! DISABLE_COMPORT_485F");
#endif // #ifndef DISABLE_COMPORT_485F
} }
else else
port = new ComPort(dev); port = new ComPort(dev);
......
...@@ -36,6 +36,7 @@ namespace uniset ...@@ -36,6 +36,7 @@ namespace uniset
{ {
if( use485 ) if( use485 )
{ {
#ifndef DISABLE_COMPORT_485F
ComPort485F* cp; ComPort485F* cp;
if( dev == "/dev/ttyS2" ) if( dev == "/dev/ttyS2" )
...@@ -46,6 +47,9 @@ namespace uniset ...@@ -46,6 +47,9 @@ namespace uniset
throw Exception("Open ComPort FAILED! dev must be /dev/ttyS2 or /dev/tytS3"); throw Exception("Open ComPort FAILED! dev must be /dev/ttyS2 or /dev/tytS3");
port = cp; port = cp;
#else
throw Exception("Open ComPort485F FAILED! DISABLE_COMPORT_485F");
#endif // #ifndef DISABLE_COMPORT_485F
} }
else else
port = new ComPort(dev); port = new ComPort(dev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment