зеркало из https://github.com/microsoft/SCXcore.git
173 строки
6.2 KiB
Makefile
173 строки
6.2 KiB
Makefile
# -*- mode: Makefile; -*-
|
||
#--------------------------------------------------------------------------------
|
||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||
#--------------------------------------------------------------------------------
|
||
# 2007-08-23
|
||
#
|
||
# Platform-specific overrides to the general POSIX platform file
|
||
#
|
||
#--------------------------------------------------------------------------------
|
||
|
||
ifeq ($(COMBINED_PACKAGES),1)
|
||
# Reassign SCXOMI directories to any OMI output directory (generic non-SSL use)
|
||
SCXOMI_DEV_ROOT := $(SCXOMI_DIR)/output_openssl_1.0.0
|
||
SCXOMI_INCLUDE := $(SCXOMI_DEV_ROOT)/include
|
||
SCXOMI_LIBS := $(SCXOMI_DEV_ROOT)/lib
|
||
endif
|
||
|
||
# Catchall
|
||
ifeq (,$(PF_DISTRO))
|
||
VERSTRING=UNKNOWN
|
||
PF_DISTRO=UNKNOWN
|
||
PF_MAJOR=UNKNOWN
|
||
PF_MINOR=UNKNOWN
|
||
$(warning "Unmatched version string")
|
||
endif
|
||
|
||
include Makefile.gcc4
|
||
|
||
#================================================================================
|
||
# OpenSSL
|
||
# For ULINUX, on x64 platfomrs we need to build against three versions of OpenSSL: 0.9.8, 1.0.0,1.1.0 and 3.0.0.
|
||
# on x86 platforms we need to build against two versions of OpenSSL: 0.9.8, 1.0.0.
|
||
#================================================================================
|
||
ifeq ($(COMBINED_PACKAGES),1)
|
||
|
||
# Let's figure out the system version of SSL installed (for unit test purposes)
|
||
|
||
OPENSSL_SYSTEM_VERSION_FULL=$(shell openssl version | awk '{print $$2}')
|
||
OPENSSL_SYSTEM_VERSION_098=$(shell echo $(OPENSSL_SYSTEM_VERSION_FULL) | grep -Eq '^0.9.8'; echo $$?)
|
||
OPENSSL_SYSTEM_VERSION_100=$(shell echo $(OPENSSL_SYSTEM_VERSION_FULL) | grep -Eq '^1.0.'; echo $$?)
|
||
OPENSSL_SYSTEM_VERSION_110=$(shell echo $(OPENSSL_SYSTEM_VERSION_FULL) | grep -Eq '^1.1.'; echo $$?)
|
||
OPENSSL_SYSTEM_VERSION_300=$(shell echo $(OPENSSL_SYSTEM_VERSION_FULL) | grep -Eq '^3.0.'; echo $$?)
|
||
|
||
ifeq ($(OPENSSL_SYSTEM_VERSION_098), 0)
|
||
export OPENSSL_SYSTEM_VERSION="0.9.8"
|
||
else
|
||
ifeq ($(OPENSSL_SYSTEM_VERSION_100), 0)
|
||
export OPENSSL_SYSTEM_VERSION="1.0.0"
|
||
else
|
||
ifeq ($(OPENSSL_SYSTEM_VERSION_110), 0)
|
||
export OPENSSL_SYSTEM_VERSION="1.1.0"
|
||
else
|
||
ifeq ($(OPENSSL_SYSTEM_VERSION_300), 0)
|
||
export OPENSSL_SYSTEM_VERSION="3.0.0"
|
||
else
|
||
$(error Unable to determine SSL system version installed!)
|
||
endif
|
||
endif
|
||
endif
|
||
endif
|
||
|
||
displaySSLversion:
|
||
@echo "OpenSSL system full version: $(OPENSSL_SYSTEM_VERSION_FULL)"
|
||
@echo "OpenSSL system full version 098: $(OPENSSL_SYSTEM_VERSION_098)"
|
||
@echo "OpenSSL system full version 100: $(OPENSSL_SYSTEM_VERSION_100)"
|
||
@echo "OpenSSL system full version 110: $(OPENSSL_SYSTEM_VERSION_110)"
|
||
@echo "OpenSSL system full version 300: $(OPENSSL_SYSTEM_VERSION_300)"
|
||
@echo "OpenSSL system version: $(OPENSSL_SYSTEM_VERSION)"
|
||
|
||
# Now define other SSL variables for expansion/directory purposes
|
||
|
||
export OPENSSL098DIR=openssl_0.9.8
|
||
export OPENSSL100DIR=openssl_1.0.0
|
||
export OPENSSL110DIR=openssl_1.1.0
|
||
export OPENSSL300DIR=openssl_3.0.0
|
||
|
||
LINK_OPENSSL098=$(LINK) -L$(INTERMEDIATE_DIR)/$(OPENSSL098DIR) -L$(SCXPAL_TARGET_DIR)
|
||
LINK_OPENSSL100=$(LINK) -L$(INTERMEDIATE_DIR)/$(OPENSSL100DIR) -L$(SCXPAL_TARGET_DIR)
|
||
LINK_OPENSSL110=$(LINK) -L$(INTERMEDIATE_DIR)/$(OPENSSL110DIR) -L$(SCXPAL_TARGET_DIR)
|
||
LINK_OPENSSL300=$(LINK) -L$(INTERMEDIATE_DIR)/$(OPENSSL300DIR) -L$(SCXPAL_TARGET_DIR)
|
||
|
||
LD_LIBRARY_PATH_OPENSSL098=$(OPENSSL098_LIBDIR)
|
||
PKG_CONFIG_PATH_OPENSSL098=$(OPENSSL098_LIBDIR)/pkgconfig
|
||
LD_LIBRARY_PATH_OPENSSL100=$(OPENSSL100_LIBDIR)
|
||
PKG_CONFIG_PATH_OPENSSL100=$(OPENSSL100_LIBDIR)/pkgconfig
|
||
LD_LIBRARY_PATH_OPENSSL110=$(OPENSSL110_LIBDIR)
|
||
PKG_CONFIG_PATH_OPENSSL110=$(OPENSSL110_LIBDIR)/pkgconfig
|
||
LD_LIBRARY_PATH_OPENSSL300=$(OPENSSL300_LIBDIR)
|
||
PKG_CONFIG_PATH_OPENSSL300=$(OPENSSL300_LIBDIR)/pkgconfig
|
||
|
||
endif
|
||
|
||
#--------------------------------------------------------------------------------
|
||
# Paths
|
||
#--------------------------------------------------------------------------------
|
||
|
||
# Path to where the CPPUNIT libraries are checked in
|
||
CPPUNIT_LIB_PATH=$(SCX_SHARED_TST_EXT_LIB_DIR)/linux/$(ARCH)/cppunit
|
||
|
||
#--------------------------------------------------------------------------------
|
||
# Tools on this platform
|
||
#--------------------------------------------------------------------------------
|
||
|
||
# Link a dynamic lib
|
||
LINK_DYNLIB=g++ -shared -Wl,-rpath=/opt/microsoft/scx/lib -Wl,-rpath=/opt/omi/lib
|
||
ifeq ($(PF_ARCH),x86)
|
||
LINK_DYNLIB+= -m32
|
||
else
|
||
LINK_DYNLIB+= -m64
|
||
endif
|
||
LINK_DYNLIB+= -L$(INTERMEDIATE_DIR) -L$(SCXPAL_TARGET_DIR)
|
||
|
||
#--------------------------------------------------------------------------------
|
||
# Link switches for this platform, per target
|
||
#--------------------------------------------------------------------------------
|
||
|
||
LDFLAGS_RPM = -lrpm -lpopt
|
||
LDFLAGS_DYNLIB = -ldl -lpthread -lcrypt -lrt
|
||
LDFLAGS_EXECUTABLE = -ldl -lpthread -lrt
|
||
|
||
ifneq ($(COMBINED_PACKAGES),1)
|
||
LDFLAGS_DYNLIB += $(LDFLAGS_RPM)
|
||
LDFLAGS_EXECUTABLE += $(LDFLAGS_RPM)
|
||
endif
|
||
|
||
ifeq ($(PF_DISTRO),SUSE)
|
||
ifeq ($(PF_MAJOR),9)
|
||
else
|
||
LDFLAGS_EXECUTABLE += -pie
|
||
endif
|
||
endif
|
||
|
||
# The Core Provider Module links with these
|
||
LDFLAGS_COREPROVIDERMODULE = $(LDFLAGS_DYNLIB)
|
||
|
||
# The Test Provider Module links with these
|
||
LDFLAGS_TESTPROVIDERMODULE = $(LDFLAGS_DYNLIB)
|
||
|
||
# Test Provider specific link flags. Used to hide symbols
|
||
TESTPROVIDERMODULE_EXTRA_LINKFLAGS=-Wl,--version-script=$(INTERMEDIATE_DIR)/testprovider.map
|
||
|
||
# The testrunner links with these
|
||
LDFLAGS_TESTRUNNER = $(LDFLAGS_EXECUTABLE)
|
||
|
||
# Transforms a list of symbols that should be exposed to the correct link flags
|
||
get_ld_flags_for_retaining_symbols=$(addprefix -u, $(1))
|
||
|
||
# Run pkg-config to get ssl library switches for this platform
|
||
SSL_LIBS = `pkg-config --libs openssl`
|
||
|
||
#--------------------------------------------------------------------------------
|
||
# Compiler switch tweaks
|
||
#--------------------------------------------------------------------------------
|
||
|
||
# C++ 11 for IBM atomic support
|
||
ifeq ($(ARCH),ppc)
|
||
CXXFLAGS += -std=c++11 -D=linux
|
||
endif
|
||
|
||
#--------------------------------------------------------------------------------
|
||
# InstallBuilder datafile determination
|
||
#--------------------------------------------------------------------------------
|
||
|
||
PF_DEPENDENT_DATAFILES = Linux.data
|
||
|
||
ifeq ("$(wildcard /usr/bin/dpkg-deb)","")
|
||
PF_DEPENDENT_DATAFILES += Linux_RPM.data
|
||
else
|
||
PF_DEPENDENT_DATAFILES += Linux_DPKG.data
|
||
endif
|
||
|
||
#-------------------------------- End of File -----------------------------------
|