From e388de9cf524977c36b523e31ad9d75816207ff5 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 29 Jul 2008 12:52:50 +0000 Subject: Added configure option to remove pentominos support. --- server/configure.in | 17 ++++++++++++++++- server/src/Makefile.am | 2 +- server/src/server.cc | 8 ++++++-- server/xml/macros/example.xml | 33 +++++++++++++++------------------ 4 files changed, 38 insertions(+), 22 deletions(-) diff --git a/server/configure.in b/server/configure.in index 624df8e..79a14e1 100644 --- a/server/configure.in +++ b/server/configure.in @@ -6,12 +6,27 @@ AM_INIT_AUTOMAKE( pracrod, 0.0.1 ) dnl ====================== dnl Compile with debug options dnl ====================== -AC_ARG_WITH(debug, [ --with-debug build with debug support]) +AC_ARG_WITH(debug, + [ --with-debug build with debug support (default=no)], + [with_debug=yes], + [with_debug=no]) if test x$with_debug == xyes; then AC_MSG_WARN([*** Building with debug support!]) CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Werror -g -O0" fi +dnl ====================== +dnl Compile without pentominos support +dnl ====================== +AC_ARG_WITH(pentominos, + [ --with-pentominos build without pentominos support (default=yes)], + [], + [with_pentominos=yes]) +if test x$with_pentominos == xno; then + AC_MSG_WARN([*** Building without pentominos support!]) + CXXFLAGS="$CXXFLAGS -DWITHOUT_PENTOMINOS" +fi + AC_PROG_CXX AC_PROG_LIBTOOL diff --git a/server/src/Makefile.am b/server/src/Makefile.am index 6e197c2..93d830a 100644 --- a/server/src/Makefile.am +++ b/server/src/Makefile.am @@ -82,7 +82,7 @@ test_macroparser: macroparser.cc @../../tools/test macroparser.cc saxparser.cc exception.cc log.cc -lexpat -DXML="\"../xml\"" test_server: server.cc - @../../tools/test server.cc templateparser.cc saxparser.cc queryparser.cc queryhandler.cc luaquerymapper.cc tcpsocket.cc exception.cc log.cc configuration.cc transactionparser.cc widgetgenerator.cc -lexpat $(LUA_LIBS) $(CONFIG_LIBS) -DXML="\"../xml\"" + @../../tools/test server.cc templateparser.cc saxparser.cc queryparser.cc queryhandler.cc luaquerymapper.cc tcpsocket.cc exception.cc log.cc configuration.cc transactionparser.cc widgetgenerator.cc database.cc macroparser.cc xml_encode_decode.cc -lexpat $(LUA_LIBS) $(CONFIG_LIBS) $(PQXX_LIBS) $(PQXX_CXXFLAGS) -DXML="\"../xml\"" #killall -9 test_server diff --git a/server/src/server.cc b/server/src/server.cc index c0ec223..54a2616 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -129,7 +129,8 @@ static void connection(TCPSocket &socket) tp.parse(); Template *templ = tp.getTemplate(); - + +#ifndef WITHOUT_PENTOMINOS // Send the queries to Pentominos (if any) TCPSocket s; s.connect("localhost", 11108); @@ -151,7 +152,10 @@ static void connection(TCPSocket &socket) std::string result = qh.exec(); printf("Got result: [%s]\n", result.c_str()); - +#else + std::string result = ""; +#endif/*WITHOUT_PENTOMINOS*/ + // Parse the result from the queries to pentominos QueryParser qp(result); qp.parse(); diff --git a/server/xml/macros/example.xml b/server/xml/macros/example.xml index f875747..eafcf33 100644 --- a/server/xml/macros/example.xml +++ b/server/xml/macros/example.xml @@ -19,12 +19,11 @@ lensmeter.right.cyl and lensmeter.right.cyl.value and lensmeter.right.cyl.timestamp ) - then - timestamp = lensmeter.right.cyl.value - value = lensmeter.right.cyl.value end - end + then + timestamp = lensmeter.right.cyl.value + value = lensmeter.right.cyl.value end - + return value, timestamp @@ -44,7 +43,7 @@ @@ -61,18 +60,16 @@ - -