From 91feb6780c8458b72816be01501b731b1bd476a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Wed, 21 Apr 2010 09:18:43 +0000 Subject: [PATCH] - Added support for omniORB in qtclients. + We can now remove the dependency on mico for Linux systems. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5344 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/omc_debug/Makefile.in | 5 +- Compiler/omc_profiler/Makefile.in | 5 +- Compiler/omc_release/Makefile.in | 5 +- Compiler/runtime/Makefile.in | 3 +- Makefile.in | 4 +- configure | 191 ++++++++++++++++++++++++------ configure.in | 87 ++++++++------ 7 files changed, 212 insertions(+), 88 deletions(-) diff --git a/Compiler/omc_debug/Makefile.in b/Compiler/omc_debug/Makefile.in index 35cbf72eb63..5ab496b6c80 100644 --- a/Compiler/omc_debug/Makefile.in +++ b/Compiler/omc_debug/Makefile.in @@ -21,7 +21,6 @@ RMLINC = -I$(RMLHOME)/include/plain USE_CORBA = @USE_CORBA@ -CORBAHOME = @CORBAHOME@ EXEEXT = @EXEEXT@ @@ -35,10 +34,8 @@ builddir_doc=$(top_builddir)/build/doc include $(srcdir)/Makefile.common -CORBALIB=`mico-config --libs` - ifdef USE_CORBA - CORBALIBS=$(CORBALIB) + CORBALIBS=@CORBALIBS@ else CORBALIBS= endif diff --git a/Compiler/omc_profiler/Makefile.in b/Compiler/omc_profiler/Makefile.in index 8f94dbf2fa5..dc9c0d566fb 100644 --- a/Compiler/omc_profiler/Makefile.in +++ b/Compiler/omc_profiler/Makefile.in @@ -21,7 +21,6 @@ RMLINC = -I$(RMLHOME)/include/plain USE_CORBA = @USE_CORBA@ -CORBAHOME = @CORBAHOME@ EXEEXT = @EXEEXT@ @@ -35,10 +34,8 @@ builddir_doc=$(top_builddir)/build/doc include $(srcdir)/Makefile.common -CORBALIB=`mico-config --libs` - ifdef USE_CORBA - CORBALIBS=$(CORBALIB) + CORBALIBS=$CORBALIBS$ else CORBALIBS= endif diff --git a/Compiler/omc_release/Makefile.in b/Compiler/omc_release/Makefile.in index a664f9d9705..4c51eccb442 100644 --- a/Compiler/omc_release/Makefile.in +++ b/Compiler/omc_release/Makefile.in @@ -14,7 +14,6 @@ LIBSOCKET = @LIBSOCKET@ LIBLPSOLVE55 = @LIBLPSOLVE55@ USE_CORBA = @USE_CORBA@ -CORBAHOME = @CORBAHOME@ SHELL = /bin/sh CC = gcc @@ -32,10 +31,8 @@ builddir_inc=$(top_builddir)/build/include builddir_doc=$(top_builddir)/build/doc include $(srcdir)/Makefile.common -CORBALIB=`mico-config --libs` - ifdef USE_CORBA - CORBALIBS=$(CORBALIB) + CORBALIBS=@CORBALIBS@ else CORBALIBS= endif diff --git a/Compiler/runtime/Makefile.in b/Compiler/runtime/Makefile.in index 174c51ec3b4..32769dc3ad3 100644 --- a/Compiler/runtime/Makefile.in +++ b/Compiler/runtime/Makefile.in @@ -14,14 +14,13 @@ builddir_inc=$(top_builddir)/build/include builddir_doc=$(top_builddir)/build/doc USE_CORBA = @USE_CORBA@ -CORBAHOME = @CORBAHOME@ RMLINCLUDE = @rmlinc@ CFLAGS = @DEFS@ $(USE_CORBA) ifdef USE_CORBA CORBASRC = omc_communication.cc omc_communication_impl.cpp corbaimpl.cpp - CORBAINCL = -I$(CORBAHOME)/include + CORBAINCL = @CORBACFLAGS@ else CORBASRC = corbaimpl_stub.cpp CORBAINCL = diff --git a/Makefile.in b/Makefile.in index b7e3670ed66..5b3221f7708 100644 --- a/Makefile.in +++ b/Makefile.in @@ -63,9 +63,9 @@ qtclients: mkbuilddirs echo "environment variable QTHOME should be defined" echo "Coin3D (www.coin3d.org) and SoQt should be installed and in the path!" echo "using QTHOME=${QTHOME}" - (cd OMShell && qmake && make && cp -p OMShell ../$(builddir_bin)/.) + (cd OMShell && @IDLCMD@ ../Compiler/runtime/omc_communication.idl && CORBALIBS="@CORBALIBS@" CORBAINCL="@CORBACFLAGS@" qmake && make && cp -p OMShell ../$(builddir_bin)/.) (cd OMNotebook/ext && qmake && make && cp -p ext ../../$(builddir_bin)/.) - (cd OMNotebook/OMNotebookQT4 && qmake && make && cp -p OMNotebook *.xml ../../$(builddir_bin)/.) + (cd OMNotebook/OMNotebookQT4 && @IDLCMD@ ../../Compiler/runtime/omc_communication.idl && USE_CORBA="@QT_USE_CORBA@" CORBALIBS="@CORBALIBS@" CORBAINCL="@CORBACFLAGS@" qmake && make && cp -p OMNotebook *.xml ../../$(builddir_bin)/.) clean: (cd c_runtime && $(MAKE) -f Makefile clean) diff --git a/configure b/configure index 5c3d6ae6760..6b815a849a3 100755 --- a/configure +++ b/configure @@ -611,7 +611,8 @@ BOOSTHOME USE_MODPAR IDLCMD CORBALIBS -CORBAHOME +CORBACFLAGS +QT_USE_CORBA USE_CORBA LIBLPSOLVE55 LIBNSL @@ -666,6 +667,8 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_CORBA +with_MICO +with_ORBIT2 with_omniORB with_MODPAR with_BOOST @@ -1286,8 +1289,10 @@ if test -n "$ac_init_help"; then Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-CORBA=DIR use corba installed in DIR /usr/local - --with-omniORB=DIR use omniORB installed in DIR + --with-CORBA=DIR use mico corba installed in DIR (or use mico-config) + --with-MICO=DIR use mico corba installed in DIR (or use mico-config) + --with-ORBIT2=DIR use orbit2 installed in DIR (or use orbit2-config) + --with-omniORB=DIR use omniORB installed in DIR --with-MODPAR Compile with automatic parallelization, requires boost --with-BOOST=DIR With BOOST library in DIR @@ -2150,6 +2155,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3961,7 +3967,7 @@ _ACEOF LIBS="-llpsolve55 $LIBS" else - as_fn_error "not found" "$LINENO" 5 + as_fn_error "linking failed" "$LINENO" 5 fi LIBLPSOLVE55=$LIBS @@ -4079,54 +4085,162 @@ fi # Check whether --with-CORBA was given. if test "${with_CORBA+set}" = set; then : - withval=$with_CORBA; -if test "x$withval" = "xno" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabling CORBA" >&5 -$as_echo "disabling CORBA" >&6; }; - USE_CORBA=""; - CORBAHOME=""; - CORBALIBS=""; - IDLCMD=""; + withval=$with_CORBA; WANT_MICO="$withval" else - if test "x$withval" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling CORBA... CORBAHOME=\"/usr/local\"" >&5 -$as_echo "enabling CORBA... CORBAHOME=\"/usr/local\"" >&6; }; - USE_CORBA="-DUSE_CORBA"; - CORBAHOME="/usr/local"; - CORBALIBS="-lmico -lcrypto -lssl -lpthread"; - IDLCMD="idl"; - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling CORBA... CORBAHOME=\"$withval\"" >&5 -$as_echo "enabling CORBA... CORBAHOME=\"$withval\"" >&6; }; - USE_CORBA="-DUSE_CORBA"; - CORBAHOME="$withval"; - CORBALIBS="-lmico -lcrypto -lssl -lpthread"; - IDLCMD="idl"; - fi + WANT_MICO="no" fi -else - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabling CORBA (no CORBAHOME given)" >&5 -$as_echo "disabling CORBA (no CORBAHOME given)" >&6; }; USE_CORBA=""; CORBAHOME="";CORBALIBS="";IDLCMD=""; +# Check whether --with-MICO was given. +if test "${with_MICO+set}" = set; then : + withval=$with_MICO; WANT_MICO="$withval" fi +# Check whether --with-ORBIT2 was given. +if test "${with_ORBIT2+set}" = set; then : + withval=$with_ORBIT2; WANT_ORBIT2="$withval" +else + WANT_ORBIT2="no" +fi + # Check whether --with-omniORB was given. if test "${with_omniORB+set}" = set; then : - withval=$with_omniORB; - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling omniORB... CORBAHOME=\"$withval\"" >&5 -$as_echo "enabling omniORB... CORBAHOME=\"$withval\"" >&6; }; - USE_CORBA="-DUSE_CORBA -DUSE_OMNIORB"; - CORBALIBS="-lomniORB4 -lomnithread -lpthread"; - CORBAHOME="$withval"; - IDLCMD="omniidl -bcxx -Wbh=.h -Wbs=.cc"; + withval=$with_omniORB; WANT_OMNIORB="$withval" +else + WANT_OMNIORB="no" +fi + + +if test ! "$WANT_MICO" = "no"; then + if test "$WANT_MICO" = "yes"; then + MICO="mico-config"; + else + MICO="$withval/bin/mico-config"; + fi + # Extract the first word of "$MICO", so it can be a program name with args. +set dummy $MICO; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_USE_CORBA+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$USE_CORBA"; then + ac_cv_prog_USE_CORBA="$USE_CORBA" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_USE_CORBA="-DUSE_CORBA -DUSE_MICO" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_USE_CORBA" && ac_cv_prog_USE_CORBA="no" +fi +fi +USE_CORBA=$ac_cv_prog_USE_CORBA +if test -n "$USE_CORBA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_CORBA" >&5 +$as_echo "$USE_CORBA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "$USE_CORBA" = "no"; then + as_fn_error "failed to find mico-corba" "$LINENO" 5 + fi + QT_USE_CORBA="USE_MICO" + CORBACFLAGS=-I`mico-config --prefix`/include; + CORBALIBS=`mico-config --libs`; + IDLCMD="idl"; + DESIRED_CORBA="mico" +elif test ! "$WANT_ORBIT2" = "no"; then + if test "$WANT_ORBIT2" = "yes"; then + ORBIT2="orbit2-config"; + else + ORBIT2="$withval/bin/orbit2-config"; + fi + # Extract the first word of "$ORBIT2", so it can be a program name with args. +set dummy $ORBIT2; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_USE_CORBA+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$USE_CORBA"; then + ac_cv_prog_USE_CORBA="$USE_CORBA" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_USE_CORBA="-DUSE_CORBA -DUSE_ORBIT2" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_USE_CORBA" && ac_cv_prog_USE_CORBA="no" +fi +fi +USE_CORBA=$ac_cv_prog_USE_CORBA +if test -n "$USE_CORBA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_CORBA" >&5 +$as_echo "$USE_CORBA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$USE_CORBA" = "no"; then + as_fn_error "failed to find orbit2" "$LINENO" 5 + fi + QT_USE_CORBA="USE_ORBIT2" + CORBACFLAGS=`orbit2-config --cflags`; + CORBALIBS=`orbit2-config --libs`; + IDLCMD="orbit-idl-2"; + DESIRED_CORBA="orbit2" + as_fn_error "ORBIT2 is not supported yet" "$LINENO" 5 +elif test ! "$WANT_OMNIORB" = "no"; then + if test "$WANT_OMNIORB" = "yes"; then + WANT_OMNIORB="/usr"; + fi + USE_CORBA="-DUSE_CORBA -DUSE_OMNIORB"; + QT_USE_CORBA="USE_OMNIORB" + CORBALIBS="-lomniORB4 -lomnithread -lpthread"; + CORBACFLAGS="-I$WANT_OMNIORB/include"; + IDLCMD="omniidl -bcxx -Wbh=.h -Wbs=.cc"; + DESIRED_CORBA="omniorb" +else + USE_CORBA=""; + CORBACFLAGS=""; + CORBALIBS=""; + IDLCMD=""; + DESIRED_CORBA="none" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if CORBA is desired" >&5 +$as_echo_n "checking if CORBA is desired... " >&6; }; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DESIRED_CORBA" >&5 +$as_echo "$DESIRED_CORBA" >&6; }; + # Check whether --with-MODPAR was given. @@ -5322,4 +5436,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi - diff --git a/configure.in b/configure.in index ab424d53ce4..569c6be84fa 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,8 @@ AC_SUBST(LIBSOCKET) AC_SUBST(LIBNSL) AC_SUBST(LIBLPSOLVE55) AC_SUBST(USE_CORBA) -AC_SUBST(CORBAHOME) +AC_SUBST(QT_USE_CORBA) +AC_SUBST(CORBACFLAGS) AC_SUBST(CORBALIBS) AC_SUBST(IDLCMD) AC_SUBST(USE_MODPAR) @@ -181,41 +182,62 @@ AC_CHECK_FUNC(gethostbyname, dnl should we use corba? -AC_ARG_WITH(CORBA, [ --with-CORBA=DIR use corba installed in DIR [/usr/local]], -[ -if test "x$withval" = "xno" ; then - AC_MSG_RESULT([disabling CORBA]); - USE_CORBA=""; - CORBAHOME=""; - CORBALIBS=""; - IDLCMD=""; -else - if test "x$withval" = "xyes"; then - AC_MSG_RESULT([enabling CORBA... CORBAHOME="/usr/local"]); - USE_CORBA="-DUSE_CORBA"; - CORBAHOME="/usr/local"; - CORBALIBS="-lmico -lcrypto -lssl -lpthread"; - IDLCMD="idl"; +AC_ARG_WITH(CORBA, [ --with-CORBA=DIR use mico corba installed in DIR (or use mico-config)],[WANT_MICO="$withval"],[WANT_MICO="no"]) +AC_ARG_WITH(MICO, [ --with-MICO=DIR use mico corba installed in DIR (or use mico-config)],[WANT_MICO="$withval"],[]) +AC_ARG_WITH(ORBIT2, [ --with-ORBIT2=DIR use orbit2 installed in DIR (or use orbit2-config)],[WANT_ORBIT2="$withval"],[WANT_ORBIT2="no"]) +AC_ARG_WITH(omniORB,[ --with-omniORB=DIR use omniORB installed in DIR],[WANT_OMNIORB="$withval"],[WANT_OMNIORB="no"]) + +if test ! "$WANT_MICO" = "no"; then + if test "$WANT_MICO" = "yes"; then + MICO="mico-config"; + else + MICO="$withval/bin/mico-config"; + fi + AC_CHECK_PROG(USE_CORBA,$MICO,[-DUSE_CORBA -DUSE_MICO],[no]) + if test "$USE_CORBA" = "no"; then + AC_MSG_ERROR([failed to find mico-corba]) + fi + QT_USE_CORBA="USE_MICO" + CORBACFLAGS=-I`mico-config --prefix`/include; + CORBALIBS=`mico-config --libs`; + IDLCMD="idl"; + DESIRED_CORBA="mico" +elif test ! "$WANT_ORBIT2" = "no"; then + if test "$WANT_ORBIT2" = "yes"; then + ORBIT2="orbit2-config"; else - AC_MSG_RESULT([enabling CORBA... CORBAHOME="$withval"]); - USE_CORBA="-DUSE_CORBA"; - CORBAHOME="$withval"; - CORBALIBS="-lmico -lcrypto -lssl -lpthread"; - IDLCMD="idl"; + ORBIT2="$withval/bin/orbit2-config"; fi + AC_CHECK_PROG(USE_CORBA,$ORBIT2,[-DUSE_CORBA -DUSE_ORBIT2],[no]) + if test "$USE_CORBA" = "no"; then + AC_MSG_ERROR([failed to find orbit2]) + fi + QT_USE_CORBA="USE_ORBIT2" + CORBACFLAGS=`orbit2-config --cflags`; + CORBALIBS=`orbit2-config --libs`; + IDLCMD="orbit-idl-2"; + DESIRED_CORBA="orbit2" + AC_MSG_ERROR([ORBIT2 is not supported yet]) +elif test ! "$WANT_OMNIORB" = "no"; then + if test "$WANT_OMNIORB" = "yes"; then + WANT_OMNIORB="/usr"; + fi + USE_CORBA="-DUSE_CORBA -DUSE_OMNIORB"; + QT_USE_CORBA="USE_OMNIORB" + CORBALIBS="-lomniORB4 -lomnithread -lpthread"; + CORBACFLAGS="-I$WANT_OMNIORB/include"; + IDLCMD="omniidl -bcxx -Wbh=.h -Wbs=.cc"; + DESIRED_CORBA="omniorb" +else + USE_CORBA=""; + CORBACFLAGS=""; + CORBALIBS=""; + IDLCMD=""; + DESIRED_CORBA="none" fi -], [ -AC_MSG_RESULT([disabling CORBA (no CORBAHOME given)]); USE_CORBA=""; CORBAHOME="";CORBALIBS="";IDLCMD=""; -]) -AC_ARG_WITH(omniORB, [ --with-omniORB=DIR use omniORB installed in DIR], -[ - AC_MSG_RESULT([enabling omniORB... CORBAHOME="$withval"]); - USE_CORBA="-DUSE_CORBA -DUSE_OMNIORB"; - CORBALIBS="-lomniORB4 -lomnithread -lpthread"; - CORBAHOME="$withval"; - IDLCMD="omniidl -bcxx -Wbh=.h -Wbs=.cc"; -], []) +AC_MSG_CHECKING([if CORBA is desired]); +AC_MSG_RESULT([$DESIRED_CORBA]); dnl should we compile modpar @@ -244,4 +266,3 @@ AC_MSG_RESULT([Not compiling with BOOST]); USE_MODPAR=""; BOOSTHOME="" ]) AC_OUTPUT(Makefile Compiler/rml2sig/Makefile modelica_parser/test/parser/Makefile mosh/src/Makefile Compiler/Makefile Compiler/omc_release/Makefile Compiler/omc_debug/Makefile Compiler/omc_profiler/Makefile Compiler/absyn_builder/Makefile modelica_parser/test/lexer/Makefile Compiler/test_codegen/Makefile Compiler/runtime/Makefile modelica_parser/src/Makefile Compiler/modpar/Makefile flat_modelica_parser/src/Makefile) -