From 438eb87a8456152e9650894af58da197c7c993df Mon Sep 17 00:00:00 2001 From: smolik Date: Tue, 7 Oct 2008 21:19:01 +0000 Subject: [PATCH 1/1] orte 0.3.2 release --- Makefile.rules | 955 +++++++++---- authors | 5 +- configure.in | 6 +- .../shape/{FPublisher.ui.h => FPublisher.cpp} | 45 +- orte/contrib/shape/FPublisher.h | 46 + orte/contrib/shape/FPublisher.ui | 289 ++-- .../{FSubscriber.ui.h => FSubscriber.cpp} | 42 +- orte/contrib/shape/FSubscriber.h | 49 + orte/contrib/shape/FSubscriber.ui | 392 ++---- orte/contrib/shape/MainForm.cpp | 77 + orte/contrib/shape/MainForm.h | 23 + orte/contrib/shape/MainForm.ui | 1235 +++++++++-------- orte/contrib/shape/MainForm.ui.h | 87 -- orte/contrib/shape/Makefile | 5 +- orte/contrib/shape/MyQFrame.cpp | 10 +- orte/contrib/shape/MyQFrame.h | 2 +- orte/contrib/shape/main.cpp | 22 +- orte/contrib/shape/ortedemo.pro | 32 +- orte/contrib/shape/richtext.cpp | 54 +- orte/contrib/shape/richtext.h | 25 +- orte/contrib/shape/shapes.qrc | 10 + orte/examples/spy/ortespy.c | 2 +- orte/idl-compiler/orte-idl-c-headers.c | 4 +- orte/idl-compiler/orte-idl-driver.c | 2 +- orte/include/orte/orte_config_omk_linux.h | 6 +- orte/include/orte/orte_config_omk_rtl_onetd.h | 6 +- orte/include/orte/orte_config_omk_rtl_wip.h | 6 +- orte/include/orte/orte_config_omk_win32.h | 6 +- orte/include/orte_headers.h | 6 +- orte/libjorte/JGetORTEConstant.c | 4 +- orte/libjorte/JORTEPublicationPropertiesSet.c | 4 +- .../libjorte/JORTESubscriptionPropertiesSet.c | 4 +- orte/liborte/ORTEAppRecvThread.c | 4 +- orte/liborte/ORTEDomain.c | 22 +- orte/liborte/ORTEDomainApp.c | 8 +- orte/liborte/ORTEPattern.c | 2 +- orte/liborte/ORTEPublication.c | 4 +- orte/liborte/ORTEPublicationTimer.c | 4 +- orte/liborte/ORTESubscription.c | 10 +- orte/liborte/RTPSAck.c | 10 +- orte/liborte/RTPSCSTReaderProc.c | 4 +- orte/liborte/RTPSCSTReaderTimer.c | 4 +- orte/liborte/RTPSGap.c | 16 +- orte/liborte/RTPSHeader.c | 20 +- orte/liborte/RTPSHeardBeat.c | 14 +- orte/liborte/RTPSInfoDST.c | 6 +- orte/liborte/RTPSInfoREPLY.c | 10 +- orte/liborte/RTPSInfoSRC.c | 14 +- orte/liborte/RTPSInfoTS.c | 4 +- orte/liborte/RTPSIssue.c | 10 +- orte/liborte/RTPSUtils.c | 2 +- orte/liborte/RTPSVar.c | 36 +- orte/liborte/cdr.c | 8 +- orte/liborte/conv.c | 6 +- orte/liborte/objectUtils.c | 16 +- orte/liborte/parameter.c | 46 +- orte/liborte/sock.c | 6 +- readme | 12 + todo | 7 +- 59 files changed, 2070 insertions(+), 1696 deletions(-) rename orte/contrib/shape/{FPublisher.ui.h => FPublisher.cpp} (69%) create mode 100644 orte/contrib/shape/FPublisher.h rename orte/contrib/shape/{FSubscriber.ui.h => FSubscriber.cpp} (83%) create mode 100644 orte/contrib/shape/FSubscriber.h create mode 100644 orte/contrib/shape/MainForm.cpp create mode 100644 orte/contrib/shape/MainForm.h delete mode 100644 orte/contrib/shape/MainForm.ui.h create mode 100644 orte/contrib/shape/shapes.qrc diff --git a/Makefile.rules b/Makefile.rules index e9f8de0..2b864d2 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -1,14 +1,23 @@ -# Makefile.rules - OCERA make framework common project rules -*- makefile -*- -# +# Version for Linux/RTLinux builds. #OMK@linux +# +# Makefile.rules - OCERA make framework common project rules -*- makefile -*- #OMK@base +# # (C) Copyright 2003 by Pavel Pisa - OCERA team member +# (C) Copyright 2006 by Michal Sojka - Czech Technical University, FEE, DCE # -# The uLan driver is distributed under the Gnu General Public License. -# See file COPYING for details. +# Homepage: http://rtime.felk.cvut.cz/omk/ # +# The OMK build system is distributed under the GNU General Public +# License. See file COPYING for details. # # input variables # V .. if set to 1, full command text is shown else short form is used +# W .. whole tree - if set to 1, make is always called from the top-level directory # SUBDIRS .. list of subdirectories intended for make from actual directory +# default_CONFIG .. list of default config assignments CONFIG_XXX=y/n ... +# LN_HEADERS .. if "y", header files are symbolicaly linked instead of copied. #OMK@include +# #OMK@linux +# input variables # 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 @@ -20,23 +29,352 @@ # rtlinux_HEADERS .. list of the RT-Linux kernel-space public header files # bin_PROGRAMS .. list of the require binary programs # utils_PROGRAMS .. list of the development utility programs +# test_PROGRAMS .. list of the testing 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 +# xxx_LIBS .. list of specific target libraries # INCLUDES .. additional include directories and defines for user-space # kernel_INCLUDES .. additional include directories and defines for kernel-space # rtlinux_INCLUDES .. additional include directories and defines for RT-Linux -# default_CONFIG .. list of default config assignments CONFIG_XXX=y/n ... +# OMIT_KERNEL_PASSES if defined, all kernel passes are omited # # LINUX_DIR .. location of Linux kernel sources # RTL_DIR .. location of RT-Linux sources +# CFLAGS .. C compiler flags +# CXXFLAGS .. C++ compiler flags +# CPPFLAGS .. C preprocessor flags +# LDFLAGS .. linker flags for programs linking +# LOCAL_CONFIG_H .. name of local config.h file generated from values #OMK@config_h +# of options defined in the current directory +# config_include_HEADERS .. names of global config files (possibly +# with subdirectories) +# xxx_DEFINES .. list of config directives to be included in +# config header file of the name /xxx.h +# DOXYGEN .. if non-empty, generated headers includes Doxygen's @file +# command, so it is possible to document config +# variables. +# QT_SUBDIRS .. subdirectories where to build QT applications using qmake #OMK@qt +# QTDIR .. where QT resides +OMK_RULES_TYPE=linux #OMK@__type + #OMK@base +# We need to ensure definition of sources directory first +ifndef SOURCES_DIR +# Only shell built-in pwd understands -L +SOURCES_DIR := $(shell ( pwd -L ) ) +endif + +# If we are not called by OMK leaf Makefile... +ifndef MAKERULES_DIR +MAKERULES_DIR := $(abspath $(dir $(filter %Makefile.rules,$(MAKEFILE_LIST)))) +endif + +# OUTPUT_DIR is the place where _compiled, _build and possible other +# files/directories are created. By default is the same as +# $(MAKERULES_DIR). +ifndef OUTPUT_DIR +OUTPUT_DIR := $(MAKERULES_DIR) +endif + +.PHONY: all default check-make-ver omkize + +ifdef W + ifeq ("$(origin W)", "command line") + OMK_WHOLE_TREE:=$(W) + endif +endif +ifndef OMK_WHOLE_TREE + OMK_WHOLE_TREE:=0 +endif + +ifneq ($(OMK_WHOLE_TREE),1) +all: check-make-ver default + @echo "Compilation finished" +else +# Run make in the top-level directory +all: + @$(MAKE) -C $(MAKERULES_DIR) OMK_SERIALIZE_INCLUDED=n SOURCES_DIR=$(MAKERULES_DIR) RELATIVE_DIR="" $(MAKECMDGOALS) W=0 +endif + +ifdef OMK_TESTSROOT +# Usage: $(call canttest,) +define canttest + ( echo "$(1)" > $(OUTPUT_DIR)/_canttest; echo "$(1)"; exit 1 ) +endef +else +define canttest + echo "$(1)" +endef +endif + +#========================= +# Include the config file + +# FIXME: I think CONFIG_FILE_OK variable is useless. We have three +# config files and it is not clearly defined to which file is this +# variable related. +ifneq ($(CONFIG_FILE_OK),y) +ifndef CONFIG_FILE +CONFIG_FILE := $(OUTPUT_DIR)/config.omk +endif +ifneq ($(wildcard $(CONFIG_FILE)-default),) +-include $(CONFIG_FILE)-default +else +ifneq ($(MAKECMDGOALS),default-config) +$(warning Please, run "make default-config" first) +endif +endif + +-include $(OUTPUT_DIR)/config.target + +ifneq ($(wildcard $(CONFIG_FILE)),) +-include $(CONFIG_FILE) +CONFIG_FILE_OK = y +endif +endif #$(CONFIG_FILE_OK) + + +CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(OUTPUT_DIR)/config.target) $(wildcard $(CONFIG_FILE)) + + +export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR +export CONFIG_FILE CONFIG_FILES OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT +# OMK_SERIALIZE_INCLUDED has to be exported to submakes because passes +# must to be serialized only in the toplevel make. + +ifndef RELATIVE_DIR +RELATIVE_DIR := $(SOURCES_DIR:$(OUTPUT_DIR)%=%) +endif +#$(warning === RELATIVE_DIR = "$(RELATIVE_DIR)" ===) +override RELATIVE_DIR := $(RELATIVE_DIR:/%=%) +override RELATIVE_DIR := $(RELATIVE_DIR:\\%=%) +#$(warning RELATIVE_DIR = "$(RELATIVE_DIR)") +override BACK2TOP_DIR := $(shell echo $(RELATIVE_DIR)/ | sed -e 's_//_/_g' -e 's_/\./_/_g' -e 's_^\./__g' -e 's_\([^/][^/]*\)_.._g' -e 's_/$$__') +#$(warning BACK2TOP_DIR = "$(BACK2TOP_DIR)") + +#$(warning SOURCES_DIR = "$(SOURCES_DIR)") +#$(warning MAKERULES_DIR = "$(OUTPUT_DIR)") +#$(warning RELATIVE_DIR = "$(RELATIVE_DIR)") + +# We have to use RELATIVE_PREFIX because of mingw +override RELATIVE_PREFIX := $(RELATIVE_DIR)/ +override RELATIVE_PREFIX := $(RELATIVE_PREFIX:/%=%) + +#vpath %.c $(SOURCES_DIR) +#vpath %.cc $(SOURCES_DIR) +#vpath %.cxx $(SOURCES_DIR) + +# Define srcdir for Automake compatibility +srcdir = $(SOURCES_DIR) + +# Defines for quiet compilation +ifdef V + ifeq ("$(origin V)", "command line") + OMK_VERBOSE = $(V) + endif +endif +ifndef OMK_VERBOSE + OMK_VERBOSE = 0 +endif +ifneq ($(OMK_VERBOSE),0) + Q = +else + Q = @ +endif +ifneq ($(findstring s,$(MAKEFLAGS)),) + QUIET_CMD_ECHO = true + OMK_SILENT = 1 +else + QUIET_CMD_ECHO = echo +endif + +MAKEFILE_OMK=Makefile.omk +# All subdirectories (even linked ones) containing Makefile.omk +# Usage in Makefile.omk: SUBDIRS = $(ALL_OMK_SUBDIRS) +ALL_OMK_SUBDIRS = $(patsubst %/$(MAKEFILE_OMK),%,$(patsubst $(SOURCES_DIR)/%,%,$(wildcard $(SOURCES_DIR)/*/$(MAKEFILE_OMK)))) + +# =================================================================== +# We have set up all important variables, so we can check and include +# real OCERA style Makefile.omk now +ifndef OMK_INCLUDED +include $(SOURCES_DIR)/$(MAKEFILE_OMK) +ifeq ($(AUTOMATIC_SUBDIRS),y) +SUBDIRS?=$(ALL_OMK_SUBDIRS) +endif +OMK_INCLUDED := 1 +endif + +check-make-ver: + @GOOD_MAKE_VERSION=`echo $(MAKE_VERSION) | sed -n -e 's/^[4-9]\..*\|^3\.9[0-9].*\|^3\.8[1-9].*/y/p'` ; \ + if [ x$$GOOD_MAKE_VERSION != xy ] ; then \ + echo "Your make program version is too old and does not support OMK system." ; \ + echo "Please update to make program 3.81beta1 or newer." ; exit 1 ; \ + fi + +distclean dist-clean: + @$(QUIET_CMD_ECHO) " RM $(COMPILED_DIR_NAME) $(BUILD_DIR_NAME)" + @rm -fr $(OUTPUT_DIR)/$(COMPILED_DIR_NAME) $(OUTPUT_DIR)/$(BUILD_DIR_NAME) + +# Common OMK templates +# ==================== + +# Syntax: $(call mkdir,) +define mkdir_def + [ -d $(1) ] || mkdir -p $(1) || exit 1 +endef + +ifneq ($(OMK_VERBOSE),2) +NO_PRINT_DIRECTORY := --no-print-directory +endif + +ifeq ($(USE_LEAF_MAKEFILES),n) +export USE_LEAF_MAKEFILES +SUBDIR_MAKEFILE=$(MAKERULES_DIR)/Makefile.rules +SOURCESDIR_MAKEFILE=$(MAKERULES_DIR)/Makefile.rules +else +SUBDIR_MAKEFILE=$(SOURCES_DIR)/$(3)/Makefile +SOURCESDIR_MAKEFILE=$(SOURCES_DIR)/Makefile +endif + +pass = $(strip $(1)) + +# Call a pass in a subdirectory +# Usage: $(call omk_pass_subdir_template,,,) +define omk_pass_subdir_template +.PHONY: $(pass)-$(3)-subdir +$(pass)-submakes: $(pass)-$(3)-subdir +$(pass)-$(3)-subdir: + @$(call mkdir_def,$(2)/$(3)) + +@$(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(3) $(NO_PRINT_DIRECTORY) \ + RELATIVE_DIR=$(RELATIVE_PREFIX)$(3) -C $(2)/$(3) \ + -f $(SUBDIR_MAKEFILE) $(pass)-submakes +# In subdirectories we can call submakes directly since passes are +# already searialized on the toplevel make. +endef + +ifdef OMK_TESTSROOT +check-target = $(1:%=%-check) +endif + +# Call a pass in a subdirectory +# Usage: $(call extra_rules_subdir_template,) +define extra_rules_subdir_template +extra-rules-subdirs: extra-rules-$(1) +extra-rules-$(1): + +@$(MAKE) OMK_SERIALIZE_INCLUDED=n MAKERULES_DIR=$(SOURCES_DIR)/$(1) OUTPUT_DIR=$(OUTPUT_DIR) \ + SOURCES_DIR=$(SOURCES_DIR)/$(1) RELATIVE_DIR=$(RELATIVE_PREFIX)$(1) -C $(SOURCES_DIR)/$(1) +endef + +.PHONY: extra-rules-subdirs +extra-rules-subdirs: + +$(foreach subdir,$(EXTRA_RULES_SUBDIRS),$(eval $(call extra_rules_subdir_template,$(subdir)))) + +# Usage: $(call omk_pass_template,,,[],[]) +define omk_pass_template +.PHONY: $(pass) $(pass)-local $(pass)-check $(pass)-submakes +$(foreach subdir,$(SUBDIRS),$(eval $(call omk_pass_subdir_template,$(pass),$(2),$(subdir)))) +$(pass): +# Submakes have to be called this way and not as dependecies for pass +# serialization to work + +@$(MAKE) SOURCES_DIR=$(SOURCES_DIR) $(NO_PRINT_DIRECTORY) \ + RELATIVE_DIR=$(RELATIVE_DIR) \ + -f $(SOURCESDIR_MAKEFILE) $(pass)-submakes +$(pass)-submakes: + @true # Do not emit "nothing to be done" messages + +ifneq ($(4)$($(pass)_HOOKS),) +$(pass)-submakes: $(pass)-this-dir +$(pass)-this-dir: $(foreach subdir,$(SUBDIRS),$(pass)-$(subdir)-subdir) + +@echo "make[omk]: $(pass) in $(RELATIVE_DIR)" + @$(call mkdir_def,$(2)) + +@$(MAKE) $(NO_PRINT_DIRECTORY) SOURCES_DIR=$(SOURCES_DIR) RELATIVE_DIR=$(RELATIVE_DIR) -C $(2) \ + -f $(SOURCESDIR_MAKEFILE) $(3) $(check-target) $(1:%=%-local) +$(pass)-local: $($(pass)_HOOKS) +endif +endef + +# ======================= +# DEFAULT CONFIG PASS + +default-config: + @echo "# Start of OMK config file" > "$(CONFIG_FILE)-default" + @echo "# This file should not be altered manually" >> "$(CONFIG_FILE)-default" + @echo "# Overrides should be stored in file $(notdir $(CONFIG_FILE))" >> "$(CONFIG_FILE)-default" + @echo >> "$(CONFIG_FILE)-default" + @$(MAKE) $(NO_PRINT_DIRECTORY) -C $(OUTPUT_DIR) \ + RELATIVE_DIR="" SOURCES_DIR=$(OUTPUT_DIR) \ + -f $(OUTPUT_DIR)/Makefile default-config-pass + +$(eval $(call omk_pass_template,default-config-pass,$$(LOCAL_BUILD_DIR),,always)) + +default-config-pass-local: +# @echo Default config for $(RELATIVE_DIR) + @echo "# Config for $(RELATIVE_DIR)" >> "$(CONFIG_FILE)-default" + @$(foreach x, $(default_CONFIG), echo '$(x)' | \ + sed -e 's/^[^=]*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; ) + + +omkize: + $(Q)if ! grep -q MAKERULES_DIR Makefile; then \ + echo "Makefile is not OMK leaf makefile!" >&2; exit 1; \ + fi + $(Q)for i in `find -L . -name Makefile.omk` ; do \ + d=`dirname $${i}`; \ + if ! test -f "$${d}/Makefile.rules" && ( ! test -f "$${d}/Makefile" || ! cmp --silent Makefile "$${d}/Makefile" ); then \ + rm -f "$${d}/Makefile"; \ + cp -v Makefile "$${d}/Makefile"; \ + fi \ + done +ifeq ($(OMK_VERBOSE),1) #OMK@include +CPHEADER_FLAGS += -v +LNHEADER_FLAGS += -v +endif + +ifneq ($(LN_HEADERS),y) +define cp_cmd +( echo " CP $(1:$(OUTPUT_DIR)/%=%) -> $(2:$(OUTPUT_DIR)/%=%)"; cp $(CPHEADER_FLAGS) $(1) $(2) ) +endef +else +define cp_cmd +( echo " LN $(1:$(OUTPUT_DIR)/%=%) -> $(2:$(OUTPUT_DIR)/%=%)"; [ -f $(1) ] && ln -sf $(LNHEADER_FLAGS) $(1) $(2) ) +endef +endif + +# TODO: Check modification date of changed header files. If it is +# newer that in source dir, show a warning. + +# Syntax: $(call include-pass-template,,) +define include-pass-template +include-pass-local: include-pass-local-$(2) +include-pass-local-$(2): $$($(2)_GEN_HEADERS) $$(foreach f,$$(renamed_$(2)_GEN_HEADERS),$$(shell echo '$$(f)' | sed -e 's/^\(.*\)->.*$$$$/\1/')) + @$$(foreach f, $$($(2)_HEADERS), cmp --quiet $$(SOURCES_DIR)/$$(f) $(1)/$$(notdir $$(f)) \ + || $$(call cp_cmd,$$(SOURCES_DIR)/$$(f),$(1)/$$(notdir $$(f))) || exit 1 ; ) + @$$(foreach f, $$($(2)_GEN_HEADERS), cmp --quiet $$(f) $(1)/$$(notdir $$(f)) \ + || $$(call cp_cmd,$$(LOCAL_BUILD_DIR)/$$(f),$(1)/$$(notdir $$(f))) || exit 1 ; ) # FIXME: Use correct build dir, then document it + @$$(foreach f, $$(nobase_$(2)_HEADERS), cmp --quiet $$(SOURCES_DIR)/$$(f) $(1)/$$(f) \ + || ( mkdir -p $(1)/$$(dir $$(f)) && $$(call cp_cmd,$$(SOURCES_DIR)/$$(f),$(1)/$$(f)) ) || exit 1 ; ) + @$$(foreach f, $$(renamed_$(2)_HEADERS), \ + srcfname=`echo '$$(f)' | sed -e 's/^\(.*\)->.*$$$$/\1/'` ; destfname=`echo '$$(f)' | sed -e 's/^.*->\(.*\)$$$$/\1/'` ; \ + cmp --quiet $$(SOURCES_DIR)/$$$${srcfname} $(1)/$$$${destfname} \ + || ( mkdir -p `dirname $(1)/$$$${destfname}` && $$(call cp_cmd,$$(SOURCES_DIR)/$$$${srcfname},$(1)/$$$${destfname}) ) || exit 1 ; ) + @$$(foreach f, $$(renamed_$(2)_GEN_HEADERS), \ + srcfname=`echo '$$(f)' | sed -e 's/^\(.*\)->.*$$$$/\1/'` ; destfname=`echo '$$(f)' | sed -e 's/^.*->\(.*\)$$$$/\1/'` ; \ + cmp --quiet $$$${srcfname} $(1)/$$$${destfname} \ + || ( mkdir -p `dirname $(1)/$$$${destfname}` && $$(call cp_cmd,$$(LOCAL_BUILD_DIR)/$$$${srcfname},$(1)/$$$${destfname}) ) || exit 1 ; ) +endef +# Local Variables: +# mode:makefile +# End: + #OMK@linux # Hack to check RT-Linux rules #LINUX_DIR := /home/cvs/ocera/ocera-build/kernel/linux #RTL_DIR := /home/cvs/ocera/ocera-build/kernel/rtlinux #CONFIG_RTLINUX = y -#OCERA_DIR := $(shell ( cd -L $(MAKERULES_DIR)/../../.. ; pwd -L ) ) --include $(MAKERULES_DIR)/OCERA_TOP_DIR +#OCERA_DIR := $(shell ( cd -L $(OUTPUT_DIR)/../../.. ; pwd -L ) ) + +-include $(OUTPUT_DIR)/OCERA_TOP_DIR BUILD_DIR_NAME = _build COMPILED_DIR_NAME = _compiled @@ -44,13 +382,6 @@ ifndef GROUP_DIR_NAME GROUP_DIR_NAME = nogroup endif -# We need to ensure definition of sources directory first -ifndef SOURCES_DIR -SOURCES_DIR := $(shell ( pwd -L ) ) -endif - -all: default - ifdef OCERA_DIR ifeq ($(wildcard $(OCERA_DIR)/ocera.mk),) $(warning "ocera.mk" file does not exist. Adapt Makefile.rules for standalone compilation) @@ -66,38 +397,28 @@ KERN_MODPOST_DIR := $(BUILD_DIR)/kern-modpost USER_INCLUDE_DIR := $(OCERA_USER_INCLUDES_DIR) USER_LIB_DIR := $(OCERA_USER_LIBRARIES_DIR) USER_UTILS_DIR := $(TARGET_DIR)/usr/bin +USER_TESTS_DIR := $(TARGET_DIR)/usr/bin USER_BIN_DIR := $(TARGET_DIR)/usr/bin USER_BUILD_DIR := $(BUILD_DIR)/user/$(GROUP_DIR_NAME) #LINUX_DIR := $(OCERA_DIR)/kernel/linux #RTL_DIR := $(OCERA_DIR)/kernel/rtlinux #CONFIG_FILE := $(OCERA_DIR)/emdebsys/.config ifneq ($(wildcard $(CONFIG_FILE)),) -#include $(CONFIG_FILE) CONFIG_FILE_OK = y endif else # OCERA_DIR -KERN_INCLUDE_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/include-kern -KERN_LIB_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/lib-kern -KERN_MODULES_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/modules -KERN_BUILD_DIR := $(MAKERULES_DIR)/$(BUILD_DIR_NAME)/kern -KERN_MODPOST_DIR := $(MAKERULES_DIR)/$(BUILD_DIR_NAME)/kern-modpost -USER_INCLUDE_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/include -USER_LIB_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/lib -USER_UTILS_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/bin-utils -USER_BIN_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/bin -USER_BUILD_DIR := $(MAKERULES_DIR)/$(BUILD_DIR_NAME)/user -ifndef CONFIG_FILE -CONFIG_FILE := $(MAKERULES_DIR)/config.omk -endif -ifneq ($(wildcard $(CONFIG_FILE)-default),) --include $(CONFIG_FILE)-default -else -$(warning Please, run "make default-config" first) -endif -ifneq ($(wildcard $(CONFIG_FILE)),) -include $(CONFIG_FILE) -CONFIG_FILE_OK = y -endif +KERN_INCLUDE_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/include-kern +KERN_LIB_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/lib-kern +KERN_MODULES_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/modules +KERN_BUILD_DIR := $(OUTPUT_DIR)/$(BUILD_DIR_NAME)/kern +KERN_MODPOST_DIR := $(OUTPUT_DIR)/$(BUILD_DIR_NAME)/kern-modpost +USER_INCLUDE_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/include +USER_LIB_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/lib +USER_UTILS_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/bin-utils +USER_TESTS_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/bin-tests +USER_BIN_DIR := $(OUTPUT_DIR)/$(COMPILED_DIR_NAME)/bin +USER_BUILD_DIR := $(OUTPUT_DIR)/$(BUILD_DIR_NAME)/user + ifndef LINUX_VERSION LINUX_VERSION=$(shell uname -r) endif @@ -106,33 +427,28 @@ LINUX_DIR=/lib/modules/$(LINUX_VERSION)/build endif endif # OCERA_DIR -# Check and include real OCERA style Makefile.omk now -ifndef OMK_INCLUDED -include $(SOURCES_DIR)/Makefile.omk -OMK_INCLUDED := 1 -endif - -ifeq ($(TARGET_OS),) +ifeq ($(BUILD_OS),) # Check for target ifeq ($(OS),Windows_NT) - TARGET_OS = win32 + BUILD_OS := win32 else - TARGET_OS = $(shell uname | tr '[A-Z]' '[a-z]' ) - #$(warning TARGET_OS=$(TARGET_OS)) + BUILD_OS := $(shell uname | tr '[A-Z]' '[a-z]' ) + #$(warning BUILD_OS=$(BUILD_OS)) endif endif -export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR LINUX_DIR LINUX_VERSION RTL_DIR -export CONFIG_FILE OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT +ifeq ($(TARGET_OS),) + TARGET_OS := $(BUILD_OS) +endif + export TARGET_OS -#CFLAGS += -ggdb -CFLAGS += -O2 -CFLAGS += -Wall -#CXXFLAGS += -ggdb -CXXFLAGS += -O2 -CXXFLAGS += -Wall +LOCAL_BUILD_DIR = $(USER_OBJS_DIR) +# Assign default values to CFLAGS variable. If the variable is defined +# earlier (i.g. in config.omk), it is not overriden here. +CFLAGS ?= -O2 -Wall +CXXFLAGS ?= -O2 -Wall CPPFLAGS += -I $(USER_INCLUDE_DIR) @@ -150,118 +466,48 @@ else SOLIB_PICFLAGS += -fpic endif -ifndef RELATIVE_DIR -RELATIVE_DIR := $(SOURCES_DIR:$(MAKERULES_DIR)%=%) +ifeq ($(TARGET_OS),win32) +OMIT_KERNEL_PASSES=1 endif -override RELATIVE_DIR := $(RELATIVE_DIR:/%=%) -override RELATIVE_DIR := $(RELATIVE_DIR:\\%=%) -#$(warning RELATIVE_DIR $(RELATIVE_DIR)) -override BACK2TOP_DIR := $(shell echo $(RELATIVE_DIR)/ | sed -e 's_//_/_g' -e 's_/\./_/_g' -e 's_^\./__g' -e 's_\([^/][^/]*\)_.._g' -e 's_/$$__') -#$(warning BACK2TOP_DIR $(BACK2TOP_DIR)) - -#$(warning SOURCES_DIR = $(SOURCES_DIR)) -#$(warning MAKERULES_DIR = $(MAKERULES_DIR)) -#$(warning RELATIVE_DIR = $(RELATIVE_DIR)) - -override RELATIVE_PREFIX := $(RELATIVE_DIR)/ -override RELATIVE_PREFIX := $(RELATIVE_PREFIX:/%=%) #vpath %.c $(SOURCES_DIR) #vpath %.cc $(SOURCES_DIR) #vpath %.cxx $(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 clean-custom cleandepend default-config -.PHONY: check-make-ver check-dir include-pass library-pass binary-pass utils-pass -.PHONY: kernel-lib-pass kernel-pass kernel-mod-pass kernel-modpost-pass default-config-pass -.PHONY: check-dir-local include-pass-local library-pass-local binary-pass-local -.PHONY: utils-pass-local kernel-lib-pass-local kernel-mod-pass-local kernel-modpost-pass-local -.PHONY: default-config-pass-local +.PHONY: dep subdirs clean clean-custom cleandepend check-dir # Some support to serialize some targets for parallel make ifneq ($(OMK_SERIALIZE_INCLUDED),y) include-pass: check-dir library-pass: include-pass -binary-pass utils-pass: library-pass +binary-pass: library-pass kernel-lib-pass: include-pass kernel-mod-pass: kernel-lib-pass kernel-modpost-pass: kernel-mod-pass kernel-pass: kernel-mod-pass kernel-modpost-pass -OMK_SERIALIZE_INCLUDED = y -endif - -# Defines for quiet compilation -ifdef V - ifeq ("$(origin V)", "command line") - OMK_VERBOSE = $(V) - endif +override OMK_SERIALIZE_INCLUDED = y +MAKEOVERRIDES := $(filter-out OMK_SERIALIZE_INCLUDED=n,$(MAKEOVERRIDES)) endif -ifndef OMK_VERBOSE - OMK_VERBOSE = 0 -endif -ifeq ($(OMK_VERBOSE),1) - Q = -else - Q = @ -endif -ifneq ($(findstring s,$(MAKEFLAGS)),) - QUIET_CMD_ECHO = true - OMK_SILENT = 1 -else - QUIET_CMD_ECHO = echo - CPHEADER_FLAGS += -v -endif - -default: check-make-ver 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 - -ifdef LOCAL_CONFIG_H - -$(LOCAL_CONFIG_H) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default) - @echo LOCAL_CONFIG_H=`pwd`/$(LOCAL_CONFIG_H) - @echo "/* Automatically generated from */" > "$(LOCAL_CONFIG_H).tmp" - @echo "/* config file : $< */" >> "$(LOCAL_CONFIG_H).tmp" - @echo "#ifndef _LOCAL_CONFIG_H" >> "$(LOCAL_CONFIG_H).tmp" - @echo "#define _LOCAL_CONFIG_H" >> "$(LOCAL_CONFIG_H).tmp" - @( $(foreach x, $(shell echo $(default_CONFIG) | sed -e 's/\<\([^ ]*\)=[^ ]\>/\1/g' ), \ - echo $(x).$($(x)) ; ) echo ; ) | \ - sed -n -e 's/^\(.*\)\.[ym]$$/#define \1 1/p' \ - >> "$(LOCAL_CONFIG_H).tmp" - @echo "#endif /*_LOCAL_CONFIG_H*/" >> "$(LOCAL_CONFIG_H).tmp" - @if cmp --quiet "$(LOCAL_CONFIG_H).tmp" "$(LOCAL_CONFIG_H)" ; then \ - echo rm "$(LOCAL_CONFIG_H).tmp" ; \ - else mv "$(LOCAL_CONFIG_H).tmp" "$(LOCAL_CONFIG_H)" ; \ - echo Updated configuration "$(LOCAL_CONFIG_H)" ; fi +# Checks for OMK tester +ifdef OMK_TESTSROOT +default-config-pass-check include-pass-check: +library-pass-check binary-pass-check: + @[ -x "$(shell which $(CC))" ] || $(call canttest,Cannot find compiler: $(CC)) endif -check-make-ver: - @GOOD_MAKE_VERSION=`echo $(MAKE_VERSION) | sed -n -e 's/^[4-9]\..*\|^3\.9[0-9].*\|^3\.8[1-9].*/y/p'` ; \ - if [ x$$GOOD_MAKE_VERSION != xy ] ; then \ - echo "Your make program version is too old and does not support OMK system." ; \ - echo "Please update to make program 3.81beta1 or newer." ; exit 1 ; \ - fi - #===================================================================== # User-space rules and templates to compile programs, libraries etc. ifdef USER_RULE_TEMPLATES -USER_SOURCES2OBJS = .o/.c .o/.cc .o/.cxx .o/.o +USER_SOURCES2OBJS = .o/.c .o/.cc .o/.cxx .o/.S .o/.o -USER_SOURCES2OBJSLO = .lo/.c .lo/.cc .lo/.cxx .lo/.lo +USER_SOURCES2OBJSLO = .lo/.c .lo/.cc .lo/.cxx .lo/.S .lo/.lo #%.lo: %.c # $(CC) -o $@ $(LCFLAGS) -c $< @@ -272,6 +518,9 @@ c_o_COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ cc_o_COMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -DOMK_FOR_USER +S_o_COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASFLAGS) -DOMK_FOR_USER + idl_COMPILE = $(IDL_COMPILER) # Check GCC version for user build @@ -288,7 +537,7 @@ endif # Syntax: $(call COMPILE_c_o_template,,,) define COMPILE_c_o_template -$(2): $(1) $(LOCAL_CONFIG_H) $$(GEN_HEADERS) +$(2): $(1) $$(GEN_HEADERS) @$(QUIET_CMD_ECHO) " CC $$@" $(Q) if $$(c_o_COMPILE) $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ then mv -f "$$@.d.tmp" "$$@.d" ; \ @@ -299,7 +548,7 @@ endef # Syntax: $(call COMPILE_cc_o_template,,,) define COMPILE_cc_o_template -$(2): $(1) $(LOCAL_CONFIG_H) $$(GEN_HEADERS) +$(2): $(1) $$(GEN_HEADERS) @$(QUIET_CMD_ECHO) " CXX $$@" $(Q) if $$(cc_o_COMPILE) $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ then mv -f "$$@.d.tmp" "$$@.d" ; \ @@ -310,12 +559,12 @@ endef # Syntax: $(call COMPILE_S_o_template,,,) define COMPILE_S_o_template -$(2): $(1) $(LOCAL_CONFIG_H) $$(GEN_HEADERS) - @$(QUIET_CMD_ECHO) " AS $$@" - $(Q) if $$(S_o_COMPILE) -D__ASSEMBLY__ $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ - then if [ -e "$$@.d.tmp" ] ; then mv -f "$$@.d.tmp" "$$@.d" ; fi ; \ - else rm -f "$$@.d.tmp" ; exit 1; \ - fi +$(2): $(1) $$(GEN_HEADERS) + @$(QUIET_CMD_ECHO) " AS $$@" + $(Q) if $$(S_o_COMPILE) -D__ASSEMBLY__ $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \ + then mv -f "$$@.d.tmp" "$$@.d" ; \ + else rm -f "$$@.d.tmp" ; exit 1; \ + fi endef @@ -329,7 +578,7 @@ $(2): $(1) $(Q)echo >$$@ '/* Automatically generated from $$< */' $(Q)echo >>$$@ '/* Conditionals to control compilation */' $(Q)set -o pipefail ; $(NM) $$< \ - | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' + | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \ | sort >>$$@ $(Q)echo >>$$@ '/* Defines from the values defined to symbols */' $(Q)set -o pipefail ; $(NM) $$< \ @@ -347,6 +596,7 @@ endef # Syntax: $(call PROGRAM_template,,,,) +# FIXME: ???????? asi je tu blbej komentar define PROGRAM_template USER_IDLS += $$($(1)_SERVER_IDL) $$($(1)_CLIENT_IDL) $$($(1)_IDL) @@ -366,12 +616,12 @@ $(1)_OBJS := $$(sort $$($(1)_OBJS:%/=%)) USER_OBJS += $$($(1)_OBJS) USER_SOURCES += $$($(1)_SOURCES) -$(2)/$(1): $$($(1)_OBJS) +$(2)/$(1)$(3): $$($(1)_OBJS) @$(QUIET_CMD_ECHO) " LINK $$@" - $(Q) $$(shell if [ -z "$$(filter %.cc,$$($(1)_SOURCES:%.cxx=%.cc))" ] ; then echo $$(CC) ; else echo $$(CXX) ; fi) \ - $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) $$(LOADLIBES) $$(LDFLAGS) -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 + $(Q) $$(if $$(filter %.cc,$$($(1)_SOURCES:%.cxx=%.cc)),$$(CXX),$$(CC)) \ + $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) $$(LOADLIBES) $$(LDFLAGS) -Wl,-Map,$(USER_OBJS_DIR)/$(1).exe.map -o $$@ + @echo "$(2)/$(1)$(3): \\" >$(USER_OBJS_DIR)/$(1).exe.d + @sed -n -e 's|^LOAD \(.*\)$$$$| \1 \&|p' $(USER_OBJS_DIR)/$(1).exe.map|tr '&' '\134' >>$(USER_OBJS_DIR)/$(1).exe.d @echo >>$(USER_OBJS_DIR)/$(1).exe.d endef @@ -424,7 +674,7 @@ SOLIB_SOURCES += $$($(1)_SOURCES) $(USER_LIB_DIR)/lib$(1).$(SOLIB_EXT): $$($(1)_OBJSLO) @$(QUIET_CMD_ECHO) " LINK $$@" - $(Q) $(LD) --shared --soname=lib$(1).$(SOLIB_EXT) -o $$@ $$^ + $(Q) $(CC) --shared -Xlinker -soname=lib$(1).$(SOLIB_EXT) -o $$@ $$^ $$(LOADLIBES) $$($(1)_LIBS:%=-l%) endef @@ -432,9 +682,7 @@ endef library-pass-local: $(addprefix $(USER_INCLUDE_DIR)/,$(cmetric_include_HEADERS)) \ $(lib_LIBRARIES:%=$(USER_LIB_DIR)/lib%.a) $(shared_LIBRARIES:%=$(USER_LIB_DIR)/lib%.$(SOLIB_EXT)) -binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%) - -utils-pass-local: $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%) +binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%$(EXE_SUFFIX)) $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%$(EXE_SUFFIX)) $(test_PROGRAMS:%=$(USER_TESTS_DIR)/%$(EXE_SUFFIX)) # Special rules for CMETRIC generated headers @@ -451,9 +699,11 @@ GEN_HEADERS+=$(filter %.h,$(USER_IDLS:%.idl=%.h)) # Generate rules for compilation of programs and libraries -$(foreach prog,$(utils_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_UTILS_DIR)))) +$(foreach prog,$(utils_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_UTILS_DIR),$(EXE_SUFFIX)))) -$(foreach prog,$(bin_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_BIN_DIR)))) +$(foreach prog,$(test_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_TESTS_DIR),$(EXE_SUFFIX)))) + +$(foreach prog,$(bin_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_BIN_DIR),$(EXE_SUFFIX)))) $(foreach lib,$(lib_LIBRARIES),$(eval $(call LIBRARY_template,$(lib)))) @@ -503,6 +753,7 @@ KERN_CC = echo KERN_CC not defined - compilation skipped endif c_o_kern_COMPILE = $(KERN_CC) $(kernel_INCLUDES) -idirafter $(kern_GCCLIB_DIR)/include $(LINUX_CPPFLAGS) $(LINUX_CFLAGS) $(LINUX_CFLAGS_MODULE) -DOMK_FOR_KERNEL -DEXPORT_SYMTAB -nostdinc cc_o_kern_COMPILE = $(KERN_CC) $(kernel_INCLUDES) -idirafter $(kern_GCCLIB_DIR)/include $(LINUX_CPPFLAGS) $(LINUX_CFLAGS) $(LINUX_CFLAGS_MODULE) -DOMK_FOR_KERNEL -DEXPORT_SYMTAB +S_o_kern_COMPILE = $(KERN_CC) $(kernel_INCLUDES) -idirafter $(kern_GCCLIB_DIR)/include $(LINUX_CPPFLAGS) $(LINUX_AFLAGS) $(LINUX_CFLAGS_MODULE) -DOMK_FOR_KERNEL -DEXPORT_SYMTAB KERN_EXE_SUFFIX := $(LINUX_MODULE_EXT) KERN_LDFLAGS = $(LINUX_LDFLAGS) ifdef LINUX_ARCH @@ -520,6 +771,10 @@ KERN_AR = $(LINUX_AR) else KERN_AR = $(AR) endif +ifeq ($(LINUX_QUOTE_MODNAME),y) +KERN_MQ=\" +KERN_KBUILD_MODNAME=-D"KBUILD_MODNAME=((THIS_MODULE)!=NULL?(THIS_MODULE)->name:NULL)" +endif endif # CONFIG_RTLINUX KERN_LOADLIBES += -L$(KERN_LIB_DIR) @@ -555,9 +810,10 @@ endif define COMPILE_c_o_kern_template -$(2): $(1) $(LOCAL_CONFIG_H) +$(2): $(1) @$(QUIET_CMD_ECHO) " CC [K] $$@" - $(Q) if $$(c_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) -DKBUILD_BASENAME=$(notdir $(basename $(1))) \ + $(Q) if $$(c_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) $(KERN_KBUILD_MODNAME) \ + -D"KBUILD_BASENAME=$(KERN_MQ)$(notdir $(basename $(1)))$(KERN_MQ)" \ -o $$@ -c $$< ; \ then mv -f "$$@.d.tmp" "$$@.d" ; \ else rm -f "$$@.d.tmp" ; exit 1; \ @@ -568,9 +824,24 @@ endef define COMPILE_cc_o_kern_template -$(2): $(1) $(LOCAL_CONFIG_H) +$(2): $(1) @$(QUIET_CMD_ECHO) " CXX [K] $$@" - $(Q) if $$(cc_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) -DKBUILD_BASENAME=$(notdir $(basename $(1))) \ + $(Q) if $$(cc_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) $(KERN_KBUILD_MODNAME) \ + -D"KBUILD_BASENAME=$(KERN_MQ)$(notdir $(basename $(1)))$(KERN_MQ)" \ + -o $$@ -c $$< ; \ + then mv -f "$$@.d.tmp" "$$@.d" ; \ + else rm -f "$$@.d.tmp" ; exit 1; \ + fi +endef + + + +define COMPILE_S_o_kern_template + +$(2): $(1) + @$(QUIET_CMD_ECHO) " AS [K] $$@" + $(Q) if $$(S_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) $(KERN_KBUILD_MODNAME) \ + -D"KBUILD_BASENAME=$(KERN_MQ)$(notdir $(basename $(1)))$(KERN_MQ)" \ -o $$@ -c $$< ; \ then mv -f "$$@.d.tmp" "$$@.d" ; \ else rm -f "$$@.d.tmp" ; exit 1; \ @@ -612,7 +883,7 @@ KERN_SOURCES += $$($(1)_SOURCES) # };@\ # #endif@\ # " | tr @ \\n >$$@ - + #$(eval $(call COMPILE_c_o_kern_template,$(1).mod.c,$(1).mod.o,-DKBUILD_MODNAME=$(1))) @@ -622,7 +893,7 @@ $(2)/$(1)$(KERN_LINK_SUFFIX): $$($(1)_OBJS) @echo "$(2)/$(1)$(KERN_LINK_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 - @if [ "$(KERN_EXE_SUFFIX)" == ".ko" ] ; then \ + @if [ "$(KERN_EXE_SUFFIX)" = ".ko" ] ; then \ echo $(1) >>$(KERN_MODPOST_DIR)/module-changes ; \ echo $(1) >>$(KERN_MODPOST_DIR)/$(1).mod.stamp ; \ fi @@ -679,7 +950,9 @@ MODULES_LIST := $(MODULES_LIST:%.mod.stamp=%) define MODPOST_kern_template $(2) : $(1)$(KERN_LINK_SUFFIX) $(1).mod.c @$(QUIET_CMD_ECHO) " LD [M] $$@" - $(Q) $$(cc_o_kern_COMPILE) -DKBUILD_BASENAME=$(1) -DKBUILD_MODNAME=$(1) -o $(1).mod.o -c $(1).mod.c + $(Q) $$(cc_o_kern_COMPILE) -D"KBUILD_BASENAME=$(KERN_MQ)$(1)$(KERN_MQ)" \ + -D"KBUILD_MODNAME=$(KERN_MQ)$(1)$(KERN_MQ)" \ + -o $(1).mod.o -c $(1).mod.c $(Q) $$(KERN_LD) $$(KERN_LDFLAGS) $(1)$(KERN_LINK_SUFFIX) $(1).mod.o -r -o $$@ endef @@ -704,30 +977,13 @@ endif #===================================================================== +# Kernel requires its own set of configuration header-files +ifneq ($(kernel_LIBRARIES)$(rtlinux_LIBRARIES)$(kernel_MODULES)$(rtlinux_MODULES)$(kernel_HEADERS)$(rtlinux_HEADERS)$(kernel_HEADERS)$(rtlinux_HEADERS)$(nobase_kernel_HEADERS)$(nobase_rtlinux_HEADERS)$(renamed_kernel_HEADERS)$(renamed_rtlinux_HEADERS),) +KERN_CONFIG_HEADERS_REQUIRED = y +endif -kernel-lib-pass: - +@$(foreach dir, $(SUBDIRS), $(call mkdir_def,$(KERN_OBJS_DIR)/$(dir)) ; \ - $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ - RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) -C $(KERN_OBJS_DIR)/$(dir) \ - -f $(SOURCES_DIR)/$(dir)/Makefile $@ || exit 1 ;) - +@$(call mkdir_def,$(KERN_OBJS_DIR)) - +@if [ -n "$(kernel_LIBRARIES)$(rtlinux_LIBRARIES)" ] ; \ - then \ - $(MAKE) --no-print-directory -C $(KERN_OBJS_DIR) \ - -f $(SOURCES_DIR)/Makefile KERN_RULE_TEMPLATES=y $(@:%=%-local) ; \ - fi - -kernel-mod-pass: - +@$(foreach dir, $(SUBDIRS), $(call mkdir_def,$(KERN_OBJS_DIR)/$(dir)) ; \ - $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ - RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) -C $(KERN_OBJS_DIR)/$(dir) \ - -f $(SOURCES_DIR)/$(dir)/Makefile $@ || exit 1 ;) - +@$(call mkdir_def,$(KERN_OBJS_DIR)) - +@if [ -n "$(kernel_MODULES)$(rtlinux_MODULES)" ] ; \ - then \ - $(MAKE) --no-print-directory -C $(KERN_OBJS_DIR) \ - -f $(SOURCES_DIR)/Makefile KERN_RULE_TEMPLATES=y $(@:%=%-local) ; \ - fi +$(eval $(call omk_pass_template, kernel-lib-pass,$(KERN_OBJS_DIR),KERN_RULE_TEMPLATES=y,$(kernel_LIBRARIES)$(rtlinux_LIBRARIES))) +$(eval $(call omk_pass_template, kernel-mod-pass,$(KERN_OBJS_DIR),KERN_RULE_TEMPLATES=y,$(kernel_MODULES)$(rtlinux_MODULES))) kernel-modpost-pass: +@if [ -e "$(KERN_MODPOST_DIR)/module-changes" -o -e "$(KERN_MODPOST_DIR)/modpost-running" ] ; \ @@ -736,86 +992,34 @@ kernel-modpost-pass: -f $(SOURCES_DIR)/Makefile KERN_RULE_TEMPLATES=y KERN_MODPOST_PASS=y $(@:%=%-local) ; \ fi -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_PREFIX)$(dir) -C $(USER_OBJS_DIR)/$(dir) \ - -f $(SOURCES_DIR)/$(dir)/Makefile $@ || exit 1 ;) - +@$(foreach dir, $(QT_SUBDIRS), $(call mkdir_def,$(USER_OBJS_DIR)/$(dir)) ; \ - if [ "$@" != "binary-pass" ] ; then exit 0 ; fi ; \ - if [ ! -e $(SOURCES_DIR)/$(dir)/Makefile ] ; then \ - ( cd $(SOURCES_DIR)/$(dir) ; $$QTDIR/bin/qmake TOP_DIR=$(MAKERULES_DIR) \ - RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) QTDIR=$(QTDIR) CC=$(CC) \ - CXX=$(CXX) || exit 1 ;) ; fi ; \ - $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ - RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) -C $(SOURCES_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) +$(eval $(call omk_pass_template, library-pass,$(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,$(lib_LIBRARIES)$(shared_LIBRARIES))) +$(eval $(call omk_pass_template, binary-pass, $(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,$(bin_PROGRAMS)$(utils_PROGRAMS)$(test_PROGRAMS))) +$(eval $(call omk_pass_template,clean,$(USER_OBJS_DIR),,always)) +$(eval $(call omk_pass_template,install,$(USER_OBJS_DIR),,always)) +$(eval $(call omk_pass_template,include-pass,$(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,always)) -dep clean install check-dir include-pass default-config-pass: - +@$(foreach dir, $(SUBDIRS), $(call mkdir_def,$(USER_OBJS_DIR)/$(dir)) ; \ - $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ - RELATIVE_DIR=$(RELATIVE_PREFIX)$(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)) +check-dir: + @$(call mkdir_def,$(USER_BUILD_DIR)) + @$(call mkdir_def,$(KERN_BUILD_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,$(USER_TESTS_DIR)) @$(call mkdir_def,$(KERN_MODULES_DIR)) @$(call mkdir_def,$(KERN_MODPOST_DIR)) -install-local: - -default-config: - @echo "# Start of OMK config file" > "$(CONFIG_FILE)-default" - @echo "# This file should not be altered manually" >> "$(CONFIG_FILE)-default" - @echo "# Overrides should be stored in file $(notdir $(CONFIG_FILE))" >> "$(CONFIG_FILE)-default" - @echo >> "$(CONFIG_FILE)-default" - @$(MAKE) --no-print-directory -C $(MAKERULES_DIR) \ - RELATIVE_DIR="" SOURCES_DIR=$(MAKERULES_DIR) \ - -f $(MAKERULES_DIR)/Makefile default-config-pass +install-local: # TODO -default-config-pass-local: - @echo Default config for $(RELATIVE_DIR) - @echo "# Config for $(RELATIVE_DIR)" >> "$(CONFIG_FILE)-default" - @$(foreach x, $(default_CONFIG), echo $(x) | \ - sed -e 's/^.*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; ) +$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include)) +$(eval $(call include-pass-template,$(KERN_INCLUDE_DIR),kernel)) +ifeq ($(CONFIG_RTLINUX),y) +$(eval $(call include-pass-template,$(KERN_INCLUDE_DIR),rtlinux)) +endif -include-pass-local: - @$(call mkdir_def,$(USER_INCLUDE_DIR)) - @$(foreach f, $(include_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(notdir $(f)) \ - || cp $(CPHEADER_FLAGS) $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(notdir $(f)) || exit 1 ; ) - @$(foreach f, $(nobase_include_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(f) \ - || ( mkdir -p $(USER_INCLUDE_DIR)/$(dir $(f)) && cp $(CPHEADER_FLAGS) $(SOURCES_DIR)/$(f) $(USER_INCLUDE_DIR)/$(f) ) || exit 1 ; ) - @$(foreach f, $(renamed_include_HEADERS), \ - srcfname=`echo '$(f)' | sed -e 's/^\(.*\)->.*$$/\1/'` ; destfname=`echo '$(f)' | sed -e 's/^.*->\(.*\)$$/\1/'` ; \ - cmp --quiet $(SOURCES_DIR)/$${srcfname} $(USER_INCLUDE_DIR)/$${destfname} \ - || ( mkdir -p `dirname $(USER_INCLUDE_DIR)/$${destfname}` && cp $(CPHEADER_FLAGS) $(SOURCES_DIR)/$${srcfname} $(USER_INCLUDE_DIR)/$${destfname} ) || exit 1 ; ) -# 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 $(CPHEADER_FLAGS) $(SOURCES_DIR)/$(f) $(KERN_INCLUDE_DIR)/$(notdir $(f)) || exit 1 ; ) - @$(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 $(CPHEADER_FLAGS) $(SOURCES_DIR)/$(f) $(KERN_INCLUDE_DIR)/$(f) ) || exit 1 ; ) - @$(foreach f, $(renamed_kernel_HEADERS) $(renamed_rtlinux_HEADERS), \ - srcfname=`echo '$(f)' | sed -e 's/^\(.*\)->.*$$/\1/'` ; destfname=`echo '$(f)' | sed -e 's/^.*->\(.*\)$$/\1/'` ; \ - cmp --quiet $(SOURCES_DIR)/$${srcfname} $(KERN_INCLUDE_DIR)/$${destfname} \ - || ( mkdir -p `dirname $(KERN_INCLUDE_DIR)/$${destfname}` && cp $(CPHEADER_FLAGS) $(SOURCES_DIR)/$${srcfname} $(KERN_INCLUDE_DIR)/$${destfname} ) || exit 1 ; ) ifdef USER_RULE_TEMPLATES @@ -833,6 +1037,8 @@ $(foreach src,$(filter %.cc,$(USER_SOURCES)),$(eval $(call COMPILE_cc_o_template $(foreach src,$(filter %.cxx,$(USER_SOURCES)),$(eval $(call COMPILE_cc_o_template,$(SOURCES_DIR)/$(src),$(src:%.cxx=%.o),))) +$(foreach src,$(filter %.S,$(USER_SOURCES)),$(eval $(call COMPILE_S_o_template,$(SOURCES_DIR)/$(src),$(src:%.S=%.o),))) + $(foreach src,$(filter %.c,$(USER_GEN_SOURCES)),$(eval $(call COMPILE_c_o_template,$(src),$(src:%.c=%.o),))) # User-space shared libraries object files @@ -850,6 +1056,8 @@ $(foreach src,$(filter %.cc,$(SOLIB_SOURCES)),$(eval $(call COMPILE_cc_o_templat $(foreach src,$(filter %.cxx,$(SOLIB_SOURCES)),$(eval $(call COMPILE_cc_o_template,$(SOURCES_DIR)/$(src),$(src:%.cxx=%.lo),$(SOLIB_PICFLAGS)))) +$(foreach src,$(filter %.S,$(SOLIB_SOURCES)),$(eval $(call COMPILE_S_o_template,$(SOURCES_DIR)/$(src),$(src:%.S=%.lo),$(SOLIB_PICFLAGS)))) + $(foreach src,$(filter %.c,$(SOLIB_GEN_SOURCES)),$(eval $(call COMPILE_c_o_template,$(src),$(src:%.c=%.lo),$(SOLIB_PICFLAGS)))) # IDL compilation @@ -872,12 +1080,12 @@ $(foreach src,$(filter %.cc,$(KERN_SOURCES)),$(eval $(call COMPILE_cc_o_kern_tem $(foreach src,$(filter %.cxx,$(KERN_SOURCES)),$(eval $(call COMPILE_cc_o_kern_template,$(SOURCES_DIR)/$(src),$(src:%.cxx=%.o),))) +$(foreach src,$(filter %.S,$(USER_SOURCES)),$(eval $(call COMPILE_S_o_kern_template,$(SOURCES_DIR)/$(src),$(src:%.S=%.o),))) endif - clean-local: clean-custom @echo Cleaning in $(KERN_OBJS_DIR) and $(USER_OBJS_DIR) - @rm -f $(KERN_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.lo \ + @rm -f $(KERN_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.[och] $(USER_OBJS_DIR)/*.lo\ $(KERN_OBJS_DIR)/*.d $(USER_OBJS_DIR)/*.d \ $(KERN_OBJS_DIR)/*.map $(USER_OBJS_DIR)/*.map \ $(KERN_OBJS_DIR)/*.mod.c \ @@ -887,5 +1095,236 @@ clean-local: clean-custom @if [ -e $(KERN_LIB_DIR)/kernel.mk ] ; then \ touch -t 200001010101 $(KERN_LIB_DIR)/kernel.mk ; \ fi - +include-pass-submakes: extra-rules-subdirs + +# We must go to EXTRA_RULES_SUBDIRS beofre going to any other +# directory, since the executables compiled in EXTRA_RULES_SUBDIRS +# might be needed there. +include-pass-this-dir $(foreach subdir,$(SUBDIRS),include-pass-$(subdir)-subdir): extra-rules-subdirs + +default: include-pass library-pass binary-pass +ifndef OMIT_KERNEL_PASSES +# Also make kernel passes if not disabled +default: kernel-lib-pass kernel-pass +endif + +# Local Variables: +# mode:makefile +# End: + #OMK@config_h +# Syntax: $(call BUILD_CONFIG_H_template,,,,) +define BUILD_CONFIG_H_template + +$(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(CONFIG_FILES) + @$(QUIET_CMD_ECHO) " CONFGEN $$(@:%.stamp=%)" + @if [ ! -d `dirname $(2).tmp` ] ; then \ + mkdir -p `dirname $(2).tmp` ; fi + @echo "/* Automatically generated from */" > "$(2).tmp" + @echo "/* config files: $$(^:$(OUTPUT_DIR)/%=%) */" >> "$(2).tmp" + $(if $(DOXYGEN),@echo "/** @file */" >> "$(2).tmp") + @echo "#ifndef $(4)" >> "$(2).tmp" + @echo "#define $(4)" >> "$(2).tmp" + @( $(foreach x, $(shell echo '$($(3))' | tr 'x\t ' 'x\n\n' | sed -e 's/^\([^ =]*\)\(=[^ ]\+\|\)$$/\1/' ), \ + echo '$(x).$($(x))' ; ) echo ; ) | \ + sed -e '/^[^.]*\.n$$$$/d' -e '/^[^.]*\.$$$$/d' -e 's/^\([^.]*\)\.[ym]$$$$/\1.1/' | \ + sed -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \ + >> "$(2).tmp" + @echo "#endif /*$(4)*/" >> "$(2).tmp" + @touch "$$@" + @if cmp --quiet "$(2).tmp" "$(2)" ; then rm "$(2).tmp"; \ + else mv "$(2).tmp" "$(2)" ; \ + echo "Updated configuration $(2)" ; fi + +endef + +ifdef LOCAL_CONFIG_H + +# This must be declared after the default cflags are assigned! +# Override is used to override command line assignemnt. +override CFLAGS += -I $(USER_OBJS_DIR) +override kernel_INCLUDES += -I $(KERN_OBJS_DIR) +$(eval $(call BUILD_CONFIG_H_template,$(USER_OBJS_DIR),$(USER_OBJS_DIR)/$(LOCAL_CONFIG_H),default_CONFIG,_LOCAL_CONFIG_H) ) + +endif + +# Special rules for configuration exported headers + +#FIXME: The directory for headers should not be specified here. +$(foreach confh,$(config_include_HEADERS),$(eval $(call BUILD_CONFIG_H_template,$(USER_OBJS_DIR),$(addprefix $(USER_INCLUDE_DIR)/,$(confh)),$(basename $(notdir $(confh)))_DEFINES,\ +_$(basename $(notdir $(confh)))_H \ +))) + +config_h_stamp_files = $(addprefix $(USER_OBJS_DIR)/,$(notdir $(addsuffix .stamp,$(config_include_HEADERS) $(LOCAL_CONFIG_H)))) + +# Add some hooks to standard passes +include-pass-local: $(config_h_stamp_files) + +ifneq ($(KERN_CONFIG_HEADERS_REQUIRED),) + +ifdef LOCAL_CONFIG_H +$(eval $(call BUILD_CONFIG_H_template,$(KERN_OBJS_DIR),$(KERN_OBJS_DIR)/$(LOCAL_CONFIG_H),default_CONFIG,_LOCAL_CONFIG_H) ) +endif + +$(foreach confh,$(config_include_HEADERS),$(eval $(call BUILD_CONFIG_H_template,$(KERN_OBJS_DIR),$(addprefix $(KERN_INCLUDE_DIR)/,$(confh)),$(basename $(notdir $(confh)))_DEFINES,\ +_$(basename $(notdir $(confh)))_H \ +))) + +kern_config_h_stamp_files = $(addprefix $(KERN_OBJS_DIR)/,$(notdir $(addsuffix .stamp,$(config_include_HEADERS) $(LOCAL_CONFIG_H)))) + +# Add some hooks to standard passes +include-pass-local: $(kern_config_h_stamp_files) + +endif + +clean-local: clean-local-config-h + +clean-local-config-h: + @$(foreach confh,$(config_h_stamp_files) $(kern_config_h_stamp_files),\ + if [ -e $(confh) ] ; then rm $(confh) ; fi ; \ + ) + + +# Local Variables: +# mode:makefile +# End: + #OMK@qt +ifneq ($(QT_SUBDIRS),) + +.PHONY: qt-subpass clean-qt distclean-qt + +# Usage: $(call qt_makefile_template,) +define qt_makefile_template +$(SOURCES_DIR)/$(1)/Makefile: $(wildcard $(SOURCES_DIR)/$(1)/*.pro) + cd $(SOURCES_DIR)/$(1); $(QTDIR:%=%/bin/)qmake TOP_DIR=$(OUTPUT_DIR) \ + RELATIVE_DIR=$(RELATIVE_PREFIX)$(1) $(QTDIR:%=QTDIR=%) CC=$(CC) \ + CXX=$(CXX) LIBS+="-L$(USER_LIB_DIR)" INCLUDEPATH+="$(USER_INCLUDE_DIR)" +endef +$(foreach dir,$(QT_SUBDIRS), $(eval $(call qt_makefile_template,$(dir)))) + +qt-subpass: $(foreach dir,$(QT_SUBDIRS), $(SOURCES_DIR)/$(dir)/Makefile) + $(foreach dir,$(QT_SUBDIRS),\ + $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ + RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) -C $(SOURCES_DIR)/$(dir) \ + -f $(SOURCES_DIR)/$(dir)/Makefile || exit 1 ;) + +# Hook to binary pass +binary-pass-submakes: qt-subpass + +# Hook to clean pass +clean-local: clean-qt +clean-qt: + +@$(foreach dir, $(QT_SUBDIRS), \ + $(if $(wildcard $(SOURCES_DIR)/$(dir)/Makefile), \ + @$(QUIET_CMD_ECHO) " CLEAN $(dir)"; \ + $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ + RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) -C $(SOURCES_DIR)/$(dir) \ + -f $(SOURCES_DIR)/$(dir)/Makefile clean|| exit 1 ;)) + + +# Hook to distclean +distclean: distclean-qt + +# TODO: Add distclean-qt-pass to handle QT_SUBDIRS in the whole +# tree. This way we only distclean toplevel subdirs. +distclean-qt: + +@$(foreach dir, $(QT_SUBDIRS), \ + $(if $(wildcard $(SOURCES_DIR)/$(dir)/Makefile), \ + @$(QUIET_CMD_ECHO) " DISTCLEAN $(dir)"; \ + $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \ + RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) -C $(SOURCES_DIR)/$(dir) \ + -f $(SOURCES_DIR)/$(dir)/Makefile distclean|| exit 1 ;)) +endif + +# Local Variables: +# mode:makefile +# End: + #OMK@sources-list +# Rules that creates the list of files which are used during +# compilation. The list reflects conditional compilation depending on +# config.omk and other variables. + +SOURCES_LIST_FN=sources.txt +ifndef SOURCES_LIST +SOURCES_LIST_DIR:=$(RELATIVE_DIR) +SOURCES_LIST:=$(OUTPUT_DIR)/$(SOURCES_LIST_DIR)/$(SOURCES_LIST_FN) +SOURCES_LIST_D := $(LOCAL_BUILD_DIR)/$(SOURCES_LIST_FN).d +export SOURCES_LIST SOURCES_LIST_DIR SOURCES_LIST_D +endif + +ifeq ($(MAKECMDGOALS),sources-list) +NEED_SOURCES_LIST=y +endif +ifeq ($(MAKECMDGOALS),TAGS) +NEED_SOURCES_LIST=y +endif +ifeq ($(MAKECMDGOALS),tags) +NEED_SOURCES_LIST=y +endif + +ifeq ($(NEED_SOURCES_LIST),y) # avoid execution of find command bellow if it is not useful +.PHONY: sources-list +sources-list: $(SOURCES_LIST) + +$(SOURCES_LIST): $(CONFIG_FILES) $(shell find -name $(MAKEFILE_OMK)) + @$(call mkdir_def,$(dir $(SOURCES_LIST_D))) + @echo -n "" > "$(SOURCES_LIST).tmp" + @echo -n "" > "$(SOURCES_LIST_D).tmp" + @$(MAKE) --no-print-directory sources-list-pass + @echo "# Automatically generated list of files in '$(RELATIVE_DIR)' that are used during OMK compilation" > "$(SOURCES_LIST).tmp2" + @cat "$(SOURCES_LIST).tmp"|sort|uniq >> "$(SOURCES_LIST).tmp2" + @rm "$(SOURCES_LIST).tmp" + @mv "$(SOURCES_LIST).tmp2" "$(SOURCES_LIST)" + @echo "$(SOURCES_LIST): \\" > "$(SOURCES_LIST_D).tmp2" + @cat "$(SOURCES_LIST_D).tmp"|grep -v "$(SOURCES_LIST_D).tmp"|sort|uniq|\ + sed -e 's/$$/\\/' >> "$(SOURCES_LIST_D).tmp2" + @rm "$(SOURCES_LIST_D).tmp" + @mv "$(SOURCES_LIST_D).tmp2" "$(SOURCES_LIST_D)" +endif + +$(eval $(call omk_pass_template,sources-list-pass,$$(LOCAL_BUILD_DIR),,always)) + +sources-list-pass-local: + @$(foreach m,$(MAKEFILE_LIST),echo ' $(m)' >> "$(SOURCES_LIST_D).tmp";) + @$(foreach h,$(include_HEADERS) $(nobase_include_HEADERS) $(kernel_HEADERS),\ + echo "$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))$(h)" >> "$(SOURCES_LIST).tmp";) + @$(foreach ch,$(config_include_HEADERS), \ + echo "$(USER_INCLUDE_DIR:$(OUTPUT_DIR)/$(addsuffix /,$(SOURCES_LIST_DIR))%=%)/$(ch)" >> "$(SOURCES_LIST).tmp";) + @$(foreach h,$(renamed_include_HEADERS),echo '$(h)'|sed -e 's|\(.*\)->.*|$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))\1|' >> "$(SOURCES_LIST).tmp";) + @$(foreach bin,$(lib_LIBRARIES) $(shared_LIBRARIES) $(bin_PROGRAMS) $(test_PROGRAMS) $(utils_PROGRAMS) \ + $(kernel_LIBRARIES) $(rtlinux_LIBRARIES) $(kernel_MODULES),\ + $(foreach src,$(filter-out %.o,$($(bin)_SOURCES)),echo "$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))$(src)" >> "$(SOURCES_LIST).tmp";)) + +############ TAGS ########### + +ifeq ($(MAKECMDGOALS),TAGS) +ETAGS=etags +TAGS_CMD = $(ETAGS) +TAGS: $(SOURCES_LIST) + @$(MAKE) --no-print-directory do-tags +endif +ifeq ($(MAKECMDGOALS),tags) +CTAGS=ctags -N +TAGS_CMD = $(CTAGS) +tags: $(SOURCES_LIST) + @$(MAKE) --no-print-directory do-tags +endif +export TAGS_CMD + +ifeq ($(MAKECMDGOALS),do-tags) +.PHONY: do-tags +do-tags: $(shell sed -e '/^\#/d' $(SOURCES_LIST)) + @$(QUIET_CMD_ECHO) " TAGS $(SOURCES_LIST_FN)" + $(Q)$(TAGS_CMD) $^ +endif + +############ CSCOPE ########### + +cscope: $(SOURCES_LIST) + @$(QUIET_CMD_ECHO) " CSCOPE < $(SOURCES_LIST_FN)" + $(Q)sed -e '/^#/d' $(SOURCES_LIST)|cscope -b -i- +#FIXME: see doc to -i in cscope(1) + +# Local Variables: +# mode:makefile +# End: diff --git a/authors b/authors index 448f6e7..78e348c 100644 --- a/authors +++ b/authors @@ -39,4 +39,7 @@ Petr Stefka * Pharlap ports Virgil Ansems - * IMTECH, used the ORTE in different projects \ No newline at end of file + * IMTECH, used the ORTE in different projects + +Tran Duy Khanh + * code cleaing, removed warings under gcc 4.x diff --git a/configure.in b/configure.in index 7599aa9..b5f1649 100644 --- a/configure.in +++ b/configure.in @@ -1,19 +1,19 @@ # Process this file with autoconf to produce a configure script. # -# $Id: configure.in,v 1.14 2005/10/31 12:44:18 smolik Exp $ +# $Id: configure.in,v 1.15 2008/10/07 21:19:01 smolik Exp $ # autoconf requirement AC_PREREQ([2.56]) -AC_INIT([orte],[0.3.1],[petr.smolik@wo.cz]) +AC_INIT([orte],[0.3.2],[petr.smolik@wo.cz]) AC_CONFIG_AUX_DIR(admin) ############################### # Package info ORTE_MAJOR_VERSION=0 ORTE_MINOR_VERSION=3 -ORTE_MICRO_VERSION=1 +ORTE_MICRO_VERSION=2 ORTE_INTERFACE_AGE=0 ORTE_BINARY_AGE=0 ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION diff --git a/orte/contrib/shape/FPublisher.ui.h b/orte/contrib/shape/FPublisher.cpp similarity index 69% rename from orte/contrib/shape/FPublisher.ui.h rename to orte/contrib/shape/FPublisher.cpp index 471c587..d318d2d 100644 --- a/orte/contrib/shape/FPublisher.ui.h +++ b/orte/contrib/shape/FPublisher.cpp @@ -1,22 +1,7 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an -** init() function in place of a constructor, and a destroy() function in -** place of a destructor. -*****************************************************************************/ -#include -#include -#include -#include -#if (QT_VERSION-0 >= 0x040000) -#include -#endif +#include "FPublisher.h" -extern QApplication *a; - -void FPublisher::init() +FPublisher::FPublisher(QWidget *parent) + : QDialog(parent) { stepx=rand()%2+1;stepy=rand()%2+1; incx=incy=0; @@ -27,20 +12,20 @@ void FPublisher::init() domain=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,NULL,NULL,ORTE_FALSE); BoxType_type_register(domain); publisher=NULL; + /* setup UI */ + setupUi(this); } void FPublisher::initPublisher(int icolor,int istrength) { NtpTime persistence; - QString topic; + const char *topic; color=icolor; strength=istrength; boxType.color=color; boxType.shape=strength; - timer = new QTimer(this); - connect( timer, SIGNAL(timeout()), SLOT(Timer())); - timer->start( 50, FALSE ); + view->activateObject(0,color,strength);//color,shape NtpTimeAssembFromMs(persistence, 5, 0); switch(color) { @@ -60,11 +45,17 @@ void FPublisher::initPublisher(int icolor,int istrength) NULL, NULL, NULL); + + timer = new QTimer(); + connect( timer, SIGNAL(timeout()), this, SLOT(Timer())); + timer->start( 50 ); } + void FPublisher::closeEvent( QCloseEvent *e ) { - destroy(); + if (domain!=NULL) + destroy(); e->accept(); } @@ -74,12 +65,12 @@ void FPublisher::destroy() delete timer; ORTEDomainAppDestroy(domain); domain=NULL; + close(); } } void FPublisher::Timer() { - a->lock(); if(rect.left()<=0) incx=stepx; if(rect.top()<=0) incy=stepy; if((rect.right())>=view->width()) incx=-stepx; @@ -89,7 +80,7 @@ void FPublisher::Timer() int tmpH=rect.height(); rect.setRect(view->mouseX-tmpW/2,view->mouseY-tmpH/2,tmpW,tmpH); } else { - rect.moveBy(incx,incy); + rect.moveTo(rect.left()+incx,rect.top()+incy); } view->setPosition(0,rect); //prepare published data @@ -98,7 +89,6 @@ void FPublisher::Timer() boxType.rectangle.bottom_right_x=rect.right(); boxType.rectangle.bottom_right_y=rect.bottom(); ORTEPublicationSend(publisher); - a->unlock(); } @@ -107,9 +97,8 @@ void FPublisher::strengthChanged() ORTEPublProp pp; if (!publisher) return; - a->lock(); ORTEPublicationPropertiesGet(publisher,&pp); pp.strength=slider->value(); ORTEPublicationPropertiesSet(publisher,&pp); - a->unlock(); } + diff --git a/orte/contrib/shape/FPublisher.h b/orte/contrib/shape/FPublisher.h new file mode 100644 index 0000000..94e460b --- /dev/null +++ b/orte/contrib/shape/FPublisher.h @@ -0,0 +1,46 @@ +#ifndef FPUBLISHER_H +#define FPUBLISHER_H + +#include +#include +#include +#include +#include "ui_FPublisher.h" +#include "BoxType.h" + +#include + +class FPublisher : public QDialog , public Ui::FPublisher +{ + Q_OBJECT + + int strength; + ORTEPublication *publisher; + ORTEDomain *domain; + int color; + int stepx; + int stepy; + int incx; + int incy; + int shape; + BoxType boxType; + QRect rect; + + protected: + void closeEvent(QCloseEvent *event); + +public: + FPublisher(QWidget *parent = 0); + + void initPublisher(int icolor,int istrength); + +private slots: + void Timer(); + void destroy(); + void strengthChanged(); + +private: + QTimer *timer; +}; + +#endif diff --git a/orte/contrib/shape/FPublisher.ui b/orte/contrib/shape/FPublisher.ui index fe38ec1..628e566 100644 --- a/orte/contrib/shape/FPublisher.ui +++ b/orte/contrib/shape/FPublisher.ui @@ -1,184 +1,107 @@ - -FPublisher - - - FPublisher - - - - 0 - 0 - 389 - 256 - - - - Publisher - - - - unnamed + + FPublisher + + + + 0 + 0 + 389 + 256 + + + + Publisher + + + + + + + + + + + Qt::Horizontal + + + + Strength: - - - view - - - - 255 - 255 - 255 - - - - - - layout33 - - - - unnamed - - - - splitter2 - - - Horizontal - - - - strengt - - - Strength: - - - - - spacer3 - - - Horizontal - - - Expanding - - - - 46 - 20 - - - - - - - slider - - - 1 - - - 5 - - - 1 - - - Horizontal - - - NoMarks - - - 1 - - - - - spacer4 - - - Horizontal - - - Expanding - - - - 122 - 20 - - - - - - - - - - MyQFrame -
MyQFrame.h
- - -1 - -1 - - 0 - - 5 - 5 - 0 - 0 - - image0 -
-
- - - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f - - - - - slider - valueChanged(int) - FPublisher - strengthChanged() - - - - orte.h - BoxType.h - FPublisher.ui.h - - - int strength; - ORTEPublication *publisher; - ORTEDomain *domain; - QTimer *timer; - int color; - int stepx; - int stepy; - int incx; - int incy; - int shape; - BoxType boxType; - QRect rect; - - - init() - closeEvent( QCloseEvent * e ) - destroy() - Timer() - strengthChanged() - - - initPublisher( int icolor, int istrength ) - - - - - myqframe.h - -
+ + false + + + + + + + + 1 + + + 5 + + + 1 + + + Qt::Horizontal + + + 1 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 122 + 20 + + + + + + + + + + + + MyQFrame + QWidget +
MyQFrame.h
+
+
+ + orte.h + BoxType.h + MyQFrame.h + + + + + slider + valueChanged(int) + FPublisher + strengthChanged() + + + 20 + 20 + + + 20 + 20 + + + + + diff --git a/orte/contrib/shape/FSubscriber.ui.h b/orte/contrib/shape/FSubscriber.cpp similarity index 83% rename from orte/contrib/shape/FSubscriber.ui.h rename to orte/contrib/shape/FSubscriber.cpp index ce5c385..a6f0ecd 100644 --- a/orte/contrib/shape/FSubscriber.ui.h +++ b/orte/contrib/shape/FSubscriber.cpp @@ -1,32 +1,22 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an -** init() function in place of a constructor, and a destroy() function in -** place of a destructor. -*****************************************************************************/ -#include -#include -#include -#if (QT_VERSION-0 >= 0x040000) -#include -#endif +#include "FSubscriber.h" -extern QApplication *a; -void FSubscriber::init() +FSubscriber::FSubscriber(QWidget *parent) + : QDialog(parent) { ORTEInit(); domain=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,NULL,NULL,ORTE_FALSE); BoxType_type_register(domain); subscriberBlue=subscriberGreen=subscriberRed=NULL; subscriberBlack=subscriberYellow=NULL; + /* setup UI */ + setupUi(this); } void FSubscriber::closeEvent( QCloseEvent *e ) { - destroy(); + if (domain) + destroy(); e->accept(); } @@ -35,6 +25,7 @@ void FSubscriber::destroy() if (domain) { ORTEDomainAppDestroy(domain); domain=NULL; + close(); } } @@ -44,7 +35,6 @@ recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) FSubscriber *s=(FSubscriber*)recvCallBackParam; QRect rect; - a->lock(); switch (info->status) { case NEW_DATA: rect.setCoords( @@ -68,7 +58,6 @@ recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) s->view->deactivateObject(CL_YELLOW); break; } - a->unlock(); } @@ -95,7 +84,7 @@ void FSubscriber::initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, recvCallBack, this, IPADDRESS_INVALID); - combo->insertItem("Blue",combo->count()); + combo->addItem("Blue"); } if (iGreen) { subscriberGreen=ORTESubscriptionCreate( @@ -110,7 +99,7 @@ void FSubscriber::initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, recvCallBack, this, IPADDRESS_INVALID); - combo->insertItem("Green",combo->count()); + combo->addItem("Green"); } if (iRed) { subscriberRed=ORTESubscriptionCreate( @@ -125,7 +114,7 @@ void FSubscriber::initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, recvCallBack, this, IPADDRESS_INVALID); - combo->insertItem("Red",combo->count()); + combo->addItem("Red"); } if (iBlack) { subscriberBlack=ORTESubscriptionCreate( @@ -140,7 +129,7 @@ void FSubscriber::initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, recvCallBack, this, IPADDRESS_INVALID); - combo->insertItem("Black",combo->count()); + combo->addItem("Black"); } if (iYellow) { subscriberYellow=ORTESubscriptionCreate( @@ -155,14 +144,13 @@ void FSubscriber::initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, recvCallBack, this, IPADDRESS_INVALID); - combo->insertItem("Yellow",combo->count()); + combo->addItem("Yellow"); } } void FSubscriber::comboActivated( int ) { - a->lock(); if (combo->currentText()==QString("Blue")) slider->setValue(msBlue.seconds); if (combo->currentText()==QString("Green")) @@ -173,7 +161,6 @@ void FSubscriber::comboActivated( int ) slider->setValue(msBlack.seconds); if (combo->currentText()==QString("Yellow")) slider->setValue(msYellow.seconds); - a->unlock(); } @@ -182,7 +169,6 @@ void FSubscriber::sliderValueChanged( int value) NtpTime minSep; ORTESubsProp sp; - a->lock(); NtpTimeAssembFromMs(minSep, value, 0); if (combo->currentText()==QString("Blue")) { msBlue=minSep; @@ -214,5 +200,5 @@ void FSubscriber::sliderValueChanged( int value) sp.minimumSeparation=msYellow; ORTESubscriptionPropertiesSet(subscriberYellow,&sp); } - a->unlock(); } + diff --git a/orte/contrib/shape/FSubscriber.h b/orte/contrib/shape/FSubscriber.h new file mode 100644 index 0000000..0adc788 --- /dev/null +++ b/orte/contrib/shape/FSubscriber.h @@ -0,0 +1,49 @@ +#ifndef FSUBSCRIBER_H +#define FSUBSCRIBER_H + +#include +#include +#include +#include "ui_FSubscriber.h" +#include "BoxType.h" + +#include + +class FSubscriber : public QDialog , public Ui::FSubscriber +{ + Q_OBJECT + + BoxType boxTypeYellow; + BoxType boxTypeBlack; + BoxType boxTypeRed; + BoxType boxTypeBlue; + BoxType boxTypeGreen; + ORTEDomain *domain; + ORTESubscription *subscriberGreen; + ORTESubscription *subscriberBlue; + ORTESubscription *subscriberRed; + ORTESubscription *subscriberBlack; + ORTESubscription *subscriberYellow; + NtpTime msGreen; + NtpTime msBlue; + NtpTime msRed; + NtpTime msBlack; + NtpTime msYellow; + + protected: + void closeEvent(QCloseEvent *event); + +public: + FSubscriber(QWidget *parent = 0); + + void initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, int iYellow ); + + +private slots: + void destroy(); + void comboActivated( int ); + void sliderValueChanged( int value); + +}; + +#endif diff --git a/orte/contrib/shape/FSubscriber.ui b/orte/contrib/shape/FSubscriber.ui index c3c5f87..50d086b 100644 --- a/orte/contrib/shape/FSubscriber.ui +++ b/orte/contrib/shape/FSubscriber.ui @@ -1,239 +1,153 @@ - -FSubscriber - - - FSubscriber - - - - 0 - 0 - 389 - 331 - - - - Subscriber - - - - unnamed - - - - view - - - - 255 - 255 - 255 - - - - - - splitter2 - - - Horizontal - - - - textLabel1 - - - Color: - - - - - spacer3_2 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - - splitter3 - - - Horizontal - - - - strengt - - - Min. Separation: - - - - - spacer3 - - - Horizontal - - - Expanding - - - - 20 - 21 - - - - - - - combo - - - - - slider - - - 0 - - - 4 - - - 1 - - - Horizontal - - - NoMarks - - - 1 - - - - - spacer4_2 - - - Horizontal - - - Expanding - - - - 110 - 20 - - - - - - spacer4 - - - Horizontal - - - Expanding - - - - 100 - 20 - - - - - - - - MyQFrame -
MyQFrame.h
- - -1 - -1 - - 0 - - 5 - 5 - 0 - 0 - - image0 -
-
- - - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f - - - - - combo - activated(int) - FSubscriber - comboActivated(int) - - - slider - valueChanged(int) - FSubscriber - sliderValueChanged(int) - - - - orte.h - BoxType.h - FSubscriber.ui.h - - - BoxType boxTypeYellow; - BoxType boxTypeBlack; - BoxType boxTypeRed; - BoxType boxTypeBlue; - BoxType boxTypeGreen; - ORTEDomain *domain; - ORTESubscription *subscriberGreen; - ORTESubscription *subscriberBlue; - ORTESubscription *subscriberRed; - ORTESubscription *subscriberBlack; - ORTESubscription *subscriberYellow; - NtpTime msGreen; - NtpTime msBlue; - NtpTime msRed; - NtpTime msBlack; - NtpTime msYellow; - - - init() - closeEvent( QCloseEvent * e ) - destroy() - comboActivated( int ) - sliderValueChanged( int value ) - - - initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, int iYellow ) - - - - - myqframe.h - -
+ + FSubscriber + + + + 0 + 0 + 389 + 331 + + + + Subscriber + + + + + + + + + Qt::Horizontal + + + + Color: + + + false + + + + + + + + Qt::Horizontal + + + + Min. Separation: + + + false + + + + + + + + + + + 0 + + + 4 + + + 1 + + + Qt::Horizontal + + + 1 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 110 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 100 + 20 + + + + + + + + + + MyQFrame + QWidget +
MyQFrame.h
+
+
+ + orte.h + BoxType.h + MyQFrame.h + + + + + combo + activated(int) + FSubscriber + comboActivated(int) + + + 20 + 20 + + + 20 + 20 + + + + + slider + valueChanged(int) + FSubscriber + sliderValueChanged(int) + + + 20 + 20 + + + 20 + 20 + + + + +
diff --git a/orte/contrib/shape/MainForm.cpp b/orte/contrib/shape/MainForm.cpp new file mode 100644 index 0000000..1e1f497 --- /dev/null +++ b/orte/contrib/shape/MainForm.cpp @@ -0,0 +1,77 @@ +#include +#include "MainForm.h" +#include "richtext.h" + +#include "FPublisher.h" +#include "FSubscriber.h" + +MainForm::MainForm(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); +} + +void MainForm::about() +{ + QMessageBox::about( this, "ORTE application demo", + "This application demonstrates usege of ORTE library\n\n" + "Petr Smolik (c) 2004-2008\n" + "OCERA team"); +} + +void MainForm::viewPublSource() +{ + MyRichText *richtext; + richtext=new MyRichText; + richtext->resize( 450, 350 ); + richtext->setWindowTitle( "Publisher example"); + richtext->setTextPublisher(); + richtext->show(); + connect( this, SIGNAL( rejected() ), richtext, SLOT( close() ) ); +} + +void MainForm::viewSubsSource() +{ + MyRichText *richtext; + richtext=new MyRichText; + richtext->resize( 450, 350 ); + richtext->setWindowTitle( "Subscriber example"); + richtext->setTextSubscriber(); + connect( this, SIGNAL( rejected() ), richtext, SLOT( close() ) ); + richtext->show(); +} + +void MainForm::addPublisher() +{ + FPublisher *fp; + int color=0; + + if (radioButton2_3->isChecked()) + color=1; + if (radioButton2_4->isChecked()) + color=2; + if (radioButton1->isChecked()) + color=3; + if (radioButton2->isChecked()) + color=4; + fp = new FPublisher(); + fp->initPublisher(color,rand()%3); + connect( this, SIGNAL( rejected() ), fp, SLOT( destroy() ) ); + fp->setWindowIcon(QPixmap(":/FPublisherIcon.png")); + fp->show(); +} + +void MainForm::addSubscriber() +{ + FSubscriber *fs; + fs = new FSubscriber; + connect( this, SIGNAL( rejected() ), fs, SLOT( destroy() ) ); + fs->initSubscribers( + clBlue->isChecked(), + clGreen->isChecked(), + clRed->isChecked(), + clBlack->isChecked(), + clYellow->isChecked()); + fs->setWindowIcon(QPixmap(":/FSubscriberIcon.png")); + fs->show(); +} diff --git a/orte/contrib/shape/MainForm.h b/orte/contrib/shape/MainForm.h new file mode 100644 index 0000000..aaa21e5 --- /dev/null +++ b/orte/contrib/shape/MainForm.h @@ -0,0 +1,23 @@ +#ifndef MAINFORM_H +#define MAINFORM_H + +#include + +#include "ui_MainForm.h" + +class MainForm : public QDialog, public Ui::MainForm +{ + Q_OBJECT + +public: + MainForm(QWidget *parent = 0); + +private slots: + void about(); + void viewPublSource(); + void viewSubsSource(); + void addPublisher(); + void addSubscriber(); +}; + +#endif diff --git a/orte/contrib/shape/MainForm.ui b/orte/contrib/shape/MainForm.ui index bcdae07..327f05b 100644 --- a/orte/contrib/shape/MainForm.ui +++ b/orte/contrib/shape/MainForm.ui @@ -1,627 +1,628 @@ - -MainForm - - - MainForm - - - - 0 - 0 - 447 - 308 - - - + + MainForm + + + + 0 + 0 + 599 + 434 + + + + + 447 + 307 + + + + ORTE demo application + + + + + + + - 447 - 307 + 16777215 + 40 - - - ORTE demo application - - - - unnamed + + + + 18 + 75 + true + + + + <p align="center">Publishers</p> + + + false + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Colors + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + false + + + false + + + false + + + + + 10 + 20 + 81 + 221 + - - - layout18 - - - - unnamed - - - - textLabel1 - - - - 18 - 1 - - - - <p align="center">Publishers</p> - - - - - publGroup - - - Colors - - - - unnamed - - - - layout11 - - - - unnamed - - - - radioButton2_2 - - - Blue - - - true - - - - - radioButton2_3 - - - Green - - - - - radioButton2_4 - - - Red - - - - - radioButton1 - - - Black - - - false - - - - - radioButton2 - - - Yellow - - - - - - - - - spacer9 - - - Vertical - - - Expanding - - - - 20 - 16 - - - - - - pubAdd - - - Add - - - - - pubSource - - - View Source - - - + + + -1 + + + + + Blue + + + true + + + + + + + Green + + + + + + + Red + + + + + + + Black + + + false + + + + + + + Yellow + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Add + + + + + + + View Source + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 16 + 20 + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 32767 + 32767 + + + + :/ocera_logo.png + + + false + + + false + + + - - spacer12_2 - - - Horizontal - - - Expanding - - - - 16 - 20 - - + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + - - - layout10 - - - - unnamed - - - - layout22 - - - - unnamed - - - - spacer10 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - pixmapLabel1 - - - - 32767 - 32767 - - - - ocera_logo.png - - - false - - - - - spacer11 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - - - spacer10_2 - - - Vertical - - - Expanding - - - - 20 - 20 - - - - - - textLabel1_3 - - - Don't forget to run ortemanager! - - - AlignCenter - - - - - spacer13_3 - - - Vertical - - - Expanding - - - - 20 - 20 - - - - - - layout9 - - - - unnamed - - - - spacer10_3 - - - Horizontal - - - Expanding - - - - 21 - 20 - - - - - - pixmapLabel1_2 - - - - 32767 - 32767 - - - - shapes.png - - - false - - - - - spacer11_2 - - - Horizontal - - - Expanding - - - - 22 - 20 - - - - - - - - spacer13 - - - Vertical - - - Expanding - - - - 20 - 20 - - - - - - layout24 - - - - unnamed - - - - spacer14 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - About - - - - 120 - 0 - - - - About - - - - - spacer15 - - - Horizontal - - - Expanding - - - - 40 - 20 - - - - - - + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + Don't forget to run ortemanager! + + + Qt::AlignCenter + + + false + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 21 + 20 + + + + + + + + + 32767 + 32767 + + + + :/shapes.png + + + false + + + false + + + - - spacer13_2 - - - Horizontal - - - Expanding - - - - 16 - 20 - - + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 22 + 20 + + - - - layout19 - - - - unnamed - - - - textLabel1_2 - - - - 18 - 1 - - - - <p align="center">Subscribers</p> - - - - - subGrupColors - - - Colors - - - - unnamed - - - - layout12 - - - - unnamed - - - - clBlue - - - Blue - - - - - clGreen - - - Green - - - - - clRed - - - Red - - - - - clBlack - - - Black - - - - - clYellow - - - Yellow - - - - - - - - - spacer12 - - - Vertical - - - Expanding - - - - 20 - 16 - - - - - - subAdd - - - Add - - - - - subSource - - - View Source - - - + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 120 + 0 + + + + About + - - - - - About - clicked() - MainForm - about() - - - subSource - clicked() - MainForm - viewSubsSource() - - - pubAdd - clicked() - MainForm - addPublisher() - - - pubSource - clicked() - MainForm - viewPublSource() - - - subAdd - clicked() - MainForm - addSubscriber() - - - - radioButton1 - radioButton2 - pubAdd - pubSource - subAdd - subSource - clBlue - clGreen - radioButton2_2 - radioButton2_3 - radioButton2_4 - About - clRed - clBlack - clYellow - - - MainForm.ui.h - - - sigClose() - - - addPublisher() - addSubscriber() - about() - viewPublSource() - viewSubsSource() - closeEvent( QCloseEvent * e ) - - - - + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 16 + 20 + + + + + + + + + + + 16777215 + 40 + + + + + 18 + 75 + true + + + + <p align="center">Subscribers</p> + + + false + + + + + + + + 0 + 170 + + + + Colors + + + + + 10 + 20 + 141 + 251 + + + + + + + Blue + + + + + + + Green + + + + + + + Red + + + + + + + Black + + + + + + + Yellow + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Add + + + + + + + View Source + + + + + + + + + + pubAdd + pubSource + subAdd + subSource + About + + + + + + + About + clicked() + MainForm + about() + + + 20 + 20 + + + 20 + 20 + + + + + subSource + clicked() + MainForm + viewSubsSource() + + + 20 + 20 + + + 20 + 20 + + + + + pubAdd + clicked() + MainForm + addPublisher() + + + 20 + 20 + + + 20 + 20 + + + + + pubSource + clicked() + MainForm + viewPublSource() + + + 20 + 20 + + + 20 + 20 + + + + + subAdd + clicked() + MainForm + addSubscriber() + + + 20 + 20 + + + 20 + 20 + + + + + diff --git a/orte/contrib/shape/MainForm.ui.h b/orte/contrib/shape/MainForm.ui.h deleted file mode 100644 index 02636b5..0000000 --- a/orte/contrib/shape/MainForm.ui.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an -** init() function in place of a constructor, and a destroy() function in -** place of a destructor. -*****************************************************************************/ -#include -#include -#include -#include -#include "FPublisher.h" -#include "FSubscriber.h" -#include "richtext.h" -#if (QT_VERSION-0 >= 0x040000) -#include -#include -#include -#else -#include -#endif - - -void MainForm::addPublisher() -{ - - FPublisher *fp; - fp = new FPublisher; - connect( this, SIGNAL( sigClose() ), fp, SLOT( destroy() ) ); - fp->initPublisher(publGroup->id(publGroup->selected()),rand()%3); -#if (QT_VERSION-0 >= 0x040000) - fp->setWindowIcon(QPixmap("FPublisherIcon.png")); -#endif - fp->show(); -} - -void MainForm::addSubscriber() -{ - FSubscriber *fs; - fs = new FSubscriber; - connect( this, SIGNAL( sigClose() ), fs, SLOT( destroy() ) ); - fs->initSubscribers( - clBlue->isChecked(), - clGreen->isChecked(), - clRed->isChecked(), - clBlack->isChecked(), - clYellow->isChecked()); -#if (QT_VERSION-0 >= 0x040000) - fs->setWindowIcon(QPixmap("FSubscriberIcon.png")); -#endif - fs->show(); -} - -void MainForm::about() -{ - QMessageBox::about( this, "ORTE application demo", - "This application demonstrates usege of ORTE library\n\n" - "Petr Smolik (c) 2004\n" - "OCERA team"); -} - -void MainForm::viewPublSource() -{ - MyRichText *richtext; - richtext=new MyRichText; - richtext->resize( 450, 350 ); - richtext->setCaption( "Publisher example" ); - richtext->setTextPublisher(); - richtext->show(); -} - -void MainForm::viewSubsSource() -{ - MyRichText *richtext; - richtext=new MyRichText; - richtext->resize( 450, 350 ); - richtext->setCaption( "Subscriber example" ); - richtext->setTextSubscriber(); - richtext->show(); -} - -void MainForm::closeEvent( QCloseEvent *e ) -{ - sigClose(); - e->accept(); -} diff --git a/orte/contrib/shape/Makefile b/orte/contrib/shape/Makefile index c35118a..cc430c9 100644 --- a/orte/contrib/shape/Makefile +++ b/orte/contrib/shape/Makefile @@ -9,4 +9,7 @@ default: clean: rm -f Makefile.qmake - rm -fd .ui + rm -fr .ui + rm -fr .moc + rm -fr .obj + rm -f ortedemo diff --git a/orte/contrib/shape/MyQFrame.cpp b/orte/contrib/shape/MyQFrame.cpp index 9d28085..997498c 100644 --- a/orte/contrib/shape/MyQFrame.cpp +++ b/orte/contrib/shape/MyQFrame.cpp @@ -5,14 +5,12 @@ ****************************************************************/ #include "MyQFrame.h" -#if (QT_VERSION-0 >= 0x040000) #include #include #include -#endif -MyQFrame::MyQFrame( QWidget *parent, const char *name ) - : QFrame( parent, name ) +MyQFrame::MyQFrame( QWidget *parent) + : QFrame( parent) { mousePressed=0; objects[0]=objects[1]=objects[2]=objects[3]=objects[4]=0; @@ -59,11 +57,7 @@ void MyQFrame::paintEvent(QPaintEvent*) p.drawEllipse(positions[i]); break; case 2: //triangle -#if (QT_VERSION-0 >= 0x040000) QPolygon pt; -#else - QPointArray pt(3); -#endif pt.putPoints(0,3, positions[i].center().x(),positions[i].top(), positions[i].right(),positions[i].bottom(), positions[i].left(),positions[i].bottom()); diff --git a/orte/contrib/shape/MyQFrame.h b/orte/contrib/shape/MyQFrame.h index 71a5dce..c6b3d47 100644 --- a/orte/contrib/shape/MyQFrame.h +++ b/orte/contrib/shape/MyQFrame.h @@ -16,7 +16,7 @@ class MyQFrame : public QFrame { Q_OBJECT public: - MyQFrame( QWidget *parent=0, const char *name=0 ); + MyQFrame( QWidget *parent=0); protected: void mouseMoveEvent(QMouseEvent *e); diff --git a/orte/contrib/shape/main.cpp b/orte/contrib/shape/main.cpp index 7a3af50..2e792f9 100644 --- a/orte/contrib/shape/main.cpp +++ b/orte/contrib/shape/main.cpp @@ -1,20 +1,14 @@ -#include -#if (QT_VERSION-0 >= 0x040000) -#include -#endif +#include + #include "MainForm.h" -QApplication *a; int main( int argc, char ** argv ) { - a=new QApplication(argc,argv); - MainForm w; - a->setMainWidget( &w); -#if (QT_VERSION-0 >= 0x040000) - w.setWindowIcon(QPixmap("FMainIcon.png")); -#endif - w.show(); - a->connect( a, SIGNAL( lastWindowClosed() ), a, SLOT( quit() ) ); - return a->exec(); + QApplication app(argc, argv); + MainForm mf; + mf.connect(&app, SIGNAL( lastWindowClosed()), &app, SLOT(quit())); + mf.setWindowIcon(QPixmap(":/FMainIcon.png")); + mf.show(); + return app.exec(); } diff --git a/orte/contrib/shape/ortedemo.pro b/orte/contrib/shape/ortedemo.pro index c705221..91573ba 100644 --- a/orte/contrib/shape/ortedemo.pro +++ b/orte/contrib/shape/ortedemo.pro @@ -1,10 +1,18 @@ SOURCES += main.cpp \ + MainForm.cpp \ MyQFrame.cpp \ richtext.cpp \ - BoxType.c + FPublisher.cpp \ + FSubscriber.cpp \ + BoxType.c + HEADERS += richtext.h \ - MyQFrame.h -TARGET = ortedemo + MyQFrame.h \ + MainForm.h \ + FPublisher.h \ + FSubscriber.h + +TARGET = ortedemo unix { UI_DIR = .ui @@ -15,21 +23,13 @@ unix { FORMS = MainForm.ui \ FPublisher.ui \ FSubscriber.ui -IMAGES = ocera_logo.png \ - shapes.png \ - marble.png \ - FMainIcon.png \ - FPublisherIcon.png \ - FSubscriberIcon.png + +RESOURCES += shapes.qrc + TEMPLATE =app CONFIG += qt-mt -INCLUDEPATH += . +INCLUDEPATH += . ../../../_compiled/include DEFINES += HAVE_STDINT_H QT_THREAD_SUPPORT -LIBS += -lorte -lpthread +LIBS += -L../../../_compiled/lib -lorte -lpthread win32:LIBS += -lws2_32 LANGUAGE = C++ - -#The following line was inserted by qt3to4 -QT += qt3support -#The following line was inserted by qt3to4 -CONFIG += uic3 diff --git a/orte/contrib/shape/richtext.cpp b/orte/contrib/shape/richtext.cpp index e9df5ca..e26b589 100644 --- a/orte/contrib/shape/richtext.cpp +++ b/orte/contrib/shape/richtext.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** $Id: richtext.cpp,v 1.8 2005/11/03 09:27:47 smolik Exp $ +** $Id: richtext.cpp,v 1.9 2008/10/07 21:19:07 smolik Exp $ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** @@ -8,18 +8,8 @@ ** *****************************************************************************/ -#include #include #include -#include - -#if (QT_VERSION-0 >= 0x040000) -#include -#include -#else -#include -#include -#endif #include "richtext.h" @@ -100,29 +90,33 @@ static const char* subscriberExamples[] = { }; -MyRichText::MyRichText( QWidget *parent, const char *name ) - : QVBox( parent, name ) +MyRichText::MyRichText( QWidget *parent, Qt::WindowFlags f) + : QWidget( parent, f) { - setMargin( 5 ); - - view = new QTextView( this ); - QBrush paper; - paper.setPixmap( QPixmap( "marble.png" ) ); - if ( paper.pixmap() != 0 ) - view->setPaper( paper ); - else - view->setPaper( Qt::white ); - - view->setMinimumSize( 500, 250 ); - - QHBox *buttons = new QHBox( this ); - buttons->setMargin( 5 ); + QVBoxLayout *vboxLayout; + QHBoxLayout *buttons; + + vboxLayout = new QVBoxLayout(this); + vboxLayout->setSpacing(6); + vboxLayout->setMargin(11); + + view = new QTextBrowser(); + view->setMinimumSize( 700, 450 ); - bClose = new QPushButton( "&Close", buttons ); - bPrev = new QPushButton( "<< &Prev", buttons ); - bNext = new QPushButton( "&Next >>", buttons ); + vboxLayout->addWidget(view); + bClose = new QPushButton( "&Close"); + bPrev = new QPushButton( "<< &Prev"); bPrev->setEnabled( FALSE ); + bNext = new QPushButton( "&Next >>"); + + buttons = new QHBoxLayout(); + buttons->setMargin( 5 ); + buttons->addWidget(bClose); + buttons->addWidget(bPrev); + buttons->addWidget(bNext); + + vboxLayout->addLayout(buttons); connect( bClose, SIGNAL(clicked()), this, SLOT(close()) ); connect( bPrev, SIGNAL( clicked() ), this, SLOT( prev() ) ); diff --git a/orte/contrib/shape/richtext.h b/orte/contrib/shape/richtext.h index a6db980..ccf8cc4 100644 --- a/orte/contrib/shape/richtext.h +++ b/orte/contrib/shape/richtext.h @@ -1,5 +1,5 @@ /**************************************************************************** -** $Id: richtext.h,v 1.5 2005/11/03 09:27:47 smolik Exp $ +** $Id: richtext.h,v 1.6 2008/10/07 21:19:07 smolik Exp $ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** @@ -12,31 +12,24 @@ #define RICHTEXT_H #include +#include +#include +#include +#include +#include -#if (QT_VERSION-0 >= 0x040000) -#define QVBox Q3VBox -#define QHBox Q3HBox -#define QTextView Q3TextView -#include -#else -#include -#endif - -class QTextView; -class QPushButton; - -class MyRichText : public QVBox +class MyRichText : public QWidget { Q_OBJECT public: - MyRichText( QWidget *parent = 0, const char *name = 0); + MyRichText( QWidget *parent = 0, Qt::WindowFlags f = 0); void setTextPublisher(); void setTextSubscriber(); const char **sayings; protected: - QTextView *view; + QTextBrowser *view; QPushButton *bClose, *bNext, *bPrev; int num; diff --git a/orte/contrib/shape/shapes.qrc b/orte/contrib/shape/shapes.qrc new file mode 100644 index 0000000..5d4c8b1 --- /dev/null +++ b/orte/contrib/shape/shapes.qrc @@ -0,0 +1,10 @@ + + + ocera_logo.png + shapes.png + marble.png + FMainIcon.png + FPublisherIcon.png + FSubscriberIcon.png + + diff --git a/orte/examples/spy/ortespy.c b/orte/examples/spy/ortespy.c index b8f6473..f3c5e7d 100644 --- a/orte/examples/spy/ortespy.c +++ b/orte/examples/spy/ortespy.c @@ -73,7 +73,7 @@ recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) ORTESubscription* subscriptionCallBack(const char *topic, const char *type, void *param) { ORTETypeRegisterAdd(d,type,NULL,NULL,NULL,0); - if (strcmp(topic,"Red")==0) return NULL; + if (strcmp((const char *)topic, (const char*)"Red")==0) return NULL; return ORTESubscriptionCreate( d, IMMEDIATE, diff --git a/orte/idl-compiler/orte-idl-c-headers.c b/orte/idl-compiler/orte-idl-c-headers.c index 6dc7cea..e935ebd 100644 --- a/orte/idl-compiler/orte-idl-c-headers.c +++ b/orte/idl-compiler/orte-idl-c-headers.c @@ -495,7 +495,7 @@ ch_prep_sequence(IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci) g_free(ctmp2); ctmp2 = g_strdup("CORBA_Object"); } - separate_defs = strcmp(ctmp, ctmp2); + separate_defs = strcmp((const char *)ctmp, (const char*)ctmp2); fullname = orte_cbe_get_typespec_str(tree); if(separate_defs) @@ -528,7 +528,7 @@ ch_prep_sequence(IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci) { fprintf(ci->fh, "#if !defined(_%s_defined)\n#define _%s_defined 1\n", fullname, fullname); - if(!strcmp(ctmp, "CORBA_RepositoryId")) + if(!strcmp((const char *)ctmp, (const char*)"CORBA_RepositoryId")) fprintf(ci->fh, "/* CRACKHEADS */\n"); fprintf(ci->fh, "typedef %s %s;\n", fullname_def, fullname); fprintf(ci->fh, "#endif\n"); diff --git a/orte/idl-compiler/orte-idl-driver.c b/orte/idl-compiler/orte-idl-driver.c index bcabe69..4496de3 100644 --- a/orte/idl-compiler/orte-idl-driver.c +++ b/orte/idl-compiler/orte-idl-driver.c @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: orte-idl-driver.c,v 1.3 2005/10/31 12:44:20 smolik Exp $ + $Id: orte-idl-driver.c,v 1.4 2008/10/07 21:19:07 smolik Exp $ ***************************************************************************/ diff --git a/orte/include/orte/orte_config_omk_linux.h b/orte/include/orte/orte_config_omk_linux.h index 3bd5425..566c282 100644 --- a/orte/include/orte/orte_config_omk_linux.h +++ b/orte/include/orte/orte_config_omk_linux.h @@ -181,19 +181,19 @@ #define ORTE_PACKAGE_NAME "orte" /* Define to the full name and version of this package. */ -#define ORTE_PACKAGE_STRING "orte 0.3.1" +#define ORTE_PACKAGE_STRING "orte 0.3.2" /* Define to the one symbol short name of this package. */ #define ORTE_PACKAGE_TARNAME "orte" /* Define to the version of this package. */ -#define ORTE_PACKAGE_VERSION "0.3.1" +#define ORTE_PACKAGE_VERSION "0.3.2" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define ORTE_VERSION "0.3.1" +#define ORTE_VERSION "0.3.2" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ diff --git a/orte/include/orte/orte_config_omk_rtl_onetd.h b/orte/include/orte/orte_config_omk_rtl_onetd.h index 013e6f4..c9f2bd8 100644 --- a/orte/include/orte/orte_config_omk_rtl_onetd.h +++ b/orte/include/orte/orte_config_omk_rtl_onetd.h @@ -162,19 +162,19 @@ #define ORTE_PACKAGE_NAME "orte" /* Define to the full name and version of this package. */ -#define ORTE_PACKAGE_STRING "orte 0.3.1" +#define ORTE_PACKAGE_STRING "orte 0.3.2" /* Define to the one symbol short name of this package. */ #define ORTE_PACKAGE_TARNAME "orte" /* Define to the version of this package. */ -#define ORTE_PACKAGE_VERSION "0.3.1" +#define ORTE_PACKAGE_VERSION "0.3.2" /* Define to 1 if you have the ANSI C header files. */ /* #undef STDC_HEADERS */ /* Version number of package */ -#define ORTE_VERSION "0.3.1" +#define ORTE_VERSION "0.3.2" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ diff --git a/orte/include/orte/orte_config_omk_rtl_wip.h b/orte/include/orte/orte_config_omk_rtl_wip.h index c8e9505..35ad0c9 100644 --- a/orte/include/orte/orte_config_omk_rtl_wip.h +++ b/orte/include/orte/orte_config_omk_rtl_wip.h @@ -157,19 +157,19 @@ #define ORTE_PACKAGE_NAME "orte" /* Define to the full name and version of this package. */ -#define ORTE_PACKAGE_STRING "orte 0.3.1" +#define ORTE_PACKAGE_STRING "orte 0.3.2" /* Define to the one symbol short name of this package. */ #define ORTE_PACKAGE_TARNAME "orte" /* Define to the version of this package. */ -#define ORTE_PACKAGE_VERSION "0.3.1" +#define ORTE_PACKAGE_VERSION "0.3.2" /* Define to 1 if you have the ANSI C header files. */ /* #undef STDC_HEADERS */ /* Version number of package */ -#define ORTE_VERSION "0.3.1" +#define ORTE_VERSION "0.3.2" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ diff --git a/orte/include/orte/orte_config_omk_win32.h b/orte/include/orte/orte_config_omk_win32.h index adb5b31..41dbb5d 100644 --- a/orte/include/orte/orte_config_omk_win32.h +++ b/orte/include/orte/orte_config_omk_win32.h @@ -31,6 +31,8 @@ /* Define if is target a unix system */ /* #undef CONFIG_ORTE_UNIX */ +#define HAVE_TIMEVAL_H 1 + /* Define if is target windows */ #define CONFIG_ORTE_WIN 1 @@ -212,13 +214,13 @@ #define ORTE_PACKAGE_NAME "orte" /* Define to the full name and version of this package. */ -#define ORTE_PACKAGE_STRING "orte 0.3.1" +#define ORTE_PACKAGE_STRING "orte 0.3.2" /* Define to the one symbol short name of this package. */ #define ORTE_PACKAGE_TARNAME "orte" /* Define to the version of this package. */ -#define ORTE_PACKAGE_VERSION "0.3.1" +#define ORTE_PACKAGE_VERSION "0.3.2" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 diff --git a/orte/include/orte_headers.h b/orte/include/orte_headers.h index ba01c41..9071083 100644 --- a/orte/include/orte_headers.h +++ b/orte/include/orte_headers.h @@ -194,7 +194,9 @@ extern "C" { #ifndef __GETOPT_H__ //mingw #include #endif - #include + #ifndef HAVE_TIMEVAL_H + #include + #endif #include #define ioctl ioctlsocket #elif defined CONFIG_ORTE_RTL @@ -239,7 +241,7 @@ extern "C" { #include #include #define ioctl ioctlsocket - #define ORTE_PACKAGE_STRING "orte 0.3.0" + #define ORTE_PACKAGE_STRING "orte 0.3.2" #define CONFIG_ORTE_WIN #endif diff --git a/orte/libjorte/JGetORTEConstant.c b/orte/libjorte/JGetORTEConstant.c index aec2700..6c2be0a 100644 --- a/orte/libjorte/JGetORTEConstant.c +++ b/orte/libjorte/JGetORTEConstant.c @@ -32,7 +32,7 @@ /* macro for comparing 2 strings */ /* if(a==b) -> strcmp = 0 */ -#define compare(a,b) ((strcmp((a),(b)) == 0) ? 1 : 0) +#define compare(a,b) ((strcmp((const char *)(a), (const char*)(b)) == 0) ? 1 : 0) /* global variables */ @@ -143,7 +143,7 @@ const char *c = "MAX"; int get_const(char *konstanta) { -#define xxx(name) if (strcmp(konstanta, #name )) return name +#define xxx(name) if (strcmp((const char *)konstanta, (const char*)#name)) return name xxx(MAX); xxx(MIN); } diff --git a/orte/libjorte/JORTEPublicationPropertiesSet.c b/orte/libjorte/JORTEPublicationPropertiesSet.c index e785f91..0a008e1 100644 --- a/orte/libjorte/JORTEPublicationPropertiesSet.c +++ b/orte/libjorte/JORTEPublicationPropertiesSet.c @@ -96,7 +96,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet } str = (*env)->GetStringUTFChars(env,obj_str,0); // set structure's field - strncpy((char *) publ_prop->topic, str, strlen(str) + 1); + strncpy((char *)publ_prop->topic, (const char*)str, strlen(str) + 1); #ifdef TEST_STAGE printf(":c: topic = %s, publ_prop->topic = %s \n", str, publ_prop->topic); @@ -126,7 +126,7 @@ Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet } str = (*env)->GetStringUTFChars(env,obj_str,0); // set structure's field - strncpy((char *) publ_prop->typeName, str, strlen(str) + 1); + strncpy((char *)publ_prop->typeName, (const char*)str, strlen(str) + 1); #ifdef TEST_STAGE printf(":c: typeName = %s, publ_prop->typeName = %s \n", str, publ_prop->typeName); diff --git a/orte/libjorte/JORTESubscriptionPropertiesSet.c b/orte/libjorte/JORTESubscriptionPropertiesSet.c index 5aee3b6..9603934 100644 --- a/orte/libjorte/JORTESubscriptionPropertiesSet.c +++ b/orte/libjorte/JORTESubscriptionPropertiesSet.c @@ -94,7 +94,7 @@ Java_org_ocera_orte_Subscription_jORTESubscriptionPropertiesSet } str = (*env)->GetStringUTFChars(env,obj_str,0); // Set the structure field. - strncpy((char *) subs_prop->topic, str, strlen(str) + 1); + strncpy((char *)subs_prop->topic, (const char*)str, strlen(str) + 1); #ifdef TEST_STAGE printf(":c: topic = %s, subs_prop->topic = %s \n", str, subs_prop->topic); @@ -124,7 +124,7 @@ Java_org_ocera_orte_Subscription_jORTESubscriptionPropertiesSet } str = (*env)->GetStringUTFChars(env,obj_str,0); // Set the structure field. - strncpy((char *) subs_prop->typeName, str, strlen(str) + 1); + strncpy((char *)subs_prop->typeName, (const char*)str, strlen(str) + 1); #ifdef TEST_STAGE printf(":c: typeName = %s, subs_prop->typeName = %s \n", str, subs_prop->typeName); diff --git a/orte/liborte/ORTEAppRecvThread.c b/orte/liborte/ORTEAppRecvThread.c index c55bcbe..c909027 100644 --- a/orte/liborte/ORTEAppRecvThread.c +++ b/orte/liborte/ORTEAppRecvThread.c @@ -93,8 +93,8 @@ void ORTEAppRecvThread(TaskProp *tp) { CORBA_char flags,sub_id; CORBA_unsigned_short sub_len; - CDR_get_octet(cdrCodec,&sub_id); - CDR_get_octet(cdrCodec,&flags); + CDR_get_octet(cdrCodec, (CORBA_octet *)&sub_id); + CDR_get_octet(cdrCodec, (CORBA_octet *)&flags); if (flags & 0x01) cdrCodec->data_endian=FLAG_LITTLE_ENDIAN; else diff --git a/orte/liborte/ORTEDomain.c b/orte/liborte/ORTEDomain.c index abf9d6a..d011bd8 100644 --- a/orte/liborte/ORTEDomain.c +++ b/orte/liborte/ORTEDomain.c @@ -121,7 +121,7 @@ ORTEDomainPropDefaultGet(ORTEDomainProp *prop) { //IFProp sock_init_udp(&sock); sock_bind(&sock,0,INADDR_ANY); - sock_get_local_interfaces(&sock,prop->IFProp,&prop->IFCount); + sock_get_local_interfaces(&sock,prop->IFProp, (char *)&prop->IFCount); sock_cleanup(&sock); prop->mgrs=NULL; //only from localhost @@ -219,6 +219,7 @@ ORTEDomainCreate(int domain, ORTEDomainProp *prop, pthread_cond_init(&d->objectEntry.htimSendCond,NULL); pthread_mutex_init(&d->objectEntry.htimSendMutex,NULL); d->objectEntry.htimSendCondValue=0; + d->objectEntry.htimNeedWakeUp=ORTE_TRUE; //publication,subscriptions d->publications.counter=d->subscriptions.counter=0; CSTWriter_init_root_field(&d->publications); @@ -310,13 +311,13 @@ ORTEDomainCreate(int domain, ORTEDomainProp *prop, //reuseaddr sock_setsockopt(&d->taskRecvUnicastMetatraffic.sock, SOL_SOCKET, - SO_REUSEADDR, (char*)&reuse, sizeof(reuse)); + SO_REUSEADDR, (const char *)&reuse, sizeof(reuse)); debug(30,2) ("ORTEDomainCreate: set value SO_REUSEADDR: %u\n", reuse); //multicast loop sock_setsockopt(&d->taskRecvUnicastMetatraffic.sock, IPPROTO_IP, - IP_MULTICAST_LOOP, (char*)&loop, + IP_MULTICAST_LOOP, (const char *)&loop, sizeof(loop)); debug(30,2) ("ORTEDomainCreate: set value IP_MULTICAST_LOOP: %u\n", loop); @@ -325,7 +326,7 @@ ORTEDomainCreate(int domain, ORTEDomainProp *prop, mreq.imr_multiaddr.s_addr=htonl(d->domainProp.multicast.ipAddress); mreq.imr_interface.s_addr=htonl(INADDR_ANY); if(sock_setsockopt(&d->taskRecvUnicastMetatraffic.sock,IPPROTO_IP, - IP_ADD_MEMBERSHIP,(void *) &mreq, sizeof(mreq))>=0) { + IP_ADD_MEMBERSHIP, (const char *)&mreq, sizeof(mreq))>=0) { debug(30,2) ("ORTEDomainCreate: joint to mgroup %s\n", IPAddressToString(d->domainProp.multicast.ipAddress,sIPAddress)); } @@ -348,13 +349,13 @@ ORTEDomainCreate(int domain, ORTEDomainProp *prop, //reuseaddr sock_setsockopt(&d->taskRecvMulticastMetatraffic.sock, SOL_SOCKET, - SO_REUSEADDR, (char*)&reuse, sizeof(reuse)); + SO_REUSEADDR, (const char *)&reuse, sizeof(reuse)); debug(30,2) ("ORTEDomainCreate: set value SO_REUSEADDR: %u\n", reuse); //multicast loop sock_setsockopt(&d->taskRecvMulticastMetatraffic.sock, IPPROTO_IP, - IP_MULTICAST_LOOP, &d->domainProp.multicast.loopBackEnabled, + IP_MULTICAST_LOOP, (const char *)&d->domainProp.multicast.loopBackEnabled, sizeof(d->domainProp.multicast.loopBackEnabled)); debug(30,2) ("ORTEDomainCreate: set value IP_MULTICAST_LOOP: %u\n", d->domainProp.multicast.loopBackEnabled); @@ -363,7 +364,7 @@ ORTEDomainCreate(int domain, ORTEDomainProp *prop, mreq.imr_multiaddr.s_addr=htonl(d->domainProp.multicast.ipAddress); mreq.imr_interface.s_addr=htonl(INADDR_ANY); if(sock_setsockopt(&d->taskRecvMulticastMetatraffic.sock,IPPROTO_IP, - IP_ADD_MEMBERSHIP,(void *) &mreq, sizeof(mreq))>=0) { + IP_ADD_MEMBERSHIP, (const char *)&mreq, sizeof(mreq))>=0) { debug(30,2) ("ORTEDomainCreate: joint to mgroup %s\n", IPAddressToString(d->domainProp.multicast.ipAddress,sIPAddress)); } @@ -389,13 +390,13 @@ ORTEDomainCreate(int domain, ORTEDomainProp *prop, //reuseaddr sock_setsockopt(&d->taskRecvMulticastUserdata.sock, SOL_SOCKET, - SO_REUSEADDR, (char*)&reuse, sizeof(reuse)); + SO_REUSEADDR, (const char *)&reuse, sizeof(reuse)); debug(30,2) ("ORTEDomainCreate: set value SO_REUSEADDR: %u\n", reuse); //multicast loop sock_setsockopt(&d->taskRecvMulticastUserdata.sock, IPPROTO_IP, - IP_MULTICAST_LOOP, &d->domainProp.multicast.loopBackEnabled, + IP_MULTICAST_LOOP, (const char *)&d->domainProp.multicast.loopBackEnabled, sizeof(d->domainProp.multicast.loopBackEnabled)); debug(30,2) ("ORTEDomainCreate: set value IP_MULTICAST_LOOP: %u\n", d->domainProp.multicast.loopBackEnabled); @@ -416,8 +417,7 @@ ORTEDomainCreate(int domain, ORTEDomainProp *prop, d->taskSend.sock.port); if (d->domainProp.multicast.enabled) { //ttl - if(sock_setsockopt(&d->taskSend.sock,IPPROTO_IP,IP_MULTICAST_TTL, - &d->domainProp.multicast.ttl,sizeof(d->domainProp.multicast.ttl))>=0) { + if(sock_setsockopt(&d->taskSend.sock,IPPROTO_IP,IP_MULTICAST_TTL, (const char *)&d->domainProp.multicast.ttl,sizeof(d->domainProp.multicast.ttl))>=0) { debug(30,2) ("ORTEDomainCreate: ttl set on: %u\n", d->domainProp.multicast.ttl); } diff --git a/orte/liborte/ORTEDomainApp.c b/orte/liborte/ORTEDomainApp.c index 565f037..29732be 100644 --- a/orte/liborte/ORTEDomainApp.c +++ b/orte/liborte/ORTEDomainApp.c @@ -78,8 +78,8 @@ ORTEDomainAppSubscriptionPatternAdd(ORTEDomain *d,const char *topic, if (!d) return ORTE_FALSE; pnode=(PatternNode*)MALLOC(sizeof(PatternNode)); - strcpy(pnode->topic,topic); - strcpy(pnode->type,type); + strcpy((char *)pnode->topic,topic); + strcpy((char *)pnode->type,type); pnode->subscriptionCallBack=subscriptionCallBack; pnode->param=param; pthread_rwlock_wrlock(&d->patternEntry.lock); @@ -97,8 +97,8 @@ ORTEDomainAppSubscriptionPatternRemove(ORTEDomain *d,const char *topic, if (!d) return ORTE_FALSE; pthread_rwlock_wrlock(&d->patternEntry.lock); ul_list_for_each(Pattern,&d->patternEntry,pnode) { - if ((strcmp(pnode->topic,topic)==0) && - (strcmp(pnode->type,type)==0)) { + if ((strcmp((const char *)pnode->topic, (const char*)topic)==0) && + (strcmp((const char *)pnode->type, (const char*)type)==0)) { Pattern_delete(&d->patternEntry,pnode); FREE(pnode); return ORTE_TRUE; diff --git a/orte/liborte/ORTEPattern.c b/orte/liborte/ORTEPattern.c index 66872ff..2a145f4 100644 --- a/orte/liborte/ORTEPattern.c +++ b/orte/liborte/ORTEPattern.c @@ -42,7 +42,7 @@ ORTEPatternCheckDefault(const char *topic) { /**********************************************************************************/ Boolean ORTEPatternMatchDefault(const char *topic,const char *pattern,void *param) { - fnmatch(pattern,topic,0); + fnmatch((const char *)pattern, (const char*)topic,0); return ORTE_FALSE; } diff --git a/orte/liborte/ORTEPublication.c b/orte/liborte/ORTEPublication.c index f37cc1b..7aae8cc 100644 --- a/orte/liborte/ORTEPublication.c +++ b/orte/liborte/ORTEPublication.c @@ -71,8 +71,8 @@ ORTEPublicationCreate(ORTEDomain *d,const char *topic,const char *typeName, guid.oid=(d->publications.counter<<8)|OID_PUBLICATION; pp=(ORTEPublProp*)MALLOC(sizeof(ORTEPublProp)); memcpy(pp,&d->domainProp.publPropDefault,sizeof(ORTEPublProp)); - strcpy(pp->topic,topic); - strcpy(pp->typeName,typeName); + strcpy((char *)pp->topic,topic); + strcpy((char *)pp->typeName,typeName); pp->persistence=*persistence; pp->strength=strength; pp->reliabilityOffered=PID_VALUE_RELIABILITY_BEST_EFFORTS | diff --git a/orte/liborte/ORTEPublicationTimer.c b/orte/liborte/ORTEPublicationTimer.c index 5f702c0..957d834 100644 --- a/orte/liborte/ORTEPublicationTimer.c +++ b/orte/liborte/ORTEPublicationTimer.c @@ -43,8 +43,8 @@ PublicationCallBackTimer(ORTEDomain *d,void *vcstWriter) { if (cstWriter->csChangesCountersendQueueSize) { info.status=NEED_DATA; - info.topic=pp->topic; - info.type=pp->typeName; + info.topic=(char*)pp->topic; + info.type=(char*)pp->typeName; info.senderGUID=cstWriter->objectEntryOID->guid; cstWriter->objectEntryOID->sendCallBack(&info, cstWriter->objectEntryOID->instance, diff --git a/orte/liborte/ORTESubscription.c b/orte/liborte/ORTESubscription.c index 7d8a5cd..f5c00b3 100644 --- a/orte/liborte/ORTESubscription.c +++ b/orte/liborte/ORTESubscription.c @@ -71,7 +71,7 @@ ORTESubscriptionCreate(ORTEDomain *d,SubscriptionMode mode,SubscriptionType sTyp mreq.imr_multiaddr.s_addr=htonl(multicastIPAddress); mreq.imr_interface.s_addr=htonl(INADDR_ANY); if(sock_setsockopt(&d->taskRecvMulticastUserdata.sock,IPPROTO_IP, - IP_ADD_MEMBERSHIP,(void *) &mreq, sizeof(mreq))>=0) { + IP_ADD_MEMBERSHIP, (const char *)&mreq, sizeof(mreq))>=0) { debug(33,2) ("ORTESubscriptionCreate: listening to mgroup %s\n", IPAddressToString(multicastIPAddress,sIPAddress)); } @@ -82,8 +82,8 @@ ORTESubscriptionCreate(ORTEDomain *d,SubscriptionMode mode,SubscriptionType sTyp guid.oid=(d->subscriptions.counter<<8)|OID_SUBSCRIPTION; sp=(ORTESubsProp*)MALLOC(sizeof(ORTESubsProp)); memcpy(sp,&d->domainProp.subsPropDefault,sizeof(ORTESubsProp)); - strcpy(sp->topic,topic); - strcpy(sp->typeName,typeName); + strcpy((char *)sp->topic,topic); + strcpy((char *)sp->typeName,typeName); sp->deadline=*deadline; sp->minimumSeparation=*minimumSeparation; sp->multicast=multicastIPAddress; @@ -261,8 +261,8 @@ ORTESubscriptionPull(ORTESubscription *cstReader) { htimerUnicastCommon_get_expire(&cstReader->deadlineTimer))>=0) { memset(&info,0,sizeof(info)); info.status=DEADLINE; - info.topic=sp->topic; - info.type=sp->typeName; + info.topic=(char*)sp->topic; + info.type=(char*)sp->typeName; cstReader->objectEntryOID->recvCallBack(&info, cstReader->objectEntryOID->instance, cstReader->objectEntryOID->callBackParam); diff --git a/orte/liborte/RTPSAck.c b/orte/liborte/RTPSAck.c index 41698d3..7b12a6d 100644 --- a/orte/liborte/RTPSAck.c +++ b/orte/liborte/RTPSAck.c @@ -98,7 +98,7 @@ RTPSAck(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress senderI cdrCodec->rptr-=3; /* flags */ - CDR_get_octet(cdrCodec,&flags); + CDR_get_octet(cdrCodec, (CORBA_octet *)&flags); f_bit=flags & 2; /* move reading possition to begin of submessage */ @@ -109,16 +109,16 @@ RTPSAck(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress senderI cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* readerObjectId */ - CDR_get_ulong(cdrCodec,&roid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&roid); /* writerObjectId */ - CDR_get_ulong(cdrCodec,&woid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&woid); cdrCodec->data_endian=data_endian; /* SeqNumber */ - CDR_get_ulong(cdrCodec,&sn.high); - CDR_get_ulong(cdrCodec,&sn.low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.low); readerGUID.hid=mi->sourceHostId; readerGUID.aid=mi->sourceAppId; diff --git a/orte/liborte/RTPSCSTReaderProc.c b/orte/liborte/RTPSCSTReaderProc.c index 61e030c..185033d 100644 --- a/orte/liborte/RTPSCSTReaderProc.c +++ b/orte/liborte/RTPSCSTReaderProc.c @@ -230,8 +230,8 @@ CSTReaderNewData(CSTRemoteWriter *cstRemoteWriter, max_size); } info.status=NEW_DATA; - info.topic=sp->topic; - info.type=sp->typeName; + info.topic=(char*)sp->topic; + info.type=(char*)sp->typeName; info.senderGUID=csChange->guid; info.localTimeReceived=csChange->localTimeReceived; info.remoteTimePublished=csChange->remoteTimePublished; diff --git a/orte/liborte/RTPSCSTReaderTimer.c b/orte/liborte/RTPSCSTReaderTimer.c index f78e9e2..fc08427 100644 --- a/orte/liborte/RTPSCSTReaderTimer.c +++ b/orte/liborte/RTPSCSTReaderTimer.c @@ -196,8 +196,8 @@ CSTReaderDeadlineTimer(ORTEDomain *d,void *vcstReader) { sp=(ORTESubsProp*)cstReader->objectEntryOID->attributes; memset(&info,0,sizeof(info)); info.status=DEADLINE; - info.topic=sp->topic; - info.type=sp->typeName; + info.topic=(char*)sp->topic; + info.type=(char*)sp->typeName; if (cstReader->objectEntryOID->recvCallBack) { cstReader->objectEntryOID->recvCallBack(&info, cstReader->objectEntryOID->instance, diff --git a/orte/liborte/RTPSGap.c b/orte/liborte/RTPSGap.c index e21f988..f0aebcb 100644 --- a/orte/liborte/RTPSGap.c +++ b/orte/liborte/RTPSGap.c @@ -114,7 +114,7 @@ RTPSGapAdd(CSTRemoteWriter *cstRemoteWriter,GUID_RTPS *guid,SequenceNumber *fsn, lsn=ssn=*sn;bit=0; for(i=0;i0) { @@ -173,23 +173,23 @@ RTPSGap(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress senderI cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* readerObjectId */ - CDR_get_ulong(cdrCodec,&roid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&roid); /* writerObjectId */ - CDR_get_ulong(cdrCodec,&woid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&woid); cdrCodec->data_endian=data_endian; /* firstSeqNumber */ - CDR_get_ulong(cdrCodec,&fsn.high); - CDR_get_ulong(cdrCodec,&fsn.low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&fsn.high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&fsn.low); /* Bitmap - SN */ - CDR_get_ulong(cdrCodec,&sn.high); - CDR_get_ulong(cdrCodec,&sn.low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.low); /* numbits */ - CDR_get_ulong(cdrCodec,&numbits); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&numbits); writerGUID.hid=mi->sourceHostId; writerGUID.aid=mi->sourceAppId; diff --git a/orte/liborte/RTPSHeader.c b/orte/liborte/RTPSHeader.c index c570a0d..d994239 100644 --- a/orte/liborte/RTPSHeader.c +++ b/orte/liborte/RTPSHeader.c @@ -74,32 +74,32 @@ RTPSHeaderCheck(CDR_Codec *cdrCodec,int32_t len,MessageInterpret *mi) { CORBA_octet c; if (len<16) return -1; /* message is too small */ - CDR_get_octet(cdrCodec,&c); + CDR_get_octet(cdrCodec, (CORBA_octet *)&c); if (c!='R') return -2; /* header is invalid */ - CDR_get_octet(cdrCodec,&c); + CDR_get_octet(cdrCodec, (CORBA_octet *)&c); if (c!='T') return -2; - CDR_get_octet(cdrCodec,&c); + CDR_get_octet(cdrCodec, (CORBA_octet *)&c); if (c!='P') return -2; - CDR_get_octet(cdrCodec,&c); + CDR_get_octet(cdrCodec, (CORBA_octet *)&c); if (c!='S') return -2; /* Protocol Version */ - CDR_get_octet(cdrCodec,&mi->sourceVersion.major); - CDR_get_octet(cdrCodec,&mi->sourceVersion.minor); + CDR_get_octet(cdrCodec, (CORBA_octet *)&mi->sourceVersion.major); + CDR_get_octet(cdrCodec, (CORBA_octet *)&mi->sourceVersion.minor); /* Vendor Id */ - CDR_get_octet(cdrCodec,&mi->sourceVendorId.major); - CDR_get_octet(cdrCodec,&mi->sourceVendorId.minor); + CDR_get_octet(cdrCodec, (CORBA_octet *)&mi->sourceVendorId.major); + CDR_get_octet(cdrCodec, (CORBA_octet *)&mi->sourceVendorId.minor); /* next data are sent in big endianing */ data_endian=cdrCodec->data_endian; cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* Host Id */ - CDR_get_ulong(cdrCodec,&mi->sourceHostId); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&mi->sourceHostId); /* App Id */ - CDR_get_ulong(cdrCodec,&mi->sourceAppId); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&mi->sourceAppId); cdrCodec->data_endian=data_endian; diff --git a/orte/liborte/RTPSHeardBeat.c b/orte/liborte/RTPSHeardBeat.c index 7652680..7e59bd3 100644 --- a/orte/liborte/RTPSHeardBeat.c +++ b/orte/liborte/RTPSHeardBeat.c @@ -144,7 +144,7 @@ RTPSHeartBeat(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi) { cdrCodec->rptr-=3; /* flags */ - CDR_get_octet(cdrCodec,&flags); + CDR_get_octet(cdrCodec, (CORBA_octet *)&flags); f_bit=flags & 2; /* move reading possition to begin of submessage */ @@ -155,20 +155,20 @@ RTPSHeartBeat(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi) { cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* readerObjectId */ - CDR_get_ulong(cdrCodec,&roid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&roid); /* writerObjectId */ - CDR_get_ulong(cdrCodec,&woid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&woid); cdrCodec->data_endian=data_endian; /* firstSeqNumber */ - CDR_get_ulong(cdrCodec,&fsn.high); - CDR_get_ulong(cdrCodec,&fsn.low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&fsn.high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&fsn.low); /* lastSeqNumber */ - CDR_get_ulong(cdrCodec,&lsn.high); - CDR_get_ulong(cdrCodec,&lsn.low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&lsn.high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&lsn.low); if (SeqNumberCmp(fsn,lsn)==1) return; // lsn break writerGUID.hid=mi->sourceHostId; diff --git a/orte/liborte/RTPSInfoDST.c b/orte/liborte/RTPSInfoDST.c index 32813c9..f84eb07 100644 --- a/orte/liborte/RTPSInfoDST.c +++ b/orte/liborte/RTPSInfoDST.c @@ -41,12 +41,10 @@ void RTPSInfoDST(CDR_Codec *cdrCodec,MessageInterpret *mi) { cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* Host Id */ - CDR_get_ulong(cdrCodec, - (CORBA_unsigned_long*)&hid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&hid); /* App Id */ - CDR_get_ulong(cdrCodec, - (CORBA_unsigned_long*)&aid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&aid); cdrCodec->data_endian=data_endian; diff --git a/orte/liborte/RTPSInfoREPLY.c b/orte/liborte/RTPSInfoREPLY.c index edbe164..ddb9172 100644 --- a/orte/liborte/RTPSInfoREPLY.c +++ b/orte/liborte/RTPSInfoREPLY.c @@ -69,16 +69,16 @@ RTPSInfoREPLY(CDR_Codec *cdrCodec,MessageInterpret *mi) cdrCodec->rptr-=3; /* flags */ - CDR_get_octet(cdrCodec,&flags); + CDR_get_octet(cdrCodec, (CORBA_octet *)&flags); /* move reading possition to begin of submessage */ cdrCodec->rptr+=2; /* unicastReplyIPAddress */ - CDR_get_ulong(cdrCodec,&ipa); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&ipa); /* unicastReplyPort */ - CDR_get_ulong(cdrCodec,&port); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&port); debug(43,3) ("recv: RTPS InfoREPLY from 0x%x-0x%x\n", mi->sourceHostId,mi->sourceAppId); @@ -90,10 +90,10 @@ RTPSInfoREPLY(CDR_Codec *cdrCodec,MessageInterpret *mi) if (flags & 0x02) { /* multicastReplyIPAddress */ - CDR_get_ulong(cdrCodec,&ipa); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&ipa); /* multicastReplyPort */ - CDR_get_ulong(cdrCodec,&port); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&port); mi->multicastReplyIPAddress=ipa; mi->multicastReplyPort=port; diff --git a/orte/liborte/RTPSInfoSRC.c b/orte/liborte/RTPSInfoSRC.c index 9d0bfb5..14e8880 100644 --- a/orte/liborte/RTPSInfoSRC.c +++ b/orte/liborte/RTPSInfoSRC.c @@ -42,25 +42,25 @@ void RTPSInfoSRC(CDR_Codec *cdrCodec,MessageInterpret *mi) { CDR_Endianness data_endian; /* appIPAddress */ - CDR_get_ulong(cdrCodec,&ipa); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&ipa); /* ProtocolVersion */ - CDR_get_octet(cdrCodec,&protocol.major); - CDR_get_octet(cdrCodec,&protocol.minor); + CDR_get_octet(cdrCodec, (CORBA_octet *)&protocol.major); + CDR_get_octet(cdrCodec, (CORBA_octet *)&protocol.minor); /* Vendor Id */ - CDR_get_octet(cdrCodec,&vid.major); - CDR_get_octet(cdrCodec,&vid.minor); + CDR_get_octet(cdrCodec, (CORBA_octet *)&vid.major); + CDR_get_octet(cdrCodec, (CORBA_octet *)&vid.minor); /* next data are sent in big endianing */ data_endian=cdrCodec->data_endian; cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* HostId */ - CDR_get_ulong(cdrCodec,&hid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&hid); /* AppId */ - CDR_get_ulong(cdrCodec,&aid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&aid); cdrCodec->data_endian=data_endian; diff --git a/orte/liborte/RTPSInfoTS.c b/orte/liborte/RTPSInfoTS.c index ecd9946..18b73a8 100644 --- a/orte/liborte/RTPSInfoTS.c +++ b/orte/liborte/RTPSInfoTS.c @@ -67,7 +67,7 @@ RTPSInfoTS(CDR_Codec *cdrCodec,MessageInterpret *mi) { cdrCodec->rptr-=3; /* flags */ - CDR_get_octet(cdrCodec,&flags); + CDR_get_octet(cdrCodec, (CORBA_octet *)&flags); /* move reading possition to begin of submessage */ cdrCodec->rptr+=2; @@ -80,7 +80,7 @@ RTPSInfoTS(CDR_Codec *cdrCodec,MessageInterpret *mi) { CDR_get_long(cdrCodec,&mi->timestamp.seconds); /* time in seconds / 2^32 */ - CDR_get_ulong(cdrCodec,&mi->timestamp.fraction); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&mi->timestamp.fraction); } else { mi->haveTimestamp=ORTE_FALSE; NTPTIME_ZERO(mi->timestamp); diff --git a/orte/liborte/RTPSIssue.c b/orte/liborte/RTPSIssue.c index eca7a4a..d83132d 100644 --- a/orte/liborte/RTPSIssue.c +++ b/orte/liborte/RTPSIssue.c @@ -83,7 +83,7 @@ RTPSIssue(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress sende cdrCodec->rptr-=3; /* flags */ - CDR_get_octet(cdrCodec,&flags); + CDR_get_octet(cdrCodec, (CORBA_octet *)&flags); /* submessage length */ CDR_get_ushort(cdrCodec,&submsg_len); @@ -93,16 +93,16 @@ RTPSIssue(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress sende cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* readerObjectId */ - CDR_get_ulong(cdrCodec,&roid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&roid); /* writerObjectId */ - CDR_get_ulong(cdrCodec,&woid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&woid); cdrCodec->data_endian=data_endian; /* sn */ - CDR_get_ulong(cdrCodec,&sn.high); - CDR_get_ulong(cdrCodec,&sn.low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.low); /* at this moment is not supported p_bit */ if (flags & 0x02) return; /* p_bit */ diff --git a/orte/liborte/RTPSUtils.c b/orte/liborte/RTPSUtils.c index 8634723..d214640 100644 --- a/orte/liborte/RTPSUtils.c +++ b/orte/liborte/RTPSUtils.c @@ -59,6 +59,6 @@ gavl_cmp_guid(const GUID_RTPS *a, const GUID_RTPS *b) { /**********************************************************************************/ int gavl_cmp_str(const char *const *a,const char *const *b) { - return strcmp(*a,*b); + return strcmp((const char *)*a, (const char*)*b); } diff --git a/orte/liborte/RTPSVar.c b/orte/liborte/RTPSVar.c index 7fe3bdf..9de388b 100644 --- a/orte/liborte/RTPSVar.c +++ b/orte/liborte/RTPSVar.c @@ -313,24 +313,24 @@ NewPublisher(ORTEDomain *d,ObjectEntryOID *op) { if (cstReader->createdByPattern) { ORTESubsProp *sp; sp=(ORTESubsProp*)cstReader->objectEntryOID->attributes; - if ((strcmp(sp->topic,pp->topic)==0) && - (strcmp(sp->typeName,pp->typeName)==0)) + if ((strcmp((const char *)sp->topic, (const char*)pp->topic)==0) && + (strcmp((const char *)sp->typeName, (const char*)pp->typeName)==0)) break; //found } } pthread_rwlock_unlock(&d->subscriptions.lock); if (!cstReader) { //not exists ul_list_for_each(Pattern,&d->patternEntry,pnode) { - if ((fnmatch(pnode->topic,pp->topic,0)==0) && - (fnmatch(pnode->type,pp->typeName,0)==0)) { + if ((fnmatch((const char *)pnode->topic, (const char*)pp->topic,0)==0) && + (fnmatch((const char *)pnode->type, (const char*)pp->typeName,0)==0)) { //pattern matched // free resources pthread_rwlock_unlock(&d->readerPublications.lock); pthread_rwlock_unlock(&d->objectEntry.htimRootLock); pthread_rwlock_unlock(&d->objectEntry.objRootLock); cstReader=pnode->subscriptionCallBack( - pp->topic, - pp->typeName, + (char *)pp->topic, + (char *)pp->typeName, pnode->param); if (cstReader) { cstReader->createdByPattern=ORTE_TRUE; @@ -347,8 +347,8 @@ NewPublisher(ORTEDomain *d,ObjectEntryOID *op) { 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) && + if ((strcmp((const char *)pp->topic, (const char*)sp->topic)==0) && + (strcmp((const char *)pp->typeName, (const char*)sp->typeName)==0) && (pp->typeChecksum==sp->typeChecksum)) { //add Subscription to Publisher (only if private) if (op->privateCreated) { @@ -402,8 +402,8 @@ NewSubscriber(ORTEDomain *d,ObjectEntryOID *os) { 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) && + if ((strcmp((const char *)sp->topic, (const char*)pp->topic)==0) && + (strcmp((const char *)sp->typeName, (const char*)pp->typeName)==0) && (sp->typeChecksum==pp->typeChecksum)) { //add Publication to Subscription (only if private) if (os->privateCreated) { @@ -670,7 +670,7 @@ RTPSVar(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress senderI cdrCodec->rptr-=3; /* flags */ - CDR_get_octet(cdrCodec,&flags); + CDR_get_octet(cdrCodec, (CORBA_octet *)&flags); p_bit=flags & 2; a_bit=flags & 4; h_bit=flags & 8; @@ -683,17 +683,17 @@ RTPSVar(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress senderI cdrCodec->data_endian=FLAG_BIG_ENDIAN; /* readerObjectId */ - CDR_get_ulong(cdrCodec,&roid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&roid); /* writerObjectId */ - CDR_get_ulong(cdrCodec,&woid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&woid); if (h_bit) { /* HostId */ - CDR_get_ulong(cdrCodec,&objectGUID.hid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&objectGUID.hid); /* AppId */ - CDR_get_ulong(cdrCodec,&objectGUID.aid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&objectGUID.aid); } else { objectGUID.hid=mi->sourceHostId; @@ -701,13 +701,13 @@ RTPSVar(ORTEDomain *d,CDR_Codec *cdrCodec,MessageInterpret *mi,IPAddress senderI } /* ObjectId */ - CDR_get_ulong(cdrCodec,&objectGUID.oid); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&objectGUID.oid); cdrCodec->data_endian=data_endian; /* writerSN */ - CDR_get_ulong(cdrCodec,&sn.high); - CDR_get_ulong(cdrCodec,&sn.low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&sn.low); writerGUID.hid=mi->sourceHostId; writerGUID.aid=mi->sourceAppId; diff --git a/orte/liborte/cdr.c b/orte/liborte/cdr.c index f85ca59..37411b5 100644 --- a/orte/liborte/cdr.c +++ b/orte/liborte/cdr.c @@ -337,7 +337,7 @@ CDR_get_string_static(CDR_Codec *codec,CORBA_char **str) { CORBA_unsigned_long len; - if(CDR_get_ulong(codec, &len)==CORBA_FALSE) + if(CDR_get_ulong(codec, (CORBA_unsigned_long *)&len)==CORBA_FALSE) return CORBA_FALSE; if((codec->rptr + len) > codec->buf_len) @@ -355,7 +355,7 @@ CDR_get_string(CDR_Codec *codec, CORBA_char **str) { CORBA_unsigned_long len; - if(CDR_get_ulong(codec, &len)==CORBA_FALSE) + if(CDR_get_ulong(codec, (CORBA_unsigned_long *)&len)==CORBA_FALSE) return(CORBA_FALSE); if(len==0) @@ -380,7 +380,7 @@ CDR_get_string_buff(CDR_Codec *codec, CORBA_char *str) { CORBA_unsigned_long len; - if(CDR_get_ulong(codec, &len)==CORBA_FALSE) + if(CDR_get_ulong(codec, (CORBA_unsigned_long *)&len)==CORBA_FALSE) return(CORBA_FALSE); if(len==0) @@ -400,7 +400,7 @@ CDR_get_string_buff(CDR_Codec *codec, CORBA_char *str) CORBA_boolean CDR_get_seq_begin(CDR_Codec *codec, CORBA_unsigned_long *ul) { - return(CDR_get_ulong(codec, ul)); + return(CDR_get_ulong(codec, (CORBA_unsigned_long *)ul)); } CDR_Codec * diff --git a/orte/liborte/conv.c b/orte/liborte/conv.c index e42c28c..4114f7a 100644 --- a/orte/liborte/conv.c +++ b/orte/liborte/conv.c @@ -53,7 +53,7 @@ getStringPart(char *string,char divChar,int *iterator,char *buff) { if (!dcp) dcp=cp+strlen(cp); tcp=*dcp; //save ending value *dcp=0; //temporary end of string - strcpy(buff,cp); + strcpy((char *)buff,cp); *dcp=tcp; //restore value if (dcp[0]!=0) (*iterator)+=dcp-cp+1;//next value else (*iterator)=len; @@ -76,7 +76,11 @@ IPAddressToString(IPAddress ipAddress,char *buff) { IPAddress StringToIPAddress(const char *string) { IPAddress ipAddress=IPADDRESS_INVALID; +#ifdef CONFIG_ORTE_MINGW + unsigned long inetAddress = inet_addr(string); +#else in_addr_t inetAddress = inet_addr(string); +#endif if(inetAddress!=INADDR_NONE) { ipAddress=ntohl(inetAddress); diff --git a/orte/liborte/objectUtils.c b/orte/liborte/objectUtils.c index 3d2688e..36c835e 100644 --- a/orte/liborte/objectUtils.c +++ b/orte/liborte/objectUtils.c @@ -61,8 +61,8 @@ PublParamsInit(ORTEPublProp *pp) { pp->reliabilityOffered=0; pp->sendQueueSize=1; pp->strength=1; - strcpy(pp->topic,"DefaultTopic"); - strcpy(pp->typeName,""); + strcpy((char *)pp->topic,"DefaultTopic"); + strcpy((char *)pp->typeName,""); pp->typeChecksum=0; //additional params NTPTIME_BUILD(pp->maxBlockTime,30); @@ -82,8 +82,8 @@ SubsParamsInit(ORTESubsProp *sp) { NTPTIME_ZERO(sp->minimumSeparation); sp->recvQueueSize=1; sp->reliabilityRequested=0; - strcpy(sp->topic,"DefaultTopic"); - strcpy(sp->typeName,""); + strcpy((char *)sp->topic,"DefaultTopic"); + strcpy((char *)sp->typeName,""); sp->typeChecksum=0; // s->rcvMessageCallBack=NULL; // s->deadline=NTPTIME_ZERO; @@ -160,8 +160,8 @@ generateEvent(ORTEDomain *d,GUID_RTPS *guid,void *params,Boolean live) { 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.topic=(char*)((ORTEPublProp*)params)->topic; + d->pubInfo.type=(char*)((ORTEPublProp*)params)->typeName; d->pubInfo.objectId=guid->oid; if ((d->domainEvents.onPubRemoteNew) && live) result=d->domainEvents.onPubRemoteNew(&d->appInfo,&d->pubInfo, @@ -178,8 +178,8 @@ generateEvent(ORTEDomain *d,GUID_RTPS *guid,void *params,Boolean live) { 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.topic=(char*)((ORTESubsProp*)params)->topic; + d->subInfo.type=(char*)((ORTESubsProp*)params)->typeName; d->subInfo.objectId=guid->oid; if ((d->domainEvents.onSubRemoteNew) && (live)) result=d->domainEvents.onSubRemoteNew(&d->appInfo,&d->subInfo, diff --git a/orte/liborte/parameter.c b/orte/liborte/parameter.c index 5ea14bf..8964aaa 100644 --- a/orte/liborte/parameter.c +++ b/orte/liborte/parameter.c @@ -37,16 +37,16 @@ parameterPutString(ParameterSequence *ps,int8_t id,int8_t *sstr) { int len; - len=strlen(sstr)+1; + len=strlen((char*)sstr)+1; ps->parameterID=id; ps->parameterLength=len; ps->parameter=NULL; if (MAX_PARAMETER_LOCAL_LENGTHparameter=(int8_t*)MALLOC(len); - strncpy(ps->parameter,sstr,len); + ps->parameter=(u_char*)MALLOC(len); + strncpy((char *)ps->parameter, (const char*)sstr,len); } else { - strncpy(ps->parameterLocal,sstr,len); + strncpy((char *)ps->parameterLocal, (const char*)sstr,len); } } @@ -230,7 +230,7 @@ parameterDecodeCodecToCSChange(CSChange *csChange,CDR_Codec *cdrCodec) /* time in seconds */ CDR_get_long(cdrCodec,&(((NtpTime*)ps->parameterLocal)->seconds)); /* time in seconds / 2^32 */ - CDR_get_ulong(cdrCodec,&(((NtpTime*)ps->parameterLocal)->fraction)); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&(((NtpTime*)ps->parameterLocal)->fraction)); break; //CORBA_unsigned_long case PID_TYPE_CHECKSUM: @@ -245,36 +245,36 @@ parameterDecodeCodecToCSChange(CSChange *csChange,CDR_Codec *cdrCodec) case PID_USERDATA_MULTICAST_IPADDRESS: case PID_METATRAFFIC_UNICAST_PORT: case PID_USERDATA_UNICAST_PORT: - CDR_get_ulong(cdrCodec,(CORBA_unsigned_long*)ps->parameterLocal); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)ps->parameterLocal); break; //VendorId case PID_VENDOR_ID: - CDR_get_octet(cdrCodec,&((VendorId*)ps->parameterLocal)->major); - CDR_get_octet(cdrCodec,&((VendorId*)ps->parameterLocal)->minor); + CDR_get_octet(cdrCodec, (CORBA_octet *)&((VendorId*)ps->parameterLocal)->major); + CDR_get_octet(cdrCodec, (CORBA_octet *)&((VendorId*)ps->parameterLocal)->minor); break; //ProtocolVersion case PID_PROTOCOL_VERSION: - CDR_get_octet(cdrCodec,&((ProtocolVersion*)ps->parameterLocal)->major); - CDR_get_octet(cdrCodec,&((ProtocolVersion*)ps->parameterLocal)->minor); + CDR_get_octet(cdrCodec, (CORBA_octet *)&((ProtocolVersion*)ps->parameterLocal)->major); + CDR_get_octet(cdrCodec, (CORBA_octet *)&((ProtocolVersion*)ps->parameterLocal)->minor); break; //SequenceNumber case PID_VARGAPPS_SEQUENCE_NUMBER_LAST: - CDR_get_ulong(cdrCodec,&((SequenceNumber*)ps->parameterLocal)->high); - CDR_get_ulong(cdrCodec,&((SequenceNumber*)ps->parameterLocal)->low); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&((SequenceNumber*)ps->parameterLocal)->high); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&((SequenceNumber*)ps->parameterLocal)->low); break; //Boolean case PID_EXPECTS_ACK: - CDR_get_octet(cdrCodec,(CORBA_octet*)ps->parameterLocal); + CDR_get_octet(cdrCodec, (CORBA_octet *)ps->parameterLocal); break; //PathName,TypeName case PID_TOPIC: case PID_TYPE_NAME:{ CORBA_unsigned_long len; - CDR_get_ulong(cdrCodec,&len); + CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&len); cdrCodec->rptr-=4; ps->parameterLength=(uint16_t)len; - if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) { + if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) { CDR_get_string(cdrCodec,(CORBA_char**)&ps->parameter); } else { CDR_get_string_buff(cdrCodec,(CORBA_char*)ps->parameterLocal); @@ -585,18 +585,18 @@ parameterUpdatePublication(CSChange *csChange,ORTEPublProp *pp) { break; case PID_TOPIC: if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) - strncpy(pp->topic,ps->parameter,ps->parameterLength); + strncpy((char *)pp->topic, (const char*)ps->parameter,ps->parameterLength); else - strncpy(pp->topic,ps->parameterLocal,ps->parameterLength); + strncpy((char *)pp->topic, (const char*)ps->parameterLocal,ps->parameterLength); 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,ps->parameterLength); + strncpy((char *)pp->typeName, (const char*)ps->parameter,ps->parameterLength); else - strncpy(pp->typeName,ps->parameterLocal,ps->parameterLength); + strncpy((char *)pp->typeName, (const char*)ps->parameterLocal,ps->parameterLength); break; } } @@ -621,18 +621,18 @@ parameterUpdateSubscription(CSChange *csChange,ORTESubsProp *sp) { break; case PID_TOPIC: if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) - strncpy(sp->topic,ps->parameter,ps->parameterLength); + strncpy((char *)sp->topic, (const char*)ps->parameter,ps->parameterLength); else - strncpy(sp->topic,ps->parameterLocal,ps->parameterLength); + strncpy((char *)sp->topic, (const char*)ps->parameterLocal,ps->parameterLength); 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,ps->parameterLength); + strncpy((char *)sp->typeName, (const char*)ps->parameter,ps->parameterLength); else - strncpy(sp->typeName,ps->parameterLocal,ps->parameterLength); + strncpy((char *)sp->typeName, (const char*)ps->parameterLocal,ps->parameterLength); break; case PID_USERDATA_MULTICAST_IPADDRESS: sp->multicast=*(IPAddress*)&ps->parameterLocal; diff --git a/orte/liborte/sock.c b/orte/liborte/sock.c index 062b3eb..76371f4 100644 --- a/orte/liborte/sock.c +++ b/orte/liborte/sock.c @@ -89,7 +89,7 @@ sock_setsockopt(sock_t *sock,int level,int optname,const char *optval, int optle /*********************************************************************/ inline int sock_getsockopt(sock_t *sock,int level,int optname,char *optval, int *optlen) { - if (getsockopt(sock->fd, level, optname,(void *)optval, optlen)) { + if (getsockopt(sock->fd, level, optname,(void *)optval, (socklen_t *)optlen)) { sock_cleanup(sock); return -1; } @@ -120,7 +120,7 @@ sock_bind(sock_t *sock,uint16_t port, IPAddress listen) { #endif &name, #ifndef CONFIG_ORTE_RTL_ONETD - &size + (socklen_t *)&size #else size #endif @@ -139,7 +139,7 @@ sock_recvfrom(sock_t *sock, void *buf, int max_len,struct sockaddr_in *des,int d #ifndef CONFIG_ORTE_RTL_ONETD (struct sockaddr*) #endif - des,&des_len); + des,(socklen_t *)&des_len); } /*********************************************************************/ diff --git a/readme b/readme index 480e9c1..4e6d66a 100644 --- a/readme +++ b/readme @@ -79,6 +79,18 @@ JAVA compilation: make make install + +Another way, how to compile ORTE project is used OMK compilation method. See file readme.makerules about +details of OMK. For standalone compilation (without OCERA), just copy folder orte to other (private) +destination. Run +./switch2standalone +in the root of orte directory. + +Now just type a run +make + +in the root of the ORTE project will be create two direcories, which contains compilation results. + How to start? ------------- diff --git a/todo b/todo index 82b77d4..49b7b61 100644 --- a/todo +++ b/todo @@ -1,9 +1,14 @@ If you are a developper and wants to help, enjoy ! +################################################################ + Release: ORTE0-3-2 Date: 081007 + +same like ORTE0-3-1, :) + ################################################################ Release: ORTE0-3-1 Date: 050916 -same like ORTE0-3-1 +same like ORTE0-3-0 ################################################################ Release: ORTE0-3-0 Date: 050220 -- 2.39.2