-# 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
# 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 <somedir>/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,<error message>)
+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,<dir name>)
+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,<pass name>,<build dir>,<subdir>)
+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,<subdir>)
+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,<pass name>,<build dir>,[<local make flags>],[<local enable condition>])
+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,<include dir>,<keyword>)
+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
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)
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
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)
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 $<
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
# Syntax: $(call COMPILE_c_o_template,<source>,<target>,<additional c-flags>)
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" ; \
# Syntax: $(call COMPILE_cc_o_template,<source>,<target>,<additional c-flags>)
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" ; \
# Syntax: $(call COMPILE_S_o_template,<source>,<target>,<additional c-flags>)
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
$(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) $$< \
# Syntax: $(call PROGRAM_template,<dir>,<executable-name>,<executable-suffix>,<linker-sript>)
+# FIXME: ???????? asi je tu blbej komentar
define PROGRAM_template
USER_IDLS += $$($(1)_SERVER_IDL) $$($(1)_CLIENT_IDL) $$($(1)_IDL)
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
$(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
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
# 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))))
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
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)
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; \
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; \
# };@\
# #endif@\
# " | tr @ \\n >$$@
-
+
#$(eval $(call COMPILE_c_o_kern_template,$(1).mod.c,$(1).mod.o,-DKBUILD_MODNAME=$(1)))
@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
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
#=====================================================================
+# 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" ] ; \
-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
$(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
$(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
$(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 \
@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,<stamp_dir>,<header_file_path>,<list_of_options_to_export>,<header_barrier>)
+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,<qt-subdir>)
+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:
* Pharlap ports
Virgil Ansems <virgil.ansems@imtech.nl>
- * IMTECH, used the ORTE in different projects
\ No newline at end of file
+ * IMTECH, used the ORTE in different projects
+
+Tran Duy Khanh <trandk1@fel.cvut.cz>
+ * code cleaing, removed warings under gcc 4.x
# 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
-/****************************************************************************
-** 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 <stdio.h>
-#include <stdlib.h>
-#include <qtimer.h>
-#include <qapplication.h>
-#if (QT_VERSION-0 >= 0x040000)
-#include <QCloseEvent>
-#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;
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) {
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();
}
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;
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
boxType.rectangle.bottom_right_x=rect.right();
boxType.rectangle.bottom_right_y=rect.bottom();
ORTEPublicationSend(publisher);
- a->unlock();
}
ORTEPublProp pp;
if (!publisher) return;
- a->lock();
ORTEPublicationPropertiesGet(publisher,&pp);
pp.strength=slider->value();
ORTEPublicationPropertiesSet(publisher,&pp);
- a->unlock();
}
+
--- /dev/null
+#ifndef FPUBLISHER_H
+#define FPUBLISHER_H
+
+#include <QDialog>
+#include <QLabel>
+#include <QTimer>
+#include <QCloseEvent>
+#include "ui_FPublisher.h"
+#include "BoxType.h"
+
+#include <orte.h>
+
+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
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>FPublisher</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>FPublisher</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>389</width>
- <height>256</height>
- </rect>
- </property>
- <property name="caption">
- <string>Publisher</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
+<ui version="4.0" >
+ <class>FPublisher</class>
+ <widget class="QWidget" name="FPublisher" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>389</width>
+ <height>256</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Publisher</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="MyQFrame" native="1" name="view" />
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QSplitter" name="splitter2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QLabel" name="strengt" >
+ <property name="text" >
+ <string>Strength:</string>
</property>
- <widget class="MyQFrame">
- <property name="name">
- <cstring>view</cstring>
- </property>
- <property name="paletteBackgroundColor">
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- </property>
- </widget>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout33</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QSplitter">
- <property name="name">
- <cstring>splitter2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>strengt</cstring>
- </property>
- <property name="text">
- <string>Strength:</string>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>46</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </widget>
- <widget class="QSlider">
- <property name="name">
- <cstring>slider</cstring>
- </property>
- <property name="minValue">
- <number>1</number>
- </property>
- <property name="maxValue">
- <number>5</number>
- </property>
- <property name="pageStep">
- <number>1</number>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="tickmarks">
- <enum>NoMarks</enum>
- </property>
- <property name="tickInterval">
- <number>1</number>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer4</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>122</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </hbox>
- </widget>
- </vbox>
-</widget>
-<customwidgets>
- <customwidget>
- <class>MyQFrame</class>
- <header location="global">MyQFrame.h</header>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- <pixmap>image0</pixmap>
- </customwidget>
-</customwidgets>
-<images>
- <image name="image0">
- <data format="XPM.GZ" length="45">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f</data>
- </image>
-</images>
-<connections>
- <connection>
- <sender>slider</sender>
- <signal>valueChanged(int)</signal>
- <receiver>FPublisher</receiver>
- <slot>strengthChanged()</slot>
- </connection>
-</connections>
-<includes>
- <include location="global" impldecl="in declaration">orte.h</include>
- <include location="local" impldecl="in declaration">BoxType.h</include>
- <include location="local" impldecl="in implementation">FPublisher.ui.h</include>
-</includes>
-<variables>
- <variable>int strength;</variable>
- <variable>ORTEPublication *publisher;</variable>
- <variable>ORTEDomain *domain;</variable>
- <variable access="public">QTimer *timer;</variable>
- <variable>int color;</variable>
- <variable>int stepx;</variable>
- <variable>int stepy;</variable>
- <variable>int incx;</variable>
- <variable>int incy;</variable>
- <variable>int shape;</variable>
- <variable>BoxType boxType;</variable>
- <variable>QRect rect;</variable>
-</variables>
-<slots>
- <slot access="protected">init()</slot>
- <slot access="protected">closeEvent( QCloseEvent * e )</slot>
- <slot>destroy()</slot>
- <slot access="protected">Timer()</slot>
- <slot access="protected">strengthChanged()</slot>
-</slots>
-<functions>
- <function>initPublisher( int icolor, int istrength )</function>
-</functions>
-<pixmapinproject/>
-<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>myqframe.h</includehint>
-</includehints>
-</UI>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="slider" >
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="maximum" >
+ <number>5</number>
+ </property>
+ <property name="pageStep" >
+ <number>1</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickInterval" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>122</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <customwidgets>
+ <customwidget>
+ <class>MyQFrame</class>
+ <extends>QWidget</extends>
+ <header location="global" >MyQFrame.h</header>
+ </customwidget>
+ </customwidgets>
+ <includes>
+ <include location="global" >orte.h</include>
+ <include location="local" >BoxType.h</include>
+ <include location="local" >MyQFrame.h</include>
+ </includes>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>slider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>FPublisher</receiver>
+ <slot>strengthChanged()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
-/****************************************************************************
-** 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 <stdio.h>
-#include <qtimer.h>
-#include <qapplication.h>
-#if (QT_VERSION-0 >= 0x040000)
-#include <QCloseEvent>
-#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();
}
if (domain) {
ORTEDomainAppDestroy(domain);
domain=NULL;
+ close();
}
}
FSubscriber *s=(FSubscriber*)recvCallBackParam;
QRect rect;
- a->lock();
switch (info->status) {
case NEW_DATA:
rect.setCoords(
s->view->deactivateObject(CL_YELLOW);
break;
}
- a->unlock();
}
recvCallBack,
this,
IPADDRESS_INVALID);
- combo->insertItem("Blue",combo->count());
+ combo->addItem("Blue");
}
if (iGreen) {
subscriberGreen=ORTESubscriptionCreate(
recvCallBack,
this,
IPADDRESS_INVALID);
- combo->insertItem("Green",combo->count());
+ combo->addItem("Green");
}
if (iRed) {
subscriberRed=ORTESubscriptionCreate(
recvCallBack,
this,
IPADDRESS_INVALID);
- combo->insertItem("Red",combo->count());
+ combo->addItem("Red");
}
if (iBlack) {
subscriberBlack=ORTESubscriptionCreate(
recvCallBack,
this,
IPADDRESS_INVALID);
- combo->insertItem("Black",combo->count());
+ combo->addItem("Black");
}
if (iYellow) {
subscriberYellow=ORTESubscriptionCreate(
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"))
slider->setValue(msBlack.seconds);
if (combo->currentText()==QString("Yellow"))
slider->setValue(msYellow.seconds);
- a->unlock();
}
NtpTime minSep;
ORTESubsProp sp;
- a->lock();
NtpTimeAssembFromMs(minSep, value, 0);
if (combo->currentText()==QString("Blue")) {
msBlue=minSep;
sp.minimumSeparation=msYellow;
ORTESubscriptionPropertiesSet(subscriberYellow,&sp);
}
- a->unlock();
}
+
--- /dev/null
+#ifndef FSUBSCRIBER_H
+#define FSUBSCRIBER_H
+
+#include <QDialog>
+#include <QLabel>
+#include <QCloseEvent>
+#include "ui_FSubscriber.h"
+#include "BoxType.h"
+
+#include <orte.h>
+
+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
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>FSubscriber</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>FSubscriber</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>389</width>
- <height>331</height>
- </rect>
- </property>
- <property name="caption">
- <string>Subscriber</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="MyQFrame" row="0" column="0" rowspan="1" colspan="3">
- <property name="name">
- <cstring>view</cstring>
- </property>
- <property name="paletteBackgroundColor">
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- </property>
- </widget>
- <widget class="QSplitter" row="1" column="0">
- <property name="name">
- <cstring>splitter2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>Color:</string>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer3_2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </widget>
- <widget class="QSplitter" row="2" column="0">
- <property name="name">
- <cstring>splitter3</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>strengt</cstring>
- </property>
- <property name="text">
- <string>Min. Separation:</string>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>21</height>
- </size>
- </property>
- </spacer>
- </widget>
- <widget class="QComboBox" row="1" column="1">
- <property name="name">
- <cstring>combo</cstring>
- </property>
- </widget>
- <widget class="QSlider" row="2" column="1">
- <property name="name">
- <cstring>slider</cstring>
- </property>
- <property name="minValue">
- <number>0</number>
- </property>
- <property name="maxValue">
- <number>4</number>
- </property>
- <property name="pageStep">
- <number>1</number>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="tickmarks">
- <enum>NoMarks</enum>
- </property>
- <property name="tickInterval">
- <number>1</number>
- </property>
- </widget>
- <spacer row="1" column="2">
- <property name="name">
- <cstring>spacer4_2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>110</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <spacer row="2" column="2">
- <property name="name">
- <cstring>spacer4</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>100</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </grid>
-</widget>
-<customwidgets>
- <customwidget>
- <class>MyQFrame</class>
- <header location="global">MyQFrame.h</header>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- <pixmap>image0</pixmap>
- </customwidget>
-</customwidgets>
-<images>
- <image name="image0">
- <data format="XPM.GZ" length="45">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f</data>
- </image>
-</images>
-<connections>
- <connection>
- <sender>combo</sender>
- <signal>activated(int)</signal>
- <receiver>FSubscriber</receiver>
- <slot>comboActivated(int)</slot>
- </connection>
- <connection>
- <sender>slider</sender>
- <signal>valueChanged(int)</signal>
- <receiver>FSubscriber</receiver>
- <slot>sliderValueChanged(int)</slot>
- </connection>
-</connections>
-<includes>
- <include location="global" impldecl="in declaration">orte.h</include>
- <include location="local" impldecl="in declaration">BoxType.h</include>
- <include location="local" impldecl="in implementation">FSubscriber.ui.h</include>
-</includes>
-<variables>
- <variable access="public">BoxType boxTypeYellow;</variable>
- <variable access="public">BoxType boxTypeBlack;</variable>
- <variable access="public">BoxType boxTypeRed;</variable>
- <variable access="public">BoxType boxTypeBlue;</variable>
- <variable access="public">BoxType boxTypeGreen;</variable>
- <variable access="public">ORTEDomain *domain;</variable>
- <variable>ORTESubscription *subscriberGreen;</variable>
- <variable>ORTESubscription *subscriberBlue;</variable>
- <variable>ORTESubscription *subscriberRed;</variable>
- <variable>ORTESubscription *subscriberBlack;</variable>
- <variable>ORTESubscription *subscriberYellow;</variable>
- <variable>NtpTime msGreen;</variable>
- <variable>NtpTime msBlue;</variable>
- <variable>NtpTime msRed;</variable>
- <variable>NtpTime msBlack;</variable>
- <variable>NtpTime msYellow;</variable>
-</variables>
-<slots>
- <slot access="protected">init()</slot>
- <slot access="protected">closeEvent( QCloseEvent * e )</slot>
- <slot>destroy()</slot>
- <slot>comboActivated( int )</slot>
- <slot>sliderValueChanged( int value )</slot>
-</slots>
-<functions>
- <function>initSubscribers( int iBlue, int iGreen, int iRed, int iBlack, int iYellow )</function>
-</functions>
-<pixmapinproject/>
-<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>myqframe.h</includehint>
-</includehints>
-</UI>
+<ui version="4.0" >
+ <class>FSubscriber</class>
+ <widget class="QWidget" name="FSubscriber" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>389</width>
+ <height>331</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Subscriber</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" colspan="3" >
+ <widget class="MyQFrame" native="1" name="view" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QSplitter" name="splitter2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QLabel" name="textLabel1" >
+ <property name="text" >
+ <string>Color:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QSplitter" name="splitter3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QLabel" name="strengt" >
+ <property name="text" >
+ <string>Min. Separation:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="combo" />
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSlider" name="slider" >
+ <property name="minimum" >
+ <number>0</number>
+ </property>
+ <property name="maximum" >
+ <number>4</number>
+ </property>
+ <property name="pageStep" >
+ <number>1</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickInterval" >
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>110</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>100</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <customwidgets>
+ <customwidget>
+ <class>MyQFrame</class>
+ <extends>QWidget</extends>
+ <header location="global" >MyQFrame.h</header>
+ </customwidget>
+ </customwidgets>
+ <includes>
+ <include location="global" >orte.h</include>
+ <include location="local" >BoxType.h</include>
+ <include location="local" >MyQFrame.h</include>
+ </includes>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>FSubscriber</receiver>
+ <slot>comboActivated(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>slider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>FSubscriber</receiver>
+ <slot>sliderValueChanged(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+#include <QMessageBox>
+#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();
+}
--- /dev/null
+#ifndef MAINFORM_H
+#define MAINFORM_H
+
+#include <QDialog>
+
+#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
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>MainForm</class>
-<widget class="QDialog">
- <property name="name">
- <cstring>MainForm</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>447</width>
- <height>308</height>
- </rect>
- </property>
- <property name="minimumSize">
+<ui version="4.0" >
+ <class>MainForm</class>
+ <widget class="QDialog" name="MainForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>599</width>
+ <height>434</height>
+ </rect>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>447</width>
+ <height>307</height>
+ </size>
+ </property>
+ <property name="windowTitle" >
+ <string>ORTE demo application</string>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel1" >
+ <property name="maximumSize" >
<size>
- <width>447</width>
- <height>307</height>
+ <width>16777215</width>
+ <height>40</height>
</size>
- </property>
- <property name="caption">
- <string>ORTE demo application</string>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
+ </property>
+ <property name="font" >
+ <font>
+ <pointsize>18</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string><p align="center">Publishers</p></string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="publGroup" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Colors</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ <property name="flat" >
+ <bool>false</bool>
+ </property>
+ <property name="checkable" >
+ <bool>false</bool>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ <widget class="QWidget" name="layoutWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>81</width>
+ <height>221</height>
+ </rect>
</property>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout18</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="font">
- <font>
- <pointsize>18</pointsize>
- <bold>1</bold>
- </font>
- </property>
- <property name="text">
- <string><p align="center">Publishers</p></string>
- </property>
- </widget>
- <widget class="QButtonGroup">
- <property name="name">
- <cstring>publGroup</cstring>
- </property>
- <property name="title">
- <string>Colors</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLayoutWidget" row="0" column="0">
- <property name="name">
- <cstring>layout11</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton2_2</cstring>
- </property>
- <property name="text">
- <string>Blue</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton2_3</cstring>
- </property>
- <property name="text">
- <string>Green</string>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton2_4</cstring>
- </property>
- <property name="text">
- <string>Red</string>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton1</cstring>
- </property>
- <property name="text">
- <string>Black</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>radioButton2</cstring>
- </property>
- <property name="text">
- <string>Yellow</string>
- </property>
- </widget>
- </vbox>
- </widget>
- </grid>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer9</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- <widget class="QPushButton">
- <property name="name">
- <cstring>pubAdd</cstring>
- </property>
- <property name="text">
- <string>Add</string>
- </property>
- </widget>
- <widget class="QPushButton">
- <property name="name">
- <cstring>pubSource</cstring>
- </property>
- <property name="text">
- <string>View Source</string>
- </property>
- </widget>
- </vbox>
+ <layout class="QVBoxLayout" >
+ <property name="spacing" >
+ <number>-1</number>
+ </property>
+ <item>
+ <widget class="QRadioButton" name="radioButton2_2" >
+ <property name="text" >
+ <string>Blue</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton2_3" >
+ <property name="text" >
+ <string>Green</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton2_4" >
+ <property name="text" >
+ <string>Red</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton1" >
+ <property name="text" >
+ <string>Black</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton2" >
+ <property name="text" >
+ <string>Yellow</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pubAdd" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pubSource" >
+ <property name="text" >
+ <string>View Source</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="pixmapLabel1" >
+ <property name="maximumSize" >
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="pixmap" >
+ <pixmap resource="shapes.qrc" >:/ocera_logo.png</pixmap>
+ </property>
+ <property name="scaledContents" >
+ <bool>false</bool>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
</widget>
+ </item>
+ <item>
<spacer>
- <property name="name">
- <cstring>spacer12_2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>16</width>
- <height>20</height>
- </size>
- </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
</spacer>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout10</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout22</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <spacer>
- <property name="name">
- <cstring>spacer10</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget class="QLabel">
- <property name="name">
- <cstring>pixmapLabel1</cstring>
- </property>
- <property name="maximumSize">
- <size>
- <width>32767</width>
- <height>32767</height>
- </size>
- </property>
- <property name="pixmap">
- <pixmap>ocera_logo.png</pixmap>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer11</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </hbox>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer10_2</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1_3</cstring>
- </property>
- <property name="text">
- <string>Don't forget to run ortemanager!</string>
- </property>
- <property name="alignment">
- <set>AlignCenter</set>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer13_3</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout9</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <spacer>
- <property name="name">
- <cstring>spacer10_3</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>21</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget class="QLabel">
- <property name="name">
- <cstring>pixmapLabel1_2</cstring>
- </property>
- <property name="maximumSize">
- <size>
- <width>32767</width>
- <height>32767</height>
- </size>
- </property>
- <property name="pixmap">
- <pixmap>shapes.png</pixmap>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer11_2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>22</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </hbox>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer13</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout24</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <spacer>
- <property name="name">
- <cstring>spacer14</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget class="QPushButton">
- <property name="name">
- <cstring>About</cstring>
- </property>
- <property name="minimumSize">
- <size>
- <width>120</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>About</string>
- </property>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer15</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </hbox>
- </widget>
- </vbox>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel1_3" >
+ <property name="text" >
+ <string>Don't forget to run ortemanager!</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="pixmapLabel1_2" >
+ <property name="maximumSize" >
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="pixmap" >
+ <pixmap resource="shapes.qrc" >:/shapes.png</pixmap>
+ </property>
+ <property name="scaledContents" >
+ <bool>false</bool>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
</widget>
+ </item>
+ <item>
<spacer>
- <property name="name">
- <cstring>spacer13_2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>16</width>
- <height>20</height>
- </size>
- </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>22</width>
+ <height>20</height>
+ </size>
+ </property>
</spacer>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout19</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1_2</cstring>
- </property>
- <property name="font">
- <font>
- <pointsize>18</pointsize>
- <bold>1</bold>
- </font>
- </property>
- <property name="text">
- <string><p align="center">Subscribers</p></string>
- </property>
- </widget>
- <widget class="QButtonGroup">
- <property name="name">
- <cstring>subGrupColors</cstring>
- </property>
- <property name="title">
- <string>Colors</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLayoutWidget" row="0" column="0">
- <property name="name">
- <cstring>layout12</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>clBlue</cstring>
- </property>
- <property name="text">
- <string>Blue</string>
- </property>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>clGreen</cstring>
- </property>
- <property name="text">
- <string>Green</string>
- </property>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>clRed</cstring>
- </property>
- <property name="text">
- <string>Red</string>
- </property>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>clBlack</cstring>
- </property>
- <property name="text">
- <string>Black</string>
- </property>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>clYellow</cstring>
- </property>
- <property name="text">
- <string>Yellow</string>
- </property>
- </widget>
- </vbox>
- </widget>
- </grid>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer12</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- <widget class="QPushButton">
- <property name="name">
- <cstring>subAdd</cstring>
- </property>
- <property name="text">
- <string>Add</string>
- </property>
- </widget>
- <widget class="QPushButton">
- <property name="name">
- <cstring>subSource</cstring>
- </property>
- <property name="text">
- <string>View Source</string>
- </property>
- </widget>
- </vbox>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="About" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>About</string>
+ </property>
</widget>
- </hbox>
-</widget>
-<connections>
- <connection>
- <sender>About</sender>
- <signal>clicked()</signal>
- <receiver>MainForm</receiver>
- <slot>about()</slot>
- </connection>
- <connection>
- <sender>subSource</sender>
- <signal>clicked()</signal>
- <receiver>MainForm</receiver>
- <slot>viewSubsSource()</slot>
- </connection>
- <connection>
- <sender>pubAdd</sender>
- <signal>clicked()</signal>
- <receiver>MainForm</receiver>
- <slot>addPublisher()</slot>
- </connection>
- <connection>
- <sender>pubSource</sender>
- <signal>clicked()</signal>
- <receiver>MainForm</receiver>
- <slot>viewPublSource()</slot>
- </connection>
- <connection>
- <sender>subAdd</sender>
- <signal>clicked()</signal>
- <receiver>MainForm</receiver>
- <slot>addSubscriber()</slot>
- </connection>
-</connections>
-<tabstops>
- <tabstop>radioButton1</tabstop>
- <tabstop>radioButton2</tabstop>
- <tabstop>pubAdd</tabstop>
- <tabstop>pubSource</tabstop>
- <tabstop>subAdd</tabstop>
- <tabstop>subSource</tabstop>
- <tabstop>clBlue</tabstop>
- <tabstop>clGreen</tabstop>
- <tabstop>radioButton2_2</tabstop>
- <tabstop>radioButton2_3</tabstop>
- <tabstop>radioButton2_4</tabstop>
- <tabstop>About</tabstop>
- <tabstop>clRed</tabstop>
- <tabstop>clBlack</tabstop>
- <tabstop>clYellow</tabstop>
-</tabstops>
-<includes>
- <include location="local" impldecl="in implementation">MainForm.ui.h</include>
-</includes>
-<signals>
- <signal>sigClose()</signal>
-</signals>
-<slots>
- <slot>addPublisher()</slot>
- <slot>addSubscriber()</slot>
- <slot>about()</slot>
- <slot>viewPublSource()</slot>
- <slot>viewSubsSource()</slot>
- <slot access="protected">closeEvent( QCloseEvent * e )</slot>
-</slots>
-<pixmapinproject/>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel1_2" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font" >
+ <font>
+ <pointsize>18</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string><p align="center">Subscribers</p></string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="subGrupColors" >
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>170</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Colors</string>
+ </property>
+ <widget class="QWidget" name="layoutWidget_2" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>141</width>
+ <height>251</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="clBlue" >
+ <property name="text" >
+ <string>Blue</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="clGreen" >
+ <property name="text" >
+ <string>Green</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="clRed" >
+ <property name="text" >
+ <string>Red</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="clBlack" >
+ <property name="text" >
+ <string>Black</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="clYellow" >
+ <property name="text" >
+ <string>Yellow</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="subAdd" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="subSource" >
+ <property name="text" >
+ <string>View Source</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <tabstops>
+ <tabstop>pubAdd</tabstop>
+ <tabstop>pubSource</tabstop>
+ <tabstop>subAdd</tabstop>
+ <tabstop>subSource</tabstop>
+ <tabstop>About</tabstop>
+ </tabstops>
+ <resources>
+ <include location="shapes.qrc" />
+ </resources>
+ <connections>
+ <connection>
+ <sender>About</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>about()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>subSource</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>viewSubsSource()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pubAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>addPublisher()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pubSource</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>viewPublSource()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>subAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>addSubscriber()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
+++ /dev/null
-/****************************************************************************
-** 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 <qmessagebox.h>
-#include <qapplication.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "FPublisher.h"
-#include "FSubscriber.h"
-#include "richtext.h"
-#if (QT_VERSION-0 >= 0x040000)
-#include <QCloseEvent>
-#include <QPixmap>
-#include <q3ptrlist.h>
-#else
-#include <qptrlist.h>
-#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();
-}
clean:
rm -f Makefile.qmake
- rm -fd .ui
+ rm -fr .ui
+ rm -fr .moc
+ rm -fr .obj
+ rm -f ortedemo
****************************************************************/
#include "MyQFrame.h"
-#if (QT_VERSION-0 >= 0x040000)
#include <QPolygon>
#include <QMouseEvent>
#include <QPaintEvent>
-#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;
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());
{
Q_OBJECT
public:
- MyQFrame( QWidget *parent=0, const char *name=0 );
+ MyQFrame( QWidget *parent=0);
protected:
void mouseMoveEvent(QMouseEvent *e);
-#include <qapplication.h>
-#if (QT_VERSION-0 >= 0x040000)
-#include <QPixmap>
-#endif
+#include <QApplication>
+
#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();
}
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
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
/****************************************************************************
-** $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.
**
**
*****************************************************************************/
-#include <qpushbutton.h>
#include <qbrush.h>
#include <qapplication.h>
-#include <qglobal.h>
-
-#if (QT_VERSION-0 >= 0x040000)
-#include <q3hbox.h>
-#include <q3textview.h>
-#else
-#include <qhbox.h>
-#include <qtextview.h>
-#endif
#include "richtext.h"
};
-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() ) );
/****************************************************************************
-** $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.
**
#define RICHTEXT_H
#include <qglobal.h>
+#include <QPushButton>
+#include <QTextBrowser>
+#include <QWidget>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
-#if (QT_VERSION-0 >= 0x040000)
-#define QVBox Q3VBox
-#define QHBox Q3HBox
-#define QTextView Q3TextView
-#include <q3vbox.h>
-#else
-#include <qvbox.h>
-#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;
--- /dev/null
+<RCC>
+ <qresource prefix="/" >
+ <file>ocera_logo.png</file>
+ <file>shapes.png</file>
+ <file>marble.png</file>
+ <file>FMainIcon.png</file>
+ <file>FPublisherIcon.png</file>
+ <file>FSubscriberIcon.png</file>
+ </qresource>
+</RCC>
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,
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)
{
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");
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 $
***************************************************************************/
#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). */
#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). */
#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). */
/* 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
#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
#ifndef __GETOPT_H__ //mingw
#include <win32/getopt.h>
#endif
- #include <win32/timeval.h>
+ #ifndef HAVE_TIMEVAL_H
+ #include <win32/timeval.h>
+ #endif
#include <orte/ew_types.h>
#define ioctl ioctlsocket
#elif defined CONFIG_ORTE_RTL
#include <win32/timeval.h>
#include <win32/getopt.h>
#define ioctl ioctlsocket
- #define ORTE_PACKAGE_STRING "orte 0.3.0"
+ #define ORTE_PACKAGE_STRING "orte 0.3.2"
#define CONFIG_ORTE_WIN
#endif
/* 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 */
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);
}
}
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);
}
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);
}
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);
}
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);
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
//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
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);
//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);
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));
}
//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);
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));
}
//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);
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);
}
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);
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;
/**********************************************************************************/
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;
}
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 |
if (cstWriter->csChangesCounter<pp->sendQueueSize) {
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,
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));
}
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;
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);
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 */
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;
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;
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,
lsn=ssn=*sn;bit=0;
for(i=0;i<numbits;i++) {
if ((i%32)==0)
- CDR_get_ulong(cdrCodec,&bitmap);
+ CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&bitmap);
bit=(bitmap & (1<<(31-i%32))) ? 1:0;
if (i>0) {
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;
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;
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 */
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<fsn -> break
writerGUID.hid=mi->sourceHostId;
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;
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);
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;
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;
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;
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);
cdrCodec->rptr-=3;
/* flags */
- CDR_get_octet(cdrCodec,&flags);
+ CDR_get_octet(cdrCodec, (CORBA_octet *)&flags);
/* submessage length */
CDR_get_ushort(cdrCodec,&submsg_len);
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 */
/**********************************************************************************/
int
gavl_cmp_str(const char *const *a,const char *const *b) {
- return strcmp(*a,*b);
+ return strcmp((const char *)*a, (const char*)*b);
}
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;
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) {
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) {
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;
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;
}
/* 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;
{
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)
{
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)
{
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)
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 *
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;
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);
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);
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;
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,
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,
{
int len;
- len=strlen(sstr)+1;
+ len=strlen((char*)sstr)+1;
ps->parameterID=id;
ps->parameterLength=len;
ps->parameter=NULL;
if (MAX_PARAMETER_LOCAL_LENGTH<len) {
- ps->parameter=(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);
}
}
/* 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:
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);
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;
}
}
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;
/*********************************************************************/
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;
}
#endif
&name,
#ifndef CONFIG_ORTE_RTL_ONETD
- &size
+ (socklen_t *)&size
#else
size
#endif
#ifndef CONFIG_ORTE_RTL_ONETD
(struct sockaddr*)
#endif
- des,&des_len);
+ des,(socklen_t *)&des_len);
}
/*********************************************************************/
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?
-------------
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