add --enable-mongoose, disable by default #943

This commit is contained in:
Scott Fennell 2020-02-05 13:27:26 -06:00
parent a9f36b6dcc
commit 117bf3ebfb
11 changed files with 26 additions and 7 deletions

View File

@ -312,7 +312,7 @@ these agreements$(tput sgr0))
),
[TRICK_MONGOOSE="0"]
)
AC_SUBST([TRICK_OFFLINE])
AC_SUBST([TRICK_MONGOOSE])
# If offline is specified, set some compilation flags
AC_ARG_ENABLE([offline],

1
configure vendored
View File

@ -674,6 +674,7 @@ ac_ct_CC
CFLAGS
CC
AWK
TRICK_MONGOOSE
TRICK_OFFLINE
TRICK_FORCE_32BIT
LIBXML

View File

@ -4,6 +4,8 @@ PURPOSE: (Represent the state and initial conditions of an http server.)
#ifndef WEB_SERVER_H
#define WEB_SERVER_H
#if !defined(SWIG) || defined(USE_MONGOOSE)
#include <string>
#include <map>
#include <pthread.h>
@ -62,4 +64,6 @@ class WebServer {
void handleHTTPGETrequest(struct mg_connection *nc, http_message *hm, std::string handlerName);
void marshallWebSocketSessionData();
};
#endif
#endif

View File

@ -4,6 +4,7 @@ PURPOSE: (Represent Websocket connection.)
#ifndef WEB_SOCKET_SESSION_HH
#define WEB_SOCKET_SESSION_HH
#if !defined(SWIG) || defined(USE_MONGOOSE)
#include <string>
#ifndef SWIG
#include "mongoose/mongoose.h"
@ -25,4 +26,6 @@ class WebSocketSession {
struct mg_connection* connection;
};
#endif
#endif

View File

@ -65,7 +65,7 @@ export TRICK_PYTHON_PATH := $(TRICK_PYTHON_PATH)
export TRICK_GTE_EXT := $(TRICK_GTE_EXT)
export TRICK_HOST_CPU := $(shell TRICK_FORCE_32BIT=$(TRICK_FORCE_32BIT) $(TRICK_HOME)/bin/trick-gte TRICK_HOST_CPU)
export TRICK_EXEC_LINK_LIBS := ${PTHREAD_LIBS} $(PYTHON_LIB) $(UDUNITS_LDFLAGS) $(PLATFORM_LIBS) -lm -ldl
export TRICK_LIBS := ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm -ltrickHTTP ${TRICK_LIB_DIR}/libmongoose.a
export TRICK_LIBS := ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm
export TRICK_SYSTEM_LDFLAGS := $(TRICK_SYSTEM_LDFLAGS)
export TRICK_SWIG_FLAGS := $(TRICK_SWIG_FLAGS)
export TRICK_SWIG_CFLAGS := $(TRICK_SWIG_CFLAGS)
@ -171,6 +171,11 @@ ifneq ($(GSL_HOME),)
TRICK_SYSTEM_CXXFLAGS += -D_HAVE_GSL
endif
ifeq (${TRICK_MONGOOSE},1)
TRICK_LIBS += -ltrickHTTP ${TRICK_LIB_DIR}/libmongoose.a
TRICK_SWIG_FLAGS += -DUSE_MONGOOSE
endif
# We pipe the output of compiler through tee. If the user wanted gcc color, make sure they get it.
ifdef GCC_COLORS
TRICK_SYSTEM_CXXFLAGS += -fdiagnostics-color=always

View File

@ -1,2 +1,3 @@
exec(open("Modified_data/realtime.py").read())
exec(open("Modified_data/cannon.dr").read())

View File

@ -9,7 +9,7 @@ LIBRARY DEPENDENCIES:
*************************************************************/
#include "sim_objects/default_trick_sys.sm"
#include "sim_objects/WebServer.sm"
// #include "sim_objects/WebServer.sm"
##include "cannon/gravity/include/cannon_numeric.h"
class CannonSimObject : public Trick::SimObject {

View File

@ -7,9 +7,7 @@ exec(open("Modified_data/realtime.py").read())
#==========================================
varServerPort = trick.var_server_get_port();
trick.set_var_server_info_msg_on()
web.server.enable=True
print(varServerPort)
MsdGui_path = "models/graphics/dist/MsdGui.jar"
if (os.path.isfile(MsdGui_path)) :

View File

@ -13,7 +13,7 @@ LIBRARY DEPENDENCIES:
*************************************************************/
#include "sim_objects/default_trick_sys.sm"
#include "sim_objects/WebServer.sm"
// #include "sim_objects/WebServer.sm"
##include "msd/include/msd.hh"

View File

@ -1,2 +1,2 @@
TRICK_CFLAGS += -Imodels
TRICK_CXXFLAGS += -Imodels
TRICK_CXXFLAGS += -Imodels

View File

@ -52,6 +52,13 @@ ifeq ($(USE_ER7_UTILS_CHECKPOINTHELPER), 1)
SWIG_DEFS += -DUSE_ER7_UTILS_CHECKPOINTHELPER
endif
ifeq ($(TRICK_MONGOOSE), 1)
SWIG_DEFS += -DUSE_MONGOOSE
endif
foo:
echo ${SWIG_DEFS}
default: $(SWIG_OBJECT_FILES) $(TRICK_LIB) $(TEST_DIR)
trick: $(SWIG_OBJECT_FILES) $(OBJECT_FILES) $(TEST_DIR)