From ae7447937b00d80ecc4354366d5766e5ead858c5 Mon Sep 17 00:00:00 2001 From: ppisa Date: Tue, 13 Jan 2004 12:39:53 +0000 Subject: [PATCH] Added prerelease of ORTE-0.2 (Real Time Publisher Subscriber communication protocol) developed by Petr Smolik. --- ChangleLog | 12 + Doxyfile | 234 + Makefile | 14 + Makefile.am | 16 + Makefile.cvs | 8 + Makefile.in | 457 ++ Makefile.omk | 1 + Makefile.rules | 413 ++ aclocal.m4 | 1179 +++ admin/compile | 99 + admin/config.guess | 1314 ++++ admin/config.sub | 1410 ++++ admin/depcomp | 411 ++ admin/install-sh | 251 + admin/linux.m4 | 305 + admin/ltconfig | 2795 +++++++ admin/ltmain.sh | 4982 +++++++++++++ admin/missing | 283 + admin/mkinstalldirs | 40 + admin/modtool.in | 37 + authors | 6 + configure | 6415 +++++++++++++++++ configure.in | 128 + copying | 280 + install | 167 + kernelcfg2mk | 161 + modtool.in | 37 + orte.kdevelop | 139 + orte/Makefile | 14 + orte/Makefile.am | 13 + orte/Makefile.in | 354 + orte/Makefile.omk | 1 + orte/contrib/decoder/Makefile | 14 + orte/contrib/decoder/Makefile.msc | 45 + orte/contrib/decoder/Makefile.omk | 5 + orte/contrib/decoder/decode_msg.c | 523 ++ orte/contrib/decoder/m.bat | 4 + orte/contrib/shape/MainFrm.ui | 78 + orte/contrib/shape/MainFrm.ui.h | 64 + orte/contrib/shape/Makefile | 226 + orte/contrib/shape/MulticlipForm.ui | 510 ++ orte/contrib/shape/MulticlipForm.ui.h | 225 + orte/contrib/shape/Orte_demo.db | 2 + orte/contrib/shape/Orte_demo.pro | 14 + orte/contrib/shape/Publisher.cpp | 144 + orte/contrib/shape/Publisher.h | 44 + orte/contrib/shape/Subscriber.cpp | 91 + orte/contrib/shape/Subscriber.h | 32 + orte/contrib/shape/ViewFrm.cpp | 96 + orte/contrib/shape/ViewFrm.h | 48 + orte/contrib/shape/define.h | 14 + orte/contrib/shape/main.cpp | 11 + orte/contrib/win_pthread/libpthreadGC.a | Bin 0 -> 87846 bytes orte/contrib/win_pthread/pthreadGC.dll | Bin 0 -> 54276 bytes orte/contrib/win_pthread/pthreadVC.dll | Bin 0 -> 53312 bytes orte/contrib/win_pthread/pthreadVC.lib | Bin 0 -> 28674 bytes orte/examples/Makefile | 14 + orte/examples/Makefile.am | 12 + orte/examples/Makefile.in | 353 + orte/examples/Makefile.omk | 1 + orte/examples/hello/HelloWorldPublisher.c | 90 + orte/examples/hello/HelloWorldSubscriber.c | 96 + orte/examples/hello/Makefile | 14 + orte/examples/hello/Makefile.am | 18 + orte/examples/hello/Makefile.in | 431 ++ orte/examples/hello/Makefile.omk | 20 + orte/examples/hello/msvc/m.bat | 4 + orte/examples/hello/msvc/makefile.msc | 48 + orte/examples/reliable/BestEffortSubscriber.c | 88 + orte/examples/reliable/Makefile | 14 + orte/examples/reliable/Makefile.am | 14 + orte/examples/reliable/Makefile.in | 357 + orte/examples/reliable/Makefile.omk | 12 + orte/examples/reliable/ReliablePublisher.c | 74 + orte/examples/reliable/ReliableSubscriber.c | 88 + orte/examples/reliable/msvc/m.bat | 4 + orte/examples/reliable/msvc/makefile.msc | 46 + orte/include/config.h.in | 151 + orte/include/config.h.in~ | 148 + orte/include/config.h.undef | 27 + orte/include/defines.h | 93 + orte/include/defines_api.h | 202 + orte/include/ew_types.h | 40 + orte/include/globals.h | 39 + orte/include/orte.h | 55 + orte/include/orte_all.h | 157 + orte/include/orte_api.h | 51 + orte/include/protos.h | 476 ++ orte/include/protos_api.h | 146 + orte/include/rtl/compat.h | 60 + orte/include/rtl/rwlock.h | 79 + orte/include/typedefs.h | 473 ++ orte/include/typedefs_api.h | 338 + orte/include/typedefs_defines_rtps.h | 250 + orte/include/ul_gavl.h | 487 ++ orte/include/ul_gavlcust.h | 137 + orte/include/ul_gavlflesint.h | 264 + orte/include/ul_gavlrepcust.h | 162 + orte/include/ul_htimdefs.h | 75 + orte/include/ul_htimer.h | 216 + orte/include/ul_itbase.h | 97 + orte/include/ul_list.h | 106 + orte/include/ul_listbase.h | 286 + orte/include/ul_utdefs.h | 43 + orte/include/win32/getopt.h | 133 + orte/include/win32/pthread.h | 1286 ++++ orte/include/win32/sched.h | 174 + orte/include/win32/timeval.h | 64 + orte/liborte/Makefile | 14 + orte/liborte/Makefile.am | 64 + orte/liborte/Makefile.in | 1298 ++++ orte/liborte/Makefile.omk | 116 + orte/liborte/ORTEAppRecvMetatrafficThread.c | 102 + orte/liborte/ORTEAppRecvUserdataThread.c | 108 + orte/liborte/ORTEAppSendThread.c | 105 + orte/liborte/ORTEDomain.c | 101 + orte/liborte/ORTEDomainApp.c | 443 ++ orte/liborte/ORTEDomainMgr.c | 350 + orte/liborte/ORTEInit.c | 38 + orte/liborte/ORTEPattern.c | 46 + orte/liborte/ORTEPublication.c | 294 + orte/liborte/ORTEPublicationTimer.c | 53 + orte/liborte/ORTESubscription.c | 215 + orte/liborte/ORTEThreadUtils.c | 57 + orte/liborte/ORTETypeRegister.c | 81 + orte/liborte/ORTEVerbosity.c | 39 + orte/liborte/RTPSAck.c | 174 + orte/liborte/RTPSCSTReader.c | 326 + orte/liborte/RTPSCSTReaderProc.c | 242 + orte/liborte/RTPSCSTReaderTimer.c | 262 + orte/liborte/RTPSCSTWriter.c | 452 ++ orte/liborte/RTPSCSTWriterTimer.c | 387 + orte/liborte/RTPSGap.c | 173 + orte/liborte/RTPSHeader.c | 58 + orte/liborte/RTPSHeardBeat.c | 143 + orte/liborte/RTPSInfoDST.c | 46 + orte/liborte/RTPSInfoREPLY.c | 71 + orte/liborte/RTPSInfoSRC.c | 58 + orte/liborte/RTPSInfoTS.c | 54 + orte/liborte/RTPSIssue.c | 169 + orte/liborte/RTPSPad.c | 32 + orte/liborte/RTPSUtils.c | 60 + orte/liborte/RTPSVar.c | 493 ++ orte/liborte/conv.c | 92 + orte/liborte/debug.c | 176 + orte/liborte/event.c | 124 + orte/liborte/fnmatch.c | 178 + orte/liborte/htimerNtp.c | 246 + orte/liborte/msvc/liborte.dsp | 269 + orte/liborte/msvc/liborte.dsw | 29 + orte/liborte/objectEntry.c | 232 + orte/liborte/objectEntryTimer.c | 396 + orte/liborte/objectUtils.c | 252 + orte/liborte/parameter.c | 535 ++ orte/liborte/rtl/Makefile | 14 + orte/liborte/rtl/Makefile.am | 29 + orte/liborte/rtl/Makefile.in | 618 ++ orte/liborte/rtl/Makefile.omk | 23 + orte/liborte/rtl/pthread_rwlock_destroy.c | 142 + orte/liborte/rtl/pthread_rwlock_init.c | 111 + orte/liborte/rtl/pthread_rwlock_rdlock.c | 103 + orte/liborte/rtl/pthread_rwlock_timedrdlock.c | 107 + orte/liborte/rtl/pthread_rwlock_timedwrlock.c | 137 + orte/liborte/rtl/pthread_rwlock_tryrdlock.c | 103 + orte/liborte/rtl/pthread_rwlock_trywrlock.c | 121 + orte/liborte/rtl/pthread_rwlock_unlock.c | 95 + orte/liborte/rtl/pthread_rwlock_wrlock.c | 136 + orte/liborte/rtl/pthread_rwlockattr_destroy.c | 87 + .../rtl/pthread_rwlockattr_getpshared.c | 101 + orte/liborte/rtl/pthread_rwlockattr_init.c | 86 + .../rtl/pthread_rwlockattr_setpshared.c | 124 + orte/liborte/rtl/ptw32_rwlock_cancelwrwait.c | 52 + .../rtl/ptw32_rwlock_check_need_init.c | 95 + orte/liborte/sock.c | 195 + orte/liborte/ul_gavl.c | 592 ++ orte/liborte/ul_gavlprim.c | 431 ++ orte/liborte/usedSections.txt | 65 + orte/manager/Makefile | 14 + orte/manager/Makefile.am | 8 + orte/manager/Makefile.in | 342 + orte/manager/Makefile.omk | 7 + orte/manager/ORTEManager.c | 204 + orte/manager/make_with_ccmalloc | 3 + orte/manager/mcvs/Makefile.msc | 46 + orte/manager/mcvs/getopt.c | 114 + orte/manager/mcvs/getopt_long.c | 205 + orte/manager/mcvs/m.bat | 5 + orte/manager/rc/ORTEManagerd | 42 + orte/templates/templates.c | 20 + orte/templates/templates.h | 33 + readme | 56 + todo | 29 + 192 files changed, 46227 insertions(+) create mode 100644 ChangleLog create mode 100644 Doxyfile create mode 100644 Makefile create mode 100644 Makefile.am create mode 100644 Makefile.cvs create mode 100644 Makefile.in create mode 100644 Makefile.omk create mode 100644 Makefile.rules create mode 100644 aclocal.m4 create mode 100755 admin/compile create mode 100755 admin/config.guess create mode 100755 admin/config.sub create mode 100755 admin/depcomp create mode 100755 admin/install-sh create mode 100644 admin/linux.m4 create mode 100755 admin/ltconfig create mode 100644 admin/ltmain.sh create mode 100755 admin/missing create mode 100755 admin/mkinstalldirs create mode 100755 admin/modtool.in create mode 100644 authors create mode 100755 configure create mode 100644 configure.in create mode 100644 copying create mode 100644 install create mode 100755 kernelcfg2mk create mode 100755 modtool.in create mode 100644 orte.kdevelop create mode 100644 orte/Makefile create mode 100644 orte/Makefile.am create mode 100644 orte/Makefile.in create mode 100644 orte/Makefile.omk create mode 100644 orte/contrib/decoder/Makefile create mode 100644 orte/contrib/decoder/Makefile.msc create mode 100644 orte/contrib/decoder/Makefile.omk create mode 100644 orte/contrib/decoder/decode_msg.c create mode 100755 orte/contrib/decoder/m.bat create mode 100644 orte/contrib/shape/MainFrm.ui create mode 100644 orte/contrib/shape/MainFrm.ui.h create mode 100644 orte/contrib/shape/Makefile create mode 100644 orte/contrib/shape/MulticlipForm.ui create mode 100644 orte/contrib/shape/MulticlipForm.ui.h create mode 100644 orte/contrib/shape/Orte_demo.db create mode 100644 orte/contrib/shape/Orte_demo.pro create mode 100644 orte/contrib/shape/Publisher.cpp create mode 100644 orte/contrib/shape/Publisher.h create mode 100644 orte/contrib/shape/Subscriber.cpp create mode 100644 orte/contrib/shape/Subscriber.h create mode 100644 orte/contrib/shape/ViewFrm.cpp create mode 100644 orte/contrib/shape/ViewFrm.h create mode 100644 orte/contrib/shape/define.h create mode 100644 orte/contrib/shape/main.cpp create mode 100644 orte/contrib/win_pthread/libpthreadGC.a create mode 100644 orte/contrib/win_pthread/pthreadGC.dll create mode 100644 orte/contrib/win_pthread/pthreadVC.dll create mode 100644 orte/contrib/win_pthread/pthreadVC.lib create mode 100644 orte/examples/Makefile create mode 100644 orte/examples/Makefile.am create mode 100644 orte/examples/Makefile.in create mode 100644 orte/examples/Makefile.omk create mode 100644 orte/examples/hello/HelloWorldPublisher.c create mode 100644 orte/examples/hello/HelloWorldSubscriber.c create mode 100644 orte/examples/hello/Makefile create mode 100644 orte/examples/hello/Makefile.am create mode 100644 orte/examples/hello/Makefile.in create mode 100644 orte/examples/hello/Makefile.omk create mode 100755 orte/examples/hello/msvc/m.bat create mode 100644 orte/examples/hello/msvc/makefile.msc create mode 100644 orte/examples/reliable/BestEffortSubscriber.c create mode 100644 orte/examples/reliable/Makefile create mode 100644 orte/examples/reliable/Makefile.am create mode 100644 orte/examples/reliable/Makefile.in create mode 100644 orte/examples/reliable/Makefile.omk create mode 100644 orte/examples/reliable/ReliablePublisher.c create mode 100644 orte/examples/reliable/ReliableSubscriber.c create mode 100755 orte/examples/reliable/msvc/m.bat create mode 100644 orte/examples/reliable/msvc/makefile.msc create mode 100644 orte/include/config.h.in create mode 100644 orte/include/config.h.in~ create mode 100644 orte/include/config.h.undef create mode 100644 orte/include/defines.h create mode 100644 orte/include/defines_api.h create mode 100644 orte/include/ew_types.h create mode 100644 orte/include/globals.h create mode 100644 orte/include/orte.h create mode 100644 orte/include/orte_all.h create mode 100644 orte/include/orte_api.h create mode 100644 orte/include/protos.h create mode 100644 orte/include/protos_api.h create mode 100644 orte/include/rtl/compat.h create mode 100644 orte/include/rtl/rwlock.h create mode 100644 orte/include/typedefs.h create mode 100644 orte/include/typedefs_api.h create mode 100644 orte/include/typedefs_defines_rtps.h create mode 100644 orte/include/ul_gavl.h create mode 100644 orte/include/ul_gavlcust.h create mode 100644 orte/include/ul_gavlflesint.h create mode 100644 orte/include/ul_gavlrepcust.h create mode 100644 orte/include/ul_htimdefs.h create mode 100644 orte/include/ul_htimer.h create mode 100644 orte/include/ul_itbase.h create mode 100644 orte/include/ul_list.h create mode 100644 orte/include/ul_listbase.h create mode 100644 orte/include/ul_utdefs.h create mode 100644 orte/include/win32/getopt.h create mode 100644 orte/include/win32/pthread.h create mode 100644 orte/include/win32/sched.h create mode 100644 orte/include/win32/timeval.h create mode 100644 orte/liborte/Makefile create mode 100644 orte/liborte/Makefile.am create mode 100644 orte/liborte/Makefile.in create mode 100644 orte/liborte/Makefile.omk create mode 100644 orte/liborte/ORTEAppRecvMetatrafficThread.c create mode 100644 orte/liborte/ORTEAppRecvUserdataThread.c create mode 100644 orte/liborte/ORTEAppSendThread.c create mode 100644 orte/liborte/ORTEDomain.c create mode 100644 orte/liborte/ORTEDomainApp.c create mode 100644 orte/liborte/ORTEDomainMgr.c create mode 100644 orte/liborte/ORTEInit.c create mode 100644 orte/liborte/ORTEPattern.c create mode 100644 orte/liborte/ORTEPublication.c create mode 100644 orte/liborte/ORTEPublicationTimer.c create mode 100644 orte/liborte/ORTESubscription.c create mode 100644 orte/liborte/ORTEThreadUtils.c create mode 100644 orte/liborte/ORTETypeRegister.c create mode 100644 orte/liborte/ORTEVerbosity.c create mode 100644 orte/liborte/RTPSAck.c create mode 100644 orte/liborte/RTPSCSTReader.c create mode 100644 orte/liborte/RTPSCSTReaderProc.c create mode 100644 orte/liborte/RTPSCSTReaderTimer.c create mode 100644 orte/liborte/RTPSCSTWriter.c create mode 100644 orte/liborte/RTPSCSTWriterTimer.c create mode 100644 orte/liborte/RTPSGap.c create mode 100644 orte/liborte/RTPSHeader.c create mode 100644 orte/liborte/RTPSHeardBeat.c create mode 100644 orte/liborte/RTPSInfoDST.c create mode 100644 orte/liborte/RTPSInfoREPLY.c create mode 100644 orte/liborte/RTPSInfoSRC.c create mode 100644 orte/liborte/RTPSInfoTS.c create mode 100644 orte/liborte/RTPSIssue.c create mode 100644 orte/liborte/RTPSPad.c create mode 100644 orte/liborte/RTPSUtils.c create mode 100644 orte/liborte/RTPSVar.c create mode 100644 orte/liborte/conv.c create mode 100644 orte/liborte/debug.c create mode 100644 orte/liborte/event.c create mode 100644 orte/liborte/fnmatch.c create mode 100644 orte/liborte/htimerNtp.c create mode 100644 orte/liborte/msvc/liborte.dsp create mode 100644 orte/liborte/msvc/liborte.dsw create mode 100644 orte/liborte/objectEntry.c create mode 100644 orte/liborte/objectEntryTimer.c create mode 100644 orte/liborte/objectUtils.c create mode 100644 orte/liborte/parameter.c create mode 100644 orte/liborte/rtl/Makefile create mode 100644 orte/liborte/rtl/Makefile.am create mode 100644 orte/liborte/rtl/Makefile.in create mode 100644 orte/liborte/rtl/Makefile.omk create mode 100644 orte/liborte/rtl/pthread_rwlock_destroy.c create mode 100644 orte/liborte/rtl/pthread_rwlock_init.c create mode 100644 orte/liborte/rtl/pthread_rwlock_rdlock.c create mode 100644 orte/liborte/rtl/pthread_rwlock_timedrdlock.c create mode 100644 orte/liborte/rtl/pthread_rwlock_timedwrlock.c create mode 100644 orte/liborte/rtl/pthread_rwlock_tryrdlock.c create mode 100644 orte/liborte/rtl/pthread_rwlock_trywrlock.c create mode 100644 orte/liborte/rtl/pthread_rwlock_unlock.c create mode 100644 orte/liborte/rtl/pthread_rwlock_wrlock.c create mode 100644 orte/liborte/rtl/pthread_rwlockattr_destroy.c create mode 100644 orte/liborte/rtl/pthread_rwlockattr_getpshared.c create mode 100644 orte/liborte/rtl/pthread_rwlockattr_init.c create mode 100644 orte/liborte/rtl/pthread_rwlockattr_setpshared.c create mode 100644 orte/liborte/rtl/ptw32_rwlock_cancelwrwait.c create mode 100644 orte/liborte/rtl/ptw32_rwlock_check_need_init.c create mode 100644 orte/liborte/sock.c create mode 100644 orte/liborte/ul_gavl.c create mode 100644 orte/liborte/ul_gavlprim.c create mode 100644 orte/liborte/usedSections.txt create mode 100644 orte/manager/Makefile create mode 100644 orte/manager/Makefile.am create mode 100644 orte/manager/Makefile.in create mode 100644 orte/manager/Makefile.omk create mode 100644 orte/manager/ORTEManager.c create mode 100755 orte/manager/make_with_ccmalloc create mode 100644 orte/manager/mcvs/Makefile.msc create mode 100644 orte/manager/mcvs/getopt.c create mode 100644 orte/manager/mcvs/getopt_long.c create mode 100755 orte/manager/mcvs/m.bat create mode 100755 orte/manager/rc/ORTEManagerd create mode 100644 orte/templates/templates.c create mode 100644 orte/templates/templates.h create mode 100644 readme create mode 100644 todo diff --git a/ChangleLog b/ChangleLog new file mode 100644 index 0000000..ba3fdba --- /dev/null +++ b/ChangleLog @@ -0,0 +1,12 @@ +v0.2.0 - 08/01/2004 + +- many things (circa 80% of code scratched) +- event subssystem +- htimer, gavl, +- support serialization/deserialization functions +- ... + +V0.1.1 - 14/12/2002 + +- cleaned up source code a little. + diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..fee66a3 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,234 @@ +# Doxyfile 1.3.4-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = orte.kdevelop +PROJECT_NUMBER = $VERSION$ +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/orte +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..d289f6f --- /dev/null +++ b/Makefile.am @@ -0,0 +1,16 @@ +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +AUTOMAKE_OPTIONS = foreign + +if USE_RTLINUX +SUBDIRS = orte RTL_UDP +else +SUBDIRS = orte +endif + +EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README TODO orte.kdevelop + +ACLOCAL_AMFLAGS = -I admin diff --git a/Makefile.cvs b/Makefile.cvs new file mode 100644 index 0000000..00b7f67 --- /dev/null +++ b/Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal -I admin + autoheader + automake + autoconf + diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..7080155 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,457 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ + +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +AUTOMAKE_OPTIONS = foreign + +@USE_RTLINUX_TRUE@SUBDIRS = orte RTL_UDP +@USE_RTLINUX_FALSE@SUBDIRS = orte + +EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README TODO orte.kdevelop + +ACLOCAL_AMFLAGS = -I admin +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = modtool +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = ./orte/include/config.h.in Makefile.am Makefile.in \ + aclocal.m4 admin/compile admin/config.guess admin/config.sub \ + admin/depcomp admin/install-sh admin/ltconfig admin/ltmain.sh \ + admin/missing admin/mkinstalldirs configure configure.in \ + modtool.in +DIST_SUBDIRS = orte RTL_UDP +all: all-recursive + +.SUFFIXES: + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in admin/linux.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +orte/include/config.h: orte/include/stamp-h1 + @if test ! -f $@; then \ + rm -f orte/include/stamp-h1; \ + $(MAKE) orte/include/stamp-h1; \ + else :; fi + +orte/include/stamp-h1: $(srcdir)/./orte/include/config.h.in $(top_builddir)/config.status + @rm -f orte/include/stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status orte/include/config.h + +$(srcdir)/./orte/include/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + touch $(srcdir)/./orte/include/config.h.in + +distclean-hdr: + -rm -f orte/include/config.h orte/include/stamp-h1 +modtool: $(top_builddir)/config.status modtool.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +distdir = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/. $(distdir)/./orte/include $(distdir)/admin + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + find $$dc_install_base -type f -print ; \ + exit 1; } >&2 ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distcleancheck: distclean + if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf autom4te.cache +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive dist dist-all dist-gzip distcheck \ + distclean distclean-generic distclean-hdr distclean-recursive \ + distclean-tags distcleancheck distdir dvi dvi-am dvi-recursive \ + info info-am info-recursive install install-am install-data \ + install-data-am install-data-recursive install-exec \ + install-exec-am install-exec-recursive install-info \ + install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Makefile.omk b/Makefile.omk new file mode 100644 index 0000000..e641263 --- /dev/null +++ b/Makefile.omk @@ -0,0 +1 @@ +SUBDIRS = RTL_UDP orte diff --git a/Makefile.rules b/Makefile.rules new file mode 100644 index 0000000..0a41fd8 --- /dev/null +++ b/Makefile.rules @@ -0,0 +1,413 @@ +# Makefile.rules - OCERA make framework common project rules +# +# (C) Copyright 2003 by Pavel Pisa - OCERA team member +# +# The uLan driver is distributed under the Gnu General Public License. +# See file COPYING for details. +# +# +# input variables +# SUBDIRS .. list of subdirectories intended for make from actual directory +# lib_LIBRARIES .. list of the user-space libraries +# shared_LIBRARIES .. list of the user-space shared libraries +# kernel_LIBRARIES .. list of the kernel-space libraries +# rtlinux_LIBRARIES.. list of the RT-Linux kernel-space libraries +# include_HEADERS .. list of the user-space header files +# nobase_include_HEADERS .. headers copied even with directory part +# kernel_HEADERS .. list of the kernel-space header files +# rtlinux_HEADERS .. list of the RT-Linux kernel-space header files +# bin_PROGRAMS .. list of the require binary programs +# utils_PROGRAMS .. list of the development utility programs +# kernel_MODULES .. list of the kernel side modules/applications +# rtlinux_MODULES .. list of RT-Linux the kernel side modules/applications +# xxx_SOURCES .. list of specific target sources +# +# LINUX_DIR .. location of Linux kernel sources +# RTLINUX_DIR .. location of RT-Linux sources + +# Hack to check RT-Linux rules +#LINUX_DIR := /home/cvs/ocera/ocera-build/kernel/linux +#RTLINUX_DIR := /home/cvs/ocera/ocera-build/kernel/rtlinux +LINUX_DIR := /usr/src/linux-2.4.18rt +RTLINUX_DIR := /usr/rtlinux +KERN_EXE_SUFFIX := .o + +# We need to ensure definition of sources directory first +ifndef SOURCES_DIR +SOURCES_DIR := $(shell ( pwd -L ) ) +endif + +all: default + +# Check and include real OCERA style Makefile.omk now +ifndef OMK_INCLUDED +include $(SOURCES_DIR)/Makefile.omk +OMK_INCLUDED := 1 +endif + +ifdef OCERA_DIR +KERN_INCLUDE_DIR := $(OCERA_DIR)/compiled/kernel/include +KERN_LIB_DIR := $(OCERA_DIR)/compiled/kernel/lib +KERN_MODULES_DIR := $(OCERA_DIR)/compiled/kernel/modules +KERN_BUILD_DIR := $(OCERA_DIR)/build/kern +USER_INCLUDE_DIR := $(OCERA_DIR)/compiled/user/include +USER_LIB_DIR := $(OCERA_DIR)/compiled/user/lib +USER_UTILS_DIR := $(OCERA_DIR)/compiled/user/utils +USER_BIN_DIR := $(OCERA_DIR)/compiled/user/bin +USER_BUILD_DIR := $(OCERA_DIR)/build/user +else +KERN_INCLUDE_DIR := $(MAKERULES_DIR)/compiled/include-kern +KERN_LIB_DIR := $(MAKERULES_DIR)/compiled/lib-kern +KERN_MODULES_DIR := $(MAKERULES_DIR)/compiled/modules +KERN_BUILD_DIR := $(MAKERULES_DIR)/build/kern +USER_INCLUDE_DIR := $(MAKERULES_DIR)/compiled/include +USER_LIB_DIR := $(MAKERULES_DIR)/compiled/lib +USER_UTILS_DIR := $(MAKERULES_DIR)/compiled/bin-utils +USER_BIN_DIR := $(MAKERULES_DIR)/compiled/bin +USER_BUILD_DIR := $(MAKERULES_DIR)/build/user +endif + +export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR LINUX_DIR RTLINUX_DIR + +CFLAGS = -O2 -ggdb + +CPPFLAGS += -I $(USER_INCLUDE_DIR) + +LOADLIBES += -L$(USER_LIB_DIR) + +LOADLIBES += $(lib_LOADLIBES:%=-l%) + +LIB_CPPFLAGS += $(CPPFLAGS) +LIB_CFLAGS += $(CFLAGS) + + +ifndef RELATIVE_DIR +RELATIVE_DIR := $(SOURCES_DIR:$(MAKERULES_DIR)%=%) +RELATIVE_DIR := $(RELATIVE_DIR:/%=%) +RELATIVE_DIR := $(RELATIVE_DIR:\\%=%) +endif + +#$(warning SOURCES_DIR = $(SOURCES_DIR)) +#$(warning MAKERULES_DIR = $(MAKERULES_DIR)) +#$(warning RELATIVE_DIR = $(RELATIVE_DIR)) + +#vpath %.c $(SOURCES_DIR) +#vpath %.cc $(SOURCES_DIR) + +VPATH = $(SOURCES_DIR) +srcdir = $(SOURCES_DIR) + +USER_OBJS_DIR = $(USER_BUILD_DIR)/$(RELATIVE_DIR) +KERN_OBJS_DIR = $(KERN_BUILD_DIR)/$(RELATIVE_DIR) + +.PHONY: default dep subdirs clean cleandepend +.PHONY: check-dir include-pass library-pass binary-pass utils-pass kernel-lib-pass kernel-pass +.PHONY: check-dir-local include-pass-local library-pass-local +.PHONY: binary-pass-local utils-pass-local kernel-lib-pass-local kernel-pass-local + +default: check-dir include-pass library-pass binary-pass utils-pass kernel-lib-pass kernel-pass + + +#===================================================================== +# Common utility rules + +define mkdir_def + [ -d $(1) ] || mkdir -p $(1) || exit 1 +endef + +#===================================================================== +# User-space rules and templates to compile programs, libraries etc. + +ifdef USER_RULE_TEMPLATES + + +#%.lo: %.c +# $(CC) -o $@ $(LCFLAGS) -c $< + +c_o_COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +cc_o_COMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + + +# Check GCC version for user build +ifndef CC_VERSION +CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/') +endif +# Prepare suitable define for dependency building +ifeq ($(CC_MAJOR_VERSION),2) +CC_DEPFLAGS = -Wp,-MD,"$@.d.tmp" +else +CC_DEPFLAGS = -MT $@ -MD -MP -MF "$@.d.tmp" +endif + + + + +define COMPILE_c_o_template +$(2): $(1) + if $$(c_o_COMPILE) $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ + then mv -f "$$@.d.tmp" "$$@.d" ; \ + else rm -f "$$@.d.tmp" ; exit 1; \ + fi +endef + + + +define COMPILE_cc_o_template +$(2): $(1) + if $$(cc_o_COMPILE) $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ + then mv -f "$$@.d.tmp" "$$@.d" ; \ + else rm -f "$$@.d.tmp" ; exit 1; \ + fi +endef + + + +define PROGRAM_template +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o)) +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o)) +$(1)_OBJS := $$(sort $$($(1)_OBJS)) + +USER_OBJS += $$($(1)_OBJS) +USER_SOURCES += $$($(1)_SOURCES) + +$(2)/$(1): $$($(1)_OBJS) + $$(shell if [ -z "$$(filter %.cc,$$($(1)_SOURCES))" ] ; then echo $$(CC) ; else echo $$(CXX) ; fi) \ + $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) $$(LOADLIBES) -Wl,-Map,$(USER_OBJS_DIR)/$(1).exe.map -o $(2)/$(1) + @echo "$(2)/$(1): \\" >$(USER_OBJS_DIR)/$(1).exe.d + @sed -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(USER_OBJS_DIR)/$(1).exe.map >>$(USER_OBJS_DIR)/$(1).exe.d + @echo >>$(USER_OBJS_DIR)/$(1).exe.d +endef + + + +define LIBRARY_template +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o)) +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o)) +$(1)_OBJS := $$(sort $$($(1)_OBJS)) + +USER_OBJS += $$($(1)_OBJS) +USER_SOURCES += $$($(1)_SOURCES) + +$(USER_LIB_DIR)/lib$(1).a: $$($(1)_OBJS) + ar rcs $$@ $$^ + ranlib $$@ +endef + + + +library-pass-local: $(lib_LIBRARIES:%=$(USER_LIB_DIR)/lib%.a) $(shared_LIBRARIES:%=$(USER_LIB_DIR)/lib%.so) + +binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%) + +utils-pass-local: $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%) + +$(foreach prog,$(utils_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_UTILS_DIR)))) + +$(foreach prog,$(bin_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_BIN_DIR)))) + +$(foreach lib,$(lib_LIBRARIES),$(eval $(call LIBRARY_template,$(lib)))) + +-include $(USER_OBJS_DIR)/*.d + +endif + +#===================================================================== +# Kernel-space rules and templates to compile modules, libraries etc. + +ifdef KERN_RULE_TEMPLATES + +ifdef RTLINUX_DIR +include $(RTLINUX_DIR)/rtl.mk +endif + +KERN_LOADLIBES += -L$(KERN_LIB_DIR) + +KERN_LOADLIBES += $(rtlinux_LOADLIBES:%=-l%) +KERN_LOADLIBES += $(kernel_LOADLIBES:%=-l%) + +INCLUDES := -I $(KERN_INCLUDE_DIR) $(INCLUDE) $(rtlinux_INCLUDES) + +#-DEXPORT_NO_SYMBOLS + +c_o_kern_COMPILE = $(CC) $(INCLUDES) $(CFLAGS) -DEXPORT_SYMTAB + +cc_o_kern_COMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) -DEXPORT_SYMTAB + + +# Check GCC version for kernel part of build +ifndef CC_VERSION +kern_CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/') +endif +# Prepare suitable define for dependency building +ifeq ($(kern_CC_MAJOR_VERSION),2) +kern_CC_DEPFLAGS = -Wp,-MD,"$@.d.tmp" +else +kern_CC_DEPFLAGS = -MT $@ -MD -MP -MF "$@.d.tmp" +endif + + + +define COMPILE_c_o_kern_template + +$(2): $(1) + if $$(c_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ + then mv -f "$$@.d.tmp" "$$@.d" ; \ + else rm -f "$$@.d.tmp" ; exit 1; \ + fi +endef + + + +define COMPILE_cc_o_kern_template + +$(2): $(1) + if $$(cc_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ + then mv -f "$$@.d.tmp" "$$@.d" ; \ + else rm -f "$$@.d.tmp" ; exit 1; \ + fi +endef + + + +define MODULE_kern_template +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o)) +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o)) +$(1)_OBJS := $$(sort $$($(1)_OBJS)) + +KERN_OBJS += $$($(1)_OBJS) +KERN_SOURCES += $$($(1)_SOURCES) + +$(2)/$(1)$(KERN_EXE_SUFFIX): $$($(1)_OBJS) + ld -m elf_$(ARCH) -r $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) $$(KERN_LOADLIBES) -Map $(KERN_OBJS_DIR)/$(1).mod.map -o $(2)/$(1)$(KERN_EXE_SUFFIX) + @echo "$(2)/$(1)$(KERN_EXE_SUFFIX): \\" >$(KERN_OBJS_DIR)/$(1).mod.d + @sed -n -e 's/^LOAD \(.*\)$$$$/ \1 \\/p' $(KERN_OBJS_DIR)/$(1).mod.map >>$(KERN_OBJS_DIR)/$(1).mod.d + @echo >>$(KERN_OBJS_DIR)/$(1).mod.d +endef + + + +define LIBRARY_kern_template +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o)) +$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o)) +$(1)_OBJS := $$(sort $$($(1)_OBJS)) + +KERN_OBJS += $$($(1)_OBJS) +KERN_SOURCES += $$($(1)_SOURCES) + +$(KERN_LIB_DIR)/lib$(1).a: $$($(1)_OBJS) + ar rcs $$@ $$^ + ranlib $$@ +endef + +kernel-lib-pass-local: $(kernel_LIBRARIES:%=$(KERN_LIB_DIR)/lib%.a) + +kernel-pass-local: $(kernel_MODULES:%=$(KERN_MODULES_DIR)/%$(KERN_EXE_SUFFIX)) + +ifdef RTLINUX_DIR + +kernel-pass-local: $(rtlinux_MODULES:%=$(KERN_MODULES_DIR)/%$(KERN_EXE_SUFFIX)) + +kernel-lib-pass-local: $(rtlinux_LIBRARIES:%=$(KERN_LIB_DIR)/lib%.a) + +$(foreach module,$(rtlinux_MODULES),$(eval $(call MODULE_kern_template,$(module),$(KERN_MODULES_DIR)))) + +$(foreach lib,$(rtlinux_LIBRARIES),$(eval $(call LIBRARY_kern_template,$(lib)))) + +endif + +-include $(KERN_OBJS_DIR)/*.d + +endif + +#===================================================================== + + +kernel-lib-pass kernel-pass: + +@$(foreach dir, $(SUBDIRS), $(call mkdir_def,$(KERN_OBJS_DIR)/$(dir)) ; \ + $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ + RELATIVE_DIR=$(RELATIVE_DIR)/$(dir) -C $(KERN_OBJS_DIR)/$(dir) \ + -f $(SOURCES_DIR)/$(dir)/Makefile $@ || exit 1 ;) + +@$(call mkdir_def,$(KERN_OBJS_DIR)) + @$(MAKE) --no-print-directory -C $(KERN_OBJS_DIR) \ + -f $(SOURCES_DIR)/Makefile KERN_RULE_TEMPLATES=y $(@:%=%-local) + +library-pass binary-pass utils-pass: + +@$(foreach dir, $(SUBDIRS), $(call mkdir_def,$(USER_OBJS_DIR)/$(dir)) ; \ + $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ + RELATIVE_DIR=$(RELATIVE_DIR)/$(dir) -C $(USER_OBJS_DIR)/$(dir) \ + -f $(SOURCES_DIR)/$(dir)/Makefile $@ || exit 1 ;) + +@$(call mkdir_def,$(USER_OBJS_DIR)) + @$(MAKE) --no-print-directory -C $(USER_OBJS_DIR) \ + -f $(SOURCES_DIR)/Makefile USER_RULE_TEMPLATES=y $(@:%=%-local) + + +dep clean install check-dir include-pass: + +@$(foreach dir, $(SUBDIRS), $(call mkdir_def,$(USER_OBJS_DIR)/$(dir)) ; \ + $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ + RELATIVE_DIR=$(RELATIVE_DIR)/$(dir) -C $(USER_OBJS_DIR)/$(dir) \ + -f $(SOURCES_DIR)/$(dir)/Makefile $@ || exit 1 ;) + +@$(call mkdir_def,$(USER_OBJS_DIR)) + @$(MAKE) --no-print-directory -C $(USER_OBJS_DIR) \ + -f $(SOURCES_DIR)/Makefile $(@:%=%-local) + + +dep-local: + +check-dir-local: + @$(call mkdir_def,$(USER_OBJS_DIR)) + @$(call mkdir_def,$(KERN_OBJS_DIR)) + @$(call mkdir_def,$(USER_INCLUDE_DIR)) + @$(call mkdir_def,$(KERN_INCLUDE_DIR)) + @$(call mkdir_def,$(USER_LIB_DIR)) + @$(call mkdir_def,$(KERN_LIB_DIR)) + @$(call mkdir_def,$(USER_BIN_DIR)) + @$(call mkdir_def,$(USER_UTILS_DIR)) + @$(call mkdir_def,$(KERN_MODULES_DIR)) + +install-local: + +include-pass-local: + @$(call mkdir_def,$(USER_INCLUDE_DIR)) + @$(foreach f, $(include_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(notdir $(f)) \ + || cp -v $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(notdir $(f)) ; ) + @$(foreach f, $(nobase_include_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(f) \ + || mkdir -p $(USER_INCLUDE_DIR)/$(dir $(f)) && cp -v $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(f) ; ) +# Kernel and RT-Linux stuff + @$(call mkdir_def,$(KERN_INCLUDE_DIR)) + @$(foreach f, $(kernel_HEADERS) $(rtlinux_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(KERN_INCLUDE_DIR)/$(notdir $(f)) \ + || cp -v $(SOURCES_DIR)/$(f) $(KERN_INCLUDE_DIR)/$(notdir $(f)) ; ) + @$(foreach f, $(nobase_kernel_HEADERS) $(nobase_rtlinux_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(KERN_INCLUDE_DIR)/$(f) \ + || mkdir -p $(KERN_INCLUDE_DIR)/$(dir $(f)) && cp -v $(SOURCES_DIR)/$(f) $(KERN_INCLUDE_DIR)/$(f) ; ) + +ifdef USER_RULE_TEMPLATES + +USER_SOURCES := $(sort $(USER_SOURCES)) + +#$(warning USER_SOURCES = $(USER_SOURCES)) + +$(foreach src,$(filter %.c,$(USER_SOURCES)),$(eval $(call COMPILE_c_o_template,$(SOURCES_DIR)/$(src),$(src:%.c=%.o),))) + +$(foreach src,$(filter %.cc,$(USER_SOURCES)),$(eval $(call COMPILE_cc_o_template,$(SOURCES_DIR)/$(src),$(src:%.cc=%.o),))) + +endif + +ifdef KERN_RULE_TEMPLATES + +KERN_SOURCES := $(sort $(KERN_SOURCES)) + +#$(warning KERN_SOURCES = $(KERN_SOURCES)) + +$(foreach src,$(filter %.c,$(KERN_SOURCES)),$(eval $(call COMPILE_c_o_kern_template,$(SOURCES_DIR)/$(src),$(src:%.c=%.o),))) + +$(foreach src,$(filter %.cc,$(KERN_SOURCES)),$(eval $(call COMPILE_cc_o_kern_template,$(SOURCES_DIR)/$(src),$(src:%.cc=%.o),))) + +endif + + +clean-local: + @echo Cleaning in $(KERN_OBJS_DIR) and $(USER_OBJS_DIR) + @rm -f $(KERN_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.lo $(USER_OBJS_DIR)/*.d $(USER_OBJS_DIR)/*.map + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..5e3797d --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1179 @@ +# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_PREREQ([2.52]) + +# serial 6 + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. We must strip everything past the first ":", +# and everything past the last "/". + +# _AM_DIRNAME(PATH) +# ----------------- +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(regexp([$1], [^/.*]), -1, + [.], + patsubst([$1], [^\(/\).*], [\1])), + patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +])# _AM_DIRNAME + + +# The stamp files are numbered to have different names. +# We could number them on a directory basis, but that's additional +# complications, let's have a unique counter. +m4_define([_AM_STAMP_Count], [0]) + + +# _AM_STAMP(HEADER) +# ----------------- +# The name of the stamp file for HEADER. +AC_DEFUN([_AM_STAMP], +[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl +AS_ESCAPE(_AM_DIRNAME(patsubst([$1], + [:.*])))/stamp-h[]_AM_STAMP_Count]) + + +# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) +# ------------------------------------------------------------ +# We used to try to get a real timestamp in stamp-h. But the fear is that +# that will cause unnecessary cvs conflicts. +AC_DEFUN([_AM_CONFIG_HEADER], +[# Add the stamp file to the list of files AC keeps track of, +# along with our hook. +AC_CONFIG_HEADERS([$1], + [# update the timestamp +echo 'timestamp for $1' >"_AM_STAMP([$1])" +$2], + [$3]) +])# _AM_CONFIG_HEADER + + +# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) +# -------------------------------------------------------------- +AC_DEFUN([AM_CONFIG_HEADER], +[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) +])# AM_CONFIG_HEADER + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +AC_PREREQ([2.52]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl + AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_][CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_][CC], + defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_][CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_][CXX], + defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.6.3])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + +# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST([DEPDIR]) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST(am__include) +AC_SUBST(am__quote) +AC_MSG_RESULT($_am_result) +rm -f confinc confmf +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional \"$1\" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + + + +AC_DEFUN(DS_LINUX_DIR, +[ + AC_ARG_WITH([linuxdir], + [AC_HELP_STRING([--with-linuxdir=DIR], + [specify path to Linux source directory])], + [LINUX_DIR="${withval}"], + [LINUX_DIR=default]) + + if test "${LINUX_DIR}" != "default" ; then + DS_TRY_LINUX_DIR([${LINUX_DIR}], , AC_MSG_ERROR([Linux dir not found]) ) + fi + + if test "${LINUX_DIR}" = "default" ; then + dir="/lib/modules/`uname -r`/build"; + DS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) + fi + if test "${LINUX_DIR}" = "default" ; then + dir="../linux"; + DS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) + fi + if test "${LINUX_DIR}" = "default" ; then + dir="/usr/src/linux"; + DS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) + fi + +# if test "${LINUX_DIR}" = "default" ; then +# AC_MSG_ERROR([Linux source directory not found]) +# fi + + AC_SUBST(LINUX_DIR) +]) + +AC_DEFUN(DS_TRY_LINUX_DIR, + [AC_MSG_CHECKING(for Linux in $1) + + if test -f "$1/Makefile" ; then + result=yes + $2 + else + result="not found" + $3 + fi + + AC_MSG_RESULT($result) +]) + +AC_DEFUN(DS_LINUX, +[ + DS_LINUX_DIR() + + AC_MSG_CHECKING([Linux version]) + + if test "${LINUX_DIR}" != "default" ; then + + if [[ ! -f "${LINUX_DIR}/.config" ]];then + AC_MSG_ERROR([ + The kernel source tree at ${LINUX_DIR} is not configured. + Fix before continuing.]) + fi + + if [[ ! -f "${LINUX_DIR}/include/linux/version.h" ]];then + AC_MSG_ERROR([The header file include/linux/version.h does not exist. + For 2.6 kernels, it can be generated by running 'make prepare' in + the kernel source directory.]) + fi + + LINUX_VERSION=$(grep UTS_RELEASE ${LINUX_DIR}/include/linux/version.h | \ + sed 's/[[^"]]*"\(.*\)\{1\}"/\1/') + + AC_MSG_RESULT([$LINUX_VERSION]) + + LINUX_VERSION_MAJOR=$(echo ${LINUX_VERSION} | cut -d. -f1) + LINUX_VERSION_MINOR=$(echo ${LINUX_VERSION} | cut -d. -f2) + + case $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR in + 2.6) + DS_LINUX_2_6() + ;; + 2.[[01234]]) + DS_LINUX_2_4() + ;; + *) + AC_MSG_ERROR([Unknown Linux major.minor $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR]) + ;; + esac + else + AC_MSG_RESULT(["none"]) + fi + + DS_RT() +]) + +AC_DEFUN(DS_LINUX_2_6, +[ + AC_MSG_CHECKING(for Linux CFLAGS) + + tmpdir="`pwd`/tmp-noicrwa" + + rm -rf ${tmpdir} + mkdir ${tmpdir} + + cat >${tmpdir}/Makefile <>\$(obj)/flags + echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_LDFLAGS=\"\" >>\$(obj)/flags + echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>\$(obj)/flags + echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>\$(obj)/flags + echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>\$(obj)/flags + echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_CC=\"\$(CC)\" >>\$(obj)/flags + echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>\$(obj)/flags + echo LINUX_AS=\"\$(AS)\" >>\$(obj)/flags +EOF + + echo ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5 + ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5 + . ${tmpdir}/flags + rm -rf ${tmpdir} + + LINUX_MODULE_EXT=".ko" + + AC_SUBST(LINUX_ARCH) + AC_SUBST(LINUX_AFLAGS) + AC_SUBST(LINUX_LDFLAGS) + AC_SUBST(LINUX_ARFLAGS) + AC_SUBST(LINUX_CROSS_COMPILE) + AC_SUBST(LINUX_KERNELRELEASE) + AC_SUBST(LINUX_CFLAGS) + AC_SUBST(LINUX_CC) + AC_SUBST(LINUX_LD) + AC_SUBST(LINUX_AS) + AC_SUBST(LINUX_MODULE_EXT) + + AC_MSG_RESULT([ok]) +]) + + +AC_DEFUN(DS_LINUX_2_4, +[ + AC_MSG_CHECKING(for Linux CFLAGS) + + if [[ ! -f "${LINUX_DIR}/.hdepend" ]];then + AC_MSG_ERROR([ +You need to run 'make dep' on the kernel source before continuing.]) + fi + + tmpdir="`pwd`/tmp-noicrwa" + + rm -rf ${tmpdir} + mkdir ${tmpdir} + + cat >${tmpdir}/Makefile <>flags + echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags + echo LINUX_LDFLAGS=\"\" >>flags + echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>flags + echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>flags + echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>flags + echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags + echo LINUX_CC=\"\$(CC)\" >>flags + echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>flags + echo LINUX_AS=\"\$(AS)\" >>flags +EOF + + echo ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5 + ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5 + . ${tmpdir}/flags + rm -rf ${tmpdir} + + LINUX_MODULE_EXT=".o" + + AC_SUBST(LINUX_ARCH) + AC_SUBST(LINUX_AFLAGS) + AC_SUBST(LINUX_LDFLAGS) + AC_SUBST(LINUX_ARFLAGS) + AC_SUBST(LINUX_CROSS_COMPILE) + AC_SUBST(LINUX_KERNELRELEASE) + AC_SUBST(LINUX_CFLAGS) + AC_SUBST(LINUX_CC) + AC_SUBST(LINUX_LD) + AC_SUBST(LINUX_AS) + AC_SUBST(LINUX_MODULE_EXT) + + AC_MSG_RESULT([ok]) +]) + +AC_DEFUN(DS_CHECK_LINUX_CONFIG_OPTION, +[ + AC_MSG_CHECKING([Linux config option $1]) + + if grep '^$1=y$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=yes + $2 + else if grep '^$1=m$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=module + $3 + else + result=no + $4 + fi + fi + + AC_MSG_RESULT([$result]) +]) + +AC_DEFUN(DS_LINUX_CONFIG_OPTION, +[ + DS_CHECK_LINUX_CONFIG_OPTION([$1], + [$1=yes], + [$1=module], + [$1=no]) + + AM_CONDITIONAL([$1],[test "${$1}" = yes]) +]) + +AC_DEFUN(DS_LINUX_CONFIG_OPTION_MODULE, +[ + DS_CHECK_LINUX_CONFIG_OPTION([$1], + [$1=yes], + [$1=module], + [$1=no]) + + AM_CONDITIONAL([$1],[test "${$1}" = yes -o "${$1}" = module]) +]) + +AC_DEFUN(DS_RTAI, +[ + AC_ARG_WITH([rtaidir], + [AC_HELP_STRING([--with-rtaidir=DIR], + [specify path to RTAI source directory])], + [RTAI_DIR="${withval}"], + [RTAI_DIR=/usr/src/rtai]) + + DS_LINUX_CONFIG_OPTION_MODULE([CONFIG_RTHAL]) + + if test "${CONFIG_RTHAL}" != "no" ; then + AC_MSG_CHECKING([RTAI directory ${RTAI_DIR}]) + if [[ -d ${RTAI_DIR}/include ]] ; then + RTAI_CFLAGS="-I${RTAI_DIR}/include" + else + if [ -d ${RTAI_DIR}/rtai-core/include ] ; then + RTAI_CFLAGS="-I${RTAI_DIR}/rtai-core/include" + else + AC_MSG_ERROR([incorrect RTAI directory?]) + fi + fi + $1 + AC_MSG_RESULT([found]) + AC_DEFINE([CONFIG_ORTE_RTAI],[1],[Define if kernel is RTAI patched]) + else + $2 + fi + AC_SUBST(RTAI_CFLAGS) + +]) + +AC_DEFUN(DS_RTLINUX, +[ + AC_ARG_WITH([rtlinuxdir], + [AC_HELP_STRING([--with-rtlinuxdir=DIR], + [specify path to RTLinux source directory])], + [RTLINUX_DIR="${withval}"], + [RTLINUX_DIR=/usr/src/rtlinux]) + + DS_LINUX_CONFIG_OPTION_MODULE([CONFIG_RTLINUX]) + + if test "${CONFIG_RTLINUX}" != "no" ; then + AC_MSG_CHECKING([RTLinux directory ${RTLINUX_DIR} for rtl.mk]) + if [[ -d ${RTLINUX_DIR}/include ]] ; then + RTLINUX_CFLAGS=`sed -n -e 's/^CFLAGS *=\(.*\)$/\1/p' ${RTLINUX_DIR}/rtl.mk` + else + AC_MSG_ERROR([incorrect RTLinux directory?]) + fi + AC_MSG_RESULT([found]) + AC_DEFINE([CONFIG_ORTE_RTL],[1],[Define if kernel is RTLinux patched]) + $1 + else + $2 + fi + AC_SUBST(RTLINUX_CFLAGS) +]) + +AC_DEFUN(DS_RT, +[ + DS_RTAI([USE_RTAI=yes],[USE_RTAI=no]) + DS_RTLINUX([USE_RTLINUX=yes],[USE_RTLINUX=no]) + if test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes" ; then + AC_DEFINE([CONFIG_ORTE_RT],[1],[Define to enable comedi's RT support]) + fi + AM_CONDITIONAL([USE_RTAI],[test ${USE_RTAI} == "yes"]) + AM_CONDITIONAL([USE_RTLINUX],[test ${USE_RTLINUX} == "yes"]) + AM_CONDITIONAL([CONFIG_ORTE_RT],[test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes"]) +]) + diff --git a/admin/compile b/admin/compile new file mode 100755 index 0000000..9bb997a --- /dev/null +++ b/admin/compile @@ -0,0 +1,99 @@ +#! /bin/sh + +# Wrapper for compilers which do not understand `-c -o'. + +# Copyright 1999, 2000 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Usage: +# compile PROGRAM [ARGS]... +# `-o FOO.o' is removed from the args passed to the actual compile. + +prog=$1 +shift + +ofile= +cfile= +args= +while test $# -gt 0; do + case "$1" in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we do something ugly here. + ofile=$2 + shift + case "$ofile" in + *.o | *.obj) + ;; + *) + args="$args -o $ofile" + ofile= + ;; + esac + ;; + *.c) + cfile=$1 + args="$args $1" + ;; + *) + args="$args $1" + ;; + esac + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$prog" $args +fi + +# Name of file we expect compiler to create. +cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir $lockdir > /dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir $lockdir; exit 1" 1 2 15 + +# Run the compile. +"$prog" $args +status=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +fi + +rmdir $lockdir +exit $status diff --git a/admin/config.guess b/admin/config.guess new file mode 100755 index 0000000..cd430f6 --- /dev/null +++ b/admin/config.guess @@ -0,0 +1,1314 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-08-21' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# Please send patches to . +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + sparc*:NetBSD:*) + echo `uname -p`-unknown-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + eval $set_cc_for_build + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-pc-linux-gnu\n", argv[1]); +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-pc-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +eval $set_cc_for_build +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/admin/config.sub b/admin/config.sub new file mode 100755 index 0000000..12ebc78 --- /dev/null +++ b/admin/config.sub @@ -0,0 +1,1410 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-08-13' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 \ + | we32k \ + | x86 | xscale \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alphapca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \ + | mipsle-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [cjt]90) + basic_machine=${basic_machine}-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb) + basic_machine=sh-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/admin/depcomp b/admin/depcomp new file mode 100755 index 0000000..6589965 --- /dev/null +++ b/admin/depcomp @@ -0,0 +1,411 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 AIX compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + + tmpdepfile1="$object.d" + tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` + if test "$libtool" = yes; then + "$@" -Wc,-MD + else + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + test -z "$dashmflag" && dashmflag=-M + ( IFS=" " + case " $* " in + *" --mode=compile "*) # this is libtool, let us make it quiet + for arg + do # cycle over the arguments + case "$arg" in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + # X makedepend + ( + shift + cleared=no + for arg in "$@"; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tail +3 "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/admin/install-sh b/admin/install-sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/admin/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/admin/linux.m4 b/admin/linux.m4 new file mode 100644 index 0000000..1f57d83 --- /dev/null +++ b/admin/linux.m4 @@ -0,0 +1,305 @@ + + +AC_DEFUN(DS_LINUX_DIR, +[ + AC_ARG_WITH([linuxdir], + [AC_HELP_STRING([--with-linuxdir=DIR], + [specify path to Linux source directory])], + [LINUX_DIR="${withval}"], + [LINUX_DIR=default]) + + if test "${LINUX_DIR}" != "default" ; then + DS_TRY_LINUX_DIR([${LINUX_DIR}], , AC_MSG_ERROR([Linux dir not found]) ) + fi + + if test "${LINUX_DIR}" = "default" ; then + dir="/lib/modules/`uname -r`/build"; + DS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) + fi + if test "${LINUX_DIR}" = "default" ; then + dir="../linux"; + DS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) + fi + if test "${LINUX_DIR}" = "default" ; then + dir="/usr/src/linux"; + DS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) + fi + +# if test "${LINUX_DIR}" = "default" ; then +# AC_MSG_ERROR([Linux source directory not found]) +# fi + + AC_SUBST(LINUX_DIR) +]) + +AC_DEFUN(DS_TRY_LINUX_DIR, + [AC_MSG_CHECKING(for Linux in $1) + + if test -f "$1/Makefile" ; then + result=yes + $2 + else + result="not found" + $3 + fi + + AC_MSG_RESULT($result) +]) + +AC_DEFUN(DS_LINUX, +[ + DS_LINUX_DIR() + + AC_MSG_CHECKING([Linux version]) + + if test "${LINUX_DIR}" != "default" ; then + + if [[ ! -f "${LINUX_DIR}/.config" ]];then + AC_MSG_ERROR([ + The kernel source tree at ${LINUX_DIR} is not configured. + Fix before continuing.]) + fi + + if [[ ! -f "${LINUX_DIR}/include/linux/version.h" ]];then + AC_MSG_ERROR([The header file include/linux/version.h does not exist. + For 2.6 kernels, it can be generated by running 'make prepare' in + the kernel source directory.]) + fi + + LINUX_VERSION=$(grep UTS_RELEASE ${LINUX_DIR}/include/linux/version.h | \ + sed 's/[[^"]]*"\(.*\)\{1\}"/\1/') + + AC_MSG_RESULT([$LINUX_VERSION]) + + LINUX_VERSION_MAJOR=$(echo ${LINUX_VERSION} | cut -d. -f1) + LINUX_VERSION_MINOR=$(echo ${LINUX_VERSION} | cut -d. -f2) + + case $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR in + 2.6) + DS_LINUX_2_6() + ;; + 2.[[01234]]) + DS_LINUX_2_4() + ;; + *) + AC_MSG_ERROR([Unknown Linux major.minor $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR]) + ;; + esac + else + AC_MSG_RESULT(["none"]) + fi + + DS_RT() +]) + +AC_DEFUN(DS_LINUX_2_6, +[ + AC_MSG_CHECKING(for Linux CFLAGS) + + tmpdir="`pwd`/tmp-noicrwa" + + rm -rf ${tmpdir} + mkdir ${tmpdir} + + cat >${tmpdir}/Makefile <>\$(obj)/flags + echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_LDFLAGS=\"\" >>\$(obj)/flags + echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>\$(obj)/flags + echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>\$(obj)/flags + echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>\$(obj)/flags + echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_CC=\"\$(CC)\" >>\$(obj)/flags + echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>\$(obj)/flags + echo LINUX_AS=\"\$(AS)\" >>\$(obj)/flags +EOF + + echo ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5 + ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5 + . ${tmpdir}/flags + rm -rf ${tmpdir} + + LINUX_MODULE_EXT=".ko" + + AC_SUBST(LINUX_ARCH) + AC_SUBST(LINUX_AFLAGS) + AC_SUBST(LINUX_LDFLAGS) + AC_SUBST(LINUX_ARFLAGS) + AC_SUBST(LINUX_CROSS_COMPILE) + AC_SUBST(LINUX_KERNELRELEASE) + AC_SUBST(LINUX_CFLAGS) + AC_SUBST(LINUX_CC) + AC_SUBST(LINUX_LD) + AC_SUBST(LINUX_AS) + AC_SUBST(LINUX_MODULE_EXT) + + AC_MSG_RESULT([ok]) +]) + + +AC_DEFUN(DS_LINUX_2_4, +[ + AC_MSG_CHECKING(for Linux CFLAGS) + + if [[ ! -f "${LINUX_DIR}/.hdepend" ]];then + AC_MSG_ERROR([ +You need to run 'make dep' on the kernel source before continuing.]) + fi + + tmpdir="`pwd`/tmp-noicrwa" + + rm -rf ${tmpdir} + mkdir ${tmpdir} + + cat >${tmpdir}/Makefile <>flags + echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags + echo LINUX_LDFLAGS=\"\" >>flags + echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>flags + echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>flags + echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>flags + echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags + echo LINUX_CC=\"\$(CC)\" >>flags + echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>flags + echo LINUX_AS=\"\$(AS)\" >>flags +EOF + + echo ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5 + ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5 + . ${tmpdir}/flags + rm -rf ${tmpdir} + + LINUX_MODULE_EXT=".o" + + AC_SUBST(LINUX_ARCH) + AC_SUBST(LINUX_AFLAGS) + AC_SUBST(LINUX_LDFLAGS) + AC_SUBST(LINUX_ARFLAGS) + AC_SUBST(LINUX_CROSS_COMPILE) + AC_SUBST(LINUX_KERNELRELEASE) + AC_SUBST(LINUX_CFLAGS) + AC_SUBST(LINUX_CC) + AC_SUBST(LINUX_LD) + AC_SUBST(LINUX_AS) + AC_SUBST(LINUX_MODULE_EXT) + + AC_MSG_RESULT([ok]) +]) + +AC_DEFUN(DS_CHECK_LINUX_CONFIG_OPTION, +[ + AC_MSG_CHECKING([Linux config option $1]) + + if grep '^$1=y$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=yes + $2 + else if grep '^$1=m$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=module + $3 + else + result=no + $4 + fi + fi + + AC_MSG_RESULT([$result]) +]) + +AC_DEFUN(DS_LINUX_CONFIG_OPTION, +[ + DS_CHECK_LINUX_CONFIG_OPTION([$1], + [$1=yes], + [$1=module], + [$1=no]) + + AM_CONDITIONAL([$1],[test "${$1}" = yes]) +]) + +AC_DEFUN(DS_LINUX_CONFIG_OPTION_MODULE, +[ + DS_CHECK_LINUX_CONFIG_OPTION([$1], + [$1=yes], + [$1=module], + [$1=no]) + + AM_CONDITIONAL([$1],[test "${$1}" = yes -o "${$1}" = module]) +]) + +AC_DEFUN(DS_RTAI, +[ + AC_ARG_WITH([rtaidir], + [AC_HELP_STRING([--with-rtaidir=DIR], + [specify path to RTAI source directory])], + [RTAI_DIR="${withval}"], + [RTAI_DIR=/usr/src/rtai]) + + DS_LINUX_CONFIG_OPTION_MODULE([CONFIG_RTHAL]) + + if test "${CONFIG_RTHAL}" != "no" ; then + AC_MSG_CHECKING([RTAI directory ${RTAI_DIR}]) + if [[ -d ${RTAI_DIR}/include ]] ; then + RTAI_CFLAGS="-I${RTAI_DIR}/include" + else + if [ -d ${RTAI_DIR}/rtai-core/include ] ; then + RTAI_CFLAGS="-I${RTAI_DIR}/rtai-core/include" + else + AC_MSG_ERROR([incorrect RTAI directory?]) + fi + fi + $1 + AC_MSG_RESULT([found]) + AC_DEFINE([CONFIG_ORTE_RTAI],[1],[Define if kernel is RTAI patched]) + else + $2 + fi + AC_SUBST(RTAI_CFLAGS) + +]) + +AC_DEFUN(DS_RTLINUX, +[ + AC_ARG_WITH([rtlinuxdir], + [AC_HELP_STRING([--with-rtlinuxdir=DIR], + [specify path to RTLinux source directory])], + [RTLINUX_DIR="${withval}"], + [RTLINUX_DIR=/usr/src/rtlinux]) + + DS_LINUX_CONFIG_OPTION_MODULE([CONFIG_RTLINUX]) + + if test "${CONFIG_RTLINUX}" != "no" ; then + AC_MSG_CHECKING([RTLinux directory ${RTLINUX_DIR} for rtl.mk]) + if [[ -d ${RTLINUX_DIR}/include ]] ; then + RTLINUX_CFLAGS=`sed -n -e 's/^CFLAGS *=\(.*\)$/\1/p' ${RTLINUX_DIR}/rtl.mk` + else + AC_MSG_ERROR([incorrect RTLinux directory?]) + fi + AC_MSG_RESULT([found]) + AC_DEFINE([CONFIG_ORTE_RTL],[1],[Define if kernel is RTLinux patched]) + $1 + else + $2 + fi + AC_SUBST(RTLINUX_CFLAGS) +]) + +AC_DEFUN(DS_RT, +[ + DS_RTAI([USE_RTAI=yes],[USE_RTAI=no]) + DS_RTLINUX([USE_RTLINUX=yes],[USE_RTLINUX=no]) + if test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes" ; then + AC_DEFINE([CONFIG_ORTE_RT],[1],[Define to enable comedi's RT support]) + fi + AM_CONDITIONAL([USE_RTAI],[test ${USE_RTAI} == "yes"]) + AM_CONDITIONAL([USE_RTLINUX],[test ${USE_RTLINUX} == "yes"]) + AM_CONDITIONAL([CONFIG_ORTE_RT],[test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes"]) +]) diff --git a/admin/ltconfig b/admin/ltconfig new file mode 100755 index 0000000..2a21aaa --- /dev/null +++ b/admin/ltconfig @@ -0,0 +1,2795 @@ +#! /bin/sh + +# ltconfig - Create a system-specific libtool. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A lot of this script is taken from autoconf-2.10. + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} +echo=echo +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec "$SHELL" "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null`} + case X$UNAME in + *-DOS) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; + esac +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running ltconfig again with it. + ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + + export echo_test_string + exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# The name of this program. +progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` + +# Constants: +PROGRAM=ltconfig +PACKAGE=libtool +VERSION=1.4a +TIMESTAMP=" (1.641.2.206mm 2001/04/03 21:47:47)" +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +rm="rm -f" + +help="Try \`$progname --help' for more information." + +# Global variables: +default_ofile=libtool +can_build_shared=yes +enable_shared=yes +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +enable_static=yes +enable_fast_install=yes +enable_dlopen=unknown +enable_win32_dll=no +pic_mode=default +ltmain= +silent= +srcdir= +ac_config_guess= +ac_config_sub= +host= +build=NONE +nonopt=NONE +ofile="$default_ofile" +verify_host=yes +tagname= +with_gcc=no +with_gnu_ld=no +need_locks=yes +ac_ext=c +libext=a +cache_file= +max_cmd_len= + +## Dependencies to place before and after the object being linked: +predep_objects= +postdep_objects= +predeps= +postdeps= +compiler_lib_search_path= + +## Link characteristics: +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +old_archive_from_expsyms_cmds= +striplib= +old_striplib= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_into_libs=no +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +link_all_deplibs=unknown +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression of symbols to exclude +# it will be wrapped by ` (' and `)$', so one must not match beginning or +# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +# as well as any symbol that contains `d'. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_" +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +# platforms (ab)use it in PIC code, but their linkers get confused if +# the symbol is explicitly referenced. Since portable code cannot +# rely on this symbol name, it's probably fine to never include it in +# preloaded symbol tables. +extract_expsyms_cmds= + +## Tools: +old_AR="$AR" +old_AR_FLAGS="$AR_FLAGS" +old_CC="$CC" +old_CFLAGS="$CFLAGS" +old_CPPFLAGS="$CPPFLAGS" +old_LDFLAGS="$LDFLAGS" +old_LIBS="$LIBS" +old_MAGIC_CMD="$MAGIC_CMD" +old_LD="$LD" +old_LN_S="$LN_S" +old_LTCC="$LTCC" +old_NM="$NM" +old_RANLIB="$RANLIB" +old_STRIP="$STRIP" +old_AS="$AS" +old_DLLTOOL="$DLLTOOL" +old_OBJDUMP="$OBJDUMP" +old_OBJEXT="$OBJEXT" +old_EXEEXT="$EXEEXT" +old_reload_flag="$reload_flag" +old_deplibs_check_method="$deplibs_check_method" +old_file_magic_cmd="$file_magic_cmd" + +# Parse the command line options. +args= +prev= +for option +do + case $option in + -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + eval "$prev=\$option" + prev= + continue + fi + + case $option in + --help) cat <&2 + echo "$help" 1>&2 + exit 1 + ;; + + *) + if test -z "$ltmain"; then + ltmain="$option" + elif test -z "$host"; then +# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 +# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then +# echo "$progname: warning \`$option' is not a valid host type" 1>&2 +# fi + host="$option" + else + echo "$progname: too many arguments" 1>&2 + echo "$help" 1>&2 + exit 1 + fi ;; + esac +done + +if test -z "$ltmain"; then + echo "$progname: you must specify a LTMAIN file" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +if test ! -f "$ltmain"; then + echo "$progname: \`$ltmain' does not exist" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +if test -n "$tagname"; then + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in + "") ;; + *) + echo "$progname: invalid tag name: $tagname" 1>&2 + exit 1 + ;; + esac + + if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ofile" > /dev/null; then + echo "$progname: tag name $tagname already exists" 1>&2 + exit 1 + fi + + if test ! -f "$ofile"; then + echo "$progname: warning: output file \`$ofile' does not exist" 1>&2 + fi + + if test -z "$LTCC"; then + eval "`$SHELL $ofile --config | grep '^LTCC='`" + if test -z "$LTCC"; then + echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2 + else + echo "$progname: warning: using \`LTCC=$LTCC', extracted from \`$ofile'" 1>&2 + fi + fi +fi + +# Quote any args containing shell metacharacters. +ltconfig_args= +for arg +do + case $arg in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ltconfig_args="$ltconfig_args '$arg'" ;; + *) ltconfig_args="$ltconfig_args $arg" ;; + esac +done + +# A relevant subset of AC_INIT. + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 5 compiler messages saved in config.log +# 6 checking for... messages and results +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>>./config.log + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi +if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi + +if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then + echo "loading cache $cache_file within ltconfig" + . $cache_file +fi + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + +if test -z "$srcdir"; then + # Assume the source directory is the same one as the path to LTMAIN. + srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` + test "$srcdir" = "$ltmain" && srcdir=. +fi + +trap "$rm conftest*; exit 1" 1 2 15 +if test "$verify_host" = yes; then + # Check for config.guess and config.sub. + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/config.guess; then + ac_aux_dir=$ac_dir + break + fi + done + if test -z "$ac_aux_dir"; then + echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 + echo "$help" 1>&2 + exit 1 + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + + # Make sure we can run config.sub. + if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : + else + echo "$progname: cannot run $ac_config_sub" 1>&2 + echo "$help" 1>&2 + exit 1 + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 + + host_alias=$host + case $host_alias in + "") + # Force config.guess to use the C compiler. + # CC_FOR_BUILD overrides the CC variable in config.guess but I had + # problems with it so do it this way for now. + CC="$LTCC" + + if host_alias=`$SHELL $ac_config_guess`; then : + else + echo "$progname: cannot guess host type; you must specify one" 1>&2 + echo "$help" 1>&2 + exit 1 + fi + + # Restore the C compiler. + CC="$old_CC" + ;; + esac + host=`$SHELL $ac_config_sub $host_alias` + echo "$ac_t$host" 1>&6 + + # Make sure the host verified. + test -z "$host" && exit 1 + + # Check for the build system type + echo $ac_n "checking build system type... $ac_c" 1>&6 + + build_alias=$build + case $build_alias in + NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; + esac + + build=`$SHELL $ac_config_sub $build_alias` + build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$build" 1>&6 + +elif test -z "$host"; then + echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 + echo "$help" 1>&2 + exit 1 +else + host_alias=$host + build_alias=$host_alias + build=$host +fi + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case $host_os in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" +fi + +# Source the script associated with the $tagname tag configuration. +if test -n "$tagname"; then + . $ltmain +else + # FIXME: We should use a variable here + # Configure for a C compiler + . $srcdir/ltcf-c.sh +fi + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$NM" && NM=nm +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$objext" && objext=o + +echo $ac_n "checking for objdir... $ac_c" 1>&6 +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +echo "$ac_t$objdir" 1>&6 + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="$2" + +# We assume here that the value for ac_cv_prog_cc_pic will not be cached +# in isolation, and that seeing it set (from the cache) indicates that +# the associated values are set (in the cache) correctly too. +echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 +echo "$progname:678:checking for $compiler option to produce PIC" 1>&5 + +if test -z "$ac_cv_prog_cc_pic"; then + echo "$ac_t"none 1>&6 +else + echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6 + + # Check to make sure the pic_flag actually works. + echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6 + echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5 + if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \ + test "X${ac_cv_prog_cc_pic_works}" != X; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_prog_cc_pic_works=yes + $rm conftest* + echo $lt_simple_compile_test_code > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC" + if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + case $host_os in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then + # they create non-PIC objects. So, if there were any warnings, we + # assume that PIC is not supported. + if test -s conftest.err; then + ac_cv_prog_cc_pic_works=no + ac_cv_prog_cc_can_build_shared=no + ac_cv_prog_cc_pic= + else + ac_cv_prog_cc_pic_works=yes + ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" + fi + ;; + *) + ac_cv_prog_cc_pic_works=yes + ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" + ;; + esac + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + ac_cv_prog_cc_pic_works=no + ac_cv_prog_cc_can_build_shared=no + ac_cv_prog_cc_pic= + fi + CFLAGS="$save_CFLAGS" + $rm conftest* + fi + # Belt *and* braces to stop my trousers falling down: + if test "X$ac_cv_prog_cc_pic_works" = Xno; then + ac_cv_prog_cc_pic= + ac_cv_prog_cc_can_build_shared=no + fi + echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6 +fi + +# Check for any special shared library compilation flags. +if test -n "$ac_cv_prog_cc_shlib"; then + echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2 + if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then : + else + echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 + ac_cv_prog_cc_can_build_shared=no + fi +fi + +echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6 +echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5 +if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \ + test "X${ac_cv_prog_cc_static_works}" != X; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + $rm conftest* + echo $lt_simple_link_test_code > conftest.$ac_ext + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static" + if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_static_works=yes + else + ac_cv_prog_cc_static_works=no + ac_cv_prog_cc_static= + fi + LDFLAGS="$save_LDFLAGS" + $rm conftest* +fi +# Belt *and* braces to stop my trousers falling down: +if test "X$ac_cv_prog_cc_static_works" = Xno; then + ac_cv_prog_cc_static= +fi +echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6 +pic_flag="$ac_cv_prog_cc_pic" +special_shlib_compile_flags="$ac_cv_prog_cc_shlib" +wl="$ac_cv_prog_cc_wl" +link_static_flag="$ac_cv_prog_cc_static" +no_builtin_flag="$ac_cv_prog_cc_no_builtin" +can_build_shared="$ac_cv_prog_cc_can_build_shared" + +# find the maximum length of command line arguments +echo "$progname:780: finding the maximum length of command line arguments" 1>&5 +echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + i=0 + testring="ABCDEF" + while test `$CONFIG_SHELL $0 --fallback-echo "X$testring" >/dev/null 2>&1` == `echo "X$testring" >/dev/null 2>&1` && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 32 # 1 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # add a significant safety factor because C++ compilers can tack on massive amounts + # of additional arguments before passing them to the linker. 1/4 should be good. + len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len` +fi +echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5 +echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6 + +if test -n $lt_cv_sys_max_cmd_len ; then + max_cmd_len=$lt_cv_sys_max_cmd_len +else + max_cmd_len=none +fi + +# Check to see if options -o and -c are simultaneously supported by compiler +echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6 +if test "${lt_cv_compiler_c_o+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + $rm conftest* + echo $lt_simple_compile_test_code > conftest.$ac_ext + mkdir out + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -o out/conftest2.$objext" + echo "$progname:829: checking if $compiler supports -c -o file.$objext" >&5 + if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + lt_cv_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi + else + # Append any errors to the config.log. + cat out/conftest.err 1>&5 + lt_cv_compiler_c_o=no + fi + CFLAGS="$save_CFLAGS" + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm -r conftest 2>/dev/null +fi +compiler_c_o=$lt_cv_compiler_c_o +echo "${ac_t}$compiler_c_o" 1>&6 + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$ac_t$hard_links" 1>&6 + $rm conftest* + if test "$hard_links" = no; then + echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 + need_locks=warn + fi +else + need_locks=no +fi + +if test "$with_gcc" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 + $rm conftest* + echo $lt_simple_compile_test_code > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" + echo "$progname:883: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + if { (eval echo $progname:884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + compiler_rtti_exceptions=no + else + echo "$ac_t"yes 1>&6 + compiler_rtti_exceptions=yes + fi + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + compiler_rtti_exceptions=no + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi + +fi + +# See if the linker supports building shared libraries. +echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 + +echo "$ac_t$ld_shlibs" 1>&6 +test "$ld_shlibs" = no && can_build_shared=no + +# Check hardcoding attributes. +echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$ac_t$hardcode_action" 1>&6 + +echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "${ac_t}yes" 1>&6 +else + echo "${ac_t}no" 1>&6 +fi + +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +# PORTME Fill in your ld.so characteristics +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + +echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4* | aix5*) + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + # We preserve .a as extension for shared libraries though AIX4.2 + # and later linker supports .so + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so instead of + # lib.a to let people know that these are not typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + # We want symlinks to be created for the different names. + version_type=linux + else + # We preserve .a as extension for shared libraries though AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major.o' + fi + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + shlibpath_var=LIBPATH + deplibs_check_method=pass_all + # Put the right runpath into libraries. + hardcode_into_libs=yes + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + can_build_shared=no + fi + ;; + esac + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $with_gcc,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll; $rm \$dlpath' + ;; + yes,mingw*) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' +;; + *) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}.`test .$module = .yes && echo so || echo dylib` ${libname}${release}${major}.$`test .$module = .yes && echo so || echo dylib` ${libname}.`test .$module = .yes && echo so || echo dylib`' + soname_spec='${libname}${release}${major}.`test .$module = .yes && echo so || echo dylib`' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + *) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + hardcode_into_libs=all + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + need_version=yes + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + need_version=no + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + # OpenBSD 2.7 the overriding is needed for fast-install + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$ac_t$dynamic_linker" 1>&6 +test "$dynamic_linker" = no && can_build_shared=no + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" + ;; +irix*) + symcode='[BCDEGRST]' + ;; +solaris* | sysv5*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[ABCDGISTW]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. +global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + $rm conftest* + cat > conftest.$ac_ext <&5 + if { (eval echo $progname:1424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + # Now try to grab the symbols. + nlist=conftest.nm + if { echo "$progname:1427: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$objext conftstm.$objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if { (eval echo $progname:1479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + pipe_works=yes + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + LIBS="$save_LIBS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + $rm conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + global_symbol_pipe= + fi +done +if test "$pipe_works" = yes; then + echo "${ac_t}ok" 1>&6 +else + echo "${ac_t}failed" 1>&6 +fi + +if test -z "$global_symbol_pipe"; then + global_symbol_to_cdecl= +fi + +# Report the final consequences. +echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 + +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in +# configure.in, otherwise build static only libraries. +case $host_os in +cygwin* | mingw* | pw32* | os2*) + if test x$can_build_shared = xyes; then + test x$enable_win32_dll = xno && can_build_shared=no + echo "checking if package supports dlls... $can_build_shared" 1>&6 + fi +;; +esac + +echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + test "$enable_shared" = yes && enable_static=no + ;; +esac + +echo "$ac_t$enable_shared" 1>&6 + +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes + +echo "checking whether to build static libraries... $enable_static" 1>&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$with_gcc" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# Check whether we must set pic_mode to default +test -z "$pic_flag" && pic_mode=default + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else +if test "X${lt_cv_dlopen+set}" != Xset; then + lt_cv_dlopen=no lt_cv_dlopen_libs= +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "$progname:1583: checking for dlopen in -ldl" >&5 +if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_dl_dlopen=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_dl_dlopen=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_dl_dlopen" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen""... $ac_c" 1>&6 +echo "$progname:1622: checking for dlopen" >&5 +if test "X${ac_cv_func_dlopen+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +dlopen(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_dlopen=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_dlopen=no +fi +rm -f conftest* +fi +if test "X$ac_cv_func_dlopen" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 +echo "$progname:1669: checking for dlopen in -lsvld" >&5 +if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsvld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_svld_dlopen=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_svld_dlopen=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_svld_dlopen" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 +echo "$progname:1708: checking for dld_link in -ldld" >&5 +if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_dld_dld_link=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_dld_dld_link=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_dld_dld_link" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load""... $ac_c" 1>&6 +echo "$progname:1747: checking for shl_load" >&5 +if test "X${ac_cv_func_shl_load+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +shl_load(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_shl_load=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_shl_load=no +fi +rm -f conftest* +fi + +if test "X$ac_cv_func_shl_load" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "$progname:1795: checking for shl_load in -ldld" >&5 +if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_dld_shl_load=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_dld_shl_load=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_dld_shl_load" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +fi + + +fi + + +fi + +fi + +fi + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) +for ac_hdr in dlfcn.h; do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "$progname:1863: checking for $ac_hdr" >&5 +if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int fnord = 0; +int main () { return(0); } +EOF +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:1874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +done + + if test "x$ac_cv_header_dlfcn_h" = xyes; then + CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + fi + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:1902: checking whether a program can dlopen itself" >&5 +if test "X${lt_cv_dlopen_self+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self=cross + else + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42; } +int main() { + void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); return 1;} + +EOF +if { (eval echo $progname:1957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self" 1>&6 + + if test "$lt_cv_dlopen_self" = yes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:1976: checking whether a statically linked program can dlopen itself" >&5 +if test "X${lt_cv_dlopen_self_static+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self_static=cross + else + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42; } +int main() { + void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); return 1; } + +EOF +if { (eval echo $progname:2031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self_static=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self_static=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 +fi + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + +# Copy echo and quote the copy, instead of the original, because it is +# used later. +ltecho="$echo" +if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ltecho="$CONFIG_SHELL \$0 --fallback-echo" +fi +LTSHELL="$SHELL" + +LTCONFIG_VERSION="$VERSION" + +# Only quote variables if we're using ltmain.sh. +case $ltmain in +*.sh) + # Now quote all the things that may contain metacharacters. + for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ + old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ + old_LN_S old_NM old_RANLIB old_STRIP \ + old_AS old_DLLTOOL old_OBJDUMP \ + old_OBJEXT old_EXEEXT old_reload_flag \ + old_deplibs_check_method old_file_magic_cmd \ + AR AR_FLAGS CC LTCC LD LN_S NM LTSHELL LTCONFIG_VERSION \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ + postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ + predep_objects postdep_objects predeps postdeps compiler_lib_search_path \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o need_locks exclude_expsyms include_expsyms; do + + case $var in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test + ;; + *) + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test + ;; + esac + done + + case $ltecho in + *'\$0 --fallback-echo"') + ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + + if test -z "$tagname"; then + trap "$rm \"$ofile\"; exit 1" 1 2 15 + echo "creating $ofile" + $rm "$ofile" + cat < "$ofile" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. +# +# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +### BEGIN LIBTOOL CONFIG +EOF + else + echo "appending configuration tag \"$tagname\" to $ofile" + echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" + fi + cfgfile="$ofile" + ;; + +*) + # Double-quote the variables that need it (for aesthetics). + for var in old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ + old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ + old_LN_S old_NM old_RANLIB old_STRIP \ + old_AS old_DLLTOOL old_OBJDUMP \ + old_OBJEXT old_EXEEXT old_reload_flag \ + old_deplibs_check_method old_file_magic_cmd; do + eval "$var=\\\"\$var\\\"" + done + + # Just create a config file. + cfgfile="$ofile.cfg" + if test -z "$tagname"; then + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + echo "creating $cfgfile" + $rm "$cfgfile" + cat < "$cfgfile" +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) + +### BEGIN LIBTOOL CONFIG +EOF + else + echo "appending to $cfgfile" + echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" + fi + ;; +esac + +cat <> "$cfgfile" +# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# AR=$old_AR AR_FLAGS=$old_AR_FLAGS LTCC=$old_LTCC CC=$old_CC \\ +# CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ +# MAGIC_CMD=$old_MAGIC_CMD LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ +# LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\ +# AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\ +# objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\ +# deplibs_check_method=$old_deplibs_check_method \\ +# file_magic_cmd=$old_file_magic_cmd \\ +# $0$ltconfig_args +# +# Compiler and other test output produced by $progname, useful for +# debugging $progname, is in ./config.log if it exists. + +# The version of $progname that generated this script. +LTCONFIG_VERSION=$LTCONFIG_VERSION + +# Shell to use when invoking shell scripts. +SHELL=$LTSHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$need_lc + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$ltecho + +# The archiver. +AR=$AR +AR_FLAGS=$AR_FLAGS + +# A C compiler. +LTCC=$LTCC + +# A language-specific compiler. +CC=$CC + +# Is the compiler the GNU C compiler? +with_gcc=$with_gcc + +# The linker used to build libraries. +LD=$LD + +# Whether we need hard or soft links. +LN_S=$LN_S + +# A BSD-compatible nm program. +NM=$NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$reload_flag +reload_cmds=$reload_cmds + +# How to pass a linker flag through the compiler. +wl=$wl + +# Object file suffix (normally "o"). +objext="$objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$pic_flag +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$compiler_c_o + +# Must we lock files when doing compilation ? +need_locks=$need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$RANLIB +old_archive_cmds=$old_archive_cmds +old_postinstall_cmds=$old_postinstall_cmds +old_postuninstall_cmds=$old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$archive_cmds +archive_expsym_cmds=$archive_expsym_cmds +postinstall_cmds=$postinstall_cmds +postuninstall_cmds=$postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$old_striplib +striplib=$striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$global_symbol_to_cdecl + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$hardcode_libdir_separator + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$include_expsyms + +EOF + +if test -z "$tagname"; then + echo '### END LIBTOOL CONFIG' >> "$ofile" +else + echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile" +fi + +case $ltmain in +*.sh) + echo >> "$ofile" + if test -z "$tagname"; then + case $host_os in + aix3*) + cat <<\EOF >> "$ofile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + cat <<'EOF' >> "$ofile" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# */ +# +# #include /* for printf() */ +# #include /* for open(), lseek(), read() */ +# #include /* for O_RDONLY, O_BINARY */ +# #include /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + + chmod +x "$ofile" + fi + ;; + +*) + # Compile the libtool program. + echo "FIXME: would compile $ltmain" + ;; +esac + +# Update the list of available tags. +if test -n "$tagname"; then + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" $ofile | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + # Append the new tag name to the list of available tags. + available_tags="$available_tags $tagname" + + # Now substitute the updated of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' ${ofile} > ${ofile}.new"; then + mv ${ofile}.new ${ofile} + chmod +x "$ofile" + else + rm -f ${ofile}.new + echo "$progname: unable to update list of available tagged configurations." + exit 1 + fi +fi + +# Don't cache tagged configuration! +test -n "$cache_file" && test -z "$tagname" || exit 0 + +# AC_CACHE_SAVE +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +exit 0 + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/admin/ltmain.sh b/admin/ltmain.sh new file mode 100644 index 0000000..47f816f --- /dev/null +++ b/admin/ltmain.sh @@ -0,0 +1,4982 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +# Parse our command line options once, thoroughly. +while test $# -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + exit 0 + ;; + + --config) + sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 + exit 0 + ;; + + --debug) + echo "$progname: enabling shell trace mode" + set -x + ;; + + --dry-run | -n) + run=: + ;; + + --features) + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + exit 0 + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --quiet | --silent) + show=: + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 +fi + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + case $nonopt in + *cc | *++ | gcc* | *-gcc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + prev= + lastarg= + srcfile="$nonopt" + suppress_output= + + user_target=no + for arg + do + case $prev in + "") ;; + xcompiler) + # Aesthetically quote the previous argument. + prev= + lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + + case $arg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + + # Accept any command-line options. + case $arg in + -o) + if test "$user_target" != "no"; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit 1 + fi + user_target=next + ;; + + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + + case $user_target in + next) + # The next one is the -o target name + user_target=yes + continue + ;; + yes) + # We got the output file + user_target=set + libobj="$arg" + continue + ;; + esac + + # Accept the current argument as the source file. + lastarg="$srcfile" + srcfile="$arg" + + # Aesthetically quote the previous argument. + + # Backslashify any backslashes, double quotes, and dollar signs. + # These are the only characters that are still specially + # interpreted inside of double-quoted scrings. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $lastarg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + done + + case $user_target in + set) + ;; + no) + # Get the name of the library object. + libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + *) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit 1 + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSfmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit 1 + ;; + esac + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $libobj" + else + removelist="$libobj" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit 1" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit 1" 1 2 15 + else + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$0" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + echo $srcfile > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + # All platforms use -DPIC, to notify preprocessed assembler code. + command="$base_compile $srcfile $pic_flag -DPIC" + else + # Don't build PIC code + command="$base_compile $srcfile" + fi + if test "$build_old_libs" = yes; then + lo_libobj="$libobj" + dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$libobj"; then + dir="$objdir" + else + dir="$dir/$objdir" + fi + libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + + if test -d "$dir"; then + $show "$rm $libobj" + $run $rm $libobj + else + $show "$mkdir $dir" + $run $mkdir $dir + status=$? + if test $status -ne 0 && test ! -d $dir; then + exit $status + fi + fi + fi + if test "$compiler_o_lo" = yes; then + output_obj="$libobj" + command="$command -o $output_obj" + elif test "$compiler_c_o" = yes; then + output_obj="$obj" + command="$command -o $output_obj" + fi + + $run $rm "$output_obj" + $show "$command" + if $run eval "$command"; then : + else + test -n "$output_obj" && $run $rm $removelist + exit 1 + fi + + if test "$need_locks" = warn && + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed, then go on to compile the next one + if test x"$output_obj" != x"$libobj"; then + $show "$mv $output_obj $libobj" + if $run $mv $output_obj $libobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # If we have no pic_flag, then copy the object into place and finish. + if (test -z "$pic_flag" || test "$pic_mode" != default) && + test "$build_old_libs" = yes; then + # Rename the .lo from within objdir to obj + if test -f $obj; then + $show $rm $obj + $run $rm $obj + fi + + $show "$mv $libobj $obj" + if $run $mv $libobj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` + libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + # Now arrange that obj and lo_libobj become the same file + $show "(cd $xdir && $LN_S $baseobj $libobj)" + if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + $run $rm "$lockfile" + fi + exit 0 + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Allow error messages only from the first compilation. + suppress_output=' >/dev/null 2>&1' + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $srcfile" + else + # All platforms use -DPIC, to notify preprocessed assembler code. + command="$base_compile $srcfile $pic_flag -DPIC" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + output_obj="$obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + $run $rm "$output_obj" + $show "$command" + if $run eval "$command"; then : + else + $run $rm $removelist + exit 1 + fi + + if test "$need_locks" = warn && + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed + if test x"$output_obj" != x"$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Create an invalid libtool object if no PIC, so that we do not + # accidentally link it into a program. + if test "$build_libtool_libs" != yes; then + $show "echo timestamp > $libobj" + $run eval "echo timestamp > \$libobj" || exit $? + else + # Move the .lo from within objdir + $show "$mv $libobj $lo_libobj" + if $run $mv $libobj $lo_libobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + fi + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + $run $rm "$lockfile" + fi + + exit 0 + ;; + + # libtool link mode + link | relink) + modename="$modename: link" + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invokation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args="$nonopt" + compile_command="$nonopt" + finalize_command="$nonopt" + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -all-static | -static) + if test "X$arg" = "X-all-static"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test $# -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit 1 + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n $prev + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit 1 + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit 1 + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + esac + fi + if test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -o) prev=output ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.lo | *.$objext) + # A library or standard object. + if test "$prev" = dlfiles; then + # This file was specified with -dlopen. + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $arg" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` + prev= + else + case $arg in + *.lo) libobjs="$libobjs $arg" ;; + *) objs="$objs $arg" ;; + esac + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d $output_objdir; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $output_objdir; then + exit $status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + libs="$libs $deplib" + done + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit 1 + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test $linkmode = prog; then + # Determine which files to process + case $pass in + dlopen) + libs="$dlfiles" + save_deplibs="$deplibs" # Collect dlpreopened libraries + deplibs= + ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -l*) + if test $linkmode = oldlib && test $linkmode = obj; then + $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 + continue + fi + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + # Search the libtool library + lib="$searchdir/lib${name}.la" + if test -f "$lib"; then + found=yes + break + fi + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test $pass = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test $pass = scan; then + deplibs="$deplib $deplibs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test $pass = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + if test "$deplibs_check_method" != pass_all; then + echo + echo "*** Warning: This library needs some functionality provided by $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + else + echo + echo "*** Warning: Linking the shared library $output against the" + echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test $pass != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test $found = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit 1 + fi + + # Check to see that this really is a libtool archive. + if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variable installed. + installed=yes + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test $linkmode = oldlib && test $linkmode = obj; }; then + # Add dl[pre]opened files of deplib + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test $pass = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + elif test $linkmode != prog && test $linkmode != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit 1 + fi + continue + fi # $pass = conv + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + + # This library was specified with -dlopen. + if test $pass = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. + dlprefiles="$dlprefiles $lib" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test $pass = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test $linkmode = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" + fi + continue + fi + + if test $linkmode = prog && test $pass != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test $linkalldeplibs = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # Link against this shared library + + if test "$linkmode,$pass" = "prog,link" || + { test $linkmode = lib && test $hardcode_into_libs = yes; }; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + if test $linkmode = prog; then + # We need to hardcode the library path + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + fi + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`echo $soroot | sed -e 's/^.*\///'` + newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + eval cmds=\"$extract_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + eval cmds=\"$old_archive_from_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n $old_archive_from_expsyms_cmds + + if test $linkmode = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test $linkmode = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test $linkmode = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + add="-l$name" + fi + + if test $linkmode = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test $linkmode = prog; then + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + + # Try to link the static library + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + echo "*** Warning: This library needs some functionality provided by $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** Therefore, libtool will create a static module, that should work " + echo "*** as long as the dlopening application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test $linkmode = lib; then + if test -n "$dependency_libs" && + { test $hardcode_into_libs != yes || test $build_old_libs = yes || + test $link_static = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + + if test $link_all_deplibs != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="-L$absdir/$objdir" + else + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="-L$absdir" + fi + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$deplibs $path" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test $pass = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test $pass != dlopen; then + test $pass != scan && dependency_libs="$newdependency_libs" + if test $pass != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + *) + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + if test "$pass" = "conv" && + { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then + libs="$deplibs" # reset libs + deplibs= + fi + done # for pass + if test $linkmode = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit 1 + else + echo + echo "*** Warning: Linking the shared library $output against the non-libtool" + echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test $# -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + libext=al + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + current="$2" + revision="$3" + age="$4" + + # Check that each of the things are valid numbers. + case $current in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $revision in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $age in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + if test $age -gt $current; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix) + major=`expr $current - $age + 1` + verstring="sgi$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test $loop != 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="sgi$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test $loop != 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + verstring="0.0" + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring="" + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs. + $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" + $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` + deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` + dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test $hardcode_into_libs != yes || test $build_old_libs = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd*) + # Do not include libc due to us having libc/libc_r. + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test $build_libtool_need_lc = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behaviour. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | sed 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | sed 10q \ + | egrep "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + if eval echo \"$potent_lib\" 2>/dev/null \ + | sed 10q \ + | egrep "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | + grep . >/dev/null; then + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + echo "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test $allow_undefined = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test $hardcode_into_libs = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + test -z "$dlname" && dlname=$soname + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Ensure that we have .o objects for linkers which dislike .lo + # (e.g. aix) in case we are running --disable-static + for obj in $libobjs; do + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + if test ! -f $xdir/$oldobj; then + $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" + $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? + fi + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + eval cmds=\"$export_symbols_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit 0 + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit 1 + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + $show "echo timestamp > $libobj" + $run eval "echo timestamp > $libobj" || exit $? + exit 0 + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + else + # Just create a symlink. + $show $rm $libobj + $run $rm $libobj + xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$libobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + $show "(cd $xdir && $LN_S $oldobj $baseobj)" + $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + ;; + + prog) + case $host in + *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$output.exp" + $run $rm $export_symbols + $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`echo "$arg" | sed -e 's%^.*/%%'` + $run eval 'echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit 1 + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test $need_relink = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit 0 + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="cd `pwd`; $relink_command" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $0 --fallback-echo"; then + case $0 in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; + *) qecho="$SHELL `pwd`/$0 --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`echo $output|sed 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) exeext=.exe ;; + *) exeext= ;; + esac + $rm $output + trap "$rm $output; exit 1" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit 1 + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # win32 systems need to use the prog path for dll + # lookup to work + *-*-cygwin* | *-*-pw32*) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + # Export the path to the program. + PATH=\"\$progdir:\$PATH\" + export PATH + + exec \$program \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit 1 + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" + chmod +x $output + fi + exit 0 + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + eval cmds=\"$old_archive_from_new_cmds\" + else + # Ensure that we have .o objects in place in case we decided + # not to build a shared library, and have fallen back to building + # static libs even though --disable-static was passed! + for oldobj in $oldobjs; do + if test ! -f $oldobj; then + xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$oldobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` + obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + $show "(cd $xdir && ${LN_S} $obj $baseobj)" + $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? + fi + done + + eval cmds=\"$old_archive_cmds\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test $need_relink = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit 0 + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit 1 + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test $# -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + continue + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test $# -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + eval cmds=\"$postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit 0 + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 + exit 1 + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + /usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`echo $destfile | sed -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + eval cmds=\"$old_postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $0 --finish$current_libdirs' + else + exit 0 + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + eval cmds=\"$finish_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = ":" && exit 0 + + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + echo " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + echo "See any operating system documentation about shared libraries for" + echo "more information, such as the ld(1) and ld.so(8) manual pages." + echo "----------------------------------------------------------------------" + exit 0 + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit 1 + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit 1 + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved enviroment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd='"$cmd"$args' + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit 0 + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + rmdirs= + + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$objdir" + else + objdir="$dir/$objdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test $mode = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test $mode = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + + if test $mode = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + eval cmds=\"$postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + eval cmds=\"$old_postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + fi + fi + ;; + + *.lo) + if test "$build_old_libs" = yes; then + oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` + rmfiles="$rmfiles $dir/$oldobj" + fi + ;; + + *) + # Do a test to see if this is a libtool program. + if test $mode = clean && + (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$file + + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit 1 +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE." + exit 0 + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; +esac + +echo +$echo "Try \`$modename --help' for more information about other modes." + +exit 0 + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/admin/missing b/admin/missing new file mode 100755 index 0000000..0a7fb5a --- /dev/null +++ b/admin/missing @@ -0,0 +1,283 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.3 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar ${1+"$@"} && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar ${1+"$@"} && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/admin/mkinstalldirs b/admin/mkinstalldirs new file mode 100755 index 0000000..aa7c32c --- /dev/null +++ b/admin/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2004/01/13 12:39:53 ppisa Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/admin/modtool.in b/admin/modtool.in new file mode 100755 index 0000000..232a0ed --- /dev/null +++ b/admin/modtool.in @@ -0,0 +1,37 @@ +#!/bin/bash + +LINUX_LD="@LINUX_LD@" +CC="@CC@" +INSTALL="@INSTALL@" +LINUX_MODULE_EXT="@LINUX_MODULE_EXT@" +STRIP="@STRIP@" + +#echo modtool $* + +mode=$1 +shift + +case $mode in +--link) + echo $LINUX_LD -r $* + $LINUX_LD -r $* + ;; +--install) + module_src=$1 + module_dest=`echo $2 | sed "s/\.ko$/${LINUX_MODULE_EXT}/"` + echo $INSTALL -m644 "$module_src" "$module_dest" + $INSTALL -m644 "$module_src" "$module_dest" + $STRIP -g "$module_dest" + ;; +--uninstall) + module_src=$1 + module_dest=`echo $2 | sed "s/\.ko$/${LINUX_MODULE_EXT}/"` + echo uninstall "$module_src" "$module_dest" + rm -f "$module_dest" + ;; +*) + echo Unknown mode $mode >&2 + exit 1 +esac + + diff --git a/authors b/authors new file mode 100644 index 0000000..cfbf6b9 --- /dev/null +++ b/authors @@ -0,0 +1,6 @@ +Petr Smolik + originator +Pavel Pisa + gavl, htree implementations, help with architecture +Michal Sojka + porting to the RTLinux diff --git a/configure b/configure new file mode 100755 index 0000000..66bb479 --- /dev/null +++ b/configure @@ -0,0 +1,6415 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.57 for orte 0.2.0. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='orte' +PACKAGE_TARNAME='orte' +PACKAGE_VERSION='0.2.0' +PACKAGE_STRING='orte 0.2.0' +PACKAGE_BUGREPORT='petr.smolik@wo.cz' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LINUX_DIR LINUX_ARCH LINUX_AFLAGS LINUX_LDFLAGS LINUX_ARFLAGS LINUX_CROSS_COMPILE LINUX_KERNELRELEASE LINUX_CFLAGS LINUX_CC LINUX_LD LINUX_AS LINUX_MODULE_EXT CONFIG_RTHAL_TRUE CONFIG_RTHAL_FALSE RTAI_CFLAGS CONFIG_RTLINUX_TRUE CONFIG_RTLINUX_FALSE RTLINUX_CFLAGS USE_RTAI_TRUE USE_RTAI_FALSE USE_RTLINUX_TRUE USE_RTLINUX_FALSE CONFIG_ORTE_RT_TRUE CONFIG_ORTE_RT_FALSE ORTE_MAJOR_VERSION ORTE_MINOR_VERSION ORTE_MICRO_VERSION ORTE_VERSION INCLUDES CONFIG_ORTE_WIN_TRUE CONFIG_ORTE_WIN_FALSE moduledir modulePROGRAMS_INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE RANLIB ac_ct_RANLIB CPP EGREP LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures orte 0.2.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of orte 0.2.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-linuxdir=DIR specify path to Linux source directory + --with-rtaidir=DIR specify path to RTAI source directory + --with-rtlinuxdir=DIR specify path to RTLinux source directory + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +orte configure 0.2.0 +generated by GNU Autoconf 2.57 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by orte $as_me 0.2.0, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + +ac_aux_dir= +for ac_dir in admin $srcdir/admin; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in admin $srcdir/admin" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in admin $srcdir/admin" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + +#Check for CPU / vendor / OS +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +# Add the stamp file to the list of files AC keeps track of, +# along with our hook. + ac_config_headers="$ac_config_headers orte/include/config.h" + + + +am__api_version="1.6" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# Define the identity of the package. + PACKAGE=orte + VERSION=0.2.0 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + +# Activate maintainer mode +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + + + +# Check whether --with-linuxdir or --without-linuxdir was given. +if test "${with_linuxdir+set}" = set; then + withval="$with_linuxdir" + LINUX_DIR="${withval}" +else + LINUX_DIR=default +fi; + + if test "${LINUX_DIR}" != "default" ; then + echo "$as_me:$LINENO: checking for Linux in ${LINUX_DIR}" >&5 +echo $ECHO_N "checking for Linux in ${LINUX_DIR}... $ECHO_C" >&6 + + if test -f "${LINUX_DIR}/Makefile" ; then + result=yes + + else + result="not found" + { { echo "$as_me:$LINENO: error: Linux dir not found" >&5 +echo "$as_me: error: Linux dir not found" >&2;} + { (exit 1); exit 1; }; } + fi + + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + + fi + + if test "${LINUX_DIR}" = "default" ; then + dir="/lib/modules/`uname -r`/build"; + echo "$as_me:$LINENO: checking for Linux in ${dir}" >&5 +echo $ECHO_N "checking for Linux in ${dir}... $ECHO_C" >&6 + + if test -f "${dir}/Makefile" ; then + result=yes + LINUX_DIR=${dir} + else + result="not found" + + fi + + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + + fi + if test "${LINUX_DIR}" = "default" ; then + dir="../linux"; + echo "$as_me:$LINENO: checking for Linux in ${dir}" >&5 +echo $ECHO_N "checking for Linux in ${dir}... $ECHO_C" >&6 + + if test -f "${dir}/Makefile" ; then + result=yes + LINUX_DIR=${dir} + else + result="not found" + + fi + + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + + fi + if test "${LINUX_DIR}" = "default" ; then + dir="/usr/src/linux"; + echo "$as_me:$LINENO: checking for Linux in ${dir}" >&5 +echo $ECHO_N "checking for Linux in ${dir}... $ECHO_C" >&6 + + if test -f "${dir}/Makefile" ; then + result=yes + LINUX_DIR=${dir} + else + result="not found" + + fi + + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + + fi + +# if test "${LINUX_DIR}" = "default" ; then +# AC_MSG_ERROR([Linux source directory not found]) +# fi + + + + + echo "$as_me:$LINENO: checking Linux version" >&5 +echo $ECHO_N "checking Linux version... $ECHO_C" >&6 + + if test "${LINUX_DIR}" != "default" ; then + + if [ ! -f "${LINUX_DIR}/.config" ];then + { { echo "$as_me:$LINENO: error: + The kernel source tree at ${LINUX_DIR} is not configured. + Fix before continuing." >&5 +echo "$as_me: error: + The kernel source tree at ${LINUX_DIR} is not configured. + Fix before continuing." >&2;} + { (exit 1); exit 1; }; } + fi + + if [ ! -f "${LINUX_DIR}/include/linux/version.h" ];then + { { echo "$as_me:$LINENO: error: The header file include/linux/version.h does not exist. + For 2.6 kernels, it can be generated by running 'make prepare' in + the kernel source directory." >&5 +echo "$as_me: error: The header file include/linux/version.h does not exist. + For 2.6 kernels, it can be generated by running 'make prepare' in + the kernel source directory." >&2;} + { (exit 1); exit 1; }; } + fi + + LINUX_VERSION=$(grep UTS_RELEASE ${LINUX_DIR}/include/linux/version.h | \ + sed 's/[^"]*"\(.*\)\{1\}"/\1/') + + echo "$as_me:$LINENO: result: $LINUX_VERSION" >&5 +echo "${ECHO_T}$LINUX_VERSION" >&6 + + LINUX_VERSION_MAJOR=$(echo ${LINUX_VERSION} | cut -d. -f1) + LINUX_VERSION_MINOR=$(echo ${LINUX_VERSION} | cut -d. -f2) + + case $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR in + 2.6) + + echo "$as_me:$LINENO: checking for Linux CFLAGS" >&5 +echo $ECHO_N "checking for Linux CFLAGS... $ECHO_C" >&6 + + tmpdir="`pwd`/tmp-noicrwa" + + rm -rf ${tmpdir} + mkdir ${tmpdir} + + cat >${tmpdir}/Makefile <>\$(obj)/flags + echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_LDFLAGS=\"\" >>\$(obj)/flags + echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>\$(obj)/flags + echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>\$(obj)/flags + echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>\$(obj)/flags + echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_CC=\"\$(CC)\" >>\$(obj)/flags + echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>\$(obj)/flags + echo LINUX_AS=\"\$(AS)\" >>\$(obj)/flags +EOF + + echo ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5 + ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5 + . ${tmpdir}/flags + rm -rf ${tmpdir} + + LINUX_MODULE_EXT=".ko" + + + + + + + + + + + + + + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 + + ;; + 2.[01234]) + + echo "$as_me:$LINENO: checking for Linux CFLAGS" >&5 +echo $ECHO_N "checking for Linux CFLAGS... $ECHO_C" >&6 + + if [ ! -f "${LINUX_DIR}/.hdepend" ];then + { { echo "$as_me:$LINENO: error: +You need to run 'make dep' on the kernel source before continuing." >&5 +echo "$as_me: error: +You need to run 'make dep' on the kernel source before continuing." >&2;} + { (exit 1); exit 1; }; } + fi + + tmpdir="`pwd`/tmp-noicrwa" + + rm -rf ${tmpdir} + mkdir ${tmpdir} + + cat >${tmpdir}/Makefile <>flags + echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags + echo LINUX_LDFLAGS=\"\" >>flags + echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>flags + echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>flags + echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>flags + echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags + echo LINUX_CC=\"\$(CC)\" >>flags + echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>flags + echo LINUX_AS=\"\$(AS)\" >>flags +EOF + + echo ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5 + ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5 + . ${tmpdir}/flags + rm -rf ${tmpdir} + + LINUX_MODULE_EXT=".o" + + + + + + + + + + + + + + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 + + ;; + *) + { { echo "$as_me:$LINENO: error: Unknown Linux major.minor $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR" >&5 +echo "$as_me: error: Unknown Linux major.minor $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + else + echo "$as_me:$LINENO: result: \"none\"" >&5 +echo "${ECHO_T}\"none\"" >&6 + fi + + + + +# Check whether --with-rtaidir or --without-rtaidir was given. +if test "${with_rtaidir+set}" = set; then + withval="$with_rtaidir" + RTAI_DIR="${withval}" +else + RTAI_DIR=/usr/src/rtai +fi; + + + + echo "$as_me:$LINENO: checking Linux config option CONFIG_RTHAL" >&5 +echo $ECHO_N "checking Linux config option CONFIG_RTHAL... $ECHO_C" >&6 + + if grep '^CONFIG_RTHAL=y$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=yes + CONFIG_RTHAL=yes + else if grep '^CONFIG_RTHAL=m$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=module + CONFIG_RTHAL=module + else + result=no + CONFIG_RTHAL=no + fi + fi + + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + + + + +if test "${CONFIG_RTHAL}" = yes -o "${CONFIG_RTHAL}" = module; then + CONFIG_RTHAL_TRUE= + CONFIG_RTHAL_FALSE='#' +else + CONFIG_RTHAL_TRUE='#' + CONFIG_RTHAL_FALSE= +fi + + + + if test "${CONFIG_RTHAL}" != "no" ; then + echo "$as_me:$LINENO: checking RTAI directory ${RTAI_DIR}" >&5 +echo $ECHO_N "checking RTAI directory ${RTAI_DIR}... $ECHO_C" >&6 + if [ -d ${RTAI_DIR}/include ] ; then + RTAI_CFLAGS="-I${RTAI_DIR}/include" + else + if -d ${RTAI_DIR}/rtai-core/include ; then + RTAI_CFLAGS="-I${RTAI_DIR}/rtai-core/include" + else + { { echo "$as_me:$LINENO: error: incorrect RTAI directory?" >&5 +echo "$as_me: error: incorrect RTAI directory?" >&2;} + { (exit 1); exit 1; }; } + fi + fi + USE_RTAI=yes + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CONFIG_ORTE_RTAI 1 +_ACEOF + + else + USE_RTAI=no + fi + + + + + +# Check whether --with-rtlinuxdir or --without-rtlinuxdir was given. +if test "${with_rtlinuxdir+set}" = set; then + withval="$with_rtlinuxdir" + RTLINUX_DIR="${withval}" +else + RTLINUX_DIR=/usr/src/rtlinux +fi; + + + + echo "$as_me:$LINENO: checking Linux config option CONFIG_RTLINUX" >&5 +echo $ECHO_N "checking Linux config option CONFIG_RTLINUX... $ECHO_C" >&6 + + if grep '^CONFIG_RTLINUX=y$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=yes + CONFIG_RTLINUX=yes + else if grep '^CONFIG_RTLINUX=m$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then + result=module + CONFIG_RTLINUX=module + else + result=no + CONFIG_RTLINUX=no + fi + fi + + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + + + + +if test "${CONFIG_RTLINUX}" = yes -o "${CONFIG_RTLINUX}" = module; then + CONFIG_RTLINUX_TRUE= + CONFIG_RTLINUX_FALSE='#' +else + CONFIG_RTLINUX_TRUE='#' + CONFIG_RTLINUX_FALSE= +fi + + + + if test "${CONFIG_RTLINUX}" != "no" ; then + echo "$as_me:$LINENO: checking RTLinux directory ${RTLINUX_DIR} for rtl.mk" >&5 +echo $ECHO_N "checking RTLinux directory ${RTLINUX_DIR} for rtl.mk... $ECHO_C" >&6 + if [ -d ${RTLINUX_DIR}/include ] ; then + RTLINUX_CFLAGS=`sed -n -e 's/^CFLAGS *=\(.*\)$/\1/p' ${RTLINUX_DIR}/rtl.mk` + else + { { echo "$as_me:$LINENO: error: incorrect RTLinux directory?" >&5 +echo "$as_me: error: incorrect RTLinux directory?" >&2;} + { (exit 1); exit 1; }; } + fi + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 + +cat >>confdefs.h <<\_ACEOF +#define CONFIG_ORTE_RTL 1 +_ACEOF + + USE_RTLINUX=yes + else + USE_RTLINUX=no + fi + + + if test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define CONFIG_ORTE_RT 1 +_ACEOF + + fi + + +if test ${USE_RTAI} == "yes"; then + USE_RTAI_TRUE= + USE_RTAI_FALSE='#' +else + USE_RTAI_TRUE='#' + USE_RTAI_FALSE= +fi + + + +if test ${USE_RTLINUX} == "yes"; then + USE_RTLINUX_TRUE= + USE_RTLINUX_FALSE='#' +else + USE_RTLINUX_TRUE='#' + USE_RTLINUX_FALSE= +fi + + + +if test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes"; then + CONFIG_ORTE_RT_TRUE= + CONFIG_ORTE_RT_FALSE='#' +else + CONFIG_ORTE_RT_TRUE='#' + CONFIG_ORTE_RT_FALSE= +fi + + + + +############################### +# Package info +ORTE_MAJOR_VERSION=0 +ORTE_MINOR_VERSION=2 +ORTE_MICRO_VERSION=0 +ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION + + + + + +############################### +# includes +case "$target" in + *-cygwin* | *-mingw*) + INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/win32' + WIN_LIB='yes' + ;; + *) + # Assume Unix. + if test ${USE_RTLINUX} == "yes" ; then + INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/rtl -I$(top_srcdir)/RTL_UDP/include' + else + INCLUDES='-I$(top_srcdir)/orte/include' + fi + ;; +esac + + + +if test x$WIN_LIB = xyes; then + CONFIG_ORTE_WIN_TRUE= + CONFIG_ORTE_WIN_FALSE='#' +else + CONFIG_ORTE_WIN_TRUE='#' + CONFIG_ORTE_WIN_FALSE= +fi + + +############################### +# modules +moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/comedi" +modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install" +modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall" + + + +############################### +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +############################### +# Checks for libraries (no for RT) +if test ${USE_RTLINUX} != "yes" ; then + + +echo "$as_me:$LINENO: checking for main in -lws2_32" >&5 +echo $ECHO_N "checking for main in -lws2_32... $ECHO_C" >&6 +if test "${ac_cv_lib_ws2_32_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lws2_32 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ws2_32_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ws2_32_main=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ws2_32_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ws2_32_main" >&6 +if test $ac_cv_lib_ws2_32_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBWS2_32 1 +_ACEOF + + LIBS="-lws2_32 $LIBS" + +fi + + +echo "$as_me:$LINENO: checking for main in -lpthread" >&5 +echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_main=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6 +if test $ac_cv_lib_pthread_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +fi + +fi + +############################### +# Checks for header files. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \ +string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \ +stdarg.h getopt.h sys/types.h net/if.h byteswap.h signal.h errno.h \ +ctype.h sys/stat.h winsock2.h ws2tcpip.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +############################### +# Checks for typedefs, structures, and compiler characteristics. +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 +case $ac_cv_c_inline in + inline | yes) ;; + no) +cat >>confdefs.h <<\_ACEOF +#define inline +_ACEOF + ;; + *) cat >>confdefs.h <<_ACEOF +#define inline $ac_cv_c_inline +_ACEOF + ;; +esac + +echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_pid_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + +############################### +# Checks for library functions. +if test $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if STDC_HEADERS || HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +exit (malloc (0) ? 0 : 1); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + LIBOBJS="$LIBOBJS malloc.$ac_objext" + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + + +for ac_func in strdup +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +############################### +# Add obsolute directory for header files +CFLAGS="$CFLAGS -Wall" + + ac_config_files="$ac_config_files Makefile orte/Makefile RTL_UDP/Makefile RTL_UDP/udp/Makefile orte/liborte/Makefile orte/liborte/rtl/Makefile orte/examples/Makefile orte/examples/hello/Makefile orte/examples/reliable/Makefile orte/examples/ORTEPing/Makefile orte/examples/ORTESpy/Makefile orte/manager/Makefile" + + + ac_config_files="$ac_config_files modtool" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${CONFIG_RTHAL_TRUE}" && test -z "${CONFIG_RTHAL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"CONFIG_RTHAL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"CONFIG_RTHAL\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${CONFIG_RTLINUX_TRUE}" && test -z "${CONFIG_RTLINUX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"CONFIG_RTLINUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"CONFIG_RTLINUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${USE_RTAI_TRUE}" && test -z "${USE_RTAI_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_RTAI\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_RTAI\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${USE_RTLINUX_TRUE}" && test -z "${USE_RTLINUX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_RTLINUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_RTLINUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${CONFIG_ORTE_RT_TRUE}" && test -z "${CONFIG_ORTE_RT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"CONFIG_ORTE_RT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"CONFIG_ORTE_RT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${CONFIG_ORTE_WIN_TRUE}" && test -z "${CONFIG_ORTE_WIN_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"CONFIG_ORTE_WIN\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"CONFIG_ORTE_WIN\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by orte $as_me 0.2.0, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +orte config.status 0.2.0 +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "orte/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/Makefile" ;; + "RTL_UDP/Makefile" ) CONFIG_FILES="$CONFIG_FILES RTL_UDP/Makefile" ;; + "RTL_UDP/udp/Makefile" ) CONFIG_FILES="$CONFIG_FILES RTL_UDP/udp/Makefile" ;; + "orte/liborte/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/liborte/Makefile" ;; + "orte/liborte/rtl/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/liborte/rtl/Makefile" ;; + "orte/examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/examples/Makefile" ;; + "orte/examples/hello/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/examples/hello/Makefile" ;; + "orte/examples/reliable/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/examples/reliable/Makefile" ;; + "orte/examples/ORTEPing/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/examples/ORTEPing/Makefile" ;; + "orte/examples/ORTESpy/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/examples/ORTESpy/Makefile" ;; + "orte/manager/Makefile" ) CONFIG_FILES="$CONFIG_FILES orte/manager/Makefile" ;; + "modtool" ) CONFIG_FILES="$CONFIG_FILES modtool" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "orte/include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS orte/include/config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@LINUX_DIR@,$LINUX_DIR,;t t +s,@LINUX_ARCH@,$LINUX_ARCH,;t t +s,@LINUX_AFLAGS@,$LINUX_AFLAGS,;t t +s,@LINUX_LDFLAGS@,$LINUX_LDFLAGS,;t t +s,@LINUX_ARFLAGS@,$LINUX_ARFLAGS,;t t +s,@LINUX_CROSS_COMPILE@,$LINUX_CROSS_COMPILE,;t t +s,@LINUX_KERNELRELEASE@,$LINUX_KERNELRELEASE,;t t +s,@LINUX_CFLAGS@,$LINUX_CFLAGS,;t t +s,@LINUX_CC@,$LINUX_CC,;t t +s,@LINUX_LD@,$LINUX_LD,;t t +s,@LINUX_AS@,$LINUX_AS,;t t +s,@LINUX_MODULE_EXT@,$LINUX_MODULE_EXT,;t t +s,@CONFIG_RTHAL_TRUE@,$CONFIG_RTHAL_TRUE,;t t +s,@CONFIG_RTHAL_FALSE@,$CONFIG_RTHAL_FALSE,;t t +s,@RTAI_CFLAGS@,$RTAI_CFLAGS,;t t +s,@CONFIG_RTLINUX_TRUE@,$CONFIG_RTLINUX_TRUE,;t t +s,@CONFIG_RTLINUX_FALSE@,$CONFIG_RTLINUX_FALSE,;t t +s,@RTLINUX_CFLAGS@,$RTLINUX_CFLAGS,;t t +s,@USE_RTAI_TRUE@,$USE_RTAI_TRUE,;t t +s,@USE_RTAI_FALSE@,$USE_RTAI_FALSE,;t t +s,@USE_RTLINUX_TRUE@,$USE_RTLINUX_TRUE,;t t +s,@USE_RTLINUX_FALSE@,$USE_RTLINUX_FALSE,;t t +s,@CONFIG_ORTE_RT_TRUE@,$CONFIG_ORTE_RT_TRUE,;t t +s,@CONFIG_ORTE_RT_FALSE@,$CONFIG_ORTE_RT_FALSE,;t t +s,@ORTE_MAJOR_VERSION@,$ORTE_MAJOR_VERSION,;t t +s,@ORTE_MINOR_VERSION@,$ORTE_MINOR_VERSION,;t t +s,@ORTE_MICRO_VERSION@,$ORTE_MICRO_VERSION,;t t +s,@ORTE_VERSION@,$ORTE_VERSION,;t t +s,@INCLUDES@,$INCLUDES,;t t +s,@CONFIG_ORTE_WIN_TRUE@,$CONFIG_ORTE_WIN_TRUE,;t t +s,@CONFIG_ORTE_WIN_FALSE@,$CONFIG_ORTE_WIN_FALSE,;t t +s,@moduledir@,$moduledir,;t t +s,@modulePROGRAMS_INSTALL@,$modulePROGRAMS_INSTALL,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi + # Run the commands associated with the file. + case $ac_file in + orte/include/config.h ) # update the timestamp +echo 'timestamp for orte/include/config.h' >"orte/include/stamp-h1" + ;; + esac +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + +chmod +x modtool + +echo \ +"------------------------------------------------------------------------ +Configuration ORTE: + + Source code location: ${srcdir} + Compiler: ${CC} + Compiler flags: ${CFLAGS} + Host System Type: ${host} + + See config.h for further configuration information. +------------------------------------------------------------------------" + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..3511eee --- /dev/null +++ b/configure.in @@ -0,0 +1,128 @@ +# Process this file with autoconf to produce a configure script. +# +# $Id: configure.in,v 1.1 2004/01/13 12:39:53 ppisa Exp $ + +# autoconf requirement +AC_PREREQ([2.57]) + +AC_INIT([orte],[0.2.0],[petr.smolik@wo.cz]) +AC_CONFIG_AUX_DIR(admin) + +#Check for CPU / vendor / OS +AC_CANONICAL_HOST +AC_CANONICAL_TARGET +AM_CONFIG_HEADER(orte/include/config.h) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) +# Activate maintainer mode +AM_MAINTAINER_MODE + +DS_LINUX() + +############################### +# Package info +ORTE_MAJOR_VERSION=0 +ORTE_MINOR_VERSION=2 +ORTE_MICRO_VERSION=0 +ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION +AC_SUBST(ORTE_MAJOR_VERSION) +AC_SUBST(ORTE_MINOR_VERSION) +AC_SUBST(ORTE_MICRO_VERSION) +AC_SUBST(ORTE_VERSION) + +############################### +# includes +case "$target" in + *-cygwin* | *-mingw*) + INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/win32' + WIN_LIB='yes' + ;; + *) + # Assume Unix. + if test ${USE_RTLINUX} == "yes" ; then + INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/rtl -I$(top_srcdir)/RTL_UDP/include' + else + INCLUDES='-I$(top_srcdir)/orte/include' + fi + ;; +esac +AC_SUBST(INCLUDES) +AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN_LIB = xyes) + +############################### +# modules +moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/comedi" +modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install" +modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall" +AC_SUBST(moduledir) +AC_SUBST(modulePROGRAMS_INSTALL) + +############################### +# Checks for programs. +AC_PROG_CC +AC_PROG_RANLIB + +############################### +# Checks for libraries (no for RT) +if test ${USE_RTLINUX} != "yes" ; then +AC_CHECK_LIB([ws2_32], [main]) +AC_CHECK_LIB([pthread], [main]) +fi + +############################### +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS( +[arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \ +string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \ +stdarg.h getopt.h sys/types.h net/if.h byteswap.h signal.h errno.h \ +ctype.h sys/stat.h winsock2.h ws2tcpip.h]) + +############################### +# Checks for typedefs, structures, and compiler characteristics. +AC_C_BIGENDIAN +AC_C_CONST +AC_C_INLINE +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_HEADER_TIME + +############################### +# Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_CHECK_FUNCS([strdup]) + +############################### +# Add obsolute directory for header files +CFLAGS="$CFLAGS -Wall" + +AC_CONFIG_FILES([Makefile + orte/Makefile + RTL_UDP/Makefile + RTL_UDP/udp/Makefile + orte/liborte/Makefile + orte/liborte/rtl/Makefile + orte/examples/Makefile + orte/examples/hello/Makefile + orte/examples/reliable/Makefile + orte/examples/ORTEPing/Makefile + orte/examples/ORTESpy/Makefile + orte/manager/Makefile]) + +AC_OUTPUT([ +modtool +]) +chmod +x modtool + +echo \ +"------------------------------------------------------------------------ +Configuration ORTE: + + Source code location: ${srcdir} + Compiler: ${CC} + Compiler flags: ${CFLAGS} + Host System Type: ${host} + + See config.h for further configuration information. +------------------------------------------------------------------------" + \ No newline at end of file diff --git a/copying b/copying new file mode 100644 index 0000000..c7aea18 --- /dev/null +++ b/copying @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/install b/install new file mode 100644 index 0000000..02a4a07 --- /dev/null +++ b/install @@ -0,0 +1,167 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/kernelcfg2mk b/kernelcfg2mk new file mode 100755 index 0000000..f0c01a0 --- /dev/null +++ b/kernelcfg2mk @@ -0,0 +1,161 @@ +#!/bin/bash + +if [ $# -lt 1 ] ; then + echo "kernelcfg2mk: requires linux kernel directory as the first argument" + exit 2 +fi + +LINUX_DIR="$1" + +if [ $# -gt 1 ] ; then + KERN_MODULES_DIR="$2" +fi + +if [ ! -e $LINUX_DIR/.config ] ; then + echo "kernelcfg2mk: the provided locations doesnot point to configured kernel sources" + echo " check directory $LINUX_DIR" + exit 2 +fi + +if [ ! -e $LINUX_DIR/.config ] ; then + echo "kernelcfg2mk: the provided locations doesnot point to configured kernel sources" + echo " check directory $LINUX_DIR" + exit 2 +fi + +if [ -z "$KERN_BUILD_DIR" ] ; then + KERN_BUILD_DIR=`pwd` +fi + +if [ -z "$KERN_MODULES_DIR" ] ; then + KERN_MODULES_DIR=`pwd` +fi + + +if [ -z "$MAKE" ] ; then + MAKE="make" +fi + + +KERN_TEST_DIR="$KERN_BUILD_DIR/kern-test-mk" + +mkdir -p $KERN_TEST_DIR + +#echo MAKERULES_DIR $MAKERULES_DIR +#echo LINUX_DIR $LINUX_DIR +#echo KERN_BUILD_DIR $KERN_BUILD_DIR +#echo KERN_MODULES_DIR $KERN_MODULES_DIR + +RETVAL="0" + +LINUX_VERSION=$(grep UTS_RELEASE ${LINUX_DIR}/include/linux/version.h | \ + sed 's/[^"]*"\(.*\)\{1\}"/\1/') + +LINUX_VERSION_MAJOR=$(echo ${LINUX_VERSION} | cut -d. -f1) +LINUX_VERSION_MINOR=$(echo ${LINUX_VERSION} | cut -d. -f2) + +#echo $LINUX_VERSION +#echo $LINUX_VERSION_MAJOR +#echo $LINUX_VERSION_MINOR + + +case $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR in + + +#===================================================================== +# test for 2.4.x kernels + 2.[01234]) + + rm -f ${KERN_BUILD_DIR}/kernel.mk + rm -rf ${KERN_TEST_DIR} + mkdir ${KERN_TEST_DIR} + cd ${KERN_TEST_DIR} + + cat >${KERN_TEST_DIR}/Makefile <>flags + echo LINUX_AFLAGS="\$(AFLAGS)" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>flags + echo LINUX_LDFLAGS="" >>flags + echo LINUX_ARFLAGS="\$(ARFLAGS)" >>flags + echo LINUX_CROSS_COMPILE="\$(CROSS_COMPILE)" >>flags + echo LINUX_KERNELRELEASE="\$(KERNELRELEASE)" >>flags + echo LINUX_CFLAGS="\$(CFLAGS)" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>flags + echo LINUX_CC="\$(CC)" >>flags + echo LINUX_LD="\$(LD) \$(LDFLAGS)" >>flags + echo LINUX_AS="\$(AS)" >>flags + echo LINUX_MODULE_EXT=".o" >>flags + +EOF + + echo ${MAKE} -C ${LINUX_DIR} SUBDIRS=${KERN_TEST_DIR} modules + ${MAKE} -C ${LINUX_DIR} SUBDIRS=${KERN_TEST_DIR} modules + if [ $? == 0 ] ; then + cp -v flags ${KERN_MODULES_DIR}/kernel.mk + if [ ! $? == 0 ] ; then + RETVAL="2" + fi + else + RETVAL="1" + fi + + cd ${KERN_BUILD_DIR} + rm -rf ${KERN_TEST_DIR} + ;; + +#===================================================================== +# test for 2.6.x kernels + + 2.6) + + rm -f ${KERN_BUILD_DIR}/kernel.mk + rm -rf ${KERN_TEST_DIR} + mkdir ${KERN_TEST_DIR} + cd ${KERN_TEST_DIR} + + cat >${KERN_TEST_DIR}/Makefile <>\$(obj)/flags + echo LINUX_AFLAGS="\$(AFLAGS)" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_LDFLAGS="" >>\$(obj)/flags + echo LINUX_ARFLAGS="\$(ARFLAGS)" >>\$(obj)/flags + echo LINUX_CROSS_COMPILE="\$(CROSS_COMPILE)" >>\$(obj)/flags + echo LINUX_KERNELRELEASE="\$(KERNELRELEASE)" >>\$(obj)/flags + echo LINUX_CFLAGS="\$(CFLAGS)" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags + echo LINUX_CC="\$(CC)" >>\$(obj)/flags + echo LINUX_LD="\$(LD) \$(LDFLAGS)" >>\$(obj)/flags + echo LINUX_AS="\$(AS)" >>\$(obj)/flags + echo LINUX_MODULE_EXT=".ko" >>\$(obj)/flags +EOF + + echo ${MAKE} -C ${LINUX_DIR} V=1 SUBDIRS=${KERN_TEST_DIR} LINUXDIR=${LINUX_DIR} MODVERDIR=${KERN_TEST_DIR} modules + ${MAKE} -C ${LINUX_DIR} V=1 SUBDIRS=${KERN_TEST_DIR} LINUXDIR=${LINUX_DIR} MODVERDIR=${KERN_TEST_DIR} modules + #if [ $? == 0 ] ; then + cp -v flags ${KERN_MODULES_DIR}/kernel.mk + if [ ! $? == 0 ] ; then + RETVAL="2" + fi + #else + # RETVAL="1" + #fi + + cd ${KERN_BUILD_DIR} + rm -rf ${KERN_TEST_DIR} + ;; + +#===================================================================== + + *) + echo "Unsupported Linux version $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR" + ;; +esac + + +exit ${RETVAL} diff --git a/modtool.in b/modtool.in new file mode 100755 index 0000000..232a0ed --- /dev/null +++ b/modtool.in @@ -0,0 +1,37 @@ +#!/bin/bash + +LINUX_LD="@LINUX_LD@" +CC="@CC@" +INSTALL="@INSTALL@" +LINUX_MODULE_EXT="@LINUX_MODULE_EXT@" +STRIP="@STRIP@" + +#echo modtool $* + +mode=$1 +shift + +case $mode in +--link) + echo $LINUX_LD -r $* + $LINUX_LD -r $* + ;; +--install) + module_src=$1 + module_dest=`echo $2 | sed "s/\.ko$/${LINUX_MODULE_EXT}/"` + echo $INSTALL -m644 "$module_src" "$module_dest" + $INSTALL -m644 "$module_src" "$module_dest" + $STRIP -g "$module_dest" + ;; +--uninstall) + module_src=$1 + module_dest=`echo $2 | sed "s/\.ko$/${LINUX_MODULE_EXT}/"` + echo uninstall "$module_src" "$module_dest" + rm -f "$module_dest" + ;; +*) + echo Unknown mode $mode >&2 + exit 1 +esac + + diff --git a/orte.kdevelop b/orte.kdevelop new file mode 100644 index 0000000..7b9837b --- /dev/null +++ b/orte.kdevelop @@ -0,0 +1,139 @@ + + + + Petr Smolik + petr.smolik@wo.cz + $VERSION$ + KDevAutoProject + C + + KDevFileView + + . + false + + + + + + src/orte + debug + + + orte/examples/ORTEPing/ORTEPing + build + / + -p -s -m 10000 -v ALL,10 + false + true + + + + + optimized + GccOptions + GppOptions + G77Options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevpgf77options + -O0 -g3 -Wall + + + + + + + + + + + + + + + + false + 1 + false + + + + + + + -v ALL:10 -peer 192.168.0.1 + + + + + true + false + false + + + false + true + + + + + + + + + + + + html/ + html/ + + + + + + + + + + .h + .cpp + + + + + true + true + true + false + true + true + true + 250 + 400 + 250 + + + + + + false + + + + -f + + + + -dP + -f + -C -d -P + -u3 -p + + + diff --git a/orte/Makefile b/orte/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/orte/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/Makefile.am b/orte/Makefile.am new file mode 100644 index 0000000..811c15f --- /dev/null +++ b/orte/Makefile.am @@ -0,0 +1,13 @@ +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +# Uncomment and customize the following to ORTE your needs: +# + +if CONFIG_ORTE_RT +SUBDIRS = liborte examples +else +SUBDIRS = liborte manager examples +endif diff --git a/orte/Makefile.in b/orte/Makefile.in new file mode 100644 index 0000000..16a98c9 --- /dev/null +++ b/orte/Makefile.in @@ -0,0 +1,354 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +# Uncomment and customize the following to ORTE your needs: +# +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ + +@CONFIG_ORTE_RT_TRUE@SUBDIRS = liborte examples +@CONFIG_ORTE_RT_FALSE@SUBDIRS = liborte manager examples +subdir = orte +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = liborte manager examples +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu orte/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive distclean distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/orte/Makefile.omk b/orte/Makefile.omk new file mode 100644 index 0000000..81c5a6c --- /dev/null +++ b/orte/Makefile.omk @@ -0,0 +1 @@ +SUBDIRS = liborte manager examples diff --git a/orte/contrib/decoder/Makefile b/orte/contrib/decoder/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/orte/contrib/decoder/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/contrib/decoder/Makefile.msc b/orte/contrib/decoder/Makefile.msc new file mode 100644 index 0000000..2b9de3d --- /dev/null +++ b/orte/contrib/decoder/Makefile.msc @@ -0,0 +1,45 @@ +# --------------------------------------------------------------------- +# Microsoft C/C++ Installation Directory +# +# CHANGE this definition to point to your compiler's installation directory +# --------------------------------------------------------------------- +MSCDIR= c:\Progra~1\micros~3\vc98 + +CFLAGS = -c -Zi -MD $(INCLUDE) +LIB_CFLAGS= $(CFLAGS) -LD +INCLUDE= -I$(MSCDIR)\include -I..\include -I..\include\win32 +LIBS= $(MSCDIR)\lib\msvcrt.lib $(MSCDIR)\lib\uuid.lib $(MSCDIR)\lib\oldnames.lib \ + $(MSCDIR)\lib\kernel32.lib $(MSCDIR)\lib\libcd.lib $(MSCDIR)\lib\wsock32.lib \ + $(MSCDIR)\lib\advapi32.lib $(MSCDIR)\lib\ws2_32.lib\ + ..\liborte\win32\liborte.lib +CC= $(MSCDIR)\bin\cl +LINK= $(MSCDIR)\bin\link +LIBRARIAN= $(MSCDIR)\bin\lib + +TARGETS=decode_msg.exe + +all : default + +default : $(TARGETS) + +decode_msg.exe: decode_msg.obj + +# --------------------------------------------------------------------- +# Generic Compilation Rules +# +# Do NOT change anything below this point. +# --------------------------------------------------------------------- +#.SUFFIXES: .c .obj .exe + +.c.obj: + $(CC) $(CFLAGS) $< -Fo$*.obj + +.obj.exe: + $(LINK) -out:$@ $(ORTELIB) $< $(LIBS) + +clean : + del *.obj + del *.exe + del *.pdb + + diff --git a/orte/contrib/decoder/Makefile.omk b/orte/contrib/decoder/Makefile.omk new file mode 100644 index 0000000..f487cde --- /dev/null +++ b/orte/contrib/decoder/Makefile.omk @@ -0,0 +1,5 @@ +INCLUDES = -I$(SOURCES_DIR)/../../include/ + +utils_PROGRAMS = decode_msg + +decode_msg_SOURCES = decode_msg.c \ No newline at end of file diff --git a/orte/contrib/decoder/decode_msg.c b/orte/contrib/decoder/decode_msg.c new file mode 100644 index 0000000..150888e --- /dev/null +++ b/orte/contrib/decoder/decode_msg.c @@ -0,0 +1,523 @@ +#include +#include +#include +#include +#include +#include +#include + +// global variables + FILE *ptr_in, *ptr_out; + + +/**********************************************************************************/ +void conv_u32(u_int32_t *x,u_int8_t ef) { + #if __BYTE_ORDER == __LITTLE_ENDIAN + if(ef) bswap_32(*x); + #elif __BYTE_ORDER == __BIG_ENDIAN + if(!ef)bswap_32(*x); + #endif +} + +/**********************************************************************************/ +void print_obj(void *obj) { + fprintf(ptr_out," ("); + switch (bswap_32(*((u_int32_t*)obj))) { + case OID_APP: + fprintf(ptr_out,"ManagedApplicaton or Manager"); + break; + case OID_WRITE_APPSELF: + fprintf(ptr_out,"Write appself"); + break; + case OID_WRITE_APP: + fprintf(ptr_out,"Write app"); + break; + case OID_READ_APP: + fprintf(ptr_out,"Read app"); + break; + case OID_WRITE_MGR: + fprintf(ptr_out,"Write mgr"); + break; + case OID_READ_MGR: + fprintf(ptr_out,"Read mgr"); + break; + case OID_WRITE_PUBL: + fprintf(ptr_out,"Write publ"); + break; + case OID_READ_PUBL: + fprintf(ptr_out,"Read publ"); + break; + case OID_WRITE_SUBS: + fprintf(ptr_out,"Write subs"); + break; + case OID_READ_SUBS: + fprintf(ptr_out,"Read subs"); + break; + default: + fprintf(ptr_out,"unknown"); + break; + } + fprintf(ptr_out,")\n"); +} + +/**********************************************************************************/ +void print_app(u_int8_t app) { + switch (app) { + case MANAGEDAPPLICATION: + fprintf(ptr_out,"(managed application)\n"); + break; + case MANAGER: + fprintf(ptr_out,"(manager)\n"); + break; + default: + fprintf(ptr_out,"(unknown class)\n"); + break; + } +} + +/**********************************************************************************/ +void decode_parametr_sequence(u_int8_t *msg) { + NtpTime ts; + ProtocolVersion pv; + VendorId vid; + SequenceNumber sn; + u_int8_t i,j,l; + u_int8_t *k; + + while(*((ParameterId*)msg)!=PID_SENTINEL) { + printf("id%d,len%d\n",*((ParameterId*)msg),*((ParameterLength*)(msg+2))); + if ((*((ParameterLength*)(msg+2)))==0) break; + switch(*(ParameterId*)msg) { + case PID_PAD: + fprintf(ptr_out," PID_PAD :\n"); + break; + case PID_EXPIRATION_TIME: + ts=*((NtpTime*)(msg+4)); + fprintf(ptr_out," PID_EXPIRATION_TIME : %u,%u\n", + ts.seconds,ts.fraction); + break; + case PID_PERSISTENCE: + ts=*((NtpTime*)(msg+4)); + fprintf(ptr_out," PID_PERSISTENCE : %u,%u\n", + ts.seconds,ts.fraction); + break; + case PID_MINIMUM_SEPARATION: + ts=*((NtpTime*)(msg+4)); + fprintf(ptr_out," PID_MINIMUM_SEPARATION : %u,%u\n", + ts.seconds,ts.fraction); + break; + case PID_TOPIC: + fprintf(ptr_out," PID_TOPIC :\n"); + k=msg+4; + //len of message is also in message (first ulong) + l=(*(u_int32_t*)(msg+4))+4; + while(l!=0) { + if (l>8) j=8; + else j=l; + l-=j; + fprintf(ptr_out," : "); + for(i=0;i8) j=8; + else j=l; + l-=j; + fprintf(ptr_out," : "); + for(i=0;isourceVersion=*((ProtocolVersion*)(msg+4)); /* ProtocolVersion */ + mi->sourceVendorId=*((VendorId*)(msg+6)); /* Vendor Id */ + mi->sourceHostId=*((HostId*)(msg+8)); /* Host Id */ + mi->sourceAppId=*((AppId*)(msg+12)); /* App Id */ + mi->haveTimestamp=0; /* false */ + return 0; +} + +/**********************************************************************************/ +int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) { + IPAddress ipa; + Port port; + ObjectId roid,woid,oid; + SequenceNumber fsn,lsn,wsn; + u_int8_t i,j,l; + u_int8_t *k; + HostId hid; + AppId aid; + int ptr_off; + + switch ((SubmessageId)msg[ptr]) { + case PAD: + fprintf(ptr_out," PAD\n"); + break; + case VAR: + fprintf(ptr_out," VAR\n"); + fprintf(ptr_out," h-bit : %d\n",(msg[ptr+1] & 8) ? 1:0); + fprintf(ptr_out," alive-bit : %d\n",(msg[ptr+1] & 4) ? 1:0); + fprintf(ptr_out," p-bit : %d\n",(msg[ptr+1] & 2) ? 1:0); + roid=*((ObjectId*)(msg+ptr+4)); + fprintf(ptr_out," ObjectId : %d.%d.%d.%02x", + *(u_int8_t*)&roid,*(((u_int8_t*)&roid)+1),*(((u_int8_t*)&roid)+2),*(((u_int8_t*)&roid)+3)); + print_obj(&roid); + woid=*((ObjectId*)(msg+ptr+8)); + fprintf(ptr_out," ObjectId : %d.%d.%d.%02x", + *(u_int8_t*)&woid,*(((u_int8_t*)&woid)+1),*(((u_int8_t*)&woid)+2),*(((u_int8_t*)&woid)+3)); + print_obj(&woid); + if (msg[ptr+1] & 8) { + hid=*((HostId*)(msg+ptr+12)); /* hostId */ + aid=*((AppId*)(msg+ptr+16)); /* appId */ + fprintf(ptr_out," HostId : %d.%d.%d.%d\n", + *(u_int8_t*)&hid,*(((u_int8_t*)&hid)+1),*(((u_int8_t*)&hid)+2),*(((u_int8_t*)&hid)+3)); + fprintf(ptr_out," AppId : %d.%d.%d.%d ", + *(u_int8_t*)&aid,*(((u_int8_t*)&aid)+1),*(((u_int8_t*)&aid)+2),*(((u_int8_t*)&aid)+3)); + print_app(*(((u_int8_t*)&aid)+3)); + ptr_off=8; + } else ptr_off=0; + oid=*((ObjectId*)(msg+ptr+12+ptr_off)); + fprintf(ptr_out," ObjectId : %d.%d.%d.%02x", + *(u_int8_t*)&oid,*(((u_int8_t*)&oid)+1),*(((u_int8_t*)&oid)+2),*(((u_int8_t*)&oid)+3)); + print_obj(&oid); + wsn=*((SequenceNumber*)(msg+ptr+16+ptr_off)); + fprintf(ptr_out," sequenceNumber : %u\n",wsn.low); + if (msg[ptr+1] & 2) { + decode_parametr_sequence(msg+ptr+24+ptr_off); + } + break; + case ISSUE: + fprintf(ptr_out," ISSUE\n"); + roid=*((ObjectId*)(msg+ptr+4));woid=*((ObjectId*)(msg+ptr+8)); + fsn=*((SequenceNumber*)(msg+ptr+12)); + fprintf(ptr_out," p-bit : %d\n",(msg[ptr+1] & 2) ? 1:0); + fprintf(ptr_out," readerObjectId : %d.%d.%d.%02x", + *(u_int8_t*)&roid,*(((u_int8_t*)&roid)+1),*(((u_int8_t*)&roid)+2),*(((u_int8_t*)&roid)+3)); + print_obj(&roid); + fprintf(ptr_out," writeObjectId : %d.%d.%d.%02x", + *(u_int8_t*)&woid,*(((u_int8_t*)&woid)+1),*(((u_int8_t*)&woid)+2),*(((u_int8_t*)&woid)+3)); + print_obj(&woid); + fprintf(ptr_out," issueSeqNumber : %u\n",fsn.low); + k=msg+ptr+20; + if (msg[ptr+1] & 2) { + decode_parametr_sequence(k); /* after k is set to end of paramseq. */ + } +// l=(*(unsigned*)(msg+ptr+2))-(k-(msg+ptr+20)+16); + //len of message is also in message (first ulong), internaly defined by RTI !!! + l=(*(u_int32_t*)k)+4; + while(l!=0) { + if (l>8) j=8; + else j=l; + l-=j; + fprintf(ptr_out," : "); + for(i=0;i>=1) fprintf(ptr_out,"%d",(msg[ptr+24+i] & j) ? 1:0); + fprintf(ptr_out," "); + if ((!(++i % 4)) && (itimestamp=*((NtpTime*)(msg+ptr+4)); + fprintf(ptr_out," ntpTimeStamp : %u,%u\n", + mi->timestamp.seconds,mi->timestamp.fraction); + } + break; + case INFO_SRC: + fprintf(ptr_out," INFO_SRC\n"); + break; + case INFO_REPLY: + fprintf(ptr_out," INFO_REPLY\n"); + ipa=*((u_int32_t*)(msg+ptr+4)); /* unicastReplyIPAddress */ + port=*((u_int32_t*)(msg+ptr+8)); /* unicastReplyPort */ + fprintf(ptr_out," unicastReplyIPAddress : %d.%d.%d.%d\n", + *(u_int8_t*)&ipa,*(((u_int8_t*)&ipa)+1),*(((u_int8_t*)&ipa)+2),*(((u_int8_t*)&ipa)+3)); + fprintf(ptr_out," unicastReplyPort : %u\n",port); + if (ipa!=IPADDRESS_INVALID) { + mi->unicastReplyIPAddress=ipa; + } + mi->unicastReplyPort=port; + if ((msg[ptr+1] & 0x02) !=0) { + ipa=*((u_int32_t*)(msg+ptr+12)); /* multicastReplyIPAddress */ + port=*((u_int32_t*)(msg+ptr+16)); /* multicastReplyPort */ + fprintf(ptr_out," multicastReplyIPAddress : %d.%d.%d.%d\n", + *(u_int8_t*)&ipa,*(((u_int8_t*)&ipa)+1),*(((u_int8_t*)&ipa)+2),*(((u_int8_t*)&ipa)+3)); + fprintf(ptr_out," multicastReplyPort : %u\n",port); + mi->multicastReplyIPAddress=ipa; + mi->multicastReplyPort=port; + } else { + mi->multicastReplyIPAddress=IPADDRESS_INVALID; + mi->multicastReplyPort =PORT_INVALID; + } + break; + case INFO_DST: + fprintf(ptr_out," INFO_DST\n"); + hid=*((HostId*)(msg+ptr+4)); /* hostId */ + aid=*((AppId*)(msg+ptr+8)); /* appId */ + fprintf(ptr_out," HostId : %d.%d.%d.%d\n", + *(u_int8_t*)&hid,*(((u_int8_t*)&hid)+1),*(((u_int8_t*)&hid)+2),*(((u_int8_t*)&hid)+3)); + fprintf(ptr_out," AppId : %d.%d.%d.%d ", + *(u_int8_t*)&aid,*(((u_int8_t*)&aid)+1),*(((u_int8_t*)&aid)+2),*(((u_int8_t*)&aid)+3)); + print_app(*(((u_int8_t*)&aid)+3)); + break; + default: + fprintf(ptr_out," undefined submessage code\n"); + break; + } + return 0; +} + + +/**********************************************************************************/ +int main(int argc, char * argv[]) { + u_int8_t rtps_msg[16384],rtps_msg_c[3]={0,0,0}; + unsigned rtps_msg_ptr=0,rtps_msg_len,rtps_submsg_cnt,submsg_len; + int err,c,no_lchar=1; + MessageInterpret mi; + + printf("-------------------------------------------------------------------------------\n"); + printf(" RTPS messages decoder OCERA project \n"); + printf(" \n"); + printf("-------------------------------------------------------------------------------\n"); + if (argc != 3) { + printf(" syntax : decode_msg 'filename to decode' 'output file'\n\n"); + return 0; + } + printf(" decode file : %s\n output file : %s\n\n",argv[1],argv[2]); + ptr_in = fopen(argv[1],"r"); /* open input file */ + if (ferror(ptr_in)) { + printf(" unable to open %s\n",argv[1]); + } + ptr_out = fopen(argv[2],"w"); /* create output file */ + if (ferror(ptr_out)) { + printf(" unable to create %s\n",argv[2]); + } + while ((c = fgetc(ptr_in)) !=EOF) { /* read one character */ + if (((no_lchar==1) && (!isdigit(c))) || (no_lchar==0)) { /* outside RTPS line */ + if (rtps_msg_ptr) { /* proc. data read data ? */ + rtps_msg[rtps_msg_ptr]=0; /* end of rtps data */ + rtps_msg_len=rtps_msg_ptr;rtps_msg_ptr=0; + printf(" message length : %d\n",rtps_msg_len); + /* decoded message - msg stored in rtps_msg, length msg in rtps_msg_len */ + if ((err=decode_header(rtps_msg,rtps_msg_len,&mi))==0) { + fprintf(ptr_out,"message length : %d\n",rtps_msg_len); + fprintf(ptr_out," Header\n"); + fprintf(ptr_out," protocol version : %d.%d \ + \n vendorId : %d.%d \ + \n hostId : %d.%d.%d.%d \ + \n appId : %d.%d.%d.%d ", + mi.sourceVersion.major,mi.sourceVersion.minor,mi.sourceVendorId.major, + mi.sourceVendorId.minor,*(u_char*)&mi.sourceHostId,*(((u_char*)&mi.sourceHostId)+1), + *(((u_char*)&mi.sourceHostId)+2),*(((u_char*)&mi.sourceHostId)+3),*(((u_char*)&mi.sourceAppId)), + *(((u_char*)&mi.sourceAppId)+1),*(((u_char*)&mi.sourceAppId)+2),*(((u_char*)&mi.sourceAppId)+3)); + print_app(*(((u_char*)&mi.sourceAppId)+3)); + rtps_msg_ptr=16;rtps_submsg_cnt=1; + do { + fprintf(ptr_out," Submessage : %d",rtps_submsg_cnt++); + if ((rtps_msg_ptr+3)<=rtps_msg_len) { /* len. submessage header is OK */ + submsg_len=rtps_msg[rtps_msg_ptr+2]+rtps_msg[rtps_msg_ptr+3]*0x100; + fprintf(ptr_out," len : %d\n",submsg_len+4); + if ((submsg_len+rtps_msg_ptr+3)<=rtps_msg_len) { + /* decode submessage */ + decode_submessage(rtps_msg,rtps_msg_ptr,&mi); + rtps_msg_ptr+=submsg_len+4; + } else rtps_msg_ptr=rtps_msg_len; /* submessage is too small */ + } else { + rtps_msg_ptr=rtps_msg_len; /* submessage is too small */ + fprintf(ptr_out,"\n"); + } + } while (rtps_msg_ptr1) { /* reading RTPS message*/ + no_lchar++; + if (c=='\n') no_lchar=1; + else { + if ((no_lchar>5) && (no_lchar<57)) { /* converted data from */ + if ((rtps_msg_c[0]!=0) && (isxdigit(c))) { /* position 6 to 56 */ + rtps_msg_c[1]=(u_int8_t)c; + rtps_msg[rtps_msg_ptr++]=(u_int8_t)strtol(rtps_msg_c,NULL,16); + rtps_msg_c[0]=0; + } else { + if ((rtps_msg_c[0]==0) && (isxdigit(c))) rtps_msg_c[0]=(u_int8_t)c; + } + } + } + } + if ((no_lchar==1) && (isxdigit(c))) no_lchar++; /* is begin RTPS line ? */ + } + fclose(ptr_in); + fclose(ptr_out); + return 0; +} diff --git a/orte/contrib/decoder/m.bat b/orte/contrib/decoder/m.bat new file mode 100755 index 0000000..9e7b0cf --- /dev/null +++ b/orte/contrib/decoder/m.bat @@ -0,0 +1,4 @@ +del ORTEManager.exe +make /f Makefile.msc +pause +ORTEManager -P 192.168.0.1 -v ALL:10 \ No newline at end of file diff --git a/orte/contrib/shape/MainFrm.ui b/orte/contrib/shape/MainFrm.ui new file mode 100644 index 0000000..e86593d --- /dev/null +++ b/orte/contrib/shape/MainFrm.ui @@ -0,0 +1,78 @@ + +MainForm + + + MainForm + + + + 0 + 0 + 415 + 168 + + + + Form2 + + + + View + + + + 40 + 10 + 320 + 110 + + + + + + + View_Frame +
./ViewFrm.h
+ + -1 + -1 + + 0 + + 5 + 5 + 0 + 0 + + image0 +
+
+ + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f + + + + + + MainFrm.ui.h + + + char m_wantClose + QRect m_shapeRect + int m_close + + + init() + resizeEvent( QResizeEvent * ) + SetShapeRect( QRect rect ) + SetProperties( char shape, char color ) + MaxX() + MaxY() + closeEvent( QCloseEvent * e ) + WantClose() + getClose() + + + +
diff --git a/orte/contrib/shape/MainFrm.ui.h b/orte/contrib/shape/MainFrm.ui.h new file mode 100644 index 0000000..971360d --- /dev/null +++ b/orte/contrib/shape/MainFrm.ui.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ +#include +#include +#include + +void MainForm::init() +{ + m_wantClose=0; + m_close=0; + } + +void MainForm::resizeEvent( QResizeEvent *) +{ + View->setGeometry(0,15,size().width(),size().height()-15); +} + +void MainForm::SetShapeRect(QRect rect) +{ + m_shapeRect=rect; + View->SetShapeRect(m_shapeRect); +} + +void MainForm::SetProperties(char shape, char color) +{ + View->SetShape(shape); + View->SetShapeColor(color); +} + +int MainForm::MaxX() +{ + return View->width(); +} + +int MainForm::MaxY() +{ + return View->height(); +} + + +void MainForm::closeEvent( QCloseEvent * e ) +{ + if(m_wantClose==1) e->accept(); + else { + e->ignore(); + m_close=1; + } +} + + +void MainForm::WantClose() +{ + m_wantClose=1; +} + +int MainForm::getClose() +{ + return m_close; +} diff --git a/orte/contrib/shape/Makefile b/orte/contrib/shape/Makefile new file mode 100644 index 0000000..73c9ef9 --- /dev/null +++ b/orte/contrib/shape/Makefile @@ -0,0 +1,226 @@ +############################################################################# +# Makefile for building: Orte_demo +# Generated by qmake (1.04a) (Qt 3.1.1) on: Mon Sep 22 01:48:09 2003 +# Project: Orte_demo.pro +# Template: app +# Command: $(QMAKE) -o Makefile Orte_demo.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +LEX = flex +YACC = yacc +CFLAGS = -pipe -Wall -W -O2 -march=i386 -mcpu=i686 -g -DGLX_GLXEXT_LEGACY -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG +CXXFLAGS = -pipe -Wall -W -O2 -march=i386 -mcpu=i686 -g -DGLX_GLXEXT_LEGACY -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG +LEXFLAGS = +YACCFLAGS= -d +INCPATH = -I$(QTDIR)/mkspecs/default -I. -I../orte-0.1.1-pi/orte/include -I../orte-0.1.1-pi -I$(QTDIR)/include -I.ui/ -I.moc/ +LINK = g++ +LFLAGS = +LIBS = $(SUBLIBS) -L$(QTDIR)/lib -L/usr/X11R6/lib liblib.a -lqt-mt -lXext -lX11 -lm +AR = ar cqs +RANLIB = +MOC = $(QTDIR)/bin/moc +UIC = $(QTDIR)/bin/uic +QMAKE = qmake +TAR = tar -cf +GZIP = gzip -9f +COPY = cp -f +COPY_FILE= $(COPY) -p +COPY_DIR = $(COPY) -pR +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = .obj/ + +####### Files + +HEADERS = Publisher.h \ + ViewFrm.h \ + define.h \ + Subscriber.h +SOURCES = main.cpp \ + Publisher.cpp \ + ViewFrm.cpp \ + Subscriber.cpp +OBJECTS = .obj/main.o \ + .obj/Publisher.o \ + .obj/ViewFrm.o \ + .obj/Subscriber.o \ + .obj/MulticlipForm.o \ + .obj/MainFrm.o +FORMS = MulticlipForm.ui \ + MainFrm.ui +UICDECLS = .ui/MulticlipForm.h \ + .ui/MainFrm.h +UICIMPLS = .ui/MulticlipForm.cpp \ + .ui/MainFrm.cpp +SRCMOC = .moc/moc_Publisher.cpp \ + .moc/moc_ViewFrm.cpp \ + .moc/moc_Subscriber.cpp \ + .moc/moc_MulticlipForm.cpp \ + .moc/moc_MainFrm.cpp +OBJMOC = .obj/moc_Publisher.o \ + .obj/moc_ViewFrm.o \ + .obj/moc_Subscriber.o \ + .obj/moc_MulticlipForm.o \ + .obj/moc_MainFrm.o +DIST = Orte_demo.pro +QMAKE_TARGET = Orte_demo +DESTDIR = +TARGET = Orte_demo + +first: all +####### Implicit rules + +.SUFFIXES: .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +mocables: $(SRCMOC) + +$(MOC): + ( cd $(QTDIR)/src/moc ; $(MAKE) ) + +Makefile: Orte_demo.pro $(QTDIR)/mkspecs/default/qmake.conf + $(QMAKE) -o Makefile Orte_demo.pro +qmake: + @$(QMAKE) -o Makefile Orte_demo.pro + +dist: + @mkdir -p .obj/Orte_demo && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .obj/Orte_demo/ && $(COPY_FILE) --parents MulticlipForm.ui.h MainFrm.ui.h .obj/Orte_demo/ && ( cd `dirname .obj/Orte_demo` && $(TAR) Orte_demo.tar Orte_demo && $(GZIP) Orte_demo.tar ) && $(MOVE) `dirname .obj/Orte_demo`/Orte_demo.tar.gz . && $(DEL_FILE) -r .obj/Orte_demo + +mocclean: + -$(DEL_FILE) $(OBJMOC) + -$(DEL_FILE) $(SRCMOC) + +uiclean: + -$(DEL_FILE) $(UICIMPLS) $(UICDECLS) + +yaccclean: +lexclean: +clean: mocclean uiclean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) $(TARGET) + + +FORCE: + +####### Compile + +.obj/main.o: main.cpp .ui/MulticlipForm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/main.o main.cpp + +.obj/Publisher.o: Publisher.cpp Publisher.h \ + ViewFrm.h \ + define.h \ + .ui/MainFrm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/Publisher.o Publisher.cpp + +.obj/ViewFrm.o: ViewFrm.cpp ViewFrm.h \ + define.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/ViewFrm.o ViewFrm.cpp + +.obj/Subscriber.o: Subscriber.cpp Subscriber.h \ + define.h \ + .ui/MainFrm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/Subscriber.o Subscriber.cpp + +.ui/MulticlipForm.h: MulticlipForm.ui Subscriber.h \ + Publisher.h \ + define.h \ + .ui/MainFrm.h + $(UIC) MulticlipForm.ui -o .ui/MulticlipForm.h + +.ui/MulticlipForm.cpp: .ui/MulticlipForm.h MulticlipForm.ui Subscriber.h \ + Publisher.h \ + define.h \ + .ui/MainFrm.h + $(UIC) MulticlipForm.ui -i MulticlipForm.h -o .ui/MulticlipForm.cpp + +.ui/MainFrm.h: MainFrm.ui + $(UIC) MainFrm.ui -o .ui/MainFrm.h + +.ui/MainFrm.cpp: .ui/MainFrm.h MainFrm.ui + $(UIC) MainFrm.ui -i MainFrm.h -o .ui/MainFrm.cpp + +.obj/MulticlipForm.o: .ui/MulticlipForm.cpp MulticlipForm.ui.h \ + .ui/MulticlipForm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/MulticlipForm.o .ui/MulticlipForm.cpp + +.obj/MainFrm.o: .ui/MainFrm.cpp MainFrm.ui.h \ + .ui/MainFrm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/MainFrm.o .ui/MainFrm.cpp + +.obj/moc_Publisher.o: .moc/moc_Publisher.cpp Publisher.h define.h \ + .ui/MainFrm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/moc_Publisher.o .moc/moc_Publisher.cpp + +.obj/moc_ViewFrm.o: .moc/moc_ViewFrm.cpp ViewFrm.h define.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/moc_ViewFrm.o .moc/moc_ViewFrm.cpp + +.obj/moc_Subscriber.o: .moc/moc_Subscriber.cpp Subscriber.h define.h \ + .ui/MainFrm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/moc_Subscriber.o .moc/moc_Subscriber.cpp + +.obj/moc_MulticlipForm.o: .moc/moc_MulticlipForm.cpp .ui/MulticlipForm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/moc_MulticlipForm.o .moc/moc_MulticlipForm.cpp + +.obj/moc_MainFrm.o: .moc/moc_MainFrm.cpp .ui/MainFrm.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/moc_MainFrm.o .moc/moc_MainFrm.cpp + +.moc/moc_Publisher.cpp: $(MOC) Publisher.h + $(MOC) Publisher.h -o .moc/moc_Publisher.cpp + +.moc/moc_ViewFrm.cpp: $(MOC) ViewFrm.h + $(MOC) ViewFrm.h -o .moc/moc_ViewFrm.cpp + +.moc/moc_Subscriber.cpp: $(MOC) Subscriber.h + $(MOC) Subscriber.h -o .moc/moc_Subscriber.cpp + +.moc/moc_MulticlipForm.cpp: $(MOC) .ui/MulticlipForm.h + $(MOC) .ui/MulticlipForm.h -o .moc/moc_MulticlipForm.cpp + +.moc/moc_MainFrm.cpp: $(MOC) .ui/MainFrm.h + $(MOC) .ui/MainFrm.h -o .moc/moc_MainFrm.cpp + +####### Install + +install: all + +uninstall: + diff --git a/orte/contrib/shape/MulticlipForm.ui b/orte/contrib/shape/MulticlipForm.ui new file mode 100644 index 0000000..f36894d --- /dev/null +++ b/orte/contrib/shape/MulticlipForm.ui @@ -0,0 +1,510 @@ + +MulticlipForm + + + MulticlipForm + + + true + + + + 0 + 0 + 408 + 228 + + + + + 0 + 0 + + + + + 408 + 228 + + + + + Helvetica [Urw] + 12 + + + + ORTE Demo + + + + TextLabel6 + + + + 16 + 30 + 79 + 35 + + + + List of +Publishers : + + + + + deletePushButton + + + + 90 + 190 + 105 + 25 + + + + + 10 + + + + &Delete Publisher + + + 4194372 + + + false + + + + + addPushButton + + + + 90 + 160 + 105 + 25 + + + + + 10 + + + + &Add Publisher + + + 4194369 + + + false + + + + + + Blue + + + + + Green + + + + + Red + + + + + Black + + + + ColorP + + + + 92 + 125 + 105 + 25 + + + + + + Line2 + + + + 204 + 0 + 3 + 231 + + + + VLine + + + Sunken + + + Vertical + + + + + PublishersListBox + + + + 10 + 70 + 75 + 150 + + + + + + SubscribersListBox + + + + 211 + 70 + 75 + 150 + + + + + + addS + + + + 293 + 160 + 105 + 25 + + + + + 10 + + + + &Add Suscriber + + + false + + + + + deleteS + + + + 293 + 195 + 105 + 25 + + + + + 10 + + + + &Delete Suscriber + + + false + + + + + TextLabel2_2 + + + + 127 + 108 + 70 + 17 + + + + Color + + + + + TextLabel1_3 + + + + 127 + 60 + 60 + 20 + + + + Shape + + + + + TextLabel2_3 + + + + 215 + 30 + 95 + 35 + + + + List of +Subscribers : + + + + + + Ellipse + + + + + Rectangle + + + + + Triangle + + + + ShapeP + + + + 92 + 80 + 105 + 25 + + + + + + + Blue + + + + + Green + + + + + Red + + + + + Black + + + + ColorS + + + + 293 + 125 + 105 + 25 + + + + + + + Ellipse + + + + + Rectangle + + + + + Triangle + + + + ShapeS + + + + 293 + 80 + 105 + 25 + + + + + + TextLabel1_3_2 + + + + 327 + 60 + 72 + 20 + + + + Shape + + + + + TextLabel2_2_2 + + + + 328 + 108 + 65 + 17 + + + + Color + + + + + TextLabel2 + + + + 45 + 0 + 145 + 30 + + + + + 20 + 1 + + + + Publishers + + + + + TextLabel4 + + + + 245 + 0 + 145 + 30 + + + + + 20 + 1 + + + + Suscribers + + + + + + addPushButton + clicked() + MulticlipForm + addPublisher() + + + deletePushButton + clicked() + MulticlipForm + deletePublisher() + + + addS + clicked() + MulticlipForm + addSubscriber() + + + deleteS + clicked() + MulticlipForm + deleteSubscriber() + + + + Subscriber.h + Publisher.h + qtimer.h + sys/types.h + qapplication.h + qcombobox.h + qwidget.h + qtabwidget.h + qapplication.h + qpushbutton.h + qinputdialog.h + unistd.h + signal.h + MulticlipForm.ui.h + + + init() + addPublisher() + deletePublisher() + GotoP() + closeEvent( QCloseEvent * e ) + GotoS() + addSubscriber() + deleteSubscriber() + keyPressEvent( QKeyEvent * e ) + Timer() + + + + diff --git a/orte/contrib/shape/MulticlipForm.ui.h b/orte/contrib/shape/MulticlipForm.ui.h new file mode 100644 index 0000000..7b48179 --- /dev/null +++ b/orte/contrib/shape/MulticlipForm.ui.h @@ -0,0 +1,225 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ +#include +#include +Subscriber *tabSub[50]; +int NSubscriber; +Publisher *tabPub[50]; +int NPublisher; +int np,ns; + +void MulticlipForm::init() +{ + memset(tabSub,0,sizeof(tabSub)); + memset(tabPub,0,sizeof(tabPub)); + NPublisher=0; + NSubscriber=0; + np=ns=1; + QTimer *timer = new QTimer(this); + connect( timer, SIGNAL(timeout()), SLOT(Timer())); + timer->start( 500, FALSE ); +} + + +void MulticlipForm::addPublisher() +{ + PublishersListBox->insertItem( QString::number(np), 0 ); + GotoP(); + NPublisher++; +} + + + +void MulticlipForm::deletePublisher() +{ + QString text=PublishersListBox->currentText(); + if(PublishersListBox->currentItem()!=-1 && !text.isEmpty()){ + int pub; + pub=NPublisher-1-PublishersListBox->currentItem() ; + PublishersListBox->removeItem( PublishersListBox->currentItem() ); + tabPub[pub]->Destroy(); + delete(tabPub[pub]); + for(int i=pub;i+1currentItem(); + int color=ColorP->currentItem(); + int strength=0; + tabPub[NPublisher]=new Publisher(); + tabPub[NPublisher]->Create(name,shap,color,strength); +} + + + +void MulticlipForm::closeEvent( QCloseEvent *e ) +{ + int i; + for(i=0;iDestroy(); + delete(tabPub[i]); + } + for(i=0;iDestroy(); + delete(tabSub[i]); + } +e->accept(); +} + +void rcvCallBack(ORTERcvInfo *rcvInfo,u_char status) +{ + QRect rect; + int a,b,c,d; + char *topic,*type; + int top=0,typ=0; + switch (status) { + case 0: //Issue + sscanf((char*)rcvInfo->data,"%i %i %i %i",&a,&b,&c,&d); + rect.setCoords(a,b,c,d); + topic=(char *)rcvInfo->subsTopic; + type=(char *)rcvInfo->subsTypeName; + if(strcmp(topic,"Ellipse")==0)top=0; + if(strcmp(topic,"Rectangle")==0)top=1; + if(strcmp(topic,"Triangle")==0)top=2; + if(strcmp(type,"Blue")==0)typ=0; + if(strcmp(type,"Green")==0)typ=1; + if(strcmp(type,"Red")==0)typ=2; + if(strcmp(type,"Black")==0)typ=3; + + for(int i=0;itopS==top && tabSub[i]->typS==typ){ + (tabSub[i]->m_mainFrm)->setCaption(tabSub[i]->strTitle); + (tabSub[i]->m_mainFrm)->SetShapeRect(rect); + } + } + break; + case 1: //Data + for(int i=0;itopS!=tabPub[j]->top || tabSub[i]->typS!=tabPub[j]->typ){ + dead++; + } + } + } + if(NPublisher==0 || dead==NPublisher){ + QString name=tabSub[i]->strTitle+" deadline "; + (tabSub[i]->m_mainFrm)->setCaption(name); + } + } + break; + } +} + +void MulticlipForm::GotoS( ) +{ + QString name =QString::number(ns); + ns++; + int shap=ShapeS->currentItem(); + int color=ColorS->currentItem(); + QString topic; + QString type; + +switch(shap) + { + case RECTANGLE: + topic="Rectangle"; + break; + case ELLIPSE: + topic="Ellipse"; + break; + case TRIANGLE: + topic="Triangle"; + break; + } + + switch(color) + { + case BLUE: + type="Blue"; + break; + case GREEN: + type="Green"; + break; + case RED: + type="Red"; + break; + case BLACK: + type="Black"; + break; + } +NtpTime minimumSeparation,deadline; +int h_sub; + tabSub[NSubscriber]=new Subscriber(); + tabSub[NSubscriber]->Create(name,shap,color); +ORTEAppCreate(&(tabSub[NSubscriber]->app)); + NtpTimeAssembFromMs(minimumSeparation,0,0); + NtpTimeAssembFromMs(deadline, 5, 0); + h_sub=ORTEAppSubsAdd(tabSub[NSubscriber]->app,topic,type, &minimumSeparation,&deadline,rcvCallBack); +} + +void MulticlipForm::addSubscriber() +{ + + SubscribersListBox->insertItem( QString::number(ns), 0 ); + GotoS(); + NSubscriber++; +} + + +void MulticlipForm::deleteSubscriber() +{ +QString text=SubscribersListBox->currentText(); + if(SubscribersListBox->currentItem()!=-1 && !text.isEmpty()){ + int pub; + pub=NSubscriber-1-SubscribersListBox->currentItem() ; + SubscribersListBox->removeItem( SubscribersListBox->currentItem() ); + tabSub[pub]->Destroy(); + delete(tabSub[pub]); + for(int i=pub;i+1key() ) { + if( focusWidget ()==PublishersListBox)deletePublisher(); + if( focusWidget ()==SubscribersListBox)deleteSubscriber(); + } +} + + + +void MulticlipForm::Timer() +{ + int i; + for(i=0;im_mainFrm)->getClose()==1){ + PublishersListBox->setCurrentItem (NPublisher-1-i); + deletePublisher(); + } + } + for(i=0;im_mainFrm)->getClose()==1){ + SubscribersListBox->setCurrentItem (NSubscriber-1-i); + deleteSubscriber(); + } + } +} diff --git a/orte/contrib/shape/Orte_demo.db b/orte/contrib/shape/Orte_demo.db new file mode 100644 index 0000000..b520b30 --- /dev/null +++ b/orte/contrib/shape/Orte_demo.db @@ -0,0 +1,2 @@ + + diff --git a/orte/contrib/shape/Orte_demo.pro b/orte/contrib/shape/Orte_demo.pro new file mode 100644 index 0000000..2fc2b76 --- /dev/null +++ b/orte/contrib/shape/Orte_demo.pro @@ -0,0 +1,14 @@ +SOURCES += main.cpp Publisher.cpp ViewFrm.cpp Subscriber.cpp +HEADERS += Publisher.h ViewFrm.h define.h Subscriber.h +unix { + UI_DIR = .ui + MOC_DIR = .moc + OBJECTS_DIR = .obj +} +FORMS = MulticlipForm.ui MainFrm.ui +TEMPLATE =app +CONFIG += qt warn_on release +INCLUDEPATH += ../../include +LIBS += ../../liborte.a +DBFILE = Orte_demo.db +LANGUAGE = C++ diff --git a/orte/contrib/shape/Publisher.cpp b/orte/contrib/shape/Publisher.cpp new file mode 100644 index 0000000..56a53ef --- /dev/null +++ b/orte/contrib/shape/Publisher.cpp @@ -0,0 +1,144 @@ +#include "Publisher.h" +#include +#include +#include "ViewFrm.h" + +Publisher::Publisher( QWidget *parent, const char *name ) + : QWidget( parent, name ) +{ + m_stepx=rand()%2+1; + m_stepy=rand()%2+1; + m_incx=0; + m_incy=0; + + while(m_incx==0) m_incx=(rand()%3-1)*m_stepx; + while(m_incy==0) m_incy=(rand()%3-1)*m_stepy; + + m_shapeRect.setRect(0,0,25,45); +} + +void Publisher::Create(QString name, char shape, char color, long strength) +{ + NtpTime timePersistence; + //init main frame + m_mainFrm = new MainForm; + Text = new QLabel( m_mainFrm, "Text" ); + Text->setGeometry( QRect(10 , 0, 60, 15 ) ); + Text->setText( trUtf8( "Strength : " ) ); + str = new QSlider(m_mainFrm, "str" ); + str->setGeometry( QRect( 70, 0, 130, 15 ) ); + str->setMaxValue( 10 ); + str->setOrientation( QSlider::Horizontal ); + connect( str, SIGNAL( valueChanged(int) ), this, SLOT(changeStrenght() ) ); + m_mainFrm->show(); + m_mainFrm->SetProperties(shape,color); + m_shapeRect.moveBy(rand()%m_mainFrm->MaxX(),rand()%m_mainFrm->MaxY()); + + + //init caption + + QString topic; + QString type; + top=shape; + typ=color; + strTitle="Publisher : "+name+" (Topic="; + + switch(shape) + { + case RECTANGLE: + strTitle+="RECTANGLE, Type="; + topic="Rectangle"; + break; + case ELLIPSE: + strTitle+="ELLIPSE, Type="; + topic="Ellipse"; + break; + case TRIANGLE: + strTitle+="TRIANGLE, Type="; + topic="Triangle"; + break; + } + + switch(color) + { + case BLUE: + strTitle+="BLUE"; + type="Blue"; + break; + case GREEN: + strTitle+="GREEN"; + type="Green"; + break; + case RED: + strTitle+="RED"; + type="Red"; + break; + case BLACK: + strTitle+="BLACK"; + type="Black"; + break; + } + + ORTEAppCreate(&app1); + NtpTimeAssembFromMs(timePersistence, 5, 0); + h_pub=ORTEAppPublAdd(app1,topic,type, + &timePersistence,strength); + + strTitle+=", Strength="+QString::number(strength)+" )"; + m_mainFrm->setCaption(strTitle); + + //create the timer + QTimer *timer = new QTimer(this); + connect( timer, SIGNAL(timeout()), SLOT(Timer())); + timer->start( 50, FALSE ); +} + +void Publisher::Timer() +{ + char msg[128]; + memset(msg,0,sizeof(msg)); + MoveShape(); + sprintf(msg,"%i %i %i %i",m_shapeRect.left(),m_shapeRect.top(),m_shapeRect.right(),m_shapeRect.bottom()); + //Don't forget add to length last zero char !!! + ORTEAppPublSend(app1,h_pub,msg,strlen(msg)+1); +} + +void Publisher::MoveShape() +{ + if(m_shapeRect.left()<=0) m_incx=m_stepx; + if(m_shapeRect.top()<=0) m_incy=m_stepy; + if((m_shapeRect.right())>=m_mainFrm->MaxX()) m_incx=-m_stepx; + if((m_shapeRect.bottom())>=m_mainFrm->MaxY()) m_incy=-m_stepy; + + if(m_mainFrm->View->m_mousePressed==1) + { + int tmpW=m_shapeRect.width(); + int tmpH=m_shapeRect.height(); + + m_shapeRect.setRect(m_mainFrm->View->m_mouseX-tmpW/2,m_mainFrm->View->m_mouseY-tmpH/2,tmpW,tmpH); + } + else + { + m_shapeRect.moveBy(m_incx,m_incy); + } + + m_mainFrm->SetShapeRect(m_shapeRect); +} + +void Publisher::Destroy() +{ + m_mainFrm->WantClose(); + m_mainFrm->close(); + ORTEAppDestroy(app1); +} +void Publisher::changeStrenght() +{ + ORTEPublProp publ_prop; + ORTEAppPublPropGet(this->app1,this->h_pub,&publ_prop); + publ_prop.strength=str->value(); + ORTEAppPublPropSet(this->app1,this->h_pub,&publ_prop); + QString name=QString::number(str->value()); + if((str->value())<10) name+=" "; + (this->strTitle).replace((this->strTitle).length()-3,2,name); + (this->m_mainFrm)->setCaption(this->strTitle); +} diff --git a/orte/contrib/shape/Publisher.h b/orte/contrib/shape/Publisher.h new file mode 100644 index 0000000..dde7c3c --- /dev/null +++ b/orte/contrib/shape/Publisher.h @@ -0,0 +1,44 @@ +#if !defined PUBLISHER_H +#define PUBLISHER_H + +#include +#include "MainFrm.h" +#include +#include +#include +#include +class Publisher : public QWidget +{ + Q_OBJECT +public: + Publisher(QWidget *parent=0, const char *name=0); + +public: + void Create(QString name, char shape, char color, long strength); + void Destroy(); + +public slots: + void Timer(); + void changeStrenght(); + +public: + MainForm* m_mainFrm; + QSlider* str; + QLabel *Text; + ManagedApp *app1; + int h_pub; + int top,typ; + QString strTitle; + +protected: + QRect m_shapeRect; + char m_stepx; + char m_stepy; + char m_incx; + char m_incy; + + void MoveShape(); + +}; + +#endif diff --git a/orte/contrib/shape/Subscriber.cpp b/orte/contrib/shape/Subscriber.cpp new file mode 100644 index 0000000..94437f4 --- /dev/null +++ b/orte/contrib/shape/Subscriber.cpp @@ -0,0 +1,91 @@ +#include "Subscriber.h" +#include +#include +#include + +Subscriber::Subscriber( QWidget *parent, const char *name ) + : QWidget( parent, name ) +{ +} + +void Subscriber::Create(QString name, char shape, char color) +{ + + //init main frame + m_mainFrm = new MainForm; + Text = new QLabel( m_mainFrm, "Text" ); + Text->setGeometry( QRect(10 , 0, 110, 15 ) ); + Text->setText( trUtf8( "Minimum Separation : " ) ); + MinSep = new QSlider(m_mainFrm, "str" ); + MinSep->setGeometry( QRect( 120, 0, 130, 15 ) ); + MinSep->setMaxValue( 10 ); + MinSep->setOrientation( QSlider::Horizontal ); + connect( MinSep, SIGNAL( valueChanged(int) ), this, SLOT(changeMinSep() ) ); + m_mainFrm->show(); + m_mainFrm->SetProperties(shape,color); + + + //init caption + + + strTitle="Subscriber : "+name+" (Topic="; +typS=color; +topS=shape; + switch(shape) + { + case RECTANGLE: + strTitle+="RECTANGLE, Type="; + topic="Rectangle"; + break; + case ELLIPSE: + strTitle+="ELLIPSE, Type="; + topic="Ellipse"; + break; + case TRIANGLE: + strTitle+="TRIANGLE, Type="; + topic="Triangle"; + break; + } + + switch(color) + { + case BLUE: + strTitle+="BLUE"; + type="Blue"; + break; + case GREEN: + strTitle+="GREEN"; + type="Green"; + break; + case RED: + strTitle+="RED"; + type="Red"; + break; + case BLACK: + strTitle+="BLACK"; + type="Black"; + break; + } + strTitle+=" Min.Sep.=0 )"; + m_mainFrm->setCaption(strTitle); +} + + +void Subscriber::Destroy() +{ + m_mainFrm->WantClose(); + m_mainFrm->close(); + +} + +void Subscriber::changeMinSep() +{ + ORTESubsProp sub_prop; + ORTEAppSubsPropGet(app,1,&sub_prop); + NtpTimeAssembFromMs(sub_prop.minimumSeparation,MinSep->value(),0); + ORTEAppSubsPropSet(app,1,&sub_prop); + QString name=QString::number(MinSep->value()); + if((MinSep->value())<10) name+=" "; + (this->strTitle).replace((this->strTitle).length()-3,2,name); + (this->m_mainFrm)->setCaption(this->strTitle); +} diff --git a/orte/contrib/shape/Subscriber.h b/orte/contrib/shape/Subscriber.h new file mode 100644 index 0000000..2cf4a30 --- /dev/null +++ b/orte/contrib/shape/Subscriber.h @@ -0,0 +1,32 @@ +#if !defined SUBSCRIBER_H +#define SUBSCRIBER_H + +#include +#include "MainFrm.h" +#include +#include +#include +#include +class Subscriber : public QWidget +{ + Q_OBJECT +public: + Subscriber(QWidget *parent=0, const char *name=0); + QString topic; + QString type; + QString strTitle; + int typS,topS; + ManagedApp *app; + MainForm* m_mainFrm; + QSlider* MinSep; + QLabel *Text; + +public: + void Create(QString name, char shape, char color); + void Destroy(); + +public slots: + void changeMinSep(); + +}; +#endif diff --git a/orte/contrib/shape/ViewFrm.cpp b/orte/contrib/shape/ViewFrm.cpp new file mode 100644 index 0000000..e2f10b4 --- /dev/null +++ b/orte/contrib/shape/ViewFrm.cpp @@ -0,0 +1,96 @@ +/**************************************************************** +** +** Implementation View_Frame class +** +****************************************************************/ + +#include "ViewFrm.h" +#include +#include + +View_Frame::View_Frame( QWidget *parent, const char *name ) + : QWidget( parent, name ) +{ + setBackgroundColor(QColor( 255, 255, 255) ); + m_mousePressed=0; +} + +void View_Frame::SetShape(char shape) +{ + m_shape=shape; +} + +void View_Frame::SetShapeColor(char color) +{ + switch(color) + { + case BLUE: + m_shapeColor=QColor(0,0,255); + break; + case GREEN: + m_shapeColor=QColor(0,255,0); + break; + case RED: + m_shapeColor=QColor(255,0,0); + break; + case BLACK: + m_shapeColor=QColor(0,0,0); + break; + } +} + +void View_Frame::SetShapeRect(QRect rect) +{ + m_shapeRect=rect; + repaint(); +} + +void View_Frame::paintEvent(QPaintEvent*) +{ + QPainter p(this); + + p.setBrush(m_shapeColor); + p.setPen(NoPen); + + + switch(m_shape) + { + case RECTANGLE: + p.drawRect(m_shapeRect); + break; + case ELLIPSE: + p.drawEllipse(m_shapeRect); + break; + case TRIANGLE: + QPointArray pt(3); + pt.putPoints(0,3, m_shapeRect.center().x(),m_shapeRect.top(), m_shapeRect.right(),m_shapeRect.bottom(), m_shapeRect.left(),m_shapeRect.bottom()); + p.drawPolygon(pt); + break; + } + + QString strPos; + + strPos="X:" + QString::number(m_shapeRect.center().x())+" Y:"+QString::number(m_shapeRect.center().y()); + + p.drawText(m_shapeRect.left()-(70-m_shapeRect.width())/2,m_shapeRect.top()-1,strPos); +} + +void View_Frame::mouseMoveEvent(QMouseEvent *e) +{ + if(m_mousePressed==0) return; + + m_mouseX=e->pos().x(); + m_mouseY=e->pos().y(); +} + +void View_Frame::mousePressEvent ( QMouseEvent * e) +{ + m_mousePressed=1; + m_mouseX=e->pos().x(); + m_mouseY=e->pos().y(); +} + +void View_Frame::mouseReleaseEvent ( QMouseEvent * ) +{ + m_mousePressed=0; +} diff --git a/orte/contrib/shape/ViewFrm.h b/orte/contrib/shape/ViewFrm.h new file mode 100644 index 0000000..2dcd4d9 --- /dev/null +++ b/orte/contrib/shape/ViewFrm.h @@ -0,0 +1,48 @@ +/**************************************************************** +** +** Definition of View_Frame class +** +****************************************************************/ + +#ifndef VIEW_FRAME_H +#define VIEW_FRAME_H + +#include +#include +#include +#include "define.h" + +class View_Frame : public QWidget +{ + Q_OBJECT +public: + View_Frame( QWidget *parent=0, const char *name=0 ); + +protected: + void mouseMoveEvent(QMouseEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + + +public: + void SetShape(char shape); + void SetShapeColor(char color); + void paintEvent(QPaintEvent*); + void SetShapeRect(QRect rect); + +protected: + QRect m_shapeRect; + QColor m_shapeColor; + +private: + char m_shape; + +public: + char m_mousePressed; + int m_mouseX; + int m_mouseY; + +}; + + +#endif // VIEW_FRAME_H diff --git a/orte/contrib/shape/define.h b/orte/contrib/shape/define.h new file mode 100644 index 0000000..338ba13 --- /dev/null +++ b/orte/contrib/shape/define.h @@ -0,0 +1,14 @@ +#if !defined CONST_DEFINE +#define CONST_DEFINE + + +#define ELLIPSE 0 +#define RECTANGLE 1 +#define TRIANGLE 2 + +#define BLUE 0 +#define GREEN 1 +#define RED 2 +#define BLACK 3 + +#endif diff --git a/orte/contrib/shape/main.cpp b/orte/contrib/shape/main.cpp new file mode 100644 index 0000000..fe7eb69 --- /dev/null +++ b/orte/contrib/shape/main.cpp @@ -0,0 +1,11 @@ +#include +#include "MulticlipForm.h" + +int main( int argc, char ** argv ) +{ + QApplication a( argc, argv ); + MulticlipForm *w = new MulticlipForm(); + w->show(); + a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); + return a.exec(); +} diff --git a/orte/contrib/win_pthread/libpthreadGC.a b/orte/contrib/win_pthread/libpthreadGC.a new file mode 100644 index 0000000000000000000000000000000000000000..3aebf5da2313c64860933427757248c6f59c870b GIT binary patch literal 87846 zcmeI54X9klb%5us+R&fK~8Jl+^KHxBRnSk>PaYO9NDtBbYem1?yn zlibg0b!Ba3QRO(ZPYCfZLfr9TA@2H;5Y;cJaPOT$V7Tw=Dm-{v2n-+HtHL8+6#_%; z85I`4Cj^G&*Hu_MAOwcT{!)ccKwb<-;BXj@eoci>4urt))RGEMzbgcWPydk$&#nuB z;d4)@@LW|045$7_h0lLi2n?rTe;69SqC)Gq5E#zEu`qO?92mMi75cCb3@^Wi4zAprZ-~JsHes@C%48M213V#6Sf#DCoqQW1Kg~0G9PpR;y zAcx`4KnBCte_w^acwGn#-vl`ff3;VIzy78W7{2wU3V(A%2n>Jst_t7&st_3d9_kCj zKisdvcfTbBhJS?f!0=BmsPNBFR~Y{F9TooVk`NgF9r9uLk8i8+pKl0(;lJip_<;}t z!@J*5;lJM&0>cka$uKv!Psp(6Z^ayjtKU@Ny2r#Eh7bHeg&Y1{%wf3ktP1;&ia89o zKzs2`N9WjUD*q2l|4(Em8Q!6T*fOEp|%sVQ4=F4IZ!^!6`)a%{O`e3{< zY&Tj@9;-L%onB+JE$a0Rh{&ah`l!8GztHH6A-%IXs5}2LWvkci^v=6!ItEk6!|i-l z6D89-o9$L0VIxsy&>xNKn_Jy+XVAryG$)Zu(6V_ERf7JY-E&jaf6UYA`DIi8G38u) z{7R#{C&k(WJ-7&SNAt@?JS-EEn?Zj?$Nwa4Gy!l;VYeHdsJ`sTc*~h5X>%x`h`vp&Q@I) z(6r-5bEDpK&RAYBq*Qb-jqx;laisjc42FFu&uG%gM8x9zaSo)eqlsc#UI9Hh8P z@MK+85lQf(j2`eST9(SBnH+HK4%*Gm*-kTGHF&9;Bv&3U)Inp|*o@_H5}iEFey_PT z9JYH+qq3+}H(oZ`czfVnQ>xkE+*Et2#30XT+!)iDvQ(R^dp0Zz#%YP+1#A;wcnFvJ zcre;%4BJM3P7sPD$6C`lgi4O&1En+h*sf4yABF&*4(ISj!p~j5FpLqaGMdC(p7>Ri z<lj!6ruqxm%UaHR3zG(Ygew_LD@>U}-6Wc0M%P12)Z!_pvE7fgm zM=B56HjCGix|RHb>sTYz@3pkrG#7X-OH3rlAA=WaOYPj(S|%DQbkZ?hk>Hqya^i$d zx|`GM{znqLD0$(#U3x0jiyw8)^}_bXV%K$&Cr{N~?z)#dFl7qMY&-DY-q(lyMyuHv znK2J4)x<}8HM*~(rPdq6VW&Nu01qV<+e@q(-26U8Zi-8ZUoVtY?D$00y1OtUx%^S6 zvW!_;K1V@mbM3D8V-6lIV%Yk+X`pM;JU{BZ8kk=Z0ezNUQlr%}LpB8hK~fXOrSb~R z>{um+d9Wkc?{>mYoz3Zp#Pi2Gl74n2kY@eDY-!AYa_BzJPZeokX^)FA(G<+ZFRg+Eqq7jpp-fiX(5xS<{Edqy`B5?2&eb zqx)?ZKfEuKKfc#!@f~;~UVh@jm1l0!vK+^x@@=el+s`}0)I?$seG>bGg&D1cXpQIl zt~bnh!q$9G*g~zgvI5?*<+X*(b#`XoiMgx66CuQ%b3%Mj{<=!cLl+F(EQMQDh%@tG z6f_E@q~GiE{Q77#K}=i{;_`e4cX)6~%YxfR?1l4kw#0J?ICZp#l5y$> z%e-d}Km9GMLs>UhK~jN?tQTzkJ##nsJIVg(y`xM;+yS42k7i$MgCH>Hi`4|KJQ@;s z7-|k2vas!auL)d~rvV@P@oeC{s#&XI%N!vHyfxSIj+{p{UTN-za=NBj$fqzWKNJ_jK#}m8)9Lrk9bJ{b9^^A3EHwMSD zb`{6@dQghdNof zcPXiXMaH149X!e&9b>htjJaEg<-eAa2t>J{Yj1?RX>J(pcAffa|fj9j+jasijU zxSZh<+h|%Y`;yCSo&n^;HZ3cgcz?movUxy7$j^#cgKx=ZR$OQPgNcbv+faPg7<`6$ zGx2$FM|}1qpXeaN{z$p`L@Nk4%jZEAAwMhPG5D5z>f$$c|&Zu@A^~sm=H)k z?2kRB>_5%rO5!rEAp=din?3oLB$sl|bE)t3Q*#-g?j4=rE_+I~<;3NCz-32rDSdUb z!KLf3M17h4r}gF1^jt203n2B65|xdb<;dj6x-Y${KWYjxf)?H%<| z5s$+UX?2?7ItHf`M>Bee!Dt#~!g{A{P0lFjImxJYhL_vkoO+Z=7uP}5M$v?F{70b{ zP5vW04$A2bot1>DN8ZZZZ&$N5Tn$>qi#XdV0=tS*gHn(C71*5|4^q;dSmnE+JKI7% z�cjoCV#9GsOxXI4vNQ;X^tU>ds5hT$9E=PdPo0>J=ROTz8HOU}=jn82jwT<$@mj zD{(n9l5{g10uq|DK;I7Ha)G{mH7;kk#kptG>f3e8t-ta?$=SUV&L20c zbJ1h3w~BZcer7rs2=$Ae=Qp29GtBTlC5B~VWGL%vVn+-&q71`29I%zyZrCxylNTr< z?cUm>3{O?E9|{@f*u7^&WM!C=^E;LO5Gi)1f1@e1?qztg(p;57ZaH&R>Y7_;k)kr| z+^OcOWMn!;_L21xXkr;YuGP@ueG6`#lPq3$mU8t9TD-)p=fL8{nYOs)tboAceIqVs ztOcB#IjzNeIwKa%K57lEG86oOtWnqUMO#;I6>%1RW($-RRe?uzu^>%2!$Y5g_3~sj=AleZCeFKbw`wdD@E&VhIei?^v)%{y)(W2`5fEf@|NY+ z+xJN=;94dpvKaiTh;{hP>FuxzqHxE=Xu27my+pTcq218jFA#KFjWn}#+bSre+Z7|} zUSs(GaH)>m%*i*QsVDU+&p5rY>J{u&5;MbtUM0?3!YxN_(5rksE@$kLD(qugoBQVs z-MA1~xMFab?d^N9GGVj!HhQe}RuQM+r_tN-;^(-gglMW6-oZ2~Et@7szoGhONS&7I zQvM_EGBGL3!57n#8w23ffz097CWbV{UloBGW>u`;j_PqT-ygkjWeyrea8eA`}G_E^g_FJ3Dc4P$uT()@VY z4%8?v=NXS@U3%fwAm&|oaD*}wJk|VoW7Ote$>Wda;v4;(ilNuOt*tWrYe@qaGR(1i zf5v0jzL~Mi{Bkw0`_9P_Ut1?d^fLTtNdp(s%hABkg!HNxzs#BjmXJo@d4n3*OC@dK zRfbP3tqoPkFlTM3Pdg05+i6Q}IZU-Sl(ihF7xdDW?kdB3mS*7;GFpYyX}xDB45Q8) zg+a6EcL$c)T42q>i5EXN=0FM2nwQ~MTMm7~=^1@H`oOUsemX|A9G@?@7QRbf_wEP; zuF0pjiuf%2G$RlWtTCTOm`qd5@U$TQcstK(Cft?Y(G(CkUjJTp9aiRWG8`B;=^t(j+(XQO>Pn}d2_ zg&@yHg65gw?Mq`7g*%rr z`_1-f)E|!Oy+Nt^lQR!7GM*@9G>VTQjhS&_k)UGWLIQv-9Z9qPGxR5#Bo5l44!#7{E4-W|!gj zOY_=f+fd_i9Cnv-?CKTI%dCM}^V$@8Z6ZxC$JZA=5uLo&)c{`M+7w6Eb zhd)ZKeOaqjWCWX{#~F5#X^I(szVzm!LLJPRow=B!I0LxU1misjH)}sEstEa65%^Xw z-@g}qp@CvsR!G50gG&rwUgB1^0A)LHxLwF``+o3w?0{R+-!XAc@e;>h7e4!Z2^ulI zu}i5Hj?G)kajSdQGiLMZVn^)-n@CyTB0x7ywI80Hk0d*%d7 z>pI2Gq3fm4+%o)fiQ8S{cHZN*Iczs(klU=-5pGQi%`L5*dZG{YTdTkFHhT9iA<8s>!tX`WeZjRP0j%4%@!+*B0R#n@XeJAFwk?nPH3O~fN znZpUcszRKZZ#BjZnVbGNBE;qS_0foyP$`#Cu7f)~xT-m;TU>sGHIrKg?aLPe33Zp7sRN{4YdLn&&MX~!1sHvX+|E{a66lEU6Ev2>DqNN8sC#niV;Rs)?mpW%$MxLyekPwe!KSy{2XLK8MwA zW4rWE6ys;tBY6Sj~zY&}!moUKu{Iq+4a}XDU|f>K*CUgNE1lhd+#^ zTaCxddm_!m(yTK4U@PIQnY0>-)vcTrs_(U|_IqG#t7Ub}W0j@03GT_Xs@1coS@l*C zFThWuXQAUC6hEhO<03TC46j*w_CYoarF}W`zz&2&%ej1I_AjuWeK45DrZDCcX?hvn zv80a+>E-C-dqR3)%yO3Xu~U3XAA2G+(G0IydY4Nf(VQoOt0B>P8fvMn3%sgvv(^QU zhUqQ$P9mdrbq>SKC$ZMJBY1pU*#paS|05>_*7mW{O|sn zhs9Q928hRV+9O;a5AqK&jyGqIigEll=!*dv6(c<~NSujTfayj?7B zv&!(Yt%iQ%w?O$!nm^{wBCHB=#b!AYvl4?@jyO{jx11i8J!_1|9yrc&d?PMrZioj! zZrXm?t%lY0#&Fna4@1{+so6b<6$hJT_h}U&KP%!4e4EiRq6%^>lTtL>3?E$bSjd*i zT?2+~j>qDbDBH3(Q);GJ9t)S&SVu0BPIJugyd@o7$T3Gp-yG%GahAf7a6}dF4`mz& z-m#8$s-Qqedr~yp3~yYTCsD{YXP(55N7>f>^Kx^2kE|uv_IM(T!LQuBHCGSo;uk<| zMQEZq-n!7gdXf)@3 zCVTUTb7>^I3k)w^8aYOFlJ7MdihQRmeedOvbl^c=@A0h(lnCohq_Yb1XtPI9Bw8kX7?X1zhk163Bih~!LwCYj;S zOHU#dlFYG+KNynS?3es~^{gk648^k86v0^{O)ta4mqyqM>E(>D-4LO7qum2ZkuF@osEu(64kO__Y{_3MD zLVi}nDfl-2YM*FX{6e5J37Thye=og1R<=ks5Uod`&8S-yQm37RaecsZr?=4_cGMz` z<>vW-tR)TRm6+%8Sv~CpCCFXLo=QHdgHjaB$!w9dR)#h&C$^x2$)vOGQntu ze6c{8b@Yy`4!8IO(!K~yG{di#o&%BEhSJhFvvFE2z0W6FdI-u)G3z-HX=%iqB5ndn zY>nZ~OCxZF#B#=xuk(q8c`&m&mh2ThrhRh)G|3#_UbxC-^6l9kABW^?<0Q}ESh5C{ z981m#&?Gbbduc4WP$zT7lCKF#p24wXgp?dhb`oiN89u!h~YKu?V74l^oYP7vzzD14U+e>4~yGHa?1ktlOmTZV7$CC3Bw1(z*`$9`O`9`dz zTm{;v9i`YC@azqg!iZ~mpA+GaB?GNq@d*{3lcAaB`1`_VR1?#dX^z#gCt%tgDV;&9 z!!166v@b#v&G7i8dG>`?2d5WU@rl;caZ9b8S@Z1Wu(2+73}Kr_v&-=8r4fu>V|Pxo zdrYqB&{*%bpD+6wnw;5ixnle928lGi3@={l?-kO^u_Z)E@5#<)yCo5Zqmqn_Xf4Cz1kMN)=Sk&c+`MejT9AyYD%S^IH^r7MXJ>Ne{1iv&tuL6+kE_c z`+fJ$mz{IY+K=_vYp=cb8ye^-hlCNNJLj*F(gk>djCTMSZm%P4 z`;1DSj>)DK@$m@j?dfu;y!t?O-3DDoZHOlxsLt%acKhT1J^ialpinv8)RU})&a0sW zrQ}@GXEE|BMNWxR^IXc3lz25SUWrT5-WV%MO+5*SRSwE2&1XX+c1ywF=H~X0EA51G zTrD}LhR!QJB?l5DZ8=yAhY@vLTS&LBb;PAK;zs+^b&~Wj&n8dk00fUNl%iEELF^#> z3pZ=eAyJ2vfVi~w@DG)kdz=M6AyrA&QEl*P%=f4B2QlVfMw{e7t*zQ{@NzLtv-)u+D z#HZVr9n|Sb?kD}LNKZ&w%^%7y>D~(7bWq_lvy1d$U;80tP})&qt&{M!Y$1MpO+79Y?$g@9 zJwwL}9cH9c#{z2yvua*#4p65Z?VwIT3ZF#&A{3CIhT_$dgd%Mn%3#?;<3R0bbyQlr zT9BZOZ3&#a>1J@cm)PkTL+jjZU;7nS{z3`rST#RET^o<;pJ?zJ9%)tv?yT}@wC5kLj!+8|lmg^8 za<>+ywJWF9!gzJKT9Az5mC=H-mVF>pD%_jO=ta)vqjLOmc@&cf5G9dB~?iUUhM}4co-@cEKLr7 z6O~+~{f$T9-lwH;WP3^Fx*PiX`dZ{GsTJPKYewhSpg$Dfd{!Q!PHsLCK|2a-@wqyN z5c^7DuUEUDBT+g)`w(TaaxQ#~rAhK?JItuiNJhnDxvc3wspj{3swCBy;4RSJ&tP1I zdHd7lmlsdPsi_Xxp&0d!_#$mI<0k?3VY#|AP8rg4E@taBX(yn@amw-VYtN9*7F_j7 zam&r|USHq1mlZv zwoQwXuOU{}J@4{qW#C24@8R`zMEFjs)!i_+(7o2cxsuGTPQC zC_hQt<7R3#I*ADf&0?_XOHn2$4b(FYRaZ;{6)q%HOL~3UiU~}go~5c#8>Sa&!@=~; z&F%isZz#!a)6sOu_I2c@P(2iDpDaQ(=Jk5C(a4D&gv_KiYYMNzA4SsJGxG1Iw~RVb zn0H3+G-ZOiB1LHctsyjjPVbK1V(ojVEHt`ji;F>T?sSi~7WAxbZePRcZHS<^NLxUYrhByyb2u(WPLY;~ z5_Ln5+;%|~X@44L;v1*qJ6yPzgvpG=&Ym8~j&*a1yP5#)XioYYjWHn4pFwSv1I*Mw zy((K8+-Mj+Z2?I$BSq=ZGC-s1n?~|Fn%MjX@}Q3C_9fgl-4-94c;^pr2VrJJA+5+l z+O2NJt;&!K`^u_5u2{P?hw*@tQ1iX;SJuvtjgh1^p-wxuo|XrbLA%FS+|f)oF&K2P z^c~Hecx;;(-0UmX{)hrRkS`QdnU})in+_#}cX7r^Fu+@+?L~ZdB^lT)lDZ94U{ zbzLmhUPckf1IutMe3Nat=ElRI{XUDQv)BZ6MO;B&Cz+{Z5%!+SM=io8sQE5stg<4G7v|OcI=Wmq zXbBuhMy4d`{HVBL%P=i4)rUS_eF{->QFErVHuF+H2OYd?sFt|zLoFsj3vvSJcYc?T&sCad!k5Tjg5@y&gqA|+s(n<8=&b01uZMc717p>;4HoXzk1hA zh#?t~wQb<3!-t+H2e5md?td_Qn|7ADq$TkkdA&rr-v6Q}=Ne)6opKU)RYR}_2MUR2 zZp&6zk@mbn=`hVpluF?vNY_%Fq!emi?cLG3P?fyi#OCoRL@kcXo^Z!Hq$$#N&d_5+ zIgDuSdGg9VS~o6AUJpz!6ZX}FF0Yq0;>6}n;6u&p0k_TTaI5ro7viG5J_m{7mHgiD zQz(n8ZIMk^5O%L23dT`f_yfctJ+JKWD^zZt=FwV)>*a?3Q%fTnT}ok3 zSkb1^eX>&0+f581b&*yNS%S~*=Fb?QVh?HBr4TAOZ<^aDC!w-PKuFBux=$gY-ax}< zd!g|sv?~FM1Re8gWZ&6XhWpQ`f3=W&!7VKaCm>`=Ym0&chnwbqH~Bu1~%U#&a-ppadV<^@u0ybDXRXb)7}pkn@lM`RU=e zoZ}7Vug)V2x+9?@?+}=f49#`f9h@x^l=pcgQ1cF`?L?P(ShC^rj#4+s-ziIkg@Je@(S2{#Zb__Yv+M7P@lmCQLG2&s);hAAVR435oAzQ6F7FtvU zhhcF{r}Czf8_#tSc`(!{(5@KCGO!jEr}Ty&@py_`ZbQp?TQDkjYm+m^=^YuKMD#$KLTiQPcp#lXsOMXO5a12XaQLBd*%7jOfT^ zb{$k<^s4ycl{dQs5Q93Cm3{-95Qb$Yw;KO38>N8WRAw=60h(?v)ymUUrS|bzGL2c+ z#;ME6$h6#+RIHuC2$9uvXs+5oW4H2_8~PNuA7mb;qAVUc`389!bd}J|E!KW4GRY%2 z7RXA85xs!mZj<0n{-yRQje?}`n_~Ryi(9Pt;&!4&`xb`or5r0zy3kcx|aRdJq*(v09{ZQ-k7@d35XS3#R<9hx-teEbe7f{#MYw4DVLHNH+H$(QB?fe8uY7uATpYR?ct2h( z`%8>O=9CWqnkU$FDrVPFISCy2wE5_9;qYsNIU7oYt0Rx8JRf#+{{l>lqS@872W)}~ zhO`7?TcZww_}b;skePysDa@eg@&J|=Uz}Gv#t@MGn8KXMH_Uj{+zW_>62k93BL5-$ zOy3*&jMkpkedKF~AGP*3P&}8)*z;;7+$UhX4Wo%rHpJFmKqdxT+PEwj(~&cY1gr&t z1;i+WJXNvGa{_VNW=@#Li#LrL-WyX@yfU)6r9#>$g6NS0W9-x zY zxZ=LA6Xxiz`@9;4JW=}dlJIcbd_{2)Yo=rmz!e-htr(sLQJJ{wb(Emyq~Nys0Nwhg zx9rg1(x59C{5(ddun7qT@TZHku^=_=D1<#3^F;C$Y#5k$-@&w_cfGxQ=cyNu_x0^O zuo6=&q+yt^goY8mt#L)#5ynXZRB`y%e7bfIW%Hcjqez3XZIKp$fr990;JRfLfJNGW zVSWsd@Edrtk2Q<5ZzE2Oy&~N%pfmYt)=L^mR0^my50f zZZCKJ^Dk#vQR((1bf7V7Cwo&jvwr!BEzq-`62TD z!@n~1nTAq^|8MwBc8{MNwJjv-9lbF2#o7ceTQbC(@o%zx-z%69ndf^6 z8yJ8d9y5{0bl(oSa^&IPS^1-C!hBymYT_N;oY46A3t|As>cKu(=A&eNzTM~fd*}OB z@#6mn=KD;3#e8}`DdlK&4E~Rx8IU2$^0;X8i_D(E_d|MfM)C+|B%zQo%)l`V{TE^1 zn7(k;?|+8+)4s%AWDg*DpZ0Sm6)HZHxr(7GW+R(E?Ug6NAMH~cTBdfO4h6VjK-!j!7K2DP#aKo0q_PQ%uTZp8Malm*G8!KhjQ5hyG-t=RApgG-)HvbVuQk~rWS6pbWu}IthsTjn(9ARH|Q*vQ> z?gIae-bzj{@$e*wWim}{o{VVS-x@}@p#+boi224p(rx28%!oWpm2xiTj%`inV&xIq zPcXJovmi)Xt$-J+?C2@pM^;#S3UVyc{{2!UKjg}h=P=Bdk#K49Y#UAg7HO|eX3-GE zXgsSWJwEMjo+SL3=4EAvf6sEBW`n4N@NuM7;2w+Wq;(mpS5#+r2o<88{}}bj1{y1p z;8~+TW`vC6geWhNDVj*gXyHT9b2hO#3z@?|Km;S-r^!0PW6Z(mp2#ZOr9Ft^Z(i$B zb1|otc8=8t$?+g6iP1TqXJfiBoasXMJ5-Nc9lDS5bZIB_`X&~|NH(fQ>_7@bBd(>A zCUAO8-0mMbtOi-YEc3##DH=<7pkbL2F=9lF3? z_+4VH`!8nu-2pZ^Ywut@lY?OZ28S4G>eit>G+d}t_+f1iGKSB96H#C95)Y!jrbKJO zzoHbAX|!Adjp4O4jOz&|AKqZ=)0X)R)-x&AQtk5@EPgxUBjz)n<~0;;K125(*`&rK zn%ykH?55n%bhr(mv&I z%e;F&{$1j}yp#Js7<1Kumbg!zA%_h0J-xWtqfS<57HK!57~SShV2&(v%S`(_n%0kn zKh{e1tKA0cU>expqP|PI?}Q$k{XP~`lL&To;AdCVBpVfr?) z`7fYU^+L-McfE+)mPw62XMAORuVvEHEl)07oG2;1`#-zv>RjJfKgmW;Qx1Aiu` zlrMRlkf-a*89R_0hLElF1VOrT;KnteWfDWX^AlQ(z|fm7wiADFmzeb-r_#lnCloSv z3paQ-V;+hvz=U5$O+>ntIfxZ*W%*Fnl){IRu1I@0s%NnWSf6MqJnz-M!HYz*9@>$2o~)*t$A&{I^1L_Xt(=)YW68>u()G1+ zpdMR>HV4Xc>uQ2!^?|%?8!F0bHw7fUefoUbc=$XZOgUIlo(|vYhoIzPH@qxRe+vK} z?fZbNeVCSPsXrcWjJ#TrOC86O4yM@lYz)n{J2@vEgDC=ZN#R#4^kXZ=I0A$nMOH2Csrx44K(BjRc z6m2s1Il~>MKg7|Q`yDXe^6X~hw1>u6$>IJ#=-JK2g4!vR$&52lze(hTUc&?f8<)~t z=pY^CVA8P}JXP|piT0&%$inR6*m@!lH&nO46 z`+>*Oi9=dvbV z+0lzR$sVOd(|&OU7Gu#@`WaJRkG2wBHl8~cvsr+q1F7VFe-Ta(x2hf*oGos8sgL}F zLAYWPr0EV+#TTifX#F${B9Io3KJBL{o$LcRMNLKhqaX zeD@Xh(9G6B66hjV_(x{_5dCb825x#%RT7-^Y?MmrFu;_z!lmIOCdCs+Bw*WA2L?(_ z9r49l5cZuC(lCS^6wExSMG4By3B`)fr9BC=4X+jnFzEo=6Vz3*;+K^bv}OdWWDJ`a zD`!4}^?(N5J%uCh4Rrd6M{|sO+cANS{rv- zz{XIuh@+j4Z83S5gj|07<)XOjl`;ZvfF%k=O61y*F zB!+2@%F}lg4AMp}F}^2zYn{J0?e8cy7>M6FhxRqegIU9H+GFK(L4n>r}b~Gz$3NcuCN54r8s6CX4#6{XGed((YO?g*q>MPk}PLI(7$h$<7F}BnAv?AaIHsIyZ z?$a=1qJ4s&P`q|9Ox=G=Q6J`4w+shbSdxWg!r9%dF402&*y2ltL*UiMkO8Otk3KJ- zkN0VbMyg)mIdYKi4(G-(8zof64?O^NM zeKM`COi+izHjHNOwsM)$E6jsf@F@EW@}-{gp93h*)nvD<{)_H_VLF04F9!l6Kz4Fv$_~QG}!(I>8lD15%pzr6uNd97=oP zLZxahRQHZqh-QnrZQOuj_sh3P6+3cqh1=NX(Ki!Yw<*7IsD5ThE>l#Uy* z-rd9683@p}h}#}*1jb<9Rmf#CsdlQ3ZWEaQFCd{<*Eb7*^!$BWEkOJOX+oW*^5}8_60yN?A>L~ zZ(?-XNrrwAq-TsyzXUpr`6V8o#-vO0;3F`l@Tn`YnffM7D0~qY>Y}j!!kA(@Vvfi3 z{hVy03>tZaR37SAD(J^B$>P)27=k&CJ+GJ+OW28lQJ-BfOVI8hmEvNW#VyjN@;t1W zTsog-lw`jBbP`$ebK&o)4M|Ith9vBhxGh0l!36iJa+@i*Gas6QyFYvgq7!1e1YPun z#5A0B;Z`wS!^Je-5YxBy_3wk>Bf`I%?$npx_A41yksopIo%99I%>EqnY9~3A7*A~e zI!aJ|v`2Iclmn(H5dy>t>o9byueq{mKWTNX}fsscW*HPs5_2% zy;wfUc*l?jd_-Ro7MI=w+U7p&r{xQ$1)7Ivfh8NG&-LJTD5h5-X;`@K`49jj{oAOW z@P}gjB?P-4yOu5_*e4Lr#v+FP_3#O;H*w+mw}6kBF|QG+e^KOnx?lOCyJg!I-!()` zOKu*>*rOC4!+z@*tWv&*q}<@bj;!rM%062&_WyR*zg?{tAIqe z$4`vAa9!<2yuGe0_P7APRFO7=Pgh214^jH3r~7RW;LxW%#7P(ShI*i{o7{u~yjpJ% zO(4S1_^=#wM-~by(!SGe$VoTKcLD+#(BQ$R-D*aMK46|k_;($-E;wUS_-&TrMxKH! z+*+6vn{~b&9p8l%yc+R#p-te{ITjZ_-}+ZRnkJz|&bP9Da-tQ5eZG~&4?}#!eCrR4 zBBSgdga3|UMLbmhIpER0fu7xb9Vj#w z1_kq%c-`UXT`w+gI@L*&Ej_fN<{Uq`XpeshMsE4sUqB^aigrAa%~Cdf8oNc`Oodln z_^60Qgg;{P(dU0KP$)r*9buF(0VUAXzKZu)v@@tbH010Tb~s#V#6B%zzkEtfRL5e@ zpuiPAskdLg--K-k@oA46UiUaO=h5m2dSA(_m2pB|#AjFLaJhaGyVb>BFM_!nrTa@dA0)OymzoaQJOjn& zlA~=AT<~up9#LNwQD4^B9CMsUdtfx%FtXP&-p2Trz44)z(2~poEUe;^i5);&(m~P; z6vbZ^^Jrg2X5|2y2g9PfpK%K6L$7w_EXUt#m2cCI_(2ofOPad=+SESYF~1J|6!9mb z$NTtv0Bj~HY-pr`jp|=h6R}r9qFn=6f(W11UILBT2jyQEUyl0D@gKp?1xW zw8}y4FaS;G1{NSFrUfI1ZyQ#)r~lOBhXO9Mrxw3Yk-h;Xh#b zOCzU80HKbMhSith&5=S^1q{|g+LlK9ld%bBQ0VFBY0FOdr))SLep}2>MB866jg8^a zg2rf93tVC}4}~b!;sC{3M3@xO#dkF*9bWBP;3D(c9y*Bq6wmPa3(NaRAS5)IElXqi z&?4Ypjs!!=f+1`>_Gq${d+iI4^=<{md*PVfb;nzh& zGUmfzpY(se_hyjlawgn-o{YT@zh&fDi))!CBN*phHh zOOm4Aps#H`PisKRVfcU_{~n84YW^`=-fBsDG5f%lVal(sI!L=zr(+wJnyF6qX{mxJ z$YOX}yO6I&YeZZaJI?r04O`5gVm{~ZkY~s!;tx=Psu&XJpGcsP*z4g}?B!u5 zhg$&B9rn)GM0CdEXtss&{anvCjM_((x*KNV((S#zUq|fN-OQZ60K{5GZn!$ut2HB! zUb*r-dMyrb#i=6-w0z*gsBZC%7zi@`gz_h1cP*6vGDAN1V>*g!e^0AELu2eWyU-~)mS4PGgZPuI*)0y5OUQz(NB}{#=5rF1TpgfQ- zmd1L?RcYGM8*|49_G(n*8bqaaP{o__6!WwC+c?bP>xK#Qso4K8t0`-ce3_4S0DAa)mCM$M^`T`=T_3>A zV<%R7oRWtv(`W2Fv}e+~S1ar};WIzlue1 zw5D-{uA3!MqFeQr@tG2(>*N4|Be`DHjc!=2D5|0-JKI@b7nFxxw z;Qds5Ix9Zys3;o^N#DXq^))E;K}!)PCynjvZ=w8WXaw1Ml9y8J8$KbUAylw2!?u9hy zwN1PaOM{veKKN@@-ZrJr>?vzu-OQ|pPwDHW%#L3$7H~cfntc+)m%PE`!gs(HV^=P$U@4!>K*2v$ zx6-bW@l3ypwChBKoDAdELs;pB)>dw(m?{zMW>?2jPy$oFl++XB*IJ~Y_eI~)R{x&k z+ZVZi!{{wkv##-uA)MV6;5`>Rh@e07AdM{5Bh!rJQTbBk zHQt`H*T!S-p*KN!4X)@%*a3#iXe_Ms`aF35=(k)MUI1?i%135RlTr-wXg`H@_BXe$ z4gHQ)PWU9_-=|?xg?tMdu!g8Q&vn=0VsGEt7-Uvn(5^vRc!Q9K(xHy_YMTjsut;mb z74Nemme8^lZ}Kerre@p|+}zp5&uZ-?S&^{x;5+X>RLI1c+g z9;REc*-g{-JUzb0vAgvqyd?-ra20&ZgP{r7njx)*?SAYz%=z*`AnA8s(u0(6Md)n! zH|n_iaGTZ+dA{@vLE(nvsO!EG2mj~eFoq;ZU${F3*p$<#2yDht&X)X~dP`*_LBn5R z?V||nV@QA*3Rm`94Q{(Xr!I<9K8iV@#x(7ZkBQBGtNufBm~H+Jmc!`#9rP6;@v#pg zo;sd?C+XW>vb}cY^^32|%`Kjper?{eYkkXCF2DA=)yurs=3jrqbpVom_h7%qEy2xw z9wxg;{iF45@}Q*i#qciw{224Ju$?u&L&B?1*fAg1bt4GLiO(qvZr+^=DwM@Z>bND~ zcXtknqF|D;D0z1dMJ$@uv1mF-?AyHzG3vOL_}{UJjFhA-N>vInuq!yR+D} zclSJ8JM#7}!mlImIeuy9mqYw=m|tGzmri~;Mi(XTjP^1HQ?M%=QQsLLV=BEL?$NH~ z<9)1`=EfBP>%3AXGWH^LHc*pN8cENqHMQWcP+ngiko@7ep?@ z`flFdsvH^_=_0%rML$ElV2PKtA=ypstMT@6dl$*0V~#A}ex_+|RtQTqXst&M4tpsa z)?P*Oi2k&1>bY;&?Z+gW{pg$Oj(CoXc%ByVoD}hVKB9anB0fIiIVIvbIpR4X;@K7P z+!leaC*pZ;#PhL;=ldd_4@W#d7xCO4@mwD9{Ak4U%Ms7FM?Bvj@%%`{b7#bJW5lx@ z@mw15ygK4pi+Fw@;(1-f^WzcEcSk%|M?8BXo?9cHw?#bfiFm#%;`zpi=cgi`cSSrO zk9a;A@%&!Ib63Rkp@`>-i073N&q3QW`j3+CH-Bc#+LCo|MAwLxDA7G#|0jQKIxQEX zLC`6#7fSnoasPS}VBcN@S@-PX-%`8<_Y|fzN>a~GN!rtd0B@lcp%c@bt}*z|;C1-; z-%@;Ckpez!(+b!ggdpNQxJrmGMO;@N(jvYMuwH~zEPe#>ya(4#EKs@d9!x8)IkM7SFH;1u-E04)gZSK&StX#j6SXvA|Do>OrjM4)#b_fXk$0hif|pmI)qw;uONH};W30m2wezg5ysqw^a$w)ix5^JtV3u(P!JwO zcoyL>!U=>A5#kg{nt*UM!eWFQ5o!?bM0f;YKf(!wj}Q{SCP~u~mLilQ)FA9axF6vs z2uBd!L--rQcok_879*4(+=g&3!V?J3BfO3fMu@#zl9CaoBP>GjAp{U^Mff*_-3a>- z-bLs`nA`%DK=32ng0KtWdk9Y={1V|f!g~lGB7A}{^xsgw2on*eAY>pcMz{fC4Fa{$ zSZRW{NJH^i&SBDUX#~EQI8quVCE|0Qqopy@SSd*whgZxdNXgPf=@RJ+(j@6p zX|i;glMYeMw41!%2q%W=ON7*-|FPDB02+ zX|6O6ioHNuDCI!$7en!vNO{syH1cKA^-#YRP`7;P25A+(Q(A!L=95-Sg;J4JEZr!r zk=9B#N$aE%>1N3~|o26>02A_Ye!>3Dwaz%Zhto*v% z8Rga0;wiVRc0-`LY<+cLb!APUytu4Vc1BsD{xVsv_m>A6Vi&8z`tR0S$TQAvn+~f zsJt~IPi3viHs__`0=yuue_jyTA1_8!6kb@IgBOBE=S9TWcv)XoUtbw;){cPN*c8C6 zmMZt_z^HX>jYCxj8!GUQiCL4@=xB&onIJndAHHS`4K!+MLtSmTe|>#jS^0*t216J9 z3>>L-3~0l}APtq9YRe)@lu5g7tg@sINL0=#DT|20wh`x`qhE&63N6i}9L;aLzt(7< zXj{~V41ol030as4Y_n)8$N~Bdq5Aqjt)+1Q97P2Q8Vqcx+*rB6C>yY?Gt;?Uz^g*# z)d4FZRdtoMM$*lJ?fwmR$_WJO0~Tg#Liqf$!#Z%NO+Xw(uPYfCIEYnLGd7%H&;T(EE2axM(U?6Qr>PcH)f2JHBtHfql(fL%mNWYC{8U1#I!KJ$9?+N<338=TK*Vf9~ndw6HsB462>OY>F zE@wQqF#TrNqpi7Nmi(|z{=l{kfuLMjSL<&G)NiRo13*_$P8v@sf^|XvhU!3BZHUY# zgM=C?3=k7LD<)W9SqI-^yT7Jvn-mQUOJ{)DO{h9huY*JdT0q+?1J&hHL!bt@>KX#< zPV`O$1?gMLszW@2RUSdnzXJ_!f_3QH#EriuR4rEqt9fFxqoR1!DeI!>9#vUcyP0KU zF!EXd@At1Nfz`&!5XOk#!m#lhpp=6CI|JA`JkPVh;=he?$vq;4^O}RWl?dw)su3Cy z?nihW;SfS6LKi|WLfpNQGzlRUVHv_YgldFFga;7zARI#ILO6%ux)1Xb2w4cr5Y{17 zBixQ~7sCArk0Z1r97Z^f@E$@hg7i(~N0^QveoJt_8leJV8^SJxR)hx-9zocHuovMF z!pjK95ybC3+@G^N|L^2`QF-|yxvmEDA(NzBvNFqAHYSQ8$#;5WY|8IhVPjvWI&r(s?KB`f}v`n+3j_4N4{H zGY5<%l}5*)+&p-_xiI^B;>!rO62pVM`ue(hOc&8JA%)25;UbY9EfFw0FWR_~Z1DE{ zvWCqRS4VNYtlTCgBG&C;9*CZSN<6gr7q=c}yUR2|?k zC^JR!`!QEhSIb5{l2kAG*9SIL*2+w00^5l9R>=?IOvt@>uCK4Hqqt`!|3>Oh>Hd}& zco1?`O%V5=#gwhDtCywWv1k~K6G<8y%aKfs-MFzDP6Xwd7Q2x#w>B0uY~p!uimfs7 zTp|_w7THx1b3uUFMNUNi%Ln6I5;Qr4UlM5kM?+1+mJRhXn_iNpAwPv;->Tdd`X?%= z-2XK{7y4>2o1Gd={c`GKsXt47EA>q3@U(GhbJFtChR<4>eK`Ar?94eU=XA~eU~b&J z;q#K_O`7-4y!`nu%ztzKpXbLcSiWH6f>8@+EW~LqZuH|Q>!#G(QkTqJn~^>1(OEIG z$IM=meRK8;bG5n0=YKN)>V#zcurznXk?KbmowZIT=dE)3cAveq(me?7z&8%^Z_CDf7zA)XX`V%Q9DI z-ke#HS)X}(=2tTx%-oy#V&=z~wj7o4N-) zHH15d)0&$4gVYyNzmqmR{p$3mXTC8roH1h74YO)ztzXc(;6E1}Uodvz%!RivJh6}t zU^4V$%eR@1Dn z&HDPR`)54}Dg5`WU(EUdvPhhrJlj2c+U(TXS+jFyKQjAAv!9rqnYlP~d8RjWZRYyS zD)2ESD?Mv*mN#pCR(;l2vhK-xDC^0r16fD2PGxf%uS!Wc&>Nu`nmOU@0*JWS$5ivn=0=Ae*fzvFk@pSMs!#!LHG=-&6{FiSYaL0 zW}xG={NnWc7&LPFC{eT@mZ;co5dKquWkqlyn2=d`YD1uM21yud^X?2KvXar0@@_QM zfXvWON<${3L0K_{xFpe|@e`+{5g-*EC*<*tY2A*CU#0`iWY?`<- z0m(5SLaLk#R?Emg6eXL#i!D`J(&bXs7Y-r>djlv83JP%_?N<(XDjJZ<*A77T*dX@; z(mL3h=Es0^+8{3i;u>O2^8p|^2E>pLqle@(6nA56BwcLzEJx{FK776|LOk$YF_sq; zg4$@mDM*uwYBc4O4M>*_k`IU{-kPQakTx_c$~8z5ymMT{dm4DZ!iMf*^InM3b>8{p zUIg<&P}r_h*q_a8LK^pQ!I$8I=OQlt9XP;t)v?W;6TmwksC@W+ErLjTi>+kJ0$Ywyg zY>*~EsFO2w>^}f0)gcrqNk7A-4c!&jD1saTgm%2xb&N}cY9}96L*BFbyV$j}1x4$% z!{$;VR7^Sr3TfXB<10$-2#w-th-R`_s2I!dV$_fi)zcT!;LG#AC`ptHl1wDKIi86f1pl4Hc-TE?{Dh`aENlfOix8|?Byl#~FEfXgR(ol=@hkS2AU-gXEeO#_5>(y`XWAen&l+90a{p`CVS znoWST+8}oTvd0GbE+FkXgm}YlC_vms8m9~=AQ?8YS$?8jxB){45M4g{*~OIR^JMrE z(&#dzHGGE*rboo3 zL6UdD7g<6AFn$-icHTwFymo5qYJ-@&q#aw9I!XqGU2dJ`C{~mRn~gNRA`Jng)qqHs zTRCk2#BGB#1Clevnx+kqRvTnL+?LDYZe!scpAGrUKGsgUkV> z%?2r;TsE46fb@P*;1YGgd8fK~8Lecsjr)J3E@)B=l^NY?=~jItH%*yV&)0g;8H@14U$YNn_v~cL@snsjn{~jeEA0ua$t5+8`BxwA&!N0Kt}8 zi+mmeB*zA62c*#kp_k$5RY6m#9|BTpgA9Sx8f}otfV9~l>43Pht>w^H4}u0n)CK3A z)df^P`s{%lBz<0Q{`a&Un&07V2Rldjny{@te4wyZP}omhlpqbZC|l%H1xTq4vK5d$ zHpouOg+2YIR9h*H4f0(|g9#ur&5r@`*dX*_k}ezMmy`>;|IJ*TfVd5akTd6tPTp($s!>C`G@K~D~&upe88eWhif&y8>~>Yc`*dc9*WnUxwYgp-gMr>B2U z_>V}FiZ?M#IS_qLr@v{6bcI~V&rLny> z%D7+yDC`szB5kx^1JcktDV$Tm12>U1Tp0VUYH0yde@AG-jj2HS7Lrv8F z6QhzggZE7vHq?~a47)!#gPMfoMgTg!7Jf~IF=_N~=YNkhsUi)MOVVEfNx_wuszy&s_f}`n}z~wG)gx5 zL8Bbe>t(j1G6%ELh3!2D95zS>v0#JDUV=v*qGL}T5cc;R*e5|0He4Ag4(xj!*mDMi zU2|Y}JFwG1sy2FNA97<&$n4(xFb>T%i_VbarGU6g3vsXK?w+;yVVFz|<{x(iC=(r^tWOjuE zd)t7pcRH}gJFvSP*mpUw?->yG9tZXm2lnX>>@;hrOGCFd?E}Kz<-nfo!0vWn-{ZjE zIUwxE9M}^a*pnRCX%~u}_pSk9KkmTpa$rw(V1K~GuKOgjkn8hC9Att4+`>AQ_Je$qUHrF36eDV_?S% zEu?txlN|bU0srT52lgHZ_A?Ib(}CKKoxTF{k7M8Fz`oakz1@L*9n{Z`-8~@e_c^d1 zb6`K|z<$_)J#|3XS39uZ=fM7e1N#Gxde0dU_PZR|4?D1TIjWXJM4R2libK?2{ZVZqIB2ljIg?41L`-s-?k`?_@-&U@I5;|}cYj(YDJ5cV7g_C^QxyBye4 z9lZAr2z!PDyX?Szy8}DzMYs2H_^{CcdRVsud#M9^g#-Kj4(zT0VNY^kU+uuY&VhZM z1G{@b*dKLZ*Bsb;9oStEyIu0B1H!(}f&Bpo_D3Ap4>`0hXF%8|Ik2yDU@v!IZ*)lB zGa&5M4(yLRus`L%PJ0LKk}n+)_LUCocRR4(=fGa=kbH1J*rz+NS39uF4(y!{$u|xN zJH3&i%TQlW@i?&G=)k_xfxUG=*gX#Htq$z>JFqu8B;Ph5>{$-%+Z@;%9oXX>*!K(w zd(eS>j|2N&2lgz7&bJQ;`!WaiyByeC9oW}7c<&q#_GAb48y(n79oVZKTGuro?6L#< zQx5FUIj}EtNWOPK*q1o4?{Z+j+lk#FdHOykGX8_(_xl~#k2|n;Ij|ph@a`HA_6Ho; zPdc!_=fM7+1G{@b*dK9Vf6sxv$AO*9qrI0&9T4_52lg%pcFlpk*TH+vfUxg!U_a!* z{;~u6T@LJ?0b!r!z+U0N9&}(o0_G?~2KVm`S#9s?Q`h3NAoJ$!t zz)bQoA&vfLQ!@w`F9!-4@e_L($SdeiK4Ql8pU8X0xeL*(`&zx9&wJ(`p+7NLu#fl& z-tRVekN(E@1gz|H-rdpb%b^>?fXQC@7fm-d$oRUVB;9A|A=RlJ7qNL2XcjXkXbku* z0EB*&mP1Ma$$0I z3|xNx(Hbdd8PVg`bG=R_qYP>nJQp2XCp;?-8H%?ydu?f^03v!Ko+cBJRvUINAY$c_ zr=hn$y9_S;`p0wlI-{T`gfwS#{o%P3K!ok(kOu$}Bh6TR!GM3*$7ADbAJXL5=s6CE zSP|ppoCYL8=bJ-51%y7JK<5B(ND`hTNXvxG0EFt_ge(W7)Q~f!F9JmD_v7W%0U|s` z4*41&!V~6@?*bycQx5qlAcTvaIOGr@lASL=G()P0mHrAyn+-An@6-yPjhB-Si16My zWEmi0-HJm>0imC%8?`zFh3oWu0}wIe!E-%IX+VJ~pLRfAw$XC}5ZMMf3y9ch$;%mr zt?**M1cyuj3R1;^FN(%_6ELl55t zM66}=G+|0(lXJ{iaAD(gG$7SBiCqbZ+s0`oAcWS$zJk)&%Gn4=jxE=%lnXx;uG4%! zAm?qkega6VAs>8>i{-HAdJbvYY$bOB;?Yaxoc;z7LS*XUhg7ny#hnM_IUDvdBvK=d zU;lhps!5ODgFIrSA<8BrSB?$W)qsf67N;i-zd9JSmB0N|Q z`92`WY`LBT#Lm}CfQT_Z&!qt({4rQR{ZnN@gD>Ku4{3UBHJCIGV4Iw;0i?~AW-%b= zZ1fZY0u^I5%&~8#a&T*E<{f|>w&l7XkVkEhrvVYWk9awU0BN<+^A;d>yZRv@jW!DZ z2FU$J$*}zRU^8!D0P1>}jQ3^THfc-+L;dqIq)Rra% z5V60G%Q+p8JvN#b10wcfL4Wus@1!o9G(1S-Ldho0)qv2CO64Vg6_8dN_8$V$Yvb!V zKvHek-vY#q0?f8^8W0qt^F>ukc<4t^j_Yqov)6`ebTUg~k;W82R@%~J=xIz`*8|du zj3!?dj&gQ6AP)f2X)F0LK-z7b9t6Z~vm{3WaoN&z0fIk^4CC;|bE8o*zG{rGxT9oS zUAU3vb|VdOJqM6f8?NgCS!YXAK_%O;)BDyQTdo#B9=GLs7?1>8?K}xc(3a~UAjfUF zUI)ZwOVb4i{g6zr!C1V3Eye}VI`$FCoQzHzg~>=Gc8l?P{~{n_Cp?GDqjFHHS%bxZ zblM;?Ams*y_u$FDq`EpEo7Qu^t9^1=y&MYWq^094kd^ffviK&JAD@#nA9&x*Dg+ze z%j^6NRn=8~_Q__yeqsiFx4J$WNPO|xo^X@>=m>ixzCmd{Bf}nvoaS*4_9*1*FG}QM zM?pl-6(x#tvBNW*IqYEl^Gp%^3#dZ`B7%LQ+9+FxMiHbnroX~iHV`a6)gHB2NXQWn znDz7RMm_`1zTa+uEni1BVEWh6@l2l==TC46@r`&LWc>!Y09ijmZk8lYk+3V5ae#z_ zdm|qcZWz9}-I!Wbwj3ctOoSVHqFcL@x+ctF!G6dW8aVU^OH3!k+#qG z8*oS;3>l|v2zV|#w}igKKp(axZD6IE;MK-~I*2oshjJJqCva_GtC1Vuf`_*nQFR>V zs5|qt2)ja=@C#&#rc!3cXgXz!wYM8H3dKf=!VCb;`4AG)d1N{eEkZxCATqgrx`8fB zhSJ}Uj_qWU{i0SQPS zD*T%R^|gU&9D>_V7W1Hlhy94QsZ z+r~N5%>*SP^*4@F5g09&+>dWO3os453UT^`j?`Nh!tqam1`(~7vpP^;Q&~#~`+!t# zU-aWl?5$G=I+|wWVI>izFvYx3CgMmxkttf%Xf0YNML)A8A{V#O{lw`fv_#F)Ph4cH z){*0Yi+*s>(HH!f8K9v$({uFG=0z;C%3JI0EuTpbB48h;2=e2%4B|zb??2MW$<8P1 zCu5X2j_&RUpHsog@Zd-!v?7xj=_=Z2uqX}#Sp)$^Z^OtW; z_t&ux`t#l$?<8{=PN$lY2IZ@&_HW#Pj&1u4^lJ1(j@gWvqVzz8pChpFBH~QUWJx)n z&N#@@34|;OXbkE6BrwT;oj3tOoOVFHn&0m&ykYhA`FVbiFRyUPD!(^x<*Ho&%Ikfr zG4M|9U7l70qG8vU(jHj?~ntzN7ffksSrIA&tN&2f#`)a^y4P1=VY+XlBd^a+xRG4t~ID>M^QP&UFKjrCXH zNK0U(5w5>(BT1FoZCyd0B3SGaD`>!(Pyd}_;Eh) zQ}Nv)I(dfVZ9PfGq%Fd}*p72CQ`t^Y@n1mMjQX*dybGI7u4NHNx3D>V?kM9R7cxS6 z)$+<`hK$)sKJ_1I)gYZ*tC{3DA}a^gvWO0NVWpAwio%#EBM;W$CXWmX)x%Z{ZZ=b2 zD4K~b6YCi@W*dq)2!TH?<>Sj39dZrGmglO!TLeUNM_2p*4h%}C0Vw3~mY~lS7 zeZi91l&F5_j!<8kwPE&FE~~`I2s5gf#jq)#&X{PuR_$OcM?3z=R6l*KhPv4(t)H7} zdxMGWR2dTR6_K6w?D$-=;D?iGF>%HjO^g^@-y7{zEJ_tsaiVB|L5)QihDp)o$!9>! z`rzd26>T$=*1k)qmg#7i{TTInEWZD~L|-HIM_PWKPhV+_Y;rb-kF%kVea&v2x?)ig z{W%pTuX+m7X|sqZo&hhCZEK-#(onZuSwp7L(q;2BFaY|=SFARxakLiBL*7_jwyDAF zkZirXXzpUph1$E`GmBAx!|mes+myJK3?A1HdHQMyv1^vY_aadZQMHbVi91hrRvm)*8s5rvQZ!_*9jip&eRyU6l^A%BD@O})%{{tPIsY3t& literal 0 HcmV?d00001 diff --git a/orte/contrib/win_pthread/pthreadVC.dll b/orte/contrib/win_pthread/pthreadVC.dll new file mode 100644 index 0000000000000000000000000000000000000000..e777c73ccf801a59af41ed5d71883c63799b4228 GIT binary patch literal 53312 zcmeHw3w%`7x$l}VgaL-k00{<&7-^!son-PNlNSOZXowSr%!ok7kc=cTBq7f2Uy?D}J8FxS4Ig03{D}I^8_Kf}Am3u9f zzq@i(V^e2(dq>-bj=GKM^>wYSZ9@9`Pl!zT^g9`o^|~(1HmQ#%1V5A9Vfb zwmYi(W*c;}>geoU+<##9V|X@J9hv^k+QTQFtg0e+k@$hx?7E=5_64?Al34@JOTz zo_d(m%UBu#eg~ezA}=0r^ry&Txp@2nA+%LM^sM!8h`)CIiHGr*&e+WhIvVPPI>tIC zBlHds0{IgU za2`vBbKg`rA6^eVrchHSQt>TRdH&^aPEzH!Q?rgQhVwSHt#uBZCThY#YPo|7oraz6sTwNakp*zp zP_|phyNS56Q`@$Xb8-osKe^!)5OhDg5>Cl1INPp+lUxYr25Q?lYVRK??<+X5IQ2w2 zoG%bAZ&5`>6XBd+4reBDzm7WPLBeVjHMNQwJ(YM~LhW!+9fi~jDJ5{cRNHT zR8(LooJVuvtRN;YOn~!eYRo<=`A7nsJr!`SAWpwe{gz9O?xnl~l-Ey;@16nY9zuM} zSjMpx>a$^UJMWx>}yU_Q(k+NIl~97-Mt94^U%jFc=VTHywHQf z@PL+LOsYthDpLE|n`-YtX^gu!*mv)czmZz&mxT-VrG)8LsZ#rC2$@5kMD;8D6>E-cyzAtyX>%2~3pS z!P+%_0cGC>jaO$yN4dR_#+><6PV2eo16J0!|EW zN9LD$%irDW*!3OoBfGlKId**&Z#6xwwt!#0ovA5ybO2DiTrRg_EJ%r)Z?5q6EZOJu zDtkB+Hu>zpa-Z_bIkco=))Um{p5Ka-dMY!L!RUV=m^!alNN}I%S+&o(Qdz-+tn%6J z6Kezq7@)3G_UQ@FiPN|?3e0`Bx<*a8@mtL4e%^Dz@xX!WwL+fh$q6fAa?~(le zW^1#>eNK}r&Y0-Hz_L9~O0QN*koWh=l^HfoH%S)xkV%1<%SU3X-+iw8h%iOApp{Oq zlob&r${o#Y?C}FdETnLWc2LzQYK+Vz3x+ArJ4F0qjX%miQ>J`r0Mo`57COu!S^Bs( z>ZdNjI3!{2GxP5cC|A9Uo;wT4{4_?Ny;~JVhgFN%>g%aZ_bC(4BXUVbs;0b0%T*Z? zrW2_vLoAWYXQ7&W**`C^QcX$L#AKFSJ`Y216zcN!muFDbYKjwaKBe^?Rc%gCmT4XB zQ)=NyvF_eA!P>r{j+2?ck^DZtatq4Q`Cpr14}V}0tlcNX)<92JdO)d0ZA18wrtq!d+P2=fp4kdURr||?pb+v7-&+OlM`Y4vWetA#EaXh=v zi4*ox-_`CsNa20`P!I4j#e#x?*aWT{jaXkz!0T5&LKI|0zTi{-OkGhvD|`@o_em

)ySL9W%1-&yzk&o zgC7+-qiO?>wIMYF9^O9mwPhgvREavf>yVaE5L?Z*I01m3GJ*1x+epfLSj zWg1weX_I7WHW(%i?2r@Tj+Lvd)#_11$$lG8zS66_4fG+@!_?g{ePeD96%DOr=j#qB zQL3`aDa67`<-xP6DwS(BfT8<%4fcp&UPM0qjdzg7hk|xd$3P#-mhc5tobIny`cNV< zd6uV9Q|3_$s91E+=zXN!OyN|8nP0R26V3;bnP6CcTHgZWX&l>R4Ao(4*&#E4IY03G zZ`J=)zdzts-RC_0qRr642zB~A{WZenGV}BcmxT)~;v`Iy$xqSpcAeb6M#_ecX-*%q zLi3#06VY56Nz~KoY_=jfH#>u{xJlx(uykNV(M3viArqhi?UN%m66(0Zucr)jR8HJ%5&BzHN?bmN`68dU!y#v zb*FrMA@2%tyzEbvQm9u3#>(Ysa#bpJqzie6QCymoLVZVZsd81CRFO6)2+`drWTav# z?i{#A*Ak>(!lkNc(-;(~7Hf=+Deoky>c&WnMU8NW;QV?2}8VN8owd7VvK zi-FLU98ezTtn&d9td&Obp;v3`K7j;I!Pc{wrp|#TjKxLreoU&xs;ZWXtN9S0fTn0; zD_I|x7+tarf+&rn5nOJSlja`wp$}eGK0YPt>M!T(yMS^ulGYA+N~O{)C=JVLF(Z7) z=~wQHBrvL_brVnMq-s~NYUR(7PEW*akt!vaM#pe@yi`2R>A?c+@r|&r2T98`5H{biGZO zBrj#212`qDu*qe1X;~VMj*bMHt-i+oiP#vdlma#>AgC!XP?1QS2x+j;E5Ku5lw9WYV#3LR2M^j!oPT-xxpm>!-whucFJuLjZXk`} z>Q=i?2vdC8`Vc%OBTPOdE!0H<3t6d~uruW~{W+jN|BR>dIn5)h>yUIQXaxutNKUXbY(6pbvwI2VVt>G^eDO8( z*7ghzCT&6z&y}}Z1n80dh`_$%a)G9Z&B_8m#E%?q2*_RS9N+O5r1CVWt6fd;f+M-O5^i%sGwZ2>eyNrc)fd66 zCOPz0!PyRqNrQ_OI`@`SIDRXY^{4^x4BL>I`5Vbk-zPfRp{LznauU?rW8>#syW`@ymiQ)0UcXPEB|IoGwUzM9U*QW z$}_abEaI`hJRNhNs-~>sh)L!1hG7@fK_>ANSuYA3U3HCW%Wk<@6RldKm zmqg}Vto?kC#y9r!lqS}GerR~C^3D8G|JJzAV8S+bv+Mdu4MA~CrVW%Zf%dZ4=<-xIY{zMW%eTu~-Qi|e6%R8)?L{tp%ayr4rEZbks zr9dg?{XkpX%l%K%?4@gc%>3vc_c^0rTuR{bYb{9$>NG+>7Eg0~NAmM?8SL-rV855z z#FzPx;SI}tVKYfFt-+z-{vD#G-9$LL@1vAB)d_F2S{&VB_#oAGsbr<{y_YE&Q0Ch^ zRh%F0#ZACA%8b1nS{L3=ZMs=&lO0EB`gw@l5A7}`@`v8vdTdU|&K#6(i zQ?w(C3N%hA43I`@|48xvW=ug*_W_Cy;!(j zCXa;M#{8n;)rB`5 zuOFbfvO+wc5k}QQ8Rq!{gNV%>f|z5M2N{)=6RH{nY-{9SQwEM(v7-Lbz-JF+j2?zl1aCm8Bu)>~6|!U3_YqkkY^o5j#^wiu zvy7zJU}+Ob;7OV^m8sx`bj=0TFJd=JU55m8TBqkQt}VBx1eD|d#uEc&V_!3CXkyyG z>BTEgAu(5jVO16Fdh>XtdLEoCrky&3sc#5!khOnDPJpH}pxp z3!NX*KB)(QV)>kgHS1J}kXIfPEn+tZu{5yvLH*mX`gj`P;kaRM_~q$~ckWN$J%;4` z{Hr(*#OiVX8FD4SGNjG0^!+4yV{Nlp?IU zw4r|;mkA7g(I)@9wlP@PWfO6RXsv(%i`U|iMyj=A4M&rdE(YDb+f(^b$ek~mB`Osu zx%lx7^AlXm`Kxg+Xf*Ot+c&5Wg>5vpg-#mR)ga~p9O1y4p~8yI{1oL|s06^#Mp5}9-f6+yhe&-KlwRv# z=TGf_f0BG)zjDQ>qdnHg_z<|Gr|37znLj`a;NqOhriCBPF&VV-yjiZXb4$TaB`Cw>L*?b3j=HKhpA*KPE3el!PQ>n$Z~Myc&X~Kh5pGRDU(p z0gl6V@V)}FeC*=r5~2Lg(OjNiIsJmFHo6{$_BgAi*f3feo$z=cYT#@7G6Zz@K16~k zrthY({?X*=#22j4It_^KA5Fo)j}6=Hjx2Ax%a9iWP+@G;uLL{B#pmVWt~85ynLL3u z)!2nAb~MYcyp1H#e9BMo0L9ep&_aDPw z3wqtJ_%!}BwK-(9G%_C5etzd+Y`FO47T>H|g_)4l8R%ZCSNS$EL3gWkq9HHB+>DKY zReU-6zT{9XZB@gsjE~$k#~QC@JZQY3wG+8L%lMrIWH%^|B3l+r^e_W6r#JdfKagl< zjnr5Dqp4ddhjQ+Dt~D^KCV3m_W?6a72*IR#8t;BNm$p#ars9~^gk#zT≈DcYwzl zUqMFo7_V&T4YZjbv)|xvBkw-6Y_eCm66gW9{?WuL$t}M{*WyMSal|Ucfjim^=^PmR z+`;)VclB4CVnlO!_Lq&!{-#+~N%Hz(|^^ z9C%JsmuL~v(J7_;mvslMETFt`l!HRL)EpTZOn5Q#Ka!u%e>fHK`ZRlm+{brbYCFi7`Awj8*mblI5QsH zKC}CTU${x`6wnXYJShLEbv4Q4!9O?93=wf11n3c_gW9T$nPyx0=*?C0c~Jis1pVz7q0bbsyo{ zwflfzS@hg1;(3ITVT?2m2>0!!11K!CwS|=T)x@Q@t4b!aZG;xcr})&{pEBO$CR?CNm2^oMvLdL^7#4=_LpSKPOEOL z!El`A!-`Ls5-wnvh;S_R6vbdAD`jEWH>a6LvzCUR_!()KUq8$1FXvj^;OdVM4c!Dq zEa<7VdVNZNR8X3?r`!hPD{!r+66W}n=QVlqD@XJf{Wws&1j2EkUMsQcR^@(JtDOAN z4;>o2Bglst&yoCu7wI(j3E2Fcp=-@dObFVw=5)Ma*W}ps4B*CS<2*gqn-A88VJ zDK`1Slhl0!^K^-&%^VO&4i}K!2VxL6n%l5Mi8Su%#%LxUIQf{wO?pBX~SEh{yE9L-F_qB{J}E zbl*eXwHe7UqweG>=}2UU37B;N#urdlA^{--D-~hd&JXAyP8_9{C;OHA4~+m)ClW+~ z)S#!=L8{TbF+m!s{UgO=am z%bj#s!>iV1jlU1d8oiB#*QLe}#rLlfeE%|t?}Iv@2ENY@#rFyFZqG=^!tyLn2@!O3 z(^)V;4%8?o1~CwT@~nfgP{urSag@EoQSRfV5Xw-98P$OL?LG}^d;lTpP`~DWo}fOk zQh5@QSj>I`s4o@2k<#<|n(UA8bp{Tu1To6)$k1wanxxTs#HZY>!$oUw*mQEGh1-l| zF)4fqAL9L9hY!a3FCXBI8c4;7r<05+l&29wGwVSfLo567BvR43Yb1Wn@lpCIroR5P zj;tXZ!}N8wk>Dcwx*ZLQ(${0PM$sZ9w!T*O4^c(`1}|+>bXD{l%{#Qs(Id#*zDxB- z;qg2PK37JE@un-ITQ&Y8%IHx_G^nq?2CrY4VI*>NlhqUN_i+d_RP1EGV$m7`ZQiN1 zO_P!3A2&|&eadfoH8@~qTjTI|Dtcd~JrQ%~wPx9|o z1dR`%Vi@`@$*^h1Q?9|iV=Voq<|HwC`J;{F6+5rxUBadj7>m{=siowPJ>U&zd}B3wsfM-ri@lekec5Bl1I+ zQS?#SN_iO_!(5N%U}La-G4S6}f&iSIyMR64x53I^b}6rFbpg^Dfby?`EGW)4MGpWbNB&%2FwzS&kwcR z+zf7wtG8d19{%aokdRC0Kcha>gf5yPG5Cos*>#RS@W#gKA8wkAzZ&FwM!X}yZ$ z+T`vtesRi>@@gURe8KD^m6d^I;OOvg)qx<^=1%ts;LUHy9nceG#N~Nr`%*ceUlSgn z>+`Q!wzaur&Qy%pUj z2GNigx-6w(+n^O=IPQhRl?1*T`z3N+AO zh8U8`=+J^SANd}| zt$O~7Z*H98c`!NY=f|XZB(MuB96anz65faVuZlk)_;FT{)AolDec1MNpQd z>jZr-a*TorF#0S6nejzBtSQQ^nt^uYHw#c5%w?;U$A2-nto#&?u2aE9D$aww)zUPj ziFkooA~qvpVt*oiQw&qY)RoHg$Fvm*j3J^*9MpR_M%8{~0nC68V-_>xajAY|e%r{6 zF*ab;F3buSjKc1!7wc37O#x~+WQI92f;`7nRC=v7t-S5ye86_M2_FMZt}9WAOW% zbFI^{2#?~wLYO(c@b`_v_tFV)Ei@OO2F>N0{m@u241qn~qO@P);G4b~!OBmnPSdvt z=Jbm4GyY+GA~$>L)23^D{&0#{Pdklq`!Y}tez^j`(k1FRKI?Elmc;nM52VzmJ28`n z3-UOy)b(Pit8g_eBn6aGtvPh#+P9BJ0WVv`FwUS`l zr(X=OqwSiZEIxrgHMfUfwo{|{7x8wi$0sVkM*V2PWwl&J*7SLm?HWf2OpyDyb+&LL za9sogJP2PQ4p{T#3ISHExDgVjEZk(nt?F{S<`>Tnkm*v2AHTwqk?K|chGvt7q=T!; za*_{X^AZ;uEM=)DwLQAgBs0Gw`SJagv3tPRO+SMOapP}pNB9D&!DS1kK)fJXI-)gO zI-|DX@~LLN202tS32rr$WKzu}TTeCf1@4mZfSO55Ej9Bncj*RK&7{j+h#VbHCoLS^ z2rbsNK%GEOdBR@AVUCfok|b%LhjsU^erOd1LWl=$38%B&zv<|#MB1QFQ zQn_q(ZL{S@-0I@m*N4wN{jz8e$hTu-DUJ;n6Sr*OD!Q;9jjL;M=I$Gj2bGKs_zkSW=_qd#i5!>8Wu9iT~ZB@N$!$JLngUPa;;{P@Q*ZF;_-0=;t0eM zh$9e3AdWyBfj9zj1mXz95r`uYM<9;C|49UJa1sBDBM?U*jzAoNI0A75;t0eMh$9e3 zAdWyBf&bwMoc7GYKWo$ezkQj}mZQc?{AotO!0SLaJxRbFo{J7sMyBHfa zi81R$#vX^Y)K-v;_p1`w*84|EqYu4w{FsB0SR&_9C9QgT4&9AO1qnRJ>Q=nT_YC@!SCFK%R#|?}7dW z{>$-v7x8&`E(J|OSU&toc>fljhe1C9{TTiyL8XYFjORBH_E$XbfZu`lC3voe|5JE> z2hU_YkD`AEsE_gUS5rXQpc_EVpgTcd0X+sf3OWh;2sHgJ@B&&1Y6N`-^cBz^&=Jtf zp!Y#j??!o`YS7J~EuecqUjsb~Is!TYdI#i`AUmLILDiu3piQ71pnE_MfgT6_4m1F| z02=>U#%6$WK+8ZkfjU5UgT4y-1?UCPTcGjyNNgsk6tot!8FVk`tDrrg!=RTz?}3u> zh3kA!IcP1Y1Jnch0jLl3D(FqnX#7^%bWk>^0<;#i2^0oB0Qx>?ALu#IUqOz~F?J28 z3bYaQFQDC^J)qx$PJ-SA+5QDQfM$T^fbv0Qpyi;IpaxI}s0$>4XoM!PQOwFlvqUzA z+1OY%j*Vw_Hi0EE2MmZNvPo<*OJ*tfWx&f=Dx1otvFR+0UCw6Uf83bJ$!qkIiQb*fq?>vRF2AvmBPo@>o7AU<+9x^ROaT%t}}(D`Sh;wQMn4 z!j`gfwv1J<?XE`t!3+2Eeo=nSsh!? z>RAH|v0K;%e2LNo+wWUh3){$ASsQC-?LuQmsII}kctJx;i{V>b*IFNHsaxL?TGg~M z)DWm^5{5@bhX(5ep(EH3>J&QKwi!vazzrdxAtcn*H+BkjLTFfAQ)^?WqebwRE)OpxM6Lf(AaG;VurM3eO*UKQ)qba7~w;jX#{SG>hho-7_*O~8bj*)`sBvj<&jn`nt}DECzY7S?YM;kh*wCXVZq( zx`>2pSp|~rAx-5;hlRv!IVI&0F`6BT8^*^)8;nsHH9Q(H{I&&KBjXcei^fm{kkBSE zsxhIhQIZOFP<_4F(GhBm8XO3YA%Yaz9;$D;rKvtrHo~^Jvo*cYSl8On5{hP|xvi-+ zlJwTlwqX5G&M64ohoTy@Q4~U3hiL~bbO=CNP)l3=t&tkEAl^~2!aKIb2o+n02gd9| zUbxYRw>Ck>q7WYvX_n6+k;1kpbu$<pUJfgnu3~qyu<}U>YGj(1fsndE2CLsjurX_&0=tnhNNM7OyQ$t?q0?^k`~?YPxv5 zrn-j5YZ~UF+4bn?+)ztFXs2LkYkjC)XliQ>c7{4OH(>xkpEr=iQ;PPs_F#QWsIFBc z^~poT&c;X(hn*MG-qF;Cwa2#L#=5O6RxmVOB$&U5EujuQ$mqbRplwZ|mIl@t+K9T^ zIz#-;n4KsTtZ%Ms5w!^3c@&EI9o68ay$w^F@e#aN+52H0}{4b6`9Dz6jaRlNB#1V)i5Jw=6KpcTM0&xW52*eSHBM?U*jzAoNI0FBC z1eUi7A$|)GYFOO15jVG?rCYUQWUa32m#(Z@TItSSu%xo`pI>{t#5e+R1mXz95r`uY zM<9+s9Dz6jaRmN%BH;SzVClU-W9*SfVMG2%R2csE4Sq$AeI+X0GYG@4x5fPXa1ZR4 z5&uol{h-f+xP}JkShK66l?u!xkKL48)K(6?7G-2vh;O5!3>@19UIwyP#gs z3m^q_5c#a2G|&RjwV)e8jiAqfz6N>>^w0V`hjuHV(h&;5Iz6FY4>`<&p^lDLbnCZS zaD8Y)Q>$hn723+!uMyYUFz7$ag13;(5G39L8!4fAW4jw8AfctLbpzhn@&s-&%2xRN zi&w7Vrr*qA36f0`Ht-wSS6Q&Gp;_z{g10m@ZN@htEEt4+cv~yacBdt%zx~J(wc}qB zf+^_6P^*A%OcGXxQ0>yq-1kgE0OrKyZ5_U*)(tJ88`d|6>ID``@I_M0qx9m&&?;_> z4m*E}(>#mYaHg;oWp1!68y5Cpf=`6OTx)}#alfT9RJS>_7*<_Pz|DtxU?s+2`@WP; zCWeLIHCT^VHwI%(gY`th-eahHF*m8z*}``>3BHz4sGU6$jluHP2nO|RiP#SNbeQ#4 za4TANKB^S2X1B@Sj|$TovAhA_>#)V#s+I$|2)e>RaD{FareWBLFCkDn8e7)_^L2Cc zYSN>Wu5^688vk12FFePQ|fTa?a)_Oc@pUxJOJ)7Q&QX@Um zF1qCwl9_EQ>N;;_Y#PN>!a#dzM@L%+zRa-PfW9$WdLgQ%dKj9zOmC?#w6U(ev8^M7 z`mTaBz<#eY6bWR^PGv8Jo%3QC`suy>&4g7gor|>b@({gKv)H%j4dUbHrgodChog9U zm|{_s78^N_qK_X~z<0yq>v1^6J(r?3<7wjv#1V)i5Jw=6KpcTM0{{OYfbX2k(Ap)r z$8z7wUsLc_LC3i&-VP4|25aXBeDSLa-llbf?7=enH6oYtH#ZiZ&HJRP?=~eMN_hUMPCCXh-qx z;{M|Ii)|%8DmhW|Xz4FYkCnbu`ex}n#H$Nu2YC2hdtJYGeJAVDtV3B(XC2ErnRPnr zeAeph$Fis7+>~=q&Z{}6b1HH_pR444keia1mNz@EEN^+O7Ta z{*q@({!sF#l50wHO7ARvh(0F9cf~mCaFw}ka~*Jbv!-XevJ>26-Rs@W?mON0xWDFp z*j_UY{aOt*gn^>AKr>zw1k`U%8%f&B-dys?1uQb#qoI>$6$+W_=;+ zD_P&n`fk>bv-V{DGOL&O?($1Js{_M5c>$#i?*|%kbiTGa}fj9zj1mXz95r`uYM<9+s9Dz6jaRmM!LZIr} zEbNLIqu;c%;JLVP?G5#zj=Ht_&q{U9?`*AWpP%h=x#zob=V!T$2>jkud&7G6UrdTs A;s5{u literal 0 HcmV?d00001 diff --git a/orte/contrib/win_pthread/pthreadVC.lib b/orte/contrib/win_pthread/pthreadVC.lib new file mode 100644 index 0000000000000000000000000000000000000000..66ac0c3d319c901a46bb6bb3d9f938ed3e461682 GIT binary patch literal 28674 zcmd^HON?Ac)jqcKbP{6{6CCGZ$8j9zHSuF+Y$tw-H1<0~J0a8bEj&Sc4jJ10DUqUm?-?4q1bxu{^@euWAqVXn zHFRJlk)r+Y8ai+XY0#Tr#DpTespxG(2iru7uAYeLV?06CKNvdrIpm<}BQbr5C+INB zr)V7IR&@07n0|mKX#6{d4t+wT=*UlF8p0EF_ya?Su0ReN|CgbOUlJ)gf5A}cGa^M3 zz*1D+Vd(f;B1JoX6w@j^K_^jmP4MR=X!4zypgRdV^G`#kA0|?CX0f5OewJV9q0hE9JE_Mj8rHFWF-k)m^dG8FxmNYVB2nAC63)Dc6`1mvKp-x#_8 zzZ9KE`4wIHo1x49AX0RtWvFx=^#Qu@zM+fji4C&9+K5lTx|cZI^0|T9+i2pj(YP-FEYK zMm^yQ7E@8T8gbjIhr51E+vr$zraQFg3r#96n*VE3Wv$9M<|603Q zu2#w&XGzm04nJds< zjv9{0eXiY(8Wm?H&hohxdX8w7qc*7 zhN#Pvv~%6o7$j`TX0B0hR%X)HFea8OS#;aCC6k0L*f{fq9Z?#`;rpzT!siVWk_>6;MK-Z6XqIOH%U~o}{g(9m&KI2zI*d;KED| zOG!g7QD$vP%kN5kIlz%X4z85v00~w^^A0dwZdB_LD}+bP^QcDk@@;08a=2z=Zno5F zH!D%6(`!Dw#%XGmkuCn}-UC(9osmtxDAD)|!n{Cu-lUp_LHeRP`b>uZqpf z^xgI?H4rk>E@O)N$xLLuk4+N3WaUhL+{_Vp?UI}Y(?sUAMy2HfYExv5?TWp5xRaky z2v;oSQEFHDoD)}>Ws5d?MzR_lw8Uhh^{uvuXxXBT&edv2h*lsywb#tSsI+f|D+G^HoZXhKJ1$%TCzkOCH*eCeqc6m09L^!;W8EcKE zM}DhaYqo3M+ojp^TU7G#{Z_SxY^C@@NfT#;l4fLrHT6|dW3BziRWtDj9hKbbG2{RqB=GbOr~)nmPfPk zq}@q=rIKVqRKg^Y%GL1DalMi!iBz5n&978qriauveX~n-T21v1rm{A_xCDWIy<2P5 zv07Obhn4E0R&JK-bFo^QN;R<8rFt`P%&$~ZsW&^ZVf-_dVJ@mQ5dSMX``buuV|QA$ zMrK8HSb}a+!z_n{D_HP(S?6w8g07uBS>~20=%YP_>=Q1xFo8-sGHse`-Ds-$!4|-z zxW-I$yJX*=t)9!vYa{ZE+_!I~ZFyWyC(n2sM*H_~yr|&Y0pO|e*PRzR4 zzrQ(3^!@EbzkZ$QcQ_kZx|8TzphJ6zKHW|9-aeddfWLk}&JK_sMSA4{qIZ$LgXb4- zA`{Ttp!PxR_g^LY81#oK(dS4X!P&uwphJg|_c+nxM~Qv_`VM}7a){`sM~H?%A3%Nu z>3@O$%L$ynoG1FM1UvlRQ6^e@oaje5!&wFT_#|*Z?@WRZ`X|mh9zIR97|*|+#aYlf z_<-NrP7(ba)Bx{$kbn0C&QFdJ{R#5lMmQ6@jwk5I6ww6Izrl0I1>_Ixzg;2v$7P}x zp4U;1_rYI(5#Q2skO zYgq;QH|RZ_mwYkY`{^X*yq3>t%M1)et`-w4_A3eiulq5ODGqh9}x=kMW% zI((^v{s`It`7-$TXRsI1VtSQcp?m2*I!|Zm6g^B2&{DdG?x%A!Nhj$MdXOHXuh24D zPLI-K^i^6xD`_3Ap(p7%T1(H;)AS5IMXTv~+DT1%k=E18bdkEWgIe@WYSU{pMB8XP zZK92|h2EfH+De=0bsC{j+C?v*OB|r1G)@zA0>wN|$LJ6prh{~ZHqh7Tae9d^P={vd z2GyxSv-EY^N4sf^_RwD1PfyS)I!$NjGF_r8G)-3tdrmY(Rf?!WWvbD&{|6o}K^*g? z&dzxFlkRj)rkh!8nn^XxP8SoJqax1=U}G0E*Tx(5f;pzFPzg1|9=6QOcHwV_m#N}#<96lI<|OtSEmc)r>bj~;xRb8?U-o*78z6_{60-t-)S zSCa~qyrapDqWFZV-cF_cNuK$9p(EG!hlF~|)z@{5P-+Pyks@s)(S0W%wvjb2rm>YH zaxDvWu2caPm~0FS0Q2-fmQQ$>-CHxZlg?WV|1^*m13FSM=G{G(&d++;U5ww@c+C~w zV-wBIloD^I$r`=yREhR-=ZQ-%?_?QasB1YI=v$t7+fkDGg(LPix^$okZL=hZ@l7I? zx`-0`=O;-0^OF)LuYSCy^-H#Ah7Z5qOA~^&@VrxNncSlO3lgf22?qn*hkg%Eq};yj zxrfcG=K}|&$gX&}Ikbek8@ic=T~A{tNz+}-M5=$7-8R?G_M*Hbx6PK@LCSO@wULDJ z6>nC>AmF*fN!p~EXLBsgC>PPF+=N{_bUD4Vm0Fr;Cyp4?7naHNl_n=MFEcjC7CXyE8zZGF6$yC_g%o3Q7#b40BN}hrX?tSvJ_cM`|^;a z)r*01Z-?=7`MZ(b_NsU^LkMBa^FuR=yZ8MtQmJdu@QaG+(Jr&ep@~p z?%Q6`_#e6r|-Q~3!Zs2ZtIxG5sGCflHK$z%k%p^b@_Np0zf zrAn|(mg@uAJAOR;wQiun%w)%#O|hj>3%;~cDt2zv@&Gph^c-gKLBzvZW}B^XH-xo{ zYFG-vs}+00R$0N!ckEsayIg}NkZ%;_FW;D3#AxREuFSB&G`@SxLeeCl#Korhj^I@o zn&|5v?s2beQwbE7dQ4?&=(>DxtIP>7;uCYy(Fn(Cgs0 zo`c8?`yNIn@8i%(5@~WU$lh&_l=i!f4+!twt_Py9J@TU=sx@k z{NdXg9L?Yy#{aiOi=e1<)j#@~Jp6`tK{8a0uFXxY!-<;t!x13W;lKMgM$7jO)evx$ z*KM}^75MQ!^gfDpm5*bz@mH}PP9V+SGCV$Y^b~iD*8B=phV!WhRgxZIjkbXvTYf*d zrq&4OT||Fb{phh;rQPf_uXopMIQin5@xv21a1{O?22WY4989a+udDlB&0|0`R%y<* zP~g9;zK8zvAB$*PQk8Hq&i;(wV??^l)0U$>R7guKXISZgfwQgHY9!?-{#x}<{HJm! zoUx^Ui*YuFZ`Hos>Cga2#O9GL&WKp7N5qFHnJFM=jFiTJ5{ zjLLT*dO|O)`!uki8lxPrsynd?2}WA?+ZrHYAqn zp+!fw#zP^4{5+5sVU4hNPEusOKfz$Au)iaANy?zE1L|T2m7n5rP?qY!(^1=XGng*} zb4d;p5sSMK!N7|9J31`a@+-i;N5W?N92}gbdht8Zx9*j&op_gF74BQ18o$qvZ1!k4 zbnzY*=-2nl*lG)?Pt?&(ay!3>c78xaO?H?T5cxqbvfjYz6FFH-Gvn%6_`EcSti$F$ z5kvjzp&TNj{kt@h)qN#9Uz(W<*mr3pKO$k@m65#6kG$X``71K^0*~b7BI?~3$zSy% z4`d{7muIgRFp?j2k?q#CeLe1TJcpuz$0S@~5@AK?VO0!au8=VGYdJ&Vi$xEZp?T|T z0w&u%cw;WU*BZbhz&shx(|H-tsL@tr4JXAw%uD~ zeim-;5s%l;!0RVm^!W6pPqc0F=v@!ARSb=v?evN2=~pU}e=>(EPZ+EOJ@lqf#PL)P zQ|Ly8N6*NJT({4`%cpaQ@v#?ktN1&^NT5BR$zi6uiyW4v`mEd4IaFa%EL^wg|B}Vu zebwBsCW{!D5{r5onvI_oalO-FVV^^9-D^ecLGJS#O_s0q@pxJauxy{o$z|#^|soPE&h*FSuytoSM52G#pYRk&V5Ys$-6RD0IQ9W9JG z>RHELMO(g-!4xha^obtoNw2!-`hEikW2s)+)U)HZ7M>2dSkCPUhEcp11rT4$BF5j@ z^@$khw;NqVb9F-wz6$rDk$|6@@~FbX#k}sbEjQ;8^}#yBDBhNy8CJasZ^N{8kwmtBt)N#QZGW zuR_?{yx4MP&H;=hk@y$4S*)5FfiQLo<#2x`v7(m6x zZD2LpD`3WV37Kof_dP;q;rj$sz4(gItROwKYzTS34>`X0$gqm93!e8!wFh!QLQXDj zE*$QgGVVb94efs%6mZ3mW1#){kbo+>S{OCds}AQ;1ECIU>t6b^XUdq+IT1Ki^Z z#L!1Q=!2NGLhrca9^Aq0bA?u-V=lVBt;|}q@T?J9i6%G}y9?bXYG743E}{-1wg~xp zB8%!=kpR}4zZddA}}5l;;?7Nd=jH3N)gS6Slqe7v-7ZL1$+Wn z*EJSCv@+j$^@|knYRV$X;Zkw00w=N477H(M=08HbKS*BzYgSp#e0QkHBz?$W-X%cdQfq+K!0x} kXz{m={d(qE/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/examples/Makefile.am b/orte/examples/Makefile.am new file mode 100644 index 0000000..ae6a091 --- /dev/null +++ b/orte/examples/Makefile.am @@ -0,0 +1,12 @@ +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +# Uncomment and customize the following to ORTE your needs: +# +if CONFIG_ORTE_RT +SUBDIRS = hello +else +SUBDIRS = hello reliable ORTEPing ORTESpy +endif diff --git a/orte/examples/Makefile.in b/orte/examples/Makefile.in new file mode 100644 index 0000000..f345cb6 --- /dev/null +++ b/orte/examples/Makefile.in @@ -0,0 +1,353 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ + +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +# Uncomment and customize the following to ORTE your needs: +# +@CONFIG_ORTE_RT_TRUE@SUBDIRS = hello +@CONFIG_ORTE_RT_FALSE@SUBDIRS = hello reliable ORTEPing ORTESpy +subdir = orte/examples +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = hello reliable ORTEPing ORTESpy +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu orte/examples/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive distclean distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/orte/examples/Makefile.omk b/orte/examples/Makefile.omk new file mode 100644 index 0000000..49ac3d2 --- /dev/null +++ b/orte/examples/Makefile.omk @@ -0,0 +1 @@ +SUBDIRS = ORTEPing ORTESpy hello reliable diff --git a/orte/examples/hello/HelloWorldPublisher.c b/orte/examples/hello/HelloWorldPublisher.c new file mode 100644 index 0000000..8582c29 --- /dev/null +++ b/orte/examples/hello/HelloWorldPublisher.c @@ -0,0 +1,90 @@ +/* + * $Id: HelloWorldPublisher.c,v 0.0.0.1 2003/12/26 + * + * DEBUG: section HelloWorldPublisher + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#ifdef __RTL__ + #include + #define printf rtl_printf +#endif +#include "orte_api.h" + +ORTEDomain *d; +char instance2Send[64]; +char terminate=0; + +void * +publisher(void *arg) { + ORTEPublication *p; + ORTEDomainProp dp; + NtpTime persistence; + int i=1; + + ORTEInit(); + ORTEDomainPropDefaultGet(&dp); + #ifdef __RTL__ + dp.appLocalManager=StringToIPAddress("192.168.0.4"); + #endif + d=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,&dp,NULL); + ORTETypeRegisterAdd(d,"HelloMsg",NULL,NULL,64); + NTPTIME_BUILD(persistence,3); + p=ORTEPublicationCreate( + d, + "Example HelloMsg", + "HelloMsg", + &instance2Send, + &persistence, + 1, + NULL, + NULL, + NULL); + while (!terminate) { + ORTESleepMs(1000); + printf("Sampling publication, count %d\n", i); + sprintf(instance2Send,"Hello Universe! (%d)",i++); + ORTEPublicationSend(p); + } + #ifdef __RTL__ + pthread_exit(arg); + #endif + return 0; +} + +#ifndef __RTL__ +int +main(int argc, char *args[]) { + publisher(NULL); + return 0; +} +#else +pthread_t t; +int +init_module(void) { + pthread_create (&t, NULL, publisher, 0); + return 0; +} +void +cleanup_module(void) { + int result; + terminate=1; + pthread_join(t,(void **) &result); + ORTEDomainAppDestroy(d); +} +#endif diff --git a/orte/examples/hello/HelloWorldSubscriber.c b/orte/examples/hello/HelloWorldSubscriber.c new file mode 100644 index 0000000..f474c0d --- /dev/null +++ b/orte/examples/hello/HelloWorldSubscriber.c @@ -0,0 +1,96 @@ +/* + * $Id: HelloWorldSubscriber.c,v 0.0.0.1 2003/12/26 + * + * DEBUG: section HelloWorldSubscriber + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#ifdef __RTL__ + #include + #define printf rtl_printf +#endif +#include "orte_api.h" + +ORTEDomain *d; +char instance2Recv[64]; + +void +recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) { + char *instance=(char*)vinstance; + + switch (info->status) { + case NEW_DATA: + printf("%s\n",instance); + break; + case DEADLINE: + printf("deadline occured\n"); + break; + } +} + + +void +subscriberCreate(void) { + ORTESubscription *s; + ORTEDomainProp dp; + NtpTime deadline,minimumSeparation; + + ORTEInit(); + ORTEVerbositySetOptions("ALL,10"); + ORTEDomainPropDefaultGet(&dp); + #ifdef __RTL__ + dp.appLocalManager=StringToIPAddress("192.168.4.1"); + #endif + d=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,&dp,NULL); + ORTETypeRegisterAdd(d,"HelloMsg",NULL,NULL,64); + NTPTIME_BUILD(deadline,15); + NTPTIME_BUILD(minimumSeparation,0); + s=ORTESubscriptionCreate( + d, + IMMEDIATE, + BEST_EFFORTS, + "Example HelloMsg", + "HelloMsg", + &instance2Recv, + &deadline, + &minimumSeparation, + recvCallBack, + NULL); +} + +#ifndef __RTL__ +int +main(int argc, char *args[]) { + subscriberCreate(); + while (1) + ORTESleepMs(1000); + return 0; +} +#else +pthread_t t; +int +init_module(void) { + subscriberCreate(); + return 0; +} +void +cleanup_module(void) { + ORTEDomainAppDestroy(d); +} +#endif + diff --git a/orte/examples/hello/Makefile b/orte/examples/hello/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/orte/examples/hello/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/examples/hello/Makefile.am b/orte/examples/hello/Makefile.am new file mode 100644 index 0000000..ef37614 --- /dev/null +++ b/orte/examples/hello/Makefile.am @@ -0,0 +1,18 @@ +if CONFIG_ORTE_RT + module_PROGRAMS = helloSubscriber.ko helloPublisher.ko + helloSubscriber_ko_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) + helloSubscriber_ko_SOURCES = HelloWorldSubscriber.c + helloSubscriber_ko_LINK = $(top_builddir)/modtool --link -o $@ + helloPublisher_ko_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) + helloPublisher_ko_SOURCES = HelloWorldPublisher.c + helloPublisher_ko_LINK = $(top_builddir)/modtool --link -o $@ +else + noinst_PROGRAMS = HelloWorldPublisher HelloWorldSubscriber +if CONFIG_ORTE_WIN + win_libs= $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +endif + HelloWorldPublisher_SOURCES = HelloWorldPublisher.c + HelloWorldPublisher_LDADD = ../../liborte/liborte.a $(win_libs) + HelloWorldSubscriber_SOURCES = HelloWorldSubscriber.c + HelloWorldSubscriber_LDADD = ../../liborte/liborte.a $(win_libs) +endif \ No newline at end of file diff --git a/orte/examples/hello/Makefile.in b/orte/examples/hello/Makefile.in new file mode 100644 index 0000000..24e205a --- /dev/null +++ b/orte/examples/hello/Makefile.in @@ -0,0 +1,431 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ +@CONFIG_ORTE_RT_TRUE@module_PROGRAMS = helloSubscriber.ko helloPublisher.ko +@CONFIG_ORTE_RT_TRUE@helloSubscriber_ko_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) +@CONFIG_ORTE_RT_TRUE@helloSubscriber_ko_SOURCES = HelloWorldSubscriber.c +@CONFIG_ORTE_RT_TRUE@helloSubscriber_ko_LINK = $(top_builddir)/modtool --link -o $@ +@CONFIG_ORTE_RT_TRUE@helloPublisher_ko_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) +@CONFIG_ORTE_RT_TRUE@helloPublisher_ko_SOURCES = HelloWorldPublisher.c +@CONFIG_ORTE_RT_TRUE@helloPublisher_ko_LINK = $(top_builddir)/modtool --link -o $@ +@CONFIG_ORTE_RT_FALSE@noinst_PROGRAMS = HelloWorldPublisher HelloWorldSubscriber +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@win_libs = $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +@CONFIG_ORTE_RT_FALSE@HelloWorldPublisher_SOURCES = HelloWorldPublisher.c +@CONFIG_ORTE_RT_FALSE@HelloWorldPublisher_LDADD = ../../liborte/liborte.a $(win_libs) +@CONFIG_ORTE_RT_FALSE@HelloWorldSubscriber_SOURCES = HelloWorldSubscriber.c +@CONFIG_ORTE_RT_FALSE@HelloWorldSubscriber_LDADD = ../../liborte/liborte.a $(win_libs) +subdir = orte/examples/hello +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = +@CONFIG_ORTE_RT_TRUE@module_PROGRAMS = helloSubscriber.ko$(EXEEXT) \ +@CONFIG_ORTE_RT_TRUE@ helloPublisher.ko$(EXEEXT) +@CONFIG_ORTE_RT_FALSE@module_PROGRAMS = +@CONFIG_ORTE_RT_TRUE@noinst_PROGRAMS = +@CONFIG_ORTE_RT_FALSE@noinst_PROGRAMS = HelloWorldPublisher$(EXEEXT) \ +@CONFIG_ORTE_RT_FALSE@ HelloWorldSubscriber$(EXEEXT) +PROGRAMS = $(module_PROGRAMS) $(noinst_PROGRAMS) + +@CONFIG_ORTE_RT_FALSE@am_HelloWorldPublisher_OBJECTS = \ +@CONFIG_ORTE_RT_FALSE@ HelloWorldPublisher.$(OBJEXT) +HelloWorldPublisher_OBJECTS = $(am_HelloWorldPublisher_OBJECTS) +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@HelloWorldPublisher_DEPENDENCIES = \ +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@ ../../liborte/liborte.a \ +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@ $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_FALSE@HelloWorldPublisher_DEPENDENCIES = \ +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_FALSE@ ../../liborte/liborte.a +@CONFIG_ORTE_RT_TRUE@@CONFIG_ORTE_WIN_TRUE@HelloWorldPublisher_DEPENDENCIES = +@CONFIG_ORTE_RT_TRUE@@CONFIG_ORTE_WIN_FALSE@HelloWorldPublisher_DEPENDENCIES = +HelloWorldPublisher_LDFLAGS = +@CONFIG_ORTE_RT_FALSE@am_HelloWorldSubscriber_OBJECTS = \ +@CONFIG_ORTE_RT_FALSE@ HelloWorldSubscriber.$(OBJEXT) +HelloWorldSubscriber_OBJECTS = $(am_HelloWorldSubscriber_OBJECTS) +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@HelloWorldSubscriber_DEPENDENCIES = \ +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@ ../../liborte/liborte.a \ +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@ $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_FALSE@HelloWorldSubscriber_DEPENDENCIES = \ +@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_FALSE@ ../../liborte/liborte.a +@CONFIG_ORTE_RT_TRUE@@CONFIG_ORTE_WIN_TRUE@HelloWorldSubscriber_DEPENDENCIES = +@CONFIG_ORTE_RT_TRUE@@CONFIG_ORTE_WIN_FALSE@HelloWorldSubscriber_DEPENDENCIES = +HelloWorldSubscriber_LDFLAGS = +@CONFIG_ORTE_RT_TRUE@am_helloPublisher_ko_OBJECTS = \ +@CONFIG_ORTE_RT_TRUE@ helloPublisher_ko-HelloWorldPublisher.$(OBJEXT) +helloPublisher_ko_OBJECTS = $(am_helloPublisher_ko_OBJECTS) +helloPublisher_ko_LDADD = $(LDADD) +helloPublisher_ko_DEPENDENCIES = +helloPublisher_ko_LDFLAGS = +@CONFIG_ORTE_RT_TRUE@am_helloSubscriber_ko_OBJECTS = \ +@CONFIG_ORTE_RT_TRUE@ helloSubscriber_ko-HelloWorldSubscriber.$(OBJEXT) +helloSubscriber_ko_OBJECTS = $(am_helloSubscriber_ko_OBJECTS) +helloSubscriber_ko_LDADD = $(LDADD) +helloSubscriber_ko_DEPENDENCIES = +helloSubscriber_ko_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/orte/include +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/HelloWorldPublisher.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/HelloWorldSubscriber.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/helloPublisher_ko-HelloWorldPublisher.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/helloSubscriber_ko-HelloWorldSubscriber.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(HelloWorldPublisher_SOURCES) \ + $(HelloWorldSubscriber_SOURCES) $(helloPublisher_ko_SOURCES) \ + $(helloSubscriber_ko_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(HelloWorldPublisher_SOURCES) $(HelloWorldSubscriber_SOURCES) $(helloPublisher_ko_SOURCES) $(helloSubscriber_ko_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu orte/examples/hello/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +install-modulePROGRAMS: $(module_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(moduledir) + @list='$(module_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(modulePROGRAMS_INSTALL) $$p $(DESTDIR)$(moduledir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(modulePROGRAMS_INSTALL) $$p $(DESTDIR)$(moduledir)/$$f; \ + else :; fi; \ + done + +uninstall-modulePROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(module_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(moduledir)/$$f"; \ + rm -f $(DESTDIR)$(moduledir)/$$f; \ + done + +clean-modulePROGRAMS: + -test -z "$(module_PROGRAMS)" || rm -f $(module_PROGRAMS) + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +HelloWorldPublisher$(EXEEXT): $(HelloWorldPublisher_OBJECTS) $(HelloWorldPublisher_DEPENDENCIES) + @rm -f HelloWorldPublisher$(EXEEXT) + $(LINK) $(HelloWorldPublisher_LDFLAGS) $(HelloWorldPublisher_OBJECTS) $(HelloWorldPublisher_LDADD) $(LIBS) +HelloWorldSubscriber$(EXEEXT): $(HelloWorldSubscriber_OBJECTS) $(HelloWorldSubscriber_DEPENDENCIES) + @rm -f HelloWorldSubscriber$(EXEEXT) + $(LINK) $(HelloWorldSubscriber_LDFLAGS) $(HelloWorldSubscriber_OBJECTS) $(HelloWorldSubscriber_LDADD) $(LIBS) +helloPublisher_ko-HelloWorldPublisher.$(OBJEXT): HelloWorldPublisher.c +helloPublisher.ko$(EXEEXT): $(helloPublisher_ko_OBJECTS) $(helloPublisher_ko_DEPENDENCIES) + @rm -f helloPublisher.ko$(EXEEXT) + $(helloPublisher_ko_LINK) $(helloPublisher_ko_LDFLAGS) $(helloPublisher_ko_OBJECTS) $(helloPublisher_ko_LDADD) $(LIBS) +helloSubscriber_ko-HelloWorldSubscriber.$(OBJEXT): \ + HelloWorldSubscriber.c +helloSubscriber.ko$(EXEEXT): $(helloSubscriber_ko_OBJECTS) $(helloSubscriber_ko_DEPENDENCIES) + @rm -f helloSubscriber.ko$(EXEEXT) + $(helloSubscriber_ko_LINK) $(helloSubscriber_ko_LDFLAGS) $(helloSubscriber_ko_OBJECTS) $(helloSubscriber_ko_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HelloWorldPublisher.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HelloWorldSubscriber.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helloPublisher_ko-HelloWorldPublisher.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helloSubscriber_ko-HelloWorldSubscriber.Po@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` + +helloPublisher_ko-HelloWorldPublisher.o: HelloWorldPublisher.c +@AMDEP_TRUE@ source='HelloWorldPublisher.c' object='helloPublisher_ko-HelloWorldPublisher.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/helloPublisher_ko-HelloWorldPublisher.Po' tmpdepfile='$(DEPDIR)/helloPublisher_ko-HelloWorldPublisher.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(helloPublisher_ko_CFLAGS) $(CFLAGS) -c -o helloPublisher_ko-HelloWorldPublisher.o `test -f 'HelloWorldPublisher.c' || echo '$(srcdir)/'`HelloWorldPublisher.c + +helloPublisher_ko-HelloWorldPublisher.obj: HelloWorldPublisher.c +@AMDEP_TRUE@ source='HelloWorldPublisher.c' object='helloPublisher_ko-HelloWorldPublisher.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/helloPublisher_ko-HelloWorldPublisher.Po' tmpdepfile='$(DEPDIR)/helloPublisher_ko-HelloWorldPublisher.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(helloPublisher_ko_CFLAGS) $(CFLAGS) -c -o helloPublisher_ko-HelloWorldPublisher.obj `cygpath -w HelloWorldPublisher.c` + +helloSubscriber_ko-HelloWorldSubscriber.o: HelloWorldSubscriber.c +@AMDEP_TRUE@ source='HelloWorldSubscriber.c' object='helloSubscriber_ko-HelloWorldSubscriber.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/helloSubscriber_ko-HelloWorldSubscriber.Po' tmpdepfile='$(DEPDIR)/helloSubscriber_ko-HelloWorldSubscriber.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(helloSubscriber_ko_CFLAGS) $(CFLAGS) -c -o helloSubscriber_ko-HelloWorldSubscriber.o `test -f 'HelloWorldSubscriber.c' || echo '$(srcdir)/'`HelloWorldSubscriber.c + +helloSubscriber_ko-HelloWorldSubscriber.obj: HelloWorldSubscriber.c +@AMDEP_TRUE@ source='HelloWorldSubscriber.c' object='helloSubscriber_ko-HelloWorldSubscriber.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/helloSubscriber_ko-HelloWorldSubscriber.Po' tmpdepfile='$(DEPDIR)/helloSubscriber_ko-HelloWorldSubscriber.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(helloSubscriber_ko_CFLAGS) $(CFLAGS) -c -o helloSubscriber_ko-HelloWorldSubscriber.obj `cygpath -w HelloWorldSubscriber.c` +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(moduledir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-modulePROGRAMS clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-modulePROGRAMS + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-info-am uninstall-modulePROGRAMS + +.PHONY: GTAGS all all-am check check-am clean clean-generic \ + clean-modulePROGRAMS clean-noinstPROGRAMS distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-modulePROGRAMS install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic tags uninstall uninstall-am \ + uninstall-info-am uninstall-modulePROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/orte/examples/hello/Makefile.omk b/orte/examples/hello/Makefile.omk new file mode 100644 index 0000000..d26528c --- /dev/null +++ b/orte/examples/hello/Makefile.omk @@ -0,0 +1,20 @@ +INCLUDES = -D_OMK_UNIX + +utils_PROGRAMS = helloPublisher helloSubscriber + +helloPublisher_SOURCES = HelloWorldPublisher.c + +helloSubscriber_SOURCES = HelloWorldSubscriber.c + +lib_LOADLIBES = orte pthread + +############################################################################# +# RT-Linux version of build + +rtlinux_MODULES = HelloWorldPublisher HelloWorldSubscriber + +HelloWorldPublisher_SOURCES = HelloWorldPublisher.c + +HelloWorldSubscriber_SOURCES = HelloWorldSubscriber.c + +rtlinux_LOADLIBES = orte_rtl pthread_rwlock diff --git a/orte/examples/hello/msvc/m.bat b/orte/examples/hello/msvc/m.bat new file mode 100755 index 0000000..8e93ba9 --- /dev/null +++ b/orte/examples/hello/msvc/m.bat @@ -0,0 +1,4 @@ +del HelloWorldPublisher.exe +make /f makefile.msc +pause +HelloWorldPublisher.exe \ No newline at end of file diff --git a/orte/examples/hello/msvc/makefile.msc b/orte/examples/hello/msvc/makefile.msc new file mode 100644 index 0000000..0dade64 --- /dev/null +++ b/orte/examples/hello/msvc/makefile.msc @@ -0,0 +1,48 @@ +# --------------------------------------------------------------------- +# Microsoft C/C++ Installation Directory +# +# CHANGE this definition to point to your compiler's installation directory +# --------------------------------------------------------------------- +MSCDIR= d:\Progra~1\micros~2\vc98 + +CFLAGS = -c -Zi -MD $(INCLUDE) +LIB_CFLAGS= $(CFLAGS) -LD +INCLUDE= -I$(MSCDIR)\include -I..\..\..\include -I..\..\..\include\win32 +LIBS= $(MSCDIR)\lib\msvcrt.lib $(MSCDIR)\lib\uuid.lib $(MSCDIR)\lib\oldnames.lib \ + $(MSCDIR)\lib\kernel32.lib $(MSCDIR)\lib\libcd.lib $(MSCDIR)\lib\wsock32.lib \ + $(MSCDIR)\lib\advapi32.lib $(MSCDIR)\lib\ws2_32.lib\ + ..\..\..\contrib\win_pthread\pthreadVC.lib \ + ..\..\..\liborte\msvc\liborte.lib +CC= $(MSCDIR)\bin\cl +LINK= $(MSCDIR)\bin\link +LIBRARIAN= $(MSCDIR)\bin\lib + +TARGETS=HelloWorldPublisher.exe HelloWorldSubscriber.exe + +all : default + +default : $(TARGETS) + +HelloWorldPublisher.exe: ..\HelloWorldPublisher.obj + +HelloWorldSubscriber.exe: ..\HelloWorldSubscriber.obj + +# --------------------------------------------------------------------- +# Generic Compilation Rules +# +# Do NOT change anything below this point. +# --------------------------------------------------------------------- +#.SUFFIXES: .c .obj .exe + +.c.obj: + $(CC) $(CFLAGS) $< -Fo$*.obj + +.obj.exe: + $(LINK) -out:$@ $(ORTELIB) $< $(LIBS) + +clean : + del *.obj + del *.exe + del *.pdb + + diff --git a/orte/examples/reliable/BestEffortSubscriber.c b/orte/examples/reliable/BestEffortSubscriber.c new file mode 100644 index 0000000..6cdca60 --- /dev/null +++ b/orte/examples/reliable/BestEffortSubscriber.c @@ -0,0 +1,88 @@ +/* + * $Id: BestEffortSubscriber.c,v 0.0.0.1 2003/12/27 + * + * DEBUG: section ReliableSubscriber + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#ifdef __RTL__ + #include +#endif +#include "orte_api.h" + +ORTEDomain *d; +char instance2Recv[64]; + +void +recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) { + char *instance=(char*)vinstance; + + switch (info->status) { + case NEW_DATA: + printf("%s\n",instance); + break; + case DEADLINE: + printf("deadline occured\n"); + break; + } +} + + +int +main(int argc, char *args[]) { + ORTESubscription *s; + NtpTime deadline,minimumSeparation; + + ORTEInit(); + //ORTEVerbositySetOptions("ALL,10"); + d=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,NULL,NULL); + ORTETypeRegisterAdd(d,"HelloMsg",NULL,NULL,64); + NTPTIME_BUILD(deadline,3); + NTPTIME_BUILD(minimumSeparation,0); + s=ORTESubscriptionCreate( + d, + IMMEDIATE, + BEST_EFFORTS, + "Reliable HelloMsg", + "HelloMsg", + &instance2Recv, + &deadline, + &minimumSeparation, + recvCallBack, + NULL); + #ifndef __RTL__ + while (1) + ORTESleepMs(1000); + #endif + return 0; +} + +#ifdef __RTL__ +void +hello_init(void) { + main(0,NULL); +} +void +hello_exit(void) { + ORTEDomainAppDestroy(d); +} +MODULE_LICENSE("GPL"); +module_init(hello_init); +module_exit(hello_exit); +#endif + diff --git a/orte/examples/reliable/Makefile b/orte/examples/reliable/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/orte/examples/reliable/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/examples/reliable/Makefile.am b/orte/examples/reliable/Makefile.am new file mode 100644 index 0000000..64b0c2b --- /dev/null +++ b/orte/examples/reliable/Makefile.am @@ -0,0 +1,14 @@ +noinst_PROGRAMS = ReliablePublisher ReliableSubscriber BestEffortSubscriber + +if CONFIG_ORTE_WIN + win_libs= $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +endif + +ReliablePublisher_SOURCES = ReliablePublisher.c +ReliablePublisher_LDADD = ../../liborte/liborte.a $(win_libs) + +ReliableSubscriber_SOURCES = ReliableSubscriber.c +ReliableSubscriber_LDADD = ../../liborte/liborte.a $(win_libs) + +BestEffortSubscriber_SOURCES = BestEffortSubscriber.c +BestEffortSubscriber_LDADD = ../../liborte/liborte.a $(win_libs) diff --git a/orte/examples/reliable/Makefile.in b/orte/examples/reliable/Makefile.in new file mode 100644 index 0000000..7c47d56 --- /dev/null +++ b/orte/examples/reliable/Makefile.in @@ -0,0 +1,357 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ +noinst_PROGRAMS = ReliablePublisher ReliableSubscriber BestEffortSubscriber + +@CONFIG_ORTE_WIN_TRUE@win_libs = $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a + +ReliablePublisher_SOURCES = ReliablePublisher.c +ReliablePublisher_LDADD = ../../liborte/liborte.a $(win_libs) + +ReliableSubscriber_SOURCES = ReliableSubscriber.c +ReliableSubscriber_LDADD = ../../liborte/liborte.a $(win_libs) + +BestEffortSubscriber_SOURCES = BestEffortSubscriber.c +BestEffortSubscriber_LDADD = ../../liborte/liborte.a $(win_libs) +subdir = orte/examples/reliable +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = +noinst_PROGRAMS = ReliablePublisher$(EXEEXT) ReliableSubscriber$(EXEEXT) \ + BestEffortSubscriber$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) + +am_BestEffortSubscriber_OBJECTS = BestEffortSubscriber.$(OBJEXT) +BestEffortSubscriber_OBJECTS = $(am_BestEffortSubscriber_OBJECTS) +@CONFIG_ORTE_WIN_TRUE@BestEffortSubscriber_DEPENDENCIES = \ +@CONFIG_ORTE_WIN_TRUE@ ../../liborte/liborte.a \ +@CONFIG_ORTE_WIN_TRUE@ $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +@CONFIG_ORTE_WIN_FALSE@BestEffortSubscriber_DEPENDENCIES = \ +@CONFIG_ORTE_WIN_FALSE@ ../../liborte/liborte.a +BestEffortSubscriber_LDFLAGS = +am_ReliablePublisher_OBJECTS = ReliablePublisher.$(OBJEXT) +ReliablePublisher_OBJECTS = $(am_ReliablePublisher_OBJECTS) +@CONFIG_ORTE_WIN_TRUE@ReliablePublisher_DEPENDENCIES = \ +@CONFIG_ORTE_WIN_TRUE@ ../../liborte/liborte.a \ +@CONFIG_ORTE_WIN_TRUE@ $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +@CONFIG_ORTE_WIN_FALSE@ReliablePublisher_DEPENDENCIES = \ +@CONFIG_ORTE_WIN_FALSE@ ../../liborte/liborte.a +ReliablePublisher_LDFLAGS = +am_ReliableSubscriber_OBJECTS = ReliableSubscriber.$(OBJEXT) +ReliableSubscriber_OBJECTS = $(am_ReliableSubscriber_OBJECTS) +@CONFIG_ORTE_WIN_TRUE@ReliableSubscriber_DEPENDENCIES = \ +@CONFIG_ORTE_WIN_TRUE@ ../../liborte/liborte.a \ +@CONFIG_ORTE_WIN_TRUE@ $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +@CONFIG_ORTE_WIN_FALSE@ReliableSubscriber_DEPENDENCIES = \ +@CONFIG_ORTE_WIN_FALSE@ ../../liborte/liborte.a +ReliableSubscriber_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/orte/include +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/BestEffortSubscriber.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ReliablePublisher.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ReliableSubscriber.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(BestEffortSubscriber_SOURCES) \ + $(ReliablePublisher_SOURCES) $(ReliableSubscriber_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(BestEffortSubscriber_SOURCES) $(ReliablePublisher_SOURCES) $(ReliableSubscriber_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu orte/examples/reliable/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +BestEffortSubscriber$(EXEEXT): $(BestEffortSubscriber_OBJECTS) $(BestEffortSubscriber_DEPENDENCIES) + @rm -f BestEffortSubscriber$(EXEEXT) + $(LINK) $(BestEffortSubscriber_LDFLAGS) $(BestEffortSubscriber_OBJECTS) $(BestEffortSubscriber_LDADD) $(LIBS) +ReliablePublisher$(EXEEXT): $(ReliablePublisher_OBJECTS) $(ReliablePublisher_DEPENDENCIES) + @rm -f ReliablePublisher$(EXEEXT) + $(LINK) $(ReliablePublisher_LDFLAGS) $(ReliablePublisher_OBJECTS) $(ReliablePublisher_LDADD) $(LIBS) +ReliableSubscriber$(EXEEXT): $(ReliableSubscriber_OBJECTS) $(ReliableSubscriber_DEPENDENCIES) + @rm -f ReliableSubscriber$(EXEEXT) + $(LINK) $(ReliableSubscriber_LDFLAGS) $(ReliableSubscriber_OBJECTS) $(ReliableSubscriber_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BestEffortSubscriber.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ReliablePublisher.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ReliableSubscriber.Po@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-generic \ + clean-noinstPROGRAMS distclean distclean-compile \ + distclean-depend distclean-generic distclean-tags distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/orte/examples/reliable/Makefile.omk b/orte/examples/reliable/Makefile.omk new file mode 100644 index 0000000..8d1fbc9 --- /dev/null +++ b/orte/examples/reliable/Makefile.omk @@ -0,0 +1,12 @@ +INCLUDES = -D_OMK_UNIX + +utils_PROGRAMS = ReliablePublisher ReliableSubscriber BestEffortSubscriber + +ReliablePublisher_SOURCES = ReliablePublisher.c + +ReliableSubscriber_SOURCES = ReliableSubscriber.c + +BestEffortSubscriber_SOURCES = BestEffortSubscriber.c + +lib_LOADLIBES = orte pthread + diff --git a/orte/examples/reliable/ReliablePublisher.c b/orte/examples/reliable/ReliablePublisher.c new file mode 100644 index 0000000..c3a0946 --- /dev/null +++ b/orte/examples/reliable/ReliablePublisher.c @@ -0,0 +1,74 @@ +/* + * $Id: ReliablePublisher.c,v 0.0.0.1 2003/12/27 + * + * DEBUG: section ReliablePublisher + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#ifdef __RTL__ + #include +#endif +#include "orte_api.h" + +ORTEDomain *d; +char instance2Send[64]; + +int +main(int argc, char *args[]) { + ORTEPublication *p; + NtpTime persistence; + int i=1; + + ORTEInit(); + //ORTEVerbositySetOptions("ALL,10"); + d=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,NULL,NULL); + ORTETypeRegisterAdd(d,"HelloMsg",NULL,NULL,64); + NTPTIME_BUILD(persistence,3); + p=ORTEPublicationCreate( + d, + "Reliable HelloMsg", + "HelloMsg", + &instance2Send, + &persistence, + 1, + NULL, + NULL, + NULL); + while (1) { + ORTESleepMs(1000); + printf("Sampling publication, count %d\n", i); + sprintf(instance2Send,"Hello Universe! (%d)",i++); + ORTEPublicationSend(p); + } + return 0; +} + +#ifdef __RTL__ +void +hello_init(void) { + main(0,NULL); +} +void +hello_exit(void) { + ORTEDomainAppDestroy(d); +} +MODULE_LICENSE("GPL"); +module_init(hello_init); +module_exit(hello_exit); +#endif + diff --git a/orte/examples/reliable/ReliableSubscriber.c b/orte/examples/reliable/ReliableSubscriber.c new file mode 100644 index 0000000..bd61e66 --- /dev/null +++ b/orte/examples/reliable/ReliableSubscriber.c @@ -0,0 +1,88 @@ +/* + * $Id: ReliableSubscriber.c,v 0.0.0.1 2003/12/27 + * + * DEBUG: section ReliableSubscriber + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#ifdef __RTL__ + #include +#endif +#include "orte_api.h" + +ORTEDomain *d; +char instance2Recv[64]; + +void +recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) { + char *instance=(char*)vinstance; + + switch (info->status) { + case NEW_DATA: + printf("%s\n",instance); + break; + case DEADLINE: + printf("deadline occured\n"); + break; + } +} + + +int +main(int argc, char *args[]) { + ORTESubscription *s; + NtpTime deadline,minimumSeparation; + + ORTEInit(); + //ORTEVerbositySetOptions("ALL,10"); + d=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,NULL,NULL); + ORTETypeRegisterAdd(d,"HelloMsg",NULL,NULL,64); + NTPTIME_BUILD(deadline,3); + NTPTIME_BUILD(minimumSeparation,0); + s=ORTESubscriptionCreate( + d, + IMMEDIATE, + STRICT_RELIABLE, + "Reliable HelloMsg", + "HelloMsg", + &instance2Recv, + &deadline, + &minimumSeparation, + recvCallBack, + NULL); + #ifndef __RTL__ + while (1) + ORTESleepMs(1000); + #endif + return 0; +} + +#ifdef __RTL__ +void +hello_init(void) { + main(0,NULL); +} +void +hello_exit(void) { + ORTEDomainAppDestroy(d); +} +MODULE_LICENSE("GPL"); +module_init(hello_init); +module_exit(hello_exit); +#endif + diff --git a/orte/examples/reliable/msvc/m.bat b/orte/examples/reliable/msvc/m.bat new file mode 100755 index 0000000..8e93ba9 --- /dev/null +++ b/orte/examples/reliable/msvc/m.bat @@ -0,0 +1,4 @@ +del HelloWorldPublisher.exe +make /f makefile.msc +pause +HelloWorldPublisher.exe \ No newline at end of file diff --git a/orte/examples/reliable/msvc/makefile.msc b/orte/examples/reliable/msvc/makefile.msc new file mode 100644 index 0000000..ca789d6 --- /dev/null +++ b/orte/examples/reliable/msvc/makefile.msc @@ -0,0 +1,46 @@ +# --------------------------------------------------------------------- +# Microsoft C/C++ Installation Directory +# +# CHANGE this definition to point to your compiler's installation directory +# --------------------------------------------------------------------- +MSCDIR= d:\Progra~1\micros~2\vc98 + +CFLAGS = -c -Zi -MD $(INCLUDE) +LIB_CFLAGS= $(CFLAGS) -LD +INCLUDE= -I$(MSCDIR)\include -I..\..\..\include -I..\..\..\include\win32 +LIBS= $(MSCDIR)\lib\msvcrt.lib $(MSCDIR)\lib\uuid.lib $(MSCDIR)\lib\oldnames.lib \ + $(MSCDIR)\lib\kernel32.lib $(MSCDIR)\lib\libcd.lib $(MSCDIR)\lib\wsock32.lib \ + $(MSCDIR)\lib\advapi32.lib $(MSCDIR)\lib\ws2_32.lib\ + ..\..\..\contrib\win_pthread\pthreadVC.lib \ + ..\..\..\liborte\msvc\liborte.lib +CC= $(MSCDIR)\bin\cl +LINK= $(MSCDIR)\bin\link +LIBRARIAN= $(MSCDIR)\bin\lib + +TARGETS=HelloWorldPublisher.exe + +all : default + +default : $(TARGETS) + +HelloWorldPublisher.exe: ..\HelloWorldPublisher.obj + +# --------------------------------------------------------------------- +# Generic Compilation Rules +# +# Do NOT change anything below this point. +# --------------------------------------------------------------------- +#.SUFFIXES: .c .obj .exe + +.c.obj: + $(CC) $(CFLAGS) $< -Fo$*.obj + +.obj.exe: + $(LINK) -out:$@ $(ORTELIB) $< $(LIBS) + +clean : + del *.obj + del *.exe + del *.pdb + + diff --git a/orte/include/config.h.in b/orte/include/config.h.in new file mode 100644 index 0000000..67875b6 --- /dev/null +++ b/orte/include/config.h.in @@ -0,0 +1,151 @@ +/* orte/include/config.h.in. Generated from configure.in by autoheader. */ + +/* Define to enable comedi's RT support */ +#undef CONFIG_ORTE_RT + +/* Define if kernel is RTAI patched */ +#undef CONFIG_ORTE_RTAI + +/* Define if kernel is RTLinux patched */ +#undef CONFIG_ORTE_RTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ +#undef HAVE_LIBWS2_32 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_IF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WINSOCK2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WS2TCPIP_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#undef inline + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/orte/include/config.h.in~ b/orte/include/config.h.in~ new file mode 100644 index 0000000..feba5c1 --- /dev/null +++ b/orte/include/config.h.in~ @@ -0,0 +1,148 @@ +/* orte/include/config.h.in. Generated from configure.in by autoheader. */ + +/* Define to enable comedi's RT support */ +#undef CONFIG_ORTE_RT + +/* Define if kernel is RTAI patched */ +#undef CONFIG_ORTE_RTAI + +/* Define if kernel is RTLinux patched */ +#undef CONFIG_ORTE_RTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ +#undef HAVE_LIBWS2_32 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_IF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WINSOCK2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WS2TCPIP_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#undef inline + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/orte/include/config.h.undef b/orte/include/config.h.undef new file mode 100644 index 0000000..bf9def9 --- /dev/null +++ b/orte/include/config.h.undef @@ -0,0 +1,27 @@ +/* + * $Id: config.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _ORTE_CONFIG_H +#define _ORTE_CONFIG_H + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "ORTE 0.2.0" + +#endif /* _ORTE_CONFIG_H */ diff --git a/orte/include/defines.h b/orte/include/defines.h new file mode 100644 index 0000000..ec19f9b --- /dev/null +++ b/orte/include/defines.h @@ -0,0 +1,93 @@ +/* + * $Id: defines.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _DEFINES_H +#define _DEFINES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define RTPS_DEFAULT_PORT 7400 + +#define MAX_PARAMETER_LOCAL_LENGTH 8 //min 8 bytes !!! + +#define MAX_STRING_IPADDRESS_LENGTH 4*3+3+1 + +//#define ENABLE_MEM_CHECK + +////////////////////////////////////////////////////////////////////////////// +// Debug +#define MAX_DEBUG_SECTIONS 100 +#define MAX_DEBUG_LEVEL 10 +#define debug(SECTION, LEVEL) \ + ((LEVEL) > MAX_DEBUG_LEVEL) ? (void) 0 : \ + ((db_level = (LEVEL)) > debugLevels[SECTION]) ? (void) 0 : db_print +#ifndef ENABLE_MEM_CHECK + #define MALLOC malloc + #define FREE free +#else + #define MALLOC mem_check_malloc + #define FREE mem_check_free +#endif + +////////////////////////////////////////////////////////////////////////////// +// fnmatch +// We #undef these before defining them because some losing systems +// (HP-UX A.08.07 for example) define these in . +#undef FNM_PATHNAME +#undef FNM_NOESCAPE +#undef FNM_PERIOD +/* Bits set in the FLAGS argument to `fnmatch'. */ +#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ +#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ +#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ +#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +/* Value returned by `fnmatch' if STRING does not match PATTERN. */ +#define FNM_NOMATCH 1 + +////////////////////////////////////////////////////////////////////////////// +// Hash +#define HASH_LOADFACTOR 0.8 +// Deleted entry indicator +#define HASH_EMPTY 0x00000000 +#define HASH_INUSE 0x11111111 +#define HASH_DELETED 0xffffffff + +////////////////////////////////////////////////////////////////////////////// +// conv +#ifdef _WIN32 +/* Swap bytes in 16 bit value. */ +#define bswap_16(x) \ + ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) + +/* Swap bytes in 32 bit value. */ +#define bswap_32(x) \ + ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#endif + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _DEFINES_H */ diff --git a/orte/include/defines_api.h b/orte/include/defines_api.h new file mode 100644 index 0000000..28ca160 --- /dev/null +++ b/orte/include/defines_api.h @@ -0,0 +1,202 @@ +/* + * $Id: defines_api.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _DEFINES_API_H +#define _DEFINES_API_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_INTERFACES 5 + +#define ORTE_DEFAULT_DOMAIN 0 + +/* Sleep for Windows is a stupid loop with I/O :))) */ +#ifdef _WIN32 +/** + * ORTESleepMs - suspends calling thread for given time + * @x: time in miliseconds + */ +#include +#define ORTESleepMs(x) Sleep(x) +#else +#if defined(_OMK_UNIX) || defined(HAVE_UNISTD_H) + #include +#endif +#define ORTESleepMs(x) usleep(x*1000) +#endif + +/*****************************************************************/ +// Cmp two sequence numbers +// Return: 1 if sn1>sn2 +// -1 if sn1(sn2).high ? 1 : \ + ((sn1).high<(sn2).high ? -1 : \ + ((sn1).low>(sn2).low ? 1 : \ + ((sn1).low<(sn2).low ? -1 : 0))) \ + ) + +/*****************************************************************/ +#define SeqNumberInc(res,sn) { \ + (res) = (sn); \ + if (++(res).low==0) (res).high++; \ + } + + +/*****************************************************************/ +#define SeqNumberAdd(res,sn1,sn2) { \ + (res).low = (sn1).low+(sn2).low; \ + (res).high = (sn1).high+(sn2).high; \ + if (((res).low < (sn1).low) || \ + ((res).low < (sn2).low)) { \ + (res).high++; \ + } \ +} + +/*****************************************************************/ +#define SeqNumberDec(res,sn) { \ + (res) = (sn); \ + if ((res).low--==0) (res).high--; \ + } + +/*****************************************************************/ +#define SeqNumberSub(res,sn1,sn2) { \ + (res).low = (sn1).low-(sn2).low; \ + (res).high = (sn1).high-(sn2).high; \ + if ((res).low > (sn1).low) { \ + (res).high--; \ + } \ +} + +/*****************************************************************/ +#define NtpTimeCmp(time1, time2) \ +((((time1).seconds) > ((time2).seconds)) ? 1 : \ + ((((time1).seconds) < ((time2).seconds)) ? -1 : \ + ((((time1).fraction) > ((time2).fraction)) ? 1 : \ + ((((time1).fraction) < ((time2).fraction)) ? -1 : 0)))) + + +/*****************************************************************/ +#define NtpTimeAdd(res, time1, time2) { \ + (res).seconds = (time1).seconds + (time2).seconds; \ + (res).fraction = (time1).fraction + (time2).fraction; \ + if (((res).fraction < (time1).fraction) || \ + ((res).fraction < (time2).fraction)) { \ + (res).seconds++; \ + } \ +} + +/*****************************************************************/ +#define NtpTimeSub(res, time1, time2) { \ + (res).seconds = (time1).seconds - (time2).seconds; \ + (res).fraction = (time1).fraction - (time2).fraction; \ + if ((res).fraction > (time1).fraction) { \ + (res).seconds--; \ + } \ +} + +/*****************************************************************/ +/** + * NtpTimeAssembFromMs - converts seconds and miliseconds to NtpTime + * @time: time given in NtpTime structure + * @s: seconds portion of given time + * @msec: miliseconds portion of given time + */ +#define NtpTimeAssembFromMs(time, s, msec) { \ + register u_int32_t ms = msec; \ + (time).seconds = s; \ + (time).fraction = (ms<<22) + ((ms*393)<<8); \ +} + +/** + * NtpTimeDisAssembToMs - converts NtpTime to seconds and miliseconds + * @s: seconds portion of given time + * @msec: miliseconds portion of given time + * @time: time given in NtpTime structure + */ +#define NtpTimeDisAssembToMs(s, msec, time) { \ + s = (time).seconds; \ + msec = ((time).fraction - ((time).fraction>>6) - \ + ((time).fraction>>7) + (1<<21))>>22; \ + if ((msec) >= 1000 ) { (msec) -= 1000; (s)++; } \ +} + +/** + * NtpTimeAssembFromUs - converts seconds and useconds to NtpTime + * @time: time given in NtpTime structure + * @s: seconds portion of given time + * @usec: microseconds portion of given time + */ +#define NtpTimeAssembFromUs(time, s, usec) { \ + register u_int32_t us = usec; \ + (time).seconds = s; \ + (time).fraction = (us<<12)+ ((us*99)<<1)+ ((us*15 + ((us*61)>>7))>>4); \ +} + +/** + * NtpTimeDisAssembToUs - converts NtpTime to seconds and useconds + * @s: seconds portion of given time + * @usec: microseconds portion of given time + * @time: time given in NtpTime structure + */ +#define NtpTimeDisAssembToUs(s, usec, time) { \ + register u_int32_t NtpTemp = (time).fraction; \ + s = (time).seconds; \ + usec = ((time).fraction - (NtpTemp>>5)-(NtpTemp>>7)-(NtpTemp>>8)- \ + (NtpTemp>>9)-(NtpTemp>>10) - (NtpTemp>>12) - \ + (NtpTemp>>13)-(NtpTemp>>14) + (1<<11)) >> 12; \ + if ((usec) >= 1000000) { (usec) -= 1000000; (s)++; } \ +} + +/** + * Domain2Port - converts Domain value to IP Port value + * @domain: + * @port: + */ +#define Domain2Port(d,p) { \ + p = RTPS_DEFAULT_PORT + d*10; \ +} + +/** + * Domain2PortMulticastUserdata - converts Domain value to userdata IP Port value + * @domain: + * @port: + */ +#define Domain2PortMulticastUserdata(d,p) { \ + p = RTPS_DEFAULT_PORT + d*10+1; \ +} + +/** + * Domain2PortMulticastMetatraffic - converts Domain value to metatraffic IP Port value + * @domain: + * @port: + */ +#define Domain2PortMulticastMetatraffic(d,p) { \ + p = RTPS_DEFAULT_PORT + d*10+2; \ +} + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _DEFINES_API_H */ diff --git a/orte/include/ew_types.h b/orte/include/ew_types.h new file mode 100644 index 0000000..2179244 --- /dev/null +++ b/orte/include/ew_types.h @@ -0,0 +1,40 @@ +/* + * $Id: ew_types.h,v 0.0.0.1 2003/09/10 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _EW_TYPES_H +#define _EW_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define u_int8_t unsigned char +#define int8_t char +#define u_int16_t unsigned short +#define int16_t short +#define u_int32_t unsigned int +#define int32_t int + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _MSC_TYPES_H */ + diff --git a/orte/include/globals.h b/orte/include/globals.h new file mode 100644 index 0000000..129b70f --- /dev/null +++ b/orte/include/globals.h @@ -0,0 +1,39 @@ +/* + * $Id: globals.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _GLOBALS_H +#define _GLOBALS_H + +#ifdef __cplusplus +extern "C" { +#endif + +//debug.c +extern int db_level; +extern int debugLevels[MAX_DEBUG_SECTIONS]; +extern int mem_check_counter; +extern NtpTime zNtpTime,iNtpTime; +extern SequenceNumber noneSN; + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _GLOBALS_H */ diff --git a/orte/include/orte.h b/orte/include/orte.h new file mode 100644 index 0000000..ec26038 --- /dev/null +++ b/orte/include/orte.h @@ -0,0 +1,55 @@ +/* + * $Id: orte.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _ORTE_H +#define _ORTE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "orte_all.h" +#include "ul_gavl.h" +#include "ul_gavlcust.h" +#include "ul_gavlflesint.h" +#include "ul_gavlrepcust.h" +#include "ul_list.h" +#include "typedefs_defines_rtps.h" +#include "ul_htimer.h" //after typedefs_defines_rtps.h +#include "defines.h" +#include "defines_api.h" +#include "typedefs_api.h" +#include "typedefs.h" +#include "protos.h" +#include "protos_api.h" +#include "globals.h" + + +#if WORDS_BIGENDIAN + #define ORTE_MY_MBO 0 //ORTE my Machine Byte Order - big endian +#else + #define ORTE_MY_MBO 1 //ORTE my Machine Byte Order - little endian +#endif + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _ORTE_H */ diff --git a/orte/include/orte_all.h b/orte/include/orte_all.h new file mode 100644 index 0000000..5b1dce5 --- /dev/null +++ b/orte/include/orte_all.h @@ -0,0 +1,157 @@ +/* + * $Id: orte_all.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _ORTE_ALL_H +#define _ORTE_ALL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __RTL__ +#ifdef HAVE_CONFIG_H + #define _GNU_SOURCE + #define SOCK_BSD + #include "config.h" +#endif +#ifdef HAVE_UNISTD_H + #include +#endif +#ifdef HAVE_STDIO_H + #include +#endif +#ifdef HAVE_STDLIB_H + #include +#endif +#ifdef HAVE_STRING_H + #include +#endif +#ifdef HAVE_SOCKET + #include +#endif +#ifdef HAVE_NETDB_H + #include +#endif +#ifdef HAVE_NET_IF_H + #include +#endif +#ifdef HAVE_NETINET_IN_H + #include +#endif +#ifdef HAVE_ARPA_INET_H + #include +#endif +#ifdef HAVE_FCNTL_H + #include +#endif +#ifdef HAVE_SYS_IOCTL_H + #include +#endif +#ifdef HAVE_SYS_TIME_H + #include +#endif +#ifdef HAVE_PTHREAD_H + #include +#endif +#ifdef HAVE_SYS_TYPES_H + #include +#endif +#ifdef HAVE_BYTESWAP_H + #include +#endif +#ifdef HAVE_STDARG_H + #include +#endif +#ifdef HAVE_CTYPE_H + #include +#endif +#ifdef HAVE_WINSOCK2_H + #include +#endif +#ifdef HAVE_WS2TCPIP_H + #include +#endif +#endif + + +#ifdef _WIN32 + #ifndef HAVE_CONFIG_H + #include "config.h.undef" + #if defined(_MSC_VER) || defined (_OMK_UNIX) + #ifndef inline + #define inline _inline + #endif + #include + #include + #include + #include + #include + #include + #endif + #endif + #include + #include + #include + #define ioctl ioctlsocket + #undef SOCK_BSD + #define SOCK_WIN +#elif defined __RTL__ + #include "config.h.undef" + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #define SOCK_RTL +#elif defined _OMK_UNIX + #define _GNU_SOURCE + #include "config.h.undef" + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #define SOCK_BSD +#endif + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _ORTE_ALL_H */ diff --git a/orte/include/orte_api.h b/orte/include/orte_api.h new file mode 100644 index 0000000..039d7fe --- /dev/null +++ b/orte/include/orte_api.h @@ -0,0 +1,51 @@ +/* + * $Id: orte_api.h.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _ORTE_API_H +#define _ORTE_API_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H + #include +#endif +#ifdef _OMK_UNIX + #define HAVE_SYS_TYPES_H +#endif +#ifdef HAVE_SYS_TYPES_H + #include +#endif +#ifdef _WIN32 + #include +#elif defined __RTL__ + #include +#endif +#include "typedefs_defines_rtps.h" +#include "defines_api.h" +#include "typedefs_api.h" +#include "protos_api.h" + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _ORTE_API_H */ diff --git a/orte/include/protos.h b/orte/include/protos.h new file mode 100644 index 0000000..ba9dbe4 --- /dev/null +++ b/orte/include/protos.h @@ -0,0 +1,476 @@ +/* + * $Id: protos.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _PROTOS_H +#define _PROTOS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////// +// sock.c +extern int +sock_start(void); +extern void +sock_finish(void); +extern int +sock_init_udp(sock_t *sock); +extern void +sock_cleanup(sock_t *sock); +extern int +sock_setsockopt(sock_t *sock,int optname,const char *optval, int optlen); +extern int +sock_getsockopt(sock_t *sock,int optname,char *optval, int *optlen); +extern int +sock_bind(sock_t *sock,u_int16_t port); +extern int +sock_recvfrom(sock_t *sock, void *buf, int max_len,struct sockaddr_in *des,int des_len); +extern int +sock_sendto(sock_t *sock, void *buf, int len,struct sockaddr_in *des,int des_len); +extern int +sock_ioctl(sock_t *sock, int cmd, int *arg); +extern int +sock_get_local_interfaces(sock_t *sock,ORTEIFProp *IFProp,char *IFCount); + +/////////////////////////////////////////////////////////////////////////////// +// conv.c +extern void +conv_u16(u_int16_t *x,char ef); +extern void +conv_u32(u_int32_t *x,char ef); +extern void +conv_sn(SequenceNumber *sn,char ef); +extern void +conv_ntp(NtpTime *ntp,char ef); + +/////////////////////////////////////////////////////////////////////////////// +// htimerNtp.c +// htimerRoot +UL_HTIMER_DEC(htimerRoot, \ + ObjectEntry, \ + HTimFncRootNode, \ + htimRoot, \ + htim) +extern void +htimerRoot_run_expired(ORTEDomain *d, + ul_htim_time_t *pact_time); +// htimerUnicastCommon +UL_HTIMER_DEC(htimerUnicastCommon, \ + ObjectEntryAID, \ + HTimFncUserNode, \ + htimUnicast.common, \ + htim) +extern void +htimerUnicastCommon_update_root_timer(ObjectEntry *objectEntry, + ObjectEntryAID *objectEntryAID); +extern void +htimerUnicastCommon_run_expired(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + ul_htim_time_t *pact_time); +// htimerUnicastSendMetatraffic +UL_HTIMER_DEC(htimerUnicastSendMetatraffic, \ + ObjectEntryAID, \ + HTimFncUserNode, \ + htimUnicast.sendMetatraffic, \ + htim) +extern void +htimerUnicastSendMetatraffic_update_root_timer(ObjectEntry *objectEntry, + ObjectEntryAID *objectEntryAID); +extern void +htimerUnicastSendMetatraffic_run_expired(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + ul_htim_time_t *pact_time); +// htimerUnicastSendUserData +UL_HTIMER_DEC(htimerUnicastSendUserData, \ + ObjectEntryAID, \ + HTimFncUserNode, \ + htimUnicast.sendUserData, \ + htim) +extern void +htimerUnicastSendUserData_update_root_timer(ObjectEntry *objectEntry, + ObjectEntryAID *objectEntryAID); +extern void +htimerUnicastSendUserData_run_expired(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + ul_htim_time_t *pact_time); +extern NtpTime +getActualNtpTime(void); + + +/////////////////////////////////////////////////////////////////////////////// +// debug.c +extern void +db_init(const char *logfile, const char *options); +extern void +debug_options(const char *options); +extern void +db_print(const char *format,...); +extern void +debug_open_log(const char *logfile); +#ifdef ENABLE_MEM_CHECK +extern void * +mem_check_malloc(size_t size); +extern void +mem_check_free(void *ptr); +#endif + +/////////////////////////////////////////////////////////////////////////////// +// fnmatch.c +extern int +fnmatch(const char *__pattern,const char *__string,int __flags); + +/////////////////////////////////////////////////////////////////////////////// +// objectEntry.c +GAVL_CUST_NODE_INT_DEC(ObjectEntryHID, ObjectEntry, ObjectEntryHID, HostId, + objRoot, hidNode, hid, gavl_cmp_int) +GAVL_CUST_NODE_INT_DEC(ObjectEntryAID, ObjectEntryHID, ObjectEntryAID, AppId, + aidRoot, aidNode, aid, gavl_cmp_int) +GAVL_CUST_NODE_INT_DEC(ObjectEntryOID, ObjectEntryAID, ObjectEntryOID, ObjectId, + oidRoot, oidNode, oid, gavl_cmp_int) +extern void +objectEntryRefreshApp(ORTEDomain *d,ObjectEntryOID *objectEntryOID); +extern ObjectEntryOID * +objectEntryFind(ORTEDomain *d,GUID_RTPS *guid); +extern ObjectEntryOID * +objectEntryAdd(ORTEDomain *d,GUID_RTPS *guid,void *params); +extern int +objectEntryDelete(ORTEDomain *d,ObjectEntryOID *objectEntryOID); +extern void +objectEntryDeleteAll(ORTEDomain *d,ObjectEntry *objectEntry); +extern void +objectEntryDump(ObjectEntry *objectEntry); + +/////////////////////////////////////////////////////////////////////////////// +// ObjectUtils.c +extern void +AppParamsInit(AppParams *ap); +extern void +PublParamsInit(ORTEPublProp *sp); +extern void +SubsParamsInit(ORTESubsProp *sp); +extern void +updateORTEAppInfo(AppParams *appParams,ORTEAppInfo *appInfo); +extern Boolean +generateEvent(ORTEDomain *d,GUID_RTPS *guid,void *params,Boolean live); +extern Boolean +getTypeApp(ORTEDomain *d,AppParams *ap,IPAddress senderIPAddress); +extern void +appSelfParamChanged(ORTEDomain *d,Boolean lock,Boolean unlock,Boolean forWM); + +/////////////////////////////////////////////////////////////////////////////// +// event.c +extern int32_t +eventAdd(ORTEDomain *d,ObjectEntryAID *objectEntryAID,HTimFncUserNode *fncNode, + int where,const char *name,EVH2 *func,pthread_rwlock_t *lock, + void *arg1,NtpTime *when_expire); +extern int32_t +eventDetach(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + HTimFncUserNode *fncNode, + int where); + +/////////////////////////////////////////////////////////////////////////////// +// parameter.c +UL_LIST_CUST_DEC(CSChangeAttributes, + CSChange,ParameterSequence, + attributes,node); +extern int +parameterDelete(CSChange *csChange); +extern int +parameterCodeStreamFromCSChange(CSChange *csChange, + u_int8_t *rtps_msg,u_int32_t max_msg_len); +extern int +parameterDecodeStreamToCSChange(CSChange *csChange,u_int8_t *rtps_msg, + u_int16_t submsg_len,u_int8_t needByteSwap); +extern int +parameterUpdateCSChange( + CSChange *csChange,AppParams *ap,Boolean Manager); +extern int +parameterUpdateCSChangeFromPublication(CSChange *csChange,ORTEPublProp *pp); +extern int +parameterUpdateCSChangeFromSubscription(CSChange *csChange,ORTESubsProp *sp); +extern int +parameterUpdateApplication(CSChange *csChange,AppParams *ap); +extern int +parameterUpdatePublication(CSChange *csChange,ORTEPublProp *pp); +extern int +parameterUpdateSubscription(CSChange *csChange,ORTESubsProp *sp); + +/////////////////////////////////////////////////////////////////////////////// +// objectEntryTimer.c +extern int +objectEntryPurgeTimer(ORTEDomain *d,void *vobjectEntryOID); +extern int +objectEntryExpirationTimer(ORTEDomain *d,void *vobjectEntryOID); + +/////////////////////////////////////////////////////////////////////////////// +// ORTETypeRegister.c +GAVL_CUST_NODE_INT_DEC(ORTEType, TypeEntry, TypeNode, char *, + types, node, typeRegister.typeName, gavl_cmp_str) + + +/////////////////////////////////////////////////////////////////////////////// +// ORTEThreadUtils.c +extern void +ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,u_int16_t port); +extern void +ORTEDomainWakeUpSendingThread(ObjectEntry *objectEntry); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEAppRecvMetatrafficThread.c +extern void +ORTEAppRecvMetatrafficThread(ORTEDomain *d); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEAppRecvUserdataThread.c +extern void +ORTEAppRecvUserdataThread(ORTEDomain *d); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEAppSendThread.c +extern void +ORTESendData(ORTEDomain *d,ObjectEntryAID *objectEntryAID,Boolean meta); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSHeader.c +extern int16_t +RTPSHeaderCreate(u_int8_t *msg,HostId hid,AppId aid); +extern int16_t +RTPSHeaderCheck(u_int8_t *msg,int32_t len,MessageInterpret *mi); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSPad.c +extern void +RTPSPad(u_int8_t *rtps_msg,MessageInterpret *mi); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSInfoDST.c +extern void +RTPSInfoDST(u_int8_t *rtps_msg,MessageInterpret *mi); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSInfoREPLY.c +extern void +RTPSInfoREPLY(u_int8_t *rtps_msg,MessageInterpret *mi); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSInfoREPLY.c +extern int32_t +RTPSInfoREPLYCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len, + IPAddress ipaddress,Port port); +extern void +RTPSInfoSRC(u_int8_t *rtps_msg,MessageInterpret *mi); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSInfoTS.c +extern int32_t +RTPSInfoTSCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,NtpTime time); +extern void +RTPSInfoTS(u_int8_t *rtps_msg,MessageInterpret *mi); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSVar.c +extern void +RTPSVar(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSAck.c +extern int32_t +RTPSAckCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len, + SequenceNumber *seqNumber, + ObjectId roid,ObjectId woid,Boolean f_bit); +extern void +RTPSAck(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSHeardBeat.c +extern int +RTPSHeardBeatCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len, + SequenceNumber *firstSeqNumber,SequenceNumber *lastSeqNumber, + ObjectId woid,ObjectId roid,Boolean f_bit); +extern void +RTPSHeardBeat(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSGap.c +extern void +RTPSGap(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSIssue.c +extern int32_t +RTPSIssueCreateHeader(u_int8_t *rtps_msg,u_int32_t max_msg_len,u_int32_t length, + ObjectId roid,ObjectId woid,SequenceNumber sn); +extern void +RTPSIssue(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSUtils.c +extern int gavl_cmp_ntp_time(const NtpTime *a,const NtpTime *b); +extern int gavl_cmp_sn(const SequenceNumber *a, const SequenceNumber *b); +extern int gavl_cmp_guid(const GUID_RTPS *a, const GUID_RTPS *b); +extern int gavl_cmp_str(char *const *a,char *const *b); +extern int getMaxMessageLength(ORTEDomain *d); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSCSTWriter.c +UL_LIST_CUST_DEC(CSTWriterCSChange, + CSTWriter,CSChange, + csChanges,nodeList); +GAVL_CUST_NODE_INT_DEC(CSTWriter, + CSTPublications, CSTWriter, GUID_RTPS, + cstWriter, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_DEC(CSTRemoteReader, + CSTWriter, CSTRemoteReader, GUID_RTPS, + cstRemoteReader, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_DEC(CSChangeForReader, + CSTRemoteReader, CSChangeForReader, SequenceNumber, + csChangeForReader, node, csChange->sn, gavl_cmp_sn); + +extern void +CSTWriterInit(ORTEDomain *d,CSTWriter *cstWriter,ObjectEntryOID *object, + ObjectId oid,CSTWriterParams *params,ORTETypeRegister *typeRegister); +extern void +CSTWriterDelete(ORTEDomain *d,CSTWriter *cstWriter); +extern void +CSTWriterAddRemoteReader(ORTEDomain *d,CSTWriter *cstWriter,ObjectEntryOID *object, + ObjectId oid); +extern void +CSTWriterDestroyRemoteReader(ORTEDomain *d,CSTRemoteReader *cstRemoteReader); +extern void +CSTWriterMakeGAP(ORTEDomain *d,CSTWriter *cstWriter,GUID_RTPS *guid); +extern void +CSTWriterAddCSChange(ORTEDomain *d,CSTWriter *cstWriter,CSChange *csChange); +extern void +CSTWriterDestroyCSChangeForReader(CSTRemoteReader *cstRemoteReader, + CSChangeForReader *csChangeForReader,Boolean destroyCSChange); +extern void +CSTWriterDestroyCSChange(ORTEDomain *d,CSTWriter *cstWriter,CSChange *csChange); +extern Boolean +CSTWriterTryDestroyBestEffortIssue(CSTWriter *cstWriter); +extern void +CSTWriterRefreshAllCSChanges(ORTEDomain *d,CSTRemoteReader *cstRemoteReader); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSCSTWriterTimer.c +extern int +CSTWriterRefreshTimer(ORTEDomain *d,void *vcstWriter); +extern int +CSTWriterAnnounceTimer(ORTEDomain *d,void *vcstRemoteReader); +extern int +CSChangeForReaderUnderwayTimer(ORTEDomain *da,void *vcsChangeForReader); +extern int +CSTWriterSendBestEffortTimer(ORTEDomain *d,void *vcstRemoteReader); +extern int +CSTWriterSendStrictTimer(ORTEDomain *d,void *vcstRemoteReader); +extern int +CSTWriterSendTimer(ORTEDomain *d,void *vcstRemoteReader); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSCSTReader.c +UL_LIST_CUST_DEC(CSTReaderCSChange, + CSTReader,CSChange, + csChanges,nodeList); +GAVL_CUST_NODE_INT_DEC(CSTReader, + CSTSubscriptions, CSTReader, GUID_RTPS, + cstReader, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_DEC(CSTRemoteWriter, + CSTReader, CSTRemoteWriter, GUID_RTPS, + cstRemoteWriter, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_DEC(CSChangeFromWriter, + CSTRemoteWriter, CSChangeFromWriter, SequenceNumber, + csChangeFromWriter, node, csChange->sn, gavl_cmp_sn); +extern void +CSTReaderInit(ORTEDomain *d,CSTReader *cstReader,ObjectEntryOID *object, + ObjectId oid,CSTReaderParams *params,ORTETypeRegister *typeRegister); +extern void +CSTReaderDelete(ORTEDomain *d,CSTReader *cstReader); +extern CSTRemoteWriter * +CSTReaderAddRemoteWriter(ORTEDomain *d,CSTReader *cstReader,ObjectEntryOID *object, + ObjectId oid); +extern void +CSTReaderDestroyRemoteWriter(ORTEDomain *d,CSTRemoteWriter *cstRemoteWriter); +extern void +CSTReaderAddCSChange(CSTRemoteWriter *cstRemoteWriter,CSChange *csChange); +extern void +CSTReaderDestroyCSChangeFromWriter(CSTRemoteWriter *cstRemoteWriter, + CSChangeFromWriter *csChangeFromWriter,Boolean keepCSChange); +extern void +CSTReaderDestroyCSChange(CSTRemoteWriter *cstRemoteWriter,SequenceNumber *sn, + Boolean keepCSChange); +extern void +CSTReaderSetupState(CSTRemoteWriter *cstRemoteWriter); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSCSTReaderProc.c +extern void +CSTReaderProcCSChanges(ORTEDomain *d,CSTRemoteWriter *cstRemoteWriter); +extern void +CSTReaderProcCSChangesIssue(CSTRemoteWriter *cstRemoteWriter,Boolean pullCalled); + +/////////////////////////////////////////////////////////////////////////////// +// RTPSCSTReaderTimer.c +extern int +CSTReaderResponceTimer(ORTEDomain *d,void *vcstRemoteWriter); +extern int +CSTReaderQueryTimer(ORTEDomain *d,void *vcstRemoteWriter); +extern int +CSTReaderDeadlineTimer(ORTEDomain *d,void *vcstReader); +extern int +CSTReaderPersistenceTimer(ORTEDomain *d,void *vcstReader); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEDomainApp.c +UL_LIST_CUST_DEC(SubscriptionPattern, + PatternEntry,SubscriptionPatternNode, + subscription,node); + + +/////////////////////////////////////////////////////////////////////////////// +// ORTETypeRegister.c +extern Boolean +ORTETypeRegisterFind(ORTEDomain *d,char *typeName); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEPublication.c +GAVL_CUST_NODE_INT_DEC(PublicationList, + PSEntry, ObjectEntryOID, GUID_RTPS, + publications, psNode, guid, gavl_cmp_guid); +extern int +ORTEPublicationSendLocked(ORTEPublication *cstWriter); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEPublicationTimer.c +extern int +PublicationCallBackTimer(ORTEDomain *d,void *vcstWriter); + +/////////////////////////////////////////////////////////////////////////////// +// ORTESubscription.c +GAVL_CUST_NODE_INT_DEC(SubscriptionList, + PSEntry, ObjectEntryOID, GUID_RTPS, + subscriptions, psNode, guid, gavl_cmp_guid); + + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _PROTOS_H */ diff --git a/orte/include/protos_api.h b/orte/include/protos_api.h new file mode 100644 index 0000000..7bea748 --- /dev/null +++ b/orte/include/protos_api.h @@ -0,0 +1,146 @@ +/* + * $Id: protos_api.h,v 0.0.0.1 2003/09/10 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _PROTOS_API_H +#define _PROTOS_API_H + +#ifdef __cplusplus +extern "C" { +#endif + +/////////////////////////////////////////////////////////////////////////////// +// conv.c +extern char* +IPAddressToString(IPAddress ipAddress); +extern IPAddress +StringToIPAddress(const char *string); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEDomain.c +extern Boolean +ORTEDomainPropDefaultGet(ORTEDomainProp *prop); +extern Boolean +ORTEDomainInitEvents(ORTEDomainAppEvents *events); +extern Boolean +ORTEPublPropDefaultGet(ORTEDomain *d,ORTEPublProp *pp); +extern Boolean +ORTEPublPropDefaultSet(ORTEDomain *d,ORTEPublProp *pp); +extern Boolean +ORTESubsPropDefaultGet(ORTEDomain *d,ORTESubsProp *sp); +extern Boolean +ORTESubsPropDefaultSet(ORTEDomain *d,ORTESubsProp *sp); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEDomainApp.c +extern ORTEDomain * +ORTEDomainAppCreate(int domain,ORTEDomainProp *prop,ORTEDomainAppEvents *events); +extern Boolean +ORTEDomainAppDestroy(ORTEDomain *d); +extern Boolean +ORTEDomainAppSubscriptionPatternAdd(ORTEDomain *d,const char *topic, + const char *type,ORTESubscriptionPatternCallBack subscriptionCallBack, + void *param); +extern Boolean +ORTEDomainAppSubscriptionPatternRemove(ORTEDomain *d,const char *topic, + const char *type); +extern Boolean +ORTEDomainAppSubscriptionPatternDestroyAll(ORTEDomain *d); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEDomainMgr.c +extern ORTEDomain * +ORTEDomainMgrCreate(int domain, ORTEDomainProp *prop, + ORTEDomainAppEvents *events,Boolean startSendingThread); +extern Boolean +ORTEDomainMgrDestroy(ORTEDomain *d); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEPublication.c +extern ORTEPublication * +ORTEPublicationCreate(ORTEDomain *d,char *topic,char *typeName, + void *instance,NtpTime *persistence,int strength, + ORTESendCallBack sendCallBack,void *sendCallBackParam, + NtpTime *sendCallBackDelay); +extern int +ORTEPublicationDestroy(ORTEPublication *cstWriter); +extern int +ORTEPublicationPropertiesGet(ORTEPublication *cstWriter,ORTEPublProp *pp); +extern int +ORTEPublicationPropertiesSet(ORTEPublication *cstWriter,ORTEPublProp *pp); +extern int +ORTEPublicationWaitForSubscriptions(ORTEPublication *cstWriter,NtpTime wait, + unsigned int retries,u_int32_t noSubscriptions); +extern int +ORTEPublicationGetStatus(ORTEPublication *cstWriter,ORTEPublStatus *status); +extern int +ORTEPublicationSend(ORTEPublication *cstWriter); + +/////////////////////////////////////////////////////////////////////////////// +// ORTESubscription.c +extern ORTESubscription * +ORTESubscriptionCreate(ORTEDomain *d,SubscriptionMode mode,SubscriptionType sType, + char *topic,char *typeName,void *instance,NtpTime *deadline, + NtpTime *minimumSeparation,ORTERecvCallBack recvCallBack, + void *recvCallBackParam); +extern int +ORTESubscriptionDestroy(ORTESubscription *cstReader); +extern int +ORTESubscriptionPropertiesGet(ORTESubscription *cstReader,ORTESubsProp *sp); +extern int +ORTESubscriptionPropertiesSet(ORTESubscription *cstReader,ORTESubsProp *sp); +extern int +ORTESubscriptionWaitForPublications(ORTESubscription *cstReader,NtpTime wait, + unsigned int retries,unsigned int noPublications); +extern int +ORTESubscriptionGetStatus(ORTESubscription *cstReader,ORTESubsStatus *status); +extern int +ORTESubscriptionPull(ORTESubscription *cstReader); + +/////////////////////////////////////////////////////////////////////////////// +// ORTETypeRegister.c +extern int +ORTETypeRegisterAdd(ORTEDomain *d,char *typeName,ORTETypeSerialize ts, + ORTETypeDeserialize ds,unsigned int gms); +extern int +ORTETypeRegisterDestroyAll(ORTEDomain *d); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEVerbosity.c +extern void +ORTEVerbositySetOptions(const char *options); +extern void +ORTEVerbositySetLogFile(const char *arg); + + +/////////////////////////////////////////////////////////////////////////////// +// ORTEInit.c +extern void +ORTEInit(void); + +/////////////////////////////////////////////////////////////////////////////// +// ORTEAppSendThread.c +extern void +ORTEAppSendThread(ORTEDomain *d); + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _PROTOS_API_H */ diff --git a/orte/include/rtl/compat.h b/orte/include/rtl/compat.h new file mode 100644 index 0000000..edf45af --- /dev/null +++ b/orte/include/rtl/compat.h @@ -0,0 +1,60 @@ +/* + * $Id: compat.h,v 0.0.0.1 2003/12/19 + * + * AUTHOR: Michal Sojka sojka1@fel.cvut.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _COMPAT_H +#define _COMPAT_H + +#include "defines.h" //macro MALLOC + +#define printf rtl_printf +#define gettimeofday(tv, tz) do_gettimeofday(tv) +#define setsockopt(a, b, c, d, e) (-1) +#define getsockopt(a, b, c, d, e) (-1) +#define ioctl(a, b, c) (-1) + +static inline +char *strdup(char *str) { + char *tmp; + + tmp = MALLOC(strlen(str) + 1); + if (tmp) + memcpy(tmp, str, strlen(str) + 1); + return tmp; +} + +static inline int +atoi(char *s) { + int i = 0; + int neg = 0; + + while (isspace(*s)) s++; + if (*s == '-') { + neg = 1; + s++; + } else + if (*s == '+') { + s++; + } + while (isdigit(*s)) + i = i*10 + *s++ - '0'; + return neg ? -i : i; +} + +#endif /* _COMPAT_H */ diff --git a/orte/include/rtl/rwlock.h b/orte/include/rtl/rwlock.h new file mode 100644 index 0000000..c0ae53d --- /dev/null +++ b/orte/include/rtl/rwlock.h @@ -0,0 +1,79 @@ +/* + * $Id: rwlock.h,v 0.0.0.1 2003/12/19 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _RWLOCK_H +#define _RWLOCK_H + +#define PTW32_RWLOCK_MAGIC 0xfacade2 +#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) -1) + +typedef struct pthread_rwlock_t_ *pthread_rwlock_t; +typedef struct pthread_rwlockattr_t_ *pthread_rwlockattr_t; +struct pthread_rwlock_t_ { + pthread_mutex_t mtxExclusiveAccess; + pthread_mutex_t mtxSharedAccessCompleted; + pthread_cond_t cndSharedAccessCompleted; + int nSharedAccessCount; + int nExclusiveAccessCount; + int nCompletedSharedAccessCount; + int nMagic; +}; + +struct pthread_rwlockattr_t_ { + int pshared; +}; +extern void ptw32_rwlock_cancelwrwait(void * arg); + +extern inline int +ptw32_rwlock_check_need_init(pthread_rwlock_t *rwlock); + +extern int pthread_rwlock_init(pthread_rwlock_t *lock, + const pthread_rwlockattr_t *attr); + +extern int pthread_rwlock_destroy(pthread_rwlock_t *lock); + +extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); + +extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); + +extern int pthread_rwlock_rdlock(pthread_rwlock_t *lock); + +extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + +extern int pthread_rwlock_wrlock(pthread_rwlock_t *lock); + +extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + +extern int pthread_rwlock_unlock(pthread_rwlock_t *lock); + +extern int pthread_rwlockattr_init(pthread_rwlockattr_t * attr); + +extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t * attr); + +extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * attr, + int *pshared); + +extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr, + int pshared); + + +#endif /* _RWLOCK_H */ diff --git a/orte/include/typedefs.h b/orte/include/typedefs.h new file mode 100644 index 0000000..b010c9c --- /dev/null +++ b/orte/include/typedefs.h @@ -0,0 +1,473 @@ +/* + * $Id: typedefs.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _TYPEDEFS_H +#define _TYPEDEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * struct sock_t - + */ +typedef struct sock_t { + int fd; + u_int16_t port; +} sock_t; + +/** + * struct - MessageBuffer + */ +typedef struct MessageBuffer { + ORTECDRStream cdrStream; + ORTECDRStream *cdrStreamDirect; + Boolean needSend; + Boolean containsInfoReply; +} MessageBuffer; +/** + * struct TaskProp - + */ +typedef struct TaskProp { + sock_t sock; + pthread_t thread; + Boolean terminate; +} TaskProp; + + +/** + * struct typeEntry - + */ +typedef struct TypeEntry { + gavl_cust_root_field_t types; //Types + pthread_rwlock_t lock; +} TypeEntry; + +/** + * struct typeNode - + */ +typedef struct TypeNode { + gavl_node_t node; + ORTETypeRegister typeRegister; +} TypeNode; + +/** + * struct SubscriptionPatternNode - + */ +typedef struct SubscriptionPatternNode { + ul_list_node_t node; + PathName topic; + TypeName type; + ORTESubscriptionPatternCallBack subscriptionCallBack; + void *param; +} SubscriptionPatternNode; + +/** + * struct PatternEntry - + */ +typedef struct PatternEntry { + ul_list_head_t subscription; + ORTEPatternCheck check; + ORTEPatternMatch match; + void *param; +} PatternEntry; + +/** + * struct AppParams - Manager & ManagedApplication + */ +typedef struct AppParams { + HostId hostId; + AppId appId; + IPAddress unicastIPAddressList[MAX_INTERFACES]; + unsigned char unicastIPAddressCount; + IPAddress metatrafficMulticastIPAddressList[MAX_INTERFACES]; + unsigned char metatrafficMulticastIPAddressCount; + IPAddress managerKeyList[MAX_INTERFACES];//useful only for manager + unsigned char managerKeyCount; //useful only for manager + Port metatrafficUnicastPort; + Port userdataUnicastPort; + VendorId vendorId; + ProtocolVersion protocolVersion; + NtpTime expirationTime; + SequenceNumber vargAppsSequenceNumber; //useful only for manager +} AppParams; + +typedef struct ObjectEntryOID ObjectEntryOID; +typedef struct ObjectEntryHID ObjectEntryHID; +typedef struct ObjectEntryAID ObjectEntryAID; +typedef struct ObjectEntry ObjectEntry; + +typedef void EVH1(ORTEDomain *,ObjectEntryAID *,ul_htim_time_t *); +/** + * struct HTimFncRootNode - + */ +typedef struct HTimFncRootNode { + ul_htim_node_t htim; + const char *name; + EVH1 *func; + ObjectEntryAID *objectEntryAID; +} HTimFncRootNode; + +/** + * struct HTimNode - + */ +typedef struct HTimNode { + ul_htim_queue_t common; //timing queue for a timer function + HTimFncRootNode commonNode; //root node + ul_htim_queue_t sendMetatraffic; //timing queue for sendMetatraffic + HTimFncRootNode sendMetatrafficNode; //root node + ul_htim_queue_t sendUserData; //timing queue for sendUserData + HTimFncRootNode sendUserDataNode; //root node +} HTimNode; + +/** + * struct HTimFncUserNode - + */ +typedef int EVH2(ORTEDomain *,void *); +typedef struct HTimFncUserNode { + ul_htim_node_t htim; + const char *name; + pthread_rwlock_t *lock; //when func share params, lock is called before call the func + EVH2 *func; + void *arg1; +} HTimFncUserNode; + +/** + * struct ObjectEntry - Tree of objects + */ +struct ObjectEntryOID{ + gavl_node_t oidNode; + ObjectId oid; + GUID_RTPS guid; //for easy access to guid + //Object + ObjectEntryAID *objectEntryAID; + ObjectEntryHID *objectEntryHID; + void *attributes; //atributes of object + Boolean appMOM; + Boolean private; //object created by me self app + HTimFncUserNode expirationPurgeTimer; + //only for private CSTPublication,CSTSubscription + void *instance; //data stream + ORTERecvCallBack recvCallBack; + ORTESendCallBack sendCallBack; + void *callBackParam; + NtpTime sendCallBackDelay; + HTimFncUserNode sendCallBackDelayTimer; + //only for list of publishers or subscribers + gavl_node_t psNode; +}; +struct ObjectEntryAID { + gavl_node_t aidNode; + AppId aid; + HTimNode htimUnicast; //parameters for Unicast + gavl_cust_root_field_t oidRoot; +}; +struct ObjectEntryHID{ + gavl_node_t hidNode; + HostId hid; + gavl_cust_root_field_t aidRoot; +}; +struct ObjectEntry{ + gavl_cust_root_field_t objRoot; //root of tree objects + pthread_rwlock_t objRootLock; + ul_htim_queue_t htimRoot; //root of tree htimers + pthread_rwlock_t htimRootLock; + pthread_mutex_t htimSendMutex; //for wake up + Boolean htimNeedWakeUp; +}; + +/** + * struct ParameterSequence - + */ +typedef struct ParameterSequence { + ul_list_node_t node; + ParameterId parameterID; + ParameterLength parameterLength; + u_char parameterLocal[MAX_PARAMETER_LOCAL_LENGTH]; + u_char *parameter; +} ParameterSequence; + +/** + * struct CSChange - + */ +typedef struct CSChange { + ul_list_node_t nodeList; + gavl_node_t nodeGAVL; + SequenceNumber sn; + GUID_RTPS guid; + Boolean alive; + SequenceNumber gapSN; //>0 means sn is in GAP + // 1 - sn is gap, 2 - sn,sn+1 are gaps, ... + ul_list_head_t attributes; + ORTECDRStream cdrStream; //for issue + //how many times was a cstRemoteWriter acknowledged + int remoteReaderCount; + int remoteReaderProcBest; + int remoteReaderProcStrict; + //receiving informations + NtpTime remoteTimePublished; + NtpTime localTimeReceived; +} CSChange; + +/** + * struct CSTWriterParams - + */ +typedef struct CSTWriterParams { + NtpTime waitWhileDataUnderwayTime; + NtpTime repeatAnnounceTime; + NtpTime delayResponceTime; + NtpTime refreshPeriod; + unsigned int HBMaxRetries; + Boolean fullAcknowledge; +} CSTWriterParams; + +/** + * struct CSChangeForReader - + */ +typedef struct CSChangeForReader { + gavl_node_t node; + CSChange *csChange; + StateMachineChFReader commStateChFReader; + HTimFncUserNode waitWhileDataUnderwayTimer; +} CSChangeForReader; + +typedef struct CSTWriter CSTWriter; //forward declaration +/** + * struct CSTRemoteReader - + */ +typedef struct CSTRemoteReader { + gavl_node_t node; + CSTWriter *cstWriter; + ObjectEntryOID *objectEntryOID; + GUID_RTPS guid; + + gavl_cust_root_field_t csChangeForReader; + int csChangesCounter; + + //comm states + StateMachineHB commStateHB; + StateMachineSend commStateSend; + + //timing properties + HTimFncUserNode delayResponceTimer; + HTimFncUserNode repeatAnnounceTimer; + + unsigned int HBRetriesCounter; + + NtpTime lastSentIssueTime; +} CSTRemoteReader; + +typedef struct CSTPublications CSTPublications; +/** + * struct CSTWriter - + */ +struct CSTWriter { + ORTEDomain *domain; + gavl_node_t node; + GUID_RTPS guid; + ObjectEntryOID *objectEntryOID; + + SequenceNumber firstSN; + SequenceNumber lastSN; + + CSTWriterParams params; + + ul_list_head_t csChanges; + int csChangesCounter; + gavl_cust_root_field_t cstRemoteReader; + int cstRemoteReaderCounter; + pthread_rwlock_t lock; + + HTimFncUserNode refreshPeriodTimer; + + //ser./deser. function + ORTETypeRegister *typeRegister; + + //only for CSTPublications + unsigned int strictReliableCounter; + unsigned int bestEffortsCounter; + pthread_mutex_t mutexCSChangeDestroyed; +}; + +/** + * struct CSTReaderParams - + */ +typedef struct CSTReaderParams { + NtpTime delayResponceTimeMin; + NtpTime delayResponceTimeMax; + NtpTime repeatActiveQueryTime; + Boolean fullAcknowledge; + unsigned int ACKMaxRetries; +} CSTReaderParams; + +/** + * struct CSChangeFromWriter - + */ +typedef struct CSChangeFromWriter { + gavl_node_t node; + CSChange *csChange; + StateMachineChFWriter commStateChFWriter; +} CSChangeFromWriter; + +typedef struct CSTReader CSTReader; //forward declaration +/** + * struct CSTRemoteWriter - + */ +typedef struct CSTRemoteWriter { + gavl_node_t node; + CSTReader *cstReader; + ObjectEntryOID *objectEntryOID; + GUID_RTPS guid; + + gavl_cust_root_field_t csChangeFromWriter; + int csChangesCounter; + + SequenceNumber sn; + SequenceNumber firstSN; + SequenceNumber lastSN; + + //comm states + StateMachineACK commStateACK; + + //timing properties + HTimFncUserNode delayResponceTimer; + HTimFncUserNode repeatActiveQueryTimer; + + int ACKRetriesCounter; +} CSTRemoteWriter; + +typedef struct CSTSubscriptions CSTSubscriptions; +/** + * struct CSTReader - + */ +struct CSTReader { + ORTEDomain *domain; + gavl_node_t node; + GUID_RTPS guid; + ObjectEntryOID *objectEntryOID; + + CSTReaderParams params; + + ul_list_head_t csChanges; + gavl_cust_root_field_t cstRemoteWriter; + int cstRemoteWriterCounter; + pthread_rwlock_t lock; + + //ser./deser. function + ORTETypeRegister *typeRegister; + + //only for CSTSubcriptions + CSTRemoteWriter *cstRemoteWriterSubscribed; + HTimFncUserNode deadlineTimer; + HTimFncUserNode persistenceTimer; + + unsigned int strictReliableCounter; + unsigned int bestEffortsCounter; +}; + +/** + * struct CSTPublications - + */ +struct CSTPublications { + gavl_cust_root_field_t cstWriter; + pthread_rwlock_t lock; + u_int32_t counter; +}; + +/** + * struct CSTSubscriptions - + */ +struct CSTSubscriptions { + gavl_cust_root_field_t cstReader; + pthread_rwlock_t lock; + u_int32_t counter; +}; + +/** + * struct PSEntry - + */ +typedef struct PSEntry { + gavl_cust_root_field_t publications; + pthread_rwlock_t publicationsLock; + gavl_cust_root_field_t subscriptions; + pthread_rwlock_t subscriptionsLock; +} PSEntry ; + +/** + * struct ORTEDomain - + */ +struct ORTEDomain { + u_int32_t domain; //domain value + GUID_RTPS guid; //guid of self application + AppParams *appParams; //self parameters (share from objectEntry) + ObjectEntryOID *objectEntryOID;//entry point for self OID + + //////////////////////////////////////////////////// + //variables for tasks + TaskProp taskRecvMetatraffic; + MessageBuffer mbRecvMetatraffic; + TaskProp taskSend; + MessageBuffer mbSend; + TaskProp taskRecvUserdata; + MessageBuffer mbRecvUserdata; + + //////////////////////////////////////////////////// + //databases + TypeEntry typeEntry; //db of types + ObjectEntry objectEntry; //Objects Tree + PSEntry psEntry; //lists of publ/subs + PatternEntry patternEntry; + + ORTEDomainProp domainProp; + ORTEDomainAppEvents domainEvents; + + //////////////////////////////////////////////////// + //information used by event system + ORTEAppInfo appInfo; + ORTEPubInfo pubInfo; + ORTESubInfo subInfo; + + //////////////////////////////////////////////////// + //default properties for a Publication and Subscription + ORTEPublProp publPropDefault; + ORTESubsProp subsPropDefault; + + //////////////////////////////////////////////////// + //communication objects + CSTWriter writerApplicationSelf; //Manager,App + CSTReader readerManagers; //Manager,App + CSTReader readerApplications; //Manager,App + CSTWriter writerManagers; //Manager + CSTWriter writerApplications; //Manager + CSTWriter writerPublications; //App + CSTReader readerPublications; //App + CSTWriter writerSubscriptions; //App + CSTReader readerSubscriptions; //App + + CSTPublications publications; //App + CSTSubscriptions subscriptions; //App +}; + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _TYPEDEFS_H */ + diff --git a/orte/include/typedefs_api.h b/orte/include/typedefs_api.h new file mode 100644 index 0000000..fe4109b --- /dev/null +++ b/orte/include/typedefs_api.h @@ -0,0 +1,338 @@ +/* + * $Id: typedefs_api.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _TYPEDEFS_API_H +#define _TYPEDEFS_API_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ORTEDomain ORTEDomain; //forward declaration +typedef struct CSTWriter ORTEPublication; //forward declaration +typedef struct CSTReader ORTESubscription; //forward declaration + +typedef enum { + PULLED = 0x01, + IMMEDIATE = 0x02 + } SubscriptionMode; + +typedef enum { + BEST_EFFORTS = 0x01, + STRICT_RELIABLE = 0x02 + } SubscriptionType; + +typedef enum { + NEW_DATA = 0x01, + DEADLINE = 0x02 + } ORTERecvStatus; + +typedef enum { + NEED_DATA = 0x01, + CQL = 0x02 + } ORTESendStatus; + +typedef struct ORTEIFProp { + int32_t ifFlags; + IPAddress ipAddress; +} ORTEIFProp; + +typedef struct ORTEMulticastProp { + Boolean enabled; + unsigned char ttl; + Boolean loopBackEnabled; + IPAddress ipAddress; +} ORTEMulticastProp; + +typedef struct ORTECDRStream { + char *buffer; + char *bufferPtr; + Boolean needByteSwap; + int length; +} ORTECDRStream; + +typedef void (*ORTETypeSerialize)(ORTECDRStream *cdr_stream, void *instance); +typedef void (*ORTETypeDeserialize)(ORTECDRStream *cdr_stream, void *instance); + +/** + * struct ORTETypeRegister - + */ +typedef struct ORTETypeRegister { + char *typeName; + ORTETypeSerialize serialize; + ORTETypeDeserialize deserialize; + unsigned int getMaxSize; +} ORTETypeRegister; + +/** + * struct ORTEDomainBaseProp - + */ +typedef struct ORTEDomainBaseProp { + NtpTime expirationTime; + NtpTime refreshPeriod; + NtpTime purgeTime; + NtpTime repeatAnnounceTime; + NtpTime repeatActiveQueryTime; + NtpTime delayResponceTimeACKMin; + NtpTime delayResponceTimeACKMax; + unsigned int HBMaxRetries; + unsigned int ACKMaxRetries; + NtpTime maxBlockTime; +} ORTEDomainBaseProp; + +/** + * struct ORTEDomainWireProp - + */ +typedef struct ORTEDomainWireProp { + unsigned int metaBytesPerPacket; + unsigned int metaBytesPerFastPacket; + unsigned int metabitsPerACKBitmap; + unsigned int userMaxSerDeserSize; +} ORTEDomainWireProp; + +/** + * struct ORTEPublProp - + */ +typedef struct ORTEPublProp { + PathName topic; + TypeName typeName; + TypeChecksum typeChecksum; + Boolean expectsAck; + NtpTime persistence; + u_int32_t reliabilityOffered; + u_int32_t sendQueueSize; + int32_t strength; + //Additional properties + u_int32_t criticalQueueLevel; + NtpTime HBNornalRate; + NtpTime HBCQLRate; + unsigned int HBMaxRetries; + // + NtpTime maxBlockTime; +} ORTEPublProp; + +/** + * struct ORTESubsProp - + */ +typedef struct ORTESubsProp { + PathName topic; + TypeName typeName; + TypeChecksum typeChecksum; + NtpTime minimumSeparation; + u_int32_t recvQueueSize; + u_int32_t reliabilityRequested; + //additional parameters + NtpTime deadline; + u_int32_t mode; +} ORTESubsProp; + +/** + * struct ORTEAppInfo - + */ +typedef struct ORTEAppInfo { + HostId hostId; + AppId appId; + IPAddress *unicastIPAddressList; + unsigned char unicastIPAddressCount; + IPAddress *metatrafficMulticastIPAddressList; + unsigned char metatrafficMulticastIPAddressCount; + Port metatrafficUnicastPort; + Port userdataUnicastPort; + VendorId vendorId; + ProtocolVersion protocolVersion; +} ORTEAppInfo; + +/** + * struct ORTEPubInfo - + */ +typedef struct ORTEPubInfo { + const char *topic; + const char *type; + ObjectId objectId; +} ORTEPubInfo; + +/** + * struct ORTEPubInfo - + */ +typedef struct ORTESubInfo { + const char *topic; + const char *type; + ObjectId objectId; +} ORTESubInfo; + +/** + * struct ORTEPublStatus - status of a publication + * @reliable: count of reliable subscriptions (best effort) connected on responsible publication + * @unReliable: count of unreliable subscriptions (strict) connected on responsible publication + * @issues: number of messages in sending queue + * @unacknowledgedIssues: number of unacknowledged issues (only for best effort) + */ +typedef struct ORTEPublStatus { + unsigned int strict; + unsigned int bestEffort; + unsigned int issues; +} ORTEPublStatus; + +/** + * struct ORTESubsStatus - status of a subscription + * @reliable: count of reliable publications (best effort) connected to responsible subscription + * @unReliable: count of unreliable publications (strict) connected to responsible subscription + * @issues: number of messages in receiving queue + * + * Current implementation has always issues=0. It means, that all messages were sent to user application + */ +typedef struct ORTESubsStatus { + unsigned int strict; + unsigned int bestEffort; + unsigned int issues; +} ORTESubsStatus; + +/** + * struct ORTERecvInfo - + */ +typedef struct ORTERecvInfo { + ORTERecvStatus status; + const char *topic; + const char *type; + GUID_RTPS senderGUID; + NtpTime localTimeReceived; + NtpTime remoteTimePublished; + SequenceNumber sn; +} ORTERecvInfo; + +/** + * struct ORTESendInfo - + */ +typedef struct ORTESendInfo { + ORTESendStatus status; + const char *topic; + const char *type; + GUID_RTPS senderGUID; + SequenceNumber sn; +} ORTESendInfo; + +//CallBackRutines +typedef void +(*ORTERecvCallBack)(const ORTERecvInfo *info,void *instance, void *recvCallBackParam); +typedef void +(*ORTESendCallBack)(const ORTESendInfo *info,void *instance, void *sendCallBackParam); +typedef ORTESubscription* +(*ORTESubscriptionPatternCallBack)(const char *topic, const char *nddsType, void *Param); + + +//Pattern +typedef Boolean +(*ORTEPatternCheck)(const char *string); +typedef Boolean +(*ORTEPatternMatch)(const char *topic,const char *pattern,void *param); +extern Boolean +ORTEPatternCheckDefault(const char *topic); +extern Boolean +ORTEPatternMatchDefault(const char *topic,const char *pattern,void *param); +extern void +ORTEPatternRegister(ORTEDomain *d,ORTEPatternCheck check, + ORTEPatternMatch match,void *param); + +//Manager +typedef Boolean +(*ORTEOnMgrNew)(const struct ORTEAppInfo *appInfo, void *param); +typedef void +(*ORTEOnMgrDelete)(const struct ORTEAppInfo *appInfo, void *param); +//Application +typedef Boolean +(*ORTEOnAppRemoteNew)(const struct ORTEAppInfo *appInfo, void *param); +typedef void (*ORTEOnAppDelete) +(const struct ORTEAppInfo *appInfo, void *param); +//Publication +typedef Boolean +(*ORTEOnPubRemote)(const struct ORTEAppInfo *appInfo, + const struct ORTEPubInfo *pubInfo, void *param); +typedef void +(*ORTEOnPubDelete)(const struct ORTEAppInfo *appInfo, + const struct ORTEPubInfo *pubInfo, void *param); +//Subscription +typedef Boolean +(*ORTEOnSubRemote)(const struct ORTEAppInfo *appInfo, + const struct ORTESubInfo *subInfo, void *param); +typedef void +(*ORTEOnSubDelete)(const struct ORTEAppInfo *appInfo, + const struct ORTESubInfo *subInfo, void *param); + +/** + * struct ORTEDomainAppEvents - Domain events of an application + */ +typedef struct ORTEDomainAppEvents { + ORTEOnMgrNew onMgrNew; + void *onMgrNewParam; + ORTEOnMgrDelete onMgrDelete; + void *onMgrDeleteParam; + ORTEOnAppRemoteNew onAppRemoteNew; + void *onAppRemoteNewParam; + ORTEOnAppDelete onAppDelete; + void *onAppDeleteParam; + ORTEOnPubRemote onPubRemoteNew; + void *onPubRemoteNewParam; + ORTEOnPubRemote onPubRemoteChanged; + void *onPubRemoteChangedParam; + ORTEOnPubDelete onPubDelete; + void *onPubDeleteParam; + ORTEOnSubRemote onSubRemoteNew; + void *onSubRemoteNewParam; + ORTEOnSubRemote onSubRemoteChanged; + void *onSubRemoteChangedParam; + ORTEOnSubDelete onSubDelete; + void *onSubDeleteParam; +} ORTEDomainAppEvents; + +/** + * struct ORTETaskProp - + */ +typedef struct ORTETasksProp { + Boolean realTimeEnabled; + int smtStackSize; + int smtPriority; + int rmtStackSize; + int rmtPriority; +} ORTETasksProp; + +/** + * struct ORTEDomainApp - + */ +typedef struct ORTEDomainProp { + ORTETasksProp tasksProp; + ORTEIFProp IFProp[MAX_INTERFACES]; //interface properties + unsigned char IFCount; //count of interfaces + ORTEDomainBaseProp baseProp; + ORTEDomainWireProp wireProp; + ORTEMulticastProp multicast; //multicast properies + char *mgrs; //managers + IPAddress mgrAddKey; //keys + IPAddress appLocalManager; //applications + char version[60]; //string product version + int recvBuffSize; + int sendBuffSize; +} ORTEDomainProp; + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _TYPEDEFS_API_H */ + diff --git a/orte/include/typedefs_defines_rtps.h b/orte/include/typedefs_defines_rtps.h new file mode 100644 index 0000000..db0550e --- /dev/null +++ b/orte/include/typedefs_defines_rtps.h @@ -0,0 +1,250 @@ +/* + * $Id: typedefs_defines_rtps.h,v 0.0.0.1 2003/08/21 + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _TYPEDEFS_DEFINES_RTPS_H +#define _TYPEDEFS_DEFINES_RTPS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define RTPS_HEADER_LENGTH 16 + +#define MAX_PATHNAME 128 +#define MAX_TYPENAME 128 +#define ORTE_TRUE 1 +#define ORTE_FALSE 0 + +typedef int8_t Boolean; + +typedef int8_t PathName[MAX_PATHNAME]; +typedef int8_t TypeName[MAX_TYPENAME]; + +typedef int32_t TypeChecksum; + +/*****************************************************************/ +/* Wire Protocol Specification (WPS) */ +/*****************************************************************/ + + +/** + Host identifier. + + for example: IP address working nodes +*/ +typedef int32_t HostId; +#define HID_UNKNOWN 0x00 + +/** + Application identifier. + + composed from: 3 bytes - instance Id + 1 byte - appKind (1 - ManagedApplication, 2 - Manager) +*/ +typedef int32_t AppId; +#define AID_UNKNOWN 0x00 +#define MANAGEDAPPLICATION 0x01 +#define MANAGER 0x02 + +/** + Object identifier. + + composed from: 3 bytes - instance Id + 1 byte - objKind +*/ +typedef int32_t ObjectId; + +#define OID_UNKNOWN 0x00000000 +#define OID_APP 0x000001C1 +#define OID_WRITE_APPSELF 0x000008C2 +#define OID_READ_APPSELF 0x000008C7 +#define OID_WRITE_APP 0x000001C2 +#define OID_READ_APP 0x000001C7 +#define OID_WRITE_MGR 0x000007C2 +#define OID_READ_MGR 0x000007C7 +#define OID_WRITE_PUBL 0x000003C2 +#define OID_READ_PUBL 0x000003C7 +#define OID_WRITE_SUBS 0x000004C2 +#define OID_READ_SUBS 0x000004C7 +//Kind +#define OID_APPLICATION 0x01 +#define OID_CSTWRITER 0x02 +#define OID_PUBLICATION 0x03 +#define OID_SUBSCRIPTION 0x04 +#define OID_CSTREADER 0x07 +// +#define OID_USEROBJ 0x00 +#define OID_RESUSEROBJ 0x40 +#define OID_METAOBJ 0x80 +#define OID_RESMETAOBJ 0xC0 + +typedef struct { + HostId hid; + AppId aid; + ObjectId oid; + } GUID_RTPS; + +typedef struct { + int8_t major; + int8_t minor; + } VendorId; + +#define VENDOR_ID_UNKNOWN(id) {id.major=0;id.minor=0;} +#define VENDOR_ID_RTI(id) {id.major=1;id.minor=1;} +#define VENDOR_ID_OCERA(id) {id.major=0;id.minor=0;} + +typedef struct { + int8_t major; + int8_t minor; + } ProtocolVersion; + +#define PROTOCOL_VERSION_1_0(pv) {pv.major=1;pv.minor=0;} + +typedef struct { + int32_t high; + int32_t low; + } SequenceNumber; + + +#define SEQUENCE_NUMBER_NONE(sn) {sn.high=0;sn.low=0;} +#define SEQUENCE_NUMBER_UNKNOWN(sn) {sn.high=0x7fffffff;sn.low=0xffffffff;} + + +typedef struct { + int32_t seconds; /* time in seconds */ + u_int32_t fraction; /* time in seconds / 2^32 */ + } NtpTime; + +#define NTPTIME_ZERO(t) {t.seconds=0;t.fraction=0;} +#define NTPTIME_BUILD(t,s) {t.seconds=s;t.fraction=0;} +#define NTPTIME_INFINITE(t) {t.seconds=0xffffffff;t.fraction=0;} + +typedef int32_t IPAddress; + +#define IPADDRESS_INVALID 0 + +typedef int32_t Port; + +#define PORT_INVALID 0 + +typedef enum { + PAD = 0x01, + VAR = 0x02, + ISSUE = 0x03, + ACK = 0x06, + HEARTBEAT = 0x07, + GAP = 0x08, + INFO_TS = 0x09, + INFO_SRC = 0x0c, + INFO_REPLY = 0x0d, + INFO_DST = 0x0e, + APP_QUIT = 0x90 + } SubmessageId; + +typedef struct { + ProtocolVersion sourceVersion; + VendorId sourceVendorId; + HostId sourceHostId; + AppId sourceAppId; + HostId destHostId; + AppId destAppId; + IPAddress unicastReplyIPAddress; + Port unicastReplyPort; + IPAddress multicastReplyIPAddress; + Port multicastReplyPort; + Boolean haveTimestamp; + NtpTime timestamp; + } MessageInterpret; + + +#define PID_PAD 0x00 +#define PID_SENTINEL 0x01 +#define PID_EXPIRATION_TIME 0x02 +#define PID_PERSISTENCE 0x03 +#define PID_MINIMUM_SEPARATION 0x04 +#define PID_TOPIC 0x05 +#define PID_STRENGTH 0x06 +#define PID_TYPE_NAME 0x07 +#define PID_TYPE_CHECKSUM 0x08 +#define RTPS_PID_TYPE2_NAME 0x09 +#define RTPS_PID_TYPE2_CHECKSUM 0x0a +#define PID_MATATRAFFIC_MULTICAST_IPADDRESS 0x0b +#define PID_APP_IPADDRESS 0x0c +#define PID_METATRAFFIC_UNICAST_PORT 0x0d +#define PID_USERDATA_UNICAST_PORT 0x0e +#define PID_IS_RELIABLE 0x0f +#define PID_EXPECTS_ACK 0x10 +#define PID_USERDATA_MULTICAST_IPADDRESS 0x11 +#define PID_MANAGER_KEY 0x12 +#define PID_SEND_QUEUE_SIZE 0x13 +#define PID_RELIABILITY_ENABLED 0x14 +#define PID_PROTOCOL_VERSION 0x15 +#define PID_VENDOR_ID 0x16 +#define PID_VARGAPPS_SEQUENCE_NUMBER_LAST 0x17 +#define PID_RECV_QUEUE_SIZE 0x18 +#define PID_RELIABILITY_OFFERED 0x19 +#define PID_RELIABILITY_REQUESTED 0x1a + +/* possible values for PID_RELIABILITY_REQUEST */ +#define PID_VALUE_RELIABILITY_BEST_EFFORTS 0x01 +#define PID_VALUE_RELIABILITY_STRICT 0x02 + +typedef u_int16_t ParameterId; +typedef u_int16_t ParameterLength; + +/* State Machines */ +typedef enum { + MAYSENDHB = 0x01, + MUSTSENDHB = 0x02, + SENDHB = 0x03 + } StateMachineHB; + +typedef enum { + NOTHNIGTOSEND = 0x01, + MUSTSENDDATA = 0x02 + } StateMachineSend; + +typedef enum { + NEW = 0x01, + TOSEND = 0x02, + UNDERWAY = 0x03, + UNACKNOWLEDGED = 0x04, + ANNOUCED = 0x05, + ACKNOWLEDGED = 0x06 + } StateMachineChFReader; + +typedef enum { + WAITING = 0x01, + PULLING = 0x02, + ACKPENDING = 0x03 + } StateMachineACK; + +typedef enum { + FUTURE = 0x01, + REQUESTED = 0x02, + MISSING = 0x03, + RECEIVED = 0x04 + } StateMachineChFWriter; + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _TYPEDEFS_DEFINES_RTPS_H */ diff --git a/orte/include/ul_gavl.h b/orte/include/ul_gavl.h new file mode 100644 index 0000000..9d46d8e --- /dev/null +++ b/orte/include/ul_gavl.h @@ -0,0 +1,487 @@ +/******************************************************************* + uLan Communication - C interface library + + ul_gavl.h - generic AVL tree + + (C) Copyright 2001 by Pavel Pisa - Originator + + The uLan driver is distributed under the Gnu General Public License. + See file COPYING for details. + + Originator reserve the right to use and publish sources + under different conditions too. If third party contributors + do not accept this condition, they can delete this statement + and only GNU license will apply. + *******************************************************************/ + +#ifndef _UL_GAVL_H +#define _UL_GAVL_H + +#include "ul_utdefs.h" +#include "ul_itbase.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Add support to work correctly even with unbalamced tree + with hdiff out of range <-1,0,+1>, else unbalanced tree + results in continuous tree degradation and even fatal errors. + This option does not solve errors caused by incorrectly + assigned hdiff values. + */ +#define GAVL_UNBALANCED_SUPPORT + +/* function to compare fields of two items */ +typedef int gavl_cmp_fnc_t(const void *a, const void *b); + +/** + * struct gavl_node - Structure Representing Node of Generic AVL Tree + * @left: pointer to left child or NULL + * @right: pointer to right child or NULL + * @parent: pointer to parent node, NULL for root + * @hdiff: difference of height between left and right child + * + * This structure represents one node in the tree and links @left and @right + * to nodes with lower and higher value of order criterion. + * Each tree is built from one type of items defined by user. + * User can decide to include node structure inside item representation + * or GAVL can malloc node structures for each inserted item. + * The GAVL allocates memory space with capacity + * sizeof(gavl_node_t)+sizeof(void*) in the second case. The item pointer + * is stored following node structure (void**)(node+1); + */ +typedef struct gavl_node { + struct gavl_node *left; + struct gavl_node *right; + struct gavl_node *parent; + int hdiff; +} gavl_node_t; + +/** + * struct gavl_root - Structure Representing Root of Generic AVL Tree + * @root_node: pointer to root node of GAVL tree + * @node_offs: offset between start of user defined item representation + * and included GAVL node structure. If negative value + * is stored there, user item does not contain node structure + * and GAVL manages standalone ones with item pointers. + * @key_offs: offset to compared (ordered) fields in the item representation + * @cmp_fnc: function defining order of items by comparing fields at offset + * @key_offs. + */ + +typedef struct gavl_root { + gavl_node_t *root_node; + int node_offs; + int key_offs; + gavl_cmp_fnc_t *cmp_fnc; +} gavl_root_t; + +#define GAVL_FANY 0 +#define GAVL_FFIRST 1 +#define GAVL_FAFTER 2 +#define GAVL_FCMP 0x80 + +gavl_node_t * +gavl_first_node(const gavl_root_t *root); + +gavl_node_t * +gavl_last_node(const gavl_root_t *root); + +gavl_node_t * +gavl_next_node(const gavl_node_t *node); + +gavl_node_t * +gavl_prev_node(const gavl_node_t *node); + +int +gavl_is_empty(const gavl_root_t *root); + +/* Core search routine for GAVL trees + searches in "root" for node "node" of item + with value of item field at offset "key_offs" + equal to "*key". Values are compared by function + "*cmp_fnc". + Integer "mode" modifies search algorithm + GAVL_FANY .. finds index of any item with field value "*key" + GAVL_FFIRST .. finds index of first item with "*key" + GAVL_FAFTER .. index points after last item with "*key" value + reworded - index points at first item with higher + value of field or after last item + Return of nonzero value indicates match found. + If the mode is ored with GAVL_FCMP, result of last compare is returned + */ + +int +gavl_search_node(const gavl_root_t *root, const void *key, + int mode, gavl_node_t **nodep); + +/* returns first node with associated key field value equal to "*key" or NULL */ +static inline gavl_node_t * +gavl_find_first_node(const gavl_root_t *root, const void *key) +{ + gavl_node_t *node; + gavl_search_node(root, key, GAVL_FFIRST, &node); + return node; +} + +/* returns first node after node with associated key + field value equal to "*key" or NULL */ +static inline gavl_node_t * +gavl_find_after_node(const gavl_root_t *root, const void *key) +{ + gavl_node_t *node; + gavl_search_node(root, key, GAVL_FAFTER, &node); + return node; +} + +/* returns item with key field value equal to "*key" or NULL */ +void * +gavl_find(const gavl_root_t *root, const void *key); + +/* same as above, but first matching item is found */ +void * +gavl_find_first(const gavl_root_t *root, const void *key); + +/* same as above, but first nonmatching higher item is found */ +void * +gavl_find_after(const gavl_root_t *root, const void *key); + + +/** + * gavl_node2item - Conversion from GAVL Tree Node to User Defined Item + * @root: GAVL tree root + * @node: node belonging to @root GAVL tree + * + * Return Value: pointer to item corresponding to node + */ +static inline void * +gavl_node2item(const gavl_root_t *root, const gavl_node_t *node) +{ + if(root->node_offs<0) return *(void**)(node+1); + return (void*)((char*)node-root->node_offs); +}; + +/** + * gavl_node2item_safe - Conversion from GAVL Tree Node to User Defined Item + * @root: GAVL tree root + * @node: node belonging to @root GAVL tree + * + * Return Value: pointer to item corresponding to node + */ +static inline void * +gavl_node2item_safe(const gavl_root_t *root, const gavl_node_t *node) +{ + if(!node) return 0; + return gavl_node2item(root, node); +}; + +/** + * gavl_node2key - Conversion from GAVL Tree Node to Ordering Key + * @root: GAVL tree root + * @node: node belonging to @root GAVL tree + * + * Return Value: pointer to key corresponding to node + */ +static inline void * +gavl_node2key(const gavl_root_t *root, const gavl_node_t *node) +{ + char *p; + p=(char*)gavl_node2item(root, node); + return (void*)(p+root->key_offs); +}; + +int +gavl_balance_one(gavl_node_t **subtree); + +/* This function can be used for defining AVL trees with custom + root definition. Use gavl_insert or gavl_insert_node for + standard trees */ +int +gavl_insert_primitive_at(gavl_node_t **root_nodep, gavl_node_t *node, + gavl_node_t *where, int leftright); + +int +gavl_insert_node_at(gavl_root_t *root, gavl_node_t *node, + gavl_node_t *where, int leftright); + +int +gavl_insert_node(gavl_root_t *root, gavl_node_t *node, int mode); + +/* insert new item at the right position, + "mode" has same meaning as in "gavl_search_node" + if mode==0 then strict sorting is required + and violation result in ignore of new item + and return value <0 + */ +int +gavl_insert(gavl_root_t *root, void *item, int mode); + +/* delete node from AVL tree */ +int +gavl_delete_primitive(gavl_node_t **root_nodep, gavl_node_t *node); + +/* delete node from AVL tree */ +int +gavl_delete_node(gavl_root_t *root, gavl_node_t *node); + +/* delete item from AVL tree */ +int +gavl_delete(gavl_root_t *root, void *item); + +/* This function can be used after call gavl_first_node to destructive + traversal through the tree, it cannot be combined with gavl_next_node + or gavl_prev_node and root is emptied after the end of traversal. + If the tree is used after unsuccessful/unfinished traversal, it + must be balanced again */ +gavl_node_t * +gavl_delete_and_next_node(gavl_root_t *root, gavl_node_t *node); + +/*===========================================================*/ +/* iterators for generic GAVL type */ + +typedef struct { + gavl_root_t *container; + gavl_node_t *node; +} gavl_it_t; + +static inline void * +gavl_it2item(const gavl_it_t *it) +{ + return gavl_node2item_safe(it->container,it->node); +} + +static inline void +gavl_first_it(gavl_root_t *container, gavl_it_t *it) +{ + it->container=container; + it->node=gavl_first_node(container); +} + +static inline void +gavl_last_it(gavl_root_t *container, gavl_it_t *it) +{ + it->container=container; + it->node=gavl_last_node(container); +} + +static inline void +gavl_next_it(gavl_it_t *it) +{ + if(it->node) it->node=gavl_next_node(it->node); + else it->node=gavl_first_node(it->container); +} + +static inline void +gavl_prev_it(gavl_it_t *it) +{ + if(it->node) it->node=gavl_prev_node(it->node); + else it->node=gavl_last_node(it->container); +} + +static inline int +gavl_is_end_it(gavl_it_t *it) +{ + return !it->node; +} + +static inline void +gavl_delete_it(gavl_it_t *it) +{ + gavl_node_t *n; + if(!(n=it->node)) return; + it->node=gavl_next_node(it->node); + gavl_delete_node(it->container,n); +} + +static inline int +gavl_find_it(gavl_root_t *container, void *key, gavl_it_t *it) +{ + it->container=container; + return (it->node=gavl_find_first_node(container, key))!=0; +} + +static inline int +gavl_find_first_it(gavl_root_t *container, void *key, gavl_it_t *it) +{ + it->container=container; + return (it->node=gavl_find_first_node(container, key))!=0; +} + +static inline int +gavl_find_after_it(gavl_root_t *container, void *key, gavl_it_t *it) +{ + it->container=container; + return (it->node=gavl_find_after_node(container, key))!=0; +} + +/* The next implementation of foreaach is elegant, but can not + be used in C99 non-conformant C compiler */ +#ifdef WITH_C99 + +#define gavl_generic_for_each(item_t, root, ptr) \ + for(gavl_node_t *__fe_node=gavl_first_node(root);\ + (ptr=(item_t*)gavl_node2item_safe(root,__fe_node));\ + __fe_node=gavl_next_node(__fe_node)) + +#define gavl_generic_for_each_rev(item_t, root, ptr) \ + for(gavl_node_t *__fe_node=gavl_last_node(root);\ + (ptr=__(item_t*)gavl_node2item_safe(root,__fe_node));\ + __fe_node=gavl_prev_node(__fe_node)) + +#define gavl_generic_for_each_from(item_t, root, key, ptr) \ + for(gavl_node_t *__fe_node=gavl_find_first_node(root, key); \ + (ptr=(item_t*)gavl_node2item_safe(root,__fe_node)); \ + __fe_node=gavl_next_node(__fe_node)) + +#define gavl_generic_for_each_after(item_t, root, key, ptr) \ + for(gavl_node_t *__fe_node=gavl_find_after_node(root, key); \ + (ptr=(item_t*)gavl_node2item_safe(root,__fe_node)); \ + __fe_node=gavl_next_node(__fe_node)) + +#endif /*WITH_C99*/ + +#define gavl_generic_for_each_cut(item_t, root, ptr) \ + for(;(ptr=(item_t*)gavl_cut_first(root));) + +/*===========================================================*/ +/* basic types compare functions */ + +int gavl_cmp_int(const void *a, const void *b); +int gavl_cmp_long(const void *a, const void *b); +int gavl_cmp_ptr(const void *a, const void *b); + +/*===========================================================*/ +/* More functions useful for partially balanced trees */ + +/* Adjust hdiff in parent nodes after change of height of + branch starting at node */ +int +gavl_adjust_hdiff(gavl_node_t *node, int adj); + +/* Partial balance - reduces number of nodes with hdiff >1 or <-1, + return zero if none unbalanced node is found */ +int +gavl_balance_enhance(gavl_node_t **subtree); + +/* Full tree balance to state correct for AVL tree + => hdiff is in range <-1,0,1> */ +int +gavl_balance(gavl_root_t *root); + +/* take and delete first node without balancing but keep tree consistent */ +gavl_node_t * +gavl_cut_first_primitive(gavl_node_t **root_nodep); + +/* take and delete first item without balancing but keep tree consistent */ +void * +gavl_cut_first(gavl_root_t *root); + + +/*===========================================================*/ +/* Declarations of root fields for typesafe custom trees */ + +/* Root type for GAVL_CUST_NODE_INT_DEC tree declaration */ +/* implementation uses "ul_gavlcust.h" or ul_gavlrepcust.h" */ +/* with implementation macro GAVL_CUST_NODE_INT_IMP */ +/* or GAVL_CUST_NODE_INT_REP_IMP */ +typedef gavl_node_t * gavl_cust_root_field_t; + +/* Forward declaration of tree root for GAVL_FLES_INT_DEC */ +/* function declarations and implementations require */ +/* inclusion of ul_gavlflesint.h" and GAVL_FLES_INT_IMP */ +typedef struct{ + gavl_node_t *root; + gavl_node_t *first; + gavl_node_t *last; + long count; +} gavl_fles_int_root_field_t; + +/*===========================================================*/ +/* Macrodefinitions to prepare custom fast AVL trees with + fast possibly inlined search */ + +/* User must provide his/her own compare routine with + int cust_cmp_fnc(cust_key_t *a, cust_key_t *b) */ + +/* Declaration of new custom tree with internal node */ +#define GAVL_CUST_NODE_INT_DEC(cust_prefix, cust_root_t, cust_item_t, cust_key_t,\ + cust_root_node, cust_item_node, cust_item_key, cust_cmp_fnc) \ +\ +static inline cust_item_t * \ +cust_prefix##_node2item(const cust_root_t *root, const gavl_node_t *node) \ + {return (cust_item_t*)((char*)node-(long)&((cust_item_t*)0)->cust_item_node);}\ +\ +static inline cust_key_t *\ +cust_prefix##_node2key(const cust_root_t *root, gavl_node_t *node)\ + { return &(cust_prefix##_node2item(root, node)->cust_item_key);}\ +\ +void cust_prefix##_init_root_field(cust_root_t *root);\ +int cust_prefix##_search_node(const cust_root_t *root, cust_key_t *key, gavl_node_t **nodep);\ +cust_item_t *cust_prefix##_find(const cust_root_t *root, cust_key_t *key);\ +cust_item_t *cust_prefix##_find_first(const cust_root_t *root, cust_key_t *key);\ +cust_item_t *cust_prefix##_find_after(const cust_root_t *root, cust_key_t *key);\ +int cust_prefix##_insert(cust_root_t *root, cust_item_t *item);\ +int cust_prefix##_delete_node(cust_root_t *root, gavl_node_t *node);\ +int cust_prefix##_delete(cust_root_t *root, cust_item_t *item);\ +gavl_node_t *cust_prefix##_first_node(const cust_root_t *root);\ +gavl_node_t *cust_prefix##_last_node(const cust_root_t *root);\ +\ +static inline cust_item_t *\ +cust_prefix##_first(const cust_root_t *root)\ +{\ + gavl_node_t *n=cust_prefix##_first_node(root);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_last(const cust_root_t *root)\ +{\ + gavl_node_t *n=cust_prefix##_last_node(root);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_next(const cust_root_t *root, cust_item_t *item)\ +{\ + gavl_node_t *n=gavl_next_node(&item->cust_item_node);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_prev(const cust_root_t *root, cust_item_t *item)\ +{\ + gavl_node_t *n=gavl_prev_node(&item->cust_item_node);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline int \ +cust_prefix##_is_empty(const cust_root_t *root)\ +{\ + return !root->cust_root_node;\ +}\ +static inline cust_item_t *\ +cust_prefix##_cut_first(cust_root_t *root)\ +{\ + gavl_node_t *n=gavl_cut_first_primitive(&root->cust_root_node);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +/*** Iterators ***/\ +UL_ITBASE_SORT_DEC(cust_prefix, cust_root_t, cust_item_t, cust_key_t) + +#define gavl_cust_for_each(cust_prefix, root, ptr) \ + for(ptr=cust_prefix##_first(root);ptr;ptr=cust_prefix##_next((root),ptr)) + +#define gavl_cust_for_each_rev(cust_prefix, root, ptr) \ + for(ptr=cust_prefix##_last(root);ptr;ptr=cust_prefix##_prev((root),ptr)) + +#define gavl_cust_for_each_from(cust_prefix, root, key, ptr) \ + for(ptr=cust_prefix##_find_first(root,key);ptr;ptr=cust_prefix##_next((root),ptr)) + +#define gavl_cust_for_each_after(cust_prefix, root, key, ptr) \ + for(ptr=cust_prefix##_find_after(root,key);ptr;ptr=cust_prefix##_next((root),ptr)) + +#define gavl_cust_for_each_cut(cust_prefix, root, ptr) \ + for(;(ptr=cust_prefix##_cut_first(root));) + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_GAVL_H */ diff --git a/orte/include/ul_gavlcust.h b/orte/include/ul_gavlcust.h new file mode 100644 index 0000000..0b64d54 --- /dev/null +++ b/orte/include/ul_gavlcust.h @@ -0,0 +1,137 @@ +#ifndef _UL_GAVLCUST_H +#define _UL_GAVLCUST_H + +#include "ul_gavl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * GAVL_CUST_NODE_INT_IMP - Implementation of new custom tree with internal node + * @cust_prefix: defines prefix for builded function names + * @cust_root_t: user defined structure type of root of the tree + * @cust_item_t: user defined structure type of items stored in the tree + * @cust_key_t: type of the key used for sorting of the items + * @cust_root_node: the field of the root structure pointing to the tree root node + * @cust_item_node: the field of item structure used for chaining of items + * @cust_item_key: the key field of item structure defining order of items + * @cust_cmp_fnc: the keys compare function + * + * There are two macros designed for building custom AVL trees. The macro + * %GAVL_CUST_NODE_INT_DEC declares functions for custom tree manipulations + * and is intended for use in header files. + * The macro %GAVL_CUST_NODE_INT_IMP builds implementations for non-inlined + * functions declared by %GAVL_CUST_NODE_INT_DEC. The @cust_cmp_fnc is used + * for comparison of item keys in the search and insert functions. The types + * of two input arguments of @cust_cmp_fnc functions must correspond + * with @cust_key_t type. Return value should be positive for case when + * the first pointed key value is greater then second, negative for reverse + * case and zero for equal pointed values. + */ +#define GAVL_CUST_NODE_INT_IMP(cust_prefix, cust_root_t, cust_item_t, cust_key_t,\ + cust_root_node, cust_item_node, cust_item_key, cust_cmp_fnc) \ +\ +void cust_prefix##_init_root_field(cust_root_t *root)\ +{\ + root->cust_root_node=NULL;\ +}\ +\ +int cust_prefix##_search_node(const cust_root_t *root, cust_key_t *key, gavl_node_t **nodep)\ +{\ + int cmp=1;\ + gavl_node_t *n, *p;\ + n=p=root->cust_root_node;\ + while(n){\ + cmp=cust_cmp_fnc(cust_prefix##_node2key(root,n),key);\ + p=n;\ + if(cmp>0){\ + n=n->left;\ + }else if(cmp<0){\ + n=n->right;\ + }else{\ + *nodep=n;\ + return 0;\ + }\ + }\ + *nodep=p;\ + return cmp;\ +}\ +\ +cust_item_t *cust_prefix##_find(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *node;\ + if(cust_prefix##_search_node(root, key, &node))\ + return NULL;\ + return cust_prefix##_node2item(root,node);\ +}\ +\ +cust_item_t *cust_prefix##_find_first(const cust_root_t *root, cust_key_t *key)\ +{\ + return cust_prefix##_find(root, key);\ +}\ +\ +cust_item_t *cust_prefix##_find_after(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *node;\ + if(cust_prefix##_search_node(root, key, &node)<=0){\ + if(node) node=gavl_next_node(node);\ + }\ + return node?cust_prefix##_node2item(root,node):NULL;\ +}\ +\ +int cust_prefix##_insert(cust_root_t *root, cust_item_t *item)\ +{\ + int cmp;\ + gavl_node_t *where, *n2add;\ + \ + cmp=cust_prefix##_search_node(root, &item->cust_item_key, &where);\ + if(!cmp) return -1;\ + n2add=&item->cust_item_node;\ + return gavl_insert_primitive_at(&root->cust_root_node, n2add, where, cmp);\ +}\ +\ +int cust_prefix##_delete_node(cust_root_t *root, gavl_node_t *node)\ +{\ + return gavl_delete_primitive(&root->cust_root_node, node);\ +}\ +\ +int cust_prefix##_delete(cust_root_t *root, cust_item_t *item)\ +{\ + int ret;\ + gavl_node_t *n, *p;\ + if(!item) return -1;\ + /*if(cust_prefix##_search_node(root, &item->cust_item_key, &n))*/\ + n=&item->cust_item_node;\ + /*check if node is inserted into tree*/\ + for(p=n; p->parent; p=p->parent);\ + if(p!=root->cust_root_node)\ + return -1;\ + ret=gavl_delete_primitive(&root->cust_root_node, n);\ + return 1;\ +}\ +\ +gavl_node_t *cust_prefix##_first_node(const cust_root_t *root)\ +{\ + gavl_node_t *n=root->cust_root_node;\ + if(!n) return NULL;\ + while(n->left)\ + n=n->left;\ + return n;\ +}\ +\ +gavl_node_t *cust_prefix##_last_node(const cust_root_t *root)\ +{\ + gavl_node_t *n=root->cust_root_node;\ + if(!n) return NULL;\ + while(n->right)\ + n=n->right;\ + return n;\ +} + + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_GAVLCUST_H */ diff --git a/orte/include/ul_gavlflesint.h b/orte/include/ul_gavlflesint.h new file mode 100644 index 0000000..1e53bef --- /dev/null +++ b/orte/include/ul_gavlflesint.h @@ -0,0 +1,264 @@ +#ifndef _UL_GAVLFLESINT_H +#define _UL_GAVLFLESINT_H + +#include "ul_gavl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Declaration of tree with first/last enhanced speed functions with internal node */ +#define GAVL_FLES_INT_DEC(cust_prefix, cust_root_t, cust_item_t, cust_key_t,\ + cust_root_field, cust_item_node, cust_item_key, cust_cmp_fnc) \ +\ +static inline cust_item_t * \ +cust_prefix##_node2item(const cust_root_t *root, const gavl_node_t *node) \ + {return (cust_item_t*)((char*)node-(long)&((cust_item_t*)0)->cust_item_node);}\ +\ +static inline cust_key_t *\ +cust_prefix##_node2key(const cust_root_t *root, gavl_node_t *node)\ + { return &(cust_prefix##_node2item(root, node)->cust_item_key);}\ +\ +void cust_prefix##_init_root_field(cust_root_t *root);\ +int cust_prefix##_search_node(const cust_root_t *root, cust_key_t *key, gavl_node_t **nodep);\ +cust_item_t *cust_prefix##_find(const cust_root_t *root, cust_key_t *key);\ +cust_item_t *cust_prefix##_find_first(const cust_root_t *root, cust_key_t *key);\ +cust_item_t *cust_prefix##_find_after(const cust_root_t *root, cust_key_t *key);\ +int cust_prefix##_insert(cust_root_t *root, cust_item_t *item);\ +cust_item_t *cust_prefix##_cut_first(cust_root_t *root);\ +int cust_prefix##_delete_node(cust_root_t *root, gavl_node_t *node);\ +int cust_prefix##_delete(cust_root_t *root, cust_item_t *item);\ +static inline gavl_node_t *\ +cust_prefix##_first_node(const cust_root_t *root)\ +{\ + return root->cust_root_field.first;\ +}\ +static inline gavl_node_t *\ +cust_prefix##_last_node(const cust_root_t *root)\ +{\ + return root->cust_root_field.last;\ +}\ +static inline cust_item_t *\ +cust_prefix##_first(const cust_root_t *root)\ +{\ + gavl_node_t *n=cust_prefix##_first_node(root);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_last(const cust_root_t *root)\ +{\ + gavl_node_t *n=cust_prefix##_last_node(root);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_next(const cust_root_t *root, cust_item_t *item)\ +{\ + gavl_node_t *n=gavl_next_node(&item->cust_item_node);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_prev(const cust_root_t *root, cust_item_t *item)\ +{\ + gavl_node_t *n=gavl_prev_node(&item->cust_item_node);\ + return n?cust_prefix##_node2item(root,n):NULL;\ +}\ +static inline int \ +cust_prefix##_is_empty(const cust_root_t *root)\ +{\ + return !root->cust_root_field.root;\ +}\ +/*** Iterators ***/\ +UL_ITBASE_SORT_DEC(cust_prefix, cust_root_t, cust_item_t, cust_key_t) + + +/** + * GAVL_FLES_INT_IMP - Implementation of new custom tree with fast first/last functions + * @cust_prefix: defines prefix for builded function names + * @cust_root_t: user defined structure type of root of the tree + * @cust_item_t: user defined structure type of items stored in the tree + * @cust_key_t: type of the key used for sorting of the items + * @cust_root_field: the field of the root structure pointing to the tree root node + * @cust_item_node: the field of item structure used for chaining of items + * @cust_item_key: the key field of item structure defining order of items + * @cust_cmp_fnc: the keys compare function + * + * This version of custom tree implementation allows multiple items with same + * key value to be stored in tree. + * There are two macros designed for building custom AVL trees. The macro + * %GAVL_CUST_NODE_INT_DEC declares functions for custom tree manipulations + * and is intended for use in header files. + * The macro %GAVL_CUST_NODE_INT_REP_IMP builds implementations for non-inlined + * functions declared by %GAVL_CUST_NODE_INT_DEC. The @cust_cmp_fnc is used + * for comparison of item keys in the search and insert functions. The types + * of two input arguments of @cust_cmp_fnc functions must correspond + * with @cust_key_t type. Return value should be positive for case when + * the first pointed key value is greater then second, negative for reverse + * case and zero for equal pointed values. + */ +#define GAVL_FLES_INT_IMP(cust_prefix, cust_root_t, cust_item_t, cust_key_t,\ + cust_root_field, cust_item_node, cust_item_key, cust_cmp_fnc,\ + cust_ins_fl, cust_first_change, cust_last_change, cust_empty_state) \ +\ +void cust_prefix##_init_root_field(cust_root_t *root)\ +{\ + root->cust_root_field.root=NULL;\ + root->cust_root_field.first=NULL;\ + root->cust_root_field.last=NULL;\ + root->cust_root_field.count=0;\ +}\ +\ +int cust_prefix##_search_node4(const cust_root_t *root, cust_key_t *key, gavl_node_t **nodep, int mode)\ +{\ + int cmp=1;\ + gavl_node_t *n, *p;\ + n=p=root->cust_root_field.root;\ + while(n){\ + cmp=cust_cmp_fnc(cust_prefix##_node2key(root,n),key);\ + p=n;\ + if(cmp>0){\ + n=n->left;\ + }else if((cmp<0)||(mode&GAVL_FAFTER)){\ + n=n->right;\ + }else{\ + break;\ + }\ + }\ + if(!cmp && (mode&GAVL_FFIRST)){\ + while((n=p->left)){\ + cmp=cust_cmp_fnc(cust_prefix##_node2key(root,n),key);\ + if(!cmp){\ + p=n;\ + }else{\ + while((n=n->right)){\ + cmp=cust_cmp_fnc(cust_prefix##_node2key(root,n),key);\ + if(!cmp){\ + p=n;\ + break;\ + }\ + }\ + if(cmp) break;\ + }\ + }\ + cmp=0;\ + }\ + *nodep=p;\ + return cmp;\ +}\ +\ +int cust_prefix##_search_node(const cust_root_t *root, cust_key_t *key, gavl_node_t **nodep)\ +{\ + return cust_prefix##_search_node4(root, key, nodep, 0);\ +}\ +\ +cust_item_t *cust_prefix##_find(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *node;\ + if(cust_prefix##_search_node4(root, key, &node, 0))\ + return NULL;\ + return cust_prefix##_node2item(root,node);\ +}\ +\ +cust_item_t *cust_prefix##_find_first(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *n;\ + if(cust_prefix##_search_node4(root, key, &n, GAVL_FFIRST))\ + return NULL;\ + return cust_prefix##_node2item(root,n);\ +}\ +\ +cust_item_t *cust_prefix##_find_after(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *node;\ + if(cust_prefix##_search_node4(root, key, &node, GAVL_FAFTER)<=0){\ + if(node) node=gavl_next_node(node);\ + }\ + return node?cust_prefix##_node2item(root,node):NULL;\ +}\ +\ +int cust_prefix##_insert(cust_root_t *root, cust_item_t *item)\ +{\ + int cmp;\ + gavl_node_t *where, *n2add;\ + \ + cmp=cust_prefix##_search_node4(root, &item->cust_item_key, &where, cust_ins_fl);\ + if(!cmp && !(cust_ins_fl&GAVL_FAFTER)) return -1;\ + n2add=&item->cust_item_node;\ + if(!root->cust_root_field.root){\ + root->cust_root_field.first=root->cust_root_field.last=n2add;\ + cust_first_change; cust_last_change;\ + }else if((cmp>0)&&(where==root->cust_root_field.first)){\ + root->cust_root_field.first=n2add;\ + cust_first_change;\ + }else if((cmp<=0)&&(where==root->cust_root_field.last)){\ + root->cust_root_field.last=n2add;\ + cust_last_change;\ + }\ + root->cust_root_field.count++;\ + return gavl_insert_primitive_at(&root->cust_root_field.root, n2add, where, cmp);\ +}\ +\ +int cust_prefix##_delete_node(cust_root_t *root, gavl_node_t *node)\ +{\ + gavl_node_t *p;\ + /*check if node is inserted into tree*/\ + for(p=node; p->parent; p=p->parent);\ + if(p!=root->cust_root_field.root)\ + return -1;\ + if(root->cust_root_field.first==node){\ + if(root->cust_root_field.last==node){\ + root->cust_root_field.first=root->cust_root_field.last=NULL;\ + cust_empty_state;\ + }else{\ + root->cust_root_field.first=gavl_next_node(node);\ + cust_first_change;\ + }\ + }else if(root->cust_root_field.last==node){\ + root->cust_root_field.last=gavl_prev_node(node);\ + cust_last_change;\ + }\ + root->cust_root_field.count--;\ + return gavl_delete_primitive(&root->cust_root_field.root, node);\ +}\ +\ +int cust_prefix##_delete(cust_root_t *root, cust_item_t *item)\ +{\ + gavl_node_t *n;\ + if(!item) return -1;\ + n=&item->cust_item_node;\ + return cust_prefix##_delete_node(root, n);\ +}\ +\ +cust_item_t *cust_prefix##_cut_first(cust_root_t *root)\ +{\ + gavl_node_t *n, *p;\ + gavl_node_t **np=&root->cust_root_field.root;\ + if(!(n=root->cust_root_field.first))\ + return NULL;\ + if(n->parent) np=&n->parent->left;\ + if((*np=n->right)){\ + p=n->right;\ + p->parent=n->parent;\ + while(p->left) p=p->left;\ + root->cust_root_field.first=p;\ + cust_first_change;\ + }else{\ + if(!(root->cust_root_field.first=n->parent)){\ + root->cust_root_field.last=n->parent;\ + cust_empty_state;\ + }else{\ + cust_first_change;\ + }\ + }\ + for(p=n->parent;p;p=p->parent)\ + if(p->hdiff++<0) break;\ + n->parent=n->left=n->right=NULL;\ + root->cust_root_field.count--;\ + return cust_prefix##_node2item(root,n);\ +} + + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_GAVLFLESINT_H */ diff --git a/orte/include/ul_gavlrepcust.h b/orte/include/ul_gavlrepcust.h new file mode 100644 index 0000000..619feb8 --- /dev/null +++ b/orte/include/ul_gavlrepcust.h @@ -0,0 +1,162 @@ +#ifndef _UL_GAVLREPCUST_H +#define _UL_GAVLREPCUST_H + +#include "ul_gavl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * GAVL_CUST_NODE_INT_REP_IMP - Implementation of new custom tree with internal node allowed item repeat + * @cust_prefix: defines prefix for builded function names + * @cust_root_t: user defined structure type of root of the tree + * @cust_item_t: user defined structure type of items stored in the tree + * @cust_key_t: type of the key used for sorting of the items + * @cust_root_node: the field of the root structure pointing to the tree root node + * @cust_item_node: the field of item structure used for chaining of items + * @cust_item_key: the key field of item structure defining order of items + * @cust_cmp_fnc: the keys compare function + * + * This version of custom tree implementation allows multiple items with same + * key value to be stored in tree. + * There are two macros designed for building custom AVL trees. The macro + * %GAVL_CUST_NODE_INT_DEC declares functions for custom tree manipulations + * and is intended for use in header files. + * The macro %GAVL_CUST_NODE_INT_REP_IMP builds implementations for non-inlined + * functions declared by %GAVL_CUST_NODE_INT_DEC. The @cust_cmp_fnc is used + * for comparison of item keys in the search and insert functions. The types + * of two input arguments of @cust_cmp_fnc functions must correspond + * with @cust_key_t type. Return value should be positive for case when + * the first pointed key value is greater then second, negative for reverse + * case and zero for equal pointed values. + */ +#define GAVL_CUST_NODE_INT_REP_IMP(cust_prefix, cust_root_t, cust_item_t, cust_key_t,\ + cust_root_node, cust_item_node, cust_item_key, cust_cmp_fnc) \ +\ +void cust_prefix##_init_root_field(cust_root_t *root)\ +{\ + root->cust_root_node=NULL;\ +}\ +\ +int cust_prefix##_search_node4(const cust_root_t *root, cust_key_t *key, gavl_node_t **nodep, int mode)\ +{\ + int cmp=1;\ + gavl_node_t *n, *p;\ + n=p=root->cust_root_node;\ + while(n){\ + cmp=cust_cmp_fnc(cust_prefix##_node2key(root,n),key);\ + p=n;\ + if(cmp>0){\ + n=n->left;\ + }else if((cmp<0)||(mode&GAVL_FAFTER)){\ + n=n->right;\ + }else{\ + break;\ + }\ + }\ + if(!cmp && (mode&GAVL_FFIRST)){\ + while((n=p->left)){\ + cmp=cust_cmp_fnc(cust_prefix##_node2key(root,n),key);\ + if(!cmp){\ + p=n;\ + }else{\ + while((n=n->right)){\ + cmp=cust_cmp_fnc(cust_prefix##_node2key(root,n),key);\ + if(!cmp){\ + p=n;\ + break;\ + }\ + }\ + if(cmp) break;\ + }\ + }\ + cmp=0;\ + }\ + *nodep=p;\ + return cmp;\ +}\ +\ +int cust_prefix##_search_node(const cust_root_t *root, cust_key_t *key, gavl_node_t **nodep)\ +{\ + return cust_prefix##_search_node4(root, key, nodep, 0);\ +}\ +\ +cust_item_t *cust_prefix##_find(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *node;\ + if(cust_prefix##_search_node4(root, key, &node, 0))\ + return NULL;\ + return cust_prefix##_node2item(root,node);\ +}\ +\ +cust_item_t *cust_prefix##_find_first(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *n;\ + if(cust_prefix##_search_node4(root, key, &n, GAVL_FFIRST))\ + return NULL;\ + return cust_prefix##_node2item(root,n);\ +}\ +\ +cust_item_t *cust_prefix##_find_after(const cust_root_t *root, cust_key_t *key)\ +{\ + gavl_node_t *node;\ + if(cust_prefix##_search_node4(root, key, &node, GAVL_FAFTER)<=0){\ + if(node) node=gavl_next_node(node);\ + }\ + return node?cust_prefix##_node2item(root,node):NULL;\ +}\ +\ +int cust_prefix##_insert(cust_root_t *root, cust_item_t *item)\ +{\ + int cmp;\ + gavl_node_t *where, *n2add;\ + \ + cmp=cust_prefix##_search_node4(root, &item->cust_item_key, &where, GAVL_FAFTER);\ + n2add=&item->cust_item_node;\ + return gavl_insert_primitive_at(&root->cust_root_node, n2add, where, cmp);\ +}\ +\ +int cust_prefix##_delete_node(cust_root_t *root, gavl_node_t *node)\ +{\ + return gavl_delete_primitive(&root->cust_root_node, node);\ +}\ +\ +int cust_prefix##_delete(cust_root_t *root, cust_item_t *item)\ +{\ + int ret;\ + gavl_node_t *n, *p;\ + if(!item) return -1;\ + n=&item->cust_item_node;\ + /*check if node is inserted into tree*/\ + for(p=n; p->parent; p=p->parent);\ + if(p!=root->cust_root_node)\ + return -1;\ + ret=gavl_delete_primitive(&root->cust_root_node, n);\ + return 1;\ +}\ +\ +gavl_node_t *cust_prefix##_first_node(const cust_root_t *root)\ +{\ + gavl_node_t *n=root->cust_root_node;\ + if(!n) return NULL;\ + while(n->left)\ + n=n->left;\ + return n;\ +}\ +\ +gavl_node_t *cust_prefix##_last_node(const cust_root_t *root)\ +{\ + gavl_node_t *n=root->cust_root_node;\ + if(!n) return NULL;\ + while(n->right)\ + n=n->right;\ + return n;\ +} + + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_GAVLREPCUST_H */ diff --git a/orte/include/ul_htimdefs.h b/orte/include/ul_htimdefs.h new file mode 100644 index 0000000..f408da4 --- /dev/null +++ b/orte/include/ul_htimdefs.h @@ -0,0 +1,75 @@ +#ifndef _UL_HTIMDEFS_H +#define _UL_HTIMDEFS_H + +#include "ul_utdefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Select heap-tree as base structure to implement + * hierarchic timer - not recomended + */ +//#define UL_HTIMER_WITH_HPTREE + +/* If defined, standard timer type + * is built + */ +//#define UL_HTIMER_WITH_STD_TYPE + +/* If defined, standard microsecond resolution + * data types are selected for timer implementation + */ +//#define UL_HTIMER_WITH_MSTIME + +/* If defined, NTPTimer type + * is built + */ +#define UL_HTIMER_WITH_NTPTIME + +#ifdef UL_HTIMER_WITH_MSTIME +typedef unsigned long ul_mstime_t; +typedef signed long ul_msdiff_t; + +typedef ul_mstime_t ul_htim_time_t; +typedef ul_msdiff_t ul_htim_diff_t; + +static inline int +ul_htimer_cmp_fnc(const ul_htim_time_t *a, const ul_htim_time_t *b) +{ + ul_htim_diff_t d=(ul_htim_diff_t)(*a-*b); + if (d>0) return 1; + if (d<0) return -1; + return 0; +} +#endif /*UL_HTIMER_WITH_MSTIME*/ + +#ifdef UL_HTIMER_WITH_NTPTIME +#include "typedefs_defines_rtps.h" +#include "defines_api.h" +typedef NtpTime ul_htim_time_t; + +static inline int +ul_htimer_cmp_fnc(const ul_htim_time_t *a, const ul_htim_time_t *b){ + return NtpTimeCmp(*a,*b); +} +#endif /*UL_HTIMER_WITH_NTPTIME*/ + +/*===========================================================*/ +/* Configuration of types for standard timer (ul_htimer) */ + +/* Additional, user defined fields for ul_htimer_t structure */ +#define UL_HTIMER_USER_FIELDS + +typedef void (ul_htimer_fnc_t)(unsigned long data); + +/* The wrapper for ul_htimer_run_expired */ +#define UL_HTIMER_FNC_CALL(queue, timer, pact_time) \ + do{ timer->function(timer->data); } while(0) + + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_HTIMDEFS_H */ diff --git a/orte/include/ul_htimer.h b/orte/include/ul_htimer.h new file mode 100644 index 0000000..1369d8b --- /dev/null +++ b/orte/include/ul_htimer.h @@ -0,0 +1,216 @@ +#ifndef _UL_HTIMER_H +#define _UL_HTIMER_H + +#include "ul_htimdefs.h" + +#include "ul_list.h" +#ifndef UL_HTIMER_WITH_HPTREE + #include "ul_gavl.h" +#else /*UL_HTIMER_WITH_HPTREE*/ + #include "ul_hptree.h" +#endif /*UL_HTIMER_WITH_HPTREE*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * struct ul_htim_node - Timer queue entry base structure + * @node: regular GAVL node structure for insertion into + * @expires: time to trigger timer in &ul_htim_time_t type defined resolution + * + * This is basic type useful to define more complete timer types + */ +typedef struct ul_htim_node { + #ifndef UL_HTIMER_WITH_HPTREE + gavl_node_t node; + #else /*UL_HTIMER_WITH_HPTREE*/ + ul_hpt_node_t node; + #endif /*UL_HTIMER_WITH_HPTREE*/ + ul_htim_time_t expires; +} ul_htim_node_t; + +/** + * struct ul_htim_queue - Timer queue head/root base structure + * @timers: root of FLES GAVL tree of timer entries + * @first_changed: flag, which is set after each add, detach operation + * which concerning of firsts scheduled timer + * + * This is basic type useful to define more complete timer queues types + */ +typedef struct ul_htim_queue { + #ifndef UL_HTIMER_WITH_HPTREE + gavl_fles_int_root_field_t timers; + #else /*UL_HTIMER_WITH_HPTREE*/ + ul_hpt_root_field_t timers; + #endif /*UL_HTIMER_WITH_HPTREE*/ + int first_changed; +} ul_htim_queue_t; + +int ul_htim_queue_insert(ul_htim_queue_t *queue, ul_htim_node_t *htim); +int ul_htim_queue_delete(ul_htim_queue_t *queue, ul_htim_node_t *htim); +ul_htim_node_t *ul_htim_queue_cut_first(ul_htim_queue_t *queue); + +#ifndef UL_HTIMER_WITH_HPTREE +void ul_htim_queue_init_root_field(ul_htim_queue_t *queue); + +static inline void +ul_htim_queue_init_detached(ul_htim_node_t *htim) + {htim->node.parent=NULL;} + +static inline int +ul_htim_queue_inline_first(ul_htim_queue_t *queue, ul_htim_node_t **phtim) +{ + /*little faster equivalent to ul_htim_queue_first(&queue->cust_queue_field);*/ + gavl_node_t *gavl_node=queue->timers.first; + if(!gavl_node) return 0; + *phtim=UL_CONTAINEROF(gavl_node,ul_htim_node_t,node); + return 1; +} + +#else /*UL_HTIMER_WITH_HPTREE*/ +int ul_htim_queue_init_root_field(ul_htim_queue_t *queue); + +static inline void +ul_htim_queue_init_detached(ul_htim_node_t *htim) + {;} + +static inline int +ul_htim_queue_inline_first(ul_htim_queue_t *queue, ul_htim_node_t **phtim) +{ + if(!queue->timers.count) return 0; + *phtim=UL_CONTAINEROF(queue->timers.heaparr[ul_hpt_first_i],ul_htim_node_t,node); + return *phtim!=0; +} +#endif /*UL_HTIMER_WITH_HPTREE*/ + +#define UL_HTIMER_DEC(cust_prefix, cust_queue_t, cust_timer_t, \ + cust_queue_field, cust_timer_field) \ +\ +void cust_prefix##_init_queue(cust_queue_t *queue);\ +cust_timer_t *cust_prefix##_cut_expired(cust_queue_t *queue, ul_htim_time_t *act_time);\ +int cust_prefix##_next_expire(cust_queue_t *queue, ul_htim_time_t *act_time);\ +static inline int \ +cust_prefix##_add(cust_queue_t *queue, cust_timer_t *timer){ \ + return ul_htim_queue_insert(&queue->cust_queue_field, &timer->cust_timer_field); \ +} \ +static inline int \ +cust_prefix##_detach(cust_queue_t *queue, cust_timer_t *timer){ \ + return ul_htim_queue_delete(&queue->cust_queue_field, &timer->cust_timer_field); \ +}\ +static inline int \ +cust_prefix##_first_changed(cust_queue_t *queue){\ + int first_changed=queue->cust_queue_field.first_changed;\ + queue->cust_queue_field.first_changed=0;\ + return first_changed;\ +}\ +static inline void \ +cust_prefix##_init_detached(cust_timer_t *timer){\ + ul_htim_queue_init_detached(&timer->cust_timer_field);\ +}\ +static inline void \ +cust_prefix##_set_expire(cust_timer_t *timer, ul_htim_time_t expire){\ + timer->cust_timer_field.expires=expire;\ +}\ +static inline ul_htim_time_t \ +cust_prefix##_get_expire(cust_timer_t *timer){\ + return timer->cust_timer_field.expires;\ +} + +#define UL_HTIMER_IMP(cust_prefix, cust_queue_t, cust_timer_t, \ + cust_queue_field, cust_timer_field) \ +\ +void cust_prefix##_init_queue(cust_queue_t *queue)\ +{\ + ul_htim_queue_init_root_field(&queue->cust_queue_field);\ +}\ +cust_timer_t *cust_prefix##_cut_expired(cust_queue_t *queue, ul_htim_time_t *pact_time)\ +{ /*little faster equivalent to ul_htim_queue_first(&queue->cust_queue_field);*/\ + ul_htim_node_t *htim_node;\ + if(!ul_htim_queue_inline_first(&queue->cust_queue_field,&htim_node))\ + return 0;\ + if(ul_htimer_cmp_fnc(&htim_node->expires,pact_time)>0) return NULL;\ + htim_node=ul_htim_queue_cut_first(&queue->cust_queue_field);\ + return UL_CONTAINEROF(htim_node,cust_timer_t,cust_timer_field);\ +}\ +int cust_prefix##_next_expire(cust_queue_t *queue, ul_htim_time_t *pnext_time)\ +{\ + /*same as above, allows also new timers without "ul_gavlflesint.h" explicit inclussion */\ + ul_htim_node_t *htim_node;\ + if(!ul_htim_queue_inline_first(&queue->cust_queue_field,&htim_node))\ + return 0;\ + *pnext_time=htim_node->expires;\ + return 1;\ +} + +/*===========================================================*/ +/* Standard timer (ul_htimer) */ + +#ifdef UL_HTIMER_WITH_STD_TYPE + +/** + * struct ul_htimer - Standard timer entry with callback function + * @htim: basic timer queue entry + * @function: user provided function to call at trigger time + * @data: user selected data + * + * This is standard timer type, which requires @data casting + * in many cases. The type of @function field has to be declared + * in "ul_htimdefs.h" header file. + */ +typedef struct ul_htimer { + ul_htim_node_t htim; + ul_htimer_fnc_t *function; + unsigned long data; + UL_HTIMER_USER_FIELDS +} ul_htimer_t; + +/** + * struct ul_htimer_queue - Standard timer queue + * @htim: basic timer queue head + * @function: user provided function to call at trigger time + * @data: user selected data + * + * This is standard timer type, wghich requires @data casting + * in many cases + */ +typedef struct ul_htimer_queue { + ul_htim_queue_t htim_queue; +} ul_htimer_queue_t; + +UL_HTIMER_DEC(ul_htimer, ul_htimer_queue_t, ul_htimer_t, htim_queue, htim) + +void ul_htimer_run_expired(ul_htimer_queue_t *queue, ul_htim_time_t *pact_time); +/* there are next usefull functions + * void ul_htimer_init_queue(ul_htimer_queue_t *queue); + * int ul_htimer_add(ul_htimer_queue_t *queue, ul_htimer_t *timer); + * int ul_htimer_detach(ul_htimer_queue_t *queue, ul_htimer_t *timer); + * int ul_htimer_first_changed(ul_htimer_queue_t *queue); + * int ul_htimer_next_expire(ul_htimer_queue_t *queue, ul_htimer_time_t *pnext_time); + * ul_htimer_t *ul_htimer_cut_expired(ul_htimer_queue_t *queue, ul_htimer_time_t *pact_time); + * void ul_htimer_init_detached(ul_htimer_t *timer); + * void ul_htimer_set_expire(ul_htimer_t *timer, ul_htimer_time_t expire); + * ul_htimer_time_t ul_htimer_get_expire(ul_htimer_t *timer); + */ + +#endif /*UL_HTIMER_WITH_STD_TYPE*/ + +#ifdef UL_HTIMER_WITH_MSTIME +#ifdef UL_HTIMER_WITH_STD_TYPE +ul_htimer_queue_t ul_root_htimer; +#endif /*UL_HTIMER_WITH_STD_TYPE*/ +ul_mstime_t ul_mstime_last; +ul_mstime_t ul_mstime_next; + +void ul_mstime_update(void); +void ul_mstime_init(void); +void ul_get_log_time_str(char str[30]); +void ul_compute_mstime_next(void); + +#endif /*UL_HTIMER_WITH_MSTIME*/ + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_HTIMER_H */ diff --git a/orte/include/ul_itbase.h b/orte/include/ul_itbase.h new file mode 100644 index 0000000..9f7ab88 --- /dev/null +++ b/orte/include/ul_itbase.h @@ -0,0 +1,97 @@ +#ifndef _UL_ITBASE_H +#define _UL_ITBASE_H + +#include "ul_utdefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define UL_ITBASE_UL_DEC(cust_prefix, cust_container_t, cust_item_t) \ +typedef struct { cust_container_t *container; cust_item_t *item;}\ + cust_prefix##_it_t;\ +static inline cust_item_t * \ +cust_prefix##_it2item(const cust_prefix##_it_t *it)\ +{\ + return it->item;\ +}\ +static inline void \ +cust_prefix##_first_it(cust_container_t *container, cust_prefix##_it_t *it)\ +{\ + it->container=container;\ + it->item=cust_prefix##_first(container);\ +}\ +static inline void \ +cust_prefix##_last_it(cust_container_t *container, cust_prefix##_it_t *it)\ +{\ + it->container=container;\ + it->item=cust_prefix##_last(container);\ +}\ +static inline void \ +cust_prefix##_next_it(cust_prefix##_it_t *it)\ +{\ + if(it->item) it->item=cust_prefix##_next(it->container,it->item);\ + else it->item=cust_prefix##_first(it->container);\ +}\ +static inline void \ +cust_prefix##_prev_it(cust_prefix##_it_t *it)\ +{\ + if(it->item) it->item=cust_prefix##_prev(it->container,it->item);\ + else it->item=cust_prefix##_last(it->container);\ +}\ +static inline int \ +cust_prefix##_is_end_it(cust_prefix##_it_t *it)\ +{\ + return !it->item;\ +}\ +static inline void \ +cust_prefix##_delete_it(cust_prefix##_it_t *it)\ +{\ + cust_item_t *p;\ + if(!(p=it->item)) return;\ + it->item=cust_prefix##_next(it->container,it->item);\ + cust_prefix##_delete(it->container,p);\ +} + +#define UL_ITBASE_SORT_DEC(cust_prefix, cust_container_t, cust_item_t, cust_key_t) \ +UL_ITBASE_UL_DEC(cust_prefix, cust_container_t, cust_item_t) \ +static inline int \ +cust_prefix##_find_it(cust_container_t *container, cust_key_t *key, cust_prefix##_it_t *it)\ +{\ + it->container=container;\ + return (it->item=cust_prefix##_find(container, key))!=0;\ +}\ +static inline int \ +cust_prefix##_find_first_it(cust_container_t *container, cust_key_t *key, cust_prefix##_it_t *it)\ +{\ + it->container=container;\ + return (it->item=cust_prefix##_find_first(container, key))!=0;\ +}\ +static inline int \ +cust_prefix##_find_after_it(cust_container_t *container, cust_key_t *key, cust_prefix##_it_t *it)\ +{\ + it->container=container;\ + return (it->item=cust_prefix##_find_after(container, key))!=0;\ +} + +#define ul_for_each_it(cust_prefix, root, it) \ + for(cust_prefix##_first_it(root,&it);\ + !cust_prefix##_is_end_it(&it);cust_prefix##_next_it(&it)) + +#define ul_for_each_rev_it(cust_prefix, root, it) \ + for(cust_prefix##_last_it(root,&it);\ + !cust_prefix##_is_end_it(&it);cust_prefix##_prev_it(&it)) + +#define ul_for_each_from_it(cust_prefix, root, key, it) \ + for(cust_prefix##_find_first_it(root, key, &it);\ + !cust_prefix##_is_end_it(&it);cust_prefix##_next_it(&it)) + +#define ul_for_each_after_it(cust_prefix, root, key, it) \ + for(cust_prefix##_find_after_it(root, key, &it);\ + !cust_prefix##_is_end_it(&it);cust_prefix##_next_it(&it)) + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_ITBASE_H */ diff --git a/orte/include/ul_list.h b/orte/include/ul_list.h new file mode 100644 index 0000000..fb1b00c --- /dev/null +++ b/orte/include/ul_list.h @@ -0,0 +1,106 @@ +#ifndef _UL_LISTS_H +#define _UL_LISTS_H + +#include "ul_utdefs.h" +#include "ul_listbase.h" +#include "ul_itbase.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct list_head ul_list_node_t; +typedef struct list_head ul_list_head_t; + +#define UL_LIST_CUST_DEC(cust_prefix, cust_head_t, cust_item_t,\ + cust_head_field, cust_node_field) \ +\ +static inline cust_item_t * \ +cust_prefix##_node2item(const cust_head_t *head, const ul_list_node_t *node) \ + {return UL_CONTAINEROF(node, cust_item_t, cust_node_field);}\ +\ +static inline void \ +cust_prefix##_init_head(cust_head_t *head)\ +{\ + INIT_LIST_HEAD(&head->cust_head_field);\ +}\ +static inline cust_item_t *\ +cust_prefix##_first(const cust_head_t *head)\ +{\ + ul_list_node_t *n=head->cust_head_field.next;\ + return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_last(const cust_head_t *head)\ +{\ + ul_list_node_t *n=head->cust_head_field.prev;\ + return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_next(const cust_head_t *head, const cust_item_t *item)\ +{\ + ul_list_node_t *n=item->cust_node_field.next;\ + return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\ +}\ +static inline cust_item_t *\ +cust_prefix##_prev(const cust_head_t *head, const cust_item_t *item)\ +{\ + ul_list_node_t *n=item->cust_node_field.prev;\ + return (n!=&head->cust_head_field)?cust_prefix##_node2item(head,n):NULL;\ +}\ +static inline int \ +cust_prefix##_is_empty(const cust_head_t *head)\ +{\ + return head->cust_head_field.next==&head->cust_head_field;\ +}\ +static inline void \ +cust_prefix##_ins_head(cust_head_t *head, cust_item_t *item)\ +{\ + list_add(&item->cust_node_field, &head->cust_head_field);\ +}\ +static inline void \ +cust_prefix##_ins_tail(cust_head_t *head, cust_item_t *item)\ +{\ + list_add_tail(&item->cust_node_field, &head->cust_head_field);\ +}\ +static inline void \ +cust_prefix##_insert(cust_head_t *head, cust_item_t *item)\ +{\ + cust_prefix##_ins_tail(head, item);\ +}\ +static inline void \ +cust_prefix##_delete(cust_head_t *head, cust_item_t *item)\ +{\ + list_del(&item->cust_node_field);\ +}\ +static inline void \ +cust_prefix##_del_item(cust_item_t *item)\ +{\ + list_del(&item->cust_node_field);\ +}\ +static inline cust_item_t *\ +cust_prefix##_cut_first(cust_head_t *head)\ +{\ + ul_list_node_t *n=head->cust_head_field.next;\ + if(n==&head->cust_head_field) return NULL;\ + list_del(n);\ + return cust_prefix##_node2item(head,n);\ +}\ +/*** Iterators ***/\ +UL_ITBASE_UL_DEC(cust_prefix, cust_head_t, cust_item_t) + + +#define ul_list_for_each(cust_prefix, head, ptr) \ + for(ptr=cust_prefix##_first(head);ptr;ptr=cust_prefix##_next((head),ptr)) + +#define ul_list_for_each_rev(cust_prefix, head, ptr) \ + for(ptr=cust_prefix##_last(head);ptr;ptr=cust_prefix##_prev((head),ptr)) + +#define ul_list_for_each_cut(cust_prefix, head, ptr) \ + for(;(ptr=cust_prefix##_cut_first(head));) + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_LISTS_H */ diff --git a/orte/include/ul_listbase.h b/orte/include/ul_listbase.h new file mode 100644 index 0000000..0297d99 --- /dev/null +++ b/orte/include/ul_listbase.h @@ -0,0 +1,286 @@ +#ifndef __KERNEL__ + +/* In RT-Linux this functions collide with Linux lists functions, so + * we use Linux functions instead. */ + +#ifndef _UL_LISTBASE_H +#define _UL_LISTBASE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define LIST_POISON1 ((void *) 0) +#define LIST_POISON2 ((void *) 0) + +/* + * Simple doubly linked list implementation. + * + * Some of the internal functions ("__xxx") are useful when + * manipulating whole lists rather than single entries, as + * sometimes we already know the next/prev entries and we can + * generate better code by using them directly rather than + * using the generic single-entry routines. + */ + +struct list_head { + struct list_head *next, *prev; +}; + +#define LIST_HEAD_INIT(name) { &(name), &(name) } + +#define LIST_HEAD(name) \ + struct list_head name = LIST_HEAD_INIT(name) + +#define INIT_LIST_HEAD(ptr) do { \ + (ptr)->next = (ptr); (ptr)->prev = (ptr); \ +} while (0) + +/* + * Insert a new entry between two known consecutive entries. + * + * This is only for internal list manipulation where we know + * the prev/next entries already! + */ +static inline void __list_add(struct list_head *new, + struct list_head *prev, + struct list_head *next) +{ + next->prev = new; + new->next = next; + new->prev = prev; + prev->next = new; +} + +/** + * list_add - add a new entry + * @new: new entry to be added + * @head: list head to add it after + * + * Insert a new entry after the specified head. + * This is good for implementing stacks. + */ +static inline void list_add(struct list_head *new, struct list_head *head) +{ + __list_add(new, head, head->next); +} + +/** + * list_add_tail - add a new entry + * @new: new entry to be added + * @head: list head to add it before + * + * Insert a new entry before the specified head. + * This is useful for implementing queues. + */ +static inline void list_add_tail(struct list_head *new, struct list_head *head) +{ + __list_add(new, head->prev, head); +} + +/* + * Delete a list entry by making the prev/next entries + * point to each other. + * + * This is only for internal list manipulation where we know + * the prev/next entries already! + */ +static inline void __list_del(struct list_head * prev, struct list_head * next) +{ + next->prev = prev; + prev->next = next; +} + +/** + * list_del - deletes entry from list. + * @entry: the element to delete from the list. + * Note: list_empty on entry does not return true after this, the entry is + * in an undefined state. + */ +static inline void list_del(struct list_head *entry) +{ + __list_del(entry->prev, entry->next); + entry->next = LIST_POISON1; + entry->prev = LIST_POISON2; +} + +/** + * list_del_init - deletes entry from list and reinitialize it. + * @entry: the element to delete from the list. + */ +static inline void list_del_init(struct list_head *entry) +{ + __list_del(entry->prev, entry->next); + INIT_LIST_HEAD(entry); +} + +/** + * list_move - delete from one list and add as another's head + * @list: the entry to move + * @head: the head that will precede our entry + */ +static inline void list_move(struct list_head *list, struct list_head *head) +{ + __list_del(list->prev, list->next); + list_add(list, head); +} + +/** + * list_move_tail - delete from one list and add as another's tail + * @list: the entry to move + * @head: the head that will follow our entry + */ +static inline void list_move_tail(struct list_head *list, + struct list_head *head) +{ + __list_del(list->prev, list->next); + list_add_tail(list, head); +} + +/** + * list_empty - tests whether a list is empty + * @head: the list to test. + */ +static inline int list_empty(struct list_head *head) +{ + return head->next == head; +} + +static inline void __list_splice(struct list_head *list, + struct list_head *head) +{ + struct list_head *first = list->next; + struct list_head *last = list->prev; + struct list_head *at = head->next; + + first->prev = head; + head->next = first; + + last->next = at; + at->prev = last; +} + +/** + * list_splice - join two lists + * @list: the new list to add. + * @head: the place to add it in the first list. + */ +static inline void list_splice(struct list_head *list, struct list_head *head) +{ + if (!list_empty(list)) + __list_splice(list, head); +} + +/** + * list_splice_init - join two lists and reinitialise the emptied list. + * @list: the new list to add. + * @head: the place to add it in the first list. + * + * The list at @list is reinitialised + */ +static inline void list_splice_init(struct list_head *list, + struct list_head *head) +{ + if (!list_empty(list)) { + __list_splice(list, head); + INIT_LIST_HEAD(list); + } +} + +/** + * list_entry - get the struct for this entry + * @ptr: the &struct list_head pointer. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + */ +#define list_entry(ptr, type, member) \ + container_of(ptr, type, member) + +/** + * list_for_each - iterate over a list + * @pos: the &struct list_head to use as a loop counter. + * @head: the head for your list. + */ +#define list_for_each(pos, head) \ + for (pos = (head)->next, prefetch(pos->next); pos != (head); \ + pos = pos->next, prefetch(pos->next)) + +/** + * __list_for_each - iterate over a list + * @pos: the &struct list_head to use as a loop counter. + * @head: the head for your list. + * + * This variant differs from list_for_each() in that it's the + * simplest possible list iteration code, no prefetching is done. + * Use this for code that knows the list to be very short (empty + * or 1 entry) most of the time. + */ +#define __list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) + +/** + * list_for_each_prev - iterate over a list backwards + * @pos: the &struct list_head to use as a loop counter. + * @head: the head for your list. + */ +#define list_for_each_prev(pos, head) \ + for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ + pos = pos->prev, prefetch(pos->prev)) + +/** + * list_for_each_safe - iterate over a list safe against removal of list entry + * @pos: the &struct list_head to use as a loop counter. + * @n: another &struct list_head to use as temporary storage + * @head: the head for your list. + */ +#define list_for_each_safe(pos, n, head) \ + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) + +/** + * list_for_each_entry - iterate over list of given type + * @pos: the type * to use as a loop counter. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + prefetch(pos->member.next); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member), \ + prefetch(pos->member.next)) + +/** + * list_for_each_entry_reverse - iterate backwards over list of given type. + * @pos: the type * to use as a loop counter. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_reverse(pos, head, member) \ + for (pos = list_entry((head)->prev, typeof(*pos), member), \ + prefetch(pos->member.prev); \ + &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member), \ + prefetch(pos->member.prev)) + + +/** + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * @pos: the type * to use as a loop counter. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_safe(pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_LISTBASE_H */ + +#endif /* __RTL__ */ diff --git a/orte/include/ul_utdefs.h b/orte/include/ul_utdefs.h new file mode 100644 index 0000000..0e872fd --- /dev/null +++ b/orte/include/ul_utdefs.h @@ -0,0 +1,43 @@ +/******************************************************************* + uLan Communication - C interface library + + ul_utdefs.h - common defines used in uLan utilities library + + *******************************************************************/ + + +#ifndef _UL_UTDEFS_H +#define _UL_UTDEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32)&&defined(_MSC_VER)&&!defined(inline) +#define inline _inline +#endif + +#ifndef UL_OFFSETOF +/* offset of structure field */ +#define UL_OFFSETOF(_type,_member) \ + ((int)&(((_type*)0)->_member)) +#endif /*UL_OFFSET*/ + +#ifndef UL_CONTAINEROF +#ifdef __GNUC__ +#define UL_CONTAINEROF(_ptr, _type, _member) ({ \ + const typeof( ((_type *)0)->_member ) *__mptr = (_ptr); \ + (_type *)( (char *)__mptr - UL_OFFSETOF(_type,_member) );}) +#else /*!__GNUC__*/ +#define UL_CONTAINEROF(_ptr, _type, _member) \ + ((_type *)( (char *)_ptr - UL_OFFSETOF(_type,_member))) +#endif /*__GNUC__*/ +#endif /*UL_CONTAINEROF*/ + + + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + +#endif /* _UL_UTDEFS_H */ diff --git a/orte/include/win32/getopt.h b/orte/include/win32/getopt.h new file mode 100644 index 0000000..fb30719 --- /dev/null +++ b/orte/include/win32/getopt.h @@ -0,0 +1,133 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@gnu.org. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if defined (__STDC__) && __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if defined (__STDC__) && __STDC__ +#ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* getopt.h */ diff --git a/orte/include/win32/pthread.h b/orte/include/win32/pthread.h new file mode 100644 index 0000000..c393ca0 --- /dev/null +++ b/orte/include/win32/pthread.h @@ -0,0 +1,1286 @@ +/* This is an implementation of the threads API of POSIX 1003.1-2001. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#if !defined( _PTHREAD_H ) +#define _PTHREAD_H + +#undef PTW32_LEVEL + +#if defined(_POSIX_SOURCE) +#define PTW32_LEVEL 0 +/* Early POSIX */ +#endif + +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 +#undef PTW32_LEVEL +#define PTW32_LEVEL 1 +/* Include 1b, 1c and 1d */ +#endif + +#if defined(INCLUDE_NP) +#undef PTW32_LEVEL +#define PTW32_LEVEL 2 +/* Include Non-Portable extensions */ +#endif + +#define PTW32_LEVEL_MAX 3 + +#if !defined(PTW32_LEVEL) +#define PTW32_LEVEL PTW32_LEVEL_MAX +/* Include everything */ +#endif + +#ifdef _UWIN +# define HAVE_STRUCT_TIMESPEC 1 +# define HAVE_SIGNAL_H 1 +# undef HAVE_CONFIG_H +# pragma comment(lib, "pthread") +#endif + +/* + * ------------------------------------------------------------- + * + * + * Module: pthread.h + * + * Purpose: + * Provides an implementation of PThreads based upon the + * standard: + * + * POSIX 1003.1-2001 + * and + * The Single Unix Specification version 3 + * + * (these two are equivalent) + * + * in order to enhance code portability between Windows, + * various commercial Unix implementations, and Linux. + * + * See the ANNOUNCE file for a full list of conforming + * routines and defined constants, and a list of missing + * routines and constants not defined in this implementation. + * + * Authors: + * There have been many contributors to this library. + * The initial implementation was contributed by + * John Bossom, and several others have provided major + * sections or revisions of parts of the implementation. + * Often significant effort has been contributed to + * find and fix important bugs and other problems to + * improve the reliability of the library, which sometimes + * is not reflected in the amount of code which changed as + * result. + * As much as possible, the contributors are acknowledged + * in the ChangeLog file in the source code distribution + * where their changes are noted in detail. + * + * Contributors are listed in the CONTRIBUTORS file. + * + * As usual, all bouquets go to the contributors, and all + * brickbats go to the project maintainer. + * + * Maintainer: + * The code base for this project is coordinated and + * eventually pre-tested, packaged, and made available by + * + * Ross Johnson + * + * QA Testers: + * Ultimately, the library is tested in the real world by + * a host of competent and demanding scientists and + * engineers who report bugs and/or provide solutions + * which are then fixed or incorporated into subsequent + * versions of the library. Each time a bug is fixed, a + * test case is written to prove the fix and ensure + * that later changes to the code don't reintroduce the + * same error. The number of test cases is slowly growing + * and therefore so is the code reliability. + * + * Compliance: + * See the file ANNOUNCE for the list of implemented + * and not-implemented routines and defined options. + * Of course, these are all defined is this file as well. + * + * Web site: + * The source code and other information about this library + * are available from + * + * http://sources.redhat.com/pthreads-win32/ + * + * ------------------------------------------------------------- + */ + +/* Try to avoid including windows.h */ +#if defined(__MINGW32__) && defined(__cplusplus) +/* + * FIXME: The pthreadGCE.dll build gets linker unresolved errors + * on pthread_key_create() unless windows.h is included here. + * It appears to have something to do with an argument type mismatch. + * Looking at tsd.o with 'nm' shows this line: + * 00000000 T _pthread_key_create__FPP14pthread_key_t_PFPv_v + * instead of + * 00000000 T _pthread_key_create + */ +#define PTW32_INCLUDE_WINDOWS_H +#endif + +#ifdef PTW32_INCLUDE_WINDOWS_H +#include +#endif + +/* + * ----------------- + * autoconf switches + * ----------------- + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX + +/* Try to avoid including windows.h */ +#if defined(__MINGW32__) && defined(__cplusplus) +/* + * FIXME: The pthreadGCE.dll build gets linker unresolved errors + * on pthread_key_create() unless windows.h is included here. + * It appears to have something to do with an argument type mismatch. + * Looking at tsd.o with 'nm' shows this line: + * 00000000 T _pthread_key_create__FPP14pthread_key_t_PFPv_v + * instead of + * 00000000 T _pthread_key_create + */ +#define PTW32_INCLUDE_WINDOWS_H +#endif + +#ifdef PTW32_INCLUDE_WINDOWS_H +#include +#endif + +#ifndef NEED_FTIME +#include +#else /* NEED_FTIME */ +/* use native WIN32 time API */ +#endif /* NEED_FTIME */ + +#if HAVE_SIGNAL_H +#include +#endif /* HAVE_SIGNAL_H */ + +#include +#include + +/* + * This is a duplicate of what is in the autoconf config.h, + * which is only used when building the pthread-win32 libraries. + */ + +#ifndef PTW32_CONFIG_H +# if defined(WINCE) +# define NEED_ERRNO +# define NEED_SEM +# endif +# if defined(_UWIN) || defined(__MINGW32__) +# define HAVE_MODE_T +# endif +#endif + +/* + * + */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +#ifdef NEED_ERRNO +#include "need_errno.h" +#else +#include +#endif +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +/* + * Several systems don't define ENOTSUP. If not, we use + * the same value as Solaris. + */ +#ifndef ENOTSUP +# define ENOTSUP 48 +#endif + +#ifndef ETIMEDOUT +# define ETIMEDOUT 10060 /* This is the value in winsock.h. */ +#endif + +#include "sched.h" + +/* + * To avoid including windows.h we define only those things that we + * actually need from it. I don't like the potential incompatibility that + * this creates with future versions of windows. + */ +#ifndef PTW32_INCLUDE_WINDOWS_H +#ifndef HANDLE +# define PTW32__HANDLE_DEF +# define HANDLE void * +#endif +#ifndef DWORD +# define PTW32__DWORD_DEF +# define DWORD unsigned long +#endif +#endif + +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +#ifndef HAVE_STRUCT_TIMESPEC +struct timespec { + long tv_sec; + long tv_nsec; +}; +#endif /* HAVE_STRUCT_TIMESPEC */ + +#ifndef SIG_BLOCK +#define SIG_BLOCK 0 +#endif /* SIG_BLOCK */ + +#ifndef SIG_UNBLOCK +#define SIG_UNBLOCK 1 +#endif /* SIG_UNBLOCK */ + +#ifndef SIG_SETMASK +#define SIG_SETMASK 2 +#endif /* SIG_SETMASK */ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* + * ------------------------------------------------------------- + * + * POSIX 1003.1-2001 Options + * ========================= + * + * _POSIX_THREADS (set) + * If set, you can use threads + * + * _POSIX_THREAD_ATTR_STACKSIZE (set) + * If set, you can control the size of a thread's + * stack + * pthread_attr_getstacksize + * pthread_attr_setstacksize + * + * _POSIX_THREAD_ATTR_STACKADDR (not set) + * If set, you can allocate and control a thread's + * stack. If not supported, the following functions + * will return ENOSYS, indicating they are not + * supported: + * pthread_attr_getstackaddr + * pthread_attr_setstackaddr + * + * _POSIX_THREAD_PRIORITY_SCHEDULING (set) + * If set, you can use realtime scheduling. + * Indicates the availability of: + * pthread_attr_getinheritsched + * pthread_attr_getschedparam + * pthread_attr_getschedpolicy + * pthread_attr_getscope + * pthread_attr_setinheritsched + * pthread_attr_setschedparam + * pthread_attr_setschedpolicy + * pthread_attr_setscope + * pthread_getschedparam + * pthread_setschedparam + * sched_get_priority_max + * sched_get_priority_min + * sched_rr_set_interval + * + * _POSIX_THREAD_PRIO_INHERIT (not set) + * If set, you can create priority inheritance + * mutexes. + * pthread_mutexattr_getprotocol + + * pthread_mutexattr_setprotocol + + * + * _POSIX_THREAD_PRIO_PROTECT (not set) + * If set, you can create priority ceiling mutexes + * Indicates the availability of: + * pthread_mutex_getprioceiling + * pthread_mutex_setprioceiling + * pthread_mutexattr_getprioceiling + * pthread_mutexattr_getprotocol + + * pthread_mutexattr_setprioceiling + * pthread_mutexattr_setprotocol + + * + * _POSIX_THREAD_PROCESS_SHARED (not set) + * If set, you can create mutexes and condition + * variables that can be shared with another + * process.If set, indicates the availability + * of: + * pthread_mutexattr_getpshared + * pthread_mutexattr_setpshared + * pthread_condattr_getpshared + * pthread_condattr_setpshared + * + * _POSIX_THREAD_SAFE_FUNCTIONS (set) + * If set you can use the special *_r library + * functions that provide thread-safe behaviour + * + * _POSIX_READER_WRITER_LOCKS (set) + * If set, you can use read/write locks + * + * _POSIX_SPIN_LOCKS (set) + * If set, you can use spin locks + * + * _POSIX_BARRIERS (set) + * If set, you can use barriers + * + * + These functions provide both 'inherit' and/or + * 'protect' protocol, based upon these macro + * settings. + * + * POSIX 1003.1-2001 Limits + * =========================== + * + * PTHREAD_DESTRUCTOR_ITERATIONS + * Maximum number of attempts to destroy + * a thread's thread-specific data on + * termination (must be at least 4) + * + * PTHREAD_KEYS_MAX + * Maximum number of thread-specific data keys + * available per process (must be at least 128) + * + * PTHREAD_STACK_MIN + * Minimum supported stack size for a thread + * + * PTHREAD_THREADS_MAX + * Maximum number of threads supported per + * process (must be at least 64). + * + * _POSIX_SEM_NSEMS_MAX + * The maximum number of semaphores a process can have. + * (only defined if not already defined) + * + * _POSIX_SEM_VALUE_MAX + * The maximum value a semaphore can have. + * (only defined if not already defined) + * + * ------------------------------------------------------------- + */ + +/* + * POSIX Options + */ +#ifndef _POSIX_THREADS +#define _POSIX_THREADS +#endif + +#ifndef _POSIX_READER_WRITER_LOCKS +#define _POSIX_READER_WRITER_LOCKS +#endif + +#ifndef _POSIX_SPIN_LOCKS +#define _POSIX_SPIN_LOCKS +#endif + +#ifndef _POSIX_BARRIERS +#define _POSIX_BARRIERS +#endif + +#define _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_ATTR_STACKSIZE +#define _POSIX_THREAD_PRIORITY_SCHEDULING + +#if defined( KLUDGE ) +/* + * The following are not supported + */ +#define _POSIX_THREAD_ATTR_STACKADDR +#define _POSIX_THREAD_PRIO_INHERIT +#define _POSIX_THREAD_PRIO_PROTECT +#define _POSIX_THREAD_PROCESS_SHARED + +#endif /* KLUDGE */ + +/* + * POSIX Limits + * + * PTHREAD_DESTRUCTOR_ITERATIONS + * Standard states this must be at least + * 4. + * + * PTHREAD_KEYS_MAX + * WIN32 permits only 64 TLS keys per process. + * This limitation could be worked around by + * simply simulating keys. + * + * PTHREADS_STACK_MIN + * POSIX specifies 0 which is also the value WIN32 + * interprets as allowing the system to + * set the size to that of the main thread. The + * maximum stack size in Win32 is 1Meg. WIN32 + * allocates more stack as required up to the 1Meg + * limit. + * + * PTHREAD_THREADS_MAX + * Not documented by WIN32. Wrote a test program + * that kept creating threads until it failed + * revealed this approximate number (Windows NT). + * This number is somewhat less for Windows 9x + * and is effectively less than 64. Perhaps this + * constant should be set at DLL load time. + * + */ +#define PTHREAD_DESTRUCTOR_ITERATIONS 4 +#define PTHREAD_KEYS_MAX 64 +#define PTHREAD_STACK_MIN 0 +#define PTHREAD_THREADS_MAX 2019 +#ifndef _POSIX_SEM_NSEMS_MAX +/* Not used and only an arbitrary value. */ +# define _POSIX_SEM_NSEMS_MAX 1024 +#endif +#ifndef _POSIX_SEM_VALUE_MAX +# define _POSIX_SEM_VALUE_MAX (INT_MAX/2) +#endif + +#if __GNUC__ && ! defined (__declspec) +# error Please upgrade your GNU compiler to one that supports __declspec. +#endif + +/* + * When building the DLL code, you should define PTW32_BUILD so that + * the variables/functions are exported correctly. When using the DLL, + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ +#ifdef _DLL +# ifdef PTW32_BUILD +# define PTW32_DLLPORT __declspec (dllexport) +# else +# define PTW32_DLLPORT __declspec (dllimport) +# endif +#endif + +#if defined(_UWIN) && PTW32_LEVEL >= PTW32_LEVEL_MAX +# include +#else +typedef struct pthread_t_ *pthread_t; +typedef struct pthread_attr_t_ *pthread_attr_t; +typedef struct pthread_once_t_ pthread_once_t; +typedef struct pthread_key_t_ *pthread_key_t; +typedef struct pthread_mutex_t_ *pthread_mutex_t; +typedef struct pthread_mutexattr_t_ *pthread_mutexattr_t; +typedef struct pthread_cond_t_ *pthread_cond_t; +typedef struct pthread_condattr_t_ *pthread_condattr_t; +#endif +typedef struct pthread_rwlock_t_ *pthread_rwlock_t; +typedef struct pthread_rwlockattr_t_ *pthread_rwlockattr_t; +typedef struct pthread_spinlock_t_ *pthread_spinlock_t; +typedef struct pthread_barrier_t_ *pthread_barrier_t; +typedef struct pthread_barrierattr_t_ *pthread_barrierattr_t; + +/* + * ==================== + * ==================== + * POSIX Threads + * ==================== + * ==================== + */ + +enum { +/* + * pthread_attr_{get,set}detachstate + */ + PTHREAD_CREATE_JOINABLE = 0, /* Default */ + PTHREAD_CREATE_DETACHED = 1, + +/* + * pthread_attr_{get,set}inheritsched + */ + PTHREAD_INHERIT_SCHED = 0, + PTHREAD_EXPLICIT_SCHED = 1, /* Default */ + +/* + * pthread_{get,set}scope + */ + PTHREAD_SCOPE_PROCESS = 0, + PTHREAD_SCOPE_SYSTEM = 1, /* Default */ + +/* + * pthread_setcancelstate paramters + */ + PTHREAD_CANCEL_ENABLE = 0, /* Default */ + PTHREAD_CANCEL_DISABLE = 1, + +/* + * pthread_setcanceltype parameters + */ + PTHREAD_CANCEL_ASYNCHRONOUS = 0, + PTHREAD_CANCEL_DEFERRED = 1, /* Default */ + +/* + * pthread_mutexattr_{get,set}pshared + * pthread_condattr_{get,set}pshared + */ + PTHREAD_PROCESS_PRIVATE = 0, + PTHREAD_PROCESS_SHARED = 1, + +/* + * pthread_barrier_wait + */ + PTHREAD_BARRIER_SERIAL_THREAD = -1 +}; + +/* + * ==================== + * ==================== + * Cancelation + * ==================== + * ==================== + */ +#define PTHREAD_CANCELED ((void *) -1) + + +/* + * ==================== + * ==================== + * Once Key + * ==================== + * ==================== + */ +#define PTHREAD_ONCE_INIT { FALSE, -1 } + +struct pthread_once_t_ +{ + int done; /* indicates if user function executed */ + long started; /* First thread to increment this value */ + /* to zero executes the user function */ +}; + + +/* + * ==================== + * ==================== + * Object initialisers + * ==================== + * ==================== + */ +#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1) + +#define PTHREAD_COND_INITIALIZER ((pthread_cond_t) -1) + +#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) -1) + +#define PTHREAD_SPINLOCK_INITIALIZER ((pthread_spinlock_t) -1) + + +/* + * Mutex types. + */ +enum +{ + /* Compatibility with LinuxThreads */ + PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP, + /* For compatibility with POSIX */ + PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL +}; + + +/* There are three implementations of cancel cleanup. + * Note that pthread.h is included in both application + * compilation units and also internally for the library. + * The code here and within the library aims to work + * for all reasonable combinations of environments. + * + * The three implementations are: + * + * WIN32 SEH + * C + * C++ + * + * Please note that exiting a push/pop block via + * "return", "exit", "break", or "continue" will + * lead to different behaviour amongst applications + * depending upon whether the library was built + * using SEH, C++, or C. For example, a library built + * with SEH will call the cleanup routine, while both + * C++ and C built versions will not. + */ + +/* + * Define defaults for cleanup code. + * Note: Unless the build explicitly defines one of the following, then + * we default to standard C style cleanup. This style uses setjmp/longjmp + * in the cancelation and thread exit implementations and therefore won't + * do stack unwinding if linked to applications that have it (e.g. + * C++ apps). This is currently consistent with most/all commercial Unix + * POSIX threads implementations. + */ +#if !defined( __CLEANUP_SEH ) && !defined( __CLEANUP_CXX ) && !defined( __CLEANUP_C ) +# define __CLEANUP_C +#endif + +#if defined( __CLEANUP_SEH ) && defined(__GNUC__) +#error ERROR [__FILE__, line __LINE__]: GNUC does not support SEH. +#endif + +typedef struct ptw32_cleanup_t ptw32_cleanup_t; +typedef void (__cdecl *ptw32_cleanup_callback_t)(void *); + +struct ptw32_cleanup_t +{ + ptw32_cleanup_callback_t routine; + void *arg; + struct ptw32_cleanup_t *prev; +}; + +#ifdef __CLEANUP_SEH + /* + * WIN32 SEH version of cancel cleanup. + */ + +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + ptw32_cleanup_t _cleanup; \ + \ + _cleanup.routine = (ptw32_cleanup_callback_t)(_rout); \ + _cleanup.arg = (_arg); \ + __try \ + { \ + +#define pthread_cleanup_pop( _execute ) \ + } \ + __finally \ + { \ + if( _execute || AbnormalTermination()) \ + { \ + (*(_cleanup.routine))( _cleanup.arg ); \ + } \ + } \ + } + +#else /* __CLEANUP_SEH */ + +#ifdef __CLEANUP_C + + /* + * C implementation of PThreads cancel cleanup + */ + +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + ptw32_cleanup_t _cleanup; \ + \ + ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t) (_rout), (_arg) ); \ + +#define pthread_cleanup_pop( _execute ) \ + (void) ptw32_pop_cleanup( _execute ); \ + } + +#else /* __CLEANUP_C */ + +#ifdef __CLEANUP_CXX + + /* + * C++ version of cancel cleanup. + * - John E. Bossom. + */ + + class PThreadCleanup { + /* + * PThreadCleanup + * + * Purpose + * This class is a C++ helper class that is + * used to implement pthread_cleanup_push/ + * pthread_cleanup_pop. + * The destructor of this class automatically + * pops the pushed cleanup routine regardless + * of how the code exits the scope + * (i.e. such as by an exception) + */ + ptw32_cleanup_callback_t cleanUpRout; + void * obj; + int executeIt; + + public: + PThreadCleanup() : + cleanUpRout( 0 ), + obj( 0 ), + executeIt( 0 ) + /* + * No cleanup performed + */ + { + } + + PThreadCleanup( + ptw32_cleanup_callback_t routine, + void * arg ) : + cleanUpRout( routine ), + obj( arg ), + executeIt( 1 ) + /* + * Registers a cleanup routine for 'arg' + */ + { + } + + ~PThreadCleanup() + { + if ( executeIt && ((void *) cleanUpRout != (void *) 0) ) + { + (void) (*cleanUpRout)( obj ); + } + } + + void execute( int exec ) + { + executeIt = exec; + } + }; + + /* + * C++ implementation of PThreads cancel cleanup; + * This implementation takes advantage of a helper + * class who's destructor automatically calls the + * cleanup routine if we exit our scope weirdly + */ +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + PThreadCleanup cleanup((ptw32_cleanup_callback_t)(_rout), \ + (void *) (_arg) ); + +#define pthread_cleanup_pop( _execute ) \ + cleanup.execute( _execute ); \ + } + +#else + +#error ERROR [__FILE__, line __LINE__]: Cleanup type undefined. + +#endif /* __CLEANUP_CXX */ + +#endif /* __CLEANUP_C */ + +#endif /* __CLEANUP_SEH */ + +/* + * =============== + * =============== + * Methods + * =============== + * =============== + */ + +/* + * PThread Attribute Functions + */ +PTW32_DLLPORT int pthread_attr_init (pthread_attr_t * attr); + +PTW32_DLLPORT int pthread_attr_destroy (pthread_attr_t * attr); + +PTW32_DLLPORT int pthread_attr_getdetachstate (const pthread_attr_t * attr, + int *detachstate); + +PTW32_DLLPORT int pthread_attr_getstackaddr (const pthread_attr_t * attr, + void **stackaddr); + +PTW32_DLLPORT int pthread_attr_getstacksize (const pthread_attr_t * attr, + size_t * stacksize); + +PTW32_DLLPORT int pthread_attr_setdetachstate (pthread_attr_t * attr, + int detachstate); + +PTW32_DLLPORT int pthread_attr_setstackaddr (pthread_attr_t * attr, + void *stackaddr); + +PTW32_DLLPORT int pthread_attr_setstacksize (pthread_attr_t * attr, + size_t stacksize); + +PTW32_DLLPORT int pthread_attr_getschedparam (const pthread_attr_t *attr, + struct sched_param *param); + +PTW32_DLLPORT int pthread_attr_setschedparam (pthread_attr_t *attr, + const struct sched_param *param); + +PTW32_DLLPORT int pthread_attr_setschedpolicy (pthread_attr_t *, + int); + +PTW32_DLLPORT int pthread_attr_getschedpolicy (pthread_attr_t *, + int *); + +PTW32_DLLPORT int pthread_attr_setinheritsched(pthread_attr_t * attr, + int inheritsched); + +PTW32_DLLPORT int pthread_attr_getinheritsched(pthread_attr_t * attr, + int * inheritsched); + +PTW32_DLLPORT int pthread_attr_setscope (pthread_attr_t *, + int); + +PTW32_DLLPORT int pthread_attr_getscope (const pthread_attr_t *, + int *); + +/* + * PThread Functions + */ +PTW32_DLLPORT int pthread_create (pthread_t * tid, + const pthread_attr_t * attr, + void *(*start) (void *), + void *arg); + +PTW32_DLLPORT int pthread_detach (pthread_t tid); + +PTW32_DLLPORT int pthread_equal (pthread_t t1, + pthread_t t2); + +PTW32_DLLPORT void pthread_exit (void *value_ptr); + +PTW32_DLLPORT int pthread_join (pthread_t thread, + void **value_ptr); + +PTW32_DLLPORT pthread_t pthread_self (void); + +PTW32_DLLPORT int pthread_cancel (pthread_t thread); + +PTW32_DLLPORT int pthread_setcancelstate (int state, + int *oldstate); + +PTW32_DLLPORT int pthread_setcanceltype (int type, + int *oldtype); + +PTW32_DLLPORT void pthread_testcancel (void); + +PTW32_DLLPORT int pthread_once (pthread_once_t * once_control, + void (*init_routine) (void)); + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +PTW32_DLLPORT ptw32_cleanup_t *ptw32_pop_cleanup (int execute); + +PTW32_DLLPORT void ptw32_push_cleanup (ptw32_cleanup_t * cleanup, + void (*routine) (void *), + void *arg); +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +/* + * Thread Specific Data Functions + */ +PTW32_DLLPORT int pthread_key_create (pthread_key_t * key, + void (*destructor) (void *)); + +PTW32_DLLPORT int pthread_key_delete (pthread_key_t key); + +PTW32_DLLPORT int pthread_setspecific (pthread_key_t key, + const void *value); + +PTW32_DLLPORT void *pthread_getspecific (pthread_key_t key); + + +/* + * Mutex Attribute Functions + */ +PTW32_DLLPORT int pthread_mutexattr_init (pthread_mutexattr_t * attr); + +PTW32_DLLPORT int pthread_mutexattr_destroy (pthread_mutexattr_t * attr); + +PTW32_DLLPORT int pthread_mutexattr_getpshared (const pthread_mutexattr_t + * attr, + int *pshared); + +PTW32_DLLPORT int pthread_mutexattr_setpshared (pthread_mutexattr_t * attr, + int pshared); + +PTW32_DLLPORT int pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind); +PTW32_DLLPORT int pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind); + +/* + * Barrier Attribute Functions + */ +PTW32_DLLPORT int pthread_barrierattr_init (pthread_barrierattr_t * attr); + +PTW32_DLLPORT int pthread_barrierattr_destroy (pthread_barrierattr_t * attr); + +PTW32_DLLPORT int pthread_barrierattr_getpshared (const pthread_barrierattr_t + * attr, + int *pshared); + +PTW32_DLLPORT int pthread_barrierattr_setpshared (pthread_barrierattr_t * attr, + int pshared); + +/* + * Mutex Functions + */ +PTW32_DLLPORT int pthread_mutex_init (pthread_mutex_t * mutex, + const pthread_mutexattr_t * attr); + +PTW32_DLLPORT int pthread_mutex_destroy (pthread_mutex_t * mutex); + +PTW32_DLLPORT int pthread_mutex_lock (pthread_mutex_t * mutex); + +PTW32_DLLPORT int pthread_mutex_timedlock(pthread_mutex_t *mutex, + const struct timespec *abstime); + +PTW32_DLLPORT int pthread_mutex_trylock (pthread_mutex_t * mutex); + +PTW32_DLLPORT int pthread_mutex_unlock (pthread_mutex_t * mutex); + +/* + * Spinlock Functions + */ +PTW32_DLLPORT int pthread_spin_init (pthread_spinlock_t * lock, int pshared); + +PTW32_DLLPORT int pthread_spin_destroy (pthread_spinlock_t * lock); + +PTW32_DLLPORT int pthread_spin_lock (pthread_spinlock_t * lock); + +PTW32_DLLPORT int pthread_spin_trylock (pthread_spinlock_t * lock); + +PTW32_DLLPORT int pthread_spin_unlock (pthread_spinlock_t * lock); + +/* + * Barrier Functions + */ +PTW32_DLLPORT int pthread_barrier_init (pthread_barrier_t * barrier, + const pthread_barrierattr_t * attr, + unsigned int count); + +PTW32_DLLPORT int pthread_barrier_destroy (pthread_barrier_t * barrier); + +PTW32_DLLPORT int pthread_barrier_wait (pthread_barrier_t * barrier); + +/* + * Condition Variable Attribute Functions + */ +PTW32_DLLPORT int pthread_condattr_init (pthread_condattr_t * attr); + +PTW32_DLLPORT int pthread_condattr_destroy (pthread_condattr_t * attr); + +PTW32_DLLPORT int pthread_condattr_getpshared (const pthread_condattr_t * attr, + int *pshared); + +PTW32_DLLPORT int pthread_condattr_setpshared (pthread_condattr_t * attr, + int pshared); + +/* + * Condition Variable Functions + */ +PTW32_DLLPORT int pthread_cond_init (pthread_cond_t * cond, + const pthread_condattr_t * attr); + +PTW32_DLLPORT int pthread_cond_destroy (pthread_cond_t * cond); + +PTW32_DLLPORT int pthread_cond_wait (pthread_cond_t * cond, + pthread_mutex_t * mutex); + +PTW32_DLLPORT int pthread_cond_timedwait (pthread_cond_t * cond, + pthread_mutex_t * mutex, + const struct timespec *abstime); + +PTW32_DLLPORT int pthread_cond_signal (pthread_cond_t * cond); + +PTW32_DLLPORT int pthread_cond_broadcast (pthread_cond_t * cond); + +/* + * Scheduling + */ +PTW32_DLLPORT int pthread_setschedparam (pthread_t thread, + int policy, + const struct sched_param *param); + +PTW32_DLLPORT int pthread_getschedparam (pthread_t thread, + int *policy, + struct sched_param *param); + +PTW32_DLLPORT int pthread_setconcurrency (int); + +PTW32_DLLPORT int pthread_getconcurrency (void); + +/* + * Read-Write Lock Functions + */ +PTW32_DLLPORT int pthread_rwlock_init(pthread_rwlock_t *lock, + const pthread_rwlockattr_t *attr); + +PTW32_DLLPORT int pthread_rwlock_destroy(pthread_rwlock_t *lock); + +PTW32_DLLPORT int pthread_rwlock_tryrdlock(pthread_rwlock_t *); + +PTW32_DLLPORT int pthread_rwlock_trywrlock(pthread_rwlock_t *); + +PTW32_DLLPORT int pthread_rwlock_rdlock(pthread_rwlock_t *lock); + +PTW32_DLLPORT int pthread_rwlock_timedrdlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + +PTW32_DLLPORT int pthread_rwlock_wrlock(pthread_rwlock_t *lock); + +PTW32_DLLPORT int pthread_rwlock_timedwrlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + +PTW32_DLLPORT int pthread_rwlock_unlock(pthread_rwlock_t *lock); + +PTW32_DLLPORT int pthread_rwlockattr_init (pthread_rwlockattr_t * attr); + +PTW32_DLLPORT int pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr); + +PTW32_DLLPORT int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr, + int *pshared); + +PTW32_DLLPORT int pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr, + int pshared); + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX - 1 + +/* + * Non-portable functions + */ + +/* + * Compatibility with Linux. + */ +PTW32_DLLPORT int pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr, + int kind); +PTW32_DLLPORT int pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr, + int *kind); + +/* + * Possibly supported by other POSIX threads implementations + */ +PTW32_DLLPORT int pthread_delay_np (struct timespec * interval); +PTW32_DLLPORT int pthread_num_processors_np(void); + +/* + * Useful if an application wants to statically link + * the lib rather than load the DLL at run-time. + */ +PTW32_DLLPORT int pthread_win32_process_attach_np(void); +PTW32_DLLPORT int pthread_win32_process_detach_np(void); +PTW32_DLLPORT int pthread_win32_thread_attach_np(void); +PTW32_DLLPORT int pthread_win32_thread_detach_np(void); + +/* + * Register a system time change with the library. + * Causes the library to perform various functions + * in response to the change. Should be called whenever + * the application's top level window receives a + * WM_TIMECHANGE message. It can be passed directly to + * pthread_create() as a new thread if desired. + */ +PTW32_DLLPORT void * pthread_timechange_handler_np(void *); + +#endif /*PTW32_LEVEL >= PTW32_LEVEL_MAX - 1 */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX + +/* + * Returns the Win32 HANDLE for the POSIX thread. + */ +PTW32_DLLPORT HANDLE pthread_getw32threadhandle_np(pthread_t thread); + + +/* + * Protected Methods + * + * This function blocks until the given WIN32 handle + * is signaled or pthread_cancel had been called. + * This function allows the caller to hook into the + * PThreads cancel mechanism. It is implemented using + * + * WaitForMultipleObjects + * + * on 'waitHandle' and a manually reset WIN32 Event + * used to implement pthread_cancel. The 'timeout' + * argument to TimedWait is simply passed to + * WaitForMultipleObjects. + */ +PTW32_DLLPORT int pthreadCancelableWait (HANDLE waitHandle); +PTW32_DLLPORT int pthreadCancelableTimedWait (HANDLE waitHandle, + DWORD timeout); + +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +/* + * Thread-Safe C Runtime Library Mappings. + */ +#ifndef _UWIN +# if defined(NEED_ERRNO) + PTW32_DLLPORT int * _errno( void ); +# else +# ifndef errno +# if (defined(_MT) || defined(_DLL)) + __declspec(dllimport) extern int * __cdecl _errno(void); +# define errno (*_errno()) +# endif +# endif +# endif +#endif + +/* + * WIN32 C runtime library had been made thread-safe + * without affecting the user interface. Provide + * mappings from the UNIX thread-safe versions to + * the standard C runtime library calls. + * Only provide function mappings for functions that + * actually exist on WIN32. + */ + +#if !defined(__MINGW32__) +#define strtok_r( _s, _sep, _lasts ) \ + ( *(_lasts) = strtok( (_s), (_sep) ) ) +#endif /* !__MINGW32__ */ + +#define asctime_r( _tm, _buf ) \ + ( strcpy( (_buf), asctime( (_tm) ) ), \ + (_buf) ) + +#define ctime_r( _clock, _buf ) \ + ( strcpy( (_buf), ctime( (_clock) ) ), \ + (_buf) ) + +#define gmtime_r( _clock, _result ) \ + ( *(_result) = *gmtime( (_clock) ), \ + (_result) ) + +#define localtime_r( _clock, _result ) \ + ( *(_result) = *localtime( (_clock) ), \ + (_result) ) + +#define rand_r( _seed ) \ + ( _seed == _seed? rand() : rand() ) + + +#ifdef __cplusplus + +/* + * Internal exceptions + */ +class ptw32_exception {}; +class ptw32_exception_cancel : public ptw32_exception {}; +class ptw32_exception_exit : public ptw32_exception {}; + +#endif + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX + +/* FIXME: This is only required if the library was built using SEH */ +/* + * Get internal SEH tag + */ +PTW32_DLLPORT DWORD ptw32_get_exception_services_code(void); + +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +#ifndef PTW32_BUILD + +#ifdef __CLEANUP_SEH + +/* + * Redefine the SEH __except keyword to ensure that applications + * propagate our internal exceptions up to the library's internal handlers. + */ +#define __except( E ) \ + __except( ( GetExceptionCode() == ptw32_get_exception_services_code() ) \ + ? EXCEPTION_CONTINUE_SEARCH : ( E ) ) + +#endif /* __CLEANUP_SEH */ + +#ifdef __CLEANUP_CXX + +/* + * Redefine the C++ catch keyword to ensure that applications + * propagate our internal exceptions up to the library's internal handlers. + */ +#ifdef _MSC_VER + /* + * WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll' + * if you want Pthread-Win32 cancelation and pthread_exit to work. + */ + +#ifndef PtW32NoCatchWarn + +#pragma message("Specify \"/DPtW32NoCatchWarn\" compiler flag to skip this message.") +#pragma message("------------------------------------------------------------------") +#pragma message("When compiling applications with MSVC++ and C++ exception handling:") +#pragma message(" Replace any 'catch( ... )' in routines called from POSIX threads") +#pragma message(" with 'PtW32CatchAll' or 'CATCHALL' if you want POSIX thread") +#pragma message(" cancelation and pthread_exit to work. For example:") +#pragma message("") +#pragma message(" #ifdef PtW32CatchAll") +#pragma message(" PtW32CatchAll") +#pragma message(" #else") +#pragma message(" catch(...)") +#pragma message(" #endif") +#pragma message(" {") +#pragma message(" /* Catchall block processing */") +#pragma message(" }") +#pragma message("------------------------------------------------------------------") + +#endif + +#define PtW32CatchAll \ + catch( ptw32_exception & ) { throw; } \ + catch( ... ) + +#else /* _MSC_VER */ + +#define catch( E ) \ + catch( ptw32_exception & ) { throw; } \ + catch( E ) + +#endif /* _MSC_VER */ + +#endif /* __CLEANUP_CXX */ + +#endif /* ! PTW32_BUILD */ + +#ifdef __cplusplus +} /* End of extern "C" */ +#endif /* __cplusplus */ + +#ifdef PTW32__HANDLE_DEF +# undef HANDLE +#endif +#ifdef PTW32__DWORD_DEF +# undef DWORD +#endif + +#undef PTW32_LEVEL +#undef PTW32_LEVEL_MAX + +#endif /* _PTHREAD_H */ diff --git a/orte/include/win32/sched.h b/orte/include/win32/sched.h new file mode 100644 index 0000000..e822ca4 --- /dev/null +++ b/orte/include/win32/sched.h @@ -0,0 +1,174 @@ +/* + * Module: sched.h + * + * Purpose: + * Provides an implementation of POSIX realtime extensions + * as defined in + * + * POSIX 1003.1b-1993 (POSIX.1b) + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#ifndef _SCHED_H +#define _SCHED_H + +#undef PTW32_LEVEL + +#if defined(_POSIX_SOURCE) +#define PTW32_LEVEL 0 +/* Early POSIX */ +#endif + +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 +#undef PTW32_LEVEL +#define PTW32_LEVEL 1 +/* Include 1b, 1c and 1d */ +#endif + +#if defined(INCLUDE_NP) +#undef PTW32_LEVEL +#define PTW32_LEVEL 2 +/* Include Non-Portable extensions */ +#endif + +#define PTW32_LEVEL_MAX 3 + +#if !defined(PTW32_LEVEL) +#define PTW32_LEVEL PTW32_LEVEL_MAX +/* Include everything */ +#endif + + +#if __GNUC__ && ! defined (__declspec) +# error Please upgrade your GNU compiler to one that supports __declspec. +#endif + +/* + * When building the DLL code, you should define PTW32_BUILD so that + * the variables/functions are exported correctly. When using the DLL, + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ +#ifdef PTW32_BUILD +# define PTW32_DLLPORT __declspec (dllexport) +#else +# define PTW32_DLLPORT __declspec (dllimport) +#endif + +/* + * This is a duplicate of what is in the autoconf config.h, + * which is only used when building the pthread-win32 libraries. + */ + +#ifndef PTW32_CONFIG_H +# if defined(WINCE) +# define NEED_ERRNO +# define NEED_SEM +# endif +# if defined(_UWIN) || defined(__MINGW32__) +# define HAVE_MODE_T +# endif +#endif + +/* + * + */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +#ifdef NEED_ERRNO +#include "need_errno.h" +#else +#include +#endif +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +#if defined(__MINGW32__) || defined(_UWIN) +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +/* For pid_t */ +# include +/* Required by Unix 98 */ +# include +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ +#else +typedef int pid_t; +#endif + +/* Thread scheduling policies */ + +enum { + SCHED_OTHER = 0, + SCHED_FIFO, + SCHED_RR, + SCHED_MIN = SCHED_OTHER, + SCHED_MAX = SCHED_RR +}; + +struct sched_param { + int sched_priority; +}; + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PTW32_DLLPORT int sched_yield (void); + +PTW32_DLLPORT int sched_get_priority_min (int policy); + +PTW32_DLLPORT int sched_get_priority_max (int policy); + +PTW32_DLLPORT int sched_setscheduler (pid_t pid, int policy); + +PTW32_DLLPORT int sched_getscheduler (pid_t pid); + +/* + * Note that this macro returns ENOTSUP rather than + * ENOSYS as might be expected. However, returning ENOSYS + * should mean that sched_get_priority_{min,max} are + * not implemented as well as sched_rr_get_interval. + * This is not the case, since we just don't support + * round-robin scheduling. Therefore I have chosen to + * return the same value as sched_setscheduler when + * SCHED_RR is passed to it. + */ +#define sched_rr_get_interval(_pid, _interval) \ + ( errno = ENOTSUP, (int) -1 ) + + +#ifdef __cplusplus +} /* End of extern "C" */ +#endif /* __cplusplus */ + +#undef PTW32_LEVEL +#undef PTW32_LEVEL_MAX + +#endif /* !_SCHED_H */ + diff --git a/orte/include/win32/timeval.h b/orte/include/win32/timeval.h new file mode 100644 index 0000000..cf6da30 --- /dev/null +++ b/orte/include/win32/timeval.h @@ -0,0 +1,64 @@ +/* + * timeval.h 1.0 01/12/19 + * + * Defines gettimeofday, timeval, etc. for Win32 + * + * By Wu Yongwei, modified by Petr Smolik + * + */ + +#ifndef _TIMEVAL_H +#define _TIMEVAL_H + +#ifdef _WIN32 + +#include //there is defined struct timeval +#include +#include + +//#define EPOCHFILETIME (116444736000000000i64) + +#define EPOCHFILETIME (116444736000000000) + +struct timezone { + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + +static inline int gettimeofday(struct timeval *tv, struct timezone *tz) +{ + FILETIME ft; + LARGE_INTEGER li; + __int64 t; + static int tzflag; + + if (tv) + { + GetSystemTimeAsFileTime(&ft); + li.LowPart = ft.dwLowDateTime; + li.HighPart = ft.dwHighDateTime; + t = li.QuadPart; /* In 100-nanosecond intervals */ + t -= EPOCHFILETIME; /* Offset to the Epoch time */ + t /= 10; /* In microseconds */ + tv->tv_sec = (long)(t / 1000000); + tv->tv_usec = (long)(t % 1000000); + } + + if (tz) + { + if (!tzflag) + { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + + return 0; +} + +#endif /* _WIN32 */ + +#endif /* _TIMEVAL_H */ + diff --git a/orte/liborte/Makefile b/orte/liborte/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/orte/liborte/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/liborte/Makefile.am b/orte/liborte/Makefile.am new file mode 100644 index 0000000..8ed3a96 --- /dev/null +++ b/orte/liborte/Makefile.am @@ -0,0 +1,64 @@ +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# + +LIBORTE_SOURCES = \ +conv.c \ +debug.c \ +event.c \ +fnmatch.c \ +htimerNtp.c \ +objectEntry.c \ +objectEntryTimer.c \ +objectUtils.c \ +ORTEAppRecvMetatrafficThread.c \ +ORTEAppRecvUserdataThread.c \ +ORTEAppSendThread.c \ +ORTEDomainApp.c \ +ORTEPublication.c \ +ORTEPublicationTimer.c \ +ORTESubscription.c \ +ORTEDomain.c \ +ORTEDomainMgr.c \ +ORTEInit.c \ +ORTEThreadUtils.c \ +ORTETypeRegister.c \ +ORTEVerbosity.c \ +ORTEPattern.c \ +parameter.c \ +RTPSAck.c \ +RTPSCSTReader.c \ +RTPSCSTReaderTimer.c \ +RTPSCSTReaderProc.c \ +RTPSCSTWriter.c \ +RTPSCSTWriterTimer.c \ +RTPSGap.c \ +RTPSHeader.c \ +RTPSHeardBeat.c \ +RTPSInfoDST.c \ +RTPSInfoREPLY.c \ +RTPSInfoSRC.c \ +RTPSInfoTS.c \ +RTPSPad.c \ +RTPSUtils.c \ +RTPSVar.c \ +RTPSIssue.c \ +sock.c \ +ul_gavl.c \ +ul_gavlprim.c + +if CONFIG_ORTE_RT +module_PROGRAMS = orte.ko +orte_ko_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) +orte_ko_SOURCES = $(LIBORTE_SOURCES) +orte_ko_LINK = $(top_builddir)/modtool --link -o $@ + +SUBDIRS = rtl +else +lib_LIBRARIES = liborte.a +liborte_a_SOURCES = $(LIBORTE_SOURCES) +endif + +EXTRA_DIST = usedSections.txt diff --git a/orte/liborte/Makefile.in b/orte/liborte/Makefile.in new file mode 100644 index 0000000..c62f045 --- /dev/null +++ b/orte/liborte/Makefile.in @@ -0,0 +1,1298 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ + +LIBORTE_SOURCES = \ +conv.c \ +debug.c \ +event.c \ +fnmatch.c \ +htimerNtp.c \ +objectEntry.c \ +objectEntryTimer.c \ +objectUtils.c \ +ORTEAppRecvMetatrafficThread.c \ +ORTEAppRecvUserdataThread.c \ +ORTEAppSendThread.c \ +ORTEDomainApp.c \ +ORTEPublication.c \ +ORTEPublicationTimer.c \ +ORTESubscription.c \ +ORTEDomain.c \ +ORTEDomainMgr.c \ +ORTEInit.c \ +ORTEThreadUtils.c \ +ORTETypeRegister.c \ +ORTEVerbosity.c \ +ORTEPattern.c \ +parameter.c \ +RTPSAck.c \ +RTPSCSTReader.c \ +RTPSCSTReaderTimer.c \ +RTPSCSTReaderProc.c \ +RTPSCSTWriter.c \ +RTPSCSTWriterTimer.c \ +RTPSGap.c \ +RTPSHeader.c \ +RTPSHeardBeat.c \ +RTPSInfoDST.c \ +RTPSInfoREPLY.c \ +RTPSInfoSRC.c \ +RTPSInfoTS.c \ +RTPSPad.c \ +RTPSUtils.c \ +RTPSVar.c \ +RTPSIssue.c \ +sock.c \ +ul_gavl.c \ +ul_gavlprim.c + + +@CONFIG_ORTE_RT_TRUE@module_PROGRAMS = orte.ko +@CONFIG_ORTE_RT_TRUE@orte_ko_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) +@CONFIG_ORTE_RT_TRUE@orte_ko_SOURCES = $(LIBORTE_SOURCES) +@CONFIG_ORTE_RT_TRUE@orte_ko_LINK = $(top_builddir)/modtool --link -o $@ + +@CONFIG_ORTE_RT_TRUE@SUBDIRS = rtl +@CONFIG_ORTE_RT_FALSE@lib_LIBRARIES = liborte.a +@CONFIG_ORTE_RT_FALSE@liborte_a_SOURCES = $(LIBORTE_SOURCES) + +EXTRA_DIST = usedSections.txt +subdir = orte/liborte +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(lib_LIBRARIES) + +liborte_a_AR = $(AR) cru +liborte_a_LIBADD = +am__objects_1 = conv.$(OBJEXT) debug.$(OBJEXT) event.$(OBJEXT) \ + fnmatch.$(OBJEXT) htimerNtp.$(OBJEXT) objectEntry.$(OBJEXT) \ + objectEntryTimer.$(OBJEXT) objectUtils.$(OBJEXT) \ + ORTEAppRecvMetatrafficThread.$(OBJEXT) \ + ORTEAppRecvUserdataThread.$(OBJEXT) ORTEAppSendThread.$(OBJEXT) \ + ORTEDomainApp.$(OBJEXT) ORTEPublication.$(OBJEXT) \ + ORTEPublicationTimer.$(OBJEXT) ORTESubscription.$(OBJEXT) \ + ORTEDomain.$(OBJEXT) ORTEDomainMgr.$(OBJEXT) ORTEInit.$(OBJEXT) \ + ORTEThreadUtils.$(OBJEXT) ORTETypeRegister.$(OBJEXT) \ + ORTEVerbosity.$(OBJEXT) ORTEPattern.$(OBJEXT) \ + parameter.$(OBJEXT) RTPSAck.$(OBJEXT) RTPSCSTReader.$(OBJEXT) \ + RTPSCSTReaderTimer.$(OBJEXT) RTPSCSTReaderProc.$(OBJEXT) \ + RTPSCSTWriter.$(OBJEXT) RTPSCSTWriterTimer.$(OBJEXT) \ + RTPSGap.$(OBJEXT) RTPSHeader.$(OBJEXT) RTPSHeardBeat.$(OBJEXT) \ + RTPSInfoDST.$(OBJEXT) RTPSInfoREPLY.$(OBJEXT) \ + RTPSInfoSRC.$(OBJEXT) RTPSInfoTS.$(OBJEXT) RTPSPad.$(OBJEXT) \ + RTPSUtils.$(OBJEXT) RTPSVar.$(OBJEXT) RTPSIssue.$(OBJEXT) \ + sock.$(OBJEXT) ul_gavl.$(OBJEXT) ul_gavlprim.$(OBJEXT) +@CONFIG_ORTE_RT_FALSE@am_liborte_a_OBJECTS = $(am__objects_1) +liborte_a_OBJECTS = $(am_liborte_a_OBJECTS) +@CONFIG_ORTE_RT_TRUE@module_PROGRAMS = orte.ko$(EXEEXT) +@CONFIG_ORTE_RT_FALSE@module_PROGRAMS = +PROGRAMS = $(module_PROGRAMS) + +am__objects_2 = orte_ko-conv.$(OBJEXT) orte_ko-debug.$(OBJEXT) \ + orte_ko-event.$(OBJEXT) orte_ko-fnmatch.$(OBJEXT) \ + orte_ko-htimerNtp.$(OBJEXT) orte_ko-objectEntry.$(OBJEXT) \ + orte_ko-objectEntryTimer.$(OBJEXT) \ + orte_ko-objectUtils.$(OBJEXT) \ + orte_ko-ORTEAppRecvMetatrafficThread.$(OBJEXT) \ + orte_ko-ORTEAppRecvUserdataThread.$(OBJEXT) \ + orte_ko-ORTEAppSendThread.$(OBJEXT) \ + orte_ko-ORTEDomainApp.$(OBJEXT) \ + orte_ko-ORTEPublication.$(OBJEXT) \ + orte_ko-ORTEPublicationTimer.$(OBJEXT) \ + orte_ko-ORTESubscription.$(OBJEXT) orte_ko-ORTEDomain.$(OBJEXT) \ + orte_ko-ORTEDomainMgr.$(OBJEXT) orte_ko-ORTEInit.$(OBJEXT) \ + orte_ko-ORTEThreadUtils.$(OBJEXT) \ + orte_ko-ORTETypeRegister.$(OBJEXT) \ + orte_ko-ORTEVerbosity.$(OBJEXT) orte_ko-ORTEPattern.$(OBJEXT) \ + orte_ko-parameter.$(OBJEXT) orte_ko-RTPSAck.$(OBJEXT) \ + orte_ko-RTPSCSTReader.$(OBJEXT) \ + orte_ko-RTPSCSTReaderTimer.$(OBJEXT) \ + orte_ko-RTPSCSTReaderProc.$(OBJEXT) \ + orte_ko-RTPSCSTWriter.$(OBJEXT) \ + orte_ko-RTPSCSTWriterTimer.$(OBJEXT) orte_ko-RTPSGap.$(OBJEXT) \ + orte_ko-RTPSHeader.$(OBJEXT) orte_ko-RTPSHeardBeat.$(OBJEXT) \ + orte_ko-RTPSInfoDST.$(OBJEXT) orte_ko-RTPSInfoREPLY.$(OBJEXT) \ + orte_ko-RTPSInfoSRC.$(OBJEXT) orte_ko-RTPSInfoTS.$(OBJEXT) \ + orte_ko-RTPSPad.$(OBJEXT) orte_ko-RTPSUtils.$(OBJEXT) \ + orte_ko-RTPSVar.$(OBJEXT) orte_ko-RTPSIssue.$(OBJEXT) \ + orte_ko-sock.$(OBJEXT) orte_ko-ul_gavl.$(OBJEXT) \ + orte_ko-ul_gavlprim.$(OBJEXT) +@CONFIG_ORTE_RT_TRUE@am_orte_ko_OBJECTS = $(am__objects_2) +orte_ko_OBJECTS = $(am_orte_ko_OBJECTS) +orte_ko_LDADD = $(LDADD) +orte_ko_DEPENDENCIES = +orte_ko_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/orte/include +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ORTEAppRecvMetatrafficThread.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEAppRecvUserdataThread.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEAppSendThread.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEDomain.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEDomainApp.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEDomainMgr.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEInit.Po ./$(DEPDIR)/ORTEPattern.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEPublication.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEPublicationTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTESubscription.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEThreadUtils.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTETypeRegister.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ORTEVerbosity.Po ./$(DEPDIR)/RTPSAck.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSCSTReader.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSCSTReaderProc.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSCSTReaderTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSCSTWriter.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSCSTWriterTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSGap.Po ./$(DEPDIR)/RTPSHeader.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSHeardBeat.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSInfoDST.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSInfoREPLY.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSInfoSRC.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSInfoTS.Po ./$(DEPDIR)/RTPSIssue.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSPad.Po ./$(DEPDIR)/RTPSUtils.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/RTPSVar.Po ./$(DEPDIR)/conv.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/debug.Po ./$(DEPDIR)/event.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/fnmatch.Po ./$(DEPDIR)/htimerNtp.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/objectEntry.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/objectEntryTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/objectUtils.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEAppRecvMetatrafficThread.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEAppRecvUserdataThread.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEAppSendThread.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEDomain.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEDomainApp.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEDomainMgr.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEInit.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEPattern.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEPublication.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEPublicationTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTESubscription.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEThreadUtils.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTETypeRegister.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ORTEVerbosity.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSAck.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSCSTReader.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSCSTReaderProc.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSCSTReaderTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSCSTWriter.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSCSTWriterTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSGap.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSHeader.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSHeardBeat.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSInfoDST.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSInfoREPLY.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSInfoSRC.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSInfoTS.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSIssue.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSPad.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSUtils.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-RTPSVar.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-conv.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-debug.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-event.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-fnmatch.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-htimerNtp.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-objectEntry.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-objectEntryTimer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-objectUtils.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-parameter.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-sock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ul_gavl.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/orte_ko-ul_gavlprim.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/parameter.Po ./$(DEPDIR)/sock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ul_gavl.Po ./$(DEPDIR)/ul_gavlprim.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(liborte_a_SOURCES) $(orte_ko_SOURCES) + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = rtl +SOURCES = $(liborte_a_SOURCES) $(orte_ko_SOURCES) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu orte/liborte/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +AR = ar +libLIBRARIES_INSTALL = $(INSTALL_DATA) +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(libLIBRARIES_INSTALL) $$p $(DESTDIR)$(libdir)/$$f"; \ + $(libLIBRARIES_INSTALL) $$p $(DESTDIR)$(libdir)/$$f; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(libdir)/$$p"; \ + rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +liborte.a: $(liborte_a_OBJECTS) $(liborte_a_DEPENDENCIES) + -rm -f liborte.a + $(liborte_a_AR) liborte.a $(liborte_a_OBJECTS) $(liborte_a_LIBADD) + $(RANLIB) liborte.a +install-modulePROGRAMS: $(module_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(moduledir) + @list='$(module_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(modulePROGRAMS_INSTALL) $$p $(DESTDIR)$(moduledir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(modulePROGRAMS_INSTALL) $$p $(DESTDIR)$(moduledir)/$$f; \ + else :; fi; \ + done + +uninstall-modulePROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(module_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(moduledir)/$$f"; \ + rm -f $(DESTDIR)$(moduledir)/$$f; \ + done + +clean-modulePROGRAMS: + -test -z "$(module_PROGRAMS)" || rm -f $(module_PROGRAMS) +orte_ko-conv.$(OBJEXT): conv.c +orte_ko-debug.$(OBJEXT): debug.c +orte_ko-event.$(OBJEXT): event.c +orte_ko-fnmatch.$(OBJEXT): fnmatch.c +orte_ko-htimerNtp.$(OBJEXT): htimerNtp.c +orte_ko-objectEntry.$(OBJEXT): objectEntry.c +orte_ko-objectEntryTimer.$(OBJEXT): objectEntryTimer.c +orte_ko-objectUtils.$(OBJEXT): objectUtils.c +orte_ko-ORTEAppRecvMetatrafficThread.$(OBJEXT): \ + ORTEAppRecvMetatrafficThread.c +orte_ko-ORTEAppRecvUserdataThread.$(OBJEXT): ORTEAppRecvUserdataThread.c +orte_ko-ORTEAppSendThread.$(OBJEXT): ORTEAppSendThread.c +orte_ko-ORTEDomainApp.$(OBJEXT): ORTEDomainApp.c +orte_ko-ORTEPublication.$(OBJEXT): ORTEPublication.c +orte_ko-ORTEPublicationTimer.$(OBJEXT): ORTEPublicationTimer.c +orte_ko-ORTESubscription.$(OBJEXT): ORTESubscription.c +orte_ko-ORTEDomain.$(OBJEXT): ORTEDomain.c +orte_ko-ORTEDomainMgr.$(OBJEXT): ORTEDomainMgr.c +orte_ko-ORTEInit.$(OBJEXT): ORTEInit.c +orte_ko-ORTEThreadUtils.$(OBJEXT): ORTEThreadUtils.c +orte_ko-ORTETypeRegister.$(OBJEXT): ORTETypeRegister.c +orte_ko-ORTEVerbosity.$(OBJEXT): ORTEVerbosity.c +orte_ko-ORTEPattern.$(OBJEXT): ORTEPattern.c +orte_ko-parameter.$(OBJEXT): parameter.c +orte_ko-RTPSAck.$(OBJEXT): RTPSAck.c +orte_ko-RTPSCSTReader.$(OBJEXT): RTPSCSTReader.c +orte_ko-RTPSCSTReaderTimer.$(OBJEXT): RTPSCSTReaderTimer.c +orte_ko-RTPSCSTReaderProc.$(OBJEXT): RTPSCSTReaderProc.c +orte_ko-RTPSCSTWriter.$(OBJEXT): RTPSCSTWriter.c +orte_ko-RTPSCSTWriterTimer.$(OBJEXT): RTPSCSTWriterTimer.c +orte_ko-RTPSGap.$(OBJEXT): RTPSGap.c +orte_ko-RTPSHeader.$(OBJEXT): RTPSHeader.c +orte_ko-RTPSHeardBeat.$(OBJEXT): RTPSHeardBeat.c +orte_ko-RTPSInfoDST.$(OBJEXT): RTPSInfoDST.c +orte_ko-RTPSInfoREPLY.$(OBJEXT): RTPSInfoREPLY.c +orte_ko-RTPSInfoSRC.$(OBJEXT): RTPSInfoSRC.c +orte_ko-RTPSInfoTS.$(OBJEXT): RTPSInfoTS.c +orte_ko-RTPSPad.$(OBJEXT): RTPSPad.c +orte_ko-RTPSUtils.$(OBJEXT): RTPSUtils.c +orte_ko-RTPSVar.$(OBJEXT): RTPSVar.c +orte_ko-RTPSIssue.$(OBJEXT): RTPSIssue.c +orte_ko-sock.$(OBJEXT): sock.c +orte_ko-ul_gavl.$(OBJEXT): ul_gavl.c +orte_ko-ul_gavlprim.$(OBJEXT): ul_gavlprim.c +orte.ko$(EXEEXT): $(orte_ko_OBJECTS) $(orte_ko_DEPENDENCIES) + @rm -f orte.ko$(EXEEXT) + $(orte_ko_LINK) $(orte_ko_LDFLAGS) $(orte_ko_OBJECTS) $(orte_ko_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEAppRecvMetatrafficThread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEAppRecvUserdataThread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEAppSendThread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEDomain.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEDomainApp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEDomainMgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEInit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEPattern.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEPublication.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEPublicationTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTESubscription.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEThreadUtils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTETypeRegister.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEVerbosity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSAck.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSCSTReader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSCSTReaderProc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSCSTReaderTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSCSTWriter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSCSTWriterTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSGap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSHeader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSHeardBeat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSInfoDST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSInfoREPLY.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSInfoSRC.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSInfoTS.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSIssue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSPad.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSUtils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTPSVar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htimerNtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objectEntry.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objectEntryTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objectUtils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEAppRecvMetatrafficThread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEAppRecvUserdataThread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEAppSendThread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEDomain.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEDomainApp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEDomainMgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEInit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEPattern.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEPublication.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEPublicationTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTESubscription.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEThreadUtils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTETypeRegister.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ORTEVerbosity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSAck.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSCSTReader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSCSTReaderProc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSCSTReaderTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSCSTWriter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSCSTWriterTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSGap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSHeader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSHeardBeat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSInfoDST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSInfoREPLY.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSInfoSRC.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSInfoTS.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSIssue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSPad.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSUtils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-RTPSVar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-conv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-debug.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-event.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-fnmatch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-htimerNtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-objectEntry.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-objectEntryTimer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-objectUtils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-parameter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-sock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ul_gavl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orte_ko-ul_gavlprim.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parameter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ul_gavl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ul_gavlprim.Po@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` + +orte_ko-conv.o: conv.c +@AMDEP_TRUE@ source='conv.c' object='orte_ko-conv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-conv.Po' tmpdepfile='$(DEPDIR)/orte_ko-conv.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-conv.o `test -f 'conv.c' || echo '$(srcdir)/'`conv.c + +orte_ko-conv.obj: conv.c +@AMDEP_TRUE@ source='conv.c' object='orte_ko-conv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-conv.Po' tmpdepfile='$(DEPDIR)/orte_ko-conv.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-conv.obj `cygpath -w conv.c` + +orte_ko-debug.o: debug.c +@AMDEP_TRUE@ source='debug.c' object='orte_ko-debug.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-debug.Po' tmpdepfile='$(DEPDIR)/orte_ko-debug.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-debug.o `test -f 'debug.c' || echo '$(srcdir)/'`debug.c + +orte_ko-debug.obj: debug.c +@AMDEP_TRUE@ source='debug.c' object='orte_ko-debug.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-debug.Po' tmpdepfile='$(DEPDIR)/orte_ko-debug.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-debug.obj `cygpath -w debug.c` + +orte_ko-event.o: event.c +@AMDEP_TRUE@ source='event.c' object='orte_ko-event.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-event.Po' tmpdepfile='$(DEPDIR)/orte_ko-event.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-event.o `test -f 'event.c' || echo '$(srcdir)/'`event.c + +orte_ko-event.obj: event.c +@AMDEP_TRUE@ source='event.c' object='orte_ko-event.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-event.Po' tmpdepfile='$(DEPDIR)/orte_ko-event.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-event.obj `cygpath -w event.c` + +orte_ko-fnmatch.o: fnmatch.c +@AMDEP_TRUE@ source='fnmatch.c' object='orte_ko-fnmatch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-fnmatch.Po' tmpdepfile='$(DEPDIR)/orte_ko-fnmatch.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-fnmatch.o `test -f 'fnmatch.c' || echo '$(srcdir)/'`fnmatch.c + +orte_ko-fnmatch.obj: fnmatch.c +@AMDEP_TRUE@ source='fnmatch.c' object='orte_ko-fnmatch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-fnmatch.Po' tmpdepfile='$(DEPDIR)/orte_ko-fnmatch.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-fnmatch.obj `cygpath -w fnmatch.c` + +orte_ko-htimerNtp.o: htimerNtp.c +@AMDEP_TRUE@ source='htimerNtp.c' object='orte_ko-htimerNtp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-htimerNtp.Po' tmpdepfile='$(DEPDIR)/orte_ko-htimerNtp.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-htimerNtp.o `test -f 'htimerNtp.c' || echo '$(srcdir)/'`htimerNtp.c + +orte_ko-htimerNtp.obj: htimerNtp.c +@AMDEP_TRUE@ source='htimerNtp.c' object='orte_ko-htimerNtp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-htimerNtp.Po' tmpdepfile='$(DEPDIR)/orte_ko-htimerNtp.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-htimerNtp.obj `cygpath -w htimerNtp.c` + +orte_ko-objectEntry.o: objectEntry.c +@AMDEP_TRUE@ source='objectEntry.c' object='orte_ko-objectEntry.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-objectEntry.Po' tmpdepfile='$(DEPDIR)/orte_ko-objectEntry.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-objectEntry.o `test -f 'objectEntry.c' || echo '$(srcdir)/'`objectEntry.c + +orte_ko-objectEntry.obj: objectEntry.c +@AMDEP_TRUE@ source='objectEntry.c' object='orte_ko-objectEntry.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-objectEntry.Po' tmpdepfile='$(DEPDIR)/orte_ko-objectEntry.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-objectEntry.obj `cygpath -w objectEntry.c` + +orte_ko-objectEntryTimer.o: objectEntryTimer.c +@AMDEP_TRUE@ source='objectEntryTimer.c' object='orte_ko-objectEntryTimer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-objectEntryTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-objectEntryTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-objectEntryTimer.o `test -f 'objectEntryTimer.c' || echo '$(srcdir)/'`objectEntryTimer.c + +orte_ko-objectEntryTimer.obj: objectEntryTimer.c +@AMDEP_TRUE@ source='objectEntryTimer.c' object='orte_ko-objectEntryTimer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-objectEntryTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-objectEntryTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-objectEntryTimer.obj `cygpath -w objectEntryTimer.c` + +orte_ko-objectUtils.o: objectUtils.c +@AMDEP_TRUE@ source='objectUtils.c' object='orte_ko-objectUtils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-objectUtils.Po' tmpdepfile='$(DEPDIR)/orte_ko-objectUtils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-objectUtils.o `test -f 'objectUtils.c' || echo '$(srcdir)/'`objectUtils.c + +orte_ko-objectUtils.obj: objectUtils.c +@AMDEP_TRUE@ source='objectUtils.c' object='orte_ko-objectUtils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-objectUtils.Po' tmpdepfile='$(DEPDIR)/orte_ko-objectUtils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-objectUtils.obj `cygpath -w objectUtils.c` + +orte_ko-ORTEAppRecvMetatrafficThread.o: ORTEAppRecvMetatrafficThread.c +@AMDEP_TRUE@ source='ORTEAppRecvMetatrafficThread.c' object='orte_ko-ORTEAppRecvMetatrafficThread.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEAppRecvMetatrafficThread.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEAppRecvMetatrafficThread.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEAppRecvMetatrafficThread.o `test -f 'ORTEAppRecvMetatrafficThread.c' || echo '$(srcdir)/'`ORTEAppRecvMetatrafficThread.c + +orte_ko-ORTEAppRecvMetatrafficThread.obj: ORTEAppRecvMetatrafficThread.c +@AMDEP_TRUE@ source='ORTEAppRecvMetatrafficThread.c' object='orte_ko-ORTEAppRecvMetatrafficThread.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEAppRecvMetatrafficThread.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEAppRecvMetatrafficThread.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEAppRecvMetatrafficThread.obj `cygpath -w ORTEAppRecvMetatrafficThread.c` + +orte_ko-ORTEAppRecvUserdataThread.o: ORTEAppRecvUserdataThread.c +@AMDEP_TRUE@ source='ORTEAppRecvUserdataThread.c' object='orte_ko-ORTEAppRecvUserdataThread.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEAppRecvUserdataThread.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEAppRecvUserdataThread.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEAppRecvUserdataThread.o `test -f 'ORTEAppRecvUserdataThread.c' || echo '$(srcdir)/'`ORTEAppRecvUserdataThread.c + +orte_ko-ORTEAppRecvUserdataThread.obj: ORTEAppRecvUserdataThread.c +@AMDEP_TRUE@ source='ORTEAppRecvUserdataThread.c' object='orte_ko-ORTEAppRecvUserdataThread.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEAppRecvUserdataThread.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEAppRecvUserdataThread.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEAppRecvUserdataThread.obj `cygpath -w ORTEAppRecvUserdataThread.c` + +orte_ko-ORTEAppSendThread.o: ORTEAppSendThread.c +@AMDEP_TRUE@ source='ORTEAppSendThread.c' object='orte_ko-ORTEAppSendThread.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEAppSendThread.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEAppSendThread.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEAppSendThread.o `test -f 'ORTEAppSendThread.c' || echo '$(srcdir)/'`ORTEAppSendThread.c + +orte_ko-ORTEAppSendThread.obj: ORTEAppSendThread.c +@AMDEP_TRUE@ source='ORTEAppSendThread.c' object='orte_ko-ORTEAppSendThread.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEAppSendThread.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEAppSendThread.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEAppSendThread.obj `cygpath -w ORTEAppSendThread.c` + +orte_ko-ORTEDomainApp.o: ORTEDomainApp.c +@AMDEP_TRUE@ source='ORTEDomainApp.c' object='orte_ko-ORTEDomainApp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEDomainApp.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEDomainApp.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEDomainApp.o `test -f 'ORTEDomainApp.c' || echo '$(srcdir)/'`ORTEDomainApp.c + +orte_ko-ORTEDomainApp.obj: ORTEDomainApp.c +@AMDEP_TRUE@ source='ORTEDomainApp.c' object='orte_ko-ORTEDomainApp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEDomainApp.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEDomainApp.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEDomainApp.obj `cygpath -w ORTEDomainApp.c` + +orte_ko-ORTEPublication.o: ORTEPublication.c +@AMDEP_TRUE@ source='ORTEPublication.c' object='orte_ko-ORTEPublication.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEPublication.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEPublication.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEPublication.o `test -f 'ORTEPublication.c' || echo '$(srcdir)/'`ORTEPublication.c + +orte_ko-ORTEPublication.obj: ORTEPublication.c +@AMDEP_TRUE@ source='ORTEPublication.c' object='orte_ko-ORTEPublication.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEPublication.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEPublication.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEPublication.obj `cygpath -w ORTEPublication.c` + +orte_ko-ORTEPublicationTimer.o: ORTEPublicationTimer.c +@AMDEP_TRUE@ source='ORTEPublicationTimer.c' object='orte_ko-ORTEPublicationTimer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEPublicationTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEPublicationTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEPublicationTimer.o `test -f 'ORTEPublicationTimer.c' || echo '$(srcdir)/'`ORTEPublicationTimer.c + +orte_ko-ORTEPublicationTimer.obj: ORTEPublicationTimer.c +@AMDEP_TRUE@ source='ORTEPublicationTimer.c' object='orte_ko-ORTEPublicationTimer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEPublicationTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEPublicationTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEPublicationTimer.obj `cygpath -w ORTEPublicationTimer.c` + +orte_ko-ORTESubscription.o: ORTESubscription.c +@AMDEP_TRUE@ source='ORTESubscription.c' object='orte_ko-ORTESubscription.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTESubscription.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTESubscription.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTESubscription.o `test -f 'ORTESubscription.c' || echo '$(srcdir)/'`ORTESubscription.c + +orte_ko-ORTESubscription.obj: ORTESubscription.c +@AMDEP_TRUE@ source='ORTESubscription.c' object='orte_ko-ORTESubscription.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTESubscription.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTESubscription.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTESubscription.obj `cygpath -w ORTESubscription.c` + +orte_ko-ORTEDomain.o: ORTEDomain.c +@AMDEP_TRUE@ source='ORTEDomain.c' object='orte_ko-ORTEDomain.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEDomain.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEDomain.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEDomain.o `test -f 'ORTEDomain.c' || echo '$(srcdir)/'`ORTEDomain.c + +orte_ko-ORTEDomain.obj: ORTEDomain.c +@AMDEP_TRUE@ source='ORTEDomain.c' object='orte_ko-ORTEDomain.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEDomain.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEDomain.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEDomain.obj `cygpath -w ORTEDomain.c` + +orte_ko-ORTEDomainMgr.o: ORTEDomainMgr.c +@AMDEP_TRUE@ source='ORTEDomainMgr.c' object='orte_ko-ORTEDomainMgr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEDomainMgr.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEDomainMgr.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEDomainMgr.o `test -f 'ORTEDomainMgr.c' || echo '$(srcdir)/'`ORTEDomainMgr.c + +orte_ko-ORTEDomainMgr.obj: ORTEDomainMgr.c +@AMDEP_TRUE@ source='ORTEDomainMgr.c' object='orte_ko-ORTEDomainMgr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEDomainMgr.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEDomainMgr.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEDomainMgr.obj `cygpath -w ORTEDomainMgr.c` + +orte_ko-ORTEInit.o: ORTEInit.c +@AMDEP_TRUE@ source='ORTEInit.c' object='orte_ko-ORTEInit.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEInit.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEInit.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEInit.o `test -f 'ORTEInit.c' || echo '$(srcdir)/'`ORTEInit.c + +orte_ko-ORTEInit.obj: ORTEInit.c +@AMDEP_TRUE@ source='ORTEInit.c' object='orte_ko-ORTEInit.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEInit.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEInit.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEInit.obj `cygpath -w ORTEInit.c` + +orte_ko-ORTEThreadUtils.o: ORTEThreadUtils.c +@AMDEP_TRUE@ source='ORTEThreadUtils.c' object='orte_ko-ORTEThreadUtils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEThreadUtils.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEThreadUtils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEThreadUtils.o `test -f 'ORTEThreadUtils.c' || echo '$(srcdir)/'`ORTEThreadUtils.c + +orte_ko-ORTEThreadUtils.obj: ORTEThreadUtils.c +@AMDEP_TRUE@ source='ORTEThreadUtils.c' object='orte_ko-ORTEThreadUtils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEThreadUtils.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEThreadUtils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEThreadUtils.obj `cygpath -w ORTEThreadUtils.c` + +orte_ko-ORTETypeRegister.o: ORTETypeRegister.c +@AMDEP_TRUE@ source='ORTETypeRegister.c' object='orte_ko-ORTETypeRegister.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTETypeRegister.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTETypeRegister.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTETypeRegister.o `test -f 'ORTETypeRegister.c' || echo '$(srcdir)/'`ORTETypeRegister.c + +orte_ko-ORTETypeRegister.obj: ORTETypeRegister.c +@AMDEP_TRUE@ source='ORTETypeRegister.c' object='orte_ko-ORTETypeRegister.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTETypeRegister.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTETypeRegister.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTETypeRegister.obj `cygpath -w ORTETypeRegister.c` + +orte_ko-ORTEVerbosity.o: ORTEVerbosity.c +@AMDEP_TRUE@ source='ORTEVerbosity.c' object='orte_ko-ORTEVerbosity.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEVerbosity.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEVerbosity.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEVerbosity.o `test -f 'ORTEVerbosity.c' || echo '$(srcdir)/'`ORTEVerbosity.c + +orte_ko-ORTEVerbosity.obj: ORTEVerbosity.c +@AMDEP_TRUE@ source='ORTEVerbosity.c' object='orte_ko-ORTEVerbosity.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEVerbosity.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEVerbosity.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEVerbosity.obj `cygpath -w ORTEVerbosity.c` + +orte_ko-ORTEPattern.o: ORTEPattern.c +@AMDEP_TRUE@ source='ORTEPattern.c' object='orte_ko-ORTEPattern.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEPattern.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEPattern.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEPattern.o `test -f 'ORTEPattern.c' || echo '$(srcdir)/'`ORTEPattern.c + +orte_ko-ORTEPattern.obj: ORTEPattern.c +@AMDEP_TRUE@ source='ORTEPattern.c' object='orte_ko-ORTEPattern.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ORTEPattern.Po' tmpdepfile='$(DEPDIR)/orte_ko-ORTEPattern.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ORTEPattern.obj `cygpath -w ORTEPattern.c` + +orte_ko-parameter.o: parameter.c +@AMDEP_TRUE@ source='parameter.c' object='orte_ko-parameter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-parameter.Po' tmpdepfile='$(DEPDIR)/orte_ko-parameter.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-parameter.o `test -f 'parameter.c' || echo '$(srcdir)/'`parameter.c + +orte_ko-parameter.obj: parameter.c +@AMDEP_TRUE@ source='parameter.c' object='orte_ko-parameter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-parameter.Po' tmpdepfile='$(DEPDIR)/orte_ko-parameter.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-parameter.obj `cygpath -w parameter.c` + +orte_ko-RTPSAck.o: RTPSAck.c +@AMDEP_TRUE@ source='RTPSAck.c' object='orte_ko-RTPSAck.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSAck.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSAck.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSAck.o `test -f 'RTPSAck.c' || echo '$(srcdir)/'`RTPSAck.c + +orte_ko-RTPSAck.obj: RTPSAck.c +@AMDEP_TRUE@ source='RTPSAck.c' object='orte_ko-RTPSAck.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSAck.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSAck.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSAck.obj `cygpath -w RTPSAck.c` + +orte_ko-RTPSCSTReader.o: RTPSCSTReader.c +@AMDEP_TRUE@ source='RTPSCSTReader.c' object='orte_ko-RTPSCSTReader.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTReader.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTReader.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTReader.o `test -f 'RTPSCSTReader.c' || echo '$(srcdir)/'`RTPSCSTReader.c + +orte_ko-RTPSCSTReader.obj: RTPSCSTReader.c +@AMDEP_TRUE@ source='RTPSCSTReader.c' object='orte_ko-RTPSCSTReader.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTReader.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTReader.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTReader.obj `cygpath -w RTPSCSTReader.c` + +orte_ko-RTPSCSTReaderTimer.o: RTPSCSTReaderTimer.c +@AMDEP_TRUE@ source='RTPSCSTReaderTimer.c' object='orte_ko-RTPSCSTReaderTimer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTReaderTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTReaderTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTReaderTimer.o `test -f 'RTPSCSTReaderTimer.c' || echo '$(srcdir)/'`RTPSCSTReaderTimer.c + +orte_ko-RTPSCSTReaderTimer.obj: RTPSCSTReaderTimer.c +@AMDEP_TRUE@ source='RTPSCSTReaderTimer.c' object='orte_ko-RTPSCSTReaderTimer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTReaderTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTReaderTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTReaderTimer.obj `cygpath -w RTPSCSTReaderTimer.c` + +orte_ko-RTPSCSTReaderProc.o: RTPSCSTReaderProc.c +@AMDEP_TRUE@ source='RTPSCSTReaderProc.c' object='orte_ko-RTPSCSTReaderProc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTReaderProc.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTReaderProc.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTReaderProc.o `test -f 'RTPSCSTReaderProc.c' || echo '$(srcdir)/'`RTPSCSTReaderProc.c + +orte_ko-RTPSCSTReaderProc.obj: RTPSCSTReaderProc.c +@AMDEP_TRUE@ source='RTPSCSTReaderProc.c' object='orte_ko-RTPSCSTReaderProc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTReaderProc.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTReaderProc.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTReaderProc.obj `cygpath -w RTPSCSTReaderProc.c` + +orte_ko-RTPSCSTWriter.o: RTPSCSTWriter.c +@AMDEP_TRUE@ source='RTPSCSTWriter.c' object='orte_ko-RTPSCSTWriter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTWriter.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTWriter.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTWriter.o `test -f 'RTPSCSTWriter.c' || echo '$(srcdir)/'`RTPSCSTWriter.c + +orte_ko-RTPSCSTWriter.obj: RTPSCSTWriter.c +@AMDEP_TRUE@ source='RTPSCSTWriter.c' object='orte_ko-RTPSCSTWriter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTWriter.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTWriter.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTWriter.obj `cygpath -w RTPSCSTWriter.c` + +orte_ko-RTPSCSTWriterTimer.o: RTPSCSTWriterTimer.c +@AMDEP_TRUE@ source='RTPSCSTWriterTimer.c' object='orte_ko-RTPSCSTWriterTimer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTWriterTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTWriterTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTWriterTimer.o `test -f 'RTPSCSTWriterTimer.c' || echo '$(srcdir)/'`RTPSCSTWriterTimer.c + +orte_ko-RTPSCSTWriterTimer.obj: RTPSCSTWriterTimer.c +@AMDEP_TRUE@ source='RTPSCSTWriterTimer.c' object='orte_ko-RTPSCSTWriterTimer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSCSTWriterTimer.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSCSTWriterTimer.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSCSTWriterTimer.obj `cygpath -w RTPSCSTWriterTimer.c` + +orte_ko-RTPSGap.o: RTPSGap.c +@AMDEP_TRUE@ source='RTPSGap.c' object='orte_ko-RTPSGap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSGap.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSGap.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSGap.o `test -f 'RTPSGap.c' || echo '$(srcdir)/'`RTPSGap.c + +orte_ko-RTPSGap.obj: RTPSGap.c +@AMDEP_TRUE@ source='RTPSGap.c' object='orte_ko-RTPSGap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSGap.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSGap.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSGap.obj `cygpath -w RTPSGap.c` + +orte_ko-RTPSHeader.o: RTPSHeader.c +@AMDEP_TRUE@ source='RTPSHeader.c' object='orte_ko-RTPSHeader.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSHeader.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSHeader.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSHeader.o `test -f 'RTPSHeader.c' || echo '$(srcdir)/'`RTPSHeader.c + +orte_ko-RTPSHeader.obj: RTPSHeader.c +@AMDEP_TRUE@ source='RTPSHeader.c' object='orte_ko-RTPSHeader.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSHeader.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSHeader.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSHeader.obj `cygpath -w RTPSHeader.c` + +orte_ko-RTPSHeardBeat.o: RTPSHeardBeat.c +@AMDEP_TRUE@ source='RTPSHeardBeat.c' object='orte_ko-RTPSHeardBeat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSHeardBeat.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSHeardBeat.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSHeardBeat.o `test -f 'RTPSHeardBeat.c' || echo '$(srcdir)/'`RTPSHeardBeat.c + +orte_ko-RTPSHeardBeat.obj: RTPSHeardBeat.c +@AMDEP_TRUE@ source='RTPSHeardBeat.c' object='orte_ko-RTPSHeardBeat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSHeardBeat.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSHeardBeat.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSHeardBeat.obj `cygpath -w RTPSHeardBeat.c` + +orte_ko-RTPSInfoDST.o: RTPSInfoDST.c +@AMDEP_TRUE@ source='RTPSInfoDST.c' object='orte_ko-RTPSInfoDST.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoDST.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoDST.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoDST.o `test -f 'RTPSInfoDST.c' || echo '$(srcdir)/'`RTPSInfoDST.c + +orte_ko-RTPSInfoDST.obj: RTPSInfoDST.c +@AMDEP_TRUE@ source='RTPSInfoDST.c' object='orte_ko-RTPSInfoDST.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoDST.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoDST.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoDST.obj `cygpath -w RTPSInfoDST.c` + +orte_ko-RTPSInfoREPLY.o: RTPSInfoREPLY.c +@AMDEP_TRUE@ source='RTPSInfoREPLY.c' object='orte_ko-RTPSInfoREPLY.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoREPLY.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoREPLY.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoREPLY.o `test -f 'RTPSInfoREPLY.c' || echo '$(srcdir)/'`RTPSInfoREPLY.c + +orte_ko-RTPSInfoREPLY.obj: RTPSInfoREPLY.c +@AMDEP_TRUE@ source='RTPSInfoREPLY.c' object='orte_ko-RTPSInfoREPLY.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoREPLY.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoREPLY.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoREPLY.obj `cygpath -w RTPSInfoREPLY.c` + +orte_ko-RTPSInfoSRC.o: RTPSInfoSRC.c +@AMDEP_TRUE@ source='RTPSInfoSRC.c' object='orte_ko-RTPSInfoSRC.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoSRC.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoSRC.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoSRC.o `test -f 'RTPSInfoSRC.c' || echo '$(srcdir)/'`RTPSInfoSRC.c + +orte_ko-RTPSInfoSRC.obj: RTPSInfoSRC.c +@AMDEP_TRUE@ source='RTPSInfoSRC.c' object='orte_ko-RTPSInfoSRC.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoSRC.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoSRC.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoSRC.obj `cygpath -w RTPSInfoSRC.c` + +orte_ko-RTPSInfoTS.o: RTPSInfoTS.c +@AMDEP_TRUE@ source='RTPSInfoTS.c' object='orte_ko-RTPSInfoTS.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoTS.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoTS.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoTS.o `test -f 'RTPSInfoTS.c' || echo '$(srcdir)/'`RTPSInfoTS.c + +orte_ko-RTPSInfoTS.obj: RTPSInfoTS.c +@AMDEP_TRUE@ source='RTPSInfoTS.c' object='orte_ko-RTPSInfoTS.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSInfoTS.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSInfoTS.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSInfoTS.obj `cygpath -w RTPSInfoTS.c` + +orte_ko-RTPSPad.o: RTPSPad.c +@AMDEP_TRUE@ source='RTPSPad.c' object='orte_ko-RTPSPad.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSPad.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSPad.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSPad.o `test -f 'RTPSPad.c' || echo '$(srcdir)/'`RTPSPad.c + +orte_ko-RTPSPad.obj: RTPSPad.c +@AMDEP_TRUE@ source='RTPSPad.c' object='orte_ko-RTPSPad.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSPad.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSPad.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSPad.obj `cygpath -w RTPSPad.c` + +orte_ko-RTPSUtils.o: RTPSUtils.c +@AMDEP_TRUE@ source='RTPSUtils.c' object='orte_ko-RTPSUtils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSUtils.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSUtils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSUtils.o `test -f 'RTPSUtils.c' || echo '$(srcdir)/'`RTPSUtils.c + +orte_ko-RTPSUtils.obj: RTPSUtils.c +@AMDEP_TRUE@ source='RTPSUtils.c' object='orte_ko-RTPSUtils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSUtils.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSUtils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSUtils.obj `cygpath -w RTPSUtils.c` + +orte_ko-RTPSVar.o: RTPSVar.c +@AMDEP_TRUE@ source='RTPSVar.c' object='orte_ko-RTPSVar.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSVar.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSVar.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSVar.o `test -f 'RTPSVar.c' || echo '$(srcdir)/'`RTPSVar.c + +orte_ko-RTPSVar.obj: RTPSVar.c +@AMDEP_TRUE@ source='RTPSVar.c' object='orte_ko-RTPSVar.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSVar.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSVar.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSVar.obj `cygpath -w RTPSVar.c` + +orte_ko-RTPSIssue.o: RTPSIssue.c +@AMDEP_TRUE@ source='RTPSIssue.c' object='orte_ko-RTPSIssue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSIssue.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSIssue.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSIssue.o `test -f 'RTPSIssue.c' || echo '$(srcdir)/'`RTPSIssue.c + +orte_ko-RTPSIssue.obj: RTPSIssue.c +@AMDEP_TRUE@ source='RTPSIssue.c' object='orte_ko-RTPSIssue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-RTPSIssue.Po' tmpdepfile='$(DEPDIR)/orte_ko-RTPSIssue.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-RTPSIssue.obj `cygpath -w RTPSIssue.c` + +orte_ko-sock.o: sock.c +@AMDEP_TRUE@ source='sock.c' object='orte_ko-sock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-sock.Po' tmpdepfile='$(DEPDIR)/orte_ko-sock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c + +orte_ko-sock.obj: sock.c +@AMDEP_TRUE@ source='sock.c' object='orte_ko-sock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-sock.Po' tmpdepfile='$(DEPDIR)/orte_ko-sock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-sock.obj `cygpath -w sock.c` + +orte_ko-ul_gavl.o: ul_gavl.c +@AMDEP_TRUE@ source='ul_gavl.c' object='orte_ko-ul_gavl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ul_gavl.Po' tmpdepfile='$(DEPDIR)/orte_ko-ul_gavl.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ul_gavl.o `test -f 'ul_gavl.c' || echo '$(srcdir)/'`ul_gavl.c + +orte_ko-ul_gavl.obj: ul_gavl.c +@AMDEP_TRUE@ source='ul_gavl.c' object='orte_ko-ul_gavl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ul_gavl.Po' tmpdepfile='$(DEPDIR)/orte_ko-ul_gavl.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ul_gavl.obj `cygpath -w ul_gavl.c` + +orte_ko-ul_gavlprim.o: ul_gavlprim.c +@AMDEP_TRUE@ source='ul_gavlprim.c' object='orte_ko-ul_gavlprim.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ul_gavlprim.Po' tmpdepfile='$(DEPDIR)/orte_ko-ul_gavlprim.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ul_gavlprim.o `test -f 'ul_gavlprim.c' || echo '$(srcdir)/'`ul_gavlprim.c + +orte_ko-ul_gavlprim.obj: ul_gavlprim.c +@AMDEP_TRUE@ source='ul_gavlprim.c' object='orte_ko-ul_gavlprim.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/orte_ko-ul_gavlprim.Po' tmpdepfile='$(DEPDIR)/orte_ko-ul_gavlprim.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(orte_ko_CFLAGS) $(CFLAGS) -c -o orte_ko-ul_gavlprim.obj `cygpath -w ul_gavlprim.c` +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LIBRARIES) $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(moduledir) + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLIBRARIES clean-modulePROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: install-modulePROGRAMS + +install-exec-am: install-libLIBRARIES + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-info-am uninstall-libLIBRARIES \ + uninstall-modulePROGRAMS + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-libLIBRARIES clean-modulePROGRAMS \ + clean-recursive distclean distclean-compile distclean-depend \ + distclean-generic distclean-recursive distclean-tags distdir \ + dvi dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive \ + install-libLIBRARIES install-man install-modulePROGRAMS \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-libLIBRARIES \ + uninstall-modulePROGRAMS uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/orte/liborte/Makefile.omk b/orte/liborte/Makefile.omk new file mode 100644 index 0000000..116cf50 --- /dev/null +++ b/orte/liborte/Makefile.omk @@ -0,0 +1,116 @@ +lib_LIBRARIES = orte + +INCLUDES = -I $(srcdir)/../include -D_OMK_UNIX + +include_HEADERS = \ +../include/orte_api.h \ +../include/typedefs_defines_rtps.h \ +../include/defines_api.h \ +../include/typedefs_api.h \ +../include/protos_api.h + +orte_SOURCES = \ +conv.c \ +debug.c \ +event.c \ +fnmatch.c \ +htimerNtp.c \ +objectEntry.c \ +objectEntryTimer.c \ +objectUtils.c \ +ORTEAppRecvMetatrafficThread.c \ +ORTEAppRecvUserdataThread.c \ +ORTEAppSendThread.c \ +ORTEDomainApp.c \ +ORTEPublication.c \ +ORTEPublicationTimer.c \ +ORTESubscription.c \ +ORTEDomain.c \ +ORTEDomainMgr.c \ +ORTEInit.c \ +ORTEThreadUtils.c \ +ORTETypeRegister.c \ +ORTEVerbosity.c \ +ORTEPattern.c \ +parameter.c \ +RTPSAck.c \ +RTPSCSTReader.c \ +RTPSCSTReaderTimer.c \ +RTPSCSTReaderProc.c \ +RTPSCSTWriter.c \ +RTPSCSTWriterTimer.c \ +RTPSGap.c \ +RTPSHeader.c \ +RTPSHeardBeat.c \ +RTPSInfoDST.c \ +RTPSInfoREPLY.c \ +RTPSInfoSRC.c \ +RTPSInfoTS.c \ +RTPSPad.c \ +RTPSUtils.c \ +RTPSVar.c \ +RTPSIssue.c \ +sock.c \ +ul_gavl.c \ +ul_gavlprim.c + +############################################################################# +# RT-Linux version of build + +rtlinux_LIBRARIES = orte_rtl + +rtlinux_INCLUDES = -I $(srcdir)/../include + +rtlinux_HEADERS = \ +../include/orte_api.h \ +../include/typedefs_defines_rtps.h \ +../include/defines_api.h \ +../include/typedefs_api.h \ +../include/protos_api.h + +orte_rtl_SOURCES = \ +conv.c \ +debug.c \ +event.c \ +fnmatch.c \ +htimerNtp.c \ +objectEntry.c \ +objectEntryTimer.c \ +objectUtils.c \ +ORTEAppRecvMetatrafficThread.c \ +ORTEAppRecvUserdataThread.c \ +ORTEAppSendThread.c \ +ORTEDomainApp.c \ +ORTEPublication.c \ +ORTEPublicationTimer.c \ +ORTESubscription.c \ +ORTEDomain.c \ +ORTEDomainMgr.c \ +ORTEInit.c \ +ORTEThreadUtils.c \ +ORTETypeRegister.c \ +ORTEVerbosity.c \ +ORTEPattern.c \ +parameter.c \ +RTPSAck.c \ +RTPSCSTReader.c \ +RTPSCSTReaderTimer.c \ +RTPSCSTReaderProc.c \ +RTPSCSTWriter.c \ +RTPSCSTWriterTimer.c \ +RTPSGap.c \ +RTPSHeader.c \ +RTPSHeardBeat.c \ +RTPSInfoDST.c \ +RTPSInfoREPLY.c \ +RTPSInfoSRC.c \ +RTPSInfoTS.c \ +RTPSPad.c \ +RTPSUtils.c \ +RTPSVar.c \ +RTPSIssue.c \ +sock.c \ +ul_gavl.c \ +ul_gavlprim.c + +SUBDIRS = rtl diff --git a/orte/liborte/ORTEAppRecvMetatrafficThread.c b/orte/liborte/ORTEAppRecvMetatrafficThread.c new file mode 100644 index 0000000..02e7dfa --- /dev/null +++ b/orte/liborte/ORTEAppRecvMetatrafficThread.c @@ -0,0 +1,102 @@ +/* + * $Id: ORTEAppRecvMetatrafficThread.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 22 Receiving thread + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +void ORTEAppRecvMetatrafficThread(ORTEDomain *d) { + struct sockaddr_in des; + int16_t submsg_len,msg_ptr; + u_int16_t msg_total_len; + MessageInterpret mi; + + debug(22,10) ("ORTEAppRecvMetatrafficThread: start\n"); + + while (!d->taskRecvMetatraffic.terminate) { + msg_total_len = sock_recvfrom( + &d->taskRecvMetatraffic.sock, //socked handle + d->mbRecvMetatraffic.cdrStream.buffer, //buffer + d->domainProp.recvBuffSize, //max length of message + &des,sizeof(des)); //info from sending host + d->mbRecvMetatraffic.cdrStream.length=msg_total_len; + d->mbRecvMetatraffic.cdrStream.bufferPtr=d->mbRecvMetatraffic.cdrStream.buffer; + debug(22,7) ("ORTEAppRecvMetatrafficThread: fired\n"); + //is it header of valid RTPS packet? + if (RTPSHeaderCheck(d->mbRecvMetatraffic.cdrStream.buffer,msg_total_len,&mi)==0) { + debug(22,7) ("ORTEAppRecvMetatrafficThread: RTPS Heard OK\n"); + debug(22,7) (" PV: %d.%d VID:%d.%d HID:0x%x AID:0x%x\n", + mi.sourceVersion.major,mi.sourceVersion.minor, + mi.sourceVendorId.major,mi.sourceVendorId.minor, + mi.sourceHostId,mi.sourceAppId); + msg_ptr=16; + do { + // check if length of submessage header is OK + if ((msg_ptr+3)<=msg_total_len) { + int8_t e_bit=d->mbRecvMetatraffic.cdrStream.buffer[msg_ptr+1] & 1; + submsg_len=(u_int16_t)d->mbRecvMetatraffic.cdrStream.buffer[msg_ptr+2]; + conv_u16(&submsg_len,e_bit); + // check if length of submessage OK + if ((submsg_len+msg_ptr+3)<=msg_total_len) { + pthread_rwlock_wrlock(&d->objectEntry.objRootLock); + pthread_rwlock_wrlock(&d->objectEntry.htimRootLock); + switch ((SubmessageId)d->mbRecvMetatraffic.cdrStream.buffer[msg_ptr]) { + case VAR: + RTPSVar(d,d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi,ntohl(des.sin_addr.s_addr)); + break; + case ACK: + RTPSAck(d,d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi,ntohl(des.sin_addr.s_addr)); + break; + case HEARTBEAT: + RTPSHeardBeat(d,d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi); + break; + case GAP: + RTPSGap(d,d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi,ntohl(des.sin_addr.s_addr)); + break; + case INFO_TS: + RTPSInfoTS(d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi); + break; + case INFO_SRC: + RTPSInfoSRC(d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi); + break; + case INFO_REPLY: + RTPSInfoREPLY(d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi); + break; + case INFO_DST: + RTPSInfoDST(d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi); + break; + case PAD: + RTPSPad(d->mbRecvMetatraffic.cdrStream.buffer+msg_ptr,&mi); + break; + default: + break; + } + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + pthread_rwlock_unlock(&d->objectEntry.objRootLock); + msg_ptr+=submsg_len+4; + } else break; /* submessage is too big */ + } else break; /* submessage is too big */ + } while (msg_ptrtaskRecvUserdata.terminate) { + debug(23,7) ("ORTEAppRecvUserdataThread: receiving\n"); + d->mbRecvUserdata.cdrStream.length = sock_recvfrom( + &d->taskRecvUserdata.sock, //socked handle + d->mbRecvUserdata.cdrStream.buffer,//buffer + d->domainProp.recvBuffSize, //max length of message + &des,sizeof(des)); //info from sending host + d->mbRecvUserdata.cdrStream.bufferPtr=d->mbRecvUserdata.cdrStream.buffer; + debug(23,7) ("ORTEAppRecvUserdataThread: fired\n"); + //is it header of valid RTPS packet? + if (RTPSHeaderCheck(d->mbRecvUserdata.cdrStream.buffer, + d->mbSend.cdrStream.length,&mi)==0) { + debug(23,7) ("ORTEAppRecvUserdataThread: RTPS Heard OK\n"); + debug(23,7) (" PV: %d.%d VID:%d.%d HID:0x%x AID:0x%x\n", + mi.sourceVersion.major,mi.sourceVersion.minor, + mi.sourceVendorId.major,mi.sourceVendorId.minor, + mi.sourceHostId,mi.sourceAppId); + d->mbRecvUserdata.cdrStream.bufferPtr+=16; + do { + // check if length of submessage header is OK + if ((d->mbRecvUserdata.cdrStream.bufferPtr- + d->mbRecvUserdata.cdrStream.buffer+3)<=d->mbRecvUserdata.cdrStream.length) { + int8_t e_bit=d->mbRecvUserdata.cdrStream.bufferPtr[1] & 1; + submsg_len=(u_int16_t)d->mbRecvUserdata.cdrStream.bufferPtr[2]; + conv_u16(&submsg_len,e_bit); + // check if length of submessage OK + if ((submsg_len+d->mbRecvUserdata.cdrStream.bufferPtr- + d->mbRecvUserdata.cdrStream.buffer+3)<=d->mbRecvUserdata.cdrStream.length) { + pthread_rwlock_wrlock(&d->objectEntry.objRootLock); + pthread_rwlock_wrlock(&d->objectEntry.htimRootLock); + switch ((SubmessageId)d->mbRecvUserdata.cdrStream.bufferPtr[0]) { + case VAR: +// RTPSVar(d,d->taskRecvUserdata.bufferStart+msg_ptr,&mi,ntohl(des.sin_addr.s_addr)); + break; + case ACK: +// RTPSAck(d,d->taskRecvUserdata.bufferStart+msg_ptr,&mi,ntohl(des.sin_addr.s_addr)); + break; + case HEARTBEAT: +// RTPSHeardBeat(d,d->taskRecvUserdata.bufferStart+msg_ptr,&mi); + break; + case GAP: +// RTPSGap(d,d->taskRecvUserdata.bufferStart+msg_ptr,&mi,ntohl(des.sin_addr.s_addr)); + break; + case INFO_TS: + RTPSInfoTS(d->mbRecvUserdata.cdrStream.bufferPtr,&mi); + break; + case INFO_SRC: + RTPSInfoSRC(d->mbRecvUserdata.cdrStream.bufferPtr,&mi); + break; + case INFO_REPLY: + RTPSInfoREPLY(d->mbRecvUserdata.cdrStream.bufferPtr,&mi); + break; + case INFO_DST: + RTPSInfoDST(d->mbRecvUserdata.cdrStream.bufferPtr,&mi); + break; + case PAD: + RTPSPad(d->mbRecvUserdata.cdrStream.bufferPtr,&mi); + break; + case ISSUE: + RTPSIssue(d,d->mbRecvUserdata.cdrStream.bufferPtr,&mi,ntohl(des.sin_addr.s_addr)); + break; + default: + debug(23,5) ("ORTEAppRecvUserdataThread: unknown message :%d\n",d->mbRecvUserdata.cdrStream.bufferPtr[0]); + break; + } + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + pthread_rwlock_unlock(&d->objectEntry.objRootLock); + d->mbRecvUserdata.cdrStream.bufferPtr+=submsg_len+4; + } else break; /* submessage is too big */ + } else break; /* submessage is too big */ + } while ((d->mbRecvUserdata.cdrStream.bufferPtr- + d->mbRecvUserdata.cdrStream.buffer)mbRecvUserdata.cdrStream.length); + } + } + + debug(23,10) ("ORTEAppRecvUserdataThread: finished\n"); +} diff --git a/orte/liborte/ORTEAppSendThread.c b/orte/liborte/ORTEAppSendThread.c new file mode 100644 index 0000000..b35109f --- /dev/null +++ b/orte/liborte/ORTEAppSendThread.c @@ -0,0 +1,105 @@ +/* + * $Id: ORTEAppSendThread.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 24 Sending thread + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +void ORTESendData(ORTEDomain *d,ObjectEntryAID *objectEntryAID,Boolean meta) { + struct sockaddr_in des; + ObjectEntryOID *objectEntryOID; + AppParams *appParams; + ObjectId oid=OID_APP; + int i; + + objectEntryOID=ObjectEntryOID_find(objectEntryAID,&oid); + if (objectEntryOID) { + appParams=(AppParams*)objectEntryOID->attributes; + for(i=0;iunicastIPAddressCount;i++) { + des.sin_family=AF_INET; + des.sin_addr.s_addr = htonl(appParams->unicastIPAddressList[i]); + if (meta) { + des.sin_port = htons((u_int16_t)appParams->metatrafficUnicastPort); + sock_sendto ( + &d->taskSend.sock, + d->mbSend.cdrStream.buffer, + d->mbSend.cdrStream.length, + &des, + sizeof(des)); + } else { + des.sin_port = htons((u_int16_t)appParams->userdataUnicastPort); + sock_sendto ( + &d->taskSend.sock, + d->mbSend.cdrStreamDirect->buffer, + d->mbSend.cdrStreamDirect->length, + &des, + sizeof(des)); + } + } + } + //prepare buffer for next sending + d->mbSend.cdrStream.length=RTPS_HEADER_LENGTH; + d->mbSend.cdrStream.bufferPtr=d->mbSend.cdrStream.buffer+RTPS_HEADER_LENGTH; + d->mbSend.needSend=ORTE_FALSE; + d->mbSend.containsInfoReply=ORTE_FALSE; +} + +/*****************************************************************************/ +void ORTEAppSendThread(ORTEDomain *d) { + struct timespec wtime; + NtpTime actTime,nextExpire,whenExpire,sleepingTime; + int32_t s,ms; + + debug(24,10) ("ORTEAppSendThread: start\n"); + d->objectEntry.htimNeedWakeUp=ORTE_TRUE; + + while (!d->taskSend.terminate) { + actTime=getActualNtpTime(); + pthread_rwlock_wrlock(&d->objectEntry.htimRootLock); + if (htimerRoot_next_expire(&d->objectEntry,&nextExpire)==0) { + NTPTIME_BUILD(whenExpire,300); //max time for sleeping (no. events) + NtpTimeAdd(nextExpire,actTime,whenExpire); + } + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + NtpTimeDisAssembToUs(wtime.tv_sec,wtime.tv_nsec,nextExpire); + wtime.tv_nsec*=1000; //conver to nano seconds + NtpTimeSub(sleepingTime,nextExpire,actTime); + NtpTimeDisAssembToMs(s,ms,sleepingTime); + if (s<0) s=ms=0; + debug(24,4) ("ORTEAppSendThread: sleeping for %lis %lims\n",s,ms); + if (!((wtime.tv_sec==0) && (wtime.tv_nsec==0))) { + pthread_mutex_timedlock( + &d->objectEntry.htimSendMutex, + &wtime); + } + debug(24,7) ("ORTEAppSendThread: fired\n"); + actTime=getActualNtpTime(); + pthread_rwlock_wrlock(&d->objectEntry.objRootLock); + pthread_rwlock_wrlock(&d->objectEntry.htimRootLock); + d->objectEntry.htimNeedWakeUp=ORTE_FALSE; + htimerRoot_run_expired(d,&actTime); + d->objectEntry.htimNeedWakeUp=ORTE_TRUE; + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + pthread_rwlock_unlock(&d->objectEntry.objRootLock); + } + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + debug(24,10) ("ORTEAppSendThread: finished\n"); +} + diff --git a/orte/liborte/ORTEDomain.c b/orte/liborte/ORTEDomain.c new file mode 100644 index 0000000..99462f6 --- /dev/null +++ b/orte/liborte/ORTEDomain.c @@ -0,0 +1,101 @@ +/* + * $Id: ORTEDomain.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 30 Domain functions + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +Boolean +ORTEDomainPropDefaultGet(ORTEDomainProp *prop) { + sock_t sock; + + memset(prop, 0, sizeof(*prop)); + + prop->multicast.enabled=ORTE_FALSE; + prop->multicast.ttl=1; + prop->multicast.loopBackEnabled=ORTE_TRUE; + + //IFProp + sock_init_udp(&sock); + sock_bind(&sock,0); + sock_get_local_interfaces(&sock,prop->IFProp,&prop->IFCount); + sock_cleanup(&sock); + + prop->mgrs=NULL; + prop->appLocalManager=StringToIPAddress("127.0.0.1"); + prop->mgrAddKey=0; + sprintf(prop->version,PACKAGE_STRING\ + ", compiled: "\ + __DATE__\ + " "\ + __TIME__); + + prop->recvBuffSize=0x4000; + prop->sendBuffSize=0x4000; + prop->wireProp.metaBytesPerPacket=0x2000; + prop->wireProp.metaBytesPerFastPacket=0x1000; + prop->wireProp.metabitsPerACKBitmap=32; + prop->wireProp.userMaxSerDeserSize=0x4000; + + //domainBaseProp + NTPTIME_BUILD(prop->baseProp.expirationTime,180); //180s + NTPTIME_BUILD(prop->baseProp.refreshPeriod,72); //72s - refresh self parameters + NTPTIME_BUILD(prop->baseProp.purgeTime,60); //60s - purge time of parameters + NTPTIME_BUILD(prop->baseProp.repeatAnnounceTime,72);//72s - announcement by HB + NTPTIME_BUILD(prop->baseProp.repeatActiveQueryTime,72);//72s - announcement by ACK + NtpTimeAssembFromMs(prop->baseProp.delayResponceTimeACKMin,0,10);//10ms - delay before send ACK + NtpTimeAssembFromMs(prop->baseProp.delayResponceTimeACKMax,1,0);//1s + NtpTimeAssembFromMs(prop->baseProp.maxBlockTime,20,0);//20s + prop->baseProp.ACKMaxRetries=10; + prop->baseProp.HBMaxRetries=10; + + return ORTE_TRUE; +} + +/*****************************************************************************/ +Boolean +ORTEDomainInitEvents(ORTEDomainAppEvents *events) { + memset(events,0,sizeof(ORTEDomainAppEvents)); + return ORTE_TRUE; +} + +/*****************************************************************************/ +Boolean +ORTEPublPropDefaultGet(ORTEDomain *d,ORTEPublProp *pp) { + return ORTE_TRUE; +} + +/*****************************************************************************/ +Boolean +ORTEPublPropDefaultSet(ORTEDomain *d,ORTEPublProp *pp) { + return ORTE_TRUE; +} + +/*****************************************************************************/ +Boolean +ORTESubsPropDefaultGet(ORTEDomain *d,ORTESubsProp *sp) { + return ORTE_TRUE; +} + +/*****************************************************************************/ +Boolean +ORTESubsPropDefaultSet(ORTEDomain *d,ORTESubsProp *sp) { + return ORTE_TRUE; +} diff --git a/orte/liborte/ORTEDomainApp.c b/orte/liborte/ORTEDomainApp.c new file mode 100644 index 0000000..2049991 --- /dev/null +++ b/orte/liborte/ORTEDomainApp.c @@ -0,0 +1,443 @@ +/* + * $Id: ORTEDomainApp.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 21 Domain application + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +ORTEDomain * +ORTEDomainAppCreate(int domain, ORTEDomainProp *prop, + ORTEDomainAppEvents *events) { + ORTEDomain *d; + ObjectEntryOID *objectEntryOID; + AppParams *appParams; + CSTWriterParams cstWriterParams; + CSTReaderParams cstReaderParams; + char iflocal[MAX_INTERFACES*MAX_STRING_IPADDRESS_LENGTH]; + int i; + u_int16_t port=0; + + debug(21,10) ("ORTEDomainAppCreate: start\n"); + //Create domainApplication + d=MALLOC(sizeof(ORTEDomain)); + if (!d) return NULL; //no memory + //initialization local values + d->domain=domain; + d->taskRecvMetatraffic.terminate=ORTE_FALSE; + d->taskRecvUserdata.terminate=ORTE_FALSE; + d->taskSend.terminate=ORTE_FALSE; + d->taskRecvMetatraffic.sock.port=0; + d->taskRecvUserdata.sock.port=0; + d->taskSend.sock.port=0; + PublParamsInit(&d->publPropDefault); + SubsParamsInit(&d->subsPropDefault); + //init structure objectEntry + ObjectEntryHID_init_root_field(&d->objectEntry); + pthread_rwlock_init(&d->objectEntry.objRootLock,NULL); + htimerRoot_init_queue(&d->objectEntry); + pthread_rwlock_init(&d->objectEntry.htimRootLock,NULL); + pthread_mutex_init(&d->objectEntry.htimSendMutex, NULL); + //publication,subscriptions + d->publications.counter=d->subscriptions.counter=0; + CSTWriter_init_root_field(&d->publications); + CSTReader_init_root_field(&d->subscriptions); + pthread_rwlock_init(&d->publications.lock,NULL); + pthread_rwlock_init(&d->subscriptions.lock,NULL); + //publication,subscriptions lists + PublicationList_init_root_field(&d->psEntry); + pthread_rwlock_init(&d->psEntry.publicationsLock,NULL); + SubscriptionList_init_root_field(&d->psEntry); + pthread_rwlock_init(&d->psEntry.subscriptionsLock,NULL); + + //pattern + ORTEPatternRegister(d,ORTEPatternCheckDefault,ORTEPatternMatchDefault,NULL); + SubscriptionPattern_init_head(&d->patternEntry); + + //create domainProp + if (prop!=NULL) { + memcpy(&d->domainProp,prop,sizeof(ORTEDomainProp)); + } else { + ORTEDomainPropDefaultGet(&d->domainProp); + } + + //print local IP addresses + iflocal[0]=0; + if (d->domainProp.IFCount) { + for(i=0;idomainProp.IFCount;i++) + strcat(iflocal,IPAddressToString(d->domainProp.IFProp[i].ipAddress)); + debug(21,2) ("ORTEDomainAppCreate: localIPAddres(es) %s\n",iflocal); + } else{ + debug(21,2) ("ORTEDomainAppCreate: no activ interface card\n"); + } + + //DomainEvents + if (events!=NULL) { + memcpy(&d->domainEvents,events,sizeof(ORTEDomainAppEvents)); + } else { + memset(&d->domainEvents,0,sizeof(ORTEDomainAppEvents)); + } + + //local buffers + d->mbRecvMetatraffic.cdrStream.buffer= + (u_int8_t*)MALLOC(d->domainProp.recvBuffSize); + d->mbRecvUserdata.cdrStream.buffer= + (u_int8_t*)MALLOC(d->domainProp.recvBuffSize); + d->mbSend.cdrStream.buffer= + (u_int8_t*)MALLOC(d->domainProp.sendBuffSize); + if ((!d->mbRecvMetatraffic.cdrStream.buffer) || + (!d->mbRecvUserdata.cdrStream.buffer) || + (!d->mbSend.cdrStream.buffer)) { //no memory + FREE(d->mbRecvMetatraffic.cdrStream.buffer); + FREE(d->mbRecvUserdata.cdrStream.buffer); + FREE(d->mbSend.cdrStream.buffer); + FREE(d); + return NULL; + } + d->mbRecvMetatraffic.cdrStream.bufferPtr=d->mbRecvMetatraffic.cdrStream.buffer; + d->mbRecvMetatraffic.cdrStream.length=0; + d->mbRecvUserdata.cdrStream.bufferPtr=d->mbRecvUserdata.cdrStream.buffer; + d->mbRecvUserdata.cdrStream.length=0; + d->mbSend.cdrStream.bufferPtr=d->mbSend.cdrStream.buffer; + d->mbSend.cdrStream.length=0; + + //TypeRegister + ORTEType_init_root_field(&d->typeEntry); + pthread_rwlock_init(&d->typeEntry.lock,NULL); + + //Sockets + sock_init_udp(&d->taskRecvMetatraffic.sock); + sock_init_udp(&d->taskRecvUserdata.sock); + sock_init_udp(&d->taskSend.sock); + if (d->domainProp.multicast.enabled) { + Domain2PortMulticastMetatraffic(d->domain,port); + } else { + Domain2Port(d->domain,port); + } + sock_bind(&d->taskRecvMetatraffic.sock,0); //give me receiving port (metatraffic) + debug(21,2) ("ORTEDomainAppCreate: Bind on port(RecvMetatraffic):%u\n", + d->taskRecvMetatraffic.sock.port); + sock_bind(&d->taskRecvUserdata.sock,0); //give me receiving port (userdata) + debug(21,2) ("ORTEDomainAppCreate: Bind on port(RecvUserdata):%u\n", + d->taskRecvUserdata.sock.port); + sock_bind(&d->taskSend.sock,0); //give me sending port + debug(21,2) ("ORTEDomainAppCreate: Bind on port(Send):%u\n", + d->taskSend.sock.port); + if ((d->taskRecvMetatraffic.sock.fd<0) || + (d->taskRecvUserdata.sock.fd<0) || + (d->taskSend.sock.fd<0)) { + debug(21,0) ("Error creating socket(s).\n"); + sock_cleanup(&d->taskRecvMetatraffic.sock); + sock_cleanup(&d->taskRecvUserdata.sock); + sock_cleanup(&d->taskSend.sock); + FREE(d->mbRecvMetatraffic.cdrStream.buffer); + FREE(d->mbRecvUserdata.cdrStream.buffer); + FREE(d->mbSend.cdrStream.buffer); + FREE(d); + return NULL; + } + if (d->domainProp.multicast.enabled) { + struct ip_mreq mreq; + //ttl + if(sock_setsockopt(&d->taskSend.sock,IP_MULTICAST_TTL, + &d->domainProp.multicast.ttl,sizeof(d->domainProp.multicast.ttl))>=0) { + debug(21,2) ("ORTEDomainAppCreate: ttl set on: %u\n", + d->domainProp.multicast.ttl); + } + // join multicast group + mreq.imr_multiaddr.s_addr=htonl(d->domainProp.multicast.ipAddress); + mreq.imr_interface.s_addr=htonl(INADDR_ANY); + if(sock_setsockopt(&d->taskRecvUserdata.sock,IP_ADD_MEMBERSHIP, + (void *) &mreq, sizeof(mreq))>=0) { + debug(21,2) ("ORTEDomainAppCreate: listening to mgroup %s\n", + IPAddressToString(d->domainProp.multicast.ipAddress)); + } + } + + //Generates local GUID + if (d->domainProp.IFCount>0) + d->guid.hid=d->domainProp.IFProp[0].ipAddress; + else + d->guid.hid=StringToIPAddress("127.0.0.1"); + d->guid.aid=(d->taskSend.sock.port<<8)+MANAGEDAPPLICATION; + d->guid.oid=OID_APP; + debug(29,2) ("ORTEDomainAppCreate: GUID: %#10.8x,%#10.8x,%#10.8x\n", + d->guid.hid,d->guid.aid,d->guid.oid); + + //create HEADER of message for sending task + RTPSHeaderCreate(d->mbSend.cdrStream.buffer,d->guid.hid,d->guid.aid); + d->mbSend.cdrStream.bufferPtr= + d->mbSend.cdrStream.buffer+RTPS_HEADER_LENGTH; + d->mbSend.cdrStream.length=RTPS_HEADER_LENGTH; + d->mbSend.needSend=ORTE_FALSE; + d->mbSend.containsInfoReply=ORTE_FALSE; + + //Self object data & fellow managers object data + appParams=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(appParams); + appParams->expirationTime=d->domainProp.baseProp.expirationTime; + VENDOR_ID_OCERA(appParams->vendorId); + appParams->hostId=d->guid.hid; + appParams->appId=d->guid.aid; + appParams->metatrafficUnicastPort=d->taskRecvMetatraffic.sock.port; + appParams->userdataUnicastPort=d->taskRecvUserdata.sock.port; + if (d->domainProp.multicast.enabled) { + //multicast + for(i=0;idomainProp.IFCount;i++) + appParams->metatrafficMulticastIPAddressList[i]=d->domainProp.IFProp[i].ipAddress; + appParams->metatrafficMulticastIPAddressCount=d->domainProp.IFCount; + } else { + //unicast + if (d->domainProp.IFCount) { + for(i=0;idomainProp.IFCount;i++) + appParams->unicastIPAddressList[i]=d->domainProp.IFProp[i].ipAddress; + appParams->unicastIPAddressCount=d->domainProp.IFCount; + } else { + appParams->unicastIPAddressList[0]=StringToIPAddress("127.0.0.1"); + appParams->unicastIPAddressCount=1; + } + } + //ApplicatonKeyList + appParams->managerKeyList[0]=StringToIPAddress("127.0.0.1"); + for(i=0;idomainProp.IFCount;i++) + appParams->managerKeyList[i+1]=d->domainProp.IFProp[i].ipAddress; + appParams->managerKeyCount=d->domainProp.IFCount+1; + d->appParams=appParams; + //insert object, doesn't need to be locked + d->objectEntryOID=objectEntryAdd(d,&d->guid,(void*)appParams); + d->objectEntryOID->private=ORTE_TRUE; + + //CST objects + // writerApplicationSelf (WAS) + NTPTIME_ZERO(cstWriterParams.waitWhileDataUnderwayTime); + cstWriterParams.refreshPeriod=d->domainProp.baseProp.refreshPeriod; + cstWriterParams.repeatAnnounceTime=d->domainProp.baseProp.repeatAnnounceTime; + NTPTIME_ZERO(cstWriterParams.delayResponceTime); + cstWriterParams.HBMaxRetries=d->domainProp.baseProp.HBMaxRetries; + cstWriterParams.fullAcknowledge=ORTE_TRUE; + CSTWriterInit(d,&d->writerApplicationSelf,d->objectEntryOID, + OID_WRITE_APPSELF,&cstWriterParams,NULL); + // add to WAS remote writer(s) + if (d->domainProp.appLocalManager) { + GUID_RTPS guid; + guid.hid=d->domainProp.appLocalManager; + guid.aid=AID_UNKNOWN; + guid.oid=OID_APP; + if (!objectEntryFind(d,&guid)) { + appParams=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(appParams); + appParams->hostId=guid.hid; + appParams->appId=guid.aid; + appParams->metatrafficUnicastPort=port; + appParams->userdataUnicastPort=0; //Manager support only metatraffic + appParams->unicastIPAddressList[0]=d->domainProp.appLocalManager; + appParams->unicastIPAddressCount=1; + objectEntryOID=objectEntryAdd(d,&guid,(void*)appParams); + CSTWriterAddRemoteReader(d,&d->writerApplicationSelf,objectEntryOID, + OID_READ_MGR); + debug(21,2) ("ORTEDomainAppCreate: add fellow manager (%s)\n", + IPAddressToString(d->domainProp.appLocalManager)); + } + } + // readerManagers + cstReaderParams.delayResponceTimeMin=d->domainProp.baseProp.delayResponceTimeACKMin; + cstReaderParams.delayResponceTimeMax=d->domainProp.baseProp.delayResponceTimeACKMax; + cstReaderParams.ACKMaxRetries=d->domainProp.baseProp.ACKMaxRetries; + cstReaderParams.repeatActiveQueryTime=d->domainProp.baseProp.repeatActiveQueryTime; + cstReaderParams.fullAcknowledge=ORTE_TRUE; + CSTReaderInit(d,&d->readerManagers,d->objectEntryOID, + OID_READ_MGR,&cstReaderParams,NULL); + // readerApplications + cstReaderParams.delayResponceTimeMin=d->domainProp.baseProp.delayResponceTimeACKMin; + cstReaderParams.delayResponceTimeMax=d->domainProp.baseProp.delayResponceTimeACKMax; + cstReaderParams.ACKMaxRetries=d->domainProp.baseProp.ACKMaxRetries; + cstReaderParams.repeatActiveQueryTime=d->domainProp.baseProp.repeatActiveQueryTime; + cstReaderParams.fullAcknowledge=ORTE_TRUE; + CSTReaderInit(d,&d->readerApplications,d->objectEntryOID, + OID_READ_APP,&cstReaderParams,NULL); + // writerPublications + NTPTIME_ZERO(cstWriterParams.waitWhileDataUnderwayTime); + cstWriterParams.refreshPeriod=d->domainProp.baseProp.refreshPeriod; + cstWriterParams.repeatAnnounceTime=d->domainProp.baseProp.repeatAnnounceTime; + NtpTimeAssembFromMs(cstWriterParams.delayResponceTime,0,20); + cstWriterParams.HBMaxRetries=d->domainProp.baseProp.HBMaxRetries; + cstWriterParams.fullAcknowledge=ORTE_TRUE; + CSTWriterInit(d,&d->writerPublications,d->objectEntryOID, + OID_WRITE_PUBL,&cstWriterParams,NULL); + // writerSubscriptions + NTPTIME_ZERO(cstWriterParams.waitWhileDataUnderwayTime); + cstWriterParams.refreshPeriod=d->domainProp.baseProp.refreshPeriod; + cstWriterParams.repeatAnnounceTime=d->domainProp.baseProp.repeatAnnounceTime; + NtpTimeAssembFromMs(cstWriterParams.delayResponceTime,0,20); + cstWriterParams.HBMaxRetries=d->domainProp.baseProp.HBMaxRetries; + cstWriterParams.fullAcknowledge=ORTE_TRUE; + CSTWriterInit(d,&d->writerSubscriptions,d->objectEntryOID, + OID_WRITE_SUBS,&cstWriterParams,NULL); + // readerPublications + cstReaderParams.delayResponceTimeMin=d->domainProp.baseProp.delayResponceTimeACKMin; + cstReaderParams.delayResponceTimeMax=d->domainProp.baseProp.delayResponceTimeACKMax; + cstReaderParams.ACKMaxRetries=d->domainProp.baseProp.ACKMaxRetries; + cstReaderParams.repeatActiveQueryTime=d->domainProp.baseProp.repeatActiveQueryTime; + cstReaderParams.fullAcknowledge=ORTE_TRUE; + CSTReaderInit(d,&d->readerPublications,d->objectEntryOID, + OID_READ_PUBL,&cstReaderParams,NULL); + // readerSubscriptions + cstReaderParams.delayResponceTimeMin=d->domainProp.baseProp.delayResponceTimeACKMin; + cstReaderParams.delayResponceTimeMax=d->domainProp.baseProp.delayResponceTimeACKMax; + cstReaderParams.ACKMaxRetries=d->domainProp.baseProp.ACKMaxRetries; + cstReaderParams.repeatActiveQueryTime=d->domainProp.baseProp.repeatActiveQueryTime; + cstReaderParams.fullAcknowledge=ORTE_TRUE; + CSTReaderInit(d,&d->readerSubscriptions,d->objectEntryOID, + OID_READ_SUBS,&cstReaderParams,NULL); + + //add csChange for WAS + appSelfParamChanged(d,ORTE_FALSE,ORTE_FALSE,ORTE_FALSE); + + //Start threads + pthread_mutex_lock(&d->objectEntry.htimSendMutex); + pthread_create(&d->taskRecvMetatraffic.thread, NULL, + (void*)&ORTEAppRecvMetatrafficThread, (void *)d); + pthread_create(&d->taskRecvUserdata.thread, NULL, + (void*)&ORTEAppRecvUserdataThread, (void *)d); + pthread_create(&d->taskSend.thread, NULL, + (void*)&ORTEAppSendThread, (void *)d); + + debug(21,10) ("ORTEDomainAppCreate: finished\n"); + return d; +} + +/*****************************************************************************/ +Boolean +ORTEDomainAppDestroy(ORTEDomain *d) { + CSTWriter *cstWriter; + CSTReader *cstReader; + + debug(21,10) ("ORTEDomainAppDestroy: start\n"); + if (!d) return ORTE_FALSE; + //Stoping threads + d->taskRecvMetatraffic.terminate=ORTE_TRUE; + d->taskRecvUserdata.terminate=ORTE_TRUE; + d->taskSend.terminate=ORTE_TRUE; + ORTEDomainWakeUpReceivingThread(d, + &d->taskSend.sock,d->taskRecvMetatraffic.sock.port); + pthread_join(d->taskRecvMetatraffic.thread,NULL); + ORTEDomainWakeUpReceivingThread(d, + &d->taskSend.sock,d->taskRecvUserdata.sock.port); + pthread_join(d->taskRecvUserdata.thread,NULL); + ORTEDomainWakeUpSendingThread(&d->objectEntry); + pthread_join(d->taskSend.thread,NULL); + debug(21,3) ("ORTEDomainAppDestroy: threads stoped\n"); + + //Sockets + sock_cleanup(&d->taskRecvMetatraffic.sock); + sock_cleanup(&d->taskRecvUserdata.sock); + sock_cleanup(&d->taskSend.sock); + + //Mutex(es) + pthread_mutex_destroy(&d->objectEntry.htimSendMutex); + + //rwLocks + pthread_rwlock_destroy(&d->objectEntry.objRootLock); + pthread_rwlock_destroy(&d->objectEntry.htimRootLock); + pthread_rwlock_destroy(&d->publications.lock); + pthread_rwlock_destroy(&d->subscriptions.lock); + pthread_rwlock_destroy(&d->psEntry.publicationsLock); + pthread_rwlock_destroy(&d->psEntry.subscriptionsLock); + + //TypeRegister + ORTETypeRegisterDestroyAll(d); + pthread_rwlock_destroy(&d->typeEntry.lock); + + //Pattern + ORTEDomainAppSubscriptionPatternDestroyAll(d); + + //CSTReaders and CSTWriters + CSTWriterDelete(d,&d->writerApplicationSelf); + CSTReaderDelete(d,&d->readerManagers); + CSTReaderDelete(d,&d->readerApplications); + CSTWriterDelete(d,&d->writerPublications); + CSTWriterDelete(d,&d->writerSubscriptions); + CSTReaderDelete(d,&d->readerPublications); + CSTReaderDelete(d,&d->readerSubscriptions); + gavl_cust_for_each(CSTWriter,&d->publications,cstWriter) { + CSTWriterDelete(d,cstWriter); + FREE(cstWriter); + } + gavl_cust_for_each(CSTReader,&d->subscriptions,cstReader) { + CSTReaderDelete(d,cstReader); + FREE(cstReader); + } + + //objects in objectsEntry + objectEntryDeleteAll(d,&d->objectEntry); + + FREE(d->mbRecvMetatraffic.cdrStream.buffer); + FREE(d->mbRecvUserdata.cdrStream.buffer); + FREE(d->mbSend.cdrStream.buffer); + FREE(d); + debug(21,10) ("ORTEDomainAppDestroy: finished\n"); + return ORTE_TRUE; +} + +/*****************************************************************************/ +Boolean +ORTEDomainAppSubscriptionPatternAdd(ORTEDomain *d,const char *topic, + const char *type,ORTESubscriptionPatternCallBack subscriptionCallBack, + void *param) { + SubscriptionPatternNode *psnode; + + if (!d) return ORTE_FALSE; + psnode=(SubscriptionPatternNode*)MALLOC(sizeof(SubscriptionPatternNode)); + strcpy(psnode->topic,topic); + strcpy(psnode->type,type); + psnode->subscriptionCallBack=subscriptionCallBack; + psnode->param=param; + SubscriptionPattern_insert(&d->patternEntry,psnode); + return ORTE_TRUE; +} + +/*****************************************************************************/ +Boolean +ORTEDomainAppSubscriptionPatternRemove(ORTEDomain *d,const char *topic, + const char *type) { + SubscriptionPatternNode *psnode; + + if (!d) return ORTE_FALSE; + ul_list_for_each(SubscriptionPattern,&d->patternEntry,psnode) { + if ((strcmp(psnode->topic,topic)==0) && + (strcmp(psnode->type,type)==0)) { + SubscriptionPattern_delete(&d->patternEntry,psnode); + FREE(psnode); + return ORTE_TRUE; + } + } + return ORTE_FALSE; +} + +/*****************************************************************************/ +Boolean +ORTEDomainAppSubscriptionPatternDestroyAll(ORTEDomain *d) { + SubscriptionPatternNode *psnode; + + if (!d) return ORTE_FALSE; + while((psnode=SubscriptionPattern_cut_first(&d->patternEntry))) { + FREE(psnode); + } + return ORTE_TRUE; +} diff --git a/orte/liborte/ORTEDomainMgr.c b/orte/liborte/ORTEDomainMgr.c new file mode 100644 index 0000000..df702dd --- /dev/null +++ b/orte/liborte/ORTEDomainMgr.c @@ -0,0 +1,350 @@ +/* + * $Id: ORTEDomainMgr.c,v 0.0.0.1 2003/09/12 + * + * DEBUG: section 29 Domain manager + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +ORTEDomain * +ORTEDomainMgrCreate(int domain, ORTEDomainProp *prop, + ORTEDomainAppEvents *events,Boolean startSendingThread) { + ORTEDomain *d; + ObjectEntryOID *objectEntryOID; + AppParams *appParams; + CSTWriterParams cstWriterParams; + CSTReaderParams cstReaderParams; + char iflocal[MAX_INTERFACES*MAX_STRING_IPADDRESS_LENGTH]; + int i; + u_int16_t port=0; + + debug(29,10) ("ORTEDomainMgrCreate: start\n"); + //Create domainApplication + d=MALLOC(sizeof(ORTEDomain)); + if (!d) return NULL; //no memory + //initialization local values + d->domain=domain; + d->taskRecvMetatraffic.terminate=ORTE_FALSE; + d->taskSend.terminate=ORTE_FALSE; + d->taskRecvMetatraffic.sock.port=0; + d->taskSend.sock.port=0; + //init structure objectEntry + ObjectEntryHID_init_root_field(&d->objectEntry); + pthread_rwlock_init(&d->objectEntry.objRootLock,NULL); + htimerRoot_init_queue(&d->objectEntry); + pthread_rwlock_init(&d->objectEntry.htimRootLock,NULL); + pthread_mutex_init(&d->objectEntry.htimSendMutex, NULL); + + //create domainProp + if (prop!=NULL) { + memcpy(&d->domainProp,prop,sizeof(ORTEDomainProp)); + } else { + ORTEDomainPropDefaultGet(&d->domainProp); + } + + //print local IP addresses + iflocal[0]=0; + if (d->domainProp.IFCount) { + for(i=0;idomainProp.IFCount;i++) + strcat(iflocal,IPAddressToString(d->domainProp.IFProp[i].ipAddress)); + debug(29,2) ("ORTEDomainMgrCreate: localIPAddres(es) %s\n",iflocal); + } else{ + debug(29,2) ("ORTEDomainMgrCreate: no activ interface card\n"); + } + + //DomainEvents + if (events!=NULL) { + memcpy(&d->domainEvents,events,sizeof(ORTEDomainAppEvents)); + } else { + memset(&d->domainEvents,0,sizeof(ORTEDomainAppEvents)); + } + + //local buffers + d->mbRecvMetatraffic.cdrStream.buffer= + (u_int8_t*)MALLOC(d->domainProp.recvBuffSize); + d->mbRecvUserdata.cdrStream.buffer=NULL; + d->mbSend.cdrStream.buffer= + (u_int8_t*)MALLOC(d->domainProp.sendBuffSize); + if ((!d->mbRecvMetatraffic.cdrStream.buffer) || + (!d->mbSend.cdrStream.buffer)) { //no memory + FREE(d->mbRecvMetatraffic.cdrStream.buffer); + FREE(d->mbSend.cdrStream.buffer); + FREE(d); + return NULL; + } + d->mbRecvMetatraffic.cdrStream.bufferPtr=d->mbRecvMetatraffic.cdrStream.buffer; + d->mbRecvMetatraffic.cdrStream.length=0; + d->mbRecvUserdata.cdrStream.bufferPtr=d->mbRecvUserdata.cdrStream.buffer; + d->mbRecvUserdata.cdrStream.length=0; + d->mbSend.cdrStream.bufferPtr=d->mbSend.cdrStream.buffer; + d->mbSend.cdrStream.length=0; + + //Sockets + sock_init_udp(&d->taskRecvMetatraffic.sock); + sock_init_udp(&d->taskSend.sock); + if (d->domainProp.multicast.enabled) { + Domain2PortMulticastMetatraffic(d->domain,port); + } else { + Domain2Port(d->domain,port); + } + sock_bind(&d->taskRecvMetatraffic.sock,port); //receiving port + debug(29,2) ("ORTEDomainMgrCreate: bind on port(Recv): %u\n", + d->taskRecvMetatraffic.sock.port); + sock_bind(&d->taskSend.sock,0); //give me sending port + debug(29,2) ("ORTEDomainAppCreate: bind on port(Send): %u\n", + d->taskSend.sock.port); + if (d->domainProp.multicast.enabled) { + struct ip_mreq mreq; + //ttl + if(sock_setsockopt(&d->taskSend.sock,IP_MULTICAST_TTL, + &d->domainProp.multicast.ttl,sizeof(d->domainProp.multicast.ttl))>=0) { + debug(29,2) ("ORTEDomainAppCreate: ttl set on: %u\n", + d->domainProp.multicast.ttl); + } + // join multicast group + mreq.imr_multiaddr.s_addr=htonl(d->domainProp.multicast.ipAddress); + mreq.imr_interface.s_addr=htonl(INADDR_ANY); + if(sock_setsockopt(&d->taskRecvUserdata.sock,IP_ADD_MEMBERSHIP, + (void *) &mreq, sizeof(mreq))>=0) { + debug(29,2) ("ORTEDomainAppCreate: listening to mgroup %s\n", + IPAddressToString(d->domainProp.multicast.ipAddress)); + } + } + if ((d->taskRecvMetatraffic.sock.fd<0) || (d->taskSend.sock.fd<0) || + (port!=d->taskRecvMetatraffic.sock.port)) { + printf("Error creating socket(s).\n"); + sock_cleanup(&d->taskRecvMetatraffic.sock); + sock_cleanup(&d->taskSend.sock); + FREE(d->mbRecvMetatraffic.cdrStream.buffer); + FREE(d->mbSend.cdrStream.buffer); + FREE(d); + return NULL; + } + + //Generates local GUID + if (d->domainProp.IFCount>0) + d->guid.hid=d->domainProp.IFProp[0].ipAddress; + else + d->guid.hid=StringToIPAddress("127.0.0.1"); + d->guid.aid=(d->taskSend.sock.port<<8)+MANAGER; + d->guid.oid=OID_APP; + debug(29,2) ("ORTEDomainMgrCreate: GUID: %#10.8x,%#10.8x,%#10.8x\n", + d->guid.hid,d->guid.aid,d->guid.oid); + + //create HEADER of message for sending task + RTPSHeaderCreate(d->mbSend.cdrStream.buffer,d->guid.hid,d->guid.aid); + d->mbSend.cdrStream.bufferPtr= + d->mbSend.cdrStream.buffer+RTPS_HEADER_LENGTH; + d->mbSend.cdrStream.length=RTPS_HEADER_LENGTH; + d->mbSend.needSend=ORTE_FALSE; + d->mbSend.containsInfoReply=ORTE_FALSE; + + //Self object data & fellow managers object data + appParams=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(appParams); + appParams->expirationTime=d->domainProp.baseProp.expirationTime; + VENDOR_ID_OCERA(appParams->vendorId); + appParams->hostId=d->guid.hid; + appParams->appId=d->guid.aid; + appParams->metatrafficUnicastPort=d->taskRecvMetatraffic.sock.port; + appParams->userdataUnicastPort=0; //Manager support only metatraffic + if (d->domainProp.multicast.enabled) { + //multicast + for(i=0;idomainProp.IFCount;i++) + appParams->metatrafficMulticastIPAddressList[i]=d->domainProp.IFProp[i].ipAddress; + appParams->metatrafficMulticastIPAddressCount=d->domainProp.IFCount; + } else { + //unicast + if (d->domainProp.IFCount) { + for(i=0;idomainProp.IFCount;i++) + appParams->unicastIPAddressList[i]=d->domainProp.IFProp[i].ipAddress; + appParams->unicastIPAddressCount=d->domainProp.IFCount; + } else { + appParams->unicastIPAddressList[0]=StringToIPAddress("127.0.0.1"); + appParams->unicastIPAddressCount=1; + } + } + //managerKeyList + appParams->managerKeyList[0]=StringToIPAddress("127.0.0.1"); + for(i=0;idomainProp.IFCount;i++) + appParams->managerKeyList[i+1]=d->domainProp.IFProp[i].ipAddress; + appParams->managerKeyCount=d->domainProp.IFCount+1; + if (d->domainProp.mgrAddKey!=0) { + appParams->managerKeyList[appParams->managerKeyCount]=d->domainProp.mgrAddKey; + appParams->managerKeyCount++; + debug(29,4) ("ORTEDomainMgrCreate: additional manager key accepted (%s)\n", + IPAddressToString(d->domainProp.mgrAddKey)); + + } + d->appParams=appParams; + //insert object, doesn't need to be locked + d->objectEntryOID=objectEntryAdd(d,&d->guid,(void*)appParams); + d->objectEntryOID->private=ORTE_TRUE; + + //CST objects + // writerApplicationSelf (WAS) + NTPTIME_ZERO(cstWriterParams.waitWhileDataUnderwayTime); + cstWriterParams.refreshPeriod=d->domainProp.baseProp.refreshPeriod; + cstWriterParams.repeatAnnounceTime=d->domainProp.baseProp.repeatAnnounceTime; + NTPTIME_ZERO(cstWriterParams.delayResponceTime); + cstWriterParams.HBMaxRetries=d->domainProp.baseProp.HBMaxRetries; + cstWriterParams.fullAcknowledge=ORTE_FALSE; + CSTWriterInit(d,&d->writerApplicationSelf,d->objectEntryOID, + OID_WRITE_APPSELF,&cstWriterParams,NULL); + // add to WAS remote writer(s) + if (d->domainProp.mgrs) { + int8_t *cp=d->domainProp.mgrs; + while (cp[0]!=0) { //till is length>0 +#ifndef __RTL__ + struct hostent *hostname; +#endif + int8_t *dcp,tcp; + dcp=strchr(cp,':'); + if (!dcp) dcp=cp+strlen(cp); + tcp=*dcp; //save ending value + *dcp=0; //temporary end of string +#ifdef __RTL__ + if (1) { + GUID_RTPS guid; + IPAddress ipAddress=StringToIPAddress(cp); +#else + if ((hostname=gethostbyname(cp))) { + GUID_RTPS guid; + IPAddress ipAddress=ntohl(*((long*)(hostname->h_addr_list[0]))); +#endif + guid.hid=ipAddress; + guid.aid=AID_UNKNOWN; + guid.oid=OID_APP; + if (!objectEntryFind(d,&guid)) { + appParams=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(appParams); + appParams->hostId=guid.hid; + appParams->appId=guid.aid; + appParams->metatrafficUnicastPort=d->appParams->metatrafficUnicastPort; + appParams->userdataUnicastPort=0; //Manager support only metatraffic + appParams->unicastIPAddressList[0]=ipAddress; + appParams->unicastIPAddressCount=1; + objectEntryOID=objectEntryAdd(d,&guid,(void*)appParams); + CSTWriterAddRemoteReader(d,&d->writerApplicationSelf,objectEntryOID, + OID_READ_MGR); + debug(29,2) ("ORTEDomainAppCreate: add fellow manager (%s)\n", + IPAddressToString(ipAddress)); + } + } + *dcp=tcp; //restore value + if (dcp[0]!=0) cp=dcp+1; //next value + else cp=dcp; + } + } + // readerManagers + cstReaderParams.delayResponceTimeMin=d->domainProp.baseProp.delayResponceTimeACKMin; + cstReaderParams.delayResponceTimeMax=d->domainProp.baseProp.delayResponceTimeACKMax; + cstReaderParams.ACKMaxRetries=d->domainProp.baseProp.ACKMaxRetries; + cstReaderParams.repeatActiveQueryTime=iNtpTime; //RM cann't repeatly send ACKf + cstReaderParams.fullAcknowledge=ORTE_FALSE; //never will send ACK + CSTReaderInit(d,&d->readerManagers,d->objectEntryOID, + OID_READ_MGR,&cstReaderParams,NULL); + // readerApplications + cstReaderParams.delayResponceTimeMin=d->domainProp.baseProp.delayResponceTimeACKMin; + cstReaderParams.delayResponceTimeMax=d->domainProp.baseProp.delayResponceTimeACKMax; + cstReaderParams.ACKMaxRetries=d->domainProp.baseProp.ACKMaxRetries; + cstReaderParams.repeatActiveQueryTime=d->domainProp.baseProp.repeatActiveQueryTime; + cstReaderParams.fullAcknowledge=ORTE_TRUE; + CSTReaderInit(d,&d->readerApplications,d->objectEntryOID, + OID_READ_APP,&cstReaderParams,NULL); + // writerApplications + NTPTIME_ZERO(cstWriterParams.waitWhileDataUnderwayTime); + cstWriterParams.refreshPeriod=iNtpTime; //only WAS,WM can refresh csChange(s) + cstWriterParams.repeatAnnounceTime=d->domainProp.baseProp.repeatAnnounceTime; + NtpTimeAssembFromMs(cstWriterParams.delayResponceTime,0,20); + cstWriterParams.HBMaxRetries=d->domainProp.baseProp.HBMaxRetries; + cstWriterParams.fullAcknowledge=ORTE_FALSE; + CSTWriterInit(d,&d->writerApplications,d->objectEntryOID, + OID_WRITE_APP,&cstWriterParams,NULL); + // writerManagers + NTPTIME_ZERO(cstWriterParams.waitWhileDataUnderwayTime); + cstWriterParams.refreshPeriod=d->domainProp.baseProp.refreshPeriod; + cstWriterParams.repeatAnnounceTime=d->domainProp.baseProp.repeatAnnounceTime; + NtpTimeAssembFromMs(cstWriterParams.delayResponceTime,0,20); + cstWriterParams.HBMaxRetries=d->domainProp.baseProp.HBMaxRetries; + cstWriterParams.fullAcknowledge=ORTE_TRUE; + CSTWriterInit(d,&d->writerManagers,d->objectEntryOID, + OID_WRITE_MGR,&cstWriterParams,NULL); + + //add csChange for WAS + appSelfParamChanged(d,ORTE_FALSE,ORTE_FALSE,ORTE_FALSE); + + //Start threads + pthread_mutex_lock(&d->objectEntry.htimSendMutex); + pthread_create(&d->taskRecvMetatraffic.thread, NULL, + (void*)&ORTEAppRecvMetatrafficThread, (void *)d); + if (startSendingThread) { + pthread_create(&d->taskSend.thread, NULL, + (void*)&ORTEAppSendThread, (void *)d); + } + + debug(29,10) ("ORTEDomainMgrCreate: finished\n"); + return d; +} + +/*****************************************************************************/ +Boolean +ORTEDomainMgrDestroy(ORTEDomain *d) { + + debug(29,10) ("ORTEDomainMgrDestroy: start\n"); + //Stoping threads + d->taskRecvMetatraffic.terminate=ORTE_TRUE; + d->taskSend.terminate=ORTE_TRUE; + ORTEDomainWakeUpReceivingThread(d, + &d->taskSend.sock,d->taskRecvMetatraffic.sock.port); + pthread_join(d->taskRecvMetatraffic.thread,NULL); + ORTEDomainWakeUpSendingThread(&d->objectEntry); + pthread_join(d->taskSend.thread,NULL); + debug(29,8) ("ORTEDomainMgrDestroy: threads stoped and destroyed\n"); + + objectEntryDump(&d->objectEntry); + + //Sockets + sock_cleanup(&d->taskRecvMetatraffic.sock); + sock_cleanup(&d->taskSend.sock); + + //Mutex(es) + pthread_mutex_destroy(&d->objectEntry.htimSendMutex); + + //rwLocks + pthread_rwlock_destroy(&d->objectEntry.objRootLock); + pthread_rwlock_destroy(&d->objectEntry.htimRootLock); + + + //CSTReaders and CSTWriters + CSTReaderDelete(d,&d->readerManagers); + CSTReaderDelete(d,&d->readerApplications); + CSTWriterDelete(d,&d->writerManagers); + CSTWriterDelete(d,&d->writerApplications); + CSTWriterDelete(d,&d->writerApplicationSelf); + + //objects in objectsEntry + objectEntryDeleteAll(d,&d->objectEntry); + + FREE(d->mbRecvMetatraffic.cdrStream.buffer); + FREE(d->mbSend.cdrStream.buffer); + FREE(d); + debug(29,10) ("ORTEDomainMgrDestroy: finished\n"); + return ORTE_TRUE; +} diff --git a/orte/liborte/ORTEInit.c b/orte/liborte/ORTEInit.c new file mode 100644 index 0000000..33da16b --- /dev/null +++ b/orte/liborte/ORTEInit.c @@ -0,0 +1,38 @@ +/* + * $Id: ORTEInit.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 20 Initialization of ORTE + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +void +ORTEInit(void) { + SEQUENCE_NUMBER_NONE(noneSN); + NTPTIME_ZERO(zNtpTime); + NTPTIME_INFINITE(iNtpTime); + sock_start(); + db_init(NULL,""); //no debug info +} + + + + + + diff --git a/orte/liborte/ORTEPattern.c b/orte/liborte/ORTEPattern.c new file mode 100644 index 0000000..267e82a --- /dev/null +++ b/orte/liborte/ORTEPattern.c @@ -0,0 +1,46 @@ +/* + * $Id: ORTEPattern.c,v 0.0.0.1 2003/07/12 + * + * DEBUG: section 28 Pattern + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +Boolean +ORTEPatternCheckDefault(const char *topic) { + if (strchr(topic, '*')!=NULL) + return ORTE_TRUE; + return ORTE_FALSE; +} + +/**********************************************************************************/ +Boolean +ORTEPatternMatchDefault(const char *topic,const char *pattern,void *param) { + fnmatch(pattern,topic,0); + return ORTE_FALSE; +} + +/**********************************************************************************/ +void +ORTEPatternRegister(ORTEDomain *d,ORTEPatternCheck check, + ORTEPatternMatch match,void *param) { + d->patternEntry.check=check; + d->patternEntry.match=match; + d->patternEntry.param=param; +} diff --git a/orte/liborte/ORTEPublication.c b/orte/liborte/ORTEPublication.c new file mode 100644 index 0000000..fab4ca5 --- /dev/null +++ b/orte/liborte/ORTEPublication.c @@ -0,0 +1,294 @@ +/* + * $Id: ORTEPublication.c,v 0.0.0.1 2003/11/21 + * + * DEBUG: section 31 Functions working over publication + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +GAVL_CUST_NODE_INT_IMP(PublicationList, + PSEntry, ObjectEntryOID, GUID_RTPS, + publications, psNode, guid, gavl_cmp_guid); + +/*****************************************************************************/ +ORTEPublication * +ORTEPublicationCreate(ORTEDomain *d,char *topic,char *typeName, + void *instance,NtpTime *persistence,int strength, + ORTESendCallBack sendCallBack,void *sendCallBackParam, + NtpTime *sendCallBackDelay) { + GUID_RTPS guid; + CSTWriter *cstWriter; + CSTWriterParams cstWriterParams; + ORTEPublProp *pp; + ObjectEntryOID *objectEntryOID; + CSChange *csChange; + TypeNode *typeNode; + + cstWriter=(CSTWriter*)MALLOC(sizeof(CSTWriter)); + if (!cstWriter) return NULL; + pthread_rwlock_wrlock(&d->objectEntry.objRootLock); + pthread_rwlock_wrlock(&d->objectEntry.htimRootLock); + pthread_rwlock_rdlock(&d->typeEntry.lock); + if (!(typeNode=ORTEType_find(&d->typeEntry,&typeName))) { + pthread_rwlock_unlock(&d->typeEntry.lock); + pthread_rwlock_unlock(&d->objectEntry.objRootLock); + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + printf("before call ORTEPublicationCreate is necessary to register \n\ + ser./deser. function for a given typeName!!!\n"); + return NULL; + } + pthread_rwlock_wrlock(&d->publications.lock); + //generate new guid of publisher + d->publications.counter++; + guid.hid=d->guid.hid;guid.aid=d->guid.aid; + guid.oid=(d->publications.counter<<8)|OID_PUBLICATION; + pp=(ORTEPublProp*)MALLOC(sizeof(ORTEPublProp)); + memcpy(pp,&d->publPropDefault,sizeof(ORTEPublProp)); + strcpy(pp->topic,topic); + strcpy(pp->typeName,typeName); + pp->persistence=*persistence; + pp->strength=strength; + pp->reliabilityOffered=PID_VALUE_RELIABILITY_BEST_EFFORTS | + PID_VALUE_RELIABILITY_STRICT; + //insert object to structure objectEntry + objectEntryOID=objectEntryAdd(d,&guid,(void*)pp); + objectEntryOID->private=ORTE_TRUE; + objectEntryOID->instance=instance; + objectEntryOID->sendCallBack=sendCallBack; + objectEntryOID->callBackParam=sendCallBackParam; + if (objectEntryOID->sendCallBack!=NULL) { + if (sendCallBackDelay!=NULL) { + objectEntryOID->sendCallBackDelay=*sendCallBackDelay; + eventAdd(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->sendCallBackDelayTimer, + 0, + "PublicationCallBackTimer", + PublicationCallBackTimer, + &cstWriter->lock, + cstWriter, + &objectEntryOID->sendCallBackDelay); + } + } + //create writerPublication + NTPTIME_ZERO(cstWriterParams.waitWhileDataUnderwayTime); + NTPTIME_ZERO(cstWriterParams.delayResponceTime); + cstWriterParams.refreshPeriod=iNtpTime; //cann't refresh csChange(s) + cstWriterParams.repeatAnnounceTime=pp->HBNornalRate; + cstWriterParams.HBMaxRetries=pp->HBMaxRetries; + cstWriterParams.fullAcknowledge=ORTE_TRUE; + CSTWriterInit(d,cstWriter,objectEntryOID,guid.oid,&cstWriterParams, + &typeNode->typeRegister); + //insert cstWriter to list of publications + CSTWriter_insert(&d->publications,cstWriter); + //generate csChange for writerPublisher + pthread_rwlock_wrlock(&d->writerPublications.lock); + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + parameterUpdateCSChangeFromPublication(csChange,pp); + csChange->guid=guid; + csChange->alive=ORTE_TRUE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(d,&d->writerPublications,csChange); + pthread_rwlock_unlock(&d->writerPublications.lock); + pthread_rwlock_unlock(&d->publications.lock); + pthread_rwlock_unlock(&d->typeEntry.lock); + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + pthread_rwlock_unlock(&d->objectEntry.objRootLock); + return cstWriter; +} + +/*****************************************************************************/ +int +ORTEPublicationDestroy(ORTEPublication *cstWriter) { + CSChange *csChange; + + if (!cstWriter) return -1; + //generate csChange for writerPublisher + pthread_rwlock_wrlock(&cstWriter->domain->objectEntry.objRootLock); + pthread_rwlock_wrlock(&cstWriter->domain->objectEntry.htimRootLock); + pthread_rwlock_wrlock(&cstWriter->domain->writerPublications.lock); + if (cstWriter->objectEntryOID->sendCallBack!=NULL) { + eventDetach(cstWriter->domain, + cstWriter->objectEntryOID->objectEntryAID, + &cstWriter->objectEntryOID->sendCallBackDelayTimer, + 0); + } + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + CSChangeAttributes_init_head(csChange); + csChange->cdrStream.buffer=NULL; + csChange->guid=cstWriter->guid; + csChange->alive=ORTE_FALSE; + CSTWriterAddCSChange(cstWriter->domain, + &cstWriter->domain->writerPublications, + csChange); + pthread_rwlock_unlock(&cstWriter->domain->writerPublications.lock); + pthread_rwlock_unlock(&cstWriter->domain->objectEntry.htimRootLock); + pthread_rwlock_unlock(&cstWriter->domain->objectEntry.objRootLock); + return 0; +} + + +/*****************************************************************************/ +int +ORTEPublicationPropertiesGet(ORTEPublication *cstWriter,ORTEPublProp *pp) { + pthread_rwlock_rdlock(&cstWriter->domain->objectEntry.objRootLock); + pthread_rwlock_rdlock(&cstWriter->lock); + *pp=*(ORTEPublProp*)cstWriter->objectEntryOID->attributes; + pthread_rwlock_unlock(&cstWriter->lock); + pthread_rwlock_unlock(&cstWriter->domain->objectEntry.objRootLock); + return 0; +} + +/*****************************************************************************/ +int +ORTEPublicationPropertiesSet(ORTEPublication *cstWriter,ORTEPublProp *pp) { + CSChange *csChange; + + pthread_rwlock_wrlock(&cstWriter->domain->objectEntry.objRootLock); + pthread_rwlock_wrlock(&cstWriter->domain->objectEntry.htimRootLock); + pthread_rwlock_wrlock(&cstWriter->domain->writerPublications.lock); + pthread_rwlock_rdlock(&cstWriter->lock); + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + parameterUpdateCSChangeFromPublication(csChange,pp); + csChange->guid=cstWriter->guid; + csChange->alive=ORTE_TRUE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(cstWriter->domain, + &cstWriter->domain->writerPublications,csChange); + pthread_rwlock_unlock(&cstWriter->lock); + pthread_rwlock_unlock(&cstWriter->domain->publications.lock); + pthread_rwlock_unlock(&cstWriter->domain->objectEntry.htimRootLock); + pthread_rwlock_unlock(&cstWriter->domain->objectEntry.objRootLock); + return 0; +} + +/*****************************************************************************/ +int +ORTEPublicationWaitForSubscriptions(ORTEPublication *cstWriter,NtpTime wait, + unsigned int retries,unsigned int noSubscriptions) { + return 0; +} + +/*****************************************************************************/ +int +ORTEPublicationGetStatus(ORTEPublication *cstWriter,ORTEPublStatus *status) { + return 0; +} + +/*****************************************************************************/ +int +ORTEPublicationPrepareQueue(ORTEPublication *cstWriter) { + ORTEPublProp *pp; + + if (!cstWriter) return -1; + pthread_rwlock_wrlock(&cstWriter->lock); + pp=(ORTEPublProp*)cstWriter->objectEntryOID->attributes; + if (cstWriter->csChangesCounter>=pp->sendQueueSize) { + if (!CSTWriterTryDestroyBestEffortIssue(cstWriter)) { + NtpTime expire,atime=getActualNtpTime(); + struct timespec wtime; + //Count max block time + NtpTimeAdd(expire,atime,cstWriter->domain->domainProp.baseProp.maxBlockTime); + NtpTimeDisAssembToUs(wtime.tv_sec,wtime.tv_nsec,expire); + wtime.tv_nsec*=1000; //conver to nano seconds + pthread_mutex_lock(&cstWriter->mutexCSChangeDestroyed); + pthread_rwlock_unlock(&cstWriter->lock); + pthread_mutex_timedlock( + &cstWriter->mutexCSChangeDestroyed, + &wtime); + pthread_mutex_unlock(&cstWriter->mutexCSChangeDestroyed); + pthread_rwlock_wrlock(&cstWriter->lock); + pp=(ORTEPublProp*)cstWriter->objectEntryOID->attributes; + if (cstWriter->csChangesCounter>=pp->sendQueueSize) { + debug(31,5) ("Publication: queue level (%d), queue full!!!\n", + cstWriter->csChangesCounter); + pthread_rwlock_unlock(&cstWriter->lock); + return -2; + } + } + } + pthread_rwlock_unlock(&cstWriter->lock); + return 0; +} + +/*****************************************************************************/ +int +ORTEPublicationSendLocked(ORTEPublication *cstWriter) { + CSChange *csChange; + SequenceNumber snNext; + + if (!cstWriter) return -1; + pthread_rwlock_rdlock(&cstWriter->domain->typeEntry.lock); + pthread_rwlock_wrlock(&cstWriter->domain->writerPublications.lock); + if (!CSTRemoteReader_is_empty(cstWriter)) { + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + CSChangeAttributes_init_head(csChange); + csChange->guid=cstWriter->guid; + csChange->alive=ORTE_FALSE; + csChange->cdrStream.length=RTPS_HEADER_LENGTH+12+ //HEADER+INFO_TS+ISSUE + +20+cstWriter->typeRegister->getMaxSize; + csChange->cdrStream.buffer=(u_int8_t*)MALLOC(csChange->cdrStream.length); + csChange->cdrStream.bufferPtr=csChange->cdrStream.buffer+RTPS_HEADER_LENGTH+12+20; + SeqNumberInc(snNext,cstWriter->lastSN); + RTPSHeaderCreate(csChange->cdrStream.buffer, + cstWriter->domain->guid.hid,cstWriter->domain->guid.aid); + RTPSInfoTSCreate(csChange->cdrStream.buffer+RTPS_HEADER_LENGTH, + 12,getActualNtpTime()); + RTPSIssueCreateHeader(csChange->cdrStream.buffer+ + RTPS_HEADER_LENGTH+12,20,16+cstWriter->typeRegister->getMaxSize, + OID_UNKNOWN,cstWriter->guid.oid,snNext); + //serialization routine + if (cstWriter->typeRegister->serialize) { + cstWriter->typeRegister->serialize( + &csChange->cdrStream, + cstWriter->objectEntryOID->instance); + } else { + //no deserialization -> memcpy + memcpy(csChange->cdrStream.bufferPtr, + cstWriter->objectEntryOID->instance, + cstWriter->typeRegister->getMaxSize); + csChange->cdrStream.bufferPtr+=cstWriter->typeRegister->getMaxSize; + } + csChange->cdrStream.needByteSwap=ORTE_FALSE; + CSTWriterAddCSChange(cstWriter->domain, + cstWriter, + csChange); + } + pthread_rwlock_unlock(&cstWriter->domain->typeEntry.lock); + pthread_rwlock_unlock(&cstWriter->domain->writerPublications.lock); + return 0; +} + +/*****************************************************************************/ +int +ORTEPublicationSend(ORTEPublication *cstWriter) { + int r; + + if (!cstWriter) return -1; + //PrepareSendingQueue + if ((r=ORTEPublicationPrepareQueue(cstWriter))<0) return r; + //send + pthread_rwlock_wrlock(&cstWriter->domain->objectEntry.objRootLock); + pthread_rwlock_wrlock(&cstWriter->domain->objectEntry.htimRootLock); + pthread_rwlock_wrlock(&cstWriter->lock); + r=ORTEPublicationSendLocked(cstWriter); + pthread_rwlock_unlock(&cstWriter->lock); + pthread_rwlock_unlock(&cstWriter->domain->objectEntry.htimRootLock); + pthread_rwlock_unlock(&cstWriter->domain->objectEntry.objRootLock); + return r; +} diff --git a/orte/liborte/ORTEPublicationTimer.c b/orte/liborte/ORTEPublicationTimer.c new file mode 100644 index 0000000..fc97b78 --- /dev/null +++ b/orte/liborte/ORTEPublicationTimer.c @@ -0,0 +1,53 @@ +/* + * $Id: ORTEPublicationTimer.c,v 0.0.0.1 2003/12/15 + * + * DEBUG: section 32 Publication Timer + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +int +PublicationCallBackTimer(ORTEDomain *d,void *vcstWriter) { + CSTWriter *cstWriter=(CSTWriter*)vcstWriter; + ORTEPublProp *pp; + ORTESendInfo info; + + pp=(ORTEPublProp*)cstWriter->objectEntryOID->attributes; + info.status=NEED_DATA; + info.topic=pp->topic; + info.type=pp->typeName; + info.senderGUID=cstWriter->objectEntryOID->guid; + cstWriter->objectEntryOID->sendCallBack(&info, + cstWriter->objectEntryOID->instance, + cstWriter->objectEntryOID->callBackParam); + CSTWriterTryDestroyBestEffortIssue(cstWriter); + if (cstWriter->csChangesCountersendQueueSize) { + ORTEPublicationSendLocked(cstWriter); + } + eventAdd(d, + cstWriter->objectEntryOID->objectEntryAID, + &cstWriter->objectEntryOID->sendCallBackDelayTimer, + 0, + "PublicationCallBackTimer", + PublicationCallBackTimer, + &cstWriter->lock, + cstWriter, + &cstWriter->objectEntryOID->sendCallBackDelay); + return 0; +} diff --git a/orte/liborte/ORTESubscription.c b/orte/liborte/ORTESubscription.c new file mode 100644 index 0000000..12408c3 --- /dev/null +++ b/orte/liborte/ORTESubscription.c @@ -0,0 +1,215 @@ +/* + * $Id: ORTESubscription.c,v 0.0.0.1 2003/11/21 + * + * DEBUG: section 33 Functions working over subscription + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +GAVL_CUST_NODE_INT_IMP(SubscriptionList, + PSEntry, ObjectEntryOID, GUID_RTPS, + subscriptions, psNode, guid, gavl_cmp_guid); + +/*****************************************************************************/ +ORTESubscription * +ORTESubscriptionCreate(ORTEDomain *d,SubscriptionMode mode,SubscriptionType sType, + char *topic,char *typeName,void *instance,NtpTime *deadline, + NtpTime *minimumSeparation,ORTERecvCallBack recvCallBack, + void *recvCallBackParam) { + GUID_RTPS guid; + CSTReader *cstReader; + CSTReaderParams cstReaderParams; + ORTESubsProp *sp; + ObjectEntryOID *objectEntryOID; + CSChange *csChange; + TypeNode *typeNode; + + cstReader=(CSTReader*)MALLOC(sizeof(CSTReader)); + if (!cstReader) return NULL; + pthread_rwlock_wrlock(&d->objectEntry.objRootLock); + pthread_rwlock_wrlock(&d->objectEntry.htimRootLock); + pthread_rwlock_rdlock(&d->typeEntry.lock); + if (!(typeNode=ORTEType_find(&d->typeEntry,&typeName))) { + pthread_rwlock_unlock(&d->typeEntry.lock); + pthread_rwlock_unlock(&d->objectEntry.objRootLock); + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + printf("before call ORTESubscriptionCreateBestEffort is necessary to register \n\ + ser./deser. function for a given typeName!!!\n"); + return NULL; + } + pthread_rwlock_wrlock(&d->subscriptions.lock); + //generate new guid of publisher + d->subscriptions.counter++; + guid.hid=d->guid.hid;guid.aid=d->guid.aid; + guid.oid=(d->subscriptions.counter<<8)|OID_SUBSCRIPTION; + sp=(ORTESubsProp*)MALLOC(sizeof(ORTESubsProp)); + memcpy(sp,&d->subsPropDefault,sizeof(ORTESubsProp)); + strcpy(sp->topic,topic); + strcpy(sp->typeName,typeName); + sp->deadline=*deadline; + sp->minimumSeparation=*minimumSeparation; + switch (sType) { + case BEST_EFFORTS: + sp->reliabilityRequested=PID_VALUE_RELIABILITY_BEST_EFFORTS; + break; + case STRICT_RELIABLE: + sp->reliabilityRequested=PID_VALUE_RELIABILITY_STRICT; + break; + } + sp->mode=mode; + //insert object to structure objectEntry + objectEntryOID=objectEntryAdd(d,&guid,(void*)sp); + objectEntryOID->private=ORTE_TRUE; + objectEntryOID->instance=instance; + objectEntryOID->recvCallBack=recvCallBack; + objectEntryOID->callBackParam=recvCallBackParam; + //create writerSubscription + cstReaderParams.delayResponceTimeMin=zNtpTime; + cstReaderParams.delayResponceTimeMax=zNtpTime; + cstReaderParams.ACKMaxRetries=d->domainProp.baseProp.ACKMaxRetries; + cstReaderParams.repeatActiveQueryTime=iNtpTime; + cstReaderParams.fullAcknowledge=ORTE_FALSE; + CSTReaderInit(d,cstReader,objectEntryOID,guid.oid,&cstReaderParams, + &typeNode->typeRegister); + //insert cstWriter to list of subscriberes + CSTReader_insert(&d->subscriptions,cstReader); + //generate csChange for writerSubscriberes + pthread_rwlock_wrlock(&d->writerSubscriptions.lock); + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + parameterUpdateCSChangeFromSubscription(csChange,sp); + csChange->guid=guid; + csChange->alive=ORTE_TRUE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(d,&d->writerSubscriptions,csChange); + pthread_rwlock_unlock(&d->writerSubscriptions.lock); + pthread_rwlock_unlock(&d->subscriptions.lock); + pthread_rwlock_unlock(&d->typeEntry.lock); + pthread_rwlock_unlock(&d->objectEntry.objRootLock); + pthread_rwlock_unlock(&d->objectEntry.htimRootLock); + return cstReader; +} + +/*****************************************************************************/ +int +ORTESubscriptionDestroy(ORTESubscription *cstReader) { + CSChange *csChange; + + if (!cstReader) return -1; + //generate csChange for writerSubscriptions + pthread_rwlock_rdlock(&cstReader->domain->objectEntry.objRootLock); + pthread_rwlock_wrlock(&cstReader->domain->objectEntry.htimRootLock); + pthread_rwlock_wrlock(&cstReader->domain->writerSubscriptions.lock); + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + CSChangeAttributes_init_head(csChange); + csChange->guid=cstReader->guid; + csChange->alive=ORTE_FALSE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(cstReader->domain, + &cstReader->domain->writerSubscriptions, + csChange); + pthread_rwlock_unlock(&cstReader->domain->writerSubscriptions.lock); + pthread_rwlock_unlock(&cstReader->domain->objectEntry.htimRootLock); + pthread_rwlock_unlock(&cstReader->domain->objectEntry.objRootLock); + return 0; +} + + +/*****************************************************************************/ +int +ORTESubscriptionPropertiesGet(ORTESubscription *cstReader,ORTESubsProp *sp) { + pthread_rwlock_rdlock(&cstReader->domain->objectEntry.objRootLock); + pthread_rwlock_rdlock(&cstReader->lock); + *sp=*(ORTESubsProp*)cstReader->objectEntryOID->attributes; + pthread_rwlock_unlock(&cstReader->lock); + pthread_rwlock_unlock(&cstReader->domain->objectEntry.objRootLock); + return 0; +} + +/*****************************************************************************/ +int +ORTESubscriptionPropertiesSet(ORTESubscription *cstReader,ORTESubsProp *sp) { + CSChange *csChange; + + pthread_rwlock_rdlock(&cstReader->domain->objectEntry.objRootLock); + pthread_rwlock_wrlock(&cstReader->domain->objectEntry.htimRootLock); + pthread_rwlock_wrlock(&cstReader->domain->writerSubscriptions.lock); + pthread_rwlock_rdlock(&cstReader->lock); + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + parameterUpdateCSChangeFromSubscription(csChange,sp); + csChange->guid=cstReader->guid; + csChange->alive=ORTE_TRUE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(cstReader->domain, + &cstReader->domain->writerSubscriptions,csChange); + pthread_rwlock_unlock(&cstReader->lock); + pthread_rwlock_unlock(&cstReader->domain->subscriptions.lock); + pthread_rwlock_unlock(&cstReader->domain->objectEntry.htimRootLock); + pthread_rwlock_unlock(&cstReader->domain->objectEntry.objRootLock); + return 0; +} + +/*****************************************************************************/ +int +ORTESubscriptionWaitForPublications(ORTESubscription *cstReader,NtpTime wait, + u_int32_t retries,u_int32_t noPublications) { + return 0; +} + +/*****************************************************************************/ +int +ORTESubscriptionGetStatus(ORTESubscription *cstReader,ORTESubsStatus *status) { + return 0; +} + +/*****************************************************************************/ +int +ORTESubscriptionPull(ORTESubscription *cstReader) { + ORTESubsProp *sp; + ORTERecvInfo info; + NtpTime timeNext; + + if (!cstReader) return -1; + pthread_rwlock_rdlock(&cstReader->domain->objectEntry.objRootLock); + pthread_rwlock_wrlock(&cstReader->domain->objectEntry.htimRootLock); + pthread_rwlock_rdlock(&cstReader->domain->writerSubscriptions.lock); + pthread_rwlock_wrlock(&cstReader->lock); + sp=(ORTESubsProp*)cstReader->objectEntryOID->attributes; + if (sp->mode==PULLED) { + if (NtpTimeCmp( + getActualNtpTime(), + htimerUnicastCommon_get_expire(&cstReader->deadlineTimer))>=0) { + memset(&info,0,sizeof(info)); + info.status=DEADLINE; + info.topic=sp->topic; + info.type=sp->typeName; + cstReader->objectEntryOID->recvCallBack(&info, + cstReader->objectEntryOID->instance, + cstReader->objectEntryOID->callBackParam); + NtpTimeAdd(timeNext, + (getActualNtpTime()), + sp->deadline); + htimerUnicastCommon_set_expire(&cstReader->deadlineTimer,timeNext); + } + CSTReaderProcCSChangesIssue(cstReader->cstRemoteWriterSubscribed,ORTE_TRUE); + } + pthread_rwlock_unlock(&cstReader->lock); + pthread_rwlock_unlock(&cstReader->domain->writerSubscriptions.lock); + pthread_rwlock_unlock(&cstReader->domain->objectEntry.htimRootLock); + pthread_rwlock_unlock(&cstReader->domain->objectEntry.objRootLock); + return 0; +} diff --git a/orte/liborte/ORTEThreadUtils.c b/orte/liborte/ORTEThreadUtils.c new file mode 100644 index 0000000..d58a2a6 --- /dev/null +++ b/orte/liborte/ORTEThreadUtils.c @@ -0,0 +1,57 @@ +/* + * $Id: ORTEThreadUtils.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 25 Thread utility + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +void +ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,u_int16_t port) { + struct sockaddr_in des; + int i; + + des.sin_family = AF_INET; + des.sin_port = htons(port); //to receiving port + if (d->domainProp.IFCount) { + for(i=0;idomainProp.IFCount;i++) { + des.sin_addr.s_addr=htonl(d->domainProp.IFProp[i].ipAddress); + sock_sendto(sock,&i,1,&des,sizeof(des)); + debug(25,2) ("Sent wake up signal to: %s.%d\n", + IPAddressToString(ntohl(des.sin_addr.s_addr)), + port); + } + } else { + des.sin_addr.s_addr = inet_addr("127.0.0.1"); //local IPAddress + sock_sendto(sock,NULL,0,&des,sizeof(des)); + debug(25,2) ("Sent wake up signal to: %s.%d\n", + IPAddressToString(ntohl(des.sin_addr.s_addr)), + port); + } +} + +/*****************************************************************************/ +void +ORTEDomainWakeUpSendingThread(ObjectEntry *objectEntry) { + if (objectEntry->htimNeedWakeUp) + pthread_mutex_unlock(&objectEntry->htimSendMutex); +} + + + diff --git a/orte/liborte/ORTETypeRegister.c b/orte/liborte/ORTETypeRegister.c new file mode 100644 index 0000000..e12ac06 --- /dev/null +++ b/orte/liborte/ORTETypeRegister.c @@ -0,0 +1,81 @@ +/* + * $Id: ORTETypeRegister.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 26 Type register + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +GAVL_CUST_NODE_INT_IMP(ORTEType, TypeEntry, TypeNode, char *, + types, node, typeRegister.typeName, gavl_cmp_str) + + +/*****************************************************************************/ +Boolean +ORTETypeRegisterFind(ORTEDomain *d,char *typeName) { + Boolean result=ORTE_FALSE; + + if (!d) return ORTE_FALSE; //bat handle + pthread_rwlock_rdlock(&d->typeEntry.lock); + if (ORTEType_find(&d->typeEntry,&typeName)) + result=ORTE_TRUE; + pthread_rwlock_unlock(&d->typeEntry.lock); + return result; +} + +/*****************************************************************************/ +int +ORTETypeRegisterAdd(ORTEDomain *d,char *typeName,ORTETypeSerialize ts, + ORTETypeDeserialize ds,unsigned int gms) { + TypeNode *tn; + + if (!d) return -1; //bat handle + if (gms>d->domainProp.wireProp.userMaxSerDeserSize) return -2; + pthread_rwlock_wrlock(&d->typeEntry.lock); + tn=ORTEType_find(&d->typeEntry,&typeName); + if (!tn) { + tn=(TypeNode*)MALLOC(sizeof(TypeNode)); + tn->typeRegister.typeName=strdup(typeName); + ORTEType_insert(&d->typeEntry,tn); + } + tn->typeRegister.serialize=ts; + tn->typeRegister.deserialize=ds; + tn->typeRegister.getMaxSize=gms; + pthread_rwlock_unlock(&d->typeEntry.lock); + debug(26,3) ("ORTETypeRegisterAdd: registered type:%s\n",typeName); + return 0; +} + +/*****************************************************************************/ +int +ORTETypeRegisterDestroyAll(ORTEDomain *d) { + TypeNode *tn; + + if (!d) return -1; //bat handle + pthread_rwlock_wrlock(&d->typeEntry.lock); + while((tn=ORTEType_cut_first(&d->typeEntry))) { + FREE(tn); + } + pthread_rwlock_unlock(&d->typeEntry.lock); + return 0; +} + + + + + diff --git a/orte/liborte/ORTEVerbosity.c b/orte/liborte/ORTEVerbosity.c new file mode 100644 index 0000000..f8e2808 --- /dev/null +++ b/orte/liborte/ORTEVerbosity.c @@ -0,0 +1,39 @@ +/* + * $Id: ORTEVerbosity.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 27 Verbosity function + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +void +ORTEVerbositySetOptions(const char *options) { + debug_options(options); +} + +/*****************************************************************************/ +void +ORTEVerbositySetLogFile(const char *logfile) { + debug_open_log(logfile); +} + + + + + diff --git a/orte/liborte/RTPSAck.c b/orte/liborte/RTPSAck.c new file mode 100644 index 0000000..2608f39 --- /dev/null +++ b/orte/liborte/RTPSAck.c @@ -0,0 +1,174 @@ +/* + * $Id: RTPSAck.c,v 0.0.0.1 2003/10/07 + * + * DEBUG: section 47 RTPS message ACK + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +int32_t +RTPSAckCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len, + SequenceNumber *seqNumber, + ObjectId roid,ObjectId woid,Boolean f_bit) { + SequenceNumber sn_tmp; + + if (max_msg_len<28) return -1; + rtps_msg[0]=(u_int8_t)ACK; + rtps_msg[1]=ORTE_MY_MBO; + if (f_bit) rtps_msg[1]|=2; + *((ParameterLength*)(rtps_msg+2))=24; + conv_u32(&roid,0); + *((ObjectId*)(rtps_msg+4))=roid; + conv_u32(&woid,0); + *((ObjectId*)(rtps_msg+8))=woid; + SeqNumberInc(sn_tmp,*seqNumber); + *((SequenceNumber*)(rtps_msg+12))=sn_tmp; + *((u_int32_t*)(rtps_msg+20))=32; + *((u_int32_t*)(rtps_msg+24))=0; + return 28; +} + +/**********************************************************************************/ +void +RTPSAck(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) { + GUID_RTPS readerGUID; + CSTWriter *cstWriter=NULL; + CSTRemoteReader *cstRemoteReader; + CSChangeForReader *csChangeForReader; + StateMachineSend stateMachineSendNew; + ObjectId roid,woid; + SequenceNumber sn; + int8_t e_bit,f_bit; + + e_bit=rtps_msg[1] & 0x01; + f_bit=(rtps_msg[1] & 0x02)>>1; + roid=*((ObjectId*)(rtps_msg+4)); /* readerObjectId */ + conv_u32(&roid,0); + woid=*((ObjectId*)(rtps_msg+8)); /* writerObjectId */ + conv_u32(&woid,0); + sn=*((SequenceNumber*)(rtps_msg+12)); /* Bitmap - SN */ + conv_sn(&sn,e_bit); + readerGUID.hid=mi->sourceHostId; + readerGUID.aid=mi->sourceAppId; + readerGUID.oid=roid; + + debug(47,3) ("recv: RTPS ACK%c(0x%x) from 0x%x-0x%x\n", + f_bit ? 'F':'f', + woid,mi->sourceHostId,mi->sourceAppId); + + //Manager + if ((d->guid.aid & 0x03)==MANAGER) { + switch (woid) { + case OID_WRITE_APPSELF: + pthread_rwlock_wrlock(&d->writerApplicationSelf.lock); + cstWriter=&d->writerApplicationSelf; + readerGUID.hid=senderIPAddress; + readerGUID.aid=AID_UNKNOWN; + readerGUID.oid=roid; + break; + case OID_WRITE_MGR: + pthread_rwlock_wrlock(&d->writerManagers.lock); + cstWriter=&d->writerManagers; + break; + case OID_WRITE_APP: + pthread_rwlock_wrlock(&d->writerApplications.lock); + cstWriter=&d->writerApplications; + break; + } + } + //Application + if ((d->guid.aid & 0x03)==MANAGEDAPPLICATION) { + switch (roid) { + case OID_READ_APP: + case OID_READ_APPSELF: + pthread_rwlock_wrlock(&d->writerApplicationSelf.lock); + cstWriter=&d->writerApplicationSelf; + break; + case OID_READ_PUBL: + pthread_rwlock_wrlock(&d->writerPublications.lock); + cstWriter=&d->writerPublications; + break; + case OID_READ_SUBS: + pthread_rwlock_wrlock(&d->writerSubscriptions.lock); + cstWriter=&d->writerSubscriptions; + break; + } + } + if (!cstWriter) return; + cstRemoteReader=CSTRemoteReader_find(cstWriter,&readerGUID); + if (!cstRemoteReader) { + pthread_rwlock_unlock(&cstWriter->lock); + return; + } + stateMachineSendNew=NOTHNIGTOSEND; + gavl_cust_for_each(CSChangeForReader,cstRemoteReader,csChangeForReader) { + if (SeqNumberCmp(csChangeForReader->csChange->sn,sn)<0) { //ACK + if (csChangeForReader->commStateChFReader!=ACKNOWLEDGED) { + csChangeForReader->commStateChFReader=ACKNOWLEDGED; +// csChangeForReader->csChange->acknowledgedCounter++; + } + } else { //NACK + csChangeForReader->commStateChFReader=TOSEND; + stateMachineSendNew=MUSTSENDDATA; + } + } + if ((cstRemoteReader->commStateSend==NOTHNIGTOSEND) && + (stateMachineSendNew==MUSTSENDDATA)) { + cstRemoteReader->commStateSend=stateMachineSendNew; + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1, //metatraffic timer + "CSTWriterSendTimer", + CSTWriterSendTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &cstRemoteReader->cstWriter->params.delayResponceTime); + } + if ((cstRemoteReader->commStateSend==MUSTSENDDATA) && + (stateMachineSendNew==NOTHNIGTOSEND)) { + cstRemoteReader->commStateSend=stateMachineSendNew; + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1); + } + if ((!f_bit) && (cstRemoteReader->commStateSend==NOTHNIGTOSEND)) { + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1, //metatraffic timer + "CSTWriterSendTimer", + CSTWriterSendTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &cstRemoteReader->cstWriter->params.delayResponceTime); + } + pthread_rwlock_unlock(&cstWriter->lock); +} + + diff --git a/orte/liborte/RTPSCSTReader.c b/orte/liborte/RTPSCSTReader.c new file mode 100644 index 0000000..619f8e0 --- /dev/null +++ b/orte/liborte/RTPSCSTReader.c @@ -0,0 +1,326 @@ +/* + * $Id: RTPSCSTReader.c,v 0.0.0.1 2003/09/13 + * + * DEBUG: section 53 CSTReader + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +GAVL_CUST_NODE_INT_IMP(CSTReader, + CSTSubscriptions, CSTReader, GUID_RTPS, + cstReader, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_IMP(CSTRemoteWriter, + CSTReader, CSTRemoteWriter, GUID_RTPS, + cstRemoteWriter, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_IMP(CSChangeFromWriter, + CSTRemoteWriter, CSChangeFromWriter, SequenceNumber, + csChangeFromWriter, node, csChange->sn, gavl_cmp_sn); + +/*****************************************************************************/ +void +CSTReaderInit(ORTEDomain *d,CSTReader *cstReader,ObjectEntryOID *object, + ObjectId oid,CSTReaderParams *params,ORTETypeRegister *typeRegister) { + + debug(53,10) ("CSTReaderInit: start\n"); + //init values of cstReader + cstReader->guid.hid=object->objectEntryHID->hid; + cstReader->guid.aid=object->objectEntryAID->aid; + cstReader->guid.oid=oid; + cstReader->objectEntryOID=object; + memcpy(&cstReader->params,params,sizeof(CSTReaderParams)); + cstReader->strictReliableCounter=0; + cstReader->bestEffortsCounter=0; + cstReader->cstRemoteWriterCounter=0; + CSTReaderCSChange_init_head(cstReader); + CSTRemoteWriter_init_root_field(cstReader); + pthread_rwlock_init(&cstReader->lock,NULL); + cstReader->domain=d; + cstReader->typeRegister=typeRegister; + ul_htim_queue_init_detached(&cstReader->deadlineTimer.htim); + ul_htim_queue_init_detached(&cstReader->persistenceTimer.htim); + cstReader->cstRemoteWriterSubscribed=NULL; + if ((oid & 0x07) == OID_SUBSCRIPTION) { + ORTESubsProp *sp; + sp=(ORTESubsProp*)cstReader->objectEntryOID->attributes; + if (NtpTimeCmp(sp->deadline,zNtpTime)!=0) { + if (sp->mode==IMMEDIATE) { + eventAdd(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->deadlineTimer, + 0, //common timer + "CSTReaderDeadlineTimer", + CSTReaderDeadlineTimer, + &cstReader->lock, + cstReader, + &sp->deadline); + } + if (sp->mode==PULLED) { + NtpTime timeNext; + NtpTimeAdd(timeNext, + (getActualNtpTime()), + sp->deadline); + htimerUnicastCommon_set_expire(&cstReader->deadlineTimer,timeNext); + } + } + } + debug(53,4) ("CSTReaderInit: 0x%x-0x%x-0x%x\n", + cstReader->guid.hid, + cstReader->guid.aid, + cstReader->guid.oid); + debug(53,10) ("CSTReaderInit: finished\n"); +} + +/*****************************************************************************/ +void +CSTReaderDelete(ORTEDomain *d,CSTReader *cstReader) { + CSTRemoteWriter *cstRemoteWriter; + + debug(53,10)("CSTReaderDelete: start\n"); + debug(53,4) ("CSTReaderDelete: 0x%x-0x%x-0x%x\n", + cstReader->guid.hid, + cstReader->guid.aid, + cstReader->guid.oid); + //Destroy all cstRemoteReader connected on cstWriter + while((cstRemoteWriter=CSTRemoteWriter_first(cstReader))) { + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + } + eventDetach(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->deadlineTimer, + 0); + eventDetach(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->persistenceTimer, + 0); //common timer + pthread_rwlock_destroy(&cstReader->lock); + debug(53,10) ("CSTReaderDelete: finished\n"); +} + +/*****************************************************************************/ +CSTRemoteWriter * +CSTReaderAddRemoteWriter(ORTEDomain *d,CSTReader *cstReader,ObjectEntryOID *object, + ObjectId oid) { + CSTRemoteWriter *cstRemoteWriter; + + cstReader->cstRemoteWriterCounter++; + cstRemoteWriter=(CSTRemoteWriter*)MALLOC(sizeof(CSTRemoteWriter)); + cstRemoteWriter->guid.hid=object->objectEntryHID->hid; + cstRemoteWriter->guid.aid=object->objectEntryAID->aid; + cstRemoteWriter->guid.oid=oid; + cstRemoteWriter->objectEntryOID=object; + cstRemoteWriter->cstReader=cstReader; + cstRemoteWriter->csChangesCounter=0; + cstRemoteWriter->ACKRetriesCounter=0; + cstRemoteWriter->commStateACK=WAITING; + CSChangeFromWriter_init_root_field(cstRemoteWriter); + SEQUENCE_NUMBER_NONE(cstRemoteWriter->sn); + SEQUENCE_NUMBER_NONE(cstRemoteWriter->firstSN); + SEQUENCE_NUMBER_NONE(cstRemoteWriter->lastSN); + ul_htim_queue_init_detached(&cstRemoteWriter->delayResponceTimer.htim); + ul_htim_queue_init_detached(&cstRemoteWriter->repeatActiveQueryTimer.htim); + CSTRemoteWriter_insert(cstReader,cstRemoteWriter); + //add event for repeatActiveTime + if (NtpTimeCmp(cstReader->params.repeatActiveQueryTime,iNtpTime)!=0) { + eventAdd(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1, //metatraffic timer + "CSTReaderQueryTimer", + CSTReaderQueryTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + NULL); + } + if ((cstReader->guid.oid & 0x07)==OID_SUBSCRIPTION) { + ORTEPublProp *pp=(ORTEPublProp*)object->attributes; + if ((pp->reliabilityOffered & PID_VALUE_RELIABILITY_STRICT)!=0) + cstReader->strictReliableCounter++; + else { + if ((pp->reliabilityOffered & PID_VALUE_RELIABILITY_BEST_EFFORTS)!=0) + cstReader->bestEffortsCounter++; + } + } + debug(53,4) ("CSTReaderAddRemoteWriter: 0x%x-0x%x-0x%x\n", + cstRemoteWriter->guid.hid, + cstRemoteWriter->guid.aid, + cstRemoteWriter->guid.oid); + return cstRemoteWriter; +} + +/*****************************************************************************/ +void +CSTReaderDestroyRemoteWriter(ORTEDomain *d,CSTRemoteWriter *cstRemoteWriter) { + CSChangeFromWriter *csChangeFromWriter; + + if (!cstRemoteWriter) return; + cstRemoteWriter->cstReader->cstRemoteWriterCounter--; + debug(53,4) ("CSTReaderDestroyRemoteWriter: 0x%x-0x%x-0x%x\n", + cstRemoteWriter->guid.hid, + cstRemoteWriter->guid.aid, + cstRemoteWriter->guid.oid); + if ((cstRemoteWriter->cstReader->guid.oid & 0x07)==OID_SUBSCRIPTION) { + ORTEPublProp *pp; + pp=(ORTEPublProp*)cstRemoteWriter->objectEntryOID->attributes; + if ((pp->reliabilityOffered & PID_VALUE_RELIABILITY_STRICT)!=0) + cstRemoteWriter->cstReader->strictReliableCounter++; + else { + if ((pp->reliabilityOffered & PID_VALUE_RELIABILITY_BEST_EFFORTS)!=0) + cstRemoteWriter->cstReader->bestEffortsCounter++; + } + } + if (cstRemoteWriter->cstReader->cstRemoteWriterSubscribed==cstRemoteWriter) + cstRemoteWriter->cstReader->cstRemoteWriterSubscribed=NULL; + while((csChangeFromWriter=CSChangeFromWriter_first(cstRemoteWriter))) { + CSTReaderDestroyCSChangeFromWriter(cstRemoteWriter, + csChangeFromWriter,ORTE_FALSE); + } + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1); //metatraffic timer + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); //metatraffic timer + CSTRemoteWriter_delete(cstRemoteWriter->cstReader,cstRemoteWriter); + FREE(cstRemoteWriter); +} + +/*****************************************************************************/ +void +CSTReaderAddCSChange(CSTRemoteWriter *cstRemoteWriter,CSChange *csChange) { + CSChangeFromWriter *csChangeFromWriter; + + cstRemoteWriter->csChangesCounter++; + cstRemoteWriter->ACKRetriesCounter=0; + csChangeFromWriter=(CSChangeFromWriter*)MALLOC(sizeof(CSChangeFromWriter)); + csChangeFromWriter->csChange=csChange; + csChangeFromWriter->commStateChFWriter=RECEIVED; + CSChangeFromWriter_insert(cstRemoteWriter,csChangeFromWriter); + CSTReaderCSChange_insert(cstRemoteWriter->cstReader,csChange); +} + +/*****************************************************************************/ +void +CSTReaderDestroyCSChangeFromWriter(CSTRemoteWriter *cstRemoteWriter, + CSChangeFromWriter *csChangeFromWriter,Boolean keepCSChange) { + + if ((!csChangeFromWriter) || (!cstRemoteWriter)) return; + CSTReaderCSChange_delete(cstRemoteWriter->cstReader, + csChangeFromWriter->csChange); + if (!keepCSChange) { + if (csChangeFromWriter->csChange->cdrStream.buffer) + FREE(csChangeFromWriter->csChange->cdrStream.buffer); + parameterDelete(csChangeFromWriter->csChange); + FREE(csChangeFromWriter->csChange); + } + CSChangeFromWriter_delete(cstRemoteWriter,csChangeFromWriter); + FREE(csChangeFromWriter); + cstRemoteWriter->csChangesCounter--; +} + +/*****************************************************************************/ +void +CSTReaderDestroyCSChange(CSTRemoteWriter *cstRemoteWriter,SequenceNumber *sn, + Boolean keepCSChange) { + CSChangeFromWriter *csChangeFromWriter; + + csChangeFromWriter=CSChangeFromWriter_find(cstRemoteWriter,sn); + if (csChangeFromWriter) { + CSTReaderDestroyCSChangeFromWriter(cstRemoteWriter, + csChangeFromWriter,keepCSChange); + } +} + +/*****************************************************************************/ +void +CSTReaderSetupState(CSTRemoteWriter *cstRemoteWriter) { + + if (CSChangeFromWriter_first(cstRemoteWriter)==NULL) { //no csChanges + if (SeqNumberCmp(cstRemoteWriter->sn,cstRemoteWriter->lastSN)!=0) { + if (cstRemoteWriter->commStateACK!=WAITING) { + cstRemoteWriter->commStateACK=PULLING; + cstRemoteWriter->ACKRetriesCounter=0; + eventDetach(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); //metatraffic timer + eventDetach(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1); //metatraffic timer + eventAdd(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1, //metatraffic timer + "CSTReaderResponceTimer", + CSTReaderResponceTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + &cstRemoteWriter->cstReader->params.delayResponceTimeMin); + } + } else { + if (cstRemoteWriter->commStateACK==PULLING) { + cstRemoteWriter->commStateACK=WAITING; + cstRemoteWriter->ACKRetriesCounter=0; + eventDetach(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1); //metatraffic timer + if (NtpTimeCmp(cstRemoteWriter->cstReader->params.repeatActiveQueryTime, + iNtpTime)!=0) { + eventDetach(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); //metatraffic timer + eventAdd(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1, //metatraffic timer + "CSTReaderQueryTimer", + CSTReaderQueryTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + &cstRemoteWriter->cstReader->params.repeatActiveQueryTime); + } + } + } + } else { + if (cstRemoteWriter->commStateACK==WAITING) { + cstRemoteWriter->commStateACK=PULLING; + cstRemoteWriter->ACKRetriesCounter=0; + eventDetach(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); //metatraffic timer + eventDetach(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1); //metatraffic timer + eventAdd(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1, //metatraffic timer + "CSTReaderResponceTimer", + CSTReaderResponceTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + &cstRemoteWriter->cstReader->params.delayResponceTimeMin); + } + } +} diff --git a/orte/liborte/RTPSCSTReaderProc.c b/orte/liborte/RTPSCSTReaderProc.c new file mode 100644 index 0000000..54767db --- /dev/null +++ b/orte/liborte/RTPSCSTReaderProc.c @@ -0,0 +1,242 @@ +/* + * $Id: RTPSCSTReaderProc.c,v 0.0.0.1 2003/09/13 + * + * DEBUG: section 54 CSChanges processing + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +void +CSTReaderProcCSChangesManager(ORTEDomain *d,CSTRemoteWriter *cstRemoteWriter, + CSChangeFromWriter *csChangeFromWriter) { + CSChange *csChange; + ObjectEntryOID *objectEntryOID; + + + csChange=csChangeFromWriter->csChange; + objectEntryOID=objectEntryFind(d,&csChangeFromWriter->csChange->guid); + if (!objectEntryOID) return; + if (!csChange->alive) { + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + eventAdd(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0, + "ExpirationTimer", + objectEntryExpirationTimer, + NULL, + objectEntryOID, + NULL); + return; + } + switch (csChange->guid.aid & 0x03) { + case MANAGER: + //update parameters of object + parameterUpdateApplication(csChange,(AppParams*)objectEntryOID->attributes); + //copy csChange to writerManagers + CSTReaderDestroyCSChangeFromWriter(cstRemoteWriter, + csChangeFromWriter, + ORTE_TRUE); + pthread_rwlock_wrlock(&d->writerManagers.lock); + CSTWriterAddCSChange(d,&d->writerManagers,csChange); + pthread_rwlock_unlock(&d->writerManagers.lock); + break; + case MANAGEDAPPLICATION: + //update parameters of object + parameterUpdateApplication(csChange,(AppParams*)objectEntryOID->attributes); + //changes can make only local Apps + if (cstRemoteWriter->objectEntryOID->appMOM) { + CSTReaderDestroyCSChangeFromWriter(cstRemoteWriter, + csChangeFromWriter, + ORTE_TRUE); + pthread_rwlock_wrlock(&d->writerApplications.lock); + CSTWriterAddCSChange(d,&d->writerApplications,csChange); + pthread_rwlock_unlock(&d->writerApplications.lock); + } + break; + } +} + +/*****************************************************************************/ +void +CSTReaderProcCSChangesApp(ORTEDomain *d,CSTRemoteWriter *cstRemoteWriter, + CSChangeFromWriter *csChangeFromWriter) { + CSChange *csChange; + ObjectEntryOID *objectEntryOID; + + csChange=csChangeFromWriter->csChange; + objectEntryOID=objectEntryFind(d,&csChangeFromWriter->csChange->guid); + if (!objectEntryOID) return; + if (!csChange->alive) { + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + eventAdd(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0, + "ExpirationTimer", + objectEntryExpirationTimer, + NULL, + objectEntryOID, + NULL); + return; + } + switch (csChangeFromWriter->csChange->guid.oid & 0x07) { + case OID_APPLICATION: + break; + case OID_PUBLICATION: + break; + case OID_SUBSCRIPTION: + break; + } +} + +/*****************************************************************************/ +void +CSTReaderProcCSChanges(ORTEDomain *d,CSTRemoteWriter *cstRemoteWriter) { + CSChangeFromWriter *csChangeFromWriter; + SequenceNumber snNext; + + debug(54,10) ("CSTReaderProcCSChanges: start\n"); + if (!cstRemoteWriter) return; + while (1) { + csChangeFromWriter=CSChangeFromWriter_first(cstRemoteWriter); + if (!csChangeFromWriter) break; + if (SeqNumberCmp(csChangeFromWriter->csChange->sn, + cstRemoteWriter->firstSN)>=0) { + SeqNumberInc(snNext,cstRemoteWriter->sn); + debug(54,10) ("CSTReaderProcCSChanges: processing sn:%u,Change sn:%u\n",snNext.low, + csChangeFromWriter->csChange->sn.low); + if ((SeqNumberCmp(csChangeFromWriter->csChange->sn,snNext)==0) && + (csChangeFromWriter->commStateChFWriter==RECEIVED)) { + if (SeqNumberCmp(csChangeFromWriter->csChange->gapSN,noneSN)==0) { + if ((d->guid.aid & 0x03)==MANAGER) + CSTReaderProcCSChangesManager(d,cstRemoteWriter, + csChangeFromWriter); + if ((d->guid.aid & 0x03)==MANAGEDAPPLICATION) + CSTReaderProcCSChangesApp(d,cstRemoteWriter, + csChangeFromWriter); + SeqNumberInc(cstRemoteWriter->sn,cstRemoteWriter->sn); + } else { + //GAP + SeqNumberAdd(cstRemoteWriter->sn, + cstRemoteWriter->sn, + csChangeFromWriter->csChange->gapSN); + } + CSTReaderDestroyCSChange(cstRemoteWriter, //note:csChange can be coped to another CSTWriter!!! + &snNext,ORTE_FALSE); + } else + break; + } else { + CSTReaderDestroyCSChangeFromWriter(cstRemoteWriter, + csChangeFromWriter,ORTE_FALSE); + } + } + CSTReaderSetupState(cstRemoteWriter); + debug(54,10) ("CSTReaderProcCSChanges: finished\n"); +} + +/*****************************************************************************/ +void +CSTReaderProcCSChangesIssue(CSTRemoteWriter *cstRemoteWriter,Boolean pullCalled) { + ORTESubsProp *sp; + CSChangeFromWriter *csChangeFromWriter; + ORTERecvInfo info; + + debug(54,10) ("CSTReaderProcIssue: start\n"); + if (cstRemoteWriter==NULL) return; + sp=(ORTESubsProp*)cstRemoteWriter->cstReader->objectEntryOID->attributes; + //Strict + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_STRICT)!=0) { + } else { + //Best Effort + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_BEST_EFFORTS)!=0) { + if ((cstRemoteWriter!= + cstRemoteWriter->cstReader->cstRemoteWriterSubscribed) || + (cstRemoteWriter->cstReader->cstRemoteWriterSubscribed==NULL)) + return; + if ((sp->mode==PULLED) && (pullCalled==ORTE_FALSE)) return; + while((csChangeFromWriter=CSChangeFromWriter_first(cstRemoteWriter))) { + ObjectEntryOID *objectEntryOID; + objectEntryOID=cstRemoteWriter->cstReader->objectEntryOID; + if (objectEntryOID->recvCallBack) { + //deserialization routine + if (cstRemoteWriter->cstReader->typeRegister->deserialize) { + cstRemoteWriter->cstReader->typeRegister->deserialize( + &csChangeFromWriter->csChange->cdrStream, + objectEntryOID->instance); + } else { + int length=csChangeFromWriter->csChange->cdrStream.length; + if (cstRemoteWriter->cstReader->typeRegister->getMaxSizecstReader->typeRegister->getMaxSize; + //no deserialization -> memcpy + memcpy(objectEntryOID->instance, + csChangeFromWriter->csChange->cdrStream.buffer, + length); + } + info.status=NEW_DATA; + info.topic=sp->topic; + info.type=sp->typeName; + info.senderGUID=csChangeFromWriter->csChange->guid; + info.localTimeReceived=csChangeFromWriter->csChange->localTimeReceived; + info.remoteTimePublished=csChangeFromWriter->csChange->remoteTimePublished; + info.sn=csChangeFromWriter->csChange->sn; + objectEntryOID->recvCallBack(&info, + objectEntryOID->instance, + objectEntryOID->callBackParam); + if (sp->mode==IMMEDIATE) { + //setup new time for deadline timer + eventDetach(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->cstReader->objectEntryOID->objectEntryAID, + &cstRemoteWriter->cstReader->deadlineTimer, + 0); + eventAdd(cstRemoteWriter->cstReader->domain, + cstRemoteWriter->cstReader->objectEntryOID->objectEntryAID, + &cstRemoteWriter->cstReader->deadlineTimer, + 0, //common timer + "CSTReaderDeadlineTimer", + CSTReaderDeadlineTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter->cstReader, + &sp->deadline); + } + if (sp->mode==PULLED) { + NtpTime timeNext; + NtpTimeAdd(timeNext, + (getActualNtpTime()), + sp->deadline); + htimerUnicastCommon_set_expire(&cstRemoteWriter-> + cstReader->deadlineTimer,timeNext); + } + } + CSTReaderDestroyCSChangeFromWriter( + cstRemoteWriter, + csChangeFromWriter, + ORTE_FALSE); + } + } + } + CSTReaderSetupState(cstRemoteWriter); + debug(54,10) ("CSTReaderProcIssue: finished\n"); +} diff --git a/orte/liborte/RTPSCSTReaderTimer.c b/orte/liborte/RTPSCSTReaderTimer.c new file mode 100644 index 0000000..36de740 --- /dev/null +++ b/orte/liborte/RTPSCSTReaderTimer.c @@ -0,0 +1,262 @@ +/* + * $Id: RTPSCSTReaderTimer.c,v 0.0.0.1 2003/11/03 + * + * DEBUG: section 55 CSTReader timer functions + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +int +CSTReaderResponceTimer(ORTEDomain *d,void *vcstRemoteWriter) { + CSTRemoteWriter *cstRemoteWriter=(CSTRemoteWriter*)vcstRemoteWriter; + int32_t len; + + if (!d->mbSend.containsInfoReply) { + len=RTPSInfoREPLYCreate( + d->mbSend.cdrStream.bufferPtr, + getMaxMessageLength(d), + IPADDRESS_INVALID, + ((AppParams*)cstRemoteWriter->cstReader->objectEntryOID->attributes)->metatrafficUnicastPort); + if (len<0) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + d->mbSend.containsInfoReply=ORTE_TRUE; + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + debug(55,3) ("sent: RTPS_InfoREPLY(0x%x) to 0x%x-0x%x\n", + cstRemoteWriter->cstReader->guid.oid, + cstRemoteWriter->guid.hid, + cstRemoteWriter->guid.aid); + } + len=RTPSAckCreate( + d->mbSend.cdrStream.bufferPtr, + getMaxMessageLength(d), + &cstRemoteWriter->sn, + cstRemoteWriter->cstReader->guid.oid, + cstRemoteWriter->guid.oid, + ORTE_TRUE); + if (len<0) { + //not enought space in sending buffer + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + debug(55,3) ("sent: RTPS_ACKF(0x%x) to 0x%x-0x%x\n", + cstRemoteWriter->cstReader->guid.oid, + cstRemoteWriter->guid.hid, + cstRemoteWriter->guid.aid); + if (cstRemoteWriter->commStateACK==PULLING) { + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1); //metatraffic timer + if (cstRemoteWriter->ACKRetriesCounter< + cstRemoteWriter->cstReader->params.ACKMaxRetries) { + cstRemoteWriter->ACKRetriesCounter++; + eventAdd(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1, //metatraffic timer + "CSTReaderResponceTimer", + CSTReaderResponceTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + &cstRemoteWriter->cstReader->params.delayResponceTimeMin); + } else { + debug(55,3) ("sent: maxRetries ritch upper level (%d).\n", + cstRemoteWriter->cstReader->params.ACKMaxRetries); + } + } + if (cstRemoteWriter->commStateACK==ACKPENDING) { + cstRemoteWriter->commStateACK=WAITING; + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); //metatraffic timer + if (NtpTimeCmp(cstRemoteWriter->cstReader-> + params.repeatActiveQueryTime,iNtpTime)!=0) { + eventAdd(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1, //metatraffic timer + "CSTReaderQueryTimer", + CSTReaderQueryTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + &cstRemoteWriter->cstReader->params.repeatActiveQueryTime); + } + } + return 0; +} + +/*****************************************************************************/ +int +CSTReaderQueryTimer(ORTEDomain *d,void *vcstRemoteWriter) { + CSTRemoteWriter *cstRemoteWriter=(CSTRemoteWriter*)vcstRemoteWriter; + int32_t len; + + if (!d->mbSend.containsInfoReply) { + len=RTPSInfoREPLYCreate( + d->mbSend.cdrStream.bufferPtr, + getMaxMessageLength(d), + IPADDRESS_INVALID, + ((AppParams*)cstRemoteWriter->cstReader->objectEntryOID->attributes)->metatrafficUnicastPort); + if (len<0) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + d->mbSend.containsInfoReply=ORTE_TRUE; + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + debug(55,3) ("sent: RTPS_InfoREPLY(0x%x) to 0x%x-0x%x\n", + cstRemoteWriter->cstReader->guid.oid, + cstRemoteWriter->guid.hid, + cstRemoteWriter->guid.aid); + } + len=RTPSAckCreate( + d->mbSend.cdrStream.bufferPtr, + getMaxMessageLength(d), + &cstRemoteWriter->sn, + cstRemoteWriter->cstReader->guid.oid, + cstRemoteWriter->guid.oid, + ORTE_FALSE); + if (len<0) { + //not enought space in sending buffer + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + debug(55,3) ("sent: RTPS_ACKf(0x%x) to 0x%x-0x%x\n", + cstRemoteWriter->cstReader->guid.oid, + cstRemoteWriter->guid.hid, + cstRemoteWriter->guid.aid); + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); //metatraffic timer + eventAdd(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1, //metatraffic timer + "CSTReaderQueryTimer", + CSTReaderQueryTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + &cstRemoteWriter->cstReader->params.repeatActiveQueryTime); + return 0; +} + + +/*****************************************************************************/ +int +CSTReaderDeadlineTimer(ORTEDomain *d,void *vcstReader) { + CSTReader *cstReader=(CSTReader*)vcstReader; + ORTESubsProp *sp; + ORTERecvInfo info; + + sp=(ORTESubsProp*)cstReader->objectEntryOID->attributes; + memset(&info,0,sizeof(info)); + info.status=DEADLINE; + info.topic=sp->topic; + info.type=sp->typeName; + cstReader->objectEntryOID->recvCallBack(&info, + cstReader->objectEntryOID->instance, + cstReader->objectEntryOID->callBackParam); + eventDetach(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->deadlineTimer, + 0); + eventAdd(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->deadlineTimer, + 0, //common timer + "CSTReaderDeadlineTimer", + CSTReaderDeadlineTimer, + &cstReader->lock, + cstReader, + &sp->deadline); + return 0; +} + +/*****************************************************************************/ +int +CSTReaderPersistenceTimer(ORTEDomain *d,void *vcstReader) { + CSTReader *cstReader=(CSTReader*)vcstReader; + CSTRemoteWriter *cstRemoteWriter; + CSChangeFromWriter *csChangeFromWriter; + ORTESubsProp *sp; + ORTEPublProp *pp; + int32_t strength; + + if (cstReader->cstRemoteWriterSubscribed!=NULL) { + //keep only one csChange (last) + while (cstReader->cstRemoteWriterSubscribed->csChangesCounter>1) { + csChangeFromWriter= + CSChangeFromWriter_first(cstReader->cstRemoteWriterSubscribed); + if (csChangeFromWriter) { + CSTReaderDestroyCSChangeFromWriter( + cstReader->cstRemoteWriterSubscribed, + csChangeFromWriter, + ORTE_FALSE); + } + } + } + cstReader->cstRemoteWriterSubscribed=NULL; + sp=(ORTESubsProp*)cstReader->objectEntryOID->attributes; + strength=0; + gavl_cust_for_each(CSTRemoteWriter,cstReader,cstRemoteWriter) { + pp=(ORTEPublProp*)cstRemoteWriter->objectEntryOID->attributes; + csChangeFromWriter=CSChangeFromWriter_last(cstRemoteWriter); + if ((pp->strength>strength) && (csChangeFromWriter!=NULL)){ + NtpTime persistence,persistenceExpired,actTime; + actTime=getActualNtpTime(); + NtpTimeAdd(persistenceExpired, + csChangeFromWriter->csChange->localTimeReceived, + pp->persistence); + if (NtpTimeCmp(persistenceExpired,actTime)>0) { + NtpTimeSub(persistence, + persistenceExpired, + actTime); + eventDetach(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->persistenceTimer, + 0); //common timer + eventAdd(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->persistenceTimer, + 0, //common timer + "CSTReaderPersistenceTimer", + CSTReaderPersistenceTimer, + &cstReader->lock, + cstReader, + &persistence); + cstReader->cstRemoteWriterSubscribed=cstRemoteWriter; + } + } + } + if ((cstReader->cstRemoteWriterSubscribed!=NULL) && + (sp->mode==IMMEDIATE)) { + CSTReaderProcCSChangesIssue( + cstReader->cstRemoteWriterSubscribed,ORTE_FALSE); + } + return 0; +} diff --git a/orte/liborte/RTPSCSTWriter.c b/orte/liborte/RTPSCSTWriter.c new file mode 100644 index 0000000..5f20ded --- /dev/null +++ b/orte/liborte/RTPSCSTWriter.c @@ -0,0 +1,452 @@ +/* + * $Id: RTPSCSTWriter.c,v 0.0.0.1 2003/09/13 + * + * DEBUG: section 51 CSTWriter + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +GAVL_CUST_NODE_INT_IMP(CSTWriter, + CSTPublications, CSTWriter, GUID_RTPS, + cstWriter, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_IMP(CSTRemoteReader, + CSTWriter, CSTRemoteReader, GUID_RTPS, + cstRemoteReader, node, guid, gavl_cmp_guid); +GAVL_CUST_NODE_INT_IMP(CSChangeForReader, + CSTRemoteReader, CSChangeForReader, SequenceNumber, + csChangeForReader, node, csChange->sn, gavl_cmp_sn); + +/*****************************************************************************/ +void +CSTWriterInit(ORTEDomain *d,CSTWriter *cstWriter,ObjectEntryOID *object, + ObjectId oid,CSTWriterParams *params,ORTETypeRegister *typeRegister) { + + debug(51,10) ("CSTWriterInit: start\n"); + //init values of cstwriter + cstWriter->guid.hid=object->objectEntryHID->hid; + cstWriter->guid.aid=object->objectEntryAID->aid; + cstWriter->guid.oid=oid; + cstWriter->objectEntryOID=object; + memcpy(&cstWriter->params,params,sizeof(CSTWriterParams)); + cstWriter->strictReliableCounter=0; + cstWriter->bestEffortsCounter=0; + cstWriter->csChangesCounter=0; + cstWriter->cstRemoteReaderCounter=0; + SEQUENCE_NUMBER_NONE(cstWriter->firstSN); + SEQUENCE_NUMBER_NONE(cstWriter->lastSN); + CSTWriterCSChange_init_head(cstWriter); + CSTRemoteReader_init_root_field(cstWriter); + pthread_rwlock_init(&cstWriter->lock,NULL); + ul_htim_queue_init_detached(&cstWriter->refreshPeriodTimer.htim); + cstWriter->domain=d; + cstWriter->typeRegister=typeRegister; + if ((cstWriter->guid.oid & 0x07)==OID_PUBLICATION) { + pthread_mutex_init(&cstWriter->mutexCSChangeDestroyed,NULL); + } + //add event for refresh + if (NtpTimeCmp(cstWriter->params.refreshPeriod,iNtpTime)!=0) { + CSTWriterRefreshTimer(d,(void*)cstWriter); + } + debug(51,4) ("CSTWriterInit: 0x%x-0x%x-0x%x\n", + cstWriter->guid.hid, + cstWriter->guid.aid, + cstWriter->guid.oid); + debug(51,10) ("CSTWriterInit: finished\n"); +} + +/*****************************************************************************/ +void +CSTWriterDelete(ORTEDomain *d,CSTWriter *cstWriter) { + CSTRemoteReader *cstRemoteReader; + CSChange *csChange; + + debug(51,10) ("CSTWriterDelete: start\n"); + + debug(51,4) ("CSTWriterDelete: 0x%x-0x%x-0x%x\n", + cstWriter->guid.hid, + cstWriter->guid.aid, + cstWriter->guid.oid); + //Destroy all cstRemoteReader connected on cstWriter + while((cstRemoteReader=CSTRemoteReader_first(cstWriter))) { + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + } + //Destroy all csChnages connected on cstWriter + while((csChange=CSTWriterCSChange_cut_first(cstWriter))) { + parameterDelete(csChange); + FREE(csChange); + } + eventDetach(d, + cstWriter->objectEntryOID->objectEntryAID, + &cstWriter->refreshPeriodTimer, + 0); + if ((cstWriter->guid.oid & 0x07)==OID_PUBLICATION) { + pthread_mutex_destroy(&cstWriter->mutexCSChangeDestroyed); + } + pthread_rwlock_destroy(&cstWriter->lock); + debug(51,10) ("CSTWriterDelete: finished\n"); +} + +/*****************************************************************************/ +void +CSTWriterAddRemoteReader(ORTEDomain *d,CSTWriter *cstWriter,ObjectEntryOID *object, + ObjectId oid) { + CSTRemoteReader *cstRemoteReader; + CSChangeForReader *csChangeForReader; + CSChange *csChange=NULL; + + cstWriter->cstRemoteReaderCounter++; + cstRemoteReader=(CSTRemoteReader*)MALLOC(sizeof(CSTRemoteReader)); + cstRemoteReader->guid.hid=object->objectEntryHID->hid; + cstRemoteReader->guid.aid=object->objectEntryAID->aid; + cstRemoteReader->guid.oid=oid; + cstRemoteReader->objectEntryOID=object; + cstRemoteReader->cstWriter=cstWriter; + CSChangeForReader_init_root_field(cstRemoteReader); + cstRemoteReader->commStateHB=MAYSENDHB; + cstRemoteReader->commStateSend=NOTHNIGTOSEND; + cstRemoteReader->HBRetriesCounter=0; + cstRemoteReader->csChangesCounter=0; + NTPTIME_ZERO(cstRemoteReader->lastSentIssueTime); + ul_htim_queue_init_detached(&cstRemoteReader->delayResponceTimer.htim); + ul_htim_queue_init_detached(&cstRemoteReader->repeatAnnounceTimer.htim); + //insert remote reader + CSTRemoteReader_insert(cstWriter,cstRemoteReader); + //copy all csChanges (not for publication) + if ((cstWriter->guid.oid & 0x07)!=OID_PUBLICATION) { + ul_list_for_each(CSTWriterCSChange,cstWriter,csChange) { + csChange->remoteReaderCount++; + cstRemoteReader->csChangesCounter++; + csChangeForReader=(CSChangeForReader*)MALLOC(sizeof(CSChangeForReader)); + csChangeForReader->commStateChFReader=TOSEND; + csChangeForReader->csChange=csChange; + ul_htim_queue_init_detached(&csChangeForReader->waitWhileDataUnderwayTimer.htim); + CSChangeForReader_insert(cstRemoteReader,csChangeForReader); + cstRemoteReader->commStateSend=MUSTSENDDATA; + } + if (cstRemoteReader->commStateSend==MUSTSENDDATA) { + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1, + "CSTWriterSendTimer", + CSTWriterSendTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &cstRemoteReader->cstWriter->params.delayResponceTime); + } + } else { + //Publication + ORTESubsProp *sp=(ORTESubsProp*)object->attributes; + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_STRICT)!=0) + cstWriter->strictReliableCounter++; + else { + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_BEST_EFFORTS)!=0) + cstWriter->bestEffortsCounter++; + } + } + debug(51,4) ("CSTWriterAddRemoteReader: 0x%x-0x%x-0x%x\n", + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid, + cstRemoteReader->guid.oid); +} + +/*****************************************************************************/ +void +CSTWriterDestroyRemoteReader(ORTEDomain *d,CSTRemoteReader *cstRemoteReader) { + CSChangeForReader *csChangeForReader; + + if (!cstRemoteReader) return; + cstRemoteReader->cstWriter->cstRemoteReaderCounter--; + debug(51,4) ("CSTWriterDestroyRemoteReader: 0x%x-0x%x-0x%x\n", + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid, + cstRemoteReader->guid.oid); + if ((cstRemoteReader->cstWriter->guid.oid & 0x07)==OID_PUBLICATION) { + ORTESubsProp *sp; + sp=(ORTESubsProp*)cstRemoteReader->objectEntryOID->attributes; + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_STRICT)!=0) + cstRemoteReader->cstWriter->strictReliableCounter--; + else { + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_BEST_EFFORTS)!=0) + cstRemoteReader->cstWriter->bestEffortsCounter--; + } + } + while((csChangeForReader=CSChangeForReader_first(cstRemoteReader))) { + CSTWriterDestroyCSChangeForReader(cstRemoteReader, + csChangeForReader,ORTE_TRUE); + } + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1); //metatraffic timer + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 2); //userdata timer + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->repeatAnnounceTimer, + 1); //metatraffic timer + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->repeatAnnounceTimer, + 2); //userdata timer + CSTRemoteReader_delete(cstRemoteReader->cstWriter,cstRemoteReader); + FREE(cstRemoteReader); +} + +/*****************************************************************************/ +void +CSTWriterMakeGAP(ORTEDomain *d,CSTWriter *cstWriter,GUID_RTPS *guid) { + CSChange *csChange,*csChange1; + + ul_list_for_each(CSTWriterCSChange,cstWriter,csChange) { + if ((!SeqNumberCmp(csChange->gapSN,noneSN)) && + (!gavl_cmp_guid(&csChange->guid,guid))) { //equal? (VAR) + //VAR->GAP - inc gap_sn_no + SeqNumberInc(csChange->gapSN,csChange->gapSN); + parameterDelete(csChange); + //is Gap in prior or next position? + csChange1=CSTWriterCSChange_prev(cstWriter,csChange); + if (csChange1) { + if (SeqNumberCmp(csChange1->gapSN,noneSN)) { + SeqNumberAdd(csChange1->gapSN, + csChange1->gapSN, + csChange->gapSN); + CSTWriterDestroyCSChange(d,cstWriter,csChange); + csChange=csChange1; + } + } + csChange1=CSTWriterCSChange_next(cstWriter,csChange); + if (csChange1) { + if (SeqNumberCmp(csChange1->gapSN,noneSN)) { + SeqNumberAdd(csChange->gapSN, + csChange->gapSN, + csChange1->gapSN); + CSTWriterDestroyCSChange(d,cstWriter,csChange1); + } + } + break; + } + } +} + +/*****************************************************************************/ +void +CSTWriterAddCSChange(ORTEDomain *d,CSTWriter *cstWriter,CSChange *csChange) { + CSChangeForReader *csChangeForReader; + CSTRemoteReader *cstRemoteReader; + CSChange *csChangeFSN; + + cstWriter->csChangesCounter++; + //look for old cschange + if ((cstWriter->guid.oid & 0x07)!=OID_PUBLICATION) + CSTWriterMakeGAP(d,cstWriter,&csChange->guid); + //insert cschange into database changes + SeqNumberInc(cstWriter->lastSN,cstWriter->lastSN); + csChange->sn=cstWriter->lastSN; + SEQUENCE_NUMBER_NONE(csChange->gapSN); + csChange->remoteReaderCount=cstWriter->cstRemoteReaderCounter; + csChange->remoteReaderProcBest=0; + csChange->remoteReaderProcStrict=0; + CSTWriterCSChange_insert(cstWriter,csChange); + //update FirstSN + csChangeFSN=CSTWriterCSChange_first(cstWriter); + if (SeqNumberCmp(csChangeFSN->gapSN,noneSN)>0) { + //minimal are 2 SNs (GAP,VAR) ... +// CSTWriterDestroyCSChange(cstWriter,csChange); + } + csChangeFSN=CSTWriterCSChange_first(cstWriter); + cstWriter->firstSN=csChangeFSN->sn; + //insert new cschange for each reader + gavl_cust_for_each(CSTRemoteReader,cstWriter,cstRemoteReader) { + //csChangeForReader + csChangeForReader=(CSChangeForReader*)MALLOC(sizeof(CSChangeForReader)); + csChangeForReader->commStateChFReader=TOSEND; + csChangeForReader->csChange=csChange; + ul_htim_queue_init_detached(&csChangeForReader->waitWhileDataUnderwayTimer.htim); + CSChangeForReader_insert(cstRemoteReader,csChangeForReader); + cstRemoteReader->csChangesCounter++; + if (cstRemoteReader->commStateSend==NOTHNIGTOSEND) { + cstRemoteReader->commStateSend=MUSTSENDDATA; + if ((cstWriter->guid.oid & 0x07)!=OID_PUBLICATION) { + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 1, + "CSTWriterSendTimer", + CSTWriterSendTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + NULL); + } else { + ORTESubsProp *sp=(ORTESubsProp*)cstRemoteReader->objectEntryOID->attributes; + + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_STRICT)!=0) { + //Strict reliable subscription + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 2); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 2, + "CSTWriterSendStrictTimer", + CSTWriterSendStrictTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + NULL); + } else { + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_BEST_EFFORTS)!=0) { + //best efforts subscription + NtpTime nextIssueTime,nextIssueDelay,actTime=getActualNtpTime(); + + NtpTimeAdd(nextIssueTime, + cstRemoteReader->lastSentIssueTime, + sp->minimumSeparation); + NtpTimeSub(nextIssueDelay, + nextIssueTime, + actTime); + if (NtpTimeCmp(actTime,nextIssueTime)>=0) + NTPTIME_ZERO(nextIssueDelay); + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 2); + if (NtpTimeCmp(nextIssueDelay,zNtpTime)==0) { + //direct sent issue, for case zero time + CSTWriterSendBestEffortTimer(d,(void*)cstRemoteReader); + } else { + //shedule sent issue (future) + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 2, + "CSTWriterSendBestEffortTimer", + CSTWriterSendBestEffortTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &nextIssueDelay); + } + } else { + //!Best_Effort & !Strict_Reliable + CSTWriterDestroyCSChangeForReader(cstRemoteReader,csChangeForReader, + ORTE_TRUE); + } + } + } + } + debug(51,5) ("CSTWriterAddCSChange: scheduled Var | Gap | Issue | HB \n"); + } +} + +/*****************************************************************************/ +void +CSTWriterDestroyCSChangeForReader(CSTRemoteReader *cstRemoteReader, + CSChangeForReader *csChangeForReader,Boolean destroyCSChange) { + CSChange *csChange; + if (!csChangeForReader) return; + csChange=csChangeForReader->csChange; + csChange->remoteReaderCount--; + cstRemoteReader->csChangesCounter--; + eventDetach(cstRemoteReader->cstWriter->domain, + cstRemoteReader->objectEntryOID->objectEntryAID, + &csChangeForReader->waitWhileDataUnderwayTimer, + 0); + CSChangeForReader_delete(cstRemoteReader,csChangeForReader); + FREE(csChangeForReader); + if ((cstRemoteReader->cstWriter->guid.oid & 0x07)==OID_PUBLICATION) { + if (csChange->remoteReaderCount<= + (csChange->remoteReaderProcBest+csChange->remoteReaderProcStrict)) { + if (destroyCSChange) { + CSTWriterDestroyCSChange(cstRemoteReader->cstWriter->domain, + cstRemoteReader->cstWriter,csChange); + } + pthread_mutex_unlock(&cstRemoteReader->cstWriter->mutexCSChangeDestroyed); + debug(51,5) ("Publication: new queue level (%d)\n", + cstRemoteReader->cstWriter->csChangesCounter); + } + } +} + +/*****************************************************************************/ +void +CSTWriterDestroyCSChange(ORTEDomain *d,CSTWriter *cstWriter,CSChange *csChange) { + CSTRemoteReader *cstRemoteReader; + CSChangeForReader *csChangeForReader; + + if (!csChange) return; + cstWriter->csChangesCounter--; + CSTWriterCSChange_delete(cstWriter,csChange); + gavl_cust_for_each(CSTRemoteReader,cstWriter,cstRemoteReader) { + csChangeForReader=CSChangeForReader_find(cstRemoteReader,&csChange->sn); + CSTWriterDestroyCSChangeForReader(cstRemoteReader, + csChangeForReader,ORTE_FALSE); + } + if (csChange->cdrStream.buffer) + FREE(csChange->cdrStream.buffer); + parameterDelete(csChange); + FREE(csChange); +} + +/*****************************************************************************/ +Boolean +CSTWriterTryDestroyBestEffortIssue(CSTWriter *cstWriter) { + CSChange *csChange; + ul_list_for_each(CSTWriterCSChange,cstWriter,csChange) { + if (!csChange->remoteReaderProcStrict) { + CSTWriterDestroyCSChange(cstWriter->domain,cstWriter,csChange); + return ORTE_TRUE; + } + } + return ORTE_FALSE; +} + +/*****************************************************************************/ +void +CSTWriterRefreshAllCSChanges(ORTEDomain *d,CSTRemoteReader *cstRemoteReader) { + CSChangeForReader *csChangeForReader; + int32_t timerQueue=1; + + if ((cstRemoteReader->cstWriter->guid.oid & 0x07)==OID_PUBLICATION) + timerQueue=2; //userdata timer queue + gavl_cust_for_each(CSChangeForReader,cstRemoteReader,csChangeForReader) { + csChangeForReader->commStateChFReader=TOSEND; + if (cstRemoteReader->commStateSend==NOTHNIGTOSEND) { + cstRemoteReader->commStateSend=MUSTSENDDATA; + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + timerQueue); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + timerQueue, + "CSTWriterSendTimer", + CSTWriterSendTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &cstRemoteReader->cstWriter->params.delayResponceTime); + } + } +} diff --git a/orte/liborte/RTPSCSTWriterTimer.c b/orte/liborte/RTPSCSTWriterTimer.c new file mode 100644 index 0000000..29e965f --- /dev/null +++ b/orte/liborte/RTPSCSTWriterTimer.c @@ -0,0 +1,387 @@ +/* + * $Id: RTPSCSTWriterTimer.c,v 0.0.0.1 2003/10/19 + * + * DEBUG: section 52 CSTWriter timer functions + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +int +CSTWriterRefreshTimer(ORTEDomain *d,void *vcstWriter) { + CSTWriter *cstWriter=(CSTWriter*)vcstWriter; + CSTRemoteReader *cstRemoteReader; + + debug(52,10) ("CSTWriterRefreshTimer: start\n"); + + gavl_cust_for_each(CSTRemoteReader,cstWriter,cstRemoteReader) { + CSTWriterRefreshAllCSChanges(d,cstRemoteReader); + } + eventDetach(d, + cstWriter->objectEntryOID->objectEntryAID, + &cstWriter->refreshPeriodTimer, + 0); //common timer + eventAdd(d, + cstWriter->objectEntryOID->objectEntryAID, + &cstWriter->refreshPeriodTimer, + 0, //common timer + "CSTWriterRefreshTimer", + CSTWriterRefreshTimer, + &cstWriter->lock, + cstWriter, + &cstWriter->params.refreshPeriod); + debug(52,10) ("CSTWriterRefreshTimer: finished\n"); + return 0; +} + +/*****************************************************************************/ +int +CSTWriterAnnounceTimer(ORTEDomain *d,void *vcstRemoteReader) { + CSTRemoteReader *cstRemoteReader=(CSTRemoteReader*)vcstRemoteReader; + + debug(52,10) ("CSTWriterAnnounceTimer: start\n"); + if ((cstRemoteReader->commStateHB==MAYSENDHB) && + ((!cstRemoteReader->cstWriter->params.fullAcknowledge))) {// || +// (cstRemoteReader->unacknowledgedCounter))) { + //create HB + int32_t len=RTPSHeardBeatCreate( + d->mbSend.cdrStream.bufferPtr, + getMaxMessageLength(d), + &cstRemoteReader->cstWriter->firstSN, + &cstRemoteReader->cstWriter->lastSN, + cstRemoteReader->cstWriter->guid.oid, + OID_UNKNOWN, + ORTE_FALSE); + if (len<0) { + //not enought space in sending buffer + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + debug(52,3) ("sent: RTPS_HBF(0x%x) to 0x%x-0x%x\n", + cstRemoteReader->cstWriter->guid.oid, + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid); + } + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->repeatAnnounceTimer, + 1); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->repeatAnnounceTimer, + 1, //metatraffic timer + "CSTWriterAnnounceTimer", + CSTWriterAnnounceTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &cstRemoteReader->cstWriter->params.repeatAnnounceTime); + debug(52,10) ("CSTWriterAnnounceTimer: finished\n"); + return 0; +} + +/**********************************************************************************/ +int +CSChangeForReaderUnderwayTimer(ORTEDomain *d,void *vcsChangeForReader) { + CSChangeForReader *csChangeForReader=(CSChangeForReader*)vcsChangeForReader; + csChangeForReader->commStateChFReader=UNACKNOWLEDGED; + return 0; +} + +/**********************************************************************************/ +int +CSTWriterSendBestEffortTimer(ORTEDomain *d,void *vcstRemoteReader) { + CSTRemoteReader *cstRemoteReader=(CSTRemoteReader*)vcstRemoteReader; + ORTESubsProp *sp=(ORTESubsProp*)cstRemoteReader->objectEntryOID->attributes; + CSChangeForReader *csChangeForReader=NULL; + + debug(52,10) ("CSTWriterSendBestEffortTimer: start\n"); + if (cstRemoteReader->commStateSend!=NOTHNIGTOSEND) { + gavl_cust_for_each(CSChangeForReader,cstRemoteReader,csChangeForReader) { + if (csChangeForReader->commStateChFReader==TOSEND) { + CSChange *csChange=csChangeForReader->csChange; + csChangeForReader->commStateChFReader=UNDERWAY; + cstRemoteReader->commStateSend=MUSTSENDDATA; + cstRemoteReader->lastSentIssueTime=getActualNtpTime(); + d->mbSend.cdrStreamDirect=&csChange->cdrStream; + ORTESendData(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + ORTE_FALSE); + CSTWriterDestroyCSChangeForReader(cstRemoteReader, + csChangeForReader,ORTE_TRUE); + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 2); + //when is no csChange -> break processing + if (cstRemoteReader->cstWriter->csChangesCounter==0) + break; + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->delayResponceTimer, + 2, + "CSTWriterSendBestEffortTimer", + CSTWriterSendBestEffortTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &sp->minimumSeparation); + return 0; + } + } + } + cstRemoteReader->commStateSend=NOTHNIGTOSEND; + debug(52,10) ("CSTWriterSendBestEffortTimer: finished\n"); + return 0; +} + +/**********************************************************************************/ +int +CSTWriterSendStrictTimer(ORTEDomain *d,void *vcstRemoteReader) { +/* CSTRemoteReader *cstRemoteReader=(CSTRemoteReader*)vcstRemoteReader; + CSChangeForReader *csChangeForReader=NULL; + unsigned int max_msg_len; + CSChange *csChange; + int len; + Boolean firstTrace=ORTE_TRUE; + + debug(52,10) ("CSTWriterSendStrictTimer: start\n"); + max_msg_len=getMaxMessageLength(d); + if (cstRemoteReader->commStateSend!=NOTHNIGTOSEND) { + gavl_cust_for_each(CSChangeForReader,cstRemoteReader,csChangeForReader) { + csChange=csChangeForReader->csChange; + if (csChangeForReader->commStateChFReader==TOSEND) { + cstRemoteReader->commStateSend=MUSTSENDDATA; + if ((firstTrace) && (cstRemoteReader->cstWriter->params.fullAcknowledge) && + !d->mbSend.containsInfoReply) { + firstTrace=ORTE_FALSE; + len=RTPSInfoREPLYCreate(d->mbSend.cdrStream.bufferPtr,max_msg_len, + IPADDRESS_INVALID, + ((AppParams*)cstRemoteReader->cstWriter->objectEntryOID->attributes)->userdataUnicastPort); + if (len<0) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + d->mbSend.containsInfoReply=ORTE_TRUE; + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + max_msg_len-=len; + debug(52,3) ("sent: RTPS_InfoREPLY(0x%x) to 0x%x-0x%x\n", + cstRemoteReader->cstWriter->guid.oid, + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid); + } + if (max_msg_len<20+cstWriter->typeRegister->getMaxSize) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + debug(52,3) ("sent: RTPS_ISSUE(0x%x) to 0x%x-0x%x\n", + cstRemoteReader->cstWriter->guid.oid, + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid); + + + + RTPSIssueCreateHeader(d->mbSend.cdrStream.bufferPtr, + max_msg_len,16+cstWriter->typeRegister->getMaxSize, + OID_UNKNOWN,cstWriter->guid.oid,snNext); + + + + + } + } + } + cstRemoteReader->commStateSend=NOTHNIGTOSEND; + debug(52,10) ("CSTWriterSendStrictTimer: finished\n");*/ + return 0; +} + +/**********************************************************************************/ +int +CSTWriterSendTimer(ORTEDomain *d,void *vcstRemoteReader) { + CSTRemoteReader *cstRemoteReader=(CSTRemoteReader*)vcstRemoteReader; + CSChangeForReader *csChangeForReader=NULL; + unsigned int max_msg_len; + int len,off; + Boolean firstTrace=ORTE_TRUE,f_bit=ORTE_TRUE; + + debug(52,10) ("CSTWriterSendTimer: start\n"); + max_msg_len=getMaxMessageLength(d); + if (cstRemoteReader->commStateSend!=NOTHNIGTOSEND) { + gavl_cust_for_each(CSChangeForReader,cstRemoteReader,csChangeForReader) { + if (csChangeForReader->commStateChFReader==TOSEND) { + cstRemoteReader->commStateSend=MUSTSENDDATA; + if ((firstTrace) && (cstRemoteReader->cstWriter->params.fullAcknowledge) && + !d->mbSend.containsInfoReply) { + f_bit=ORTE_FALSE; + firstTrace=ORTE_FALSE; + len=RTPSInfoREPLYCreate(d->mbSend.cdrStream.bufferPtr,max_msg_len, + IPADDRESS_INVALID, + ((AppParams*)cstRemoteReader->cstWriter->objectEntryOID->attributes)->metatrafficUnicastPort); + if (len<0) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + d->mbSend.containsInfoReply=ORTE_TRUE; + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + max_msg_len-=len; + debug(52,3) ("sent: RTPS_InfoREPLY(0x%x) to 0x%x-0x%x\n", + cstRemoteReader->cstWriter->guid.oid, + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid); + } + if (max_msg_len<32) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + off=0; + //VAR ??? + if (SeqNumberCmp(csChangeForReader->csChange->gapSN,noneSN)==0) { + debug(52,3) ("sent: RTPS_VAR(0x%x) to 0x%x-0x%x\n", + cstRemoteReader->cstWriter->guid.oid, + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid); + len=32; + d->mbSend.cdrStream.bufferPtr[0]=(u_int8_t)VAR; + d->mbSend.cdrStream.bufferPtr[1]=ORTE_MY_MBO; + if (csChangeForReader->csChange->alive) + d->mbSend.cdrStream.bufferPtr[1]|=4; + *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+4))=OID_UNKNOWN; + conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+4),0); + *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+8))= + cstRemoteReader->cstWriter->guid.oid; + conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+8),0); + if (csChangeForReader->csChange->guid.oid==OID_APP) { + d->mbSend.cdrStream.bufferPtr[1]|=8; + *((HostId*)(d->mbSend.cdrStream.bufferPtr+12))= + csChangeForReader->csChange->guid.hid; + conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+12),0); + *((AppId*)(d->mbSend.cdrStream.bufferPtr+16))= + csChangeForReader->csChange->guid.aid; + conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+16),0); + } else { + len-=8; + off=-8; + } + *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+20+off))= + csChangeForReader->csChange->guid.oid; + conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+20+off),0); + *((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+24+off))= + csChangeForReader->csChange->sn; + if (!CSChangeAttributes_is_empty(csChangeForReader->csChange)) { + int plen; + plen=parameterCodeStreamFromCSChange(csChangeForReader->csChange, + d->mbSend.cdrStream.bufferPtr+32+off,max_msg_len-len); + if (plen<0) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } + d->mbSend.cdrStream.bufferPtr[1]|=2; + len+=plen; + } + } else { //GAP ??? + debug(52,3) ("sent: RTPS_GAP(0x%x) to 0x%x-0x%x\n", + cstRemoteReader->cstWriter->guid.oid, + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid); + len=32; + d->mbSend.cdrStream.bufferPtr[0]=(u_int8_t)GAP; + d->mbSend.cdrStream.bufferPtr[1]=ORTE_MY_MBO; + *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+4))=OID_UNKNOWN; + conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+4),0); + *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+8))= + cstRemoteReader->cstWriter->guid.oid; + conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+8),0); + *((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+12))= + csChangeForReader->csChange->sn; + conv_sn((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+12),ORTE_MY_MBO); + SeqNumberAdd(*((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+20)), + csChangeForReader->csChange->sn, + csChangeForReader->csChange->gapSN); + conv_sn((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+20),ORTE_MY_MBO); + *((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+28))=0; //NumBits + } + *((ParameterLength*)(d->mbSend.cdrStream.bufferPtr+2))=len-4; + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + max_msg_len-=len; + //setup new state for csChangeForReader + if (NtpTimeCmp(zNtpTime, + cstRemoteReader->cstWriter->params.waitWhileDataUnderwayTime)==0) { + csChangeForReader->commStateChFReader=UNACKNOWLEDGED; + } else { + csChangeForReader->commStateChFReader=UNDERWAY; + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &csChangeForReader->waitWhileDataUnderwayTimer, + 0); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &csChangeForReader->waitWhileDataUnderwayTimer, + 0, //common timer + "CSChangeForReaderUnderwayTimer", + CSChangeForReaderUnderwayTimer, + &cstRemoteReader->cstWriter->lock, + csChangeForReader, + &cstRemoteReader->cstWriter->params.waitWhileDataUnderwayTime); + } + } + } + } + //add HeardBeat + len=RTPSHeardBeatCreate( + d->mbSend.cdrStream.bufferPtr,max_msg_len, + &cstRemoteReader->cstWriter->firstSN, + &cstRemoteReader->cstWriter->lastSN, + cstRemoteReader->cstWriter->guid.oid, + OID_UNKNOWN, + f_bit); + if (len<0) { + d->mbSend.needSend=ORTE_TRUE; + return 1; + } else { + //schedule new time for Announce timer + eventDetach(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->repeatAnnounceTimer, + 1); + eventAdd(d, + cstRemoteReader->objectEntryOID->objectEntryAID, + &cstRemoteReader->repeatAnnounceTimer, + 1, //metatraffic timer + "CSTWriterAnnounceTimer", + CSTWriterAnnounceTimer, + &cstRemoteReader->cstWriter->lock, + cstRemoteReader, + &cstRemoteReader->cstWriter->params.repeatAnnounceTime); + } + debug(52,3) ("sent: RTPS_HB(0x%x) to 0x%x-0x%x\n", + cstRemoteReader->cstWriter->guid.oid, + cstRemoteReader->guid.hid, + cstRemoteReader->guid.aid); + if (cstRemoteReader->commStateHB==MUSTSENDHB) { + cstRemoteReader->commStateHB=MAYSENDHB; + } + cstRemoteReader->commStateSend=NOTHNIGTOSEND; + d->mbSend.cdrStream.bufferPtr+=len; + d->mbSend.cdrStream.length+=len; + debug(52,10) ("CSTWriterSendTimer: finished\n"); + return 0; +} diff --git a/orte/liborte/RTPSGap.c b/orte/liborte/RTPSGap.c new file mode 100644 index 0000000..87db602 --- /dev/null +++ b/orte/liborte/RTPSGap.c @@ -0,0 +1,173 @@ +/* + * $Id: RTPSGap.c,v 0.0.0.1 2003/10/07 + * + * DEBUG: section 49 RTPS message GAP + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +void +RTPSGapAdd(CSTRemoteWriter *cstRemoteWriter,GUID_RTPS *guid,SequenceNumber *fsn, + SequenceNumber *sn,u_int32_t numbits,u_int8_t *bitmaps,Boolean e_bit) { + SequenceNumber lsn,ssn; + u_int32_t i; + int8_t bit,bit_last=0; + CSChange *csChange; + u_int32_t bitmap; + + if (SeqNumberCmp(*sn,cstRemoteWriter->sn)<0) return;//have to be sn>=writer_sn ! + if (SeqNumberCmp(*fsn,*sn)==1) return; //cannot be fsn>sn ! + if (numbits>256) return; + //first case of GAP sn + if (SeqNumberCmp(*fsn,*sn)<0) { //if fsnsn)>0) { //have to be sn>writer_sn + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + csChange->cdrStream.buffer=NULL; + csChange->sn=*fsn; + csChange->guid=*guid; + csChange->alive=ORTE_TRUE; + SeqNumberSub(csChange->gapSN,*sn,*fsn); //setup flag GAP + CSChangeAttributes_init_head(csChange); + CSTReaderAddCSChange(cstRemoteWriter,csChange); + } + } + } + //second case of GAP sn + lsn=ssn=*sn;bit=0; + for(i=0;i0) { + if (bit_last && !bit) { //end of GAP 1->0 + if (!CSChangeFromWriter_find(cstRemoteWriter,&ssn)) { + if (SeqNumberCmp(ssn,cstRemoteWriter->sn)>0) { + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + csChange->cdrStream.buffer=NULL; + csChange->sn=ssn; + csChange->guid=*guid; + csChange->alive=ORTE_TRUE; + SeqNumberSub(csChange->gapSN,lsn,ssn); //setup flag GAP + CSChangeAttributes_init_head(csChange); + CSTReaderAddCSChange(cstRemoteWriter,csChange); + } + } + } else { + if (!bit_last && bit) { //begin GAP 0->1 + ssn=lsn; //start pointer + } + } + } + SeqNumberInc(lsn,lsn); + bit_last=bit; + } + if (bit) { + if (!CSChangeFromWriter_find(cstRemoteWriter,&ssn)) { + if (SeqNumberCmp(ssn,cstRemoteWriter->sn)>0) { + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + csChange->cdrStream.buffer=NULL; + csChange->sn=ssn; + csChange->guid=*guid; + csChange->alive=ORTE_TRUE; + SeqNumberSub(csChange->gapSN,lsn,ssn); //setup flag GAP + CSChangeAttributes_init_head(csChange); + CSTReaderAddCSChange(cstRemoteWriter,csChange); + } + } + } +} + +/**********************************************************************************/ +void +RTPSGap(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) { + CSTReader *cstReader=NULL; + CSTRemoteWriter *cstRemoteWriter; + GUID_RTPS writerGUID; + ObjectId roid,woid; + SequenceNumber sn,fsn; + u_int32_t numbits; + int8_t e_bit; + + e_bit=rtps_msg[1] & 0x01; + roid=*((ObjectId*)(rtps_msg+4)); /* readerObjectId */ + conv_u32(&roid,0); + woid=*((ObjectId*)(rtps_msg+8)); /* writerObjectId */ + conv_u32(&woid,0); + fsn=*((SequenceNumber*)(rtps_msg+12)); /* firstSeqNumber */ + conv_sn(&fsn,e_bit); + sn=*((SequenceNumber*)(rtps_msg+20)); /* Bitmap - SN */ + conv_sn(&sn,e_bit); + numbits=*((u_int32_t*)(rtps_msg+28)); /* numbits */ + conv_u32(&numbits,e_bit); + writerGUID.hid=mi->sourceHostId; + writerGUID.aid=mi->sourceAppId; + writerGUID.oid=woid; + + debug(49,3) ("recv: RTPS_GAP(0x%x) from 0x%x-0x%x\n", + woid,mi->sourceHostId,mi->sourceAppId); + + //Manager + if ((d->guid.aid & 0x03)==MANAGER) { + if ((writerGUID.oid==OID_WRITE_APPSELF) && + ((writerGUID.aid & 0x03)==MANAGER)) { + pthread_rwlock_wrlock(&d->readerManagers.lock); + cstReader=&d->readerManagers; + } + if (((writerGUID.oid==OID_WRITE_APPSELF) && + ((writerGUID.aid & 0x03)==MANAGEDAPPLICATION)) || + ((writerGUID.oid==OID_WRITE_APP) && + ((writerGUID.aid & 0x03)==MANAGER))) { + pthread_rwlock_wrlock(&d->readerApplications.lock); + cstReader=&d->readerApplications; + } + } + if ((d->guid.aid & 3)==MANAGEDAPPLICATION) { + switch (writerGUID.oid) { + case OID_WRITE_MGR: + pthread_rwlock_wrlock(&d->readerManagers.lock); + cstReader=&d->readerManagers; + break; + case OID_WRITE_APP: + pthread_rwlock_wrlock(&d->readerApplications.lock); + cstReader=&d->readerApplications; + break; + case OID_WRITE_PUBL: + pthread_rwlock_wrlock(&d->readerPublications.lock); + cstReader=&d->readerPublications; + break; + case OID_WRITE_SUBS: + pthread_rwlock_wrlock(&d->readerSubscriptions.lock); + cstReader=&d->readerSubscriptions; + break; + } + } + if (!cstReader) return; + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (!cstRemoteWriter) { + pthread_rwlock_unlock(&cstReader->lock); + return; + } + RTPSGapAdd(cstRemoteWriter,&writerGUID,&fsn,&sn,numbits, + rtps_msg+32,e_bit); + CSTReaderProcCSChanges(d,cstRemoteWriter); + pthread_rwlock_unlock(&cstReader->lock); +} + + diff --git a/orte/liborte/RTPSHeader.c b/orte/liborte/RTPSHeader.c new file mode 100644 index 0000000..62bed0e --- /dev/null +++ b/orte/liborte/RTPSHeader.c @@ -0,0 +1,58 @@ +/* + * $Id: RTPSHeader.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 40 Operations with header of RTPS + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +int16_t +RTPSHeaderCreate(u_int8_t *msg,HostId hid,AppId aid) { + msg[0]='R';msg[1]='T'; msg[2]='P'; msg[3]='S'; + //Protocol version + PROTOCOL_VERSION_1_0((*((ProtocolVersion*)(msg+4)))); + //Vendor id + VENDOR_ID_UNKNOWN((*((VendorId*)(msg+6)))); + //HID + conv_u32(&hid,0); + *((HostId*)(msg+8))=hid; + //AID + conv_u32(&aid,0); + *((AppId*)(msg+12))=aid; + return 16; +} +/**********************************************************************************/ +int16_t +RTPSHeaderCheck(u_int8_t *msg,int32_t len,MessageInterpret *mi) { + if (len<16) return -1; /* message is too small */ + if (msg[0]!='R') return -2; /* header is invalid */ + if (msg[1]!='T') return -2; /* header is invalid */ + if (msg[2]!='P') return -2; /* header is invalid */ + if (msg[3]!='S') return -2; /* header is invalid */ + mi->sourceVersion=*((ProtocolVersion*)(msg+4)); /* ProtocolVersion */ + mi->sourceVendorId=*((VendorId*)(msg+6)); /* Vendor Id */ + mi->sourceHostId=*((HostId*)(msg+8)); /* Host Id */ + conv_u32(&mi->sourceHostId,0); + mi->sourceAppId=*((AppId*)(msg+12)); /* App Id */ + conv_u32(&mi->sourceAppId,0); + mi->haveTimestamp=ORTE_FALSE; /* false */ + return 0; +} + + diff --git a/orte/liborte/RTPSHeardBeat.c b/orte/liborte/RTPSHeardBeat.c new file mode 100644 index 0000000..3109801 --- /dev/null +++ b/orte/liborte/RTPSHeardBeat.c @@ -0,0 +1,143 @@ +/* + * $Id: RTPSHeardBeat.c,v 0.0.0.1 2003/10/07 + * + * DEBUG: section 48 RTPS message HeardBeat + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +int +RTPSHeardBeatCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len, + SequenceNumber *firstSeqNumber,SequenceNumber *lastSeqNumber, + ObjectId woid,ObjectId roid,Boolean f_bit) { + if (max_msg_len<28) return -1; + rtps_msg[0]=(u_int8_t)HEARTBEAT; + rtps_msg[1]=ORTE_MY_MBO; + if (f_bit) rtps_msg[1]|=2; + *((ParameterLength*)(rtps_msg+2))=24; + conv_u32(&roid,0); + *((ObjectId*)(rtps_msg+4))=roid; + conv_u32(&woid,0); + *((ObjectId*)(rtps_msg+8))=woid; + *((SequenceNumber*)(rtps_msg+12))=*firstSeqNumber; + *((SequenceNumber*)(rtps_msg+20))=*lastSeqNumber; + return 28; +} + +/**********************************************************************************/ +void +RTPSHeardBeat(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi) { + GUID_RTPS writerGUID; + ObjectId roid,woid; + SequenceNumber fsn,lsn; + int8_t e_bit,f_bit; + CSTReader *cstReader=NULL; + CSTRemoteWriter *cstRemoteWriter=NULL; + + e_bit=rtps_msg[1] & 0x01; + f_bit=(rtps_msg[1] & 0x02)>>1; + roid=*((ObjectId*)(rtps_msg+4)); /* readerObjectId */ + conv_u32(&roid,0); + woid=*((ObjectId*)(rtps_msg+8)); /* writerObjectId */ + conv_u32(&woid,0); + fsn=*((SequenceNumber*)(rtps_msg+12)); /* firstSeqNumber */ + conv_sn(&fsn,e_bit); + lsn=*((SequenceNumber*)(rtps_msg+20)); /* lastSeqNumber */ + conv_sn(&lsn,e_bit); + if (SeqNumberCmp(fsn,lsn)==1) return; // lsn break + writerGUID.hid=mi->sourceHostId; + writerGUID.aid=mi->sourceAppId; + writerGUID.oid=woid; + + debug(48,3) ("recv: RTPS HB%c(0x%x) from 0x%x-0x%x\n", + f_bit ? 'F':'f',woid,mi->sourceHostId,mi->sourceAppId); + + if ((d->guid.aid & 0x03)==MANAGER) { + if ((writerGUID.oid==OID_WRITE_APPSELF) && + ((writerGUID.aid & 0x03)==MANAGER)) { + pthread_rwlock_wrlock(&d->readerManagers.lock); + cstReader=&d->readerManagers; + } + if (((writerGUID.oid==OID_WRITE_APPSELF) && + ((writerGUID.aid & 0x03)==MANAGEDAPPLICATION)) || + ((writerGUID.oid==OID_WRITE_APP) && + ((writerGUID.aid & 0x03)==MANAGER))) { + pthread_rwlock_wrlock(&d->readerApplications.lock); + cstReader=&d->readerApplications; + } + } + if ((d->guid.aid & 3)==MANAGEDAPPLICATION) { + switch (writerGUID.oid) { + case OID_WRITE_MGR: + pthread_rwlock_wrlock(&d->readerManagers.lock); + cstReader=&d->readerManagers; + break; + case OID_WRITE_APP: + pthread_rwlock_wrlock(&d->readerApplications.lock); + cstReader=&d->readerApplications; + break; + case OID_WRITE_PUBL: + pthread_rwlock_wrlock(&d->readerPublications.lock); + cstReader=&d->readerPublications; + break; + case OID_WRITE_SUBS: + pthread_rwlock_wrlock(&d->readerSubscriptions.lock); + cstReader=&d->readerSubscriptions; + break; + } + } + if (!cstReader) return; + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (!cstRemoteWriter) { + pthread_rwlock_unlock(&cstReader->lock); + return; + } + cstRemoteWriter->firstSN=fsn; + cstRemoteWriter->lastSN=lsn; + cstRemoteWriter->ACKRetriesCounter=0; + if (SeqNumberCmp(cstRemoteWriter->sn,lsn)>0) + cstRemoteWriter->sn=lsn; + if (SeqNumberCmp(cstRemoteWriter->sn,fsn)<0) { + if (SeqNumberCmp(fsn,noneSN)!=0) { + SeqNumberDec(cstRemoteWriter->sn,fsn); + } + } + CSTReaderProcCSChanges(d,cstRemoteWriter); + if ((!f_bit) && (cstRemoteWriter->commStateACK==WAITING)) { + cstRemoteWriter->commStateACK=ACKPENDING; + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1); //metatraffic timer + eventAdd(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->delayResponceTimer, + 1, //metatraffic timer + "CSTReaderResponceTimer", + CSTReaderResponceTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + &cstRemoteWriter->cstReader->params.delayResponceTimeMin); + } + pthread_rwlock_unlock(&cstReader->lock); +} diff --git a/orte/liborte/RTPSInfoDST.c b/orte/liborte/RTPSInfoDST.c new file mode 100644 index 0000000..d7cd8ff --- /dev/null +++ b/orte/liborte/RTPSInfoDST.c @@ -0,0 +1,46 @@ +/* + * $Id: RTPSInfoDST.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 42 message INFO DST + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +void RTPSInfoDST(u_int8_t *rtps_msg,MessageInterpret *mi) { + HostId hid; + AppId aid; + + //parsing + hid=*((HostId*)(rtps_msg+4)); /* HostId */ + conv_u32(&hid,0); + aid=*((u_int32_t*)(rtps_msg+8)); /* AppId */ + conv_u32(&aid,0); + + debug(42,3) (" RTPSInfoDST:\n"); + debug(42,4) (" hid:0x%x, aid:0x%x\n",hid,aid); + + if (hid!=HID_UNKNOWN) { + mi->destHostId=hid; + } + if (aid!=AID_UNKNOWN) { + mi->destAppId=aid; + } +} + + diff --git a/orte/liborte/RTPSInfoREPLY.c b/orte/liborte/RTPSInfoREPLY.c new file mode 100644 index 0000000..f117f03 --- /dev/null +++ b/orte/liborte/RTPSInfoREPLY.c @@ -0,0 +1,71 @@ +/* + * $Id: RTPSInfoREPLY.c,v 0.0.0.1 2003/09/1 + * + * DEBUG: section 43 message INFO REPLY + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +int32_t +RTPSInfoREPLYCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len, + IPAddress ipaddress,Port port) { + + if (max_msg_len<12) return -1; + rtps_msg[0]=(u_int8_t)INFO_REPLY; + rtps_msg[1]=ORTE_MY_MBO; + *((ParameterLength*)(rtps_msg+2))=8; + *((ObjectId*)(rtps_msg+4))=ipaddress; + *((ObjectId*)(rtps_msg+8))=port; + return 12; +} + +/**********************************************************************************/ +void +RTPSInfoREPLY(u_int8_t *rtps_msg,MessageInterpret *mi) { + IPAddress ipa; + Port port; + int8_t e_bit; + + //Parsing + e_bit=rtps_msg[1] & 0x01; + ipa=*((IPAddress*)(rtps_msg+4)); /* unicastReplyIPAddress */ + conv_u32(&ipa,e_bit); + port=*((Port*)(rtps_msg+8)); /* unicastReplyPort */ + conv_u32(&ipa,e_bit); + + debug(43,3) ("recv: RTPS InfoREPLY from 0x%x-0x%x\n", + mi->sourceHostId,mi->sourceAppId); + + if (ipa!=IPADDRESS_INVALID) { + mi->unicastReplyIPAddress=ipa; + } + mi->unicastReplyPort=port; + if (rtps_msg[1] & 0x02) { + ipa=*((u_int32_t*)(rtps_msg+12)); /* multicastReplyIPAddress */ + conv_u32(&ipa,e_bit); + port=*((u_int32_t*)(rtps_msg+16)); /* multicastReplyPort */ + conv_u32(&port,e_bit); + mi->multicastReplyIPAddress=ipa; + mi->multicastReplyPort=port; + } else { + mi->multicastReplyIPAddress=IPADDRESS_INVALID; + mi->multicastReplyPort =PORT_INVALID; + } +} + diff --git a/orte/liborte/RTPSInfoSRC.c b/orte/liborte/RTPSInfoSRC.c new file mode 100644 index 0000000..aa9c37f --- /dev/null +++ b/orte/liborte/RTPSInfoSRC.c @@ -0,0 +1,58 @@ +/* + * $Id: RTPSInfoSRC.c,v 0.0.0.1 2003/09/10 + * + * DEBUG: section 44 message INFO SRC + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +void RTPSInfoSRC(u_int8_t *rtps_msg,MessageInterpret *mi) { + IPAddress ipa; + ProtocolVersion protocol; + VendorId vid; + HostId hid; + AppId aid; + int8_t e_bit; + + //Parsing + e_bit=rtps_msg[1] & 0x01; + ipa=*((IPAddress*)(rtps_msg+4)); /* appIPAddress */ + conv_u32(&ipa,e_bit); + protocol=*((ProtocolVersion*)(rtps_msg+8)); /* ProtocolVersion */ + vid=*((VendorId*)(rtps_msg+10)); /* Vendor Id */ + hid=*((HostId*)(rtps_msg+12)); /* HostId */ + conv_u32(&hid,0); + aid=*((AppId*)(rtps_msg+16)); /* AppId */ + conv_u32(&aid,0); + + debug(44,3) (" RTPSInfoSRC: \n"); + debug(44,4) (" appIPAddress:%s\n",IPAddressToString(ipa)); + debug(44,4) (" pv:%lu,%lu vid:%lu,%lu hid:0x%x aid:0x%x\n", + protocol.major,protocol.minor,vid.major,vid.minor,hid,aid); + + mi->sourceHostId=hid; + mi->sourceAppId=aid; + mi->sourceVersion=protocol; + mi->sourceVendorId=vid; + mi->unicastReplyIPAddress=ipa; + mi->unicastReplyPort=PORT_INVALID; + mi->multicastReplyIPAddress=IPADDRESS_INVALID; + mi->multicastReplyPort=PORT_INVALID; + mi->haveTimestamp=ORTE_FALSE; +} diff --git a/orte/liborte/RTPSInfoTS.c b/orte/liborte/RTPSInfoTS.c new file mode 100644 index 0000000..e55bfc8 --- /dev/null +++ b/orte/liborte/RTPSInfoTS.c @@ -0,0 +1,54 @@ +/* + * $Id: RTPSInfoTS.c,v 0.0.0.1 2003/09/10 + * + * DEBUG: section 45 message INFO TS + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +int32_t +RTPSInfoTSCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,NtpTime time) { + if (max_msg_len<12) return -1; + rtps_msg[0]=(u_int8_t)INFO_TS; + rtps_msg[1]=ORTE_MY_MBO; //I-bit = 0 + *((ParameterLength*)(rtps_msg+2))=8; + *((NtpTime*)(rtps_msg+4))=time; + return 0; +} + +/**********************************************************************************/ +void +RTPSInfoTS(u_int8_t *rtps_msg,MessageInterpret *mi) { + int8_t e_bit=rtps_msg[1] & 0x01; + int32_t sec,msec; + + if ((rtps_msg[1] & 0x02)==0) { /* I = bit */ + mi->haveTimestamp=ORTE_TRUE; + mi->timestamp=*((NtpTime*)(rtps_msg+4)); + conv_sn((SequenceNumber*)&mi->timestamp,e_bit); + } else { + mi->haveTimestamp=ORTE_FALSE; + NTPTIME_ZERO(mi->timestamp); + } + NtpTimeDisAssembToMs(sec,msec,mi->timestamp); + if (mi->haveTimestamp) + debug(45,3) ("recv: RTPSInfoTS, timestamp %lis %lims\n",sec,msec); + else + debug(45,3) ("recv: RTPSInfoTS\n"); +} diff --git a/orte/liborte/RTPSIssue.c b/orte/liborte/RTPSIssue.c new file mode 100644 index 0000000..7405da0 --- /dev/null +++ b/orte/liborte/RTPSIssue.c @@ -0,0 +1,169 @@ +/* + * $Id: RTPSIssue.c,v 0.0.0.1 2003/12/08 + * + * DEBUG: section 56 message ISSUE + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" +/**********************************************************************************/ +int32_t +RTPSIssueCreateHeader(u_int8_t *rtps_msg,u_int32_t max_msg_len,u_int32_t length, + ObjectId roid,ObjectId woid,SequenceNumber sn) { + + if (max_msg_len<20) return -1; + rtps_msg[0]=(u_int8_t)ISSUE; + rtps_msg[1]=ORTE_MY_MBO; + *((ParameterLength*)(rtps_msg+2))=length; + conv_u32(&roid,0); + *((ObjectId*)(rtps_msg+4))=roid; + conv_u32(&woid,0); + *((ObjectId*)(rtps_msg+8))=woid; + *((SequenceNumber*)(rtps_msg+12))=sn; + return 0; +} + +/**********************************************************************************/ +void +RTPSIssue(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) { + GUID_RTPS guid,writerGUID; + ObjectId roid,woid; + SequenceNumber sn,sn_tmp; + int8_t e_bit,p_bit; + u_int16_t submsg_len; + CSTReader *cstReader; + CSTRemoteWriter *cstRemoteWriter; + CSChange *csChange=NULL; + + e_bit=rtps_msg[1] & 0x01; + p_bit=(rtps_msg[1] & 0x02)>>1; + submsg_len=*((u_int16_t*)(rtps_msg+2)); + conv_u16(&submsg_len,e_bit); + roid=*((ObjectId*)(rtps_msg+4)); /* readerObjectId */ + conv_u32(&roid,0); + woid=*((ObjectId*)(rtps_msg+8)); /* writerObjectId */ + conv_u32(&woid,0); + sn=*((SequenceNumber*)(rtps_msg+12)); /* sn */ + conv_sn(&sn,e_bit); + if (p_bit) return; /* at this moment is not supported p_bit */ + writerGUID.hid=mi->sourceHostId; + writerGUID.aid=mi->sourceAppId; + writerGUID.oid=woid; + + debug(56,3) ("recv: RTPS_ISSUE(0x%x) from 0x%x-0x%x\n", + woid,mi->sourceHostId,mi->sourceAppId); + + pthread_rwlock_rdlock(&d->subscriptions.lock); + guid=d->guid; + guid.oid=roid; + gavl_cust_for_each(CSTReader,&d->subscriptions,cstReader) { + if (roid!=OID_UNKNOWN) + cstReader=CSTReader_find(&d->subscriptions,&guid); + if (cstReader) { + ORTESubsProp *sp; + pthread_rwlock_wrlock(&cstReader->lock); + sp=(ORTESubsProp*)cstReader->objectEntryOID->attributes; + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (cstRemoteWriter) { + ORTEPublProp *pp,*pps; + pp=(ORTEPublProp*)cstRemoteWriter->objectEntryOID->attributes; + if (cstReader->cstRemoteWriterSubscribed!=NULL) { + pps=(ORTEPublProp*)cstReader->cstRemoteWriterSubscribed-> + objectEntryOID->attributes; + if (pp->strength>pps->strength) { + cstReader->cstRemoteWriterSubscribed=cstRemoteWriter; + } + } else { + cstReader->cstRemoteWriterSubscribed=cstRemoteWriter; + } + if (cstReader->cstRemoteWriterSubscribed==cstRemoteWriter) { + eventDetach(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->persistenceTimer, + 0); //common timer + eventAdd(d, + cstReader->objectEntryOID->objectEntryAID, + &cstReader->persistenceTimer, + 0, //common timer + "CSTReaderPersistenceTimer", + CSTReaderPersistenceTimer, + &cstReader->lock, + cstReader, + &pp->persistence); + } + if ((SeqNumberCmp(sn,cstRemoteWriter->sn)>0) && //have to be sn>writer_sn + (CSChangeFromWriter_find(cstRemoteWriter,&sn)==NULL)) { + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + csChange->cdrStream.buffer=NULL; + csChange->guid=writerGUID; + csChange->sn=sn; + SEQUENCE_NUMBER_NONE(csChange->gapSN); + CSChangeAttributes_init_head(csChange); + csChange->cdrStream.length=submsg_len-16; + csChange->cdrStream.buffer=(int8_t*)MALLOC(submsg_len-16); + csChange->cdrStream.bufferPtr=csChange->cdrStream.buffer; + csChange->cdrStream.needByteSwap=ORTE_FALSE; + if (e_bit ^ ORTE_MY_MBO) + csChange->cdrStream.needByteSwap=ORTE_TRUE; + memcpy(csChange->cdrStream.buffer,rtps_msg+20,submsg_len-16); + if (SeqNumberCmp(sn,cstRemoteWriter->firstSN)>=0) { //sn>=firstSN + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_STRICT)!=0) { + if (sp->recvQueueSize>cstRemoteWriter->csChangesCounter) { + sn_tmp.high=0; + sn_tmp.low=sp->recvQueueSize; + SeqNumberAdd(sn_tmp, + cstRemoteWriter->sn, + sn_tmp); + if (SeqNumberCmp(sn,sn_tmp)<=0) { //sn<=(firstSN+QueueSize) + csChange->remoteTimePublished=mi->timestamp; + csChange->localTimeReceived=getActualNtpTime(); + CSTReaderAddCSChange(cstRemoteWriter,csChange); + csChange=NULL; + } + } + } else { + if ((sp->reliabilityRequested & PID_VALUE_RELIABILITY_BEST_EFFORTS)!=0) { + if ((sp->recvQueueSize<=cstRemoteWriter->csChangesCounter) || + (cstReader->cstRemoteWriterSubscribed!=cstRemoteWriter)) { + CSChangeFromWriter *csChangeFromWriter; + csChangeFromWriter=CSChangeFromWriter_first(cstRemoteWriter); + CSTReaderDestroyCSChangeFromWriter(cstRemoteWriter, + csChangeFromWriter, + ORTE_FALSE); + } + if (sp->recvQueueSize>cstRemoteWriter->csChangesCounter) { + csChange->remoteTimePublished=mi->timestamp; + csChange->localTimeReceived=getActualNtpTime(); + CSTReaderAddCSChange(cstRemoteWriter,csChange); + csChange=NULL; + } + } + } + } + } + if (csChange) { + FREE(csChange->cdrStream.buffer); + FREE(csChange); + } + CSTReaderProcCSChangesIssue(cstRemoteWriter,ORTE_FALSE); + } + pthread_rwlock_unlock(&cstReader->lock); + } else + break; //break traceing all cstReaders + } + pthread_rwlock_unlock(&d->subscriptions.lock); +} diff --git a/orte/liborte/RTPSPad.c b/orte/liborte/RTPSPad.c new file mode 100644 index 0000000..9647131 --- /dev/null +++ b/orte/liborte/RTPSPad.c @@ -0,0 +1,32 @@ +/* + * $Id: RTPSPad.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 41 message PAD + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +void RTPSPad(u_int8_t *rtps_msg,MessageInterpret *mi) { + //nothing to do + + debug(41,3) (" RTPSInfoPAD:\n"); + +} + + diff --git a/orte/liborte/RTPSUtils.c b/orte/liborte/RTPSUtils.c new file mode 100644 index 0000000..cf93b94 --- /dev/null +++ b/orte/liborte/RTPSUtils.c @@ -0,0 +1,60 @@ +/* + * $Id: RTPSUtils.c,v 0.0.0.1 2003/09/13 + * + * DEBUG: section 50 Utils + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +int gavl_cmp_ntp_time(const NtpTime *a,const NtpTime *b) { + return NtpTimeCmp(*a,*b); +} + +/**********************************************************************************/ +int gavl_cmp_sn(const SequenceNumber *a, const SequenceNumber *b) { + return SeqNumberCmp(*a,*b); +} + +/**********************************************************************************/ +int +gavl_cmp_guid(const GUID_RTPS *a, const GUID_RTPS *b) { + //HID + if (a->hid>b->hid) return 1; + if (a->hidhid) return -1; + //AID + if (a->aid>b->aid) return 1; + if (a->aidaid) return -1; + //OID + if (a->oid>b->oid) return 1; + if (a->oidoid) return -1; + return 0; +} + +/**********************************************************************************/ +int +gavl_cmp_str(char *const *a,char *const *b) { + return strcmp(*a,*b); +} +/**********************************************************************************/ +int +getMaxMessageLength(ORTEDomain *d) { + return d->domainProp.wireProp.metaBytesPerPacket-d->mbSend.cdrStream.length- + RTPS_HEADER_LENGTH-20; +} + diff --git a/orte/liborte/RTPSVar.c b/orte/liborte/RTPSVar.c new file mode 100644 index 0000000..3ad2926 --- /dev/null +++ b/orte/liborte/RTPSVar.c @@ -0,0 +1,493 @@ +/* + * $Id: RTPSVar.c,v 0.0.0.1 2003/10/07 + * + * DEBUG: section 46 RTPS message VAR + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +void NewPublisher(ORTEDomain *d,ObjectEntryOID *op); +void NewSubscriber(ORTEDomain *d,ObjectEntryOID *os); + +/**********************************************************************************/ +void +RTPSVar(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) { + GUID_RTPS objectGUID,writerGUID; + ObjectId roid,woid; + SequenceNumber sn; + int8_t e_bit,p_bit,a_bit; + u_int16_t submsg_len; + CSTReader *cstReader=NULL; + CSTRemoteWriter *cstRemoteWriter=NULL; + CSTRemoteReader *cstRemoteReader=NULL; + CSChange *csChange; + ObjectEntryAID *objectEntryAID; + ObjectEntryOID *objectEntryOID; + + e_bit=rtps_msg[1] & 0x01; + p_bit=(rtps_msg[1] & 0x02)>>1; + a_bit=(rtps_msg[1] & 0x04)>>2; + submsg_len=*((u_int16_t*)(rtps_msg+2)); + conv_u16(&submsg_len,e_bit); + roid=*((ObjectId*)(rtps_msg+4)); /* readerObjectId */ + conv_u32(&roid,0); + woid=*((ObjectId*)(rtps_msg+8)); /* writerObjectId */ + conv_u32(&woid,0); + if (rtps_msg[1] & 0x08) { /* bit H */ + objectGUID.hid=*((HostId*)(rtps_msg+12)); /* HostId */ + conv_u32(&objectGUID.hid,0); + objectGUID.aid=*((AppId*)(rtps_msg+16)); /* AppId */ + conv_u32(&objectGUID.aid,0); + } else { + rtps_msg-=8; + objectGUID.hid=mi->sourceHostId; + objectGUID.aid=mi->sourceAppId; + } + objectGUID.oid=*((ObjectId*)(rtps_msg+20)); /* ObjectId */ + conv_u32(&objectGUID.oid,0); + sn=*((SequenceNumber*)(rtps_msg+24)); /* writerSN */ + conv_sn(&sn,e_bit); + writerGUID.hid=mi->sourceHostId; + writerGUID.aid=mi->sourceAppId; + writerGUID.oid=woid; + + debug(46,3) ("recv: RTPS_VAR(0x%x) from 0x%x-0x%x sn:%u\n", + woid,mi->sourceHostId,mi->sourceAppId,sn.low); + + //prepare csChange + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + csChange->cdrStream.buffer=NULL; + csChange->guid=objectGUID; + if (a_bit) csChange->alive=ORTE_TRUE; + else csChange->alive=ORTE_FALSE; + if (p_bit) + parameterDecodeStreamToCSChange(csChange,rtps_msg+32,submsg_len,e_bit); + else + CSChangeAttributes_init_head(csChange); + csChange->sn=sn; + SEQUENCE_NUMBER_NONE(csChange->gapSN); + + //Manager + if ((d->guid.aid & 0x03)==MANAGER) { + if ((writerGUID.oid==OID_WRITE_APPSELF) && + ((writerGUID.aid & 0x03)==MANAGER)) { + //readerManagers + pthread_rwlock_wrlock(&d->readerManagers.lock); + pthread_rwlock_wrlock(&d->writerApplicationSelf.lock); + cstReader=&d->readerManagers; + gavl_cust_for_each(CSTRemoteReader, + &d->writerApplicationSelf, + cstRemoteReader) { + if (cstRemoteReader->guid.hid==senderIPAddress) break; + } + if (cstRemoteReader) { + objectEntryOID=objectEntryFind(d,&objectGUID); + if (!objectEntryOID) { + // create new RemoteReader + AppParams *ap=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(ap); + parameterUpdateApplication(csChange,ap); + if (generateEvent(d,&objectGUID,(void*)ap,ORTE_TRUE) && + csChange->alive) { + debug(46,2) ("manager 0x%x-0x%x accepted\n", + objectGUID.hid,objectGUID.aid); + objectEntryOID=objectEntryAdd(d,&objectGUID,(void*)ap); + CSTWriterRefreshAllCSChanges(d,cstRemoteReader); + CSTReaderAddRemoteWriter(d,cstReader,objectEntryOID,writerGUID.oid); + pthread_rwlock_wrlock(&d->readerApplications.lock); + pthread_rwlock_wrlock(&d->writerApplications.lock); + CSTReaderAddRemoteWriter(d,&d->readerApplications,objectEntryOID,OID_WRITE_APP); + CSTWriterAddRemoteReader(d,&d->writerApplications,objectEntryOID,OID_READ_APP); + pthread_rwlock_unlock(&d->writerApplications.lock); + pthread_rwlock_unlock(&d->readerApplications.lock); + //all applications from manager node set expiration timer + gavl_cust_for_each(ObjectEntryAID, + objectEntryOID->objectEntryHID,objectEntryAID) { + objectEntryOID=ObjectEntryOID_find(objectEntryAID,&objectGUID.oid); + objectEntryRefreshApp(d,objectEntryOID); + } + } else { + FREE(ap); + } + } + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (cstRemoteWriter) + objectEntryRefreshApp(d,cstRemoteWriter->objectEntryOID); + } else { + //deny Manager + } + pthread_rwlock_unlock(&d->writerApplicationSelf.lock); + } + if (((writerGUID.oid==OID_WRITE_APPSELF) && + ((writerGUID.aid & 0x03)==MANAGEDAPPLICATION)) || + ((writerGUID.oid==OID_WRITE_APP) && + ((writerGUID.aid & 0x03)==MANAGER))) { + //readerApplication + pthread_rwlock_wrlock(&d->readerApplications.lock); + cstReader=&d->readerApplications; + objectEntryOID=objectEntryFind(d,&objectGUID); + if (!objectEntryOID) { + AppParams *ap=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(ap); + parameterUpdateApplication(csChange,ap); + if (generateEvent(d,&objectGUID,(void*)ap,ORTE_TRUE) && + csChange->alive) { + objectEntryOID=objectEntryAdd(d,&objectGUID,(void*)ap); + objectEntryOID->appMOM=getTypeApp(d,ap,senderIPAddress); + if (objectEntryOID->appMOM) { + debug(46,2) ("MOM application 0x%x-0x%x accepted\n", + objectGUID.hid,objectGUID.aid); + //increment vargAppsSequenceNumber and make csChange + SeqNumberInc(d->appParams->vargAppsSequenceNumber, + d->appParams->vargAppsSequenceNumber); + //WAS & WM is locked inside next function + appSelfParamChanged(d,ORTE_TRUE,ORTE_FALSE,ORTE_TRUE); + CSTReaderAddRemoteWriter(d,cstReader, + objectEntryOID,writerGUID.oid); + CSTWriterAddRemoteReader(d,&d->writerManagers, + objectEntryOID,OID_READ_MGR); + pthread_rwlock_unlock(&d->writerApplicationSelf.lock); + pthread_rwlock_unlock(&d->writerManagers.lock); + } else { + debug(46,2) ("OAM application 0x%x-0x%x accepted\n", + objectGUID.hid,objectGUID.aid); + } + pthread_rwlock_wrlock(&d->writerApplications.lock); + CSTWriterAddRemoteReader(d,&d->writerApplications,objectEntryOID,OID_READ_APP); + pthread_rwlock_unlock(&d->writerApplications.lock); + } else { + FREE(ap); + } + } + if (objectEntryOID) { + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (objectEntryOID->appMOM) { + objectEntryRefreshApp(d,objectEntryOID); + } else { + //turn off expiration timer + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + debug(46,3) ("for application 0x%x-0x%x turn off expiration timer\n", + objectEntryOID->guid.hid,objectEntryOID->guid.aid); + } + } + } + } + //ManagedApplication + if ((d->guid.aid & 3)==MANAGEDAPPLICATION) { + switch (writerGUID.oid) { + case OID_WRITE_MGR: + pthread_rwlock_wrlock(&d->readerManagers.lock); + cstReader=&d->readerManagers; + objectEntryOID=objectEntryFind(d,&objectGUID); + if (!objectEntryOID) { + AppParams *ap=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(ap); + parameterUpdateApplication(csChange,ap); + if (generateEvent(d,&objectGUID,(void*)ap,ORTE_TRUE) && + csChange->alive) { + debug(46,2) ("new manager 0x%x-0x%x accepted\n", + objectGUID.hid,objectGUID.aid); + objectEntryOID=objectEntryAdd(d,&objectGUID,(void*)ap); + objectEntryOID->private=ORTE_FALSE; + pthread_rwlock_wrlock(&d->readerApplications.lock); + CSTReaderAddRemoteWriter(d,&d->readerApplications, + objectEntryOID,OID_WRITE_APP); + pthread_rwlock_unlock(&d->readerApplications.lock); + //all applications from manager node set expiration timer + gavl_cust_for_each(ObjectEntryAID, + objectEntryOID->objectEntryHID,objectEntryAID) { + objectEntryOID=ObjectEntryOID_find(objectEntryAID,&objectGUID.oid); + objectEntryRefreshApp(d,objectEntryOID); + } + } else { + FREE(ap); + } + } else { + GUID_RTPS guid_wapp=objectGUID; + guid_wapp.oid=OID_WRITE_APP; + pthread_rwlock_wrlock(&d->readerApplications.lock); + cstRemoteWriter=CSTRemoteWriter_find(&d->readerApplications,&guid_wapp); + //setup state of cstRemoteWriter on send ACK to manager + if (cstRemoteWriter) { + if (cstRemoteWriter->commStateACK==WAITING) { + eventDetach(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1); //metatraffic timer + eventAdd(d, + cstRemoteWriter->objectEntryOID->objectEntryAID, + &cstRemoteWriter->repeatActiveQueryTimer, + 1, //metatraffic timer + "CSTReaderQueryTimer", + CSTReaderQueryTimer, + &cstRemoteWriter->cstReader->lock, + cstRemoteWriter, + NULL); + } + } + pthread_rwlock_unlock(&d->readerApplications.lock); + } + objectEntryRefreshApp(d,objectEntryOID); + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if ((!cstRemoteWriter) && + (objectGUID.hid==writerGUID.hid) && (objectGUID.aid==writerGUID.aid)) { + cstRemoteWriter= + CSTReaderAddRemoteWriter(d,cstReader,objectEntryOID,writerGUID.oid); + } + break; + case OID_WRITE_APP: + pthread_rwlock_wrlock(&d->readerApplications.lock); + cstReader=&d->readerApplications; + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (cstRemoteWriter) { + GUID_RTPS guid_tmp=objectGUID; + guid_tmp.oid=OID_WRITE_PUBL; + objectEntryOID=objectEntryFind(d,&objectGUID); + if (!CSTRemoteWriter_find(&d->readerPublications,&guid_tmp)) { + if (!objectEntryOID) { + AppParams *ap=(AppParams*)MALLOC(sizeof(AppParams)); + AppParamsInit(ap); + parameterUpdateApplication(csChange,ap); + if (generateEvent(d,&objectGUID,(void*)ap,ORTE_TRUE) && + csChange->alive) { + debug(46,2) ("new application 0x%x-0x%x accepted\n", + objectGUID.hid,objectGUID.aid); + objectEntryOID=objectEntryAdd(d,&objectGUID,(void*)ap); + objectEntryOID->private=ORTE_FALSE; + } else { + FREE(ap); + break; + } + } + pthread_rwlock_wrlock(&d->readerPublications.lock); + pthread_rwlock_wrlock(&d->readerSubscriptions.lock); + pthread_rwlock_wrlock(&d->writerPublications.lock); + pthread_rwlock_wrlock(&d->writerSubscriptions.lock); + CSTReaderAddRemoteWriter(d,&d->readerPublications, + objectEntryOID,OID_WRITE_PUBL); + CSTReaderAddRemoteWriter(d,&d->readerSubscriptions, + objectEntryOID,OID_WRITE_SUBS); + CSTWriterAddRemoteReader(d,&d->writerPublications, + objectEntryOID,OID_READ_PUBL); + CSTWriterAddRemoteReader(d,&d->writerSubscriptions, + objectEntryOID,OID_READ_SUBS); + pthread_rwlock_unlock(&d->readerPublications.lock); + pthread_rwlock_unlock(&d->readerSubscriptions.lock); + pthread_rwlock_unlock(&d->writerPublications.lock); + pthread_rwlock_unlock(&d->writerSubscriptions.lock); + } + if (objectEntryOID) { + //turn off expiration timer + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + debug(46,3) ("for application 0x%x-0x%x turn off expiration timer\n", + objectEntryOID->guid.hid, + objectEntryOID->guid.aid); + } + } + break; + case OID_WRITE_PUBL: + pthread_rwlock_wrlock(&d->readerPublications.lock); + cstReader=&d->readerPublications; + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (cstRemoteWriter) { + objectEntryOID=objectEntryFind(d,&objectGUID); + if (!objectEntryOID) { + ORTEPublProp *pp=(ORTEPublProp*)MALLOC(sizeof(ORTEPublProp)); + PublParamsInit(pp); + parameterUpdatePublication(csChange,pp); + if (generateEvent(d,&objectGUID,(void*)pp,ORTE_TRUE) && + csChange->alive) { + debug(46,2) ("new publisher 0x%x-0x%x-0x%x accepted\n", + objectGUID.hid,objectGUID.aid,objectGUID.oid); + objectEntryOID=objectEntryAdd(d,&objectGUID,(void*)pp); + objectEntryOID->private=ORTE_FALSE; + pthread_rwlock_wrlock(&d->psEntry.publicationsLock); + PublicationList_insert(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.publicationsLock); + NewPublisher(d,objectEntryOID); + } else + FREE(pp); + } else { + if (!PublicationList_find(&d->psEntry,&objectGUID)) { + pthread_rwlock_wrlock(&d->psEntry.publicationsLock); + PublicationList_insert(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.publicationsLock); + NewPublisher(d,objectEntryOID); + } + } + } + break; + case OID_WRITE_SUBS: + pthread_rwlock_wrlock(&d->readerSubscriptions.lock); + cstReader=&d->readerSubscriptions; + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&writerGUID); + if (cstRemoteWriter) { + objectEntryOID=objectEntryFind(d,&objectGUID); + if (!objectEntryOID) { + ORTESubsProp *sp=(ORTESubsProp*)MALLOC(sizeof(ORTESubsProp)); + SubsParamsInit(sp); + parameterUpdateSubscription(csChange,sp); + if (generateEvent(d,&objectGUID,(void*)sp,ORTE_TRUE) && + csChange->alive) { + debug(46,2) ("new subscriber 0x%x-0x%x-0x%x accepted\n", + objectGUID.hid,objectGUID.aid,objectGUID.oid); + objectEntryOID=objectEntryAdd(d,&objectGUID,(void*)sp); + objectEntryOID->private=ORTE_FALSE; + pthread_rwlock_wrlock(&d->psEntry.subscriptionsLock); + SubscriptionList_insert(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.subscriptionsLock); + NewSubscriber(d,objectEntryOID); + } else + FREE(sp); + } else { + if (!SubscriptionList_find(&d->psEntry,&objectGUID)) { + pthread_rwlock_wrlock(&d->psEntry.subscriptionsLock); + SubscriptionList_insert(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.subscriptionsLock); + NewSubscriber(d,objectEntryOID); + } + } + } + break; + } + } + if (!cstReader) return; + if (!cstRemoteWriter) { + pthread_rwlock_unlock(&cstReader->lock); + return; + } + debug(46,10) ("recv: processing CSChange\n"); + if (SeqNumberCmp(sn,cstRemoteWriter->sn)>0) { //have to be sn>writer_sn + CSTReaderAddCSChange(cstRemoteWriter,csChange); + CSTReaderProcCSChanges(d,cstRemoteWriter); + } else { + //destroy csChange + parameterDelete(csChange); + FREE(csChange); + } + pthread_rwlock_unlock(&cstReader->lock); +} + + +/**********************************************************************************/ +void +NewPublisher(ORTEDomain *d,ObjectEntryOID *op) { + ObjectEntryOID *o; + ORTEPublProp *pp; + CSTWriter *cstWriter; + CSTReader *cstReader; + + if ((d==NULL) || (op==NULL)) return; + pp=(ORTEPublProp*)op->attributes; + pthread_rwlock_rdlock(&d->psEntry.subscriptionsLock); + gavl_cust_for_each(SubscriptionList,&d->psEntry,o) { + ORTESubsProp *sp=(ORTESubsProp*)o->attributes; + if ((strcmp(pp->topic,sp->topic)==0) && + (strcmp(pp->typeName,sp->typeName)==0) && + (pp->typeChecksum==sp->typeChecksum)) { + //add Subscription to Publisher (only if private) + if (op->private) { + pthread_rwlock_rdlock(&d->publications.lock); + if ((cstWriter=CSTWriter_find(&d->publications,&op->guid))) { + pthread_rwlock_wrlock(&cstWriter->lock); + if (!CSTRemoteReader_find(cstWriter,&o->guid)) { + CSTWriterAddRemoteReader(d,cstWriter,o,o->oid); + debug(46,2) ("0x%x-0x%x-0x%x accepted 0x%x-0x%x-0x%x\n", + op->guid.hid,op->guid.aid,op->guid.oid, + o->guid.hid,o->guid.aid,o->guid.oid); + } + pthread_rwlock_unlock(&cstWriter->lock); + } + pthread_rwlock_unlock(&d->publications.lock); + } + //add Publisher to Subscriber (only if private) + if (o->private) { + pthread_rwlock_rdlock(&d->subscriptions.lock); + if ((cstReader=CSTReader_find(&d->subscriptions,&o->guid))) { + pthread_rwlock_wrlock(&cstReader->lock); + if (!CSTRemoteWriter_find(cstReader,&op->guid)) { + CSTReaderAddRemoteWriter(d,cstReader,op,op->oid); + debug(46,2) ("0x%x-0x%x-0x%x accepted 0x%x-0x%x-0x%x\n", + o->guid.hid,o->guid.aid,o->guid.oid, + op->guid.hid,op->guid.aid,op->guid.oid); + } + pthread_rwlock_unlock(&cstReader->lock); + } + pthread_rwlock_unlock(&d->subscriptions.lock); + } + } + } + pthread_rwlock_unlock(&d->psEntry.subscriptionsLock); +} + +/**********************************************************************************/ +void +NewSubscriber(ORTEDomain *d,ObjectEntryOID *os) { + ObjectEntryOID *o; + ORTESubsProp *sp; + CSTWriter *cstWriter; + CSTReader *cstReader; + + if ((d==NULL) || (os==NULL)) return; + sp=(ORTESubsProp*)os->attributes; + pthread_rwlock_rdlock(&d->psEntry.publicationsLock); + gavl_cust_for_each(PublicationList,&d->psEntry,o) { + ORTEPublProp *pp=(ORTEPublProp*)o->attributes; + if ((strcmp(sp->topic,pp->topic)==0) && + (strcmp(sp->typeName,pp->typeName)==0) && + (sp->typeChecksum==pp->typeChecksum)) { + //add Publication to Subscription (only if private) + if (os->private) { + pthread_rwlock_rdlock(&d->subscriptions.lock); + if ((cstReader=CSTReader_find(&d->subscriptions,&os->guid))) { + pthread_rwlock_wrlock(&cstReader->lock); + if (!CSTRemoteWriter_find(cstReader,&o->guid)) { + CSTReaderAddRemoteWriter(d,cstReader,o,o->oid); + debug(46,2) ("0x%x-0x%x-0x%x accepted 0x%x-0x%x-0x%x\n", + os->guid.hid,os->guid.aid,os->guid.oid, + o->guid.hid,o->guid.aid,o->guid.oid); + } + pthread_rwlock_unlock(&cstReader->lock); + } + pthread_rwlock_unlock(&d->subscriptions.lock); + } + //add Subscriber to Publisher (only if private) + if (o->private) { + pthread_rwlock_rdlock(&d->publications.lock); + if ((cstWriter=CSTWriter_find(&d->publications,&o->guid))) { + pthread_rwlock_wrlock(&cstWriter->lock); + if (!CSTRemoteReader_find(cstWriter,&os->guid)) { + CSTWriterAddRemoteReader(d,cstWriter,os,os->oid); + debug(46,2) ("0x%x-0x%x-0x%x accepted 0x%x-0x%x-0x%x\n", + o->guid.hid,o->guid.aid,o->guid.oid, + os->guid.hid,os->guid.aid,os->guid.oid); + } + pthread_rwlock_unlock(&cstWriter->lock); + } + pthread_rwlock_unlock(&d->publications.lock); + } + } + } + pthread_rwlock_unlock(&d->psEntry.publicationsLock); +} diff --git a/orte/liborte/conv.c b/orte/liborte/conv.c new file mode 100644 index 0000000..5dbb76d --- /dev/null +++ b/orte/liborte/conv.c @@ -0,0 +1,92 @@ +/* + * $Id: conv.c,v 0.0.0.1 2003/09/10 + * + * DEBUG: section 7 ordering conversion + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This module maintains a hash table of key/value pairs. + * Keys can be strings of any size, or numbers up to size + * unsigned long (HASHKEYTYPE). + * Values should be a pointer to some data you wish to store. + * + */ + +#include "orte.h" + +/**********************************************************************************/ +void conv_u16(u_int16_t *x,char ef) { + #if WORDS_BIGENDIAN + if(ef) *x=bswap_16(*x); + #else + if(!ef) *x=bswap_16(*x); + #endif +} + +/**********************************************************************************/ +void conv_u32(u_int32_t *x,char ef) { + #if WORDS_BIGENDIAN + if(ef) *x=bswap_32(*x); + #else + if(!ef) *x=bswap_32(*x); + #endif +} + +/**********************************************************************************/ +void conv_sn(SequenceNumber *sn,char ef) { + #if WORDS_BIGENDIAN + if(ef) { + sn->high=bswap_32(sn->high); + sn->low=bswap_32(sn->low); + } + #else + if(!ef) { + sn->high=bswap_32(sn->high); + sn->low=bswap_32(sn->low); + } + #endif +} + +/**********************************************************************************/ +void conv_ntp(NtpTime *ntp,char ef) { + #if WORDS_BIGENDIAN + if(ef) { + ntp->seconds=bswap_32(ntp->seconds); + ntp->fraction=bswap_32(ntp->fraction); + } + #else + if(!ef) { + ntp->seconds=bswap_32(ntp->seconds); + ntp->fraction=bswap_32(ntp->fraction); + } + #endif +} + +/**********************************************************************************/ +char* +IPAddressToString(IPAddress ipAddress) { + struct in_addr addr; + static char result[MAX_STRING_IPADDRESS_LENGTH]; + + addr.s_addr=htonl(ipAddress); + sprintf(result,"%s",inet_ntoa(addr)); + return result; +} + +/**********************************************************************************/ +IPAddress +StringToIPAddress(const char *string) { + return ntohl(inet_addr((char *)string)); +} diff --git a/orte/liborte/debug.c b/orte/liborte/debug.c new file mode 100644 index 0000000..f928119 --- /dev/null +++ b/orte/liborte/debug.c @@ -0,0 +1,176 @@ +/* + * $Id: debug.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 1 Debug + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/* global debug variables */ +int db_level; +int debugLevels[MAX_DEBUG_SECTIONS]; +int mem_check_counter=0; +NtpTime zNtpTime,iNtpTime; +SequenceNumber noneSN; + +/*********************************************************************/ +/* forvard declarations */ +static void +db_print_output(const char *format); + +/*********************************************************************/ +/* globals */ + +#ifndef __RTL__ +FILE *debug_log=NULL; /* NULL */ +#endif + +/*********************************************************************/ +/* functions */ + +#ifdef __RTL__ +static const char * +debug_log_time(void) { + struct timespec time; + static char buf[64]; + + clock_gettime(CLOCK_REALTIME, &time); + sprintf(buf, "%li.%03li", time.tv_sec,time.tv_nsec/1000000); + return buf; +} +#else +static const char * +debug_log_time(void) { + struct timeval time; + static char buf[64]; + + gettimeofday(&time,NULL); + sprintf(buf, "%li.%03li", time.tv_sec,time.tv_usec/1000); + return buf; +} +#endif /* __RTL__ */ + +void +db_print(const char *format,...) { + char f[256]; + va_list ap; + + va_start(ap, format); + sprintf(f, "%s | ",debug_log_time()); + vsprintf(f+strlen(f),format,ap); + va_end(ap); + db_print_output(f); +} + +void +db_print_output(const char *format) { +#ifndef __RTL__ + if (debug_log == NULL) return; + fprintf(debug_log, format); + fflush(debug_log); +#else + rtl_printf(format); +#endif +} + +void +debug_arg(const char *arg) { + int32_t s=0,l=0,i; + + if (!strncmp(arg, "ALL", 3)) { + s = -1; + arg += 4; + } else { + s = atoi(arg); + while (*arg && *arg++ != ','); + } + l = atoi(arg); + if (l < 0) l = 0; + if (l > 10) l = 10; + if (s >= 0) { + debugLevels[s] = l; + return; + } + for (i = 0; i < MAX_DEBUG_SECTIONS; i++) + debugLevels[i] = l; +} + +void +debug_options(const char *options) { + char *p = NULL; + char *s = NULL; + + if (options) { + p = strdup((char *)options); + for (s = strtok(p, ":"); s; s = strtok(NULL, ":")) + debug_arg(s); + free(p); + } +} + +void +debug_open_log(const char *logfile) { +#ifndef __RTL__ + if (logfile == NULL) { + debug_log = stderr; + return; + } + if (debug_log && debug_log != stderr) + fclose(debug_log); + debug_log = fopen(logfile, "a+"); + if (!debug_log) { + fprintf(stderr, "WARNING: Cannot write log file: %s\n", logfile); + perror(logfile); + fprintf(stderr, " messages will be sent to 'stderr'.\n"); + fflush(stderr); + debug_log = stderr; + } +#endif +} + +void +db_init(const char *logfile, const char *options) { + int i; + + for (i = 0; i < MAX_DEBUG_SECTIONS; i++) + debugLevels[i] = -1; + debug_options(options); + debug_open_log(logfile); +} + +#ifdef ENABLE_MEM_CHECK +void *mem_check_malloc(size_t size) { + void *ptr; + + if ((ptr=malloc(size))) { + mem_check_counter++; + debug(1,9) ("mem check: inc %d\n",mem_check_counter); + } + return ptr; +} + +void mem_check_free(void *ptr) { + if(!ptr) { +// LOG_FATAL(KERN_CRIT "ul_mem_check_free : triing to free NULL ptr\n"); + }else{ + mem_check_counter--; + debug(1,9) ("mem check: dec %d\n",mem_check_counter); + free(ptr); + } +} +#endif /* ENABLE_MEM_CHECK */ diff --git a/orte/liborte/event.c b/orte/liborte/event.c new file mode 100644 index 0000000..ec4f6db --- /dev/null +++ b/orte/liborte/event.c @@ -0,0 +1,124 @@ +/* + * $Id: events.c,v 0.0.0.1 2003/09/19 + * + * DEBUG: section 10 Event system based on htimerNtp + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundtion; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/* + * ORTEEventAdd - add a event into event system (root and application) + * @d: pointer to Domain + * @otAID: pointer to objectTreeAID or NULL for multicast event + * @fncNode: pointer on structure fncNode or NULL + * @where: in which timer queue is the event added + * 0-UnicastCommon,1-UnicastSendMetatraffic,2-UnicastSendUserdata + * @name: name called function + * @lock: pointer on lock or NULL for unprotected agruments + * @func: pointer to called function + * @arg1: first function argument + * @when: time when is needed call the function + * + */ +int32_t +eventAdd(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + HTimFncUserNode *fncNode, + int where, + const char *name, + EVH2 *func, + pthread_rwlock_t *lock, + void *arg1, + NtpTime *when) { + NtpTime whenExpire,actualTime; + + debug(10,10) ("eventAdd: start %p %s\n",objectEntryAID,name); + actualTime=getActualNtpTime(); + if (when!=NULL) { + NtpTimeAdd(whenExpire,actualTime,*when); + } else { + whenExpire=actualTime; + } + if (!fncNode) { + fncNode=(HTimFncUserNode*)MALLOC(sizeof(HTimFncUserNode)); + htimerUnicastCommon_init_detached(fncNode); + } + fncNode->name=name; + fncNode->lock=lock; + fncNode->func=func; + fncNode->arg1=arg1; + switch (where) { + case 0: + htimerUnicastCommon_set_expire(fncNode,whenExpire); + htimerUnicastCommon_add(objectEntryAID,fncNode); + htimerUnicastCommon_update_root_timer(&d->objectEntry,objectEntryAID); + break; + case 1: + htimerUnicastSendMetatraffic_set_expire(fncNode,whenExpire); + htimerUnicastSendMetatraffic_add(objectEntryAID,fncNode); + htimerUnicastSendMetatraffic_update_root_timer(&d->objectEntry,objectEntryAID); + break; + case 2: + htimerUnicastSendUserData_set_expire(fncNode,whenExpire); + htimerUnicastSendUserData_add(objectEntryAID,fncNode); + htimerUnicastSendUserData_update_root_timer(&d->objectEntry,objectEntryAID); + break; + default: + FREE(fncNode); + return ORTE_FALSE; + break; + } + debug(10,10) ("eventAdd: finished\n"); + return ORTE_TRUE; +} + +/* + * ORTEEventDetach - detach a event from event system (root and application) + * @d: pointer to Domain + * @otAID: pointer to objectTreeAID + * @fncNode: pointer on structure fncNode or NULL + * @where: from which timer queue is the event detached + * 0-UnicastCommon,1-UnicastSendMetatraffic,2-UnicastSendUserdata + * + */ +int32_t +eventDetach(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + HTimFncUserNode *fncNode, + int where) { + debug(10,10) ("eventDetach: start %p\n",objectEntryAID); + switch (where) { + case 0: + htimerUnicastCommon_detach(objectEntryAID,fncNode); + htimerUnicastCommon_update_root_timer(&d->objectEntry,objectEntryAID); + break; + case 1: + htimerUnicastSendMetatraffic_detach(objectEntryAID,fncNode); + htimerUnicastSendMetatraffic_update_root_timer(&d->objectEntry,objectEntryAID); + break; + case 2: + htimerUnicastSendUserData_detach(objectEntryAID,fncNode); + htimerUnicastSendUserData_update_root_timer(&d->objectEntry,objectEntryAID); + break; + default: + return ORTE_FALSE; + break; + } + debug(10,10) ("eventDetach: finished\n"); + return ORTE_TRUE; +} diff --git a/orte/liborte/fnmatch.c b/orte/liborte/fnmatch.c new file mode 100644 index 0000000..753c647 --- /dev/null +++ b/orte/liborte/fnmatch.c @@ -0,0 +1,178 @@ +/* + * $Id: fnmatch.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 3 + * AUTHOR: xxx, Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/* Match STRING against the filename pattern PATTERN, returning zero if + it matches, nonzero if not. */ +int +fnmatch (const char *pattern,const char *string,int flags ) { + register const char *p = pattern, *n = string; + register unsigned char c; + +/* Note that this evalutes C many times. */ +#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) + +#ifdef _WIN32_ORTE + flags |= FNM_CASEFOLD; +#endif + + while ((c = *p++) != '\0') + { + c = FOLD (c); + + switch (c) { + case '?': + if (*n == '\0') + return FNM_NOMATCH; + else if ((flags & FNM_FILE_NAME) && *n == '/') + return FNM_NOMATCH; + else if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + break; + + case '\\': + if (!(flags & FNM_NOESCAPE)) + { + c = *p++; + c = FOLD (c); + } + if (FOLD ((unsigned char)*n) != c) + return FNM_NOMATCH; + break; + + case '*': + if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + + for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) + if (((flags & FNM_FILE_NAME) && *n == '/') || + (c == '?' && *n == '\0')) + return FNM_NOMATCH; + + if (c == '\0') + return 0; + + { + unsigned char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; + c1 = FOLD (c1); + for (--p; *n != '\0'; ++n) + if ((c == '[' || FOLD ((unsigned char)*n) == c1) && + fnmatch (p, n, flags & ~FNM_PERIOD) == 0) + return 0; + return FNM_NOMATCH; + } + + case '[': + { + /* Nonzero if the sense of the character class is inverted. */ + register int not; + + if (*n == '\0') + return FNM_NOMATCH; + + if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + + not = (*p == '!' || *p == '^'); + if (not) + ++p; + + c = *p++; + for (;;) { + register unsigned char cstart = c, cend = c; + + if (!(flags & FNM_NOESCAPE) && c == '\\') + cstart = cend = *p++; + + cstart = cend = FOLD (cstart); + + if (c == '\0') + /* [ (unterminated) loses. */ + return FNM_NOMATCH; + + c = *p++; + c = FOLD (c); + + if ((flags & FNM_FILE_NAME) && c == '/') + /* [/] can never match. */ + return FNM_NOMATCH; + + if (c == '-' && *p != ']') + { + cend = *p++; + if (!(flags & FNM_NOESCAPE) && cend == '\\') + cend = *p++; + if (cend == '\0') + return FNM_NOMATCH; + cend = FOLD (cend); + + c = *p++; + } + + if (FOLD ((unsigned char)*n) >= cstart + && FOLD ((unsigned char)*n) <= cend) + goto matched; + + if (c == ']') + break; + } + if (!not) + return FNM_NOMATCH; + break; + + matched:; + /* Skip the rest of the [...] that already matched. */ + while (c != ']') { + if (c == '\0') + /* [... (unterminated) loses. */ + return FNM_NOMATCH; + + c = *p++; + if (!(flags & FNM_NOESCAPE) && c == '\\') + /* XXX 1003.2d11 is unclear if this is right. */ + ++p; + } + if (not) + return FNM_NOMATCH; + } + break; + + default: + if (c != FOLD ((unsigned char)*n)) + return FNM_NOMATCH; + } // switch (c) + + ++n; + } + + if (*n == '\0') + return 0; + + if ((flags & FNM_LEADING_DIR) && *n == '/') + /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ + return 0; + + return FNM_NOMATCH; +} diff --git a/orte/liborte/htimerNtp.c b/orte/liborte/htimerNtp.c new file mode 100644 index 0000000..2b4f6b9 --- /dev/null +++ b/orte/liborte/htimerNtp.c @@ -0,0 +1,246 @@ +/* + * $Id: htimerNtp.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 2 HTimer for NtpTime + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +GAVL_FLES_INT_DEC(ul_htim_queue, ul_htim_queue_t, ul_htim_node_t, ul_htim_time_t, + timers, node, expires, ul_htimer_cmp_fnc) + + +GAVL_FLES_INT_IMP(ul_htim_queue, ul_htim_queue_t, ul_htim_node_t, ul_htim_time_t, + timers, node, expires, ul_htimer_cmp_fnc, GAVL_FAFTER, + root->first_changed=1,/**/,root->first_changed=1) + +/*****************************************************************************/ +UL_HTIMER_IMP(htimerRoot, \ + ObjectEntry, \ + HTimFncRootNode, \ + htimRoot, \ + htim) +void +htimerRoot_run_expired(ORTEDomain *d, + ul_htim_time_t *pact_time) { + HTimFncRootNode *timer; + + while((timer=htimerRoot_cut_expired(&d->objectEntry, pact_time))){ + timer->func(d,timer->objectEntryAID,pact_time); + } +} + +/*****************************************************************************/ +UL_HTIMER_IMP(htimerUnicastCommon, \ + ObjectEntryAID, \ + HTimFncUserNode, \ + htimUnicast.common, \ + htim) + +void +htimerUnicastCommon_update_root_timer(ObjectEntry *objectEntry, + ObjectEntryAID *objectEntryAID) { + NtpTime nextExpire; + + //if first item is changed -> update root timer queue + if (htimerUnicastCommon_first_changed(objectEntryAID)) { + //deatach old timer from this queue (if any) + htimerRoot_detach(objectEntry, + &objectEntryAID->htimUnicast.commonNode); + if (htimerUnicastCommon_next_expire(objectEntryAID,&nextExpire)!=0) { + //setup new values + objectEntryAID->htimUnicast.commonNode.func= + htimerUnicastCommon_run_expired; + objectEntryAID->htimUnicast.commonNode.objectEntryAID= + objectEntryAID; + htimerRoot_set_expire( + &objectEntryAID->htimUnicast.commonNode, + nextExpire); + //insert new timer to root htimer node + htimerRoot_add(objectEntry, + &objectEntryAID->htimUnicast.commonNode); + debug(2,10) ("htimerUnicastCommon: root updated, wakeup\n"); + //wake-up sending thread to process event + ORTEDomainWakeUpSendingThread(objectEntry); + } + } +} + +void +htimerUnicastCommon_run_expired(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + ul_htim_time_t *pact_time) { + HTimFncUserNode *timer; + int retValue; + pthread_rwlock_t *lock; + + while((timer=htimerUnicastCommon_cut_expired(objectEntryAID, pact_time))){ + if ((lock=timer->lock)) //after proc. timer->func can be timer freed + pthread_rwlock_wrlock(timer->lock); + debug(2,10) ("htimerUnicastCommon: %s\n", + timer->name); + retValue=timer->func(d,timer->arg1); + if (lock) + pthread_rwlock_unlock(timer->lock); + if (retValue==2) //object deleted + return; + } + htimerUnicastCommon_update_root_timer(&d->objectEntry,objectEntryAID); +} + +/*****************************************************************************/ +UL_HTIMER_IMP(htimerUnicastSendMetatraffic, \ + ObjectEntryAID, \ + HTimFncUserNode, \ + htimUnicast.sendMetatraffic, \ + htim) + +void +htimerUnicastSendMetatraffic_update_root_timer(ObjectEntry *objectEntry, + ObjectEntryAID *objectEntryAID) { + NtpTime nextExpire; + + //if first item is changed -> update root timer queue + if (htimerUnicastSendMetatraffic_first_changed(objectEntryAID)) { + //deatach old timer from this queue (if any) + htimerRoot_detach(objectEntry, + &objectEntryAID->htimUnicast.sendMetatrafficNode); + if (htimerUnicastSendMetatraffic_next_expire(objectEntryAID,&nextExpire)!=0) { + //setup new values + objectEntryAID->htimUnicast.sendMetatrafficNode.func= + htimerUnicastSendMetatraffic_run_expired; + objectEntryAID->htimUnicast.sendMetatrafficNode.objectEntryAID= + objectEntryAID; + htimerRoot_set_expire( + &objectEntryAID->htimUnicast.sendMetatrafficNode, + nextExpire); + //insert new timer to root htimer node + htimerRoot_add(objectEntry, + &objectEntryAID->htimUnicast.sendMetatrafficNode); + debug(2,10) ("htimerUnicastMetatraffic: root updated, wakeup\n"); + //wake-up sending thread to process event + ORTEDomainWakeUpSendingThread(objectEntry); + } + } +} + +void +htimerUnicastSendMetatraffic_run_expired(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + ul_htim_time_t *pact_time) { + HTimFncUserNode *timer; + int retValue; + + while((timer=htimerUnicastSendMetatraffic_cut_expired(objectEntryAID, pact_time))){ + if (timer->lock) + pthread_rwlock_wrlock(timer->lock); + debug(2,10) ("htimerUnicastMetatraffic: %s\n", + timer->name); + retValue=timer->func(d,timer->arg1); + while (d->mbSend.needSend) { + ORTESendData(d,objectEntryAID,ORTE_TRUE); + timer->func(d,timer->arg1); + } + if (timer->lock) + pthread_rwlock_unlock(timer->lock); + } + htimerUnicastSendMetatraffic_update_root_timer(&d->objectEntry,objectEntryAID); + if (d->mbSend.cdrStream.length>RTPS_HEADER_LENGTH) { + ORTESendData(d,objectEntryAID,ORTE_TRUE); + } +} + +/*****************************************************************************/ +UL_HTIMER_IMP(htimerUnicastSendUserData, \ + ObjectEntryAID, \ + HTimFncUserNode, \ + htimUnicast.sendUserData, \ + htim) + +void +htimerUnicastSendUserData_update_root_timer(ObjectEntry *objectEntry, + ObjectEntryAID *objectEntryAID) { + NtpTime nextExpire; + + //if first item is changed -> update root timer queue + if (htimerUnicastSendUserData_first_changed(objectEntryAID)) { + //deatach old timer from this queue (if any) + htimerRoot_detach(objectEntry, + &objectEntryAID->htimUnicast.sendUserDataNode); + if (htimerUnicastSendUserData_next_expire(objectEntryAID,&nextExpire)!=0) { + //setup new values + objectEntryAID->htimUnicast.sendUserDataNode.func= + htimerUnicastSendUserData_run_expired; + objectEntryAID->htimUnicast.sendUserDataNode.objectEntryAID= + objectEntryAID; + htimerRoot_set_expire( + &objectEntryAID->htimUnicast.sendUserDataNode, + nextExpire); + //insert new timer to root htimer node + htimerRoot_add(objectEntry, + &objectEntryAID->htimUnicast.sendUserDataNode); + debug(2,10) ("htimerUnicastUserdata: root updated, wakeup\n"); + //wake-up sending thread to process event + ORTEDomainWakeUpSendingThread(objectEntry); + } + } +} + +void +htimerUnicastSendUserData_run_expired(ORTEDomain *d, + ObjectEntryAID *objectEntryAID, + ul_htim_time_t *pact_time) { + HTimFncUserNode *timer; + int retValue; + + while((timer=htimerUnicastSendUserData_cut_expired(objectEntryAID, pact_time))){ + if (timer->lock) + pthread_rwlock_wrlock(timer->lock); + retValue=timer->func(d,timer->arg1); + while (d->mbSend.needSend) { + ORTESendData(d,objectEntryAID,ORTE_FALSE); + timer->func(d,timer->arg1); + } + if (timer->lock) + pthread_rwlock_unlock(timer->lock); + } + htimerUnicastSendUserData_update_root_timer(&d->objectEntry,objectEntryAID); + if (d->mbSend.cdrStream.length>RTPS_HEADER_LENGTH) { + ORTESendData(d,objectEntryAID,ORTE_FALSE); + } +} + +/*********************************************************************/ +NtpTime +getActualNtpTime(void) { + NtpTime result; +#ifndef __RTL__ + struct timeval time; + + gettimeofday(&time,NULL); + NtpTimeAssembFromUs(result,time.tv_sec,time.tv_usec); + NtpTimeAssembFromUs(result,time.tv_sec,time.tv_usec); +#else + struct timespec time; + + clock_gettime(CLOCK_REALTIME, &time); + time.tv_nsec/=1000; //conver to us + NtpTimeAssembFromUs(result,time.tv_sec,time.tv_nsec); +#endif + return result; +} diff --git a/orte/liborte/msvc/liborte.dsp b/orte/liborte/msvc/liborte.dsp new file mode 100644 index 0000000..086e195 --- /dev/null +++ b/orte/liborte/msvc/liborte.dsp @@ -0,0 +1,269 @@ +# Microsoft Developer Studio Project File - Name="liborte" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=liborte - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "liborte.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "liborte.mak" CFG="liborte - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "liborte - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "liborte - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "liborte - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "_ORTE_WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../../include/win32" /YX /FD /c +# ADD BASE RSC /l 0x405 /d "NDEBUG" +# ADD RSC /l 0x405 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "liborte - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_ORTE_WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../include/win32" /YX /FD /GZ /c +# SUBTRACT CPP /WX /Fr +# ADD BASE RSC /l 0x405 /d "_DEBUG" +# ADD RSC /l 0x405 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "liborte - Win32 Release" +# Name "liborte - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\conv.c +# End Source File +# Begin Source File + +SOURCE=..\debug.c +# End Source File +# Begin Source File + +SOURCE=..\event.c +# End Source File +# Begin Source File + +SOURCE=..\fnmatch.c +# End Source File +# Begin Source File + +SOURCE=..\globals.c +# End Source File +# Begin Source File + +SOURCE=..\htimerNtp.c +# End Source File +# Begin Source File + +SOURCE=..\objectEntry.c +# End Source File +# Begin Source File + +SOURCE=..\objectEntryTimer.c +# End Source File +# Begin Source File + +SOURCE=..\objectUtils.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEAppRecvMetatrafficThread.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEAppRecvUserdataThread.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEAppSendThread.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEDomain.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEDomainApp.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEDomainMgr.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEInit.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEPattern.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEPublication.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEPublicationTimer.c +# End Source File +# Begin Source File + +SOURCE=..\ORTESubscription.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEThreadUtils.c +# End Source File +# Begin Source File + +SOURCE=..\ORTETypeRegister.c +# End Source File +# Begin Source File + +SOURCE=..\ORTEVerbosity.c +# End Source File +# Begin Source File + +SOURCE=..\parameter.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSAck.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSCSTReader.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSCSTReaderProc.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSCSTReaderTimer.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSCSTWriter.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSCSTWriterTimer.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSGap.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSHeader.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSHeardBeat.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSInfoDST.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSInfoREPLY.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSInfoSRC.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSInfoTS.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSIssue.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSPad.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSUtils.c +# End Source File +# Begin Source File + +SOURCE=..\RTPSVar.c +# End Source File +# Begin Source File + +SOURCE=..\sock.c +# End Source File +# Begin Source File + +SOURCE=..\ul_gavl.c +# End Source File +# Begin Source File + +SOURCE=..\ul_gavlprim.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# End Target +# End Project diff --git a/orte/liborte/msvc/liborte.dsw b/orte/liborte/msvc/liborte.dsw new file mode 100644 index 0000000..48ba699 --- /dev/null +++ b/orte/liborte/msvc/liborte.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "liborte"=".\liborte.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/orte/liborte/objectEntry.c b/orte/liborte/objectEntry.c new file mode 100644 index 0000000..398ea81 --- /dev/null +++ b/orte/liborte/objectEntry.c @@ -0,0 +1,232 @@ + /* + * $Id: objectEntry.c,v 0.0.0.1 2003/09/10 + * + * DEBUG: section 8 Functions with database of objects + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +// Implementation of GAVL functions +GAVL_CUST_NODE_INT_IMP(ObjectEntryHID, ObjectEntry, ObjectEntryHID, HostId, + objRoot, hidNode, hid, gavl_cmp_int) +GAVL_CUST_NODE_INT_IMP(ObjectEntryAID, ObjectEntryHID, ObjectEntryAID, AppId, + aidRoot, aidNode, aid, gavl_cmp_int) +GAVL_CUST_NODE_INT_IMP(ObjectEntryOID, ObjectEntryAID, ObjectEntryOID, ObjectId, + oidRoot, oidNode, oid, gavl_cmp_int) + +/*****************************************************************************/ +void +objectEntryRefreshApp(ORTEDomain *d,ObjectEntryOID *objectEntryOID) { + if (!objectEntryOID) return; + if ((objectEntryOID->oid!=OID_APP) || + (objectEntryOID->guid.aid==AID_UNKNOWN) || + (!gavl_cmp_guid(&objectEntryOID->guid,&d->guid))) return; + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + eventAdd(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0, + "ExpirationTimer", + objectEntryExpirationTimer, + NULL, + objectEntryOID, + &((AppParams*)objectEntryOID->attributes)->expirationTime); + debug(8,3) ("refreshed: 0x%x-0x%x\n", + objectEntryOID->objectEntryHID->hid, + objectEntryOID->objectEntryAID->aid); +} + +/*****************************************************************************/ +ObjectEntryOID * +objectEntryFind(ORTEDomain *d,GUID_RTPS *guid) { + ObjectEntryHID *objectEntryHID; + ObjectEntryAID *objectEntryAID; + + objectEntryHID=ObjectEntryHID_find(&d->objectEntry,&guid->hid); + if (objectEntryHID==NULL) return NULL; + objectEntryAID=ObjectEntryAID_find(objectEntryHID,&guid->aid); + if (objectEntryAID==NULL) return NULL; + return ObjectEntryOID_find(objectEntryAID,&guid->oid); +} + +/* + * objectEntryAdd - Add a object to structure objectEntry + * @objectEntry: pointer to root structure + * @guid: pointer to guid of object (hid,aid,oid) + * + * Return pointer to objectEntryOID + */ +ObjectEntryOID * +objectEntryAdd(ORTEDomain *d,GUID_RTPS *guid,void *params) { + ObjectEntryHID *objectEntryHID; + ObjectEntryAID *objectEntryAID; + ObjectEntryOID *objectEntryOID; + + debug(8,10) ("objectEntry: start\n"); + objectEntryHID=ObjectEntryHID_find(&d->objectEntry,&guid->hid); + //not exists Host -> create + if (objectEntryHID==NULL) { + objectEntryHID=(ObjectEntryHID*)MALLOC(sizeof(ObjectEntryHID)); + //initialization items of structure objectEntryHID + ObjectEntryAID_init_root_field(objectEntryHID); + objectEntryHID->hid=guid->hid; + //insert + ObjectEntryHID_insert(&d->objectEntry,objectEntryHID); + debug(8,5) ("objectEntry: Host : %#10.8x created\n",guid->hid); + } + objectEntryAID=ObjectEntryAID_find(objectEntryHID,&guid->aid); + //not exists Application -> create + if (objectEntryAID==NULL) { + objectEntryAID=(ObjectEntryAID*)MALLOC(sizeof(ObjectEntryAID)); + //init items of structure objectEntryAID + objectEntryAID->aid=guid->aid; + ObjectEntryOID_init_root_field(objectEntryAID); + //init structure htimUnicast + htimerUnicastCommon_init_queue(objectEntryAID); + ul_htim_queue_init_detached(&objectEntryAID->htimUnicast.commonNode.htim); + htimerUnicastSendMetatraffic_init_queue(objectEntryAID); + ul_htim_queue_init_detached(&objectEntryAID->htimUnicast.sendMetatrafficNode.htim); + htimerUnicastSendUserData_init_queue(objectEntryAID); + ul_htim_queue_init_detached(&objectEntryAID->htimUnicast.sendUserDataNode.htim); + //insert + ObjectEntryAID_insert(objectEntryHID,objectEntryAID); + debug(8,5) ("objectEntry: App : %#10.8x created\n",guid->aid); + } + objectEntryOID=ObjectEntryOID_find(objectEntryAID,&guid->oid); + //not exists Object -> create + if (objectEntryOID==NULL) { + objectEntryOID=(ObjectEntryOID*)MALLOC(sizeof(ObjectEntryOID)); + //initialization items of structure objectEntryOID + objectEntryOID->guid=*guid; + objectEntryOID->oid=guid->oid; + objectEntryOID->objectEntryAID=objectEntryAID; + objectEntryOID->objectEntryHID=objectEntryHID; + objectEntryOID->attributes=params; + ul_htim_queue_init_detached(&objectEntryOID->expirationPurgeTimer.htim); + ul_htim_queue_init_detached(&objectEntryOID->sendCallBackDelayTimer.htim); + //insert + ObjectEntryOID_insert(objectEntryAID,objectEntryOID); + debug(8,5) ("objectEntry: Object: %#10.8x created\n",guid->oid); + } + debug(8,10) ("objectEntry: finished\n"); + return objectEntryOID; +} + +/* + * objectEntryDestroy - Destroy a object from structure objectEntry + * @objectEntry: pointer to root structure + * @obejctEntryOID: pointer to the deleted objectEntryOID + * + * return 0-no obj. was deleted, 1-OID was deleted,2-OID,AID was deleted, + * 3-OID,AID,HID was deleted + */ +int +objectEntryDelete(ORTEDomain *d,ObjectEntryOID *objectEntryOID) { + ObjectEntryHID *objectEntryHID; + ObjectEntryAID *objectEntryAID; + int result=0; + + debug(8,10) ("objectEntryDelete: start\n"); + if (!objectEntryOID) return result; + objectEntryHID=objectEntryOID->objectEntryHID; + objectEntryAID=objectEntryOID->objectEntryAID; + //Destroy object on level OID + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->sendCallBackDelayTimer, + 0); + FREE(objectEntryOID->attributes); + ObjectEntryOID_delete(objectEntryAID,objectEntryOID); + debug(8,5) ("objectEntry: Object: %#10.8x deleted\n",objectEntryOID->oid); + FREE(objectEntryOID); + result=1; + //Destroy object on level AID + if (ObjectEntryOID_is_empty(objectEntryAID)) { + ObjectEntryAID_delete(objectEntryHID,objectEntryAID); + debug(8,5) ("objectEntry: App : %#10.8x deleted\n",objectEntryAID->aid); + FREE(objectEntryAID); + result=2; + } + //Destroy object on level HID + if (ObjectEntryAID_is_empty(objectEntryHID)) { + ObjectEntryHID_delete(&d->objectEntry,objectEntryHID); + debug(8,5) ("objectEntry: Host : %#10.8x deleted\n",objectEntryHID->hid); + FREE(objectEntryHID); + result=3; + } + debug(8,10) ("objectEntryDelete: finished\n"); + return result; +} + +/* + * objectEntryDeleteAll - Delete all structure objectEntry + * @objectEntry: pointer to root structure + * + */ +void +objectEntryDeleteAll(ORTEDomain *d,ObjectEntry *objectEntry) { + ObjectEntryHID *objectEntryHID; + ObjectEntryAID *objectEntryAID; + ObjectEntryOID *objectEntryOID; + + while((objectEntryHID=ObjectEntryHID_cut_first(objectEntry))) { + while((objectEntryAID=ObjectEntryAID_cut_first(objectEntryHID))) { + while((objectEntryOID=ObjectEntryOID_cut_first(objectEntryAID))) { + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + FREE(objectEntryOID->attributes); + FREE(objectEntryOID); + } + FREE(objectEntryAID); + } + FREE(objectEntryHID); + } +} + +/* + * ObjectEntryDump - Dump a objectEntry structure on stdio + * @objectEntry: pointer to root structure + * + */ +void +objectEntryDump(ObjectEntry *objectEntry) { + ObjectEntryHID *objectEntryHID; + ObjectEntryAID *objectEntryAID; + ObjectEntryOID *objectEntryOID; + + gavl_cust_for_each(ObjectEntryHID,objectEntry,objectEntryHID) { + debug(8,5) ("hid:%x\n",objectEntryHID->hid); + gavl_cust_for_each(ObjectEntryAID,objectEntryHID,objectEntryAID) { + debug(8,5) (" aid:%x\n",objectEntryAID->aid); + gavl_cust_for_each(ObjectEntryOID,objectEntryAID,objectEntryOID) { + debug(8,5) (" oid:%x\n",objectEntryOID->oid,objectEntryOID); + } + } + } +} + diff --git a/orte/liborte/objectEntryTimer.c b/orte/liborte/objectEntryTimer.c new file mode 100644 index 0000000..fbc74f9 --- /dev/null +++ b/orte/liborte/objectEntryTimer.c @@ -0,0 +1,396 @@ + /* + * $Id: objectEntryTimer.c,v 0.0.0.1 2003/09/10 + * + * DEBUG: section 12 Timer function on object from eventEntry + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +int +objectEntryPurgeTimer(ORTEDomain *d,void *vobjectEntryOID) { + ObjectEntryOID *objectEntryOID=(ObjectEntryOID*)vobjectEntryOID; + GUID_RTPS guid; + + guid=objectEntryOID->guid; + if ((d->guid.aid & 0x03) == MANAGER) { + if ((guid.aid & 0x03) == MANAGER) { + pthread_rwlock_wrlock(&d->writerManagers.lock); + CSTWriterMakeGAP(d,&d->writerManagers,&guid); + pthread_rwlock_unlock(&d->writerManagers.lock); + } + if (((guid.aid & 0x03) == MANAGEDAPPLICATION) && + (objectEntryOID->appMOM)) { + pthread_rwlock_wrlock(&d->writerApplications.lock); + CSTWriterMakeGAP(d,&d->writerApplications,&guid); + pthread_rwlock_unlock(&d->writerApplications.lock); + } + } + if ((d->guid.aid & 0x03) == MANAGEDAPPLICATION) { + switch (guid.oid & 0x07) { + case OID_APPLICATION: + break; + case OID_PUBLICATION: + pthread_rwlock_wrlock(&d->writerPublications.lock); + CSTWriterMakeGAP(d,&d->writerPublications,&guid); + pthread_rwlock_unlock(&d->writerPublications.lock); + break; + case OID_SUBSCRIPTION: + pthread_rwlock_wrlock(&d->writerSubscriptions.lock); + CSTWriterMakeGAP(d,&d->writerSubscriptions,&guid); + pthread_rwlock_unlock(&d->writerSubscriptions.lock); + break; + } + } + debug(12,3) ("purged: 0x%x-0x%x-0x%x object removed\n", + objectEntryOID->objectEntryHID->hid, + objectEntryOID->objectEntryAID->aid, + objectEntryOID->oid); + objectEntryDelete(d,objectEntryOID); + objectEntryDump(&d->objectEntry); + + debug(12,10) ("objectEntryPurgeTimer: finished\n"); + return 2; +} + +/*****************************************************************************/ +void +removeApplication(ORTEDomain *d,ObjectEntryOID *robjectEntryOID) { + GUID_RTPS guid; + ObjectEntryOID *objectEntryOID; + CSTWriter *cstWriter; + CSTReader *cstReader; + CSTRemoteWriter *cstRemoteWriter; + CSTRemoteReader *cstRemoteReader; + + if (!robjectEntryOID) return; + if (!gavl_cmp_guid(&robjectEntryOID->guid,&d->guid)) return; + debug(12,3) ("application removed\n"); + + guid=robjectEntryOID->guid; + //publication, subsription and application + pthread_rwlock_wrlock(&d->writerPublications.lock); + guid.oid=OID_READ_PUBL; + cstRemoteReader=CSTRemoteReader_find(&d->writerPublications,&guid); + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + pthread_rwlock_unlock(&d->writerPublications.lock); + pthread_rwlock_wrlock(&d->writerSubscriptions.lock); + guid.oid=OID_READ_SUBS; + cstRemoteReader=CSTRemoteReader_find(&d->writerSubscriptions,&guid); + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + pthread_rwlock_unlock(&d->writerSubscriptions.lock); + pthread_rwlock_wrlock(&d->readerPublications.lock); + guid.oid=OID_WRITE_PUBL; + cstRemoteWriter=CSTRemoteWriter_find(&d->readerPublications,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + pthread_rwlock_unlock(&d->readerPublications.lock); + pthread_rwlock_wrlock(&d->readerSubscriptions.lock); + guid.oid=OID_WRITE_SUBS; + cstRemoteWriter=CSTRemoteWriter_find(&d->readerSubscriptions,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + pthread_rwlock_unlock(&d->readerSubscriptions.lock); + //destroy all services + //from publisheres + pthread_rwlock_wrlock(&d->publications.lock); + gavl_cust_for_each(CSTWriter, + &d->publications,cstWriter) { + pthread_rwlock_wrlock(&cstWriter->lock); + gavl_cust_for_each(ObjectEntryOID, + robjectEntryOID->objectEntryAID, + objectEntryOID) { + cstRemoteReader=CSTRemoteReader_find(cstWriter,&objectEntryOID->guid); + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + } + pthread_rwlock_unlock(&cstWriter->lock); + } + pthread_rwlock_unlock(&d->publications.lock); + //from subscriberes + pthread_rwlock_wrlock(&d->subscriptions.lock); + gavl_cust_for_each(CSTReader, + &d->subscriptions,cstReader) { + pthread_rwlock_wrlock(&cstReader->lock); + gavl_cust_for_each(ObjectEntryOID, + robjectEntryOID->objectEntryAID, + objectEntryOID) { + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&objectEntryOID->guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + } + pthread_rwlock_unlock(&cstReader->lock); + } + pthread_rwlock_unlock(&d->subscriptions.lock); + //destroy all object - the object will be disconneced in objectEntryDelete + while((objectEntryOID=ObjectEntryOID_first(robjectEntryOID->objectEntryAID))) { + switch (objectEntryOID->oid & 0x07) { + case OID_PUBLICATION: + pthread_rwlock_wrlock(&d->psEntry.publicationsLock); + PublicationList_delete(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.publicationsLock); + break; + case OID_SUBSCRIPTION: + pthread_rwlock_wrlock(&d->psEntry.subscriptionsLock); + SubscriptionList_delete(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.subscriptionsLock); + break; + } + if (objectEntryDelete(d,objectEntryOID)>1) //AID was deleted + break; + } +} + +/*****************************************************************************/ +//Remove manager +void +removeManager(ORTEDomain *d,ObjectEntryOID *robjectEntryOID) { + CSTRemoteWriter *cstRemoteWriter; + ObjectEntryAID *objectEntryAID; + GUID_RTPS guid; + + if (!robjectEntryOID) return; + debug(12,3) ("manager removed\n"); + + guid=robjectEntryOID->guid; + //exists another live Manager on going down node + gavl_cust_for_each(ObjectEntryAID, + robjectEntryOID->objectEntryHID,objectEntryAID) { + if (((objectEntryAID->aid & 0x03) == MANAGER) && + (objectEntryAID->aid!=robjectEntryOID->guid.aid)) + break; //yes + } + if (!objectEntryAID) { //not exists + gavl_cust_for_each(ObjectEntryAID, + robjectEntryOID->objectEntryHID,objectEntryAID) { + if ((objectEntryAID->aid & 0x03) == MANAGEDAPPLICATION) { + ObjectEntryOID *objectEntryOID; + objectEntryOID=ObjectEntryOID_find(objectEntryAID,&guid.oid); + if (gavl_cmp_guid(&objectEntryOID->guid,&d->guid)) { //!= + removeApplication(d,objectEntryOID); + objectEntryAID= //start + ObjectEntryAID_first(robjectEntryOID->objectEntryHID); + } + } + } + } + pthread_rwlock_wrlock(&d->readerApplications.lock); + pthread_rwlock_wrlock(&d->readerManagers.lock); + guid.oid=OID_WRITE_APP; + cstRemoteWriter=CSTRemoteWriter_find(&d->readerApplications,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + guid.oid=OID_WRITE_MGR; + cstRemoteWriter=CSTRemoteWriter_find(&d->readerManagers,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + pthread_rwlock_unlock(&d->readerApplications.lock); + pthread_rwlock_unlock(&d->readerManagers.lock); + objectEntryDelete(d,robjectEntryOID); +} + + +/*****************************************************************************/ +int +objectEntryExpirationTimer(ORTEDomain *d,void *vobjectEntryOID) { + ObjectEntryOID *objectEntryOID=(ObjectEntryOID*)vobjectEntryOID; + ObjectEntryOID *objectEntryOID1; + ObjectEntryAID *objectEntryAID; + CSTWriter *cstWriter; + CSTReader *cstReader; + CSTRemoteWriter *cstRemoteWriter; + CSTRemoteReader *cstRemoteReader; + CSChange *csChange; + GUID_RTPS guid; + + //Manager, Manager expired + guid=objectEntryOID->guid; + //Event + generateEvent(d,&guid,objectEntryOID->attributes,ORTE_FALSE); + debug(12,3) ("expired: 0x%x-0x%x removed\n", + objectEntryOID->objectEntryHID->hid, + objectEntryOID->objectEntryAID->aid); + if (((d->guid.aid & 3) == MANAGER) && + ((guid.aid & 0x03) == MANAGER)) { + pthread_rwlock_wrlock(&d->readerManagers.lock); + pthread_rwlock_wrlock(&d->writerApplications.lock); + pthread_rwlock_wrlock(&d->readerApplications.lock); + guid.oid=OID_WRITE_APPSELF; + cstRemoteWriter=CSTRemoteWriter_find(&d->readerManagers,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + guid.oid=OID_WRITE_APP; + cstRemoteWriter=CSTRemoteWriter_find(&d->readerApplications,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + guid.oid=OID_READ_APP; + cstRemoteReader=CSTRemoteReader_find(&d->writerApplications,&guid); + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + guid.oid=objectEntryOID->oid; //restore oid + //generate csChange for writerManager with alive=FALSE + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + CSChangeAttributes_init_head(csChange); + csChange->guid=guid; + csChange->alive=ORTE_FALSE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(d,&d->writerManagers,csChange); + gavl_cust_for_each(ObjectEntryAID, + objectEntryOID->objectEntryHID,objectEntryAID) { + if (((objectEntryAID->aid & 0x03) == MANAGER) && + (objectEntryAID->aid!=objectEntryOID->guid.aid)) + break; //yes + } + //if there is no another manager from expired node -> remove all app. + if (!objectEntryAID) { + gavl_cust_for_each(ObjectEntryAID, + objectEntryOID->objectEntryHID,objectEntryAID) { + if ((objectEntryAID->aid & 0x03) == MANAGEDAPPLICATION) { + if ((objectEntryOID1=ObjectEntryOID_find(objectEntryAID,&guid.oid))) { + eventAdd(d, + objectEntryOID1->objectEntryAID, + &objectEntryOID1->expirationPurgeTimer, + 0, + "ExpirationTimer", + objectEntryExpirationTimer, + NULL, + objectEntryOID1, + NULL); + } + } + } + } + pthread_rwlock_unlock(&d->readerApplications.lock); + pthread_rwlock_unlock(&d->writerApplications.lock); + pthread_rwlock_unlock(&d->readerManagers.lock); + } + //Manager, Application expired + if (((d->guid.aid & 3) == MANAGER) && + ((guid.aid & 0x03) == MANAGEDAPPLICATION)) { + pthread_rwlock_wrlock(&d->writerApplicationSelf.lock); + pthread_rwlock_wrlock(&d->writerManagers.lock); + pthread_rwlock_wrlock(&d->writerApplications.lock); + pthread_rwlock_wrlock(&d->readerApplications.lock); + guid.oid=OID_WRITE_APPSELF; /* local app */ + cstRemoteWriter=CSTRemoteWriter_find(&d->readerApplications,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + guid.oid=OID_WRITE_APP; /* remote app */ + cstRemoteWriter=CSTRemoteWriter_find(&d->readerApplications,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + guid.oid=OID_READ_APP; + cstRemoteReader=CSTRemoteReader_find(&d->writerApplications,&guid); + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + guid.oid=OID_READ_MGR; + cstRemoteReader=CSTRemoteReader_find(&d->writerManagers,&guid); + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + if (objectEntryOID->appMOM) { + guid.oid=objectEntryOID->oid; //restore oid + //generate csChange for writerApplication with alive=FALSE + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + parameterUpdateCSChange(csChange,d->appParams,ORTE_TRUE); + csChange->guid=guid; + csChange->alive=ORTE_FALSE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(d,&d->writerApplications,csChange); + //increment vargAppsSequenceNumber and make csChange + SeqNumberInc(d->appParams->vargAppsSequenceNumber, + d->appParams->vargAppsSequenceNumber); + appSelfParamChanged(d,ORTE_FALSE,ORTE_FALSE,ORTE_TRUE); + } else { + objectEntryDelete(d,objectEntryOID); + objectEntryOID=NULL; + } + pthread_rwlock_unlock(&d->writerApplicationSelf.lock); + pthread_rwlock_unlock(&d->writerManagers.lock); + pthread_rwlock_unlock(&d->writerApplications.lock); + pthread_rwlock_unlock(&d->readerApplications.lock); + } + //Application + if ((d->guid.aid & 0x03) == MANAGEDAPPLICATION) { + switch (guid.oid & 0x07) { + case OID_APPLICATION: + if ((guid.aid & 0x03) == MANAGER) { //Manager + removeManager(d,objectEntryOID); + objectEntryOID=NULL; + } + if ((guid.aid & 0x03) == MANAGEDAPPLICATION) { //Application + removeApplication(d,objectEntryOID); + objectEntryOID=NULL; + } + break; + case OID_PUBLICATION: + pthread_rwlock_wrlock(&d->subscriptions.lock); + gavl_cust_for_each(CSTReader,&d->subscriptions,cstReader) { + cstRemoteWriter=CSTRemoteWriter_find(cstReader,&guid); + CSTReaderDestroyRemoteWriter(d,cstRemoteWriter); + } + pthread_rwlock_unlock(&d->subscriptions.lock); + pthread_rwlock_wrlock(&d->publications.lock); + cstWriter=CSTWriter_find(&d->publications,&guid); + if (cstWriter) { + CSTWriterDelete(d,cstWriter); + CSTWriter_delete(&d->publications,cstWriter); + FREE(cstWriter); + } + pthread_rwlock_unlock(&d->publications.lock); + pthread_rwlock_wrlock(&d->psEntry.publicationsLock); + PublicationList_delete(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.publicationsLock); + if (!objectEntryOID->private) { //not local object cann't be purged + objectEntryDelete(d,objectEntryOID); + objectEntryOID=NULL; + } + break; + case OID_SUBSCRIPTION: + pthread_rwlock_wrlock(&d->publications.lock); + gavl_cust_for_each(CSTWriter,&d->publications,cstWriter) { + cstRemoteReader=CSTRemoteReader_find(cstWriter,&guid); + CSTWriterDestroyRemoteReader(d,cstRemoteReader); + } + pthread_rwlock_unlock(&d->publications.lock); + pthread_rwlock_wrlock(&d->subscriptions.lock); + cstReader=CSTReader_find(&d->subscriptions,&guid); + if (cstReader) { + CSTReaderDelete(d,cstReader); + CSTReader_delete(&d->subscriptions,cstReader); + FREE(cstReader); + } + pthread_rwlock_unlock(&d->subscriptions.lock); + pthread_rwlock_wrlock(&d->psEntry.subscriptionsLock); + SubscriptionList_delete(&d->psEntry,objectEntryOID); + pthread_rwlock_unlock(&d->psEntry.subscriptionsLock); + if (!objectEntryOID->private) { //local object cann't be purged + objectEntryDelete(d,objectEntryOID); + objectEntryOID=NULL; + } + break; + } + } + if (objectEntryOID) { + eventDetach(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0); + eventAdd(d, + objectEntryOID->objectEntryAID, + &objectEntryOID->expirationPurgeTimer, + 0, + "PurgeTimer", + objectEntryPurgeTimer, + NULL, + objectEntryOID, + &d->domainProp.baseProp.purgeTime); + debug(12,3) ("expired: 0x%x-0x%x marked for remove\n", + objectEntryOID->objectEntryHID->hid, + objectEntryOID->objectEntryAID->aid); + } + objectEntryDump(&d->objectEntry); + if (!objectEntryOID) return 2; + return 0; +} diff --git a/orte/liborte/objectUtils.c b/orte/liborte/objectUtils.c new file mode 100644 index 0000000..2135f87 --- /dev/null +++ b/orte/liborte/objectUtils.c @@ -0,0 +1,252 @@ + /* + * $Id: objectUtils.c,v 0.0.0.1 2003/09/10 + * + * DEBUG: section 9 Functions with objets + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/* + * AppParamsInit - Initalization default values of an application + * @ap: pointer to an application + * + */ +void +AppParamsInit(AppParams *ap) { + PROTOCOL_VERSION_1_0(ap->protocolVersion); + VENDOR_ID_UNKNOWN(ap->vendorId); + NTPTIME_BUILD(ap->expirationTime,180); + ap->metatrafficUnicastPort=PORT_INVALID; + ap->userdataUnicastPort=PORT_INVALID; + ap->unicastIPAddressCount=0; + ap->metatrafficMulticastIPAddressCount=0; + ap->managerKeyCount=0; + SEQUENCE_NUMBER_NONE(ap->vargAppsSequenceNumber); +} + +/* + * PublParamsInit - Initalization default values of a publisher + * @p: pointer to a publisher + * + */ +void +PublParamsInit(ORTEPublProp *pp) { + pp->expectsAck=ORTE_TRUE; + NTPTIME_ZERO(pp->persistence); + pp->reliabilityOffered=0; + pp->sendQueueSize=1; + pp->strength=1; + strcpy(pp->topic,"DefaultTopic"); + strcpy(pp->typeName,""); + pp->typeChecksum=0; + //additional params + NTPTIME_BUILD(pp->maxBlockTime,30); + pp->criticalQueueLevel=1; + NtpTimeAssembFromMs(pp->HBNornalRate,1,0); + NtpTimeAssembFromMs(pp->HBCQLRate,0,50); + pp->HBMaxRetries=10; +} + +/* + * SubsParamsInit - Initalization default values of a subscription + * @s: pointer to a subscription + * + */ +void +SubsParamsInit(ORTESubsProp *sp) { + NTPTIME_ZERO(sp->minimumSeparation); + sp->recvQueueSize=1; + sp->reliabilityRequested=0; + strcpy(sp->topic,"DefaultTopic"); + strcpy(sp->typeName,""); + sp->typeChecksum=0; +// s->rcvMessageCallBack=NULL; +// s->deadline=NTPTIME_ZERO; +} + +/* + * UpdateORTEAppInfo - + * @appParams: pointer to a source of data + * @appInfo: pointer to a destination of data + * + */ +void +updateORTEAppInfo(AppParams *appParams,ORTEAppInfo *appInfo) { + appInfo->hostId= + appParams->hostId; + appInfo->appId= + appParams->appId; + appInfo->unicastIPAddressList= + appParams->unicastIPAddressList; + appInfo->unicastIPAddressCount= + appParams->unicastIPAddressCount; + appInfo->metatrafficMulticastIPAddressList= + appParams->metatrafficMulticastIPAddressList; + appInfo->metatrafficMulticastIPAddressCount= + appParams->metatrafficMulticastIPAddressCount; + appInfo->metatrafficUnicastPort= + appParams->metatrafficUnicastPort; + appInfo->userdataUnicastPort= + appParams->userdataUnicastPort; + appInfo->vendorId= + appParams->vendorId; + appInfo->protocolVersion= + appParams->protocolVersion; +} + +/* + * generateEvent - Generate new and delete event up to an application + * @objectEntryOID: pointer to a OID structure + * @live: ORTE_TRUE if object is live + * + * Return: return ORTE_TRUE if object is acceptable by ORTE (new events) + */ +Boolean +generateEvent(ORTEDomain *d,GUID_RTPS *guid,void *params,Boolean live) { + ObjectEntryOID *objectEntryOID; + GUID_RTPS guidapp; + Boolean result=ORTE_TRUE; + + //generate event + switch (guid->oid & 0x07) { + case OID_APPLICATION: + updateORTEAppInfo((AppParams*)params,&d->appInfo); + if (((guid->aid & 0x03)==MANAGER) && + (d->domainEvents.onMgrNew) && live) + result=d->domainEvents.onMgrNew(&d->appInfo, + d->domainEvents.onMgrNewParam); + if (((guid->aid & 0x03)==MANAGER) && + (d->domainEvents.onMgrDelete) && (!live)) + d->domainEvents.onMgrDelete(&d->appInfo, + d->domainEvents.onMgrDeleteParam); + if (((guid->aid & 0x03)==MANAGEDAPPLICATION) && + (d->domainEvents.onAppRemoteNew) && live) + result=d->domainEvents.onAppRemoteNew(&d->appInfo, + d->domainEvents.onAppRemoteNewParam); + if (((guid->aid & 0x03)==MANAGEDAPPLICATION) && + (d->domainEvents.onAppDelete) && !live) + d->domainEvents.onAppDelete(&d->appInfo, + d->domainEvents.onAppDeleteParam); + break; + case OID_PUBLICATION: + guidapp.hid=guid->hid; + guidapp.aid=guid->aid; + guidapp.oid=OID_APP; + objectEntryOID=objectEntryFind(d,&guidapp); + if (!objectEntryOID) return ORTE_FALSE; + updateORTEAppInfo((AppParams*)objectEntryOID->attributes,&d->appInfo); + d->pubInfo.topic=((ORTEPublProp*)params)->topic; + d->pubInfo.type=((ORTEPublProp*)params)->typeName; + d->pubInfo.objectId=guid->oid; + if ((d->domainEvents.onPubRemoteNew) && live) + result=d->domainEvents.onPubRemoteNew(&d->appInfo,&d->pubInfo, + d->domainEvents.onPubRemoteNewParam); + if ((d->domainEvents.onPubDelete) && !live) + d->domainEvents.onPubDelete(&d->appInfo,&d->pubInfo, + d->domainEvents.onPubDeleteParam); + + break; + case OID_SUBSCRIPTION: + guidapp.hid=guid->hid; + guidapp.aid=guid->aid; + guidapp.oid=OID_APP; + objectEntryOID=objectEntryFind(d,&guidapp); + if (!objectEntryOID) return ORTE_FALSE; + updateORTEAppInfo((AppParams*)objectEntryOID->attributes,&d->appInfo); + d->subInfo.topic=((ORTESubsProp*)params)->topic; + d->subInfo.type=((ORTESubsProp*)params)->typeName; + d->subInfo.objectId=guid->oid; + if ((d->domainEvents.onSubRemoteNew) && (live)) + result=d->domainEvents.onSubRemoteNew(&d->appInfo,&d->subInfo, + d->domainEvents.onSubRemoteNewParam); + if ((d->domainEvents.onSubDelete) && (!live)) + d->domainEvents.onSubDelete(&d->appInfo,&d->subInfo, + d->domainEvents.onSubDeleteParam); + + break; + } + return result; +} + +/* + * GetTypeApp - Test if application is MOM or OAM + * @d: pointer to a domain + * @ap + * @senderIPAddress: + * + * Return: return ORTE_TRUE if application MOM + */ +Boolean +getTypeApp(ORTEDomain *d,AppParams *ap,IPAddress senderIPAddress) { + Boolean result=ORTE_FALSE; + u_int16_t i,j,k; + + //test if the app is MOM + for (i=0;iappParams->managerKeyCount;i++) { + for (j=0;jmanagerKeyCount;j++) { + if (ap->managerKeyList[j]!=StringToIPAddress("127.0.0.1")) { + if (ap->managerKeyList[j]==d->appParams->managerKeyList[i]) + result=ORTE_TRUE; + } else { + if (senderIPAddress==StringToIPAddress("127.0.0.1")) + result=ORTE_TRUE; + for (k=0;kdomainProp.IFCount;k++) { + if (d->domainProp.IFProp[k].ipAddress==senderIPAddress) + result=ORTE_TRUE; + } + } + } + } + return result; +} + +/* + * appSelfParamChanged - Self parameters changed + * @d: pointer to an domain + * @lock: lock CSTWriters at the start of function + * @unlock: unlock CSTWriters at the end of function + * + */ +void +appSelfParamChanged(ORTEDomain *d, + Boolean lock,Boolean unlock,Boolean forWM) { + CSChange *csChange; + + if (lock) { + pthread_rwlock_wrlock(&d->writerApplicationSelf.lock); + pthread_rwlock_wrlock(&d->writerManagers.lock); + } + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + parameterUpdateCSChange(csChange,d->appParams,ORTE_TRUE); + csChange->guid=d->guid; + csChange->alive=ORTE_TRUE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(d,&d->writerApplicationSelf,csChange); + if (forWM) { + csChange=(CSChange*)MALLOC(sizeof(CSChange)); + parameterUpdateCSChange(csChange,d->appParams,ORTE_TRUE); + csChange->guid=d->guid; + csChange->alive=ORTE_TRUE; + csChange->cdrStream.buffer=NULL; + CSTWriterAddCSChange(d,&d->writerManagers,csChange); + } + if (unlock) { + pthread_rwlock_unlock(&d->writerApplicationSelf.lock); + pthread_rwlock_unlock(&d->writerManagers.lock); + } +} diff --git a/orte/liborte/parameter.c b/orte/liborte/parameter.c new file mode 100644 index 0000000..06515ea --- /dev/null +++ b/orte/liborte/parameter.c @@ -0,0 +1,535 @@ +/* + * $Id: parameter.c,v 0.0.0.1 2003/10/13 + * + * DEBUG: section 11 parameter + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*****************************************************************************/ +int +parameterDelete(CSChange *csChange) { + ParameterSequence *ps; + + ul_list_for_each(CSChangeAttributes, + csChange, + ps) { + if ((ps->parameterLength) > MAX_PARAMETER_LOCAL_LENGTH) + FREE(ps->parameter); + } + //ps is like one piece of memory + if (CSChangeAttributes_first(csChange)) + FREE(CSChangeAttributes_first(csChange)); + CSChangeAttributes_init_head(csChange); + return ORTE_TRUE; +} + + +/*****************************************************************************/ +int +parameterCodeStreamFromCSChange(CSChange *csChange, + u_int8_t *rtps_msg,u_int32_t max_msg_len) { + ParameterSequence *ps; + int result=0; + + ul_list_for_each(CSChangeAttributes, + csChange, + ps) { + if (max_msg_len<(u_int32_t)(4+ps->parameterLength)) return -1; //no memory for copy + *((ParameterId*)rtps_msg)=ps->parameterID; + *((ParameterLength*)(rtps_msg+2))=ps->parameterLength; + if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) { + memcpy(rtps_msg+4,ps->parameter,ps->parameterLength); + } else { + memcpy(rtps_msg+4,ps->parameterLocal,ps->parameterLength); + } + rtps_msg=rtps_msg+4+ps->parameterLength; + max_msg_len=max_msg_len-ps->parameterLength-4; + result=result+4+ps->parameterLength; + } + return result; +} + +/*****************************************************************************/ +int +parameterDecodeStreamToCSChange(CSChange *csChange,u_int8_t *rtps_msg, + u_int16_t submsg_len,u_int8_t e_bit) { + ParameterId parameterId; + ParameterLength parameterLength; + ParameterSequence *ps; + u_int16_t counter=0; + u_int8_t *rtps_msg_it=rtps_msg; + + CSChangeAttributes_init_head(csChange); + //count number of parameters + while (submsg_len) { + parameterId=*((ParameterId*)rtps_msg_it); + conv_u16(¶meterId,e_bit); + parameterLength=*((ParameterId*)(rtps_msg_it+2)); + conv_u16(¶meterLength,e_bit); + if (submsg_len>parameterLength) submsg_len-=parameterLength; + else submsg_len=0; + if (parameterId==PID_SENTINEL) break; + counter++; + rtps_msg_it+=4+parameterLength; + } + ps=(ParameterSequence*)MALLOC(sizeof(ParameterSequence)*(counter+1)); + rtps_msg_it=rtps_msg; + while (counter) { + parameterId=*((ParameterId*)rtps_msg_it); + conv_u16(¶meterId,e_bit); + ps->parameterID=parameterId; + parameterLength=*((ParameterId*)(rtps_msg_it+2)); + conv_u16(¶meterLength,e_bit); + ps->parameterLength=parameterLength; + ps->parameter=NULL; + switch (parameterId) { + case PID_SENTINEL: + counter=1; + break; + //NtpTime + case PID_EXPIRATION_TIME: + case PID_PERSISTENCE: + case PID_MINIMUM_SEPARATION: + *(NtpTime*)ps->parameterLocal=*((NtpTime*)(rtps_msg_it+4)); + conv_ntp((NtpTime*)ps->parameterLocal,e_bit); + break; + //unsigned long + case PID_TYPE_CHECKSUM: + case PID_STRENGTH: + case PID_SEND_QUEUE_SIZE: + case PID_RECV_QUEUE_SIZE: + case PID_RELIABILITY_OFFERED: + case PID_RELIABILITY_REQUESTED: + case PID_MANAGER_KEY: + *(u_int32_t*)ps->parameterLocal=*((u_int32_t*)(rtps_msg_it+4)); + conv_u32((u_int32_t*)ps->parameterLocal,e_bit); + break; + //IPAddress + case PID_MATATRAFFIC_MULTICAST_IPADDRESS: + case PID_APP_IPADDRESS: + case PID_USERDATA_MULTICAST_IPADDRESS: + *(IPAddress*)ps->parameterLocal=*((IPAddress*)(rtps_msg_it+4)); + conv_u32((IPAddress*)ps->parameterLocal,e_bit); + break; + //Port + case PID_METATRAFFIC_UNICAST_PORT: + case PID_USERDATA_UNICAST_PORT: + *(Port*)ps->parameterLocal=*((Port*)(rtps_msg_it+4)); + conv_u32((Port*)ps->parameterLocal,e_bit); + break; + //VendorId + case PID_VENDOR_ID: + *(VendorId*)ps->parameterLocal=*((VendorId*)(rtps_msg_it+4)); + break; + //ProtocolVersion + case PID_PROTOCOL_VERSION: + *(ProtocolVersion*)ps->parameterLocal=*((ProtocolVersion*)(rtps_msg_it+4)); + break; + //SequenceNumber + case PID_VARGAPPS_SEQUENCE_NUMBER_LAST: + *(SequenceNumber*)ps->parameterLocal=*((SequenceNumber*)(rtps_msg_it+4)); + conv_sn((SequenceNumber*)ps->parameterLocal,e_bit); + break; + //Boolean + case PID_EXPECTS_ACK: + *(Boolean*)ps->parameterLocal=*((Boolean*)(rtps_msg_it+4)); + break; + //PathName,TypeName + case PID_TOPIC: + case PID_TYPE_NAME: + if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) { + ps->parameter=MALLOC(ps->parameterLength); + memcpy(ps->parameter,rtps_msg_it+4,ps->parameterLength); + } else { + memcpy(ps->parameterLocal,rtps_msg_it+4,ps->parameterLength); + } + break; + case PID_PAD: + break; + } + CSChangeAttributes_insert(csChange,ps); + ps++; //next ps + counter--; + rtps_msg_it+=4+parameterLength; + } + //SENTINEL + ps->parameterID=PID_SENTINEL; + ps->parameterLength=0; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + return ORTE_TRUE; +} + +/*****************************************************************************/ +int +parameterUpdateCSChange( + CSChange *csChange,AppParams *ap,Boolean Manager) { + ParameterSequence *ps; + int i; + + i=ap->managerKeyCount+ + ap->metatrafficMulticastIPAddressCount+ + ap->unicastIPAddressCount+7; + if (!Manager) i--; + CSChangeAttributes_init_head(csChange); + ps=(ParameterSequence*)MALLOC(sizeof(ParameterSequence)*i); + //EXPIRATION_TIME + ps->parameterID=PID_EXPIRATION_TIME; + ps->parameterLength=8; + memcpy(ps->parameterLocal,&ap->expirationTime,ps->parameterLength); + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + //MATATRAFFIC_MULTICAST_IPADDRESS + for (i=0;imetatrafficMulticastIPAddressCount;i++) { + ps->parameterID=PID_MATATRAFFIC_MULTICAST_IPADDRESS; + ps->parameterLength=4; + *(IPAddress*)ps->parameterLocal=ap->metatrafficMulticastIPAddressList[i]; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + } + //METATRAFFIC_UNICAST_PORT + ps->parameterID=PID_METATRAFFIC_UNICAST_PORT; + ps->parameterLength=4; + *(Port*)&ps->parameterLocal=ap->metatrafficUnicastPort; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + //USERDATA_UNICAST_PORT + ps->parameterID=PID_USERDATA_UNICAST_PORT; + ps->parameterLength=4; + *(Port*)&ps->parameterLocal=ap->userdataUnicastPort; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + //APP_IPADDRESS + for (i=0;iunicastIPAddressCount;i++) { + ps->parameterID=PID_APP_IPADDRESS;; + ps->parameterLength=4; + *(IPAddress*)ps->parameterLocal=ap->unicastIPAddressList[i]; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + } + //PROTOCOL_VERSION + ps->parameterID=PID_PROTOCOL_VERSION; + ps->parameterLength=2; + *(ProtocolVersion*)&ps->parameterLocal=ap->protocolVersion; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + //VENDOR_ID + ps->parameterID=PID_VENDOR_ID; + ps->parameterLength=2; + *(VendorId*)&ps->parameterLocal=ap->vendorId; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + if (Manager) { //Manager + //VARGAPPS_SEQUENCE_NUMBER_LAST + ps->parameterID=PID_VARGAPPS_SEQUENCE_NUMBER_LAST; + ps->parameterLength=8; + *(SequenceNumber*)&ps->parameterLocal=ap->vargAppsSequenceNumber; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + } + //MANAGER_KEY + for (i=0;imanagerKeyCount;i++) { + ps->parameterID=PID_MANAGER_KEY; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=ap->managerKeyList[i]; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + } + //SENTINEL + ps->parameterID=PID_SENTINEL; + ps->parameterLength=0; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + return 0; +} + +/*****************************************************************************/ +int +parameterUpdateCSChangeFromPublication(CSChange *csChange,ORTEPublProp *pp) { + int len; + ParameterSequence *ps; + + CSChangeAttributes_init_head(csChange); + ps=(ParameterSequence*)MALLOC(sizeof(ParameterSequence)*8); + //persistence + ps->parameterID=PID_PERSISTENCE; + ps->parameterLength=8; + memcpy(ps->parameterLocal,&pp->persistence,ps->parameterLength); + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* reliabitityOffered */ + ps->parameterID=PID_RELIABILITY_OFFERED; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=pp->reliabilityOffered; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* sendQueueSize */ + ps->parameterID=PID_SEND_QUEUE_SIZE; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=pp->sendQueueSize; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* strength */ + ps->parameterID=PID_STRENGTH; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=pp->strength; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* topic */ + ps->parameterID=PID_TOPIC; + len=strlen(pp->topic); + ps->parameter=(int8_t*)MALLOC(len+8); + *(u_int32_t*)ps->parameter=len+1; + strncpy((4+ps->parameter),pp->topic,len); + *(u_int32_t*)(ps->parameter+len+4)=0; + ps->parameterLength=len+8; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* typeCheckSum */ + ps->parameterID=PID_TYPE_CHECKSUM; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=pp->typeChecksum; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* typeName */ + ps->parameterID=PID_TYPE_NAME; + len=strlen(pp->typeName); + ps->parameter=(int8_t*)MALLOC(len+8); + *(u_int32_t*)ps->parameter=len+1; + strncpy((4+ps->parameter),pp->typeName,len); + *(u_int32_t*)(ps->parameter+len+4)=0; + ps->parameterLength=len+8; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* sentinel -> end */ + ps->parameterID=PID_SENTINEL; + ps->parameterLength=0; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + return 0; +} + +/*****************************************************************************/ +int +parameterUpdateCSChangeFromSubscription(CSChange *csChange,ORTESubsProp *sp) { + int len; + ParameterSequence *ps; + + CSChangeAttributes_init_head(csChange); + ps=(ParameterSequence*)MALLOC(sizeof(ParameterSequence)*7); + //minimum separation + ps->parameterID=PID_MINIMUM_SEPARATION; + ps->parameterLength=8; + memcpy(ps->parameterLocal,&sp->minimumSeparation,ps->parameterLength); + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* receive queue size*/ + ps->parameterID=PID_RECV_QUEUE_SIZE; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=sp->recvQueueSize; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* reliabitityRequested */ + ps->parameterID=PID_RELIABILITY_REQUESTED; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=sp->reliabilityRequested; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* topic */ + ps->parameterID=PID_TOPIC; + len=strlen(sp->topic); + ps->parameter=(int8_t*)MALLOC(len+8); + *(u_int32_t*)ps->parameter=len+1; + strncpy((4+ps->parameter),sp->topic,len); + *(u_int32_t*)(ps->parameter+len+4)=0; + ps->parameterLength=len+8; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* typeCheckSum */ + ps->parameterID=PID_TYPE_CHECKSUM; + ps->parameterLength=4; + *(u_int32_t*)ps->parameterLocal=sp->typeChecksum; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* typeName */ + ps->parameterID=PID_TYPE_NAME; + len=strlen(sp->typeName); + ps->parameter=(int8_t*)MALLOC(len+8); + *(u_int32_t*)ps->parameter=len+1; + strncpy((4+ps->parameter),sp->typeName,len); + *(u_int32_t*)(ps->parameter+len+4)=0; + ps->parameterLength=len+8; + CSChangeAttributes_insert(csChange,ps); + ps++; + /* sentinel -> end */ + ps->parameterID=PID_SENTINEL; + ps->parameterLength=0; + ps->parameter=NULL; + CSChangeAttributes_insert(csChange,ps); + return 0; +} + +/*****************************************************************************/ +int +parameterUpdateApplication(CSChange *csChange,AppParams *ap) { + ParameterSequence *ps; + + ap->managerKeyCount=0; + ap->metatrafficMulticastIPAddressCount=0; + ap->unicastIPAddressCount=0; + ap->appId=csChange->guid.aid; + ap->hostId=csChange->guid.hid; + ul_list_for_each(CSChangeAttributes,csChange,ps) { + switch (ps->parameterID) { + case PID_EXPIRATION_TIME: + ap->expirationTime=*(NtpTime*)ps->parameterLocal; + break; + case PID_MANAGER_KEY: + ap->managerKeyList[ap->managerKeyCount]= + *(u_int32_t*)ps->parameterLocal; + ap->managerKeyCount++; + break; + case PID_MATATRAFFIC_MULTICAST_IPADDRESS: + ap->metatrafficMulticastIPAddressList[ap->metatrafficMulticastIPAddressCount]= + *(IPAddress*)ps->parameterLocal; + ap->metatrafficMulticastIPAddressCount++; + break; + case PID_APP_IPADDRESS: + ap->unicastIPAddressList[ap->unicastIPAddressCount]= + *(IPAddress*)ps->parameterLocal; + ap->unicastIPAddressCount++; + break; + case PID_USERDATA_MULTICAST_IPADDRESS: + break; + case PID_METATRAFFIC_UNICAST_PORT: + ap->metatrafficUnicastPort=*(Port*)ps->parameterLocal; + break; + case PID_USERDATA_UNICAST_PORT: + ap->userdataUnicastPort=*(Port*)ps->parameterLocal; + break; + case PID_VENDOR_ID: + ap->vendorId=*(VendorId*)ps->parameterLocal; + break; + case PID_PROTOCOL_VERSION: + ap->protocolVersion=*(ProtocolVersion*)ps->parameterLocal; + break; + case PID_VARGAPPS_SEQUENCE_NUMBER_LAST: + ap->vargAppsSequenceNumber=*(SequenceNumber*)ps->parameterLocal; + break; + } + } + return 0; +} + +/*****************************************************************************/ +int +parameterUpdatePublication(CSChange *csChange,ORTEPublProp *pp) { + ParameterSequence *ps; + + ul_list_for_each(CSChangeAttributes,csChange,ps) { + switch (ps->parameterID) { + case PID_EXPECTS_ACK: + pp->expectsAck=*(Boolean*)&ps->parameterLocal; + break; + case PID_PERSISTENCE: + pp->persistence=*(NtpTime*)&ps->parameterLocal; + break; + case PID_RELIABILITY_OFFERED: + pp->reliabilityOffered=*(u_long*)&ps->parameterLocal; + break; + case PID_SEND_QUEUE_SIZE: + pp->sendQueueSize=*(u_long*)&ps->parameterLocal; + break; + case PID_STRENGTH: + pp->strength=*(int32_t*)&ps->parameterLocal; + break; + case PID_TOPIC: + if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) + strncpy(pp->topic,ps->parameter+4,ps->parameterLength-3); + else + strncpy(pp->topic,ps->parameterLocal+4,ps->parameterLength-3); + break; + case PID_TYPE_CHECKSUM: + pp->typeChecksum=*(TypeChecksum*)&ps->parameterLocal; + break; + case PID_TYPE_NAME: + if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) + strncpy(pp->typeName,ps->parameter+4,ps->parameterLength-3); + else + strncpy(pp->typeName,ps->parameterLocal+4,ps->parameterLength-3); + break; + } + } + return 0; +} + +/*****************************************************************************/ +int +parameterUpdateSubscription(CSChange *csChange,ORTESubsProp *sp) { + ParameterSequence *ps; + + ul_list_for_each(CSChangeAttributes,csChange,ps) { + switch (ps->parameterID) { + case PID_MINIMUM_SEPARATION: + sp->minimumSeparation=*(NtpTime*)&ps->parameterLocal; + break; + case PID_RECV_QUEUE_SIZE: + sp->recvQueueSize=*(u_int32_t*)&ps->parameterLocal; + break; + case PID_RELIABILITY_REQUESTED: + sp->reliabilityRequested=*(u_int32_t*)&ps->parameterLocal; + break; + case PID_TOPIC: + if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) + strncpy(sp->topic,ps->parameter+4,ps->parameterLength-3); + else + strncpy(sp->topic,ps->parameterLocal+4,ps->parameterLength-3); + break; + case PID_TYPE_CHECKSUM: + sp->typeChecksum=*(TypeChecksum*)&ps->parameterLocal; + break; + case PID_TYPE_NAME: + if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) + strncpy(sp->typeName,ps->parameter+4,ps->parameterLength-3); + else + strncpy(sp->typeName,ps->parameterLocal+4,ps->parameterLength-3); + break; + } + } + return 0; +} + diff --git a/orte/liborte/rtl/Makefile b/orte/liborte/rtl/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/orte/liborte/rtl/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/liborte/rtl/Makefile.am b/orte/liborte/rtl/Makefile.am new file mode 100644 index 0000000..00749dd --- /dev/null +++ b/orte/liborte/rtl/Makefile.am @@ -0,0 +1,29 @@ +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# + +PTHREAD_RWLOCK_SOURCES = \ +ptw32_rwlock_check_need_init.c \ +ptw32_rwlock_cancelwrwait.c \ +pthread_rwlock_init.c \ +pthread_rwlock_destroy.c \ +pthread_rwlockattr_init.c \ +pthread_rwlockattr_destroy.c \ +pthread_rwlockattr_getpshared.c \ +pthread_rwlockattr_setpshared.c \ +pthread_rwlock_rdlock.c \ +pthread_rwlock_timedrdlock.c \ +pthread_rwlock_wrlock.c \ +pthread_rwlock_timedwrlock.c \ +pthread_rwlock_unlock.c \ +pthread_rwlock_tryrdlock.c \ +pthread_rwlock_trywrlock.c + +if CONFIG_ORTE_RT +module_PROGRAMS = pthread_rwlock.o +pthread_rwlock_o_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) +pthread_rwlock_o_SOURCES = $(PTHREAD_RWLOCK_SOURCES) +pthread_rwlock_o_LINK = $(top_builddir)/modtool --link -o $@ +endif diff --git a/orte/liborte/rtl/Makefile.in b/orte/liborte/rtl/Makefile.in new file mode 100644 index 0000000..d12d12e --- /dev/null +++ b/orte/liborte/rtl/Makefile.in @@ -0,0 +1,618 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile for the Ocera Real-Time Ethernet +# +# $Id: Makefile.am,v 1.0 2003/08/04 +# +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ + +PTHREAD_RWLOCK_SOURCES = \ +ptw32_rwlock_check_need_init.c \ +ptw32_rwlock_cancelwrwait.c \ +pthread_rwlock_init.c \ +pthread_rwlock_destroy.c \ +pthread_rwlockattr_init.c \ +pthread_rwlockattr_destroy.c \ +pthread_rwlockattr_getpshared.c \ +pthread_rwlockattr_setpshared.c \ +pthread_rwlock_rdlock.c \ +pthread_rwlock_timedrdlock.c \ +pthread_rwlock_wrlock.c \ +pthread_rwlock_timedwrlock.c \ +pthread_rwlock_unlock.c \ +pthread_rwlock_tryrdlock.c \ +pthread_rwlock_trywrlock.c + + +@CONFIG_ORTE_RT_TRUE@module_PROGRAMS = pthread_rwlock.o +@CONFIG_ORTE_RT_TRUE@pthread_rwlock_o_CFLAGS = $(ORTE_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) +@CONFIG_ORTE_RT_TRUE@pthread_rwlock_o_SOURCES = $(PTHREAD_RWLOCK_SOURCES) +@CONFIG_ORTE_RT_TRUE@pthread_rwlock_o_LINK = $(top_builddir)/modtool --link -o $@ +subdir = orte/liborte/rtl +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = +@CONFIG_ORTE_RT_TRUE@module_PROGRAMS = pthread_rwlock.o$(EXEEXT) +@CONFIG_ORTE_RT_FALSE@module_PROGRAMS = +PROGRAMS = $(module_PROGRAMS) + +am__objects_1 = pthread_rwlock_o-ptw32_rwlock_check_need_init.$(OBJEXT) \ + pthread_rwlock_o-ptw32_rwlock_cancelwrwait.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_init.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_destroy.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlockattr_init.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlockattr_destroy.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlockattr_getpshared.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlockattr_setpshared.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_rdlock.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_timedrdlock.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_wrlock.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_timedwrlock.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_unlock.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_tryrdlock.$(OBJEXT) \ + pthread_rwlock_o-pthread_rwlock_trywrlock.$(OBJEXT) +@CONFIG_ORTE_RT_TRUE@am_pthread_rwlock_o_OBJECTS = $(am__objects_1) +pthread_rwlock_o_OBJECTS = $(am_pthread_rwlock_o_OBJECTS) +pthread_rwlock_o_LDADD = $(LDADD) +pthread_rwlock_o_DEPENDENCIES = +pthread_rwlock_o_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/orte/include +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_destroy.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_init.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_rdlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedrdlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedwrlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_tryrdlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_trywrlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_unlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_wrlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_destroy.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_getpshared.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_init.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_setpshared.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_cancelwrwait.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_check_need_init.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(pthread_rwlock_o_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(pthread_rwlock_o_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu orte/liborte/rtl/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +install-modulePROGRAMS: $(module_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(moduledir) + @list='$(module_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(modulePROGRAMS_INSTALL) $$p $(DESTDIR)$(moduledir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(modulePROGRAMS_INSTALL) $$p $(DESTDIR)$(moduledir)/$$f; \ + else :; fi; \ + done + +uninstall-modulePROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(module_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(moduledir)/$$f"; \ + rm -f $(DESTDIR)$(moduledir)/$$f; \ + done + +clean-modulePROGRAMS: + -test -z "$(module_PROGRAMS)" || rm -f $(module_PROGRAMS) +pthread_rwlock_o-ptw32_rwlock_check_need_init.$(OBJEXT): \ + ptw32_rwlock_check_need_init.c +pthread_rwlock_o-ptw32_rwlock_cancelwrwait.$(OBJEXT): \ + ptw32_rwlock_cancelwrwait.c +pthread_rwlock_o-pthread_rwlock_init.$(OBJEXT): pthread_rwlock_init.c +pthread_rwlock_o-pthread_rwlock_destroy.$(OBJEXT): \ + pthread_rwlock_destroy.c +pthread_rwlock_o-pthread_rwlockattr_init.$(OBJEXT): \ + pthread_rwlockattr_init.c +pthread_rwlock_o-pthread_rwlockattr_destroy.$(OBJEXT): \ + pthread_rwlockattr_destroy.c +pthread_rwlock_o-pthread_rwlockattr_getpshared.$(OBJEXT): \ + pthread_rwlockattr_getpshared.c +pthread_rwlock_o-pthread_rwlockattr_setpshared.$(OBJEXT): \ + pthread_rwlockattr_setpshared.c +pthread_rwlock_o-pthread_rwlock_rdlock.$(OBJEXT): \ + pthread_rwlock_rdlock.c +pthread_rwlock_o-pthread_rwlock_timedrdlock.$(OBJEXT): \ + pthread_rwlock_timedrdlock.c +pthread_rwlock_o-pthread_rwlock_wrlock.$(OBJEXT): \ + pthread_rwlock_wrlock.c +pthread_rwlock_o-pthread_rwlock_timedwrlock.$(OBJEXT): \ + pthread_rwlock_timedwrlock.c +pthread_rwlock_o-pthread_rwlock_unlock.$(OBJEXT): \ + pthread_rwlock_unlock.c +pthread_rwlock_o-pthread_rwlock_tryrdlock.$(OBJEXT): \ + pthread_rwlock_tryrdlock.c +pthread_rwlock_o-pthread_rwlock_trywrlock.$(OBJEXT): \ + pthread_rwlock_trywrlock.c +pthread_rwlock.o$(EXEEXT): $(pthread_rwlock_o_OBJECTS) $(pthread_rwlock_o_DEPENDENCIES) + @rm -f pthread_rwlock.o$(EXEEXT) + $(pthread_rwlock_o_LINK) $(pthread_rwlock_o_LDFLAGS) $(pthread_rwlock_o_OBJECTS) $(pthread_rwlock_o_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_destroy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_rdlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedrdlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedwrlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_tryrdlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_trywrlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_unlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_wrlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_destroy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_getpshared.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_setpshared.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_cancelwrwait.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_check_need_init.Po@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` + +pthread_rwlock_o-ptw32_rwlock_check_need_init.o: ptw32_rwlock_check_need_init.c +@AMDEP_TRUE@ source='ptw32_rwlock_check_need_init.c' object='pthread_rwlock_o-ptw32_rwlock_check_need_init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_check_need_init.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_check_need_init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-ptw32_rwlock_check_need_init.o `test -f 'ptw32_rwlock_check_need_init.c' || echo '$(srcdir)/'`ptw32_rwlock_check_need_init.c + +pthread_rwlock_o-ptw32_rwlock_check_need_init.obj: ptw32_rwlock_check_need_init.c +@AMDEP_TRUE@ source='ptw32_rwlock_check_need_init.c' object='pthread_rwlock_o-ptw32_rwlock_check_need_init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_check_need_init.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_check_need_init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-ptw32_rwlock_check_need_init.obj `cygpath -w ptw32_rwlock_check_need_init.c` + +pthread_rwlock_o-ptw32_rwlock_cancelwrwait.o: ptw32_rwlock_cancelwrwait.c +@AMDEP_TRUE@ source='ptw32_rwlock_cancelwrwait.c' object='pthread_rwlock_o-ptw32_rwlock_cancelwrwait.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_cancelwrwait.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_cancelwrwait.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-ptw32_rwlock_cancelwrwait.o `test -f 'ptw32_rwlock_cancelwrwait.c' || echo '$(srcdir)/'`ptw32_rwlock_cancelwrwait.c + +pthread_rwlock_o-ptw32_rwlock_cancelwrwait.obj: ptw32_rwlock_cancelwrwait.c +@AMDEP_TRUE@ source='ptw32_rwlock_cancelwrwait.c' object='pthread_rwlock_o-ptw32_rwlock_cancelwrwait.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_cancelwrwait.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-ptw32_rwlock_cancelwrwait.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-ptw32_rwlock_cancelwrwait.obj `cygpath -w ptw32_rwlock_cancelwrwait.c` + +pthread_rwlock_o-pthread_rwlock_init.o: pthread_rwlock_init.c +@AMDEP_TRUE@ source='pthread_rwlock_init.c' object='pthread_rwlock_o-pthread_rwlock_init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_init.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_init.o `test -f 'pthread_rwlock_init.c' || echo '$(srcdir)/'`pthread_rwlock_init.c + +pthread_rwlock_o-pthread_rwlock_init.obj: pthread_rwlock_init.c +@AMDEP_TRUE@ source='pthread_rwlock_init.c' object='pthread_rwlock_o-pthread_rwlock_init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_init.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_init.obj `cygpath -w pthread_rwlock_init.c` + +pthread_rwlock_o-pthread_rwlock_destroy.o: pthread_rwlock_destroy.c +@AMDEP_TRUE@ source='pthread_rwlock_destroy.c' object='pthread_rwlock_o-pthread_rwlock_destroy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_destroy.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_destroy.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_destroy.o `test -f 'pthread_rwlock_destroy.c' || echo '$(srcdir)/'`pthread_rwlock_destroy.c + +pthread_rwlock_o-pthread_rwlock_destroy.obj: pthread_rwlock_destroy.c +@AMDEP_TRUE@ source='pthread_rwlock_destroy.c' object='pthread_rwlock_o-pthread_rwlock_destroy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_destroy.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_destroy.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_destroy.obj `cygpath -w pthread_rwlock_destroy.c` + +pthread_rwlock_o-pthread_rwlockattr_init.o: pthread_rwlockattr_init.c +@AMDEP_TRUE@ source='pthread_rwlockattr_init.c' object='pthread_rwlock_o-pthread_rwlockattr_init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_init.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_init.o `test -f 'pthread_rwlockattr_init.c' || echo '$(srcdir)/'`pthread_rwlockattr_init.c + +pthread_rwlock_o-pthread_rwlockattr_init.obj: pthread_rwlockattr_init.c +@AMDEP_TRUE@ source='pthread_rwlockattr_init.c' object='pthread_rwlock_o-pthread_rwlockattr_init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_init.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_init.obj `cygpath -w pthread_rwlockattr_init.c` + +pthread_rwlock_o-pthread_rwlockattr_destroy.o: pthread_rwlockattr_destroy.c +@AMDEP_TRUE@ source='pthread_rwlockattr_destroy.c' object='pthread_rwlock_o-pthread_rwlockattr_destroy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_destroy.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_destroy.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_destroy.o `test -f 'pthread_rwlockattr_destroy.c' || echo '$(srcdir)/'`pthread_rwlockattr_destroy.c + +pthread_rwlock_o-pthread_rwlockattr_destroy.obj: pthread_rwlockattr_destroy.c +@AMDEP_TRUE@ source='pthread_rwlockattr_destroy.c' object='pthread_rwlock_o-pthread_rwlockattr_destroy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_destroy.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_destroy.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_destroy.obj `cygpath -w pthread_rwlockattr_destroy.c` + +pthread_rwlock_o-pthread_rwlockattr_getpshared.o: pthread_rwlockattr_getpshared.c +@AMDEP_TRUE@ source='pthread_rwlockattr_getpshared.c' object='pthread_rwlock_o-pthread_rwlockattr_getpshared.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_getpshared.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_getpshared.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_getpshared.o `test -f 'pthread_rwlockattr_getpshared.c' || echo '$(srcdir)/'`pthread_rwlockattr_getpshared.c + +pthread_rwlock_o-pthread_rwlockattr_getpshared.obj: pthread_rwlockattr_getpshared.c +@AMDEP_TRUE@ source='pthread_rwlockattr_getpshared.c' object='pthread_rwlock_o-pthread_rwlockattr_getpshared.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_getpshared.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_getpshared.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_getpshared.obj `cygpath -w pthread_rwlockattr_getpshared.c` + +pthread_rwlock_o-pthread_rwlockattr_setpshared.o: pthread_rwlockattr_setpshared.c +@AMDEP_TRUE@ source='pthread_rwlockattr_setpshared.c' object='pthread_rwlock_o-pthread_rwlockattr_setpshared.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_setpshared.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_setpshared.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_setpshared.o `test -f 'pthread_rwlockattr_setpshared.c' || echo '$(srcdir)/'`pthread_rwlockattr_setpshared.c + +pthread_rwlock_o-pthread_rwlockattr_setpshared.obj: pthread_rwlockattr_setpshared.c +@AMDEP_TRUE@ source='pthread_rwlockattr_setpshared.c' object='pthread_rwlock_o-pthread_rwlockattr_setpshared.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_setpshared.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlockattr_setpshared.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlockattr_setpshared.obj `cygpath -w pthread_rwlockattr_setpshared.c` + +pthread_rwlock_o-pthread_rwlock_rdlock.o: pthread_rwlock_rdlock.c +@AMDEP_TRUE@ source='pthread_rwlock_rdlock.c' object='pthread_rwlock_o-pthread_rwlock_rdlock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_rdlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_rdlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_rdlock.o `test -f 'pthread_rwlock_rdlock.c' || echo '$(srcdir)/'`pthread_rwlock_rdlock.c + +pthread_rwlock_o-pthread_rwlock_rdlock.obj: pthread_rwlock_rdlock.c +@AMDEP_TRUE@ source='pthread_rwlock_rdlock.c' object='pthread_rwlock_o-pthread_rwlock_rdlock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_rdlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_rdlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_rdlock.obj `cygpath -w pthread_rwlock_rdlock.c` + +pthread_rwlock_o-pthread_rwlock_timedrdlock.o: pthread_rwlock_timedrdlock.c +@AMDEP_TRUE@ source='pthread_rwlock_timedrdlock.c' object='pthread_rwlock_o-pthread_rwlock_timedrdlock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedrdlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedrdlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_timedrdlock.o `test -f 'pthread_rwlock_timedrdlock.c' || echo '$(srcdir)/'`pthread_rwlock_timedrdlock.c + +pthread_rwlock_o-pthread_rwlock_timedrdlock.obj: pthread_rwlock_timedrdlock.c +@AMDEP_TRUE@ source='pthread_rwlock_timedrdlock.c' object='pthread_rwlock_o-pthread_rwlock_timedrdlock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedrdlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedrdlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_timedrdlock.obj `cygpath -w pthread_rwlock_timedrdlock.c` + +pthread_rwlock_o-pthread_rwlock_wrlock.o: pthread_rwlock_wrlock.c +@AMDEP_TRUE@ source='pthread_rwlock_wrlock.c' object='pthread_rwlock_o-pthread_rwlock_wrlock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_wrlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_wrlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_wrlock.o `test -f 'pthread_rwlock_wrlock.c' || echo '$(srcdir)/'`pthread_rwlock_wrlock.c + +pthread_rwlock_o-pthread_rwlock_wrlock.obj: pthread_rwlock_wrlock.c +@AMDEP_TRUE@ source='pthread_rwlock_wrlock.c' object='pthread_rwlock_o-pthread_rwlock_wrlock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_wrlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_wrlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_wrlock.obj `cygpath -w pthread_rwlock_wrlock.c` + +pthread_rwlock_o-pthread_rwlock_timedwrlock.o: pthread_rwlock_timedwrlock.c +@AMDEP_TRUE@ source='pthread_rwlock_timedwrlock.c' object='pthread_rwlock_o-pthread_rwlock_timedwrlock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedwrlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedwrlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_timedwrlock.o `test -f 'pthread_rwlock_timedwrlock.c' || echo '$(srcdir)/'`pthread_rwlock_timedwrlock.c + +pthread_rwlock_o-pthread_rwlock_timedwrlock.obj: pthread_rwlock_timedwrlock.c +@AMDEP_TRUE@ source='pthread_rwlock_timedwrlock.c' object='pthread_rwlock_o-pthread_rwlock_timedwrlock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedwrlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_timedwrlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_timedwrlock.obj `cygpath -w pthread_rwlock_timedwrlock.c` + +pthread_rwlock_o-pthread_rwlock_unlock.o: pthread_rwlock_unlock.c +@AMDEP_TRUE@ source='pthread_rwlock_unlock.c' object='pthread_rwlock_o-pthread_rwlock_unlock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_unlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_unlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_unlock.o `test -f 'pthread_rwlock_unlock.c' || echo '$(srcdir)/'`pthread_rwlock_unlock.c + +pthread_rwlock_o-pthread_rwlock_unlock.obj: pthread_rwlock_unlock.c +@AMDEP_TRUE@ source='pthread_rwlock_unlock.c' object='pthread_rwlock_o-pthread_rwlock_unlock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_unlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_unlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_unlock.obj `cygpath -w pthread_rwlock_unlock.c` + +pthread_rwlock_o-pthread_rwlock_tryrdlock.o: pthread_rwlock_tryrdlock.c +@AMDEP_TRUE@ source='pthread_rwlock_tryrdlock.c' object='pthread_rwlock_o-pthread_rwlock_tryrdlock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_tryrdlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_tryrdlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_tryrdlock.o `test -f 'pthread_rwlock_tryrdlock.c' || echo '$(srcdir)/'`pthread_rwlock_tryrdlock.c + +pthread_rwlock_o-pthread_rwlock_tryrdlock.obj: pthread_rwlock_tryrdlock.c +@AMDEP_TRUE@ source='pthread_rwlock_tryrdlock.c' object='pthread_rwlock_o-pthread_rwlock_tryrdlock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_tryrdlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_tryrdlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_tryrdlock.obj `cygpath -w pthread_rwlock_tryrdlock.c` + +pthread_rwlock_o-pthread_rwlock_trywrlock.o: pthread_rwlock_trywrlock.c +@AMDEP_TRUE@ source='pthread_rwlock_trywrlock.c' object='pthread_rwlock_o-pthread_rwlock_trywrlock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_trywrlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_trywrlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_trywrlock.o `test -f 'pthread_rwlock_trywrlock.c' || echo '$(srcdir)/'`pthread_rwlock_trywrlock.c + +pthread_rwlock_o-pthread_rwlock_trywrlock.obj: pthread_rwlock_trywrlock.c +@AMDEP_TRUE@ source='pthread_rwlock_trywrlock.c' object='pthread_rwlock_o-pthread_rwlock_trywrlock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_trywrlock.Po' tmpdepfile='$(DEPDIR)/pthread_rwlock_o-pthread_rwlock_trywrlock.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pthread_rwlock_o_CFLAGS) $(CFLAGS) -c -o pthread_rwlock_o-pthread_rwlock_trywrlock.obj `cygpath -w pthread_rwlock_trywrlock.c` +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(moduledir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-modulePROGRAMS mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-modulePROGRAMS + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-info-am uninstall-modulePROGRAMS + +.PHONY: GTAGS all all-am check check-am clean clean-generic \ + clean-modulePROGRAMS distclean distclean-compile \ + distclean-depend distclean-generic distclean-tags distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-modulePROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic tags uninstall \ + uninstall-am uninstall-info-am uninstall-modulePROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/orte/liborte/rtl/Makefile.omk b/orte/liborte/rtl/Makefile.omk new file mode 100644 index 0000000..bc6e7be --- /dev/null +++ b/orte/liborte/rtl/Makefile.omk @@ -0,0 +1,23 @@ +############################################################################# +# RT-Linux version of build + +rtlinux_LIBRARIES = pthread_rwlock + +rtlinux_INCLUDES = -I $(srcdir)/../../include + +pthread_rwlock_SOURCES = \ +ptw32_rwlock_check_need_init.c \ +ptw32_rwlock_cancelwrwait.c \ +pthread_rwlock_init.c \ +pthread_rwlock_destroy.c \ +pthread_rwlockattr_init.c \ +pthread_rwlockattr_destroy.c \ +pthread_rwlockattr_getpshared.c \ +pthread_rwlockattr_setpshared.c \ +pthread_rwlock_rdlock.c \ +pthread_rwlock_timedrdlock.c \ +pthread_rwlock_wrlock.c \ +pthread_rwlock_timedwrlock.c \ +pthread_rwlock_unlock.c \ +pthread_rwlock_tryrdlock.c \ +pthread_rwlock_trywrlock.c diff --git a/orte/liborte/rtl/pthread_rwlock_destroy.c b/orte/liborte/rtl/pthread_rwlock_destroy.c new file mode 100644 index 0000000..74124ea --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_destroy.c @@ -0,0 +1,142 @@ +/* + * pthread_rwlock_destroy.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_destroy(pthread_rwlock_t *rwlock) +{ + pthread_rwlock_t rwl; + int result = 0, result1 = 0, result2 = 0; + + if (rwlock == NULL || *rwlock == NULL) + { + return EINVAL; + } + + if (*rwlock != PTHREAD_RWLOCK_INITIALIZER) + { + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if ((result = pthread_mutex_lock(&(rwl->mtxExclusiveAccess))) != 0) + { + return result; + } + + if ((result = pthread_mutex_lock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + + /* + * Check whether any threads own/wait for the lock (wait for ex.access); + * report "BUSY" if so. + */ + if (rwl->nExclusiveAccessCount > 0 + || rwl->nSharedAccessCount > rwl->nCompletedSharedAccessCount) + { + result = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted)); + result1 = pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + result2 = EBUSY; + } + else + { + rwl->nMagic = 0; + + if ((result = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + pthread_mutex_unlock(&rwl->mtxExclusiveAccess); + return result; + } + + if ((result = pthread_mutex_unlock(&(rwl->mtxExclusiveAccess))) != 0) + { + return result; + } + + *rwlock = NULL; /* Invalidate rwlock before anything else */ + result = pthread_cond_destroy(&(rwl->cndSharedAccessCompleted)); + result1 = pthread_mutex_destroy(&(rwl->mtxSharedAccessCompleted)); + result2 = pthread_mutex_destroy(&(rwl->mtxExclusiveAccess)); + (void) free(rwl); + } + } + else + { + /* + * See notes in ptw32_rwlock_check_need_init() above also. + */ +// EnterCriticalSection(&ptw32_rwlock_test_init_lock); + + /* + * Check again. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + /* + * This is all we need to do to destroy a statically + * initialised rwlock that has not yet been used (initialised). + * If we get to here, another thread + * waiting to initialise this rwlock will get an EINVAL. + */ + *rwlock = NULL; + } + else + { + /* + * The rwlock has been initialised while we were waiting + * so assume it's in use. + */ + result = EBUSY; + } + +// LeaveCriticalSection(&ptw32_rwlock_test_init_lock); + } + + return ((result != 0) ? result : ((result1 != 0) ? result1 : result2)); +} diff --git a/orte/liborte/rtl/pthread_rwlock_init.c b/orte/liborte/rtl/pthread_rwlock_init.c new file mode 100644 index 0000000..fd91976 --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_init.c @@ -0,0 +1,111 @@ +/* + * pthread_rwlock_init.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) +{ + int result; + pthread_rwlock_t rwl = 0; + + if (rwlock == NULL) + { + return EINVAL; + } + + if (attr != NULL && *attr != NULL) + { + result = EINVAL; /* Not supported */ + goto DONE; + } + + rwl = (pthread_rwlock_t) calloc(1, sizeof(*rwl)); + + if (rwl == NULL) + { + result = ENOMEM; + goto DONE; + } + + rwl->nSharedAccessCount = 0; + rwl->nExclusiveAccessCount = 0; + rwl->nCompletedSharedAccessCount = 0; + + result = pthread_mutex_init(&rwl->mtxExclusiveAccess, NULL); + if (result != 0) + { + goto FAIL0; + } + + result = pthread_mutex_init(&rwl->mtxSharedAccessCompleted, NULL); + if (result != 0) + { + goto FAIL1; + } + + result = pthread_cond_init(&rwl->cndSharedAccessCompleted, NULL); + if (result != 0) + { + goto FAIL2; + } + + rwl->nMagic = PTW32_RWLOCK_MAGIC; + + result = 0; + goto DONE; + +FAIL2: + (void) pthread_mutex_destroy(&(rwl->mtxSharedAccessCompleted)); + +FAIL1: + (void) pthread_mutex_destroy(&(rwl->mtxExclusiveAccess)); + +FAIL0: + (void) free(rwl); + rwl = NULL; + +DONE: + *rwlock = rwl; + + return result; +} diff --git a/orte/liborte/rtl/pthread_rwlock_rdlock.c b/orte/liborte/rtl/pthread_rwlock_rdlock.c new file mode 100644 index 0000000..8731adc --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_rdlock.c @@ -0,0 +1,103 @@ +/* + * pthread_rwlock_rdlock.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) +{ + int result; + pthread_rwlock_t rwl; + + if (rwlock == NULL || *rwlock == NULL) + { + return EINVAL; + } + + /* + * We do a quick check to see if we need to do more work + * to initialise a static rwlock. We check + * again inside the guarded section of ptw32_rwlock_check_need_init() + * to avoid race conditions. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + result = ptw32_rwlock_check_need_init(rwlock); + + if (result != 0 && result != EBUSY) + { + return result; + } + } + + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if ((result = pthread_mutex_lock(&(rwl->mtxExclusiveAccess))) != 0) + { + return result; + } + + if (++rwl->nSharedAccessCount == INT_MAX) + { + if ((result = pthread_mutex_lock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + + rwl->nSharedAccessCount -= rwl->nCompletedSharedAccessCount; + rwl->nCompletedSharedAccessCount = 0; + + if ((result = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + } + + return (pthread_mutex_unlock(&(rwl->mtxExclusiveAccess))); +} diff --git a/orte/liborte/rtl/pthread_rwlock_timedrdlock.c b/orte/liborte/rtl/pthread_rwlock_timedrdlock.c new file mode 100644 index 0000000..9eb80be --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_timedrdlock.c @@ -0,0 +1,107 @@ +/* + * pthread_rwlock_timedrdlock.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, const struct timespec * abstime) +{ + int result; + pthread_rwlock_t rwl; + + if (rwlock == NULL || *rwlock == NULL) + { + return EINVAL; + } + + /* + * We do a quick check to see if we need to do more work + * to initialise a static rwlock. We check + * again inside the guarded section of ptw32_rwlock_check_need_init() + * to avoid race conditions. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + result = ptw32_rwlock_check_need_init(rwlock); + + if (result != 0 && result != EBUSY) + { + return result; + } + } + + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if ((result = pthread_mutex_timedlock(&(rwl->mtxExclusiveAccess), abstime)) != 0) + { + return result; + } + + if (++rwl->nSharedAccessCount == INT_MAX) + { + if ((result = pthread_mutex_timedlock(&(rwl->mtxSharedAccessCompleted), abstime)) != 0) + { + if (result == ETIMEDOUT) + { + ++rwl->nCompletedSharedAccessCount; + } + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + + rwl->nSharedAccessCount -= rwl->nCompletedSharedAccessCount; + rwl->nCompletedSharedAccessCount = 0; + + if ((result = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + } + + return (pthread_mutex_unlock(&(rwl->mtxExclusiveAccess))); +} diff --git a/orte/liborte/rtl/pthread_rwlock_timedwrlock.c b/orte/liborte/rtl/pthread_rwlock_timedwrlock.c new file mode 100644 index 0000000..662e113 --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_timedwrlock.c @@ -0,0 +1,137 @@ +/* + * pthread_rwlock_timedwrlock.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_timedwrlock(pthread_rwlock_t * rwlock, const struct timespec * abstime) +{ + int result; + pthread_rwlock_t rwl; + + if (rwlock == NULL || *rwlock == NULL) + { + return EINVAL; + } + + /* + * We do a quick check to see if we need to do more work + * to initialise a static rwlock. We check + * again inside the guarded section of ptw32_rwlock_check_need_init() + * to avoid race conditions. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + result = ptw32_rwlock_check_need_init(rwlock); + + if (result != 0 && result != EBUSY) + { + return result; + } + } + + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if ((result = pthread_mutex_timedlock(&(rwl->mtxExclusiveAccess), abstime)) != 0) + { + return result; + } + + if ((result = pthread_mutex_timedlock(&(rwl->mtxSharedAccessCompleted), abstime)) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + + if (rwl->nExclusiveAccessCount == 0) + { + if (rwl->nCompletedSharedAccessCount > 0) + { + rwl->nSharedAccessCount -= rwl->nCompletedSharedAccessCount; + rwl->nCompletedSharedAccessCount = 0; + } + + if (rwl->nSharedAccessCount > 0) + { + rwl->nCompletedSharedAccessCount = -rwl->nSharedAccessCount; + + /* + * This routine may be a cancelation point + * according to POSIX 1003.1j section 18.1.2. + */ +#ifdef _MSC_VER +#pragma inline_depth(0) +#endif + pthread_cleanup_push(ptw32_rwlock_cancelwrwait, (void*)rwl); + + do + { + result = pthread_cond_timedwait(&(rwl->cndSharedAccessCompleted), + &(rwl->mtxSharedAccessCompleted), + abstime); + } + while (result == 0 && rwl->nCompletedSharedAccessCount < 0); + + pthread_cleanup_pop ((result != 0) ? 1 : 0); +#ifdef _MSC_VER +#pragma inline_depth() +#endif + + if (result == 0) + { + rwl->nSharedAccessCount = 0; + } + } + } + + if (result == 0) + { + rwl->nExclusiveAccessCount++; + } + + return result; +} diff --git a/orte/liborte/rtl/pthread_rwlock_tryrdlock.c b/orte/liborte/rtl/pthread_rwlock_tryrdlock.c new file mode 100644 index 0000000..a6695ca --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_tryrdlock.c @@ -0,0 +1,103 @@ +/* + * pthread_rwlock_tryrdlock.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_tryrdlock(pthread_rwlock_t * rwlock) +{ + int result; + pthread_rwlock_t rwl; + + if (rwlock == NULL || *rwlock == NULL) + { + return EINVAL; + } + + /* + * We do a quick check to see if we need to do more work + * to initialise a static rwlock. We check + * again inside the guarded section of ptw32_rwlock_check_need_init() + * to avoid race conditions. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + result = ptw32_rwlock_check_need_init(rwlock); + + if (result != 0 && result != EBUSY) + { + return result; + } + } + + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if ((result = pthread_mutex_trylock(&(rwl->mtxExclusiveAccess))) != 0) + { + return result; + } + + if (++rwl->nSharedAccessCount == INT_MAX) + { + if ((result = pthread_mutex_lock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + + rwl->nSharedAccessCount -= rwl->nCompletedSharedAccessCount; + rwl->nCompletedSharedAccessCount = 0; + + if ((result = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + } + + return (pthread_mutex_unlock(&rwl->mtxExclusiveAccess)); +} diff --git a/orte/liborte/rtl/pthread_rwlock_trywrlock.c b/orte/liborte/rtl/pthread_rwlock_trywrlock.c new file mode 100644 index 0000000..c98ecb9 --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_trywrlock.c @@ -0,0 +1,121 @@ +/* + * pthread_rwlock_trywrlock.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" +int +pthread_rwlock_trywrlock(pthread_rwlock_t * rwlock) +{ + int result, result1; + pthread_rwlock_t rwl; + + if (rwlock == NULL || *rwlock == NULL) + { + return EINVAL; + } + + /* + * We do a quick check to see if we need to do more work + * to initialise a static rwlock. We check + * again inside the guarded section of ptw32_rwlock_check_need_init() + * to avoid race conditions. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + result = ptw32_rwlock_check_need_init(rwlock); + + if (result != 0 && result != EBUSY) + { + return result; + } + } + + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if ((result = pthread_mutex_trylock(&(rwl->mtxExclusiveAccess))) != 0) + { + return result; + } + + if ((result = pthread_mutex_trylock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + result1 = pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return ((result1 != 0) ? result1 : result); + } + + if (rwl->nExclusiveAccessCount == 0) + { + if (rwl->nCompletedSharedAccessCount > 0) + { + rwl->nSharedAccessCount -= rwl->nCompletedSharedAccessCount; + rwl->nCompletedSharedAccessCount = 0; + } + + if (rwl->nSharedAccessCount > 0) + { + if ((result = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + + if ((result = pthread_mutex_unlock(&(rwl->mtxExclusiveAccess))) == 0) + { + result = EBUSY; + } + } + else + { + rwl->nExclusiveAccessCount = 1; + } + } + else + { + result = EBUSY; + } + + return result; +} diff --git a/orte/liborte/rtl/pthread_rwlock_unlock.c b/orte/liborte/rtl/pthread_rwlock_unlock.c new file mode 100644 index 0000000..8244d0d --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_unlock.c @@ -0,0 +1,95 @@ +/* + * pthread_rwlock_unlock.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_unlock(pthread_rwlock_t * rwlock) +{ + int result, result1; + pthread_rwlock_t rwl; + + if (rwlock == NULL || *rwlock == NULL) + { + return(EINVAL); + } + + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + /* + * Assume any race condition here is harmless. + */ + return 0; + } + + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if (rwl->nExclusiveAccessCount == 0) + { + if ((result = pthread_mutex_lock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + return result; + } + + if (++rwl->nCompletedSharedAccessCount == 0) + { + result = pthread_cond_signal(&(rwl->cndSharedAccessCompleted)); + } + + result1 = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted)); + } + else + { + rwl->nExclusiveAccessCount--; + + result = pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted)); + result1 = pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + + } + + return ((result != 0) ? result : result1); +} diff --git a/orte/liborte/rtl/pthread_rwlock_wrlock.c b/orte/liborte/rtl/pthread_rwlock_wrlock.c new file mode 100644 index 0000000..301bf44 --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlock_wrlock.c @@ -0,0 +1,136 @@ +/* + * pthread_rwlock_wrlock.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlock_wrlock(pthread_rwlock_t * rwlock) +{ + int result; + pthread_rwlock_t rwl; + + if (rwlock == NULL || *rwlock == NULL) + { + return EINVAL; + } + + /* + * We do a quick check to see if we need to do more work + * to initialise a static rwlock. We check + * again inside the guarded section of ptw32_rwlock_check_need_init() + * to avoid race conditions. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + result = ptw32_rwlock_check_need_init(rwlock); + + if (result != 0 && result != EBUSY) + { + return result; + } + } + + rwl = *rwlock; + + if (rwl->nMagic != PTW32_RWLOCK_MAGIC) + { + return EINVAL; + } + + if ((result = pthread_mutex_lock(&(rwl->mtxExclusiveAccess))) != 0) + { + return result; + } + + if ((result = pthread_mutex_lock(&(rwl->mtxSharedAccessCompleted))) != 0) + { + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); + return result; + } + + if (rwl->nExclusiveAccessCount == 0) + { + if (rwl->nCompletedSharedAccessCount > 0) + { + rwl->nSharedAccessCount -= rwl->nCompletedSharedAccessCount; + rwl->nCompletedSharedAccessCount = 0; + } + + if (rwl->nSharedAccessCount > 0) + { + rwl->nCompletedSharedAccessCount = -rwl->nSharedAccessCount; + + /* + * This routine may be a cancelation point + * according to POSIX 1003.1j section 18.1.2. + */ +#ifdef _MSC_VER +#pragma inline_depth(0) +#endif + pthread_cleanup_push(ptw32_rwlock_cancelwrwait, (void*)rwl); + + do + { + result = pthread_cond_wait(&(rwl->cndSharedAccessCompleted), + &(rwl->mtxSharedAccessCompleted)); + } + while (result == 0 && rwl->nCompletedSharedAccessCount < 0); + + pthread_cleanup_pop ((result != 0) ? 1 : 0); +#ifdef _MSC_VER +#pragma inline_depth() +#endif + + if (result == 0) + { + rwl->nSharedAccessCount = 0; + } + } + } + + if (result == 0) + { + rwl->nExclusiveAccessCount++; + } + + return result; +} diff --git a/orte/liborte/rtl/pthread_rwlockattr_destroy.c b/orte/liborte/rtl/pthread_rwlockattr_destroy.c new file mode 100644 index 0000000..2ffaf28 --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlockattr_destroy.c @@ -0,0 +1,87 @@ +/* + * pthread_rwlockattr_destroy.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr) + /* + * ------------------------------------------------------ + * DOCPUBLIC + * Destroys a rwlock attributes object. The object can + * no longer be used. + * + * PARAMETERS + * attr + * pointer to an instance of pthread_rwlockattr_t + * + * + * DESCRIPTION + * Destroys a rwlock attributes object. The object can + * no longer be used. + * + * NOTES: + * 1) Does not affect rwlockss created using 'attr' + * + * RESULTS + * 0 successfully released attr, + * EINVAL 'attr' is invalid. + * + * ------------------------------------------------------ + */ +{ + int result = 0; + + if (attr == NULL || *attr == NULL) + { + result = EINVAL; + } + else + { + pthread_rwlockattr_t rwa = *attr; + + *attr = NULL; + free (rwa); + } + + return(result); +} /* pthread_rwlockattr_destroy */ diff --git a/orte/liborte/rtl/pthread_rwlockattr_getpshared.c b/orte/liborte/rtl/pthread_rwlockattr_getpshared.c new file mode 100644 index 0000000..09b17c8 --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlockattr_getpshared.c @@ -0,0 +1,101 @@ +/* + * pthread_rwlockattr_getpshared.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr, + int *pshared) + /* + * ------------------------------------------------------ + * DOCPUBLIC + * Determine whether rwlocks created with 'attr' can be + * shared between processes. + * + * PARAMETERS + * attr + * pointer to an instance of pthread_rwlockattr_t + * + * pshared + * will be set to one of: + * + * PTHREAD_PROCESS_SHARED + * May be shared if in shared memory + * + * PTHREAD_PROCESS_PRIVATE + * Cannot be shared. + * + * + * DESCRIPTION + * Rwlocks creatd with 'attr' can be shared between + * processes if pthread_rwlock_t variable is allocated + * in memory shared by these processes. + * NOTES: + * 1) pshared rwlocks MUST be allocated in shared + * memory. + * 2) The following macro is defined if shared rwlocks + * are supported: + * _POSIX_THREAD_PROCESS_SHARED + * + * RESULTS + * 0 successfully retrieved attribute, + * EINVAL 'attr' is invalid, + * + * ------------------------------------------------------ + */ +{ + int result; + + if ((attr != NULL && *attr != NULL) && + (pshared != NULL)) + { + *pshared = (*attr)->pshared; + result = 0; + } + else + { + result = EINVAL; + } + + return (result); + +} /* pthread_rwlockattr_getpshared */ diff --git a/orte/liborte/rtl/pthread_rwlockattr_init.c b/orte/liborte/rtl/pthread_rwlockattr_init.c new file mode 100644 index 0000000..8721b6c --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlockattr_init.c @@ -0,0 +1,86 @@ +/* + * pthread_rwlockattr_init.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlockattr_init (pthread_rwlockattr_t * attr) + /* + * ------------------------------------------------------ + * DOCPUBLIC + * Initializes a rwlock attributes object with default + * attributes. + * + * PARAMETERS + * attr + * pointer to an instance of pthread_rwlockattr_t + * + * + * DESCRIPTION + * Initializes a rwlock attributes object with default + * attributes. + * + * RESULTS + * 0 successfully initialized attr, + * ENOMEM insufficient memory for attr. + * + * ------------------------------------------------------ + */ +{ + int result = 0; + pthread_rwlockattr_t rwa; + + rwa = (pthread_rwlockattr_t) calloc (1, sizeof (*rwa)); + + if (rwa == NULL) + { + result = ENOMEM; + } + else + { + rwa->pshared = PTHREAD_PROCESS_PRIVATE; + } + + *attr = rwa; + + return(result); +} /* pthread_rwlockattr_init */ diff --git a/orte/liborte/rtl/pthread_rwlockattr_setpshared.c b/orte/liborte/rtl/pthread_rwlockattr_setpshared.c new file mode 100644 index 0000000..2eaa541 --- /dev/null +++ b/orte/liborte/rtl/pthread_rwlockattr_setpshared.c @@ -0,0 +1,124 @@ +/* + * pthread_rwlockattr_setpshared.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include +//#include + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +int +pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr, + int pshared) + /* + * ------------------------------------------------------ + * DOCPUBLIC + * Rwlocks created with 'attr' can be shared between + * processes if pthread_rwlock_t variable is allocated + * in memory shared by these processes. + * + * PARAMETERS + * attr + * pointer to an instance of pthread_rwlockattr_t + * + * pshared + * must be one of: + * + * PTHREAD_PROCESS_SHARED + * May be shared if in shared memory + * + * PTHREAD_PROCESS_PRIVATE + * Cannot be shared. + * + * DESCRIPTION + * Rwlocks creatd with 'attr' can be shared between + * processes if pthread_rwlock_t variable is allocated + * in memory shared by these processes. + * + * NOTES: + * 1) pshared rwlocks MUST be allocated in shared + * memory. + * + * 2) The following macro is defined if shared rwlocks + * are supported: + * _POSIX_THREAD_PROCESS_SHARED + * + * RESULTS + * 0 successfully set attribute, + * EINVAL 'attr' or pshared is invalid, + * ENOSYS PTHREAD_PROCESS_SHARED not supported, + * + * ------------------------------------------------------ + */ +{ + int result; + + if ((attr != NULL && *attr != NULL) && + ((pshared == PTHREAD_PROCESS_SHARED) || + (pshared == PTHREAD_PROCESS_PRIVATE))) + { + if (pshared == PTHREAD_PROCESS_SHARED) + { + +#if !defined( _POSIX_THREAD_PROCESS_SHARED ) + + result = ENOSYS; + pshared = PTHREAD_PROCESS_PRIVATE; + +#else + + result = 0; + +#endif /* _POSIX_THREAD_PROCESS_SHARED */ + + } + else + { + result = 0; + } + + (*attr)->pshared = pshared; + } + else + { + result = EINVAL; + } + + return (result); + +} /* pthread_rwlockattr_setpshared */ diff --git a/orte/liborte/rtl/ptw32_rwlock_cancelwrwait.c b/orte/liborte/rtl/ptw32_rwlock_cancelwrwait.c new file mode 100644 index 0000000..8c52fc9 --- /dev/null +++ b/orte/liborte/rtl/ptw32_rwlock_cancelwrwait.c @@ -0,0 +1,52 @@ +/* + * ptw32_rwlock_cancelwrwait.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +void +ptw32_rwlock_cancelwrwait(void * arg) +{ + pthread_rwlock_t rwl = (pthread_rwlock_t) arg; + + rwl->nSharedAccessCount = -rwl->nCompletedSharedAccessCount; + rwl->nCompletedSharedAccessCount = 0; + + (void) pthread_mutex_unlock(&(rwl->mtxSharedAccessCompleted)); + (void) pthread_mutex_unlock(&(rwl->mtxExclusiveAccess)); +} diff --git a/orte/liborte/rtl/ptw32_rwlock_check_need_init.c b/orte/liborte/rtl/ptw32_rwlock_check_need_init.c new file mode 100644 index 0000000..8f4119c --- /dev/null +++ b/orte/liborte/rtl/ptw32_rwlock_check_need_init.c @@ -0,0 +1,95 @@ +/* + * pthread_rwlock_check_need_init.c + * + * Description: + * This translation unit implements read/write lock primitives. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2002 Pthreads-win32 contributors + * + * Contact Email: rpj@ise.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +//#include "pthread.h" +//#include "implement.h" + +#include "orte.h" + +inline int +ptw32_rwlock_check_need_init(pthread_rwlock_t *rwlock) +{ + int result = 0; + + /* + * The following guarded test is specifically for statically + * initialised rwlocks (via PTHREAD_RWLOCK_INITIALIZER). + * + * Note that by not providing this synchronisation we risk + * introducing race conditions into applications which are + * correctly written. + * + * Approach + * -------- + * We know that static rwlocks will not be PROCESS_SHARED + * so we can serialise access to internal state using + * Win32 Critical Sections rather than Win32 Mutexes. + * + * If using a single global lock slows applications down too much, + * multiple global locks could be created and hashed on some random + * value associated with each mutex, the pointer perhaps. At a guess, + * a good value for the optimal number of global locks might be + * the number of processors + 1. + * + */ +// EnterCriticalSection(&ptw32_rwlock_test_init_lock); + + /* + * We got here possibly under race + * conditions. Check again inside the critical section + * and only initialise if the rwlock is valid (not been destroyed). + * If a static rwlock has been destroyed, the application can + * re-initialise it only by calling pthread_rwlock_init() + * explicitly. + */ + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + { + result = pthread_rwlock_init(rwlock, NULL); + } + else if (*rwlock == NULL) + { + /* + * The rwlock has been destroyed while we were waiting to + * initialise it, so the operation that caused the + * auto-initialisation should fail. + */ + result = EINVAL; + } + +// LeaveCriticalSection(&ptw32_rwlock_test_init_lock); + + return result; +} diff --git a/orte/liborte/sock.c b/orte/liborte/sock.c new file mode 100644 index 0000000..998aa10 --- /dev/null +++ b/orte/liborte/sock.c @@ -0,0 +1,195 @@ +/* + * $Id: sock.c,v 0.0.0.1 2003/08/21 + * + * DEBUG: section 6 Socket + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "orte.h" + +/*********************************************************************/ +int +sock_start(void) { +#if defined(SOCK_BSD) || defined (SOCK_RTL) + return 0; +#elif defined (SOCK_WIN) + WORD wVersionRequested; + WSADATA wsaData; + wVersionRequested = MAKEWORD(2, 0); + return WSAStartup(wVersionRequested, &wsaData); +#endif +} + +/*********************************************************************/ +inline void +sock_finish(void) { +#if defined(SOCK_WIN) + WSACleanup(); +#endif +} + +/*********************************************************************/ +int +sock_init_udp(sock_t *sock) { + sock->fd = socket(AF_INET, SOCK_DGRAM, 0); + if (sock->fd < 0) return -1; + return 0; +} + +/*********************************************************************/ +inline void +sock_cleanup(sock_t *sock) { +#if defined(SOCK_BSD) + close(sock->fd); +#elif defined(SOCK_RTL) + close_socket_np(sock->fd); +#elif defined(SOCK_WIN) + closesocket(sock->fd); +#endif +} + +/*********************************************************************/ +int +sock_setsockopt(sock_t *sock,int optname,const char *optval, int optlen) { + if (setsockopt(sock->fd, IPPROTO_IP, optname,(void *)&optval, optlen)) { + sock_cleanup(sock); + return -1; + } + return 0; +} + +/*********************************************************************/ +int +sock_getsockopt(sock_t *sock,int optname,char *optval, int *optlen) { + if (getsockopt(sock->fd, IPPROTO_IP, optname,(void *)&optval, optlen)) { + sock_cleanup(sock); + return -1; + } + return 0; +} + +/*********************************************************************/ +int +sock_bind(sock_t *sock,u_int16_t port) { + struct sockaddr_in name; + int32_t size; + + name.sin_family = AF_INET; + name.sin_port = htons(port); + name.sin_addr.s_addr = htonl(INADDR_ANY); + if (bind(sock->fd, (struct sockaddr *)&name, sizeof(name)) < 0) { + sock_cleanup(sock); + return -1; + } + size = sizeof(name); + if (getsockname(sock->fd,(struct sockaddr *)&name, &size ) < 0) { + sock_cleanup(sock); + return -1; + } + sock->port=ntohs(name.sin_port); + return 0; +} + +/*********************************************************************/ +inline int +sock_recvfrom(sock_t *sock, void *buf, int max_len,struct sockaddr_in *des,int des_len) { + return recvfrom(sock->fd, buf, max_len, 0,(struct sockaddr*)des,&des_len); +} + +/*********************************************************************/ +inline int +sock_sendto(sock_t *sock, void *buf, int len,struct sockaddr_in *des,int des_len) { + return sendto(sock->fd, buf, len, 0,(struct sockaddr*)des,des_len); +} + +/*********************************************************************/ +inline int +sock_ioctl(sock_t *sock, int cmd, int *arg) { + return ioctl(sock->fd, cmd, arg); +} + +/*********************************************************************/ +int +sock_get_local_interfaces(sock_t *sock,ORTEIFProp *IFProp,char *IFCount) { +#if defined(SOCK_BSD) + struct ifconf ifc; + char buf[MAX_INTERFACES*sizeof(struct ifreq)]; + char *ptr; + + ifc.ifc_len = sizeof(buf); + ifc.ifc_buf = buf; + *IFCount=0; + if (ioctl(sock->fd, SIOCGIFCONF, &ifc) < 0) return -1; + for (ptr = buf; ptr < (buf + ifc.ifc_len);ptr += sizeof(struct ifreq)) { + struct ifreq* ifr = (struct ifreq*) ptr; + struct sockaddr addr; + memcpy(&addr, &ifr->ifr_addr, sizeof(addr)); + ioctl(sock->fd, SIOCGIFFLAGS, ifr); + if ((ifr->ifr_flags & IFF_UP) && !(ifr->ifr_flags & IFF_LOOPBACK)) { + (*IFCount)++; + IFProp->ifFlags=ifr->ifr_flags; + IFProp->ipAddress=ntohl(((struct sockaddr_in*)&addr)->sin_addr.s_addr); + IFProp++; + } + } + return 0; +#elif defined(SOCK_RTL) + /* loopback iface is recognized if it has this address */ + char ip_address [] = "127.0.0.1"; + struct in_addr loopaddr; + int i; + + *IFCount=0; + if (inet_aton(ip_address, &loopaddr) != 0) return -1; + + for (i = 0; i < NIC_TABLE_SIZE; i++) { + if (nic_table [i].nic_struct != NULL) { + if (nic_table[i].ipad.s_addr != loopaddr.s_addr) { + (*IFCount)++; + IFProp->ifFlags=0; //RT-Linux doesn't flags + IFProp->ipAddress=ntohl(nic_table[i].ipad.s_addr); + IFProp++; + } + } + } + return 0; +#elif defined(SOCK_WIN) + INTERFACE_INFO InterfaceList[MAX_INTERFACES]; + struct sockaddr_in* pAddress; + int len,i; + + *IFCount=0; + if (WSAIoctl(sock->fd,SIO_GET_INTERFACE_LIST,NULL,0, + InterfaceList, sizeof(InterfaceList), + &len, NULL, NULL)==SOCKET_ERROR) return -1; + len=len/sizeof(INTERFACE_INFO); + for(i=0;iifFlags=nFlags; + IFProp->ipAddress=ntohl(pAddress->sin_addr.s_addr); + IFProp++; + (*IFCount)++; + } + } + return 0; +#endif +} + + diff --git a/orte/liborte/ul_gavl.c b/orte/liborte/ul_gavl.c new file mode 100644 index 0000000..3f2de5e --- /dev/null +++ b/orte/liborte/ul_gavl.c @@ -0,0 +1,592 @@ +/******************************************************************* + uLan Communication - C interface library + + ul_gavl.c - generic AVL tree + + (C) Copyright 2003 by Pavel Pisa - Originator + + The uLan driver is distributed under the Gnu General Public License. + See file COPYING for details. + + Originator reserve the right to use and publish sources + under different conditions too. If third party contributors + do not accept this condition, they can delete this statement + and only GNU license will apply. + *******************************************************************/ + +//#include +#include +#include +#include "ul_gavl.h" + +int +gavl_hdiff_check(gavl_node_t *node, int mode); + +#if 0 + #define GAVL_HDIFF_DEBUG(tree, mode) gavl_hdiff_check(tree, mode) +#else + #define GAVL_HDIFF_DEBUG(tree, mode) +#endif + + +/** + * gavl_first_node - Returns First Node of GAVL Tree + * @root: GAVL tree root + * + * Return Value: pointer to the first node of tree according to ordering + */ +gavl_node_t * +gavl_first_node(const gavl_root_t *root) +{ + gavl_node_t *n=root->root_node; + if(!n) return NULL; + while(n->left) + n=n->left; + return n; +} + +/** + * gavl_last_node - Returns Last Node of GAVL Tree + * @root: GAVL tree root + * + * Return Value: pointer to the last node of tree according to ordering + */ +gavl_node_t * +gavl_last_node(const gavl_root_t *root) +{ + gavl_node_t *n=root->root_node; + if(!n) return NULL; + while(n->right) + n=n->right; + return n; +} + +/** + * gavl_is_empty - Check for Empty GAVL Tree + * @root: GAVL tree root + * + * Return Value: returns non-zero value if there is no node in the tree + */ +int +gavl_is_empty(const gavl_root_t *root) +{ + return !root->root_node; +} + +/** + * gavl_search_node - Search for Node or Place for Node by Key + * @root: GAVL tree root + * @key: key value searched for + * @mode: mode of the search operation + * @nodep: pointer to place for storing of pointer to found node + * or pointer to node which should be parent of inserted node + * + * Core search routine for GAVL trees + * searches in tree starting at @root for node of item + * with value of item field at offset @key_off + * equal to provided *@key value. Values are compared by function + * pointed by *@cmp_fnc field in the tree @root. + * Integer @mode modifies search algorithm: + * %GAVL_FANY .. finds node of any item with field value *@key, + * %GAVL_FFIRST .. finds node of first item with *@key, + * %GAVL_FAFTER .. node points after last item with *@key value, + * reworded - index points at first item with higher + * value of field or after last item + * Return Value: Return of nonzero value indicates match found. + * If the @mode is ored with %GAVL_FCMP, result of last compare + * is returned. + */ +int +gavl_search_node(const gavl_root_t *root, const void *key, + int mode, gavl_node_t **nodep) +{ + int cmp=1; + gavl_node_t *n, *p; + n=p=root->root_node; + while(n){ + p=n; + /*If external int than equivalent to cmp=*(int*)(n)-*(int*)key;*/ + cmp=root->cmp_fnc(gavl_node2key(root,n),key); + if(cmp>0){ + n=n->left; + }else if((cmp<0)||(mode&GAVL_FAFTER)){ + n=n->right; + }else{ + break; + } + } + if(mode&GAVL_FAFTER){ + if(cmp<=0) + if(p) p=gavl_next_node(p); + *nodep=p; + return p!=NULL; + } + if(cmp&&!(mode&GAVL_FCMP)){ + *nodep=0; + return 0; + } + if(mode&GAVL_FFIRST){ + while((n=p->left)){ + cmp=root->cmp_fnc(gavl_node2key(root,n),key); + if(!cmp){ + p=n; + }else{ + while((n=n->right)){ + cmp=root->cmp_fnc(gavl_node2key(root,n),key); + if(!cmp){ + p=n; + break; + } + } + if(cmp) break; + } + } + cmp=0; + } + *nodep=p; + return cmp; +} + +/** + * gavl_find - Find Item for Provided Key + * @root: GAVL tree root + * @key: key value searched for + * + * Return Value: pointer to item associated to key value. + */ +void * +gavl_find(const gavl_root_t *root, const void *key) +{ + gavl_node_t *n; + int ret; + ret=gavl_search_node(root, key, GAVL_FANY, &n); + if(!ret) return NULL; + return gavl_node2item(root,n); +} + +/** + * gavl_find_first - Find the First Item with Provided Key Value + * @root: GAVL tree root + * @key: key value searched for + * + * same as above, but first matching item is found. + * Return Value: pointer to the first item associated to key value. + */ +void * +gavl_find_first(const gavl_root_t *root, const void *key) +{ + gavl_node_t *n; + n=gavl_find_first_node(root, key); + return n?gavl_node2item(root,n):NULL; +} + +/** + * gavl_find_after - Find the First Item with Higher Key Value + * @root: GAVL tree root + * @key: key value searched for + * + * same as above, but first matching item is found. + * Return Value: pointer to the first item associated to key value. + */ +void * +gavl_find_after(const gavl_root_t *root, const void *key) +{ + gavl_node_t *n; + n=gavl_find_after(root, key); + return n?gavl_node2item(root,n):NULL; +} + +/** + * gavl_insert_node_at - Insert Existing Node to Already Computed Place into GAVL Tree + * @root: GAVL tree root + * @node: pointer to inserted node + * @where: pointer to found parent node + * @leftright: left (1) or right (0) branch + * + * Return Value: positive value informs about success + */ +int +gavl_insert_node_at(gavl_root_t *root, gavl_node_t *node, + gavl_node_t *where, int leftright) +{ + return gavl_insert_primitive_at(&root->root_node, node, where, leftright); +} + +/** + * gavl_insert_node - Insert Existing Node into GAVL Tree + * @root: GAVL tree root + * @node: pointer to inserted node + * @mode: if mode is %GAVL_FAFTER, multiple items with same key can + * be used, else strict ordering is required + * + * Return Value: positive value informs about success + */ +int +gavl_insert_node(gavl_root_t *root, gavl_node_t *node, int mode) +{ + int cmp; + gavl_node_t *where; + + cmp=gavl_search_node(root, gavl_node2key(root, node), + (mode|GAVL_FCMP), &where); + if((mode!=GAVL_FAFTER) && !cmp) return -1; + /*return gavl_insert_node_at(root, node, where, cmp);*/ + /* insert_primitive called directly for speedup */ + return gavl_insert_primitive_at(&root->root_node, node, where, cmp); +} + +/** + * gavl_insert - Insert New Item into GAVL Tree + * @root: GAVL tree root + * @item: pointer to inserted item + * @mode: if mode is GAVL_FAFTER, multiple items with same key can + * be used, else strict ordering is required + * + * Return Value: positive value informs about success, negative + * value indicates malloc fail or attempt to insert item + * with already defined key. + */ +int +gavl_insert(gavl_root_t *root, void *item, int mode) +{ + int cmp; + gavl_node_t *where, *n2add; + + cmp=gavl_search_node(root, (char*)item+root->key_offs, + (mode|GAVL_FCMP), &where); + if((mode!=GAVL_FAFTER) && !cmp) return -1; + if(root->node_offs<0){ + n2add=MALLOC(sizeof(gavl_node_t)+sizeof(void*)); + if(!n2add) return -1; + *(void**)(n2add+1)=item; + } else { + n2add=(gavl_node_t*)((char*)item+root->node_offs); + } + /*return gavl_insert_node_at(root, n2add, where, cmp);*/ + /* insert_primitive called directly for speedup */ + return gavl_insert_primitive_at(&root->root_node, n2add, where, cmp); +} + +/** + * gavl_delete_node - Deletes/Unlinks Node from GAVL Tree + * @root: GAVL tree root + * @node: pointer to deleted node + * + * Return Value: positive value informs about success. + */ +int +gavl_delete_node(gavl_root_t *root, gavl_node_t *node) +{ + return gavl_delete_primitive(&root->root_node, node); +} + +/** + * gavl_delete - Delete/Unlink Item from GAVL Tree + * @root: GAVL tree root + * @item: pointer to deleted item + * + * Return Value: positive value informs about success, negative + * value indicates that item is not found in tree defined by root + */ +int +gavl_delete(gavl_root_t *root, void *item) +{ + int ret; + gavl_node_t *n, *p; + if(!item) return -1; + if(root->node_offs>=0){ + n=(gavl_node_t*)((char*)item+root->node_offs); + for(p=n; p->parent; p=p->parent); + if(p!=root->root_node) + return -1; + } else { + if(!gavl_search_node(root, (char*)item+root->key_offs, GAVL_FFIRST, &n)) + return -1; + while(gavl_node2item(root,n)!=item){ + n=gavl_next_node(n); + if(!n) return -1; + if(root->cmp_fnc(gavl_node2key(root,n),(char*)item+root->key_offs)) + return -1; + } + } + /*ret=gavl_delete_node(root, n);*/ + /* delete_primitive called directly for speedup */ + ret=gavl_delete_primitive(&root->root_node, n); + if(root->node_offs<0) + FREE(n); + return ret; +} + +/** + * gavl_delete_and_next_node - Delete/Unlink Item from GAVL Tree + * @root: GAVL tree root + * @node: pointer to actual node which is unlinked from tree + * after function call, it can be unalocated or reused + * by application code after this call. + * + * This function can be used after call gavl_first_node() for destructive + * traversal through the tree, it cannot be combined with gavl_next_node() + * or gavl_prev_node() and root is emptied after the end of traversal. + * If the tree is used after unsuccessful/unfinished traversal, it + * must be balanced again. The height differences are inconsistent in other + * case. If traversal could be interrupted, the function gavl_cut_first() + * could be better choice. + * Return Value: pointer to next node or NULL, when all nodes are deleted + */ +gavl_node_t * +gavl_delete_and_next_node(gavl_root_t *root, gavl_node_t *node) +{ + gavl_node_t *n, **np; + if(!node) node=gavl_first_node(root); + /* We are in big troubles if there is left child, somebody misused + this function => stop an pray, something bad happens in future */ + if(node->left) return NULL; + if((n=node->parent)){ + if(n->left==node) np=&n->left; + else np=&n->right; + } else if(node==root->root_node) { + np=&root->root_node; + }else { + /* Cross tree arguments or corrupted tree */ + return NULL; + } + if((n=node->right)){ + *np=n; + n->parent=node->parent; + while(n->left) n=n->left; + } else { + if(!node->parent){ + *np=NULL; + return NULL; + } + /* Again, this cannot happen */ + if(node->parent->left!=node) return NULL; + *np=NULL; + n=node->parent; + } + node->left=node->right=NULL; + node->parent=NULL; + return n; +} + +/*===========================================================*/ +/* basic types compare functions */ + +int gavl_cmp_int(const void *a, const void *b) +{ + if (*(int*)a>*(int*)b) return 1; + if (*(int*)a<*(int*)b) return -1; + return 0; +} + +int gavl_cmp_long(const void *a, const void *b) +{ + if (*(long*)a>*(long*)b) return 1; + if (*(long*)a<*(long*)b) return -1; + return 0; +} + +int gavl_cmp_ptr(const void *a, const void *b) +{ + if (*(void**)a>*(void**)b) return 1; + if (*(void**)a<*(void**)b) return -1; + return 0; +} + +/*===========================================================*/ +/* support for unbalanced trees */ + +#ifdef GAVL_UNBALANCED_SUPPORT + +int +gavl_adjust_hdiff(gavl_node_t *node, int adj) +{ + gavl_node_t *p; + int hdiff; + while((p=node->parent)&&adj){ + if(p->left==node){ + hdiff=p->hdiff; + /*printf("L%d ",adj);*/ + p->hdiff=hdiff+adj; + if(adj>0){ + if(hdiff<0) + if((adj+=hdiff)<=0) break; + }else{ + if(hdiff<=0) break; + if(adj<-hdiff) adj=-hdiff; + } + }else{ + hdiff=p->hdiff; + p->hdiff=hdiff-adj; + /*printf("R%d ",adj);*/ + if(adj>0){ + if(hdiff>0) + if((adj-=hdiff)<=0) break; + }else{ + if(hdiff>=0) break; + if(adj1 or <-1 */ +int +gavl_balance_enhance(gavl_node_t **subtree) +{ + gavl_node_t *n, *p; + int ret=0; + if(!*subtree) return 0; + p=*subtree; + while(p->left) p=p->left; + do{ + if((n=p->right)){ + while(n->left) n=n->left; + p=n; + } else { + while(p){ + n=p->parent; + if(!n || (p==*subtree)){ + if((p->hdiff>1)||((p->hdiff<-1))){ + gavl_balance_one(subtree); + ret=1; + } + break; + } + if(n->right!=p){ + if((p->hdiff>1)||((p->hdiff<-1))){ + if(gavl_balance_one(&n->left)) + gavl_adjust_hdiff(n->left,-1); + ret=1; + } + break; + } + if((p->hdiff>1)||((p->hdiff<-1))){ + if(gavl_balance_one(&n->right)) + gavl_adjust_hdiff(n->right,-1); + ret=1; + } + p=n; + } + p=n; + } + } while(p); + return ret; +} + +/* Full tree balance */ +int +gavl_balance(gavl_root_t *root) +{ + int height=0; + gavl_node_t *n1,*n2; + gavl_node_t *s=NULL; + gavl_node_t **np; + if(!root->root_node) return 0; + for(n1=gavl_first_node(root);n1;n1=n2){ + n2=gavl_delete_and_next_node(root, n1); + if(!s){ + s=n1; height=1; + n1->hdiff=1; + } else { + for(;;) { + if(s->left && !s->right){ + s->right=n1; n1->parent=s; + s=n1; height--; + n1->hdiff=1; + break; + } else if(!s->parent || (s->parent->hdiff>s->hdiff+1)){ + n1->left=s; + n1->parent=s->parent; + if(s->parent) s->parent->right=n1; + s->parent=n1; + n1->hdiff=s->hdiff+1; + s=n1; + break; + } + height++; + if(s->parent->hdiffhdiff+1) s->parent->hdiff=s->hdiff+1; + s=s->parent; + } + } + } + while(s->parent){ + height++; + if(s->parent->hdiffhdiff+1) s->parent->hdiff=s->hdiff+1; + s=s->parent; + } + root->root_node=s; + for(n1=s;n1;){ + if(!n1->right) n1->hdiff=0; + else n1->hdiff=-n1->right->hdiff; + if(n1->left){ + n1->hdiff+=n1->left->hdiff; + n1=n1->left; + }else{ + n2=n1->right; + do{ + if(n2){ n1=n2; break;} + n2=n1; + n1=n1->parent; + if(!n1) np=&s; + else{ + if(n1->left==n2) {np=&n1->left; n2=n1->right;} + else {np=&n1->right; n2=NULL;} + } + }while(n1); + } + } + { + int adj,hdiff, balfl; + do{ + for(n1=s;n1->right;n1=n1->right); + adj=0; + balfl=0; + do{ + n1=n1->parent; + if(n1) np=&n1->right; + else np=&s; + hdiff=(*np)->hdiff; + (*np)->hdiff+=adj; + if(hdiff<0){ + if(adj>-hdiff) adj=-hdiff; + }else adj=0; + while((*np)->hdiff>1){ + if(gavl_balance_one(np)) + adj++; + balfl=1; + } + }while(n1); + }while(balfl); + } + root->root_node=s; + return 1; +} + +/** + * gavl_cut_first - Cut First Item from Tree + * @root: GAVL tree root + * + * This enables fast delete of the first item without tree balancing. + * The resulting tree is degraded but height differences are kept consistent. + * Use of this function can result in height of tree maximally one greater + * the tree managed by optimal AVL functions. + * Return Value: returns the first item or NULL if the tree is empty + */ +void * +gavl_cut_first(gavl_root_t *root) +{ + gavl_node_t *n; + void *item; + if(!(n=gavl_cut_first_primitive(&root->root_node))) + return NULL; + item=gavl_node2item(root,n); + if(root->node_offs<0) + FREE(n); + return item; +} + +#endif /*GAVL_UNBALANCED_SUPPORT*/ + diff --git a/orte/liborte/ul_gavlprim.c b/orte/liborte/ul_gavlprim.c new file mode 100644 index 0000000..b1abf1b --- /dev/null +++ b/orte/liborte/ul_gavlprim.c @@ -0,0 +1,431 @@ +/******************************************************************* + uLan Communication - C interface library + + ul_gavlprim.c - primitives for generic AVL tree + + (C) Copyright 2003 by Pavel Pisa - Originator + + The uLan driver is distributed under the Gnu General Public License. + See file COPYING for details. + + Originator reserve the right to use and publish sources + under different conditions too. If third party contributors + do not accept this condition, they can delete this statement + and only GNU license will apply. + *******************************************************************/ + +#include +#include "ul_gavl.h" + +int +gavl_hdiff_check(gavl_node_t *node, int mode); + +#if 0 + #define GAVL_HDIFF_DEBUG(tree, mode) gavl_hdiff_check(tree, mode) +#else + #define GAVL_HDIFF_DEBUG(tree, mode) +#endif + +/** + * gavl_next_node - Returns Next Node of GAVL Tree + * @node: node for which accessor is looked for + * + * Return Value: pointer to next node of tree according to ordering + */ +gavl_node_t * +gavl_next_node(const gavl_node_t *node) +{ + gavl_node_t *n; + if((n=node->right)){ + while(n->left) n=n->left; + return n; + } else { + while((n=node->parent)){ + if(n->right!=node) break; + node=n; + } + return n; + } +} + +/** + * gavl_prev_node - Returns Previous Node of GAVL Tree + * @node: node for which predecessor is looked for + * + * Return Value: pointer to previous node of tree according to ordering + */ +gavl_node_t * +gavl_prev_node(const gavl_node_t *node) +{ + gavl_node_t *n; + if((n=node->left)){ + while(n->right) n=n->right; + return n; + } else { + while((n=node->parent)){ + if(n->left!=node) break; + node=n; + } + return n; + } +} + +/** + * gavl_balance_one - Balance One Node to Enhance Balance Factor + * @subtree: pointer to pointer to node for which balance is enhanced + * + * Return Value: returns nonzero value if height of subtree is lowered by one + */ +int +gavl_balance_one(gavl_node_t **subtree) +{ + int shdiff; int ret; + gavl_node_t *n, *p, *parent; + + #ifdef GAVL_UNBALANCED_SUPPORT + if(!*subtree) return 0; + #endif /* GAVL_UNBALANCED_SUPPORT */ + parent=(*subtree)->parent; + shdiff=(*subtree)->hdiff; + + if (shdiff>1) + { + n=(*subtree)->left; + #ifdef GAVL_UNBALANCED_SUPPORT + if(!n) return 0; + #endif /* GAVL_UNBALANCED_SUPPORT */ + if (n->hdiff>=0) { + /* ds1=ds-dn-1; */ + /* if(ds>dn) dn1=dn-1; else dn1=ds-2; */ + (*subtree)->hdiff=shdiff-n->hdiff-1; + ret=n->hdiff>0; + #ifdef GAVL_UNBALANCED_SUPPORT + if(shdiff<=n->hdiff) + n->hdiff=shdiff-2; + else + #endif /* GAVL_UNBALANCED_SUPPORT */ + n->hdiff--; + p=n->right; + n->right=*subtree; (*subtree)->parent=n; + (*subtree)->left=p; if(p) p->parent=*subtree; + *subtree=n; n->parent=parent; + GAVL_HDIFF_DEBUG(*subtree, 0); + }else{ + p=n->right; + #ifdef GAVL_UNBALANCED_SUPPORT + if(!p) return 0; + #endif /* GAVL_UNBALANCED_SUPPORT */ + shdiff-=2; + if(p->hdiff>=0){ + /* ds1=ds-2-dp; dn1=dn+1; dp1=min(dp;ds-2); */ + (*subtree)->hdiff=shdiff-p->hdiff; + n->hdiff++; + #ifndef GAVL_UNBALANCED_SUPPORT + p->hdiff=0; + #else /* GAVL_UNBALANCED_SUPPORT */ + if (p->hdiff>shdiff) p->hdiff=shdiff; + #endif /* GAVL_UNBALANCED_SUPPORT */ + }else{ + /* ds1=ds-2; dn1=dn+1-dp; dp1=max(dn+1;dp); */ + (*subtree)->hdiff=shdiff; + shdiff=n->hdiff; /* shdiff reused for nhdiff */ + n->hdiff=shdiff+1-p->hdiff; + #ifndef GAVL_UNBALANCED_SUPPORT + p->hdiff=0; + #else /* GAVL_UNBALANCED_SUPPORT */ + if (p->hdiff<=shdiff) p->hdiff=shdiff+1; + #endif /* GAVL_UNBALANCED_SUPPORT */ + } + n->right=p->left; if(p->left) p->left->parent=n; + (*subtree)->left=p->right; if(p->right) p->right->parent=*subtree; + p->left=n; n->parent=p; + p->right=*subtree; (*subtree)->parent=p; + *subtree=p; p->parent=parent; + GAVL_HDIFF_DEBUG(*subtree, 0); + ret=1; + } + } + else if (shdiff<-1) + { + n=(*subtree)->right; + #ifdef GAVL_UNBALANCED_SUPPORT + if(!n) return 0; + #endif /* GAVL_UNBALANCED_SUPPORT */ + if (n->hdiff<=0) { + /* ds1=ds-dn+1; */ + /* if(dshdiff=shdiff-n->hdiff+1; + ret=n->hdiff<0; + #ifdef GAVL_UNBALANCED_SUPPORT + if(shdiff>=n->hdiff) + n->hdiff=shdiff+2; + else + #endif /* GAVL_UNBALANCED_SUPPORT */ + n->hdiff++; + p=n->left; + n->left=*subtree; (*subtree)->parent=n; + (*subtree)->right=p; if(p) p->parent=*subtree; + *subtree=n; n->parent=parent; + GAVL_HDIFF_DEBUG(*subtree, 0); + }else{ + p=n->left; + #ifdef GAVL_UNBALANCED_SUPPORT + if(!p) return 0; + #endif /* GAVL_UNBALANCED_SUPPORT */ + shdiff+=2; + if(p->hdiff<=0){ + /* ds1=ds+2-dp; dn1=dn-1; dp1=max(dp;ds+2); */ + (*subtree)->hdiff=shdiff-p->hdiff; + n->hdiff--; + #ifndef GAVL_UNBALANCED_SUPPORT + p->hdiff=0; + #else /* GAVL_UNBALANCED_SUPPORT */ + if (p->hdiffhdiff=shdiff; + #endif /* GAVL_UNBALANCED_SUPPORT */ + }else{ + /* ds1=ds+2; dn1=dn-1-dp; dp1=min(dn-1;dp); */ + (*subtree)->hdiff=shdiff; + shdiff=n->hdiff; /* shdiff reused for nhdiff */ + n->hdiff=shdiff-1-p->hdiff; + #ifndef GAVL_UNBALANCED_SUPPORT + p->hdiff=0; + #else /* GAVL_UNBALANCED_SUPPORT */ + if (p->hdiff>=shdiff) p->hdiff=shdiff-1; + #endif /* GAVL_UNBALANCED_SUPPORT */ + } + n->left=p->right; if(p->right) p->right->parent=n; + (*subtree)->right=p->left; if(p->left) p->left->parent=*subtree; + p->right=n; n->parent=p; + p->left=*subtree; (*subtree)->parent=p; + *subtree=p; p->parent=parent; + GAVL_HDIFF_DEBUG(*subtree, 0); + ret=1; + } + } else ret=0; + + /*printf("#%d",ret);*/ + return(ret); +} + +/** + * gavl_insert_primitive_at - Low Lewel Routine to Insert Node into Tree + * @root_nodep: pointer to pointer to GAVL tree root node + * @node: pointer to inserted node + * @where: pointer to found parent node + * @leftright: left (>=1) or right (<=0) branch + * + * This function can be used for implementing AVL trees with custom + * root definition. The value of the selected @left or @right pointer + * of provided @node has to be NULL before insert operation, + * i.e. node has to be end node in the selected direction. + * Return Value: positive value informs about success + */ +int +gavl_insert_primitive_at(gavl_node_t **root_nodep, gavl_node_t *node, + gavl_node_t *where, int leftright) +{ + int hdiff; + + node->hdiff=0; + node->left=node->right=0; + if(!*root_nodep){ + node->parent=NULL; + *root_nodep=node; + return 1; + } + node->parent=where; + if(leftright>0) + where->left=node; /* where->avl+=1 */ + else + where->right=node; /* where->avl-=1 */ + + do{ + hdiff=where->hdiff; + if(where->left==node){ + /* break if balance enhanced */ + if(where->hdiff++ <0) break; + }else{ + /* break if balance enhanced */ + if(where->hdiff-- >0) break; + } + node=where; + where=where->parent; + if(hdiff){ + gavl_node_t **np; + if(!where) + np=root_nodep; + else if(where->left==node) + np=&where->left; + else + np=&where->right; + /* if only balanced trees are supposed, then next operation + leads to loop break for all possible cases */ + if(gavl_balance_one(np)) break; + } + } while(where); + + return 1; +} + +/** + * gavl_delete_primitive - Low Lewel Deletes/Unlinks Node from GAVL Tree + * @root_nodep: pointer to pointer to GAVL tree root node + * @node: pointer to deleted node + * + * Return Value: positive value informs about success. + */ +int +gavl_delete_primitive(gavl_node_t **root_nodep, gavl_node_t *node) +{ + int bal=0; + int hdiff=1; + int left_fl; + gavl_node_t *p, *n; + gavl_node_t **np; + + p=node->parent; + if(node==*root_nodep){ + np=root_nodep; + left_fl=0; + }else if(p->left==node){ + np=&p->left; + left_fl=1; + }else{ + np=&p->right; + left_fl=0; + } + if(!node->left){ + if(!node->right){ + /* No child */ + *np=NULL; + }else{ + /* Right child only */ + *np=node->right; + node->right->parent=p; + } + }else{ + if(!node->right){ + /* Left child only */ + *np=node->left; + node->left->parent=p; + }else{ + gavl_node_t *neigh; + if(node->hdiff>=0){ + gavl_node_t **np; + /* Use nearest left node for top of subtree */ + np=&node->left; n=*np; + while(n->right) {np=&n->right; n=*np;} + neigh=n; + if((*np=n->left)) n->left->parent=n->parent; + while(n->parent!=node){ + n=n->parent; + if(bal){ + bal=0; + if(!gavl_balance_one(&n->right)) {hdiff=0; break;} + } + if(n->hdiff++ ==0) {hdiff=0; break;} + bal=(n->hdiff>0); + } + if(bal) + if(!gavl_balance_one(&node->left)) hdiff=0; + + neigh->hdiff=node->hdiff; + if(hdiff){ + if(!(neigh->hdiff--)) hdiff=0; + } + }else{ + gavl_node_t **np; + /* Use nearest right node for top of subtree */ + np=&node->right; n=*np; + while(n->left) {np=&n->left; n=*np;} + neigh=n; + if((*np=n->right)) n->right->parent=n->parent; + while(n->parent!=node){ + n=n->parent; + if(bal){ + bal=0; + if(!gavl_balance_one(&n->left)) {hdiff=0; break;} + } + if(n->hdiff-- ==0) {hdiff=0; break;} + bal=(n->hdiff<0); + } + if(bal) + if(!gavl_balance_one(&node->right)) hdiff=0; + + neigh->hdiff=node->hdiff; + if(hdiff){ + if(!(neigh->hdiff++)) hdiff=0; + } + } + if((neigh->left=node->left)) neigh->left->parent=neigh; + if((neigh->right=node->right)) neigh->right->parent=neigh; + neigh->parent=node->parent; + + bal=0; + p=node->parent; + *np=neigh; + } + } + if(hdiff) do{ + if(!p){ + if(bal) + gavl_balance_one(root_nodep); + break; + }else if(left_fl){ + if(bal) + if(!gavl_balance_one(&p->left)) break; + /* three cases for hdiff-- + * +1 -> 0 => recurse + * 0 -> -1 => break + * -1 -> -2 => balance and recurse + */ + bal=p->hdiff<0; + if(!p->hdiff--) break; + }else{ + if(bal) + if(!gavl_balance_one(&p->right)) break; + /* three cases for hdiff++ + * -1 -> 0 => recurse + * 0 -> +1 => break + * +1 -> +2 => balance and recurse + */ + bal=p->hdiff>0; + if(!p->hdiff++) break; + } + n=p; + p=p->parent; + if(p) left_fl=(p->left==n); + }while(1); + + node->parent=node->left=node->right=NULL; + return 1; +} + +#ifdef GAVL_UNBALANCED_SUPPORT + +/** + * gavl_cut_first_primitive - Low Lewel Routine to Cut First Node from Tree + * @root_nodep: pointer to pointer to GAVL tree root node + * + * This enables fast delete of the first node without tree balancing. + * The resulting tree is degraded but height differences are kept consistent. + * Use of this function can result in height of tree maximally one greater + * the tree managed by optimal AVL functions. + * Return Value: returns the first node or NULL if the tree is empty + */ +gavl_node_t * +gavl_cut_first_primitive(gavl_node_t **root_nodep) +{ + gavl_node_t *n, *p; + gavl_node_t **np=root_nodep; + if(!*np) return NULL; + while((n=*np)->left) + np=&(n->left); + if((*np=n->right)) n->right->parent=n->parent; + for(p=n->parent;p;p=p->parent) + if(p->hdiff++<0) break; + n->parent=n->left=n->right=NULL; + return n; +} + +#endif /*GAVL_UNBALANCED_SUPPORT*/ diff --git a/orte/liborte/usedSections.txt b/orte/liborte/usedSections.txt new file mode 100644 index 0000000..4ae0998 --- /dev/null +++ b/orte/liborte/usedSections.txt @@ -0,0 +1,65 @@ +1 - debug.c +2 - htimerNtp.c +3 - fnmatch.c +4 - globals.c +5 - +6 - sock.c +7 - conv.c +8 - objectEntry.c +9 - objectUtils.c +10 - event.c +11 - parameter.c +12 - objectEntryTimer.c +13 - +14 - +15 - +16 - +17 - +18 - +19 - +20 - ORTEInit.c +21 - ORTEDomainApp.c +22 - ORTEAppRecvMetatrafficThread.c +23 - ORTEAppRecvUserdataThread.c +24 - ORTEAppSendMetatrafficThread.c +25 - ORTEThreadUtils.c +26 - ORTETypeRegister.c +27 - ORTEVerbosity.c +28 - ORTEPattern.c +29 - ORTEDomainMgr.c +30 - ORTEDomain.c +31 - ORTEPublication.c +32 - ORTEPublicationTimer.c +33 - ORTESubscription.c +34 - +35 - +36 - +37 - +38 - +39 - +40 - RTPSHeader.c +41 - RTPSPad.c +42 - RTPSInfoDST.c +43 - RTPSInfoREPLY.c +44 - RTPSInfoSRC.c +45 - RTPSInfoTS.c +46 - RTPSVar.c +47 - RTPSAck.c +48 - RTPSHeardBeat.c +49 - RTPSGap.c +50 - RTPSUtils.c +51 - RTPSCSTWriter.c +52 - RTPSCSTWriterTimer.c +53 - RTPSCSTReader.c +54 - RTPSCSTReaderProc.c +55 - RTPSCSTReaderTimer.c +56 - RTPSIssue.c +57 - +58 - +59 - +60 - + + + + + diff --git a/orte/manager/Makefile b/orte/manager/Makefile new file mode 100644 index 0000000..f595272 --- /dev/null +++ b/orte/manager/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/orte/manager/Makefile.am b/orte/manager/Makefile.am new file mode 100644 index 0000000..a583628 --- /dev/null +++ b/orte/manager/Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = ORTEManager + +ORTEManager_SOURCES = ORTEManager.c +if CONFIG_ORTE_WIN + win_libs= $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +endif +ORTEManager_LDADD = ../liborte/liborte.a $(win_libs) + diff --git a/orte/manager/Makefile.in b/orte/manager/Makefile.in new file mode 100644 index 0000000..aeea20c --- /dev/null +++ b/orte/manager/Makefile.in @@ -0,0 +1,342 @@ +# Makefile.in generated by automake 1.6.3 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CC = @CC@ +DEPDIR = @DEPDIR@ +INCLUDES = @INCLUDES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LINUX_AFLAGS = @LINUX_AFLAGS@ +LINUX_ARCH = @LINUX_ARCH@ +LINUX_ARFLAGS = @LINUX_ARFLAGS@ +LINUX_AS = @LINUX_AS@ +LINUX_CC = @LINUX_CC@ +LINUX_CFLAGS = @LINUX_CFLAGS@ +LINUX_CROSS_COMPILE = @LINUX_CROSS_COMPILE@ +LINUX_DIR = @LINUX_DIR@ +LINUX_KERNELRELEASE = @LINUX_KERNELRELEASE@ +LINUX_LD = @LINUX_LD@ +LINUX_LDFLAGS = @LINUX_LDFLAGS@ +LINUX_MODULE_EXT = @LINUX_MODULE_EXT@ +MAINT = @MAINT@ +ORTE_MAJOR_VERSION = @ORTE_MAJOR_VERSION@ +ORTE_MICRO_VERSION = @ORTE_MICRO_VERSION@ +ORTE_MINOR_VERSION = @ORTE_MINOR_VERSION@ +ORTE_VERSION = @ORTE_VERSION@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RTAI_CFLAGS = @RTAI_CFLAGS@ +RTLINUX_CFLAGS = @RTLINUX_CFLAGS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +modulePROGRAMS_INSTALL = @modulePROGRAMS_INSTALL@ +moduledir = @moduledir@ +bin_PROGRAMS = ORTEManager + +ORTEManager_SOURCES = ORTEManager.c +@CONFIG_ORTE_WIN_TRUE@win_libs = $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +ORTEManager_LDADD = ../liborte/liborte.a $(win_libs) +subdir = orte/manager +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/orte/include/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = ORTEManager$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_ORTEManager_OBJECTS = ORTEManager.$(OBJEXT) +ORTEManager_OBJECTS = $(am_ORTEManager_OBJECTS) +@CONFIG_ORTE_WIN_TRUE@ORTEManager_DEPENDENCIES = ../liborte/liborte.a \ +@CONFIG_ORTE_WIN_TRUE@ $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a +@CONFIG_ORTE_WIN_FALSE@ORTEManager_DEPENDENCIES = ../liborte/liborte.a +ORTEManager_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/orte/include +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/admin/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ORTEManager.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(ORTEManager_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(ORTEManager_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu orte/manager/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +ORTEManager$(EXEEXT): $(ORTEManager_OBJECTS) $(ORTEManager_DEPENDENCIES) + @rm -f ORTEManager$(EXEEXT) + $(LINK) $(ORTEManager_LDFLAGS) $(ORTEManager_OBJECTS) $(ORTEManager_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ORTEManager.Po@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic distclean distclean-compile distclean-depend \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/orte/manager/Makefile.omk b/orte/manager/Makefile.omk new file mode 100644 index 0000000..a8d567a --- /dev/null +++ b/orte/manager/Makefile.omk @@ -0,0 +1,7 @@ +INCLUDES = -D_OMK_UNIX + +bin_PROGRAMS = ORTEManager + +ORTEManager_SOURCES = ORTEManager.c + +lib_LOADLIBES = orte pthread diff --git a/orte/manager/ORTEManager.c b/orte/manager/ORTEManager.c new file mode 100644 index 0000000..2bf0a0d --- /dev/null +++ b/orte/manager/ORTEManager.c @@ -0,0 +1,204 @@ +/* + * $Id: ORTEManager.c,v 0.0.0.1 2003/10/07 + * + * DEBUG: section Manager + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include +#include +#ifdef _WIN32 + #include +#elif defined __RTL__ +#else + #include + #include + #include + #include + #include +#endif + +#include "orte_api.h" + +Boolean +onMgrAppRemoteNew(const struct ORTEAppInfo *appInfo, void *param) { + printf("%s 0x%x-0x%x was accepted\n", + (appInfo->appId & 0x3)==MANAGER ? "manager" : "application", + appInfo->hostId,appInfo->appId); + return ORTE_TRUE; +} + +void +onMgrAppDelete(const struct ORTEAppInfo *appInfo, void *param) { + printf("%s 0x%x-0x%x was deleted\n", + (appInfo->appId & 0x3)==MANAGER ? "manager" : "application", + appInfo->hostId,appInfo->appId); +} + +#ifdef _UNIX +pthread_mutex_t mutex; +void sig_usr(int signo) { + if ((signo==SIGTERM) || (signo==SIGINT)) { + pthread_mutex_unlock(&mutex); + } +} +void waitForEndingCommand(void) { + pthread_mutex_init(&mutex, NULL); + pthread_mutex_lock(&mutex); + signal(SIGTERM,sig_usr); + signal(SIGINT,sig_usr); + pthread_mutex_lock(&mutex); +} +static int daemon_init(void) { + pid_t pid; + + if ((pid = fork()) < 0) { + return -1; + } else + if (pid != 0) { + exit(0); /* parent vanishes */ + } + /* child process */ + setsid(); + umask(0); + close(0); + close(1); + close(2); + return 0; +} +#endif + +static void usage(void) { + printf("usage: ORTEManager \n"); + printf(" -p, --peer possible locations of fellow managers\n"); + printf(" -k, --key manager's additional key\n"); + printf(" -d, --domain working manager domain\n"); + printf(" -v, --verbosity set verbosity level SECTION, up to LEVEL:...\n"); + printf(" examples: ORTEManager -v 51,7:32,5 sections 51 and 32\n"); + printf(" ORTEManager -v ALL,7 all sections up to level 7\n"); + printf(" -R, --refresh refresh period in second(s)\n"); + printf(" -P, --purge purge time in second(s)\n"); +#ifdef _UNIX + printf(" -D, --daemon start program like daemon\n"); +#endif + printf(" -E, --expiration expiration time of manager in second(s)\n"); + printf(" -e, --events register event system\n"); + printf(" -l, --logfile set log file name\n"); + printf(" -V, --version show version\n"); + printf(" -h, --help this usage screen\n"); +} + +int main(int argc,char *argv[]) { + static struct option long_opts[] = { + { "peer",1,0, 'p' }, + { "key",1,0, 'k' }, + { "domain",1,0, 'd' }, + { "verbosity",1,0, 'v' }, + { "refresh",1,0, 'R' }, + { "purge",1,0, 'P' }, +#ifdef _UNIX + { "daemon",1,0, 'D' }, +#endif + { "expiration",1,0, 'E' }, + { "events",0,0, 'e' }, + { "logfile",1,0, 'l' }, + { "version",0,0, 'V' }, + { "help", 0, 0, 'h' }, + { 0, 0, 0, 0} + }; + ORTEDomain *d; + ORTEDomainProp dp; + int32_t opt,domain=ORTE_DEFAULT_DOMAIN; + Boolean daemon=ORTE_FALSE,start_sending_thread=ORTE_FALSE; + ORTEDomainAppEvents *events=NULL; + + #ifdef _UNIX + start_sending_thread=ORTE_TRUE; + #endif + + ORTEInit(); + ORTEDomainPropDefaultGet(&dp); + + while ((opt = getopt_long(argc, argv, "k:p:d:v:R:E:P:l:VhDe",&long_opts[0], NULL)) != EOF) { + switch (opt) { + case 'p': + dp.mgrs=strdup(optarg); + break; + case 'k': + dp.mgrAddKey=StringToIPAddress(strdup(optarg)); + break; + case 'd': + domain=strtol(optarg,NULL,0); + break; + case 'v': + ORTEVerbositySetOptions(optarg); + break; + case 'R': + NtpTimeAssembFromMs(dp.baseProp.refreshPeriod,strtol(optarg,NULL,0),0); + break; + case 'P': + NtpTimeAssembFromMs(dp.baseProp.purgeTime,strtol(optarg,NULL,0),0); + break; + case 'E': + NtpTimeAssembFromMs(dp.baseProp.expirationTime,strtol(optarg,NULL,0),0); + break; + case 'e': + events=(ORTEDomainAppEvents*)malloc(sizeof(ORTEDomainAppEvents)); + ORTEDomainInitEvents(events); + events->onMgrNew=onMgrAppRemoteNew; + events->onAppRemoteNew=onMgrAppRemoteNew; + events->onMgrDelete=onMgrAppDelete; + events->onAppDelete=onMgrAppDelete; + break; + case 'l': + ORTEVerbositySetLogFile(optarg); + case 'V': + printf("Ocera Real-Time Ethernet (%s).\n",dp.version); + exit(0); + break; + case 'D': + daemon=ORTE_TRUE; + break; + case 'h': + default: + usage(); + exit(opt == 'h' ? 0 : 1); + } + } + + d=ORTEDomainMgrCreate(domain,&dp,events,start_sending_thread); + if (!d) + exit(1); + + #ifdef _UNIX + if (daemon) + daemon_init(); + #endif + + if (!start_sending_thread) + ORTEAppSendThread(d); + + #ifdef _UNIX + waitForEndingCommand(); + ORTEDomainMgrDestroy(d); + if (events) + free(events); + #endif + + exit(0); +} diff --git a/orte/manager/make_with_ccmalloc b/orte/manager/make_with_ccmalloc new file mode 100755 index 0000000..149b2c4 --- /dev/null +++ b/orte/manager/make_with_ccmalloc @@ -0,0 +1,3 @@ +rm -f FILE.log +rm -f ORTEManager +gcc -O0 -g3 -o ORTEManager ORTEManager.o ../liborte/liborte.a -lpthread -lccmalloc -ldl \ No newline at end of file diff --git a/orte/manager/mcvs/Makefile.msc b/orte/manager/mcvs/Makefile.msc new file mode 100644 index 0000000..437d5d8 --- /dev/null +++ b/orte/manager/mcvs/Makefile.msc @@ -0,0 +1,46 @@ +# --------------------------------------------------------------------- +# Microsoft C/C++ Installation Directory +# +# CHANGE this definition to point to your compiler's installation directory +# --------------------------------------------------------------------- +MSCDIR= c:\Progra~1\micros~3\vc98 + +CFLAGS = -c -Zi -MD $(INCLUDE) +LIB_CFLAGS= $(CFLAGS) -LD +INCLUDE= -I$(MSCDIR)\include -I..\..\include -I..\..\include\win32 +LIBS= $(MSCDIR)\lib\msvcrt.lib $(MSCDIR)\lib\uuid.lib $(MSCDIR)\lib\oldnames.lib \ + $(MSCDIR)\lib\kernel32.lib $(MSCDIR)\lib\libcd.lib $(MSCDIR)\lib\wsock32.lib \ + $(MSCDIR)\lib\advapi32.lib $(MSCDIR)\lib\ws2_32.lib\ + ..\..\contrib\win_pthread\pthreadVC.lib \ + ..\..\liborte\msvc\liborte.lib +CC= $(MSCDIR)\bin\cl +LINK= $(MSCDIR)\bin\link +LIBRARIAN= $(MSCDIR)\bin\lib + +TARGETS=ORTEManager.exe + +all : default + +default : $(TARGETS) + +ORTEManager.exe: ..\ORTEManager.obj getopt.obj getopt_long.obj + +# --------------------------------------------------------------------- +# Generic Compilation Rules +# +# Do NOT change anything below this point. +# --------------------------------------------------------------------- +#.SUFFIXES: .c .obj .exe + +.c.obj: + $(CC) $(CFLAGS) $< -Fo$*.obj + +.obj.exe: + $(LINK) -out:$@ getopt.obj getopt_long.obj $(ORTELIB) $< $(LIBS) + +clean : + del *.obj + del *.exe + del *.pdb + + diff --git a/orte/manager/mcvs/getopt.c b/orte/manager/mcvs/getopt.c new file mode 100644 index 0000000..f2e9cb7 --- /dev/null +++ b/orte/manager/mcvs/getopt.c @@ -0,0 +1,114 @@ +#include +#include +#include +#include + +#define __P(x) x +#define _DIAGASSERT(x) assert(x) + +#ifdef __weak_alias +__weak_alias(getopt,_getopt); +#endif + + +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ + +static char * _progname __P((char *)); +int getopt_internal __P((int, char * const *, const char *)); + +static char * +_progname(nargv0) + char * nargv0; +{ + char * tmp; + + _DIAGASSERT(nargv0 != NULL); + + tmp = strrchr(nargv0, '/'); + if (tmp) + tmp++; + else + tmp = nargv0; + return(tmp); +} + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt(nargc, nargv, ostr) + int nargc; + char * const nargv[]; + const char *ostr; +{ + static char *__progname = 0; + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + __progname = __progname?__progname:_progname(*nargv); + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(ostr != NULL); + + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc || *(place = nargv[optind]) != '-') { + place = EMSG; + return (-1); + } + if (place[1] && *++place == '-' /* found "--" */ + && place[1] == '\0') { + ++optind; + place = EMSG; + return (-1); + } + } /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' || + !(oli = strchr(ostr, optopt))) { + /* + * if the user didn't specify '-' as an option, + * assume it means -1. + */ + if (optopt == (int)'-') + return (-1); + if (!*place) + ++optind; + if (opterr && *ostr != ':') + (void)fprintf(stderr, + "%s: illegal option -- %c\n", __progname, optopt); + return (BADCH); + } + if (*++oli != ':') { /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } + else { /* need an argument */ + if (*place) /* no white space */ + optarg = place; + else if (nargc <= ++optind) { /* no arg */ + place = EMSG; + if (*ostr == ':') + return (BADARG); + if (opterr) + (void)fprintf(stderr, + "%s: option requires an argument -- %c\n", + __progname, optopt); + return (BADCH); + } + else /* white space */ + optarg = nargv[optind]; + place = EMSG; + ++optind; + } + return (optopt); /* dump back option letter */ +} + diff --git a/orte/manager/mcvs/getopt_long.c b/orte/manager/mcvs/getopt_long.c new file mode 100644 index 0000000..b956823 --- /dev/null +++ b/orte/manager/mcvs/getopt_long.c @@ -0,0 +1,205 @@ +#include +#include +#include +#include +#include +#include "getopt.h" + +extern int opterr; /* if error message should be printed */ +extern int optind; /* index into parent argv vector */ +extern int optopt; /* character checked for validity */ +extern int optreset; /* reset getopt */ +extern char *optarg; /* argument associated with option */ + +#define __P(x) x +#define _DIAGASSERT(x) assert(x) + +static char * __progname __P((char *)); +int getopt_internal __P((int, char * const *, const char *)); + +static char * +__progname(nargv0) + char * nargv0; +{ + char * tmp; + + _DIAGASSERT(nargv0 != NULL); + + tmp = strrchr(nargv0, '/'); + if (tmp) + tmp++; + else + tmp = nargv0; + return(tmp); +} + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt_internal(nargc, nargv, ostr) + int nargc; + char * const *nargv; + const char *ostr; +{ + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(ostr != NULL); + + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc || *(place = nargv[optind]) != '-') { + place = EMSG; + return (-1); + } + if (place[1] && *++place == '-') { /* found "--" */ + /* ++optind; */ + place = EMSG; + return (-2); + } + } /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' || + !(oli = strchr(ostr, optopt))) { + /* + * if the user didn't specify '-' as an option, + * assume it means -1. + */ + if (optopt == (int)'-') + return (-1); + if (!*place) + ++optind; + if (opterr && *ostr != ':') + (void)fprintf(stderr, + "%s: illegal option -- %c\n", __progname(nargv[0]), optopt); + return (BADCH); + } + if (*++oli != ':') { /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } else { /* need an argument */ + if (*place) /* no white space */ + optarg = place; + else if (nargc <= ++optind) { /* no arg */ + place = EMSG; + if ((opterr) && (*ostr != ':')) + (void)fprintf(stderr, + "%s: option requires an argument -- %c\n", + __progname(nargv[0]), optopt); + return (BADARG); + } else /* white space */ + optarg = nargv[optind]; + place = EMSG; + ++optind; + } + return (optopt); /* dump back option letter */ +} + +#if 0 +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt2(nargc, nargv, ostr) + int nargc; + char * const *nargv; + const char *ostr; +{ + int retval; + + if ((retval = getopt_internal(nargc, nargv, ostr)) == -2) { + retval = -1; + ++optind; + } + return(retval); +} +#endif + +/* + * getopt_long -- + * Parse argc/argv argument vector. + */ +int +getopt_long(nargc, nargv, options, long_options, index) + int nargc; + char ** nargv; + char * options; + struct option * long_options; + int * index; +{ + int retval; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + _DIAGASSERT(long_options != NULL); + /* index may be NULL */ + + if ((retval = getopt_internal(nargc, nargv, options)) == -2) { + char *current_argv = nargv[optind++] + 2, *has_equal; + int i, current_argv_len, match = -1; + + if (*current_argv == '\0') { + return(-1); + } + if ((has_equal = strchr(current_argv, '=')) != NULL) { + current_argv_len = has_equal - current_argv; + has_equal++; + } else + current_argv_len = strlen(current_argv); + + for (i = 0; long_options[i].name; i++) { + if (strncmp(current_argv, long_options[i].name, current_argv_len)) + continue; + + if (strlen(long_options[i].name) == (unsigned)current_argv_len) { + match = i; + break; + } + if (match == -1) + match = i; + } + if (match != -1) { + if (long_options[match].has_arg == required_argument || + long_options[match].has_arg == optional_argument) { + if (has_equal) + optarg = has_equal; + else + optarg = nargv[optind++]; + } + if ((long_options[match].has_arg == required_argument) + && (optarg == NULL)) { + /* + * Missing argument, leading : + * indicates no error should be generated + */ + if ((opterr) && (*options != ':')) + (void)fprintf(stderr, + "%s: option requires an argument -- %s\n", + __progname(nargv[0]), current_argv); + return (BADARG); + } + } else { /* No matching argument */ + if ((opterr) && (*options != ':')) + (void)fprintf(stderr, + "%s: illegal option -- %s\n", __progname(nargv[0]), current_argv); + return (BADCH); + } + if (long_options[match].flag) { + *long_options[match].flag = long_options[match].val; + retval = 0; + } else + retval = long_options[match].val; + if (index) + *index = match; + } + return(retval); +} + diff --git a/orte/manager/mcvs/m.bat b/orte/manager/mcvs/m.bat new file mode 100755 index 0000000..08eb76f --- /dev/null +++ b/orte/manager/mcvs/m.bat @@ -0,0 +1,5 @@ +del ORTEManager.exe +make /f Makefile.msc +pause +rem ORTEManager -P 127.0.0.1 -v ALL:10 -r 15 +ORTEManager -v ALL:10 \ No newline at end of file diff --git a/orte/manager/rc/ORTEManagerd b/orte/manager/rc/ORTEManagerd new file mode 100755 index 0000000..f0f993e --- /dev/null +++ b/orte/manager/rc/ORTEManagerd @@ -0,0 +1,42 @@ +#!/bin/sh + +# description: Start/Stop Manager application for RTPS communication +# + +# This init script contains functions specific for redhat +# and mandrake init scripts. + +# Source function library. +. /etc/rc.d/init.d/functions + + +# See how we were called. +case "$1" in + start) + echo -n "Starting ORTEManager: " + + daemon ORTEManager -D + RETVAL=$? + ;; + stop) + echo -n "Stopping ORTEManager: " + killproc ORTEManager + RETVAL=$? + echo + ;; + status) + status ORTEManager + RETVAL=$? + ;; + restart|reload) + $0 stop + $0 start + RETVAL=$? + ;; + *) + echo "Usage: ORTEManager {start|stop|status|restart|reload}" + exit 1 +esac + +exit $RETVAL + diff --git a/orte/templates/templates.c b/orte/templates/templates.c new file mode 100644 index 0000000..47279b7 --- /dev/null +++ b/orte/templates/templates.c @@ -0,0 +1,20 @@ +/* + * $Id: filename.c,v 0.0.0.1 2003/MM/DD + * + * DEBUG: section 16 Description + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ \ No newline at end of file diff --git a/orte/templates/templates.h b/orte/templates/templates.h new file mode 100644 index 0000000..d5d6154 --- /dev/null +++ b/orte/templates/templates.h @@ -0,0 +1,33 @@ +/* + * $Id: filename.h,v 0.0.0.1 2003/MM/DD + * + * AUTHOR: Petr Smolik petr.smolik@wo.cz + * + * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/ + * -------------------------------------------------------------------- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _X_H +#define _X_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} /* extern "C"*/ +#endif + + +#endif /* _X_H */ diff --git a/readme b/readme new file mode 100644 index 0000000..8360fe1 --- /dev/null +++ b/readme @@ -0,0 +1,56 @@ + ORTE - OCERA Real-Time Ethernet + +The ORTE is open source implementation of RTPS communication protocol +defined by Real Time Innovations (http://www.rti.com). +RTPS is new application layer protocol targeted to real-time communication +area, which is build on top of standard UDP stack. + +Supported targets: +Linux +Windows - MinGW, MSVC +RTLinux - need to fix UDP (Miquele or Ismael Ripoll), call function bind +with port 0, doesn't give any free port. + +To build: +simply untar instalation package into desired directory, enter this +directory and issue following commands. + +./configure +make +make install + +after this procedure ORTEManager and ORTEPing are placed in /usr/local/bin. + +To start: +run :ORTEManager & +see :ORTEManager -h for usaged +note:ORTEManager have to run during all communication. For future work can +be added into /etc/init.d/... script for starting ORTEManager during boot +of machine. This script (redhat and mandrake) is placed in +"orte/manager/rc/ORTEManagerd" +For developping a RT application, ORTEManager can be running in userspace. +Start it with parameter "-k 192.168.4.2". This address is IP address of +RT application. + +To test communication: +in a shell try to type "ORTEPing -p -s". So, now will be created one publisher +and one subscriber with same topic and type. If you see messages like + +[root@localhost ORTEPing]# ./ORTEPing -p -s +sent issue 1 +received fresh issue 1 +sent issue 2 +received fresh issue 2 +sent issue 3 +received fresh issue 3 + +communication works. If you see only sending messsages, it's sign that ORTEManager +is not probably running. +See "ORTEPing -h" for usaged. + +Now, you can develop self applications (see documentation). + +Feedback is welcome - send bug reports, enhancements, checks, money +orders, etc. to the address below. + +Petr Smolik petr.smolik@wo.cz diff --git a/todo b/todo new file mode 100644 index 0000000..b3e26c0 --- /dev/null +++ b/todo @@ -0,0 +1,29 @@ +If you are a developper and wants to help, enjoy ! + +################################################################ + Release: ORTE0-2-0 Date: 1/8/2004 + +1) clean code !!! :))) + +2) autoconf for RTLinux + +3) portation into RTAI, RTnet + +4) add support CDR types + +... + +################################################################ + Release: ORTE0-1 Date: 4/16/2003 + +1) clean code !!! :))) + +2) change faster algorithm for storing data (GAVL - generic AVL) + +3) split application thread on two threads: + + metatraffic: + + userdata: + +4) alarms for events in application -- 2.39.2