Skip to content

Commit

Permalink
Added corba stuff to configure and made it an optional package
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1161 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
levsa committed Apr 25, 2004
1 parent dc83df8 commit e6f2b05
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
22 changes: 16 additions & 6 deletions mosh/src/Makefile.in
Expand Up @@ -12,19 +12,29 @@ PARSE_LIBP = -L../../modelica_parser/src
READLINE_INCP = -I@readlineinc@
READLINE_LIBP = -L@readlinelib@

CORBAIMPL = -I../../modeq/runtime
USE_CORBA = @USE_CORBA@
CORBAHOME = @CORBAHOME@

CORBAOBJS = ../../modeq/runtime/modeq_communication.o \
ifdef USE_CORBA
CORBAIMPL = -I../../modeq/runtime
CORBAOBJS = ../../modeq/runtime/modeq_communication.o \
../../modeq/runtime/modeq_communication_impl.o

INCP = $(ANTLR_INCP) $(PARSE_INCP) $(READLINE_INCP) $(CORBAIMPL)
CORBALIB = -L$(CORBAHOME)/lib -lmico
CORBAINC = -I$(CORBAHOME)/include
else
CORBAIMPL =
CORBAOBJS =
CORBALIB =
endif

INCP = $(ANTLR_INCP) $(PARSE_INCP) $(READLINE_INCP) $(CORBAIMPL) $(CORBAINC)
LIBP = $(ANTLR_LIBP) $(PARSE_LIBP) $(READLINE_LIBP)

CFLAGS = $(INCP) -g -Wall -DDEBUG
CFLAGS = $(INCP) -g -Wall -DDEBUG $(USE_CORBA)
CXXFLAGS = $(CFLAGS)
LINKFLAGS = $(LIBP)

LIBS = -lantlr -lmodelica_parser -lreadline -ltermcap -lssl -lmico -lcrypto -lm -lpthread
LIBS = -lantlr -lmodelica_parser -lreadline -ltermcap -lssl $(CORBALIB) -lcrypto -lm -lpthread


OBJS += mosh.o options.o
Expand Down
13 changes: 11 additions & 2 deletions mosh/src/mosh.cpp
Expand Up @@ -42,9 +42,10 @@

#include <sys/param.h> /* MAXPATHLEN */
#include "options.h"
#ifdef USE_CORBA
#include <CORBA.h>
#include "modeq_communication.h"

#endif

using namespace std;

Expand All @@ -56,6 +57,7 @@ char * check_moshhome(void);
void init_sockaddr (struct sockaddr_in *name,
const char *hostname,
int port);

void doCorbaCommunication(int argc, char **argv,const string *);
void doSocketCommunication(const string*);

Expand Down Expand Up @@ -132,6 +134,7 @@ int main(int argc, char* argv[])
return EXIT_SUCCESS;
}

#ifdef USE_CORBA
void doCorbaCommunication(int argc, char **argv, const string *scriptname)
{
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv);
Expand Down Expand Up @@ -187,7 +190,13 @@ void doCorbaCommunication(int argc, char **argv, const string *scriptname)
write_history(historyfile);
history_truncate_file(historyfile, maxhistoryfileentries);
}

#else
void doCorbaCommunication(int argc, char **argv, const string *scriptname)
{
cerr << "CORBA support disabled. configure with --with-CORBA to enable and recompile." << endl;
exit(1);
}
#endif

void doSocketCommunication(const string * scriptname)
{
Expand Down

0 comments on commit e6f2b05

Please sign in to comment.