Commit dacef9c4 authored by Locatelli's avatar Locatelli
Browse files

merge coriba branch

parent 94675f41
......@@ -11,3 +11,4 @@ obj
.project
.settings
share
/build/
......@@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers></triggers>
......@@ -75,5 +80,6 @@
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
* ExperimentController: do post configuration on attached roles of the controller (ex: cryostat orange needs to read actual value after init).
* Command Line: Simplifies exception managing and improves security of the command line stuff
* Add Unitary test stuff for Modules: Add UnitaryTest command and class UnitTest in Utilities
* Do set zero command box synchronize
\ No newline at end of file
* Do set zero command box synchronize
* Integrate coriba
\ No newline at end of file
......@@ -2,79 +2,20 @@ SUBDIRS = src
bin_SCRIPTS = nomadserver nomadservererror.sh nomadsimerror.sh moduleloadsequencer.sh moduleloadminimizer.sh
IDL_OPTIONS=$(IDL_CPPLFLAGS) -bcxx -nf -Wba -Wbh=.h -Wbs=.cpp -Wbd=.cpp
IDL_PATH=$(top_srcdir)/src/common/corba/idl
IDL_GEN_PATH=$(top_srcdir)/src/common/corba/generated
PROTO_PATH=$(top_srcdir)/src/common/protobuf/proto
PROTO_GEN_PATH=$(top_srcdir)/src/common/protobuf/generated
idl:
mkdir -p $(IDL_GEN_PATH)/dataprovider
mkdir -p $(IDL_GEN_PATH)/common
mkdir -p $(IDL_GEN_PATH)/core
mkdir -p $(IDL_GEN_PATH)/core/commandline
mkdir -p $(IDL_GEN_PATH)/core/commandzone
mkdir -p $(IDL_GEN_PATH)/client
mkdir -p $(IDL_GEN_PATH)/command
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/dataprovider -C$(IDL_GEN_PATH)/dataprovider $(IDL_PATH)/dataprovider/SurveyPublisher.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/dataprovider -C$(IDL_GEN_PATH)/dataprovider $(IDL_PATH)/dataprovider/DataChangePublisher.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/dataprovider -C$(IDL_GEN_PATH)/dataprovider $(IDL_PATH)/dataprovider/LogPublisher.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/dataprovider -C$(IDL_GEN_PATH)/dataprovider $(IDL_PATH)/dataprovider/CommandAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/dataprovider -C$(IDL_GEN_PATH)/dataprovider $(IDL_PATH)/dataprovider/LogAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/dataprovider -C$(IDL_GEN_PATH)/dataprovider $(IDL_PATH)/dataprovider/ServantAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/dataprovider -C$(IDL_GEN_PATH)/dataprovider $(IDL_PATH)/dataprovider/PropertyAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/ArrayCopier.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/RemoteConsoleProxy.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/SurveySubscriber.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/Int32ArrayTransferService.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/RemoteConsoleListener.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/ListIterator.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/Int16ArrayTransferService.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/Int64ArrayTransferService.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/ListItem.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/Sequences.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/BaseArrayTransferService.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/Float32ArrayTransferService.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/ReadyIndicator.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/DataChangeSubscriber.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/Float64ArrayTransferService.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/LogSubscriber.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/common -C$(IDL_GEN_PATH)/common $(IDL_PATH)/common/Int8ArrayTransferService.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandline -C$(IDL_GEN_PATH)/core/commandline $(IDL_PATH)/core/commandline/CommandLineProxy.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/CoreAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/ServantManager.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/SessionManager.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/OperationDescriptor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/CommandBoxAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/CommandZoneEventPublisher.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/ControlCommandBoxAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/ForLoopCommandBoxAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/CommandZoneAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/ScanCommandBoxAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/CommandZoneEventSubscriber.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/CommandBoxDescriptor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/AtomicCommandBoxAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core/commandzone -C$(IDL_GEN_PATH)/core/commandzone $(IDL_PATH)/core/commandzone/GenericCommandBoxAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/ConditionManager.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/SessionGateway.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/CompletionHandler.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/core -C$(IDL_GEN_PATH)/core $(IDL_PATH)/core/DatabaseAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/client -C$(IDL_GEN_PATH)/client $(IDL_PATH)/client/ProcessorDebuggerSubscriber.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/client -C$(IDL_GEN_PATH)/client $(IDL_PATH)/client/ConnectionToken.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/client -C$(IDL_GEN_PATH)/client $(IDL_PATH)/client/InterfaceAccessor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/LogCompletionHandler.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/ProcessorManagerProxy.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/ProcessorDescriptor.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/ProcessorManagerDebugger.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/CommandLauncher.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/ProcessorProxy.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/ProcessorDebuggerPublisher.idl
$(IDL) $(IDL_OPTIONS) -I$(IDL_PATH)/command -C$(IDL_GEN_PATH)/command $(IDL_PATH)/command/ProcessorDebuggerProxy.idl
proto:
mkdir -p $(PROTO_GEN_PATH)
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/ServantConfiguration.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/NotificationMessages.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/CommonResponses.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/DatabaseRequests.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/ServantManagerRequests.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/CommandLineRequests.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/ConditionManagerRequests.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/CommandZoneRequests.proto
protoc -I=$(PROTO_PATH) --cpp_out=$(PROTO_GEN_PATH) $(PROTO_PATH)/SessionRequests.proto
# copy script
serverexecdir=$(scriptdir)
......@@ -83,9 +24,5 @@ dist_serverexec_SCRIPTS = nomadserver
# define the directory to put the properties files
propertiesdir=$(rootconfdir)/Server/properties
# copy properties files to specified user directory
dist_properties_DATA = \
conf/properties/corba.properties
slogdir=$(serverlogdir)
dist_slog_DATA =
Using formatted core files
**************************
The default core file name pattern is "core", which is not satifying for a long
server execution. That is why we recommend to change the pattern in the /etc/sysctl.conf
file modified by the root-user like this:
...
# kernel core pattern
kernel.core_pattern = %e.core.%p
#!/bin/sh
path=`pwd`
cd $path/obj
make -s -j12 CXX="ccache icecc" install
result="$?"
if [ "$result" -eq "2" ]
then
exit 2;
fi
<project name="NomadServer" basedir=".">
<property name="builddir" value="."/>
<target name="init" depends="clean mod">
<input message="Are you sure to initialize the project?" validargs="Yes,No" defaultvalue="Yes" addproperty="do.init"/>
<condition property="do.abort">
<equals arg1="No" arg2="${do.init}"/>
</condition>
<fail if="do.abort">Init aborted</fail>
<delete dir="obj"/>
<exec executable="${builddir}/update">
</exec>
</target>
<target name="compile">
<exec executable="${builddir}/build">
</exec>
</target>
<target name="clean mod">
<delete dir="mod"/>
</target>
</project>
\ No newline at end of file
#!/bin/bash
nm -D *.so | egrep ' [TD] ' | cut -d ' ' -f3 | sort | uniq -c | grep -v ' 1 '
\ No newline at end of file
# define the directory to put the properties files
propertiesdir=$(rootconfdir)/properties
# copy properties files to specified user directory
dist_properties_DATA = \
properties/corba.properties
# Time period
corbaManagerTimePeriodms=1
# NamingService contexts
nomadServerContextName=NomadServer
dataProviderContextName=DataProvider
commandProcessorContextName=CommandProcessor
coreContextName=Core
# POA names
nomadServerPOAName=NomadServerPOA
dataProviderPOAName=DataProviderPOA
commandProcessorPOAName=CommandProcessorPOA
processorPOAName=processorPOA
processorDebuggerPOAName=processorDebuggerPOA
driverCompletionHandlerName=driverCompletionHandler
logCompletionHandlerPOAName=logCompletionHandlerPOA
commandStateChangeSubscriberPOAName=commandStateChangeSubscriberPOA
propertyAccessorPOAName=PropertyAccessorPOA
servantAccessorPOAName=ServantAccessorPOA
commandAccessorPOAName=CommandAccessorPOA
corePOAName=CorePOA
sessionManagerPOAName=SessionManagerPOA
sessionGatewayPOAName=sessionGatewayPOA
processorManagerDebuggerPOAName=ProcessorManagerDebuggerPOA
listPOAName=listPOA
remoteConsolePOAName=remoteConsolePOA
# Object names (in POA or NamingService)
processorManagerProxyName=processorManagerProxy
processorCreatorProxyName=processorCreatorProxy
processorProxyName=processorProxy
propertyAccessorName=propertyAccessor
servantAccessorName=servantAccessor
commandAccessorName=commandAccessor
sbsBit3AccessorName=sbsBit3Accessor
rs232AccessorName=rs232Accessor
logAccessorName=logAccessor
dataChangePublisherName=dataChangePublisher
dataChangeSubscriberName=dataChangeSubscriber
commandLauncherName=commandLauncher
readyIndicatorName=readyIndicator
completionHandlerName=completionHandler
propertyListGarbageCollectorName=propertyListGarbageCollector
servantListGarbageCollectorName=servantListGarbageCollector
commandListGarbageCollectorName=commandListGarbageCollector
processorGarbageCollectorName=processorGarbageCollector
logCompletionHandlerGarbageCollectorName=logCompletionHandlerGarbageCollector
commandStateChangeSubscriberGarbageCollectorName=commandStateChangeSubscriberGarbageCollector
sessionManagerName=sessionManager
sessionManagerGarbageCollectorName=sessionManagerGarbageCollector
sessionGatewayName=sessionGateway
databaseAccessorName=databaseAccessor
processorManagerDebuggerName=processorManagerDebugger
processorDebuggerProxyName=processorDebuggerProxy
processorListGarbageCollectorName=processorListGarbageCollector
listGarbageCollectorName=listGarbageCollector
coreAccessorName=coreAccessor
commandZoneAccessorName=commandZoneAccessor
atomicCommandBoxAccessorName=atomicCommandBoxAccessor
scanCommandBoxAccessorName=scanCommandBoxAccessor
forLoopCommandBoxAccessorName=forLoopCommandBoxAccessor
genericCommandBoxAccessorName=genericCommandBoxAccessor
controlCommandBoxAccessorName=controlCommandBoxAccessor
commandBoxAccessorName=commandBoxAccessor
commandZoneEventPublisherName=commandZoneEventPublisher
dataProviderRemoteConsoleName=dataProviderRemoteConsole
commandProcessorRemoteConsoleName=commandProcessorRemoteConsole
coreRemoteConsoleName=coreRemoteConsole
remoteConsoleGarbageCollectorName=remoteConsoleGarbageCollector
remoteConsoleListenerName=remoteConsoleListener
logPublisherName=logPublisher
surveyPublisherName=surveyPublisher
commandLineProxyName=commandLineProxy
conditionManagerName=conditionManager
#Retries
corbaRetryPeriodms=100
numberOfCorbaRetries=3
#Transfer
maxTransferSizeBytes=524288
\ No newline at end of file
# -----------------------------------------------------------------------------
#
# Nomad Autoconf
#
# -----------------------------------------------------------------------------
AC_INIT(nomadserver, 3.0.0)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src/core/Core.cpp)
AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CXX
AC_LANG(C++)
AM_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
AX_PTHREAD(,[AC_MSG_ERROR([Posix threads required])])
AX_BOOST_BASE([1.41],, [AC_MSG_ERROR([Boost 1.41 required])])
AX_BOOST_DATE_TIME
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_REGEX
AX_BOOST_SERIALIZATION
AX_BOOST_THREAD
AX_BOOST_UNIT_TEST_FRAMEWORK
AC_XERCES_C
AC_CMINPACK
AC_MUPARSER
AC_NEXUS
AC_LAPACK
AC_BLITZ
AC_CORBA_ORB
AC_PROTOBUF
AC_CAMEO
AX_CHECK_OPENSSL(,[AC_MSG_ERROR([Open ssl required])])
NOMAD_CXXFLAGS= stdlib=libstdc++
NOMAD_LIBS="-lstdc++ -lblosc -lhdf5_hl_cpp"
NOMAD_CXXFLAGS="$BOOST_CPPFLAGS \
$XERCES_CFLAGS \
$PTHREAD_CFLAGS \
$CMINPACK_CFLAGS \
$MUPARSER_CFLAGS \
$NEXUS_CFLAGS \
$BLITZ_CFLAGS \
$OPENSSL_INCLUDES \
$PROTOBUF_CFLAGS "$NOMAD_CXXFLAGS
NOMAD_LDFLAGS="$BOOST_LDFLAGS \
$XERCES_LDFLAGS \
$CMINPACK_LDFLAGS \
$MUPARSER_LDFLAGS \
$NEXUS_LDFLAGS \
$LAPACK_LDFLAGS \
$OPENSSL_LDFLAGS \
$PROTOBUF_LDFLAGS \
$CAMEO_LDFLAGS"
NOMAD_LIBS="$BOOST_DATE_TIME_LIB \
$BOOST_FILESYSTEM_LIB \
$BOOST_REGEX_LIB \
$BOOST_SERIALIZATION_LIB \
$BOOST_SYSTEM_LIB \
$BOOST_THREAD_LIB \
$XERCES_LIB \
$PTHREAD_LIBS \
$CMINPACK_LIB \
$MUPARSER_LIB \
$NEXUS_LIB \
$LAPACK_LIB \
$OPENSSL_LIBS \
$PROTOBUF_LIB \
$CAMEO_LIBS \
$NOMAD_LIBS"
AC_SUBST(NOMAD_CXXFLAGS)
AC_SUBST(NOMAD_LDFLAGS)
AC_SUBST(NOMAD_LIBS)
top_srcdir=.
# datadir should be renamed as it overrides the existing datadir variable
datadir=$HOME/.nomadserver
serverlogdir=$HOME/serverlog
AC_SUBST(serverlogdir)
scriptdir=$HOME/bin
AC_SUBST(scriptdir)
rootconfdir=$HOME/.nomadserver
AC_SUBST(rootconfdir)
AC_OUTPUT([
Makefile
src/Makefile
src/common/Makefile
src/common/analysislibrary/Makefile
src/common/analysislibrary/FunctionalTest/Makefile
src/core/Makefile
src/core/clientcalculator/Makefile
src/ics/Makefile
src/ics/DeviceContainer/Makefile
src/ics/DeviceContainer/FunctionalTest/Makefile
src/ics/InstrumentAbstraction/Makefile
src/ics/CommandSystem/Makefile
tests/Makefile
conf/Makefile
])
dnl
dnl AC_CORBA_OMNI_PLATFORM
dnl
dnl Description
dnl
dnl Autodetects the platform and sets necessary omniORB variables.
dnl defines: <platform> <processor> __OSVERSION__
dnl variables: PLATFORM_NAME, PLATFORM_DEFINITION,
dnl OSVERSION, PROCESSOR_NAME, PROCESSOR_DEFINITION
dnl
dnl Based upon the autoconf macros from OmniORB4
dnl [http://omniorb.sourceforge.net].
dnl
dnl Copyright (C) 2003, Alex Tingle <alex.autoconf@firetree.net>
dnl
dnl License:
dnl GNU General Public License
dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING.html]
dnl with this special exception
dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING-Exception.html].
dnl
AC_DEFUN([AC_CORBA_OMNI_PLATFORM],[
AC_REQUIRE([AC_CANONICAL_HOST])
plat_name="Platform_Unknown"
plat_def="__unknown_platform__"
os_v="0"
AH_TEMPLATE(__linux__,[for OmniORB on Linux, Cygwin])
AH_TEMPLATE(__sunos__,[for OmniORB on SunOS (Solaris)])
AH_TEMPLATE(__osf1__,[for OmniORB on OSF1 (Tru64)])
AH_TEMPLATE(__hpux__,[for OmniORB on HPUX])
AH_TEMPLATE(__nextstep__,[for OmniORB on NextStep])
AH_TEMPLATE(__irix__,[for OmniORB on IRIX])
AH_TEMPLATE(__aix__,[for OmniORB on AIX])
AH_TEMPLATE(__darwin__,[for OmniORB on Darwin])
AH_TEMPLATE(__freebsd__,[for OmniORB on FreeBSD])
AH_TEMPLATE(__osr5__,[for OmniORB on OSR5])
case "$host" in
*-*-linux-*) plat_name="Linux"; plat_def="__linux__"; os_v="2";;
*-*-cygwin*) plat_name="Cygwin"; plat_def="__linux__"; os_v="2";;
*-*-solaris*) plat_name="SunOS"; plat_def="__sunos__"; os_v="5";;
*-*-osf3*) plat_name="OSF1"; plat_def="__osf1__"; os_v="3";;
*-*-osf4*) plat_name="OSF1"; plat_def="__osf1__"; os_v="4";;
*-*-osf5*) plat_name="OSF1"; plat_def="__osf1__"; os_v="5";;
*-*-hpux10*) plat_name="HPUX"; plat_def="__hpux__"; os_v="10";;
*-*-hpux11*) plat_name="HPUX"; plat_def="__hpux__"; os_v="11";;
*-*-nextstep*) plat_name="NextStep"; plat_def="__nextstep__"; os_v="3";;
*-*-openstep*) plat_name="NextStep"; plat_def="__nextstep__"; os_v="3";;
*-*-irix*) plat_name="IRIX"; plat_def="__irix__"; os_v="6";;
*-*-aix*) plat_name="AIX"; plat_def="__aix__"; os_v="4";;
*-*-darwin*) plat_name="Darwin"; plat_def="__darwin__"; os_v="1";;
*-*-freebsd3*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="3";;
*-*-freebsd4*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="4";;
*-*-freebsd5*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="5";;
*-*-sco*) plat_name="OSR5"; plat_def="__osr5__"; os_v="5";;
esac
AC_SUBST(PLATFORM_NAME, $plat_name)
AC_SUBST(PLATFORM_DEFINITION, $plat_def)
AC_SUBST(OSVERSION, $os_v)
AC_DEFINE_UNQUOTED($plat_def)
AC_DEFINE_UNQUOTED(__OSVERSION__, $os_v,[for omniORB])
proc_name="UnknownProcessor"
proc_def="__processor_unknown__"
AH_TEMPLATE(__x86__,[for OmniORB on x86Processor])
AH_TEMPLATE(__sparc__,[for OmniORB on SparcProcessor])
AH_TEMPLATE(__alpha__,[for OmniORB on AlphaProcessor])
AH_TEMPLATE(__m68k__,[for OmniORB on m68kProcessor])
AH_TEMPLATE(__mips__,[for OmniORB on IndigoProcessor])
AH_TEMPLATE(__arm__,[for OmniORB on ArmProcessor])
AH_TEMPLATE(__s390__,[for OmniORB on s390Processor])
AH_TEMPLATE(__ia64__,[for OmniORB on ia64Processor])
AH_TEMPLATE(__hppa__,[for OmniORB on HppaProcessor])
AH_TEMPLATE(__powerpc__,[for OmniORB on PowerPCProcessor])
case "$host" in
i?86-*) proc_name="x86Processor"; proc_def="__x86__";;
sparc-*) proc_name="SparcProcessor"; proc_def="__sparc__";;
alpha*) proc_name="AlphaProcessor"; proc_def="__alpha__";;
m68k-*) proc_name="m68kProcessor"; proc_def="__m68k__";;
mips*) proc_name="IndigoProcessor"; proc_def="__mips__";;
arm-*) proc_name="ArmProcessor"; proc_def="__arm__";;
s390-*) proc_name="s390Processor"; proc_def="__s390__";;
ia64-*) proc_name="ia64Processor"; proc_def="__ia64__";;
hppa*) proc_name="HppaProcessor"; proc_def="__hppa__";;
powerpc*) proc_name="PowerPCProcessor"; proc_def="__powerpc__";;
esac
AC_SUBST(PROCESSOR_NAME, $proc_name)
AC_SUBST(PROCESSOR_DEFINITION, $proc_def)
AC_DEFINE_UNQUOTED($proc_def)
])
dnl
dnl AC_CORBA_ORB
dnl
dnl Description
dnl
dnl Tests for a linkable CORBA ORB. Currentlly only finds omniORB3 or
dnl omniORB4. Sets the output variable `CORBA_ORB', sets variables CPPFLAGS,
dnl LIBS & LDFLAGS. Sets pthread & socket options if necessary.
dnl
dnl Copyright (C) 2003, Alex Tingle <alex.autoconf@firetree.net>
dnl
dnl License:
dnl GNU General Public License
dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING.html]
dnl with this special exception
dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING-Exception.html].
dnl
AC_DEFUN([AC_CORBA_ORB],[
AC_ARG_WITH([omniorb],
[[ --with-omniorb=PATH set the path to the local omniORB installation
[$OMNIORBBASE].]],
[OMNIORBBASE=$withval]
)
if test "x$CORBA_ORB" = x; then
AC_CORBA_ORB_OMNIORB4
fi
if test "x$CORBA_ORB" = x; then
AC_CORBA_ORB_OMNIORB3
fi
])
dnl
dnl AC_CORBA_SOCKET_NSL
dnl Small wrapper around ETR_SOCKET_NSL. Automatically adds the result to LIBS.
dnl
AC_DEFUN([AC_CORBA_SOCKET_NSL],[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([ETR_SOCKET_NSL])
if test "x$ETR_SOCKET_LIBS" != x; then
LIBS="$LIBS $ETR_SOCKET_LIBS"
fi
])
dnl
dnl AC_CORBA_ORB_OMNIORB3
dnl
dnl Description
dnl
dnl Tests for a linkable installation of omniORB3
dnl [http://omniorb.sourceforge.net]. If found, it defines
dnl pre-processor macro `HAVE_OMNIORB4' and sets variables CPPFLAGS,
dnl LIBS & LDFLAGS. Sets pthread & socket options if necessary.
dnl
dnl Copyright (C) 2003, Alex Tingle <alex.autoconf@firetree.net>
dnl
dnl License:
dnl GNU General Public License
dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING.html]
dnl with this special exception
dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING-Exception.html].
dnl
AC_DEFUN([AC_CORBA_ORB_OMNIORB3],[
AC_REQUIRE([AC_CORBA_SOCKET_NSL])
AC_REQUIRE([ACX_PTHREAD])
AC_REQUIRE([AC_CORBA_OMNI_PLATFORM])
AC_CACHE_CHECK([for omniORB3],
ac_cv_corba_omniorb3,
[ AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CXX_CLEAN_TEMPLATE_REPOSITORY
# Save CPPFLAGS, LDFLAGS & LIBS
ac_corba_save_cppflags="$CPPFLAGS"
ac_corba_save_ldflags="$LDFLAGS"
ac_corba_save_libs="$LIBS"
LDFLAGS="$ac_corba_save_ldflags $PTHREAD_CFLAGS $PTHREAD_LIBS"
CPPFLAGS="$ac_corba_save_cppflags $PTHREAD_CFLAGS"
# Try to find the omniORB3 header file.Start with $OMNIORBBASE,
# and then $prefix, else just try the default include path.
ac_cv_corba_omniorb3=no
AC_CORBA_SEARCHDIRS(include)
for ac_corba_i in `find $ac_corba_searchdirs -type d -name omniORB3 2>/dev/null`
do
if test -f $ac_corba_i/CORBA.h
then
ac_corba_omnidir=`AS_DIRNAME(["$ac_corba_i"])`
CPPFLAGS="$CPPFLAGS -I$ac_corba_omnidir"
AC_TRY_CPP([#include <omniORB3/CORBA.h>],
[ac_cv_corba_omniorb3="$ac_corba_omnidir"],
[CPPFLAGS="$ac_corba_save_cppflags $PTHREAD_CFLAGS"])
fi
test "$ac_cv_corba_omniorb3" != no && break
done
if test "$ac_cv_corba_omniorb3" = no && test -z "$OMNIORBBASE"; then
AC_TRY_CPP([#include <omniORB3/CORBA.h>],[ac_cv_corba_omniorb3=yes])
fi
# Try to find the omniORB3 libraries.
if test "$ac_cv_corba_omniorb3" != no; then
LIBS="$LIBS -lomniORB3 -lomniGK_stub -lomniDynamic3 -lomniGK_alone"
LIBS="$LIBS -lomnithread"
ac_corba_links=no
AC_CORBA_SEARCHDIRS(lib)
for ac_corba_i in `find $ac_corba_searchdirs -type f -name 'libomniORB3*' 2>/dev/null`
do
# Could check for all required libraries here.
ac_corba_omnidir=`AS_DIRNAME(["$ac_corba_i"])`
LDFLAGS="$LDFLAGS -L$ac_corba_omnidir"
# Try to link.
AC_TRY_LINK([#include <omniORB3/CORBA.h>],[CORBA::ORB_var orb],
[ac_corba_links=yes],
[LDFLAGS="$ac_corba_save_ldflags $PTHREAD_CFLAGS $PTHREAD_LIBS"])
test "$ac_corba_links" = yes && break
done
if test "$ac_corba_links" = no; then
AC_TRY_LINK([#include <omniORB3/CORBA.h>],[CORBA::ORB_var orb],
[ac_corba_links=yes])
fi
test "$ac_corba_links" = no && ac_cv_corba_omniorb3=no
fi
if test "$ac_cv_corba_omniorb3" = no
then
# Restore CPPFLAGS LDFLAGS & LIBS
CPPFLAGS="$ac_corba_save_cppflags"
LDFLAGS="$ac_corba_save_ldflags"
LIBS="$ac_corba_save_libs"
fi
AC_LANG_RESTORE
])
if test "$ac_cv_corba_omniorb3" != no
then
CORBA_ORB="omniORB3"
AC_SUBST(CORBA_ORB)
AC_DEFINE(HAVE_OMNIORB3,1,"define if omniORB3 is available.")
# Since we've found `omniORB', we'll need `omniidl'.
AC_PROG_OMNIIDL
fi
])