Commit 4ac2dbf8 authored by Pavel Vainerman's avatar Pavel Vainerman

fixed: __cxx11::string --> std::string

fix compilation with --disable-api
parent b10f8b9b
......@@ -33,7 +33,7 @@ before_script:
# due broken comedi
- export CXXFLAGS="$CXXFLAGS -Wl,--unresolved-symbols=ignore-in-shared-libs"
- autoreconf -fiv
- ./configure --enable-tests --enable-mysql --enable-sqlite --enable-rrd --enable-io --enable-logicproc --disable-python --disable-mqtt --disable-pgsql --disable-pkgchecklibev
- ./configure --enable-tests --enable-mysql --enable-sqlite --enable-rrd --enable-io --enable-logicproc --disable-python --disable-mqtt --disable-pgsql --disable-api --disable-pkgchecklibev
script:
- if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then make ; fi
......
......@@ -16,13 +16,13 @@ GENUOBJ=UObject_SK.cc UObject_SK.h
BUILT_SOURCES=$(GENERATED) $(GENERATED2) $(GENOBJ)
TestGen-main.cc TestGen_SK.cc TestGen_SK.h: ../@PACKAGE@-codegen testgen.src.xml ../*.xsl
../@PACKAGE@-codegen -l $(top_builddir)/Utilities/codegen --gen-varmap --local-include -n TestGen testgen.src.xml
$(SHELL) ../@PACKAGE@-codegen -l $(top_builddir)/Utilities/codegen --gen-varmap --local-include -n TestGen testgen.src.xml
TestGenAlone-main.cc TestGenAlone_SK.cc TestGenAlone_SK.h: ../@PACKAGE@-codegen testgen-alone.src.xml ../*.xsl
../@PACKAGE@-codegen -l $(top_builddir)/Utilities/codegen --local-include --alone -n TestGenAlone testgen-alone.src.xml
$(SHELL) ../@PACKAGE@-codegen -l $(top_builddir)/Utilities/codegen --local-include --alone -n TestGenAlone testgen-alone.src.xml
$(GENUOBJ): ../@PACKAGE@-codegen uobject.src.xml ../*.xsl
../@PACKAGE@-codegen -l $(top_builddir)/Utilities/codegen -n UObject --no-main uobject.src.xml
$(SHELL) ../@PACKAGE@-codegen -l $(top_builddir)/Utilities/codegen -n UObject --no-main uobject.src.xml
clean-local:
rm -rf $(GENERATED) $(GENERATED2) $(GENUOBJ)
......
......@@ -55,11 +55,40 @@ else
AC_SUBST(EV_CFLAGS)
fi
#check rest api support
AC_MSG_CHECKING([REST API support])
buildapi=true
AC_ARG_ENABLE(api, AC_HELP_STRING([--disable-api], [disable REST API support]),
[ if test $enableval = yes; then buildapi=true; else buildapi=false; fi],[ buildapi=true; ])
REST_API_CFLAGS=
REST_API_CLIBS=
DISABLE_REST_API=
if test ${buildapi} = true; then
AC_MSG_RESULT([enabled])
REST_API_CLIBS="-lPocoJSON"
else
AC_MSG_RESULT([disabled])
REST_API_CFLAGS="-DDISABLE_REST_API"
DISABLE_REST_API=1
fi
AM_CONDITIONAL(DISABLE_REST_API, test ${buildapi} = false)
AC_SUBST(DISABLE_REST_API)
AC_SUBST(REST_API_CFLAGS)
AC_SUBST(REST_API_CLIBS)
#check libpoco support
AC_MSG_CHECKING([libpoco support])
#AC_SEARCH_LIBS(ServerSocket,PocoNet,,exit)
AC_CHECK_HEADER(Poco/Net/Socket.h,,exit)
POCO_LIBS="-lPocoFoundation -lPocoNet -lPocoJSON"
POCO_LIBS="-lPocoFoundation -lPocoNet"
if test ${buildapi} = true; then
POCO_LIBS="$POCO_LIBS -lPocoJSON"
fi
POCO_CFLAGS="-IPoco"
AC_SUBST(POCO_LIBS)
AC_SUBST(POCO_CFLAGS)
......@@ -102,6 +131,18 @@ test "x$IDL" = "x" && AC_MSG_ERROR([*** omniidl not found.])
#AC_SUBST(UNISET_IDLFLAGS)
#check mysql support
AC_MSG_CHECKING([mysql support])
buildmysql=true
AC_ARG_ENABLE(mysql, AC_HELP_STRING([--disable-mysql], [disable MySQL support]),
[ if test $enableval = yes; then buildmysql=true; else buildmysql=false; fi],[ buildmysql=true; ])
if test ${buildmysql} = true; then
AC_MSG_RESULT([enabled])
AC_CHECK_HEADERS([mysql/mysql.h])
AC_CHECK_LIB([mysqlclient],mysql_init,,exit)
else
AC_MSG_RESULT([disabled])
fi
AM_CONDITIONAL(DISABLE_MYSQL, test ${buildmysql} = false)
......@@ -225,26 +266,6 @@ fi
AM_CONDITIONAL(DISABLE_MQTT, test ${buildmqtt} = false)
#check rest api support
AC_MSG_CHECKING([REST API support])
buildapi=true
AC_ARG_ENABLE(api, AC_HELP_STRING([--disable-api], [disable REST API support]),
[ if test $enableval = yes; then buildapi=true; else buildapi=false; fi],[ buildapi=true; ])
REST_API_CFLAGS=
DISABLE_REST_API=
if test ${buildapi} = true; then
AC_MSG_RESULT([enabled])
else
AC_MSG_RESULT([disabled])
REST_API_CFLAGS="-DDISABLE_REST_API"
DISABLE_REST_API=1
fi
AM_CONDITIONAL(DISABLE_REST_API, test ${buildapi} = false)
AC_SUBST(DISABLE_REST_API)
AC_SUBST(REST_API_CFLAGS)
# check Doxygen
DOXYGEN=""
......
......@@ -17,6 +17,7 @@
#ifndef jsonHelpers_H_
#define jsonHelpers_H_
// --------------------------------------------------------------------------
#ifndef DISABLE_REST_API
#include <Poco/JSON/Object.h>
// --------------------------------------------------------------------------
namespace uniset
......@@ -72,4 +73,6 @@ class object
// --------------------------------------------------------------------------
} // end of namespace uniset
// --------------------------------------------------------------------------
#endif // end of #ifndef DISABLE_REST_API
// --------------------------------------------------------------------------
#endif // end of _jsonHelpers_H_
......@@ -7,5 +7,5 @@ Name: libUniSet2
Description: Support library for UniSet
Requires: libxml-2.0 sigc++-2.0 omniORB4 libev
Version: @VERSION@
Libs: -L${libdir} -lUniSet2 -lPocoFoundation -lPocoNet -lPocoJSON
Libs: -L${libdir} -lUniSet2 -lPocoFoundation -lPocoNet @REST_API_CLIBS@
Cflags: -I${includedir}/@PACKAGE@ -D__OMNIORB4 -std=c++11 -D_GLIBCXX_USE_NANOSLEEP @REST_API_CFLAGS@
......@@ -14,6 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// --------------------------------------------------------------------------
#ifndef DISABLE_REST_API
// --------------------------------------------------------------------------
#include "ujson.h"
// --------------------------------------------------------------------------
namespace uniset
......@@ -39,13 +41,13 @@ json::help::item::item( Poco::JSON::Object::Ptr& ptr )
params = ptr->getArray("parameters");
}
// --------------------------------------------------------------------------
json::help::item::item(const std::__cxx11::string& description)
json::help::item::item(const std::string& description)
{
root = new Poco::JSON::Object();
root->set("description", description);
}
// --------------------------------------------------------------------------
void json::help::item::param(const std::__cxx11::string& name, const std::__cxx11::string& description)
void json::help::item::param(const std::string& name, const std::string& description)
{
if( !params )
{
......@@ -128,4 +130,4 @@ Poco::JSON::Array::Ptr json::make_child_array(Poco::JSON::Object::Ptr& root, con
// --------------------------------------------------------------------------
} // end of namespace uniset
// --------------------------------------------------------------------------
#endif // #ifndef DISABLE_REST_API
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