diff --git a/common/Makefile b/common/Makefile index a590616eaab728084925a52de74fd502c8f694d5..663d212839189e54f45771218d04d5233c0bb0e4 100644 --- a/common/Makefile +++ b/common/Makefile @@ -36,7 +36,7 @@ GENERATED_SOURCES := pattern_la.cc pattern_p.cc pattern_uni.cc config_preproc_la # Sources in the CVS STATIC_SOURCES := memory.c new.cc userinfo.c path.c config_preproc.cc Quadruple.cc \ - Path2.cc ModuleVersion.cc JSON_Tokenizer.cc UnicharPattern.cc + Path2.cc ModuleVersion.cc JSON_Tokenizer.cc UnicharPattern.cc openssl_version.c ifndef MINGW STATIC_SOURCES += NetworkHandler.cc diff --git a/common/license.c b/common/license.c index eb476e9a9830bdb865d6ffdf149683f92d7c7cc2..7aa9efb2c63707c1d35a5031e749eaea67b60617 100644 --- a/common/license.c +++ b/common/license.c @@ -489,10 +489,6 @@ void free_openssl() ERR_free_strings(); } -const char * openssl_version_str(void) { - return SSLeay_version(SSLEAY_VERSION); -} - #if defined(WIN32) || defined(INTERIX) #ifdef INTERIX diff --git a/common/license.h b/common/license.h index 32d015199880e88e28975525d21af119f0496b62..13d648f5d1cb426ef7aaf34c431c2e1046931443 100644 --- a/common/license.h +++ b/common/license.h @@ -150,8 +150,6 @@ void print_license_info(void); void init_openssl(void); void free_openssl(void); -const char * openssl_version_str(void); - #if defined(WIN32) || defined(INTERIX) long gethostid(void); #endif diff --git a/common/openssl_version.c b/common/openssl_version.c new file mode 100644 index 0000000000000000000000000000000000000000..7542c0fe0b41912fdda995be8400e11f2f5399e9 --- /dev/null +++ b/common/openssl_version.c @@ -0,0 +1,18 @@ +/****************************************************************************** + * Copyright (c) 2000-2016 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Szabo, Bence Janos + * + ******************************************************************************/ + +#include "openssl_version.h" +#include <openssl/crypto.h> + +const char * openssl_version_str(void) { + return SSLeay_version(SSLEAY_VERSION); +} diff --git a/common/openssl_version.h b/common/openssl_version.h new file mode 100644 index 0000000000000000000000000000000000000000..9a98a573a2b50cf4f4065fddcbb3c6f4ecde47da --- /dev/null +++ b/common/openssl_version.h @@ -0,0 +1,25 @@ +/****************************************************************************** + * Copyright (c) 2000-2016 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Szabo, Bence Janos + * + ******************************************************************************/ +#ifndef OPENSSL_VERSION_H +#define OPENSSL_VERSION_H + +#ifdef __cplusplus +extern "C" { +#endif + +const char * openssl_version_str(void); + +#ifdef __cplusplus +} +#endif + +#endif // OPENSSL_VERSION_H diff --git a/compiler2/Makefile b/compiler2/Makefile index 28190b3d33e8f87cb06a8e3729b505d07aa368f2..dcf2ca5f863a228b1370a713ff4a6acd53beaf7c 100644 --- a/compiler2/Makefile +++ b/compiler2/Makefile @@ -111,8 +111,10 @@ COMMON_OBJECTS := $(addprefix ../common/, memory.o path.o userinfo.o) TCOV2LCOV_COMMON_OBJECTS := ../common/memory.o -COMMON_OBJECTS += ../common/license.o -TCOV2LCOV_COMMON_OBJECTS += ../common/license.o +ifeq ($(LICENSING), yes) + COMMON_OBJECTS += ../common/license.o + TCOV2LCOV_COMMON_OBJECTS += ../common/license.o +endif ifdef REGEX_DIR COMMON_OBJECTS += $(REGEX_DIR)/lib/regex.o @@ -120,7 +122,7 @@ endif COMPILER_COMMON_OBJECTS := $(COMMON_OBJECTS) \ $(addprefix ../common/, new.o pattern_la.o pattern_p.o pattern_uni.o Quadruple.o \ -ModuleVersion.o JSON_Tokenizer.o UnicharPattern.o) +ModuleVersion.o JSON_Tokenizer.o UnicharPattern.o openssl_version.o) ifeq ($(USAGE_STATS), yes) COMPILER_COMMON_OBJECTS += ../common/usage_stats.o diff --git a/compiler2/main.cc b/compiler2/main.cc index 93d7c465ee259723f3d7e84930329b9956aef0f0..c7eaa508adfbf72fb767bc1be0fc280f584c428a 100644 --- a/compiler2/main.cc +++ b/compiler2/main.cc @@ -69,9 +69,11 @@ #include "ttcn3/profiler.h" +#include "../common/openssl_version.h" +#ifdef LICENSE #include "../common/license.h" - +#endif using namespace Common; @@ -922,8 +924,7 @@ int main(int argc, char *argv[]) "Compiled with: " C_COMPILER_VERSION "\n", stderr); fputs("Using ", stderr); fputs(openssl_version_str(), stderr); - fputs("\n\n", stderr); - fputs(COPYRIGHT_STRING "\n\n", stderr); + fputs("\n\n" COPYRIGHT_STRING "\n\n", stderr); #ifdef LICENSE print_license_info(); fputs("\n\n", stderr); diff --git a/mctr2/mctr/Makefile b/mctr2/mctr/Makefile index e49f8be38c5258f545334061a5f90f776d9b6bd5..4de56af22c2051e244b5ea39cc4c75ea3ade8da1 100644 --- a/mctr2/mctr/Makefile +++ b/mctr2/mctr/Makefile @@ -55,7 +55,7 @@ OBJECTS_NOMAIN := $(filter-out Cli_main.o, $(OBJECTS)) COMMON_OBJECTS := $(addprefix ../../common/, memory.o config_preproc.o \ config_preproc_la.o config_preproc_p.tab.o path.o NetworkHandler.o \ -Path2.o) ../../core/RInt.o ../../core/Textbuf.o +Path2.o openssl_version.o) ../../core/RInt.o ../../core/Textbuf.o ifeq ($(LICENSING), yes) COMMON_OBJECTS += ../../common/license.o diff --git a/mctr2/mctr/main.cc b/mctr2/mctr/main.cc index 83a9e1dd19578cad0bff901f85291b157cae54f5..5cfe7d910afffe9c59f1680492083b4ef8257916 100644 --- a/mctr2/mctr/main.cc +++ b/mctr2/mctr/main.cc @@ -49,6 +49,8 @@ #include "../../common/license.h" #endif +#include "../../common/openssl_version.h" + #include "MainController.h" #if defined CLI @@ -273,12 +275,12 @@ int main(int argc, char *argv[]) " for the TTCN-3 Test Executor\n" "Product number: " PRODUCT_NUMBER "\n" "Build date: " __DATE__ " " __TIME__ "\n" - "Compiled with: " C_COMPILER_VERSION "\n\n" - COPYRIGHT_STRING "\n\n", stderr); + "Compiled with: " C_COMPILER_VERSION "\n", stderr); + fputs("Using ", stderr); + fputs(openssl_version_str(), stderr); + fputs("\n\n" COPYRIGHT_STRING "\n\n", stderr); #ifdef LICENSE print_license_info(); - fputs("\nUsing ", stderr); - fputs(openssl_version_str(), stderr); fputs("\n\n", stderr); #endif return 0;