diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 8f108929..c4adcbe2 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -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], diff --git a/configure b/configure index e063d43e..2f7e46fc 100755 --- a/configure +++ b/configure @@ -674,6 +674,7 @@ ac_ct_CC CFLAGS CC AWK +TRICK_MONGOOSE TRICK_OFFLINE TRICK_FORCE_32BIT LIBXML diff --git a/include/trick/WebServer.hh b/include/trick/WebServer.hh index 86c15897..b9547488 100644 --- a/include/trick/WebServer.hh +++ b/include/trick/WebServer.hh @@ -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 #include #include @@ -62,4 +64,6 @@ class WebServer { void handleHTTPGETrequest(struct mg_connection *nc, http_message *hm, std::string handlerName); void marshallWebSocketSessionData(); }; + +#endif #endif diff --git a/include/trick/WebSocketSession.hh b/include/trick/WebSocketSession.hh index e9421aae..3df297ce 100644 --- a/include/trick/WebSocketSession.hh +++ b/include/trick/WebSocketSession.hh @@ -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 #ifndef SWIG #include "mongoose/mongoose.h" @@ -25,4 +26,6 @@ class WebSocketSession { struct mg_connection* connection; }; + +#endif #endif diff --git a/share/trick/makefiles/Makefile.common b/share/trick/makefiles/Makefile.common index b9eda540..3db3e69c 100644 --- a/share/trick/makefiles/Makefile.common +++ b/share/trick/makefiles/Makefile.common @@ -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 diff --git a/trick_sims/Cannon/SIM_cannon_numeric/RUN_test/input.py b/trick_sims/Cannon/SIM_cannon_numeric/RUN_test/input.py index 20e2a266..e544b3a4 100644 --- a/trick_sims/Cannon/SIM_cannon_numeric/RUN_test/input.py +++ b/trick_sims/Cannon/SIM_cannon_numeric/RUN_test/input.py @@ -1,2 +1,3 @@ + exec(open("Modified_data/realtime.py").read()) exec(open("Modified_data/cannon.dr").read()) diff --git a/trick_sims/Cannon/SIM_cannon_numeric/S_define b/trick_sims/Cannon/SIM_cannon_numeric/S_define index 6ca52f4a..48b554c0 100644 --- a/trick_sims/Cannon/SIM_cannon_numeric/S_define +++ b/trick_sims/Cannon/SIM_cannon_numeric/S_define @@ -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 { diff --git a/trick_sims/SIM_msd/RUN_test/input.py b/trick_sims/SIM_msd/RUN_test/input.py index 10ce8531..41af5a9a 100644 --- a/trick_sims/SIM_msd/RUN_test/input.py +++ b/trick_sims/SIM_msd/RUN_test/input.py @@ -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)) : diff --git a/trick_sims/SIM_msd/S_define b/trick_sims/SIM_msd/S_define index f40ce800..dd387473 100644 --- a/trick_sims/SIM_msd/S_define +++ b/trick_sims/SIM_msd/S_define @@ -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" diff --git a/trick_sims/SIM_msd/S_overrides.mk b/trick_sims/SIM_msd/S_overrides.mk index 1b84a37b..e1f6cccd 100644 --- a/trick_sims/SIM_msd/S_overrides.mk +++ b/trick_sims/SIM_msd/S_overrides.mk @@ -1,2 +1,2 @@ TRICK_CFLAGS += -Imodels -TRICK_CXXFLAGS += -Imodels \ No newline at end of file +TRICK_CXXFLAGS += -Imodels diff --git a/trick_source/trick_swig/Makefile b/trick_source/trick_swig/Makefile index 6a1b58fb..fe4a8e89 100644 --- a/trick_source/trick_swig/Makefile +++ b/trick_source/trick_swig/Makefile @@ -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)