1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance 9# with the License. You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, 14# software distributed under the License is distributed on an 15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16# KIND, either express or implied. See the License for the 17# specific language governing permissions and limitations 18# under the License. 19# 20#************************************************************** 21 22 23 24PRJ=. 25 26PRJNAME=openssl 27TARGET=openssl 28 29# --- Settings ----------------------------------------------------- 30 31.INCLUDE : settings.mk 32 33# --- Files -------------------------------------------------------- 34 35.IF "$(SYSTEM_OPENSSL)" == "YES" 36@all: 37 @echo "Using system openssl...." 38.ENDIF 39 40 41OPENSSL_NAME=openssl-3.0.13 42 43TARFILE_NAME=$(OPENSSL_NAME) 44TARFILE_MD5=c15e53a62711002901d3515ac8b30b86 45 46CONFIGURE_DIR=. 47CONFIGURE_ACTION=config 48CONFIGURE_FLAGS=-I$(SYSBASE)$/usr$/include -L$(SYSBASE)$/usr$/lib shared 49 50BUILD_DIR=. 51BUILD_ACTION=make CC='$(CC)' build_libs 52 53OUT2LIB = libssl.* 54OUT2LIB += libcrypto.* 55OUT2INC += include/openssl/* 56 57UNAME=$(shell uname) 58 59.IF "$(COM)"=="GCC" && "$(CCNUMVER)">="000400060000" || "$(OS)"=="WNT" && "$(NASM_PATH)"=="NO_NASM_HOME" 60 NO_ASM="no-asm" 61.ELSE 62 NO_ASM= 63.ENDIF 64 65.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD" 66 PATCH_FILES=opensslunx.patch 67 .IF "$(CPU)" == "I" 68 .IF "$(UNAME)" == "GNU/kFreeBSD" 69 CONFIGURE_ACTION=Configure debian-kfreebsd-i386 no-dso no-shared $(NO_ASM) 70 .ELIF "$(UNAME)" == "FreeBSD" 71 CONFIGURE_ACTION=Configure BSD-x86-elf no-dso no-shared $(NO_ASM) 72 .ELSE 73 CONFIGURE_ACTION=Configure linux-generic32 no-dso no-shared $(NO_ASM) 74 .ENDIF 75 .ELIF "$(BUILD64)" == "1" 76 .IF "$(UNAME)" == "GNU/kFreeBSD" 77 CONFIGURE_ACTION=Configure debian-kfreebsd-amd64 no-dso no-shared $(NO_ASM) 78 .ELIF "$(UNAME)" == "FreeBSD" 79 CONFIGURE_ACTION=Configure BSD-x86_64 no-dso no-shared $(NO_ASM) 80 .ELSE 81 CONFIGURE_ACTION=Configure linux-x86_64 no-dso no-shared $(NO_ASM) 82 .ENDIF 83 .ELSE 84 CONFIGURE_ACTION=Configure linux-generic32 no-dso no-shared $(NO_ASM) 85 .ENDIF 86 # if you build openssl as shared library you have to patch the Makefile.Shared "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \" 87 #BUILD_ACTION=make 'SHARED_LDFLAGS=-Wl,--version-script=./lib$$(SHLIBDIRS)_OOo_0_9_8e.map' 88.ENDIF 89 90.IF "$(OS)" == "SOLARIS" 91 PATCH_FILES=opensslsol.patch 92 #BUILD_ACTION=make 'SHARED_LDFLAGS=-G -dy -z text -M./lib$$$$$$$$(SHLIBDIRS)_OOo_0_9_8e.map' 93 94 # Use BUILD64 when 1 to select new specific 64bit Configurations if necessary 95 96 .IF "$(CPUNAME)" == "INTEL" # Solaris INTEL 97 .IF "$(CPU)" == "X" 98 CONFIGURE_ACTION=Configure solaris64-x86_64-cc 99 .ELSE 100 CONFIGURE_ACTION=Configure solaris-x86-cc 101 .ENDIF 102 .ELIF "$(CPU)" == "U" # Solaris SPARC 103 CONFIGURE_ACTION=Configure solaris64-sparcv9-cc 104 .ELSE 105 CONFIGURE_ACTION=Configure solaris-sparcv9-cc 106 .ENDIF 107.ENDIF 108 109.IF "$(OS)" == "MACOSX" 110 CONFIGURE_ACTION=Configure darwin64-x86_64-cc no-dso no-shared $(NO_ASM) 111.ENDIF 112 113.IF "$(OS)" == "WNT" 114 115.IF "$(COM)"=="GCC" 116 117PATCH_FILES=opensslmingw.patch 118.IF "$(USE_MINGW)" == "cygwin" 119CONFIGURE_ACTION=$(PERL) configure 120CONFIGURE_FLAGS=mingw shared 121INSTALL_ACTION=mv libcrypto.a libcrypto_static.a && mv libcrypto.dll.a libcrypto.a && mv libssl.a libssl_static.a && mv libssl.dll.a libssl.a 122OUT2LIB = libcrypto_static.* 123OUT2LIB += libssl_static.* 124OUT2LIB += libcrypto.* 125OUT2LIB += libssl.* 126OUT2BIN = ssleay32.dll 127OUT2BIN += libeay32.dll 128.ELSE # "$(USE_MINGW)" == "cygwin" 129CONFIGURE_ACTION= 130BUILD_ACTION=cmd /c "ms\mingw32" 131OUT2LIB = out/libcrypto_static.* 132OUT2LIB += out/libssl_static.* 133OUT2LIB += out/libcrypto.* 134OUT2LIB += out/libssl.* 135OUT2BIN = out/ssleay32.dll 136OUT2BIN += out/libeay32.dll 137.ENDIF # "$(USE_MINGW)" == "cygwin" 138 139.ELSE # "$(COM)"=="GCC" 140 141 PATCH_FILES=openssl.patch 142 143 # Extract Strawberry Perl and use CONFIGURE_ACTION to insert it, and NASM which it needs, into the PATH. 144 # Also define: 145 # - certain constants absent in the old MSVC we use (INT64_MAX, INT64_MIN, UINT64_MAX). 146 # - the minimum Windows version to support (_WIN32_WINDOWS=0x0400 for Windows 95, _WIN32_WINNT=0x0400 for Windows NT 4.0). 147 # - OPENSSL_NO_ASYNC=1 to stop using async functions that require old Windows versions. 148 STRAWBERRY_PERL_DIR=$(shell cygpath -u $(SOLARSRC)/openssl/$(INPATH)/misc/build/strawberry-perl) 149 .IF "$(NASM_PATH)"=="NASM_IN_PATH" 150 CONFIGURE_PATH=$(STRAWBERRY_PERL_DIR)/perl/bin:$(PATH) 151 .ELSE 152 NASM_PATH_NIX=$(shell cygpath -u $(NASM_PATH)) 153 CONFIGURE_PATH=$(STRAWBERRY_PERL_DIR)/perl/bin:$(NASM_PATH_NIX):$(PATH) 154 .ENDIF 155 CONFIGURE_ACTION=\ 156 if test -d "$(STRAWBERRY_PERL_DIR)"; \ 157 then echo Found Strawberry Perl; \ 158 else mkdir "$(STRAWBERRY_PERL_DIR)" && unzip -d $(STRAWBERRY_PERL_DIR) $(SOLARSRC)/../ext_sources/93fdfe261588bc82ab3a0bd4f5945b60-strawberry-perl-5.32.1.1-32bit-portable.zip ; \ 159 fi && \ 160 PATH="$(CONFIGURE_PATH)" \ 161 PERL= \ 162 CPPFLAGS="$(SOLARINC) \ 163 -DOPENSSL_NO_ASYNC=1 \ 164 -DWINVER=0x0400 \ 165 -D_WIN32_WINNT=0x0400 \ 166 -D_WIN32_WINDOWS=0x0400 \ 167 -DINT64_MAX=9223372036854775807i64 \ 168 -DINT64_MIN=(-9223372036854775807i64-1) \ 169 -DUINT64_MAX=0xffffffffffffffffui64" \ 170 RCFLAGS="$(SOLARINC)" \ 171 perl configure $(NO_ASM) 172 .IF "$(CPUNAME)"=="INTEL" 173 CONFIGURE_FLAGS=VC-WIN32 174 .ELIF "$(CPUNAME)"=="X86_64" 175 CONFIGURE_FLAGS=VC-WIN64A 176 .ENDIF 177 BUILD_ACTION=LIB="$(ILIB)" nmake 178 179 OUT2BIN = libcrypto-3.dll 180 OUT2BIN += libssl-3.dll 181 OUT2INC = include$/openssl$/* 182 183.ENDIF # "$(COM)"=="GCC" 184 185.ENDIF # "$(OS)" == "WNT" 186 187 188# --- Targets ------------------------------------------------------ 189 190.INCLUDE : set_ext.mk 191.INCLUDE : target.mk 192.INCLUDE : tg_ext.mk 193 194