Added all flag to disable mongoose

This commit is contained in:
Caleb Herpin 2021-07-28 16:36:43 -05:00
parent fb41b4cec8
commit 9981865c3e
8 changed files with 62 additions and 30 deletions

View File

@ -149,15 +149,18 @@ ifeq ($(USE_JAVA), 1)
all: java all: java
endif endif
ifeq ($(TRICK_MONGOOSE), 1) #ifeq ($(TRICK_MONGOOSE), 1)
all: webserver #all: webserver
icg_sim_serv: ${TRICK_HOME}/include/mongoose/mongoose.h #icg_sim_serv: ${TRICK_HOME}/include/mongoose/mongoose.h
ICG: ${TRICK_HOME}/include/mongoose/mongoose.h #ICG: ${TRICK_HOME}/include/mongoose/mongoose.h
endif #endif
ifeq ($(TRICK_CIVET), 1)
all: civetweb all: civetweb
icg_sim_serv: civetweb icg_sim_serv: civetweb
ICG: civetweb ICG: civetweb
endif
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# 1.1 Build Trick-core # 1.1 Build Trick-core
no_dp: $(TRICK_LIB) $(TRICK_SWIG_LIB) no_dp: $(TRICK_LIB) $(TRICK_SWIG_LIB)

View File

@ -346,20 +346,32 @@ AC_ARG_ENABLE([offline],
AC_SUBST([TRICK_OFFLINE]) AC_SUBST([TRICK_OFFLINE])
# If offline is specified, set some compilation flags # If offline is specified, set some compilation flags
AC_ARG_ENABLE([mongoose], #AC_ARG_ENABLE([mongoose],
AS_HELP_STRING([--enable-mongoose], [Compile Trick with webserver capabilites.]), # AS_HELP_STRING([--enable-mongoose], [Compile Trick with webserver capabilites.]),
AS_IF([test "x$enable_mongoose" = xyes], # AS_IF([test "x$enable_mongoose" = xyes],
# [
# TRICK_MONGOOSE="1"
# AC_MSG_WARN($(tput setaf 1) --enable-mongoose Mongoose is released under GPLv2 and Trick is \
#released under NASA Open Source Agreement 1.3. Distribution must comply with \
#these agreements$(tput sgr0))
# ],
# [TRICK_MONGOOSE="0"]
# ),
# [TRICK_MONGOOSE="0"]
#)
#AC_SUBST([TRICK_MONGOOSE])
AC_ARG_ENABLE([civet],
AS_HELP_STRING([--disable-civet], [Compilel Trick without webserver capabilities.]),
AS_IF([test "x$disable_mongoose" = xyes]),
[ [
TRICK_MONGOOSE="1" TRICK_CIVET="0"
AC_MSG_WARN($(tput setaf 1) --enable-mongoose Mongoose is released under GPLv2 and Trick is \ ],
released under NASA Open Source Agreement 1.3. Distribution must comply with \ [TRICK_CIVET="1"]
these agreements$(tput sgr0))
],
[TRICK_MONGOOSE="0"]
), ),
[TRICK_MONGOOSE="0"] [TRICK_CIVET="0"]
) )
AC_SUBST([TRICK_MONGOOSE]) AC_SUBST([TRICK_CIVET])
# If offline is specified, set some compilation flags # If offline is specified, set some compilation flags
AC_ARG_ENABLE([offline], AC_ARG_ENABLE([offline],

View File

@ -4,6 +4,8 @@ PURPOSE: (Represent the state and initial conditions of an http server.)
#ifndef CIVET_SERVER_H #ifndef CIVET_SERVER_H
#define CIVET_SERVER_H #define CIVET_SERVER_H
#ifdef USE_CIVET
#include <string> #include <string>
#include <map> #include <map>
#include <pthread.h> #include <pthread.h>
@ -78,3 +80,4 @@ struct Data {
}; };
#endif #endif
#endif

View File

@ -4,6 +4,7 @@ PURPOSE: (Represent Websocket connection.)
#ifndef WEB_SOCKET_SESSION_HH #ifndef WEB_SOCKET_SESSION_HH
#define WEB_SOCKET_SESSION_HH #define WEB_SOCKET_SESSION_HH
#ifdef USE_CIVET
#include <string> #include <string>
#ifndef SWIG #ifndef SWIG
#include "civet/CivetServer.h" #include "civet/CivetServer.h"
@ -27,3 +28,4 @@ class WebSocketSession {
}; };
#endif #endif
#endif

View File

@ -99,11 +99,14 @@
#include "trick/lqueue.h" #include "trick/lqueue.h"
#include "trick/lstack.h" #include "trick/lstack.h"
#ifdef USE_MONGOOSE //#ifdef USE_MONGOOSE
#include "trick/WebServer.hh" //#include "trick/WebServer.hh"
#include "trick/WebSocketSession.hh" //#include "trick/WebSocketSession.hh"
#endif //#endif
#ifdef USE_CIVET
#include "trick/MyCivetServer.hh" #include "trick/MyCivetServer.hh"
#include "trick/WebSocketSession.hh" #include "trick/WebSocketSession.hh"
#endif
#endif #endif

View File

@ -171,15 +171,19 @@ ifneq ($(GSL_HOME),)
TRICK_SYSTEM_CXXFLAGS += -D_HAVE_GSL TRICK_SYSTEM_CXXFLAGS += -D_HAVE_GSL
endif endif
ifeq (${TRICK_MONGOOSE},1) #ifeq (${TRICK_MONGOOSE},1)
TRICK_LIBS += -ltrickHTTP ${TRICK_LIB_DIR}/libmongoose.a # TRICK_LIBS += -ltrickHTTP ${TRICK_LIB_DIR}/libmongoose.a
TRICK_SWIG_FLAGS += -DUSE_MONGOOSE # TRICK_SWIG_FLAGS += -DUSE_MONGOOSE
TRICK_SYSTEM_CXXFLAGS += -DUSE_MONGOOSE # TRICK_SYSTEM_CXXFLAGS += -DUSE_MONGOOSE
TRICK_ICG_EXCLUDE += :${TRICK_HOME}/include/mongoose # TRICK_ICG_EXCLUDE += :${TRICK_HOME}/include/mongoose
endif #endif
TRICK_LIBS += ${TRICK_LIB_DIR}/libcivetweb.a ${TRICK_LIB_DIR}/libtrickCivet.a ifeq (${TRICK_MONGOOSE},1)
TRICK_ICG_EXCLUDE += ${TRICK_HOME}/include/civet TRICK_LIBS += ${TRICK_LIB_DIR}/libcivetweb.a ${TRICK_LIB_DIR}/libtrickCivet.a
TRICK_SWIG_FLAGS += DUSE_CIVET
TRICK_SYSTEM_CXXFLAGS += -DUSE_CIVET
TRICK_ICG_EXCLUDE += ${TRICK_HOME}/include/civet
endif
# We pipe the output of compiler through tee. If the user wanted gcc color, make sure they get it. # We pipe the output of compiler through tee. If the user wanted gcc color, make sure they get it.
ifdef GCC_COLORS ifdef GCC_COLORS

View File

@ -18,6 +18,7 @@ JAVAC = @JAVA_CC@
TRICK_OFFLINE = @TRICK_OFFLINE@ TRICK_OFFLINE = @TRICK_OFFLINE@
TRICK_MONGOOSE = @TRICK_MONGOOSE@ TRICK_MONGOOSE = @TRICK_MONGOOSE@
TRICK_CIVET = @TRICK_CIVET@
USE_X_WINDOWS = @USE_X_WINDOWS@ USE_X_WINDOWS = @USE_X_WINDOWS@

View File

@ -52,8 +52,12 @@ ifeq ($(USE_ER7_UTILS_CHECKPOINTHELPER), 1)
SWIG_DEFS += -DUSE_ER7_UTILS_CHECKPOINTHELPER SWIG_DEFS += -DUSE_ER7_UTILS_CHECKPOINTHELPER
endif endif
ifeq ($(TRICK_MONGOOSE), 1) #ifeq ($(TRICK_MONGOOSE), 1)
SWIG_DEFS += -DUSE_MONGOOSE #SWIG_DEFS += -DUSE_MONGOOSE
#endif
ifeq ($(TRICK_CIVET), 1)
SWIG_DEFS += -DUSE_CIVET
endif endif
default: $(SWIG_OBJECT_FILES) $(TRICK_LIB) $(TEST_DIR) default: $(SWIG_OBJECT_FILES) $(TRICK_LIB) $(TEST_DIR)