diff --git a/configure.ac b/configure.ac index ae41fbdc433..e2f86dfee6e 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,14 @@ AC_C_BIGENDIAN( AC_MSG_ERROR(universial endianess not supported) ) +# OpenSSL +AX_CHECK_OPENSSL(ac_openssl_found=yes, + ac_openssl_found=no) + +AS_IF([test "$ac_openssl_found" = yes], + AC_DEFINE([TLS_FOUND], [1], [Defined if TLS support is enable]), + AC_DEFINE([TLS_FOUND], [0], [Defined if TLS support is enable])) + # Security AC_ARG_ENABLE([security], AS_HELP_STRING([--enable-security], [Enables security support]), @@ -64,11 +72,10 @@ AC_ARG_ENABLE([security], ac_enable_security=no ) AS_IF([test "$ac_enable_security" = yes], - [ - AC_DEFINE([HAVE_SECURITY], [1], [Defined if security support is enable]) - AX_CHECK_OPENSSL([AC_MSG_NOTICE([Found OpenSSL])], [AC_MSG_ERROR([Could not find OpenSSL])]) - ], - [AC_DEFINE([HAVE_SECURITY], [0], [Defined if security support is enable])]) + AS_IF([test "$ac_openssl_found" = yes], + AC_DEFINE([HAVE_SECURITY], [1], [Defined if security support is enable]), + AC_MSG_ERROR([To support security you need OpenSSL libraries])), + AC_DEFINE([HAVE_SECURITY], [0], [Defined if security support is enable])) AM_CONDITIONAL(SECURITY, test $ac_enable_security = yes) # Check for libraries used in the main build process diff --git a/examples/C++/ClientServerTest/Makefile b/examples/C++/ClientServerTest/Makefile index 10f2a29d88a..95e006366ae 100644 --- a/examples/C++/ClientServerTest/Makefile +++ b/examples/C++/ClientServerTest/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/Configurability/Makefile b/examples/C++/Configurability/Makefile index f45a1b634f6..6906e41fd13 100644 --- a/examples/C++/Configurability/Makefile +++ b/examples/C++/Configurability/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/DeadlineQoSExample/Makefile b/examples/C++/DeadlineQoSExample/Makefile index c847c3fe948..544f7673fd2 100644 --- a/examples/C++/DeadlineQoSExample/Makefile +++ b/examples/C++/DeadlineQoSExample/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I../../../thirdparty/asio/asio/include -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir @@ -42,15 +42,14 @@ all: $(DIRECTORIES) DeadlineQoSExample DEADLINEQOSEXAMPLE_TARGET= bin/DeadlineQoSExample -DEADLINEQOSEXAMPLE_SRC_CXXFILES= +DEADLINEQOSEXAMPLE_SRC_CXXFILES= DeadlineQoSExample/deadlinepayload.cxx \ + DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx \ + DeadlineQoSExample/deadlinepayloadPublisher.cxx \ + DeadlineQoSExample/deadlinepayloadSubscriber.cxx \ + DeadlineQoSExample/deadlinepayloadPubSubMain.cxx -DEADLINEQOSEXAMPLE_SRC_CPPFILES= DeadlineQoSExample/deadlinepayload.cxx \ - DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx \ - DeadlineQoSExample/deadlinepayloadPublisher.cxx \ - DeadlineQoSExample/deadlinepayloadSubscriber.cxx \ - DeadlineQoSExample/deadlinepayloadPubSubMain.cxx \ - DeadlineQoSExample/deadlineQoS.cxx +DEADLINEQOSEXAMPLE_SRC_CPPFILES= # Project sources are copied to the current directory DEADLINEQOSEXAMPLE_SRCS= $(DEADLINEQOSEXAMPLE_SRC_CXXFILES) $(DEADLINEQOSEXAMPLE_SRC_CPPFILES) diff --git a/examples/C++/DisablePositiveACKs/Makefile b/examples/C++/DisablePositiveACKs/Makefile new file mode 100644 index 00000000000..5e99f701a1b --- /dev/null +++ b/examples/C++/DisablePositiveACKs/Makefile @@ -0,0 +1,103 @@ +# Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CPP=g++ +LN=g++ +AR=ar +CP=cp +SYSLIBS= -ldl -lnsl -lm -lpthread -lrt +DEFINES= +COMMON_CFLAGS= -c -Wall -D__LITTLE_ENDIAN__ -std=c++11 + +## CHOOSE HERE BETWEEN 32 and 64 bit architecture + +##32 BIT ARCH: +#COMMON_CFLAGS+= -m32 -fpic +#LDFLAGS=-m32 + +#64BIT ARCH: +COMMON_CFLAGS+= -m64 -fpic +LDFLAGS=-m64 + +CFLAGS = $(COMMON_CFLAGS) -O2 + +INCLUDES= -I../../../thirdparty/asio/asio/include + +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) + +DIRECTORIES= output.dir bin.dir + +all: $(DIRECTORIES) DisablePositiveACKs + +DISABLEPOSITIVEACKSEXAMPLE_TARGET= bin/DisablePositiveACKs + +DISABLEPOSITIVEACKSEXAMPLE_SRC_CXXFILES= \ +DisablePositiveACKs/Topic.cxx \ +DisablePositiveACKs/TopicTypes.cxx + +DISABLEPOSITIVEACKSEXAMPLE_SRC_CPPFILES= \ +DisablePositiveACKs/DisablePositiveACKsPublisher.cpp \ +DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp \ +DisablePositiveACKs/DisablePositiveACKS_main.cpp + + +# Project sources are copied to the current directory +DISABLEPOSITIVEACKSEXAMPLE_SRCS= $(DISABLEPOSITIVEACKSEXAMPLE_SRC_CXXFILES) $(DISABLEPOSITIVEACKSEXAMPLE_SRC_CPPFILES) + +# Source directories +DISABLEPOSITIVEACKSEXAMPLE_SOURCES_DIRS_AUX= $(foreach srcdir, $(dir $(DISABLEPOSITIVEACKSEXAMPLE_SRCS)), $(srcdir)) +DISABLEPOSITIVEACKSEXAMPLE_SOURCES_DIRS= $(shell echo $(DISABLEPOSITIVEACKSEXAMPLE_SOURCES_DIRS_AUX) | tr " " "\n" | sort | uniq | tr "\n" " ") + +DISABLEPOSITIVEACKSEXAMPLE_OBJS = $(foreach obj,$(notdir $(addsuffix .o, $(DISABLEPOSITIVEACKSEXAMPLE_SRCS))), output/$(obj)) +DISABLEPOSITIVEACKSEXAMPLE_DEPS = $(foreach dep,$(notdir $(addsuffix .d, $(DISABLEPOSITIVEACKSEXAMPLE_SRCS))), output/$(dep)) + +OBJS+= $(DISABLEPOSITIVEACKSEXAMPLE_OBJS) +DEPS+= $(DISABLEPOSITIVEACKSEXAMPLE_DEPS) + +DisablePositiveACKs: $(DISABLEPOSITIVEACKSEXAMPLE_TARGET) + +$(DISABLEPOSITIVEACKSEXAMPLE_TARGET): $(DISABLEPOSITIVEACKSEXAMPLE_OBJS) + $(LN) $(LDFLAGS) -o $(DISABLEPOSITIVEACKSEXAMPLE_TARGET) $(DISABLEPOSITIVEACKSEXAMPLE_OBJS) $(LIBS) + +vpath %.cxx $(DISABLEPOSITIVEACKSEXAMPLE_SOURCES_DIRS) +vpath %.cpp $(DISABLEPOSITIVEACKSEXAMPLE_SOURCES_DIRS) + +output/%.cxx.o:%.cxx + @echo Calculating dependencies $< + @$(CC) $(CFLAGS) -MM $(CFLAGS) $(INCLUDES) $< | sed "s/^.*:/output\/&/g" > $(@:%.cxx.o=%.cxx.d) + @echo Compiling $< + @$(CC) $(CFLAGS) $(INCLUDES) $< -o $@ + +output/%.cpp.o:%.cpp + @echo Calculating dependencies $< + @$(CPP) $(CFLAGS) -MM $(CFLAGS) $(INCLUDES) $< | sed "s/^.*:/output\/&/g" > $(@:%.cpp.o=%.cpp.d) + @echo Compiling $< + @$(CPP) $(CFLAGS) $(INCLUDES) $< -o $@ + +.PHONY: DisablePositiveACKs + +clean: + @rm -f $(OBJS) + @rm -f $(DEPS) + +ifneq ($(MAKECMDGOALS), clean) +-include $(DEPS) +endif + +%.dir : + @echo "Checking directory $*" + @if [ ! -d $* ]; then \ + echo "Making directory $*"; \ + mkdir -p $* ; \ + fi; diff --git a/examples/C++/DynamicHelloWorldExample/Makefile b/examples/C++/DynamicHelloWorldExample/Makefile new file mode 100644 index 00000000000..ca2d5485e02 --- /dev/null +++ b/examples/C++/DynamicHelloWorldExample/Makefile @@ -0,0 +1,100 @@ +# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CPP=g++ +LN=g++ +AR=ar +CP=cp +SYSLIBS= -ldl -lnsl -lm -lpthread -lrt +DEFINES= +COMMON_CFLAGS= -c -Wall -D__LITTLE_ENDIAN__ -std=c++11 + +## CHOOSE HERE BETWEEN 32 and 64 bit architecture + +##32 BIT ARCH: +#COMMON_CFLAGS+= -m32 -fpic +#LDFLAGS=-m32 + +#64BIT ARCH: +COMMON_CFLAGS+= -m64 -fpic +LDFLAGS=-m64 + +CFLAGS = $(COMMON_CFLAGS) -O2 + +INCLUDES= -I../../../thirdparty/asio/asio/include + +LIBS = -lfastrtps -lfastcdr $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) + +DIRECTORIES= output.dir bin.dir + +all: $(DIRECTORIES) DynamicHelloWorldExample + +DYNAMICEXAMPLE_TARGET= bin/DynamicHelloWorldExample + +DYNAMICEXAMPLE_SRC_CXXFILES= + +DYNAMICEXAMPLE_SRC_CPPFILES= \ + DynamicHelloWorldExample/HelloWorldPublisher.cpp \ + DynamicHelloWorldExample/HelloWorldSubscriber.cpp \ + DynamicHelloWorldExample/HelloWorld_main.cpp + +# Project sources are copied to the current directory +DYNAMICEXAMPLE_SRCS= $(DYNAMICEXAMPLE_SRC_CXXFILES) $(DYNAMICEXAMPLE_SRC_CPPFILES) + +# Source directories +DYNAMICEXAMPLE_SOURCES_DIRS_AUX= $(foreach srcdir, $(dir $(DYNAMICEXAMPLE_SRCS)), $(srcdir)) +DYNAMICEXAMPLE_SOURCES_DIRS= $(shell echo $(DYNAMICEXAMPLE_SOURCES_DIRS_AUX) | tr " " "\n" | sort | uniq | tr "\n" " ") + +DYNAMICEXAMPLE_OBJS = $(foreach obj,$(notdir $(addsuffix .o, $(DYNAMICEXAMPLE_SRCS))), output/$(obj)) +DYNAMICEXAMPLE_DEPS = $(foreach dep,$(notdir $(addsuffix .d, $(DYNAMICEXAMPLE_SRCS))), output/$(dep)) + +OBJS+= $(DYNAMICEXAMPLE_OBJS) +DEPS+= $(DYNAMICEXAMPLE_DEPS) + +DynamicHelloWorldExample: $(DYNAMICEXAMPLE_TARGET) + +$(DYNAMICEXAMPLE_TARGET): $(DYNAMICEXAMPLE_OBJS) + $(LN) $(LDFLAGS) -o $(DYNAMICEXAMPLE_TARGET) $(DYNAMICEXAMPLE_OBJS) $(LIBS) + +vpath %.cxx $(DYNAMICEXAMPLE_SOURCES_DIRS) +vpath %.cpp $(DYNAMICEXAMPLE_SOURCES_DIRS) + +output/%.cxx.o:%.cxx + @echo Calculating dependencies $< + @$(CC) $(CFLAGS) -MM $(CFLAGS) $(INCLUDES) $< | sed "s/^.*:/output\/&/g" > $(@:%.cxx.o=%.cxx.d) + @echo Compiling $< + @$(CC) $(CFLAGS) $(INCLUDES) $< -o $@ + +output/%.cpp.o:%.cpp + @echo Calculating dependencies $< + @$(CPP) $(CFLAGS) -MM $(CFLAGS) $(INCLUDES) $< | sed "s/^.*:/output\/&/g" > $(@:%.cpp.o=%.cpp.d) + @echo Compiling $< + @$(CPP) $(CFLAGS) $(INCLUDES) $< -o $@ + +.PHONY: DynamicHelloWorldExample + +clean: + @rm -f $(OBJS) + @rm -f $(DEPS) + +ifneq ($(MAKECMDGOALS), clean) +-include $(DEPS) +endif + +%.dir : + @echo "Checking directory $*" + @if [ ! -d $* ]; then \ + echo "Making directory $*"; \ + mkdir -p $* ; \ + fi; diff --git a/examples/C++/Filtering/Makefile b/examples/C++/Filtering/Makefile index 790cd5d0403..85e2194327b 100644 --- a/examples/C++/Filtering/Makefile +++ b/examples/C++/Filtering/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/FlowControlExample/Makefile b/examples/C++/FlowControlExample/Makefile index ee44958e740..98be4917a31 100644 --- a/examples/C++/FlowControlExample/Makefile +++ b/examples/C++/FlowControlExample/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/HelloWorldExample/Makefile b/examples/C++/HelloWorldExample/Makefile index 9f9ec9ddbf7..615002f781d 100644 --- a/examples/C++/HelloWorldExample/Makefile +++ b/examples/C++/HelloWorldExample/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/HelloWorldExampleTCP/Makefile b/examples/C++/HelloWorldExampleTCP/Makefile index c9be5753faf..5ff7ed979d0 100644 --- a/examples/C++/HelloWorldExampleTCP/Makefile +++ b/examples/C++/HelloWorldExampleTCP/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/HistoryKind/Makefile b/examples/C++/HistoryKind/Makefile index 6059be7fc4f..8bc6cbbaaf8 100644 --- a/examples/C++/HistoryKind/Makefile +++ b/examples/C++/HistoryKind/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/Keys/Makefile b/examples/C++/Keys/Makefile index a5995920ea1..3736874806c 100644 --- a/examples/C++/Keys/Makefile +++ b/examples/C++/Keys/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/LateJoiners/Makefile b/examples/C++/LateJoiners/Makefile index bc10002d366..4d2de45372f 100644 --- a/examples/C++/LateJoiners/Makefile +++ b/examples/C++/LateJoiners/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/LifespanQoSExample/Makefile b/examples/C++/LifespanQoSExample/Makefile new file mode 100644 index 00000000000..853010a2ded --- /dev/null +++ b/examples/C++/LifespanQoSExample/Makefile @@ -0,0 +1,102 @@ +# Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CPP=g++ +LN=g++ +AR=ar +CP=cp +SYSLIBS= -ldl -lnsl -lm -lpthread -lrt +DEFINES= +COMMON_CFLAGS= -c -Wall -D__LITTLE_ENDIAN__ -std=c++11 + +## CHOOSE HERE BETWEEN 32 and 64 bit architecture + +##32 BIT ARCH: +#COMMON_CFLAGS+= -m32 -fpic +#LDFLAGS=-m32 + +#64BIT ARCH: +COMMON_CFLAGS+= -m64 -fpic +LDFLAGS=-m64 + +CFLAGS = $(COMMON_CFLAGS) -O2 + +INCLUDES= -I../../../thirdparty/asio/asio/include + +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) + +DIRECTORIES= output.dir bin.dir + +all: $(DIRECTORIES) LifespanQoSExample + +LIFESPANEXAMPLE_TARGET= bin/LifespanQoSExample + +LIFESPANEXAMPLE_SRC_CXXFILES= \ + LifespanQoSExample/Lifespan.cxx \ + LifespanQoSExample/LifespanTypes.cxx + +LIFESPANEXAMPLE_SRC_CPPFILES= \ +LifespanQoSExample/LifespanPublisher.cpp \ +LifespanQoSExample/LifespanSubscriber.cpp \ +LifespanQoSExample/Lifespan_main.cpp + +# Project sources are copied to the current directory +LIFESPANEXAMPLE_SRCS= $(LIFESPANEXAMPLE_SRC_CXXFILES) $(LIFESPANEXAMPLE_SRC_CPPFILES) + +# Source directories +LIFESPANEXAMPLE_SOURCES_DIRS_AUX= $(foreach srcdir, $(dir $(LIFESPANEXAMPLE_SRCS)), $(srcdir)) +LIFESPANEXAMPLE_SOURCES_DIRS= $(shell echo $(LIFESPANEXAMPLE_SOURCES_DIRS_AUX) | tr " " "\n" | sort | uniq | tr "\n" " ") + +LIFESPANEXAMPLE_OBJS = $(foreach obj,$(notdir $(addsuffix .o, $(LIFESPANEXAMPLE_SRCS))), output/$(obj)) +LIFESPANEXAMPLE_DEPS = $(foreach dep,$(notdir $(addsuffix .d, $(LIFESPANEXAMPLE_SRCS))), output/$(dep)) + +OBJS+= $(LIFESPANEXAMPLE_OBJS) +DEPS+= $(LIFESPANEXAMPLE_DEPS) + +LifespanQoSExample: $(LIFESPANEXAMPLE_TARGET) + +$(LIFESPANEXAMPLE_TARGET): $(LIFESPANEXAMPLE_OBJS) + $(LN) $(LDFLAGS) -o $(LIFESPANEXAMPLE_TARGET) $(LIFESPANEXAMPLE_OBJS) $(LIBS) + +vpath %.cxx $(LIFESPANEXAMPLE_SOURCES_DIRS) +vpath %.cpp $(LIFESPANEXAMPLE_SOURCES_DIRS) + +output/%.cxx.o:%.cxx + @echo Calculating dependencies $< + @$(CC) $(CFLAGS) -MM $(CFLAGS) $(INCLUDES) $< | sed "s/^.*:/output\/&/g" > $(@:%.cxx.o=%.cxx.d) + @echo Compiling $< + @$(CC) $(CFLAGS) $(INCLUDES) $< -o $@ + +output/%.cpp.o:%.cpp + @echo Calculating dependencies $< + @$(CPP) $(CFLAGS) -MM $(CFLAGS) $(INCLUDES) $< | sed "s/^.*:/output\/&/g" > $(@:%.cpp.o=%.cpp.d) + @echo Compiling $< + @$(CPP) $(CFLAGS) $(INCLUDES) $< -o $@ + +.PHONY: LifespanQoSExample + +clean: + @rm -f $(OBJS) + @rm -f $(DEPS) + +ifneq ($(MAKECMDGOALS), clean) +-include $(DEPS) +endif + +%.dir : + @echo "Checking directory $*" + @if [ ! -d $* ]; then \ + echo "Making directory $*"; \ + mkdir -p $* ; \ + fi; diff --git a/examples/C++/OwnershipStrengthQoSExample/Makefile b/examples/C++/OwnershipStrengthQoSExample/Makefile index da797adb704..7b04865df5b 100644 --- a/examples/C++/OwnershipStrengthQoSExample/Makefile +++ b/examples/C++/OwnershipStrengthQoSExample/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/RTPSTest_as_socket/Makefile b/examples/C++/RTPSTest_as_socket/Makefile index be265dd505f..156d03bc1ec 100644 --- a/examples/C++/RTPSTest_as_socket/Makefile +++ b/examples/C++/RTPSTest_as_socket/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/RTPSTest_registered/Makefile b/examples/C++/RTPSTest_registered/Makefile index cd36e226de9..35c15221df4 100644 --- a/examples/C++/RTPSTest_registered/Makefile +++ b/examples/C++/RTPSTest_registered/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/SampleConfig_Controller/Makefile b/examples/C++/SampleConfig_Controller/Makefile index 15ef0d13924..1d5c79ab249 100644 --- a/examples/C++/SampleConfig_Controller/Makefile +++ b/examples/C++/SampleConfig_Controller/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/SampleConfig_Events/Makefile b/examples/C++/SampleConfig_Events/Makefile index be68b64ccee..13f9c2b3985 100644 --- a/examples/C++/SampleConfig_Events/Makefile +++ b/examples/C++/SampleConfig_Events/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/SampleConfig_Multimedia/Makefile b/examples/C++/SampleConfig_Multimedia/Makefile index eea1e884bc7..98cce992ab0 100644 --- a/examples/C++/SampleConfig_Multimedia/Makefile +++ b/examples/C++/SampleConfig_Multimedia/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/SecureHelloWorldExample/Makefile b/examples/C++/SecureHelloWorldExample/Makefile index 824023a01e8..bc3c7eb4355 100644 --- a/examples/C++/SecureHelloWorldExample/Makefile +++ b/examples/C++/SecureHelloWorldExample/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps -lcrypto -lssl $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/StaticHelloWorldExample/Makefile b/examples/C++/StaticHelloWorldExample/Makefile index abb450ade6e..bf309132ed7 100644 --- a/examples/C++/StaticHelloWorldExample/Makefile +++ b/examples/C++/StaticHelloWorldExample/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/UserDefinedTransportExample/Makefile b/examples/C++/UserDefinedTransportExample/Makefile index d5a2a6d45ba..4963774a04d 100644 --- a/examples/C++/UserDefinedTransportExample/Makefile +++ b/examples/C++/UserDefinedTransportExample/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/examples/C++/XMLProfiles/Makefile b/examples/C++/XMLProfiles/Makefile index 053dac0a7ca..ce2055ddc43 100644 --- a/examples/C++/XMLProfiles/Makefile +++ b/examples/C++/XMLProfiles/Makefile @@ -34,7 +34,7 @@ CFLAGS = $(COMMON_CFLAGS) -O2 INCLUDES= -I. -LIBS = -lfastcdr -lfastrtps $(SYSLIBS) +LIBS = -lfastcdr -lfastrtps $(shell test -x "$$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) $(SYSLIBS) DIRECTORIES= output.dir bin.dir diff --git a/fastrtpsgen/src/main/java/com/eprosima/fastrtps/idl/templates/makefile.stg b/fastrtpsgen/src/main/java/com/eprosima/fastrtps/idl/templates/makefile.stg index 6f2dbc85148..ccad6f692f4 100644 --- a/fastrtpsgen/src/main/java/com/eprosima/fastrtps/idl/templates/makefile.stg +++ b/fastrtpsgen/src/main/java/com/eprosima/fastrtps/idl/templates/makefile.stg @@ -25,7 +25,7 @@ DEFINES= $solution.defines : {define | -D$define$};separator=" "$ INCLUDES= -I. $solution.includes : {include | -I$include$};separator=" "$ -LIBS = $solution.libraryPaths : {path |-L$path$};separator=" "$ $solution.libraries : {library |-l$library$};separator=" "$ \$(SYSLIBS) +LIBS = $solution.libraryPaths : {path |-L$path$};separator=" "$ $solution.libraries : {library |-l$library$};separator=" "$ \$(shell test -x "\$\$(which pkg-config)" && pkg-config libssl libcrypto --libs --silence-errors) \$(SYSLIBS) DIRECTORIES= output.dir output/$example$.dir lib.dir lib/$example$.dir bin.dir bin/$example$.dir diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 61ae93b2e6d..95a35332bbf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,6 +34,10 @@ if(EPROSIMA_BUILD_TESTS AND IS_TOP_LEVEL AND NOT EPROSIMA_INSTALLER) add_subdirectory(blackbox) add_subdirectory(communication) add_subdirectory(unittest) + + if(UNIX AND NOT APPLE) + add_subdirectory(realtime) + endif() endif() ############################################################################### @@ -52,7 +56,3 @@ endif() if(PERFORMANCE_TESTS) add_subdirectory(performance) endif() - -if(UNIX AND NOT APPLE) - add_subdirectory(realtime) -endif()