174664626SKris Kennaway: 274664626SKris Kennawayeval 'exec perl -S $0 ${1+"$@"}' 374664626SKris Kennaway if $running_under_some_shell; 474664626SKris Kennaway## 574664626SKris Kennaway## Configure -- OpenSSL source tree configuration script 674664626SKris Kennaway## 774664626SKris Kennaway 874664626SKris Kennawayrequire 5.000; 974664626SKris Kennawayuse strict; 1074664626SKris Kennaway 1174664626SKris Kennaway# see INSTALL for instructions. 1274664626SKris Kennaway 133b4e3dcbSSimon L. B. Nielsenmy $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; 1474664626SKris Kennaway 1574664626SKris Kennaway# Options: 1674664626SKris Kennaway# 1774664626SKris Kennaway# --openssldir install OpenSSL in OPENSSLDIR (Default: DIR/ssl if the 1874664626SKris Kennaway# --prefix option is given; /usr/local/ssl otherwise) 1974664626SKris Kennaway# --prefix prefix for the OpenSSL include, lib and bin directories 2074664626SKris Kennaway# (Default: the OPENSSLDIR directory) 2174664626SKris Kennaway# 2274664626SKris Kennaway# --install_prefix Additional prefix for package builders (empty by 2374664626SKris Kennaway# default). This needn't be set in advance, you can 2474664626SKris Kennaway# just as well use "make INSTALL_PREFIX=/whatever install". 2574664626SKris Kennaway# 265c87c606SMark Murray# --with-krb5-dir Declare where Kerberos 5 lives. The libraries are expected 275c87c606SMark Murray# to live in the subdirectory lib/ and the header files in 285c87c606SMark Murray# include/. A value is required. 295c87c606SMark Murray# --with-krb5-lib Declare where the Kerberos 5 libraries live. A value is 305c87c606SMark Murray# required. 315c87c606SMark Murray# (Default: KRB5_DIR/lib) 325c87c606SMark Murray# --with-krb5-include Declare where the Kerberos 5 header files live. A 335c87c606SMark Murray# value is required. 345c87c606SMark Murray# (Default: KRB5_DIR/include) 355c87c606SMark Murray# --with-krb5-flavor Declare what flavor of Kerberos 5 is used. Currently 365c87c606SMark Murray# supported values are "MIT" and "Heimdal". A value is required. 375c87c606SMark Murray# 38c1803d78SJacques Vidrine# --test-sanity Make a number of sanity checks on the data in this file. 39c1803d78SJacques Vidrine# This is a debugging tool for OpenSSL developers. 40c1803d78SJacques Vidrine# 415c87c606SMark Murray# no-hw-xxx do not compile support for specific crypto hardware. 425c87c606SMark Murray# Generic OpenSSL-style methods relating to this support 435c87c606SMark Murray# are always compiled but return NULL if the hardware 445c87c606SMark Murray# support isn't compiled. 455c87c606SMark Murray# no-hw do not compile support for any crypto hardware. 4674664626SKris Kennaway# [no-]threads [don't] try to create a library that is suitable for 4774664626SKris Kennaway# multithreaded applications (default is "threads" if we 4874664626SKris Kennaway# know how to do it) 49ddd58736SKris Kennaway# [no-]shared [don't] try to create shared libraries when supported. 5074664626SKris Kennaway# no-asm do not use assembler 51ddd58736SKris Kennaway# no-dso do not compile in any native shared-library methods. This 52ddd58736SKris Kennaway# will ensure that all methods just return NULL. 535c87c606SMark Murray# no-krb5 do not compile in any KRB5 library or code. 545c87c606SMark Murray# [no-]zlib [don't] compile support for zlib compression. 555c87c606SMark Murray# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared 565c87c606SMark Murray# library and will be loaded in run-time by the OpenSSL library. 5774664626SKris Kennaway# 386 generate 80386 code 583b4e3dcbSSimon L. B. Nielsen# no-sse2 disables IA-32 SSE2 code, above option implies no-sse2 5974664626SKris Kennaway# no-<cipher> build without specified algorithm (rsa, idea, rc5, ...) 6074664626SKris Kennaway# -<xxx> +<xxx> compiler options are passed through 6174664626SKris Kennaway# 62ddd58736SKris Kennaway# DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items 63ddd58736SKris Kennaway# provided to stack calls. Generates unique stack functions for 64ddd58736SKris Kennaway# each possible stack type. 6574664626SKris Kennaway# DES_PTR use pointer lookup vs arrays in the DES in crypto/des/des_locl.h 6674664626SKris Kennaway# DES_RISC1 use different DES_ENCRYPT macro that helps reduce register 6774664626SKris Kennaway# dependancies but needs to more registers, good for RISC CPU's 6874664626SKris Kennaway# DES_RISC2 A different RISC variant. 6974664626SKris Kennaway# DES_UNROLL unroll the inner DES loop, sometimes helps, somtimes hinders. 7074664626SKris Kennaway# DES_INT use 'int' instead of 'long' for DES_LONG in crypto/des/des.h 7174664626SKris Kennaway# This is used on the DEC Alpha where long is 8 bytes 7274664626SKris Kennaway# and int is 4 7374664626SKris Kennaway# BN_LLONG use the type 'long long' in crypto/bn/bn.h 7474664626SKris Kennaway# MD2_CHAR use 'char' instead of 'int' for MD2_INT in crypto/md2/md2.h 7574664626SKris Kennaway# MD2_LONG use 'long' instead of 'int' for MD2_INT in crypto/md2/md2.h 7674664626SKris Kennaway# IDEA_SHORT use 'short' instead of 'int' for IDEA_INT in crypto/idea/idea.h 7774664626SKris Kennaway# IDEA_LONG use 'long' instead of 'int' for IDEA_INT in crypto/idea/idea.h 7874664626SKris Kennaway# RC2_SHORT use 'short' instead of 'int' for RC2_INT in crypto/rc2/rc2.h 7974664626SKris Kennaway# RC2_LONG use 'long' instead of 'int' for RC2_INT in crypto/rc2/rc2.h 8074664626SKris Kennaway# RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h 8174664626SKris Kennaway# RC4_LONG use 'long' instead of 'int' for RC4_INT in crypto/rc4/rc4.h 8274664626SKris Kennaway# RC4_INDEX define RC4_INDEX in crypto/rc4/rc4_locl.h. This turns on 8374664626SKris Kennaway# array lookups instead of pointer use. 84f579bf8eSKris Kennaway# RC4_CHUNK enables code that handles data aligned at long (natural CPU 85f579bf8eSKris Kennaway# word) boundary. 86f579bf8eSKris Kennaway# RC4_CHUNK_LL enables code that handles data aligned at long long boundary 87f579bf8eSKris Kennaway# (intended for 64-bit CPUs running 32-bit OS). 8874664626SKris Kennaway# BF_PTR use 'pointer arithmatic' for Blowfish (unsafe on Alpha). 8974664626SKris Kennaway# BF_PTR2 intel specific version (generic version is more efficient). 903b4e3dcbSSimon L. B. Nielsen# 913b4e3dcbSSimon L. B. Nielsen# Following are set automatically by this script 923b4e3dcbSSimon L. B. Nielsen# 9374664626SKris Kennaway# MD5_ASM use some extra md5 assember, 9474664626SKris Kennaway# SHA1_ASM use some extra sha1 assember, must define L_ENDIAN for x86 9574664626SKris Kennaway# RMD160_ASM use some extra ripemd160 assember, 963b4e3dcbSSimon L. B. Nielsen# SHA256_ASM sha256_block is implemented in assembler 973b4e3dcbSSimon L. B. Nielsen# SHA512_ASM sha512_block is implemented in assembler 983b4e3dcbSSimon L. B. Nielsen# AES_ASM ASE_[en|de]crypt is implemented in assembler 9974664626SKris Kennaway 10074664626SKris Kennawaymy $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; 10174664626SKris Kennaway 10274664626SKris Kennaway# MD2_CHAR slags pentium pros 10374664626SKris Kennawaymy $x86_gcc_opts="RC4_INDEX MD2_INT"; 10474664626SKris Kennaway 10574664626SKris Kennaway# MODIFY THESE PARAMETERS IF YOU ARE GOING TO USE THE 'util/speed.sh SCRIPT 10674664626SKris Kennaway# Don't worry about these normally 10774664626SKris Kennaway 10874664626SKris Kennawaymy $tcc="cc"; 10974664626SKris Kennawaymy $tflags="-fast -Xa"; 11074664626SKris Kennawaymy $tbn_mul=""; 11174664626SKris Kennawaymy $tlib="-lnsl -lsocket"; 11274664626SKris Kennaway#$bits1="SIXTEEN_BIT "; 11374664626SKris Kennaway#$bits2="THIRTY_TWO_BIT "; 11474664626SKris Kennawaymy $bits1="THIRTY_TWO_BIT "; 11574664626SKris Kennawaymy $bits2="SIXTY_FOUR_BIT "; 11674664626SKris Kennaway 1173b4e3dcbSSimon L. B. Nielsenmy $x86_elf_asm="x86cpuid-elf.o:bn86-elf.o co86-elf.o:dx86-elf.o yx86-elf.o:ax86-elf.o:bx86-elf.o:mx86-elf.o:sx86-elf.o s512sse2-elf.o:cx86-elf.o:rx86-elf.o:rm86-elf.o:r586-elf.o"; 1183b4e3dcbSSimon L. B. Nielsenmy $x86_coff_asm="x86cpuid-cof.o:bn86-cof.o co86-cof.o:dx86-cof.o yx86-cof.o:ax86-cof.o:bx86-cof.o:mx86-cof.o:sx86-cof.o s512sse2-cof.o:cx86-cof.o:rx86-cof.o:rm86-cof.o:r586-cof.o"; 1193b4e3dcbSSimon L. B. Nielsenmy $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o:rm86-out.o:r586-out.o"; 12074664626SKris Kennaway 1213b4e3dcbSSimon L. B. Nielsenmy $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o::::md5-x86_64.o:::rc4-x86_64.o::"; 1223b4e3dcbSSimon L. B. Nielsenmy $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o::"; 1235740a5e3SKris Kennaway 1243b4e3dcbSSimon L. B. Nielsenmy $no_asm="::::::::::"; 12574664626SKris Kennaway 1263b4e3dcbSSimon L. B. Nielsen# As for $BSDthreads. Idea is to maintain "collective" set of flags, 1273b4e3dcbSSimon L. B. Nielsen# which would cover all BSD flavors. -pthread applies to them all, 1283b4e3dcbSSimon L. B. Nielsen# but is treated differently. OpenBSD expands is as -D_POSIX_THREAD 1293b4e3dcbSSimon L. B. Nielsen# -lc_r, which is sufficient. FreeBSD 4.x expands it as -lc_r, 1303b4e3dcbSSimon L. B. Nielsen# which has to be accompanied by explicit -D_THREAD_SAFE and 1313b4e3dcbSSimon L. B. Nielsen# sometimes -D_REENTRANT. FreeBSD 5.x expands it as -lc_r, which 1323b4e3dcbSSimon L. B. Nielsen# seems to be sufficient? 1333b4e3dcbSSimon L. B. Nielsenmy $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT"; 1343b4e3dcbSSimon L. B. Nielsen 1353b4e3dcbSSimon L. B. Nielsen#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags 136f579bf8eSKris Kennaway 13774664626SKris Kennawaymy %table=( 138ddd58736SKris Kennaway# File 'TABLE' (created by 'make TABLE') contains the data from this list, 139ddd58736SKris Kennaway# formatted for better readability. 140ddd58736SKris Kennaway 141ddd58736SKris Kennaway 142f579bf8eSKris Kennaway#"b", "${tcc}:${tflags}::${tlib}:${bits1}:${tbn_mul}::", 143f579bf8eSKris Kennaway#"bl-4c-2c", "${tcc}:${tflags}::${tlib}:${bits1}BN_LLONG RC4_CHAR MD2_CHAR:${tbn_mul}::", 144f579bf8eSKris Kennaway#"bl-4c-ri", "${tcc}:${tflags}::${tlib}:${bits1}BN_LLONG RC4_CHAR RC4_INDEX:${tbn_mul}::", 145f579bf8eSKris Kennaway#"b2-is-ri-dp", "${tcc}:${tflags}::${tlib}:${bits2}IDEA_SHORT RC4_INDEX DES_PTR:${tbn_mul}::", 14674664626SKris Kennaway 14774664626SKris Kennaway# Our development configs 1485c87c606SMark Murray"purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::", 1495c87c606SMark Murray"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::", 1503b4e3dcbSSimon L. B. Nielsen"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o", 1515c87c606SMark Murray"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", 1525c87c606SMark Murray"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", 1533b4e3dcbSSimon L. B. Nielsen"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::::", 1545c87c606SMark Murray"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", 1555c87c606SMark Murray"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", 1563b4e3dcbSSimon L. B. Nielsen"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", 1573b4e3dcbSSimon L. B. Nielsen"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", 158ed5d4f9aSSimon L. B. Nielsen"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -march=i486 -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", 1593b4e3dcbSSimon L. B. Nielsen"debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT:${no_asm}:dlfcn:linux-shared", 1603b4e3dcbSSimon L. B. Nielsen"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1613b4e3dcbSSimon L. B. Nielsen"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1623b4e3dcbSSimon L. B. Nielsen"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1633b4e3dcbSSimon L. B. Nielsen"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1643b4e3dcbSSimon L. B. Nielsen"debug-geoff","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1653b4e3dcbSSimon L. B. Nielsen"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", 1663b4e3dcbSSimon L. B. Nielsen"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", 1673b4e3dcbSSimon L. B. Nielsen"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1683b4e3dcbSSimon L. B. Nielsen"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1695c87c606SMark Murray"dist", "cc:-O::(unknown)::::::", 17074664626SKris Kennaway 171f579bf8eSKris Kennaway# Basic configs that should work on any (32 and less bit) box 1725c87c606SMark Murray"gcc", "gcc:-O3::(unknown):::BN_LLONG:::", 1735c87c606SMark Murray"cc", "cc:-O::(unknown)::::::", 17474664626SKris Kennaway 1756be8ae07SJacques Vidrine####VOS Configurations 1763b4e3dcbSSimon L. B. Nielsen"vos-gcc","gcc:-O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", 1773b4e3dcbSSimon L. B. Nielsen"debug-vos-gcc","gcc:-O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", 1786be8ae07SJacques Vidrine 1795c87c606SMark Murray#### Solaris x86 with GNU C setups 1805c87c606SMark Murray# -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have to do it 181f579bf8eSKris Kennaway# here because whenever GNU C instantiates an assembler template it 182f579bf8eSKris Kennaway# surrounds it with #APP #NO_APP comment pair which (at least Solaris 183f579bf8eSKris Kennaway# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic" 184f579bf8eSKris Kennaway# error message. 1853b4e3dcbSSimon L. B. Nielsen"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -march=pentium -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 1863b4e3dcbSSimon L. B. Nielsen# -shared -static-libgcc might appear controversial, but modules taken 1873b4e3dcbSSimon L. B. Nielsen# from static libgcc do not have relocations and linking them into our 1883b4e3dcbSSimon L. B. Nielsen# shared objects doesn't have any negative side-effects. On the contrary, 1893b4e3dcbSSimon L. B. Nielsen# doing so makes it possible to use gcc shared build with Sun C. Given 1903b4e3dcbSSimon L. B. Nielsen# that gcc generates faster code [thanks to inline assembler], I would 1913b4e3dcbSSimon L. B. Nielsen# actually recommend to consider using gcc shared build even with vendor 1923b4e3dcbSSimon L. B. Nielsen# compiler:-) 1933b4e3dcbSSimon L. B. Nielsen# <appro@fy.chalmers.se> 1943b4e3dcbSSimon L. B. Nielsen"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 19574664626SKris Kennaway 19626d191b4SKris Kennaway#### Solaris x86 with Sun C setups 1973b4e3dcbSSimon L. B. Nielsen"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 198ed5d4f9aSSimon L. B. Nielsen"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 19926d191b4SKris Kennaway 20074664626SKris Kennaway#### SPARC Solaris with GNU C setups 2013b4e3dcbSSimon L. B. Nielsen"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2023b4e3dcbSSimon L. B. Nielsen"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2035c87c606SMark Murray# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc 2043b4e3dcbSSimon L. B. Nielsen"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2053b4e3dcbSSimon L. B. Nielsen"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 20674664626SKris Kennaway#### 2073b4e3dcbSSimon L. B. Nielsen"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2083b4e3dcbSSimon L. B. Nielsen"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 20974664626SKris Kennaway 21074664626SKris Kennaway#### SPARC Solaris with Sun C setups 21174664626SKris Kennaway# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2. 21274664626SKris Kennaway# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8 21374664626SKris Kennaway# SC5.0 note: Compiler common patch 107357-01 or later is required! 2143b4e3dcbSSimon L. B. Nielsen"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2153b4e3dcbSSimon L. B. Nielsen"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2163b4e3dcbSSimon L. B. Nielsen"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2173b4e3dcbSSimon L. B. Nielsen"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs", 218f579bf8eSKris Kennaway#### 2193b4e3dcbSSimon L. B. Nielsen"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2203b4e3dcbSSimon L. B. Nielsen"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o::::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 22174664626SKris Kennaway 2223b4e3dcbSSimon L. B. Nielsen#### SunOS configs, assuming sparc for the gcc one. 2233b4e3dcbSSimon L. B. Nielsen#"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::", 2243b4e3dcbSSimon L. B. Nielsen"sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::", 22574664626SKris Kennaway 22674664626SKris Kennaway#### IRIX 5.x configs 22774664626SKris Kennaway# -mips2 flag is added by ./config when appropriate. 2283b4e3dcbSSimon L. B. Nielsen"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2293b4e3dcbSSimon L. B. Nielsen"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 23074664626SKris Kennaway#### IRIX 6.x configs 23174664626SKris Kennaway# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke 232ced566fdSJacques Vidrine# './Configure irix-cc -o32' manually. 2333b4e3dcbSSimon L. B. Nielsen"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2343b4e3dcbSSimon L. B. Nielsen"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 23574664626SKris Kennaway# N64 ABI builds. 2363b4e3dcbSSimon L. B. Nielsen"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2373b4e3dcbSSimon L. B. Nielsen"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 238f579bf8eSKris Kennaway 239f579bf8eSKris Kennaway#### Unified HP-UX ANSI C configs. 240f579bf8eSKris Kennaway# Special notes: 241f579bf8eSKris Kennaway# - Originally we were optimizing at +O4 level. It should be noted 242f579bf8eSKris Kennaway# that the only difference between +O3 and +O4 is global inter- 243f579bf8eSKris Kennaway# procedural analysis. As it has to be performed during the link 244f579bf8eSKris Kennaway# stage the compiler leaves behind certain pseudo-code in lib*.a 245f579bf8eSKris Kennaway# which might be release or even patch level specific. Generating 246f579bf8eSKris Kennaway# the machine code for and analyzing the *whole* program appears 247f579bf8eSKris Kennaway# to be *extremely* memory demanding while the performance gain is 248f579bf8eSKris Kennaway# actually questionable. The situation is intensified by the default 249f579bf8eSKris Kennaway# HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB 250f579bf8eSKris Kennaway# which is way too low for +O4. In other words, doesn't +O3 make 251f579bf8eSKris Kennaway# more sense? 252f579bf8eSKris Kennaway# - Keep in mind that the HP compiler by default generates code 253f579bf8eSKris Kennaway# suitable for execution on the host you're currently compiling at. 254f579bf8eSKris Kennaway# If the toolkit is ment to be used on various PA-RISC processors 2555c87c606SMark Murray# consider './config +DAportable'. 2563b4e3dcbSSimon L. B. Nielsen# - +DD64 is chosen in favour of +DA2.0W because it's meant to be 257f579bf8eSKris Kennaway# compatible with *future* releases. 258f579bf8eSKris Kennaway# - If you run ./Configure hpux-parisc-[g]cc manually don't forget to 259f579bf8eSKris Kennaway# pass -D_REENTRANT on HP-UX 10 and later. 260f579bf8eSKris Kennaway# - -DMD32_XARRAY triggers workaround for compiler bug we ran into in 261f579bf8eSKris Kennaway# 32-bit message digests. (For the moment of this writing) HP C 262f579bf8eSKris Kennaway# doesn't seem to "digest" too many local variables (they make "him" 263f579bf8eSKris Kennaway# chew forever:-). For more details look-up MD32_XARRAY comment in 264f579bf8eSKris Kennaway# crypto/sha/sha_lcl.h. 265f579bf8eSKris Kennaway# <appro@fy.chalmers.se> 266f579bf8eSKris Kennaway# 267f579bf8eSKris Kennaway# Since there is mention of this in shlib/hpux10-cc.sh 2683b4e3dcbSSimon L. B. Nielsen"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2693b4e3dcbSSimon L. B. Nielsen"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2703b4e3dcbSSimon L. B. Nielsen"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1::pa-risc2.o::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2713b4e3dcbSSimon L. B. Nielsen"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 272ddd58736SKris Kennaway 273ddd58736SKris Kennaway# More attempts at unified 10.X and 11.X targets for HP C compiler. 274ddd58736SKris Kennaway# 275ddd58736SKris Kennaway# Chris Ruemmler <ruemmler@cup.hp.com> 276ddd58736SKris Kennaway# Kevin Steves <ks@hp.se> 2773b4e3dcbSSimon L. B. Nielsen"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2783b4e3dcbSSimon L. B. Nielsen"hpux-parisc1_0-cc","cc:+DAportable +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2793b4e3dcbSSimon L. B. Nielsen"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2.o::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2803b4e3dcbSSimon L. B. Nielsen"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 28174664626SKris Kennaway 2823b4e3dcbSSimon L. B. Nielsen# HP/UX IA-64 targets 2833b4e3dcbSSimon L. B. Nielsen"hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2843b4e3dcbSSimon L. B. Nielsen# Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted with 2853b4e3dcbSSimon L. B. Nielsen# with debugging of the following config. 2863b4e3dcbSSimon L. B. Nielsen"hpux64-ia64-cc","cc:-Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD64 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2873b4e3dcbSSimon L. B. Nielsen# GCC builds... 288ed5d4f9aSSimon L. B. Nielsen"hpux-ia64-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:-fpic:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2893b4e3dcbSSimon L. B. Nielsen"hpux64-ia64-gcc","gcc:-mlp64 -O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:-fpic:-mlp64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 29074664626SKris Kennaway 2913b4e3dcbSSimon L. B. Nielsen# Legacy HPUX 9.X configs... 2923b4e3dcbSSimon L. B. Nielsen"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O2 -z::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 2933b4e3dcbSSimon L. B. Nielsen"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 29474664626SKris Kennaway 295ddd58736SKris Kennaway#### HP MPE/iX http://jazz.external.hp.com/src/openssl/ 2965c87c606SMark Murray"MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::", 297ddd58736SKris Kennaway 2983b4e3dcbSSimon L. B. Nielsen# DEC Alpha OSF/1/Tru64 targets. 299a21b1b38SKris Kennaway# 300a21b1b38SKris Kennaway# "What's in a name? That which we call a rose 301a21b1b38SKris Kennaway# By any other word would smell as sweet." 302a21b1b38SKris Kennaway# 303a21b1b38SKris Kennaway# - William Shakespeare, "Romeo & Juliet", Act II, scene II. 304a21b1b38SKris Kennaway# 30574664626SKris Kennaway# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version 306a21b1b38SKris Kennaway# 3073b4e3dcbSSimon L. B. Nielsen"osf1-alpha-gcc", "gcc:-O3::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${no_asm}:dlfcn:alpha-osf1-shared:::.so", 3083b4e3dcbSSimon L. B. Nielsen"osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared:::.so", 3093b4e3dcbSSimon L. B. Nielsen"tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared::-msym:.so", 310f579bf8eSKris Kennaway 3113b4e3dcbSSimon L. B. Nielsen#### 3123b4e3dcbSSimon L. B. Nielsen#### Variety of LINUX:-) 3133b4e3dcbSSimon L. B. Nielsen#### 3143b4e3dcbSSimon L. B. Nielsen# *-generic* is endian-neutral target, but ./config is free to 3153b4e3dcbSSimon L. B. Nielsen# throw in -D[BL]_ENDIAN, whichever appropriate... 3163b4e3dcbSSimon L. B. Nielsen"linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3173b4e3dcbSSimon L. B. Nielsen"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc32.o::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3183b4e3dcbSSimon L. B. Nielsen#### IA-32 targets... 3193b4e3dcbSSimon L. B. Nielsen"linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3203b4e3dcbSSimon L. B. Nielsen"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3213b4e3dcbSSimon L. B. Nielsen"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}", 3223b4e3dcbSSimon L. B. Nielsen#### 3233b4e3dcbSSimon L. B. Nielsen"linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3243b4e3dcbSSimon L. B. Nielsen# -bpowerpc64-linux is transient option, -m64 should be the one to use... 3253b4e3dcbSSimon L. B. Nielsen"linux-ppc64", "gcc:-bpowerpc64-linux -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-bpowerpc64-linux:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3263b4e3dcbSSimon L. B. Nielsen"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3273b4e3dcbSSimon L. B. Nielsen"linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3283b4e3dcbSSimon L. B. Nielsen"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3293b4e3dcbSSimon L. B. Nielsen"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3303b4e3dcbSSimon L. B. Nielsen#### SPARC Linux setups 3313b4e3dcbSSimon L. B. Nielsen# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently 3323b4e3dcbSSimon L. B. Nielsen# assisted with debugging of following two configs. 3333b4e3dcbSSimon L. B. Nielsen"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3343b4e3dcbSSimon L. B. Nielsen# it's a real mess with -mcpu=ultrasparc option under Linux, but 3353b4e3dcbSSimon L. B. Nielsen# -Wa,-Av8plus should do the trick no matter what. 3363b4e3dcbSSimon L. B. Nielsen"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3373b4e3dcbSSimon L. B. Nielsen# GCC 3.1 is a requirement 3383b4e3dcbSSimon L. B. Nielsen"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 339f579bf8eSKris Kennaway#### Alpha Linux with GNU C and Compaq C setups 340f579bf8eSKris Kennaway# Special notes: 341f579bf8eSKris Kennaway# - linux-alpha+bwx-gcc is ment to be used from ./config only. If you 342f579bf8eSKris Kennaway# ought to run './Configure linux-alpha+bwx-gcc' manually, do 343f579bf8eSKris Kennaway# complement the command line with -mcpu=ev56, -mcpu=ev6 or whatever 344f579bf8eSKris Kennaway# which is appropriate. 345f579bf8eSKris Kennaway# - If you use ccc keep in mind that -fast implies -arch host and the 346f579bf8eSKris Kennaway# compiler is free to issue instructions which gonna make elder CPU 347f579bf8eSKris Kennaway# choke. If you wish to build "blended" toolkit, add -arch generic 348f579bf8eSKris Kennaway# *after* -fast and invoke './Configure linux-alpha-ccc' manually. 349f579bf8eSKris Kennaway# 350f579bf8eSKris Kennaway# <appro@fy.chalmers.se> 351f579bf8eSKris Kennaway# 3523b4e3dcbSSimon L. B. Nielsen"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3533b4e3dcbSSimon L. B. Nielsen"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3543b4e3dcbSSimon L. B. Nielsen"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", 3553b4e3dcbSSimon L. B. Nielsen"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", 35674664626SKris Kennaway 3573b4e3dcbSSimon L. B. Nielsen#### *BSD [do see comment about ${BSDthreads} above!] 3583b4e3dcbSSimon L. B. Nielsen"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3593b4e3dcbSSimon L. B. Nielsen"BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3603b4e3dcbSSimon L. B. Nielsen"BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3613b4e3dcbSSimon L. B. Nielsen"debug-BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3623b4e3dcbSSimon L. B. Nielsen"BSD-sparcv8", "gcc:-DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 36374664626SKris Kennaway 3643b4e3dcbSSimon L. B. Nielsen"BSD-generic64","gcc:-DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3653b4e3dcbSSimon L. B. Nielsen# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it 3663b4e3dcbSSimon L. B. Nielsen# simply *happens* to work around a compiler bug in gcc 3.3.3, 3673b4e3dcbSSimon L. B. Nielsen# triggered by RIPEMD160 code. 3683b4e3dcbSSimon L. B. Nielsen"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3693b4e3dcbSSimon L. B. Nielsen"BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3703b4e3dcbSSimon L. B. Nielsen"BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3713b4e3dcbSSimon L. B. Nielsen 3723b4e3dcbSSimon L. B. Nielsen"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3733b4e3dcbSSimon L. B. Nielsen 3745c87c606SMark Murray"nextstep", "cc:-O -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", 3755c87c606SMark Murray"nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", 3765c87c606SMark Murray 37774664626SKris Kennaway# NCR MP-RAS UNIX ver 02.03.01 378fceca8a3SJacques Vidrine"ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown)::-lsocket -lnsl -lc89:${x86_gcc_des} ${x86_gcc_opts}:::", 37974664626SKris Kennaway 3803b4e3dcbSSimon L. B. Nielsen# QNX 3815c87c606SMark Murray"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:", 3825c87c606SMark Murray"qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:", 383a21b1b38SKris Kennaway 3843b4e3dcbSSimon L. B. Nielsen#### SCO/Caldera targets. 385fceca8a3SJacques Vidrine# 386fceca8a3SJacques Vidrine# Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc. 387fceca8a3SJacques Vidrine# Now we only have blended unixware-* as it's the only one used by ./config. 388fceca8a3SJacques Vidrine# If you want to optimize for particular microarchitecture, bypass ./config 389fceca8a3SJacques Vidrine# and './Configure unixware-7 -Kpentium_pro' or whatever appropriate. 390fceca8a3SJacques Vidrine# Note that not all targets include assembler support. Mostly because of 391fceca8a3SJacques Vidrine# lack of motivation to support out-of-date platforms with out-of-date 392fceca8a3SJacques Vidrine# compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has 393fceca8a3SJacques Vidrine# patiently assisted to debug most of it. 394fceca8a3SJacques Vidrine# 3953b4e3dcbSSimon L. B. Nielsen# UnixWare 2.0x fails destest with -O. 3965c87c606SMark Murray"unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", 3975c87c606SMark Murray"unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", 398fceca8a3SJacques Vidrine"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 3993b4e3dcbSSimon L. B. Nielsen"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -march=pentium -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 400fceca8a3SJacques Vidrine# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc. 401fceca8a3SJacques Vidrine"sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 402fceca8a3SJacques Vidrine"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 40374664626SKris Kennaway 4043b4e3dcbSSimon L. B. Nielsen#### IBM's AIX. 4053b4e3dcbSSimon L. B. Nielsen"aix3-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::", 4063b4e3dcbSSimon L. B. Nielsen"aix-gcc", "gcc:-O -DB_ENDIAN::-D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:", 4073b4e3dcbSSimon L. B. Nielsen"aix64-gcc","gcc:-O -DB_ENDIAN::-D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn::::::-X64", 4083b4e3dcbSSimon L. B. Nielsen# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE 4093b4e3dcbSSimon L. B. Nielsen# at build time. $OBJECT_MODE is respected at ./config stage! 4103b4e3dcbSSimon L. B. Nielsen"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", 4113b4e3dcbSSimon L. B. Nielsen"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", 41274664626SKris Kennaway 41374664626SKris Kennaway# 414c1803d78SJacques Vidrine# Cray T90 and similar (SDSC) 41574664626SKris Kennaway# It's Big-endian, but the algorithms work properly when B_ENDIAN is NOT 41674664626SKris Kennaway# defined. The T90 ints and longs are 8 bytes long, and apparently the 41774664626SKris Kennaway# B_ENDIAN code assumes 4 byte ints. Fortunately, the non-B_ENDIAN and 41874664626SKris Kennaway# non L_ENDIAN code aligns the bytes in each word correctly. 41974664626SKris Kennaway# 42074664626SKris Kennaway# The BIT_FIELD_LIMITS define is to avoid two fatal compiler errors: 42174664626SKris Kennaway#'Taking the address of a bit field is not allowed. ' 42274664626SKris Kennaway#'An expression with bit field exists as the operand of "sizeof" ' 42374664626SKris Kennaway# (written by Wayne Schroeder <schroede@SDSC.EDU>) 424c1803d78SJacques Vidrine# 425c1803d78SJacques Vidrine# j90 is considered the base machine type for unicos machines, 426c1803d78SJacques Vidrine# so this configuration is now called "cray-j90" ... 4275c87c606SMark Murray"cray-j90", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG DES_INT:::", 42874664626SKris Kennaway 42974664626SKris Kennaway# 43074664626SKris Kennaway# Cray T3E (Research Center Juelich, beckman@acl.lanl.gov) 43174664626SKris Kennaway# 43274664626SKris Kennaway# The BIT_FIELD_LIMITS define was written for the C90 (it seems). I added 43374664626SKris Kennaway# another use. Basically, the problem is that the T3E uses some bit fields 43474664626SKris Kennaway# for some st_addr stuff, and then sizeof and address-of fails 43574664626SKris Kennaway# I could not use the ams/alpha.o option because the Cray assembler, 'cam' 43674664626SKris Kennaway# did not like it. 4375c87c606SMark Murray"cray-t3e", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:::", 43874664626SKris Kennaway 43974664626SKris Kennaway# DGUX, 88100. 4405c87c606SMark Murray"dgux-R3-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown):::RC4_INDEX DES_UNROLL:::", 4415c87c606SMark Murray"dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX DES_UNROLL:::", 4425c87c606SMark Murray"dgux-R4-x86-gcc", "gcc:-O3 -fomit-frame-pointer -DL_ENDIAN::(unknown)::-lnsl -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", 44374664626SKris Kennaway 44474664626SKris Kennaway# Sinix/ReliantUNIX RM400 44574664626SKris Kennaway# NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */ 4463b4e3dcbSSimon L. B. Nielsen"ReliantUNIX","cc:-KPIC -g -DTERMIOS -DB_ENDIAN::-Kthread:SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:reliantunix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 4475c87c606SMark Murray"SINIX","cc:-O::(unknown):SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:RC4_INDEX RC4_CHAR:::", 4485c87c606SMark Murray"SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::", 44974664626SKris Kennaway 45074664626SKris Kennaway# SIEMENS BS2000/OSD: an EBCDIC-based mainframe 4515c87c606SMark Murray"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::", 45274664626SKris Kennaway 453a21b1b38SKris Kennaway# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe 454a21b1b38SKris Kennaway# You need to compile using the c89.sh wrapper in the tools directory, because the 455a21b1b38SKris Kennaway# IBM compiler does not like the -L switch after any object modules. 456a21b1b38SKris Kennaway# 4575c87c606SMark Murray"OS390-Unix","c89.sh:-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE::(unknown):::THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::", 458a21b1b38SKris Kennaway 4593b4e3dcbSSimon L. B. Nielsen# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 4603b4e3dcbSSimon L. B. Nielsen"VC-WIN64I","cl::::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", 4613b4e3dcbSSimon L. B. Nielsen"VC-WIN64A","cl::::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", 46274664626SKris Kennaway 4633b4e3dcbSSimon L. B. Nielsen# Visual C targets 4643b4e3dcbSSimon L. B. Nielsen"VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", 4653b4e3dcbSSimon L. B. Nielsen"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", 4663b4e3dcbSSimon L. B. Nielsen"VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", 46774664626SKris Kennaway 46874664626SKris Kennaway# Borland C++ 4.5 4693b4e3dcbSSimon L. B. Nielsen"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", 47074664626SKris Kennaway 47150ef0093SJacques Vidrine# MinGW 4723b4e3dcbSSimon L. B. Nielsen"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a", 473ddd58736SKris Kennaway 4744f20a5a2SJacques Vidrine# UWIN 4753b4e3dcbSSimon L. B. Nielsen"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", 4764f20a5a2SJacques Vidrine 477c1803d78SJacques Vidrine# Cygwin 4783b4e3dcbSSimon L. B. Nielsen"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", 4793b4e3dcbSSimon L. B. Nielsen"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_coff_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", 4803b4e3dcbSSimon L. B. Nielsen"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", 4813b4e3dcbSSimon L. B. Nielsen 4823b4e3dcbSSimon L. B. Nielsen# NetWare from David Ward (dsward@novell.com) - requires MetroWerks NLM development tools 4833b4e3dcbSSimon L. B. Nielsen# netware-clib => legacy CLib c-runtime support 4843b4e3dcbSSimon L. B. Nielsen"netware-clib", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", 4853b4e3dcbSSimon L. B. Nielsen# netware-libc => LibC/NKS support 4863b4e3dcbSSimon L. B. Nielsen# NetWare defaults socket bio to WinSock sockets. However, the LibC build can be 4873b4e3dcbSSimon L. B. Nielsen# configured to use BSD sockets instead. 4883b4e3dcbSSimon L. B. Nielsen"netware-libc", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", 4893b4e3dcbSSimon L. B. Nielsen"netware-libc-bsdsock", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", 4903b4e3dcbSSimon L. B. Nielsen"netware-libc-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::", 4915c87c606SMark Murray 4925c87c606SMark Murray# DJGPP 4933b4e3dcbSSimon L. B. Nielsen"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:", 49474664626SKris Kennaway 49574664626SKris Kennaway# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at> 4965c87c606SMark Murray"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::", 4973b4e3dcbSSimon L. B. Nielsen"ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::BN_LLONG::::", 49874664626SKris Kennaway# K&R C is no longer supported; you need gcc on old Ultrix installations 4995c87c606SMark Murray##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::", 50074664626SKris Kennaway 501a21b1b38SKris Kennaway##### MacOS X (a.k.a. Rhapsody or Darwin) setup 5023b4e3dcbSSimon L. B. Nielsen"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", 5033b4e3dcbSSimon L. B. Nielsen"darwin-ppc-cc","cc:-O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 5043b4e3dcbSSimon L. B. Nielsen"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 5053b4e3dcbSSimon L. B. Nielsen"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", 5065c87c606SMark Murray 5075c87c606SMark Murray##### A/UX 5085c87c606SMark Murray"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", 509f579bf8eSKris Kennaway 510ddd58736SKris Kennaway##### Sony NEWS-OS 4.x 5115c87c606SMark Murray"newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::", 5125c87c606SMark Murray 5135c87c606SMark Murray##### GNU Hurd 5143b4e3dcbSSimon L. B. Nielsen"hurd-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC", 5155c87c606SMark Murray 5165c87c606SMark Murray##### OS/2 EMX 5175c87c606SMark Murray"OS2-EMX", "gcc::::::::", 518ddd58736SKris Kennaway 519c1803d78SJacques Vidrine##### VxWorks for various targets 5205c87c606SMark Murray"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", 5215c87c606SMark Murray"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::", 5223b4e3dcbSSimon L. B. Nielsen"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::", 52350ef0093SJacques Vidrine"vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", 5243b4e3dcbSSimon L. B. Nielsen"vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::${no_asm}::::::ranlibmips:", 5255c87c606SMark Murray 5265c87c606SMark Murray##### Compaq Non-Stop Kernel (Tandem) 5275c87c606SMark Murray"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::", 528c1803d78SJacques Vidrine 52974664626SKris Kennaway); 53074664626SKris Kennaway 5313b4e3dcbSSimon L. B. Nielsenmy @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A 5323b4e3dcbSSimon L. B. Nielsen VC-NT VC-CE VC-WIN32 5333b4e3dcbSSimon L. B. Nielsen BC-32 OS2-EMX netware-clib netware-libc netware-libc-bsdsock); 53474664626SKris Kennaway 535c1803d78SJacques Vidrinemy $idx = 0; 536c1803d78SJacques Vidrinemy $idx_cc = $idx++; 537c1803d78SJacques Vidrinemy $idx_cflags = $idx++; 538c1803d78SJacques Vidrinemy $idx_unistd = $idx++; 539c1803d78SJacques Vidrinemy $idx_thread_cflag = $idx++; 5405c87c606SMark Murraymy $idx_sys_id = $idx++; 541c1803d78SJacques Vidrinemy $idx_lflags = $idx++; 542c1803d78SJacques Vidrinemy $idx_bn_ops = $idx++; 5433b4e3dcbSSimon L. B. Nielsenmy $idx_cpuid_obj = $idx++; 544c1803d78SJacques Vidrinemy $idx_bn_obj = $idx++; 545c1803d78SJacques Vidrinemy $idx_des_obj = $idx++; 5463b4e3dcbSSimon L. B. Nielsenmy $idx_aes_obj = $idx++; 547c1803d78SJacques Vidrinemy $idx_bf_obj = $idx++; 548c1803d78SJacques Vidrinemy $idx_md5_obj = $idx++; 549c1803d78SJacques Vidrinemy $idx_sha1_obj = $idx++; 550c1803d78SJacques Vidrinemy $idx_cast_obj = $idx++; 551c1803d78SJacques Vidrinemy $idx_rc4_obj = $idx++; 552c1803d78SJacques Vidrinemy $idx_rmd160_obj = $idx++; 553c1803d78SJacques Vidrinemy $idx_rc5_obj = $idx++; 554c1803d78SJacques Vidrinemy $idx_dso_scheme = $idx++; 555c1803d78SJacques Vidrinemy $idx_shared_target = $idx++; 556c1803d78SJacques Vidrinemy $idx_shared_cflag = $idx++; 557c1803d78SJacques Vidrinemy $idx_shared_ldflag = $idx++; 558c1803d78SJacques Vidrinemy $idx_shared_extension = $idx++; 559c1803d78SJacques Vidrinemy $idx_ranlib = $idx++; 5605c87c606SMark Murraymy $idx_arflags = $idx++; 561c1803d78SJacques Vidrine 56274664626SKris Kennawaymy $prefix=""; 56374664626SKris Kennawaymy $openssldir=""; 5645740a5e3SKris Kennawaymy $exe_ext=""; 56574664626SKris Kennawaymy $install_prefix=""; 56674664626SKris Kennawaymy $no_threads=0; 56774664626SKris Kennawaymy $threads=0; 5683b4e3dcbSSimon L. B. Nielsenmy $no_shared=0; # but "no-shared" is default 5693b4e3dcbSSimon L. B. Nielsenmy $zlib=1; # but "no-zlib" is default 5703b4e3dcbSSimon L. B. Nielsenmy $no_krb5=0; # but "no-krb5" is implied unless "--with-krb5-..." is used 57174664626SKris Kennawaymy $no_asm=0; 572ddd58736SKris Kennawaymy $no_dso=0; 5733b4e3dcbSSimon L. B. Nielsenmy $no_gmp=0; 57474664626SKris Kennawaymy @skip=(); 5756be8ae07SJacques Vidrinemy $Makefile="Makefile"; 57674664626SKris Kennawaymy $des_locl="crypto/des/des_locl.h"; 57774664626SKris Kennawaymy $des ="crypto/des/des.h"; 57874664626SKris Kennawaymy $bn ="crypto/bn/bn.h"; 57974664626SKris Kennawaymy $md2 ="crypto/md2/md2.h"; 58074664626SKris Kennawaymy $rc4 ="crypto/rc4/rc4.h"; 58174664626SKris Kennawaymy $rc4_locl="crypto/rc4/rc4_locl.h"; 58274664626SKris Kennawaymy $idea ="crypto/idea/idea.h"; 58374664626SKris Kennawaymy $rc2 ="crypto/rc2/rc2.h"; 58474664626SKris Kennawaymy $bf ="crypto/bf/bf_locl.h"; 58574664626SKris Kennawaymy $bn_asm ="bn_asm.o"; 58674664626SKris Kennawaymy $des_enc="des_enc.o fcrypt_b.o"; 5873b4e3dcbSSimon L. B. Nielsenmy $aes_enc="aes_core.o aes_cbc.o"; 58874664626SKris Kennawaymy $bf_enc ="bf_enc.o"; 58974664626SKris Kennawaymy $cast_enc="c_enc.o"; 59074664626SKris Kennawaymy $rc4_enc="rc4_enc.o"; 59174664626SKris Kennawaymy $rc5_enc="rc5_enc.o"; 59274664626SKris Kennawaymy $md5_obj=""; 59374664626SKris Kennawaymy $sha1_obj=""; 59474664626SKris Kennawaymy $rmd160_obj=""; 59574664626SKris Kennawaymy $processor=""; 5965740a5e3SKris Kennawaymy $default_ranlib; 59774664626SKris Kennawaymy $perl; 59874664626SKris Kennaway 5993b4e3dcbSSimon L. B. Nielsen 6003b4e3dcbSSimon L. B. Nielsen# All of the following is disabled by default (RC5 was enabled before 0.9.8): 6013b4e3dcbSSimon L. B. Nielsen 6023b4e3dcbSSimon L. B. Nielsenmy %disabled = ( # "what" => "comment" 603ed5d4f9aSSimon L. B. Nielsen "camellia" => "default", 6043b4e3dcbSSimon L. B. Nielsen "gmp" => "default", 6053b4e3dcbSSimon L. B. Nielsen "mdc2" => "default", 6063b4e3dcbSSimon L. B. Nielsen "rc5" => "default", 6073b4e3dcbSSimon L. B. Nielsen "shared" => "default", 6083b4e3dcbSSimon L. B. Nielsen "zlib" => "default", 6093b4e3dcbSSimon L. B. Nielsen "zlib-dynamic" => "default" 6103b4e3dcbSSimon L. B. Nielsen ); 6113b4e3dcbSSimon L. B. Nielsen 6123b4e3dcbSSimon L. B. Nielsen# Additional "no-..." options will be collected in %disabled. 6133b4e3dcbSSimon L. B. Nielsen# To remove something from %disabled, use e.g. "enable-rc5". 6143b4e3dcbSSimon L. B. Nielsen# For symmetry, "disable-..." is a synonym for "no-...". 6153b4e3dcbSSimon L. B. Nielsen 6163b4e3dcbSSimon L. B. Nielsen# This is what $depflags will look like with the above default: 617ed5d4f9aSSimon L. B. Nielsenmy $default_depflags = "-DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 "; 6183b4e3dcbSSimon L. B. Nielsen 6193b4e3dcbSSimon L. B. Nielsen 6203b4e3dcbSSimon L. B. Nielsenmy $no_sse2=0; 6215c87c606SMark Murray 62274664626SKris Kennaway&usage if ($#ARGV < 0); 62374664626SKris Kennaway 624ddd58736SKris Kennawaymy $flags; 625ddd58736SKris Kennawaymy $depflags; 626ddd58736SKris Kennawaymy $openssl_algorithm_defines; 627ddd58736SKris Kennawaymy $openssl_thread_defines; 6285c87c606SMark Murraymy $openssl_sys_defines=""; 629ddd58736SKris Kennawaymy $openssl_other_defines; 630ddd58736SKris Kennawaymy $libs; 631fceca8a3SJacques Vidrinemy $libkrb5=""; 632ddd58736SKris Kennawaymy $target; 633ddd58736SKris Kennawaymy $options; 634ddd58736SKris Kennawaymy $symlink; 6355c87c606SMark Murraymy $make_depend=0; 6365c87c606SMark Murraymy %withargs=(); 637ddd58736SKris Kennaway 638ddd58736SKris Kennawaymy @argvcopy=@ARGV; 639ddd58736SKris Kennawaymy $argvstring=""; 640ddd58736SKris Kennawaymy $argv_unprocessed=1; 641ddd58736SKris Kennaway 642ddd58736SKris Kennawaywhile($argv_unprocessed) 643ddd58736SKris Kennaway { 644ddd58736SKris Kennaway $flags=""; 645ddd58736SKris Kennaway $depflags=""; 646ddd58736SKris Kennaway $openssl_algorithm_defines=""; 647ddd58736SKris Kennaway $openssl_thread_defines=""; 6485c87c606SMark Murray $openssl_sys_defines=""; 649ddd58736SKris Kennaway $openssl_other_defines=""; 650ddd58736SKris Kennaway $libs=""; 651ddd58736SKris Kennaway $target=""; 652ddd58736SKris Kennaway $options=""; 653ddd58736SKris Kennaway $symlink=1; 654ddd58736SKris Kennaway 655ddd58736SKris Kennaway $argv_unprocessed=0; 656ddd58736SKris Kennaway $argvstring=join(' ',@argvcopy); 657ddd58736SKris Kennaway 658ddd58736SKris KennawayPROCESS_ARGS: 659ddd58736SKris Kennaway foreach (@argvcopy) 66074664626SKris Kennaway { 661f579bf8eSKris Kennaway s /^-no-/no-/; # some people just can't read the instructions 6623b4e3dcbSSimon L. B. Nielsen 6633b4e3dcbSSimon L. B. Nielsen # rewrite some options in "enable-..." form 6643b4e3dcbSSimon L. B. Nielsen s /^-?-?shared$/enable-shared/; 6653b4e3dcbSSimon L. B. Nielsen s /^threads$/enable-threads/; 6663b4e3dcbSSimon L. B. Nielsen s /^zlib$/enable-zlib/; 6673b4e3dcbSSimon L. B. Nielsen s /^zlib-dynamic$/enable-zlib-dynamic/; 6683b4e3dcbSSimon L. B. Nielsen 6693b4e3dcbSSimon L. B. Nielsen if (/^no-(.+)$/ || /^disable-(.+)$/) 6703b4e3dcbSSimon L. B. Nielsen { 6713b4e3dcbSSimon L. B. Nielsen if ($1 eq "ssl") 6723b4e3dcbSSimon L. B. Nielsen { 6733b4e3dcbSSimon L. B. Nielsen $disabled{"ssl2"} = "option(ssl)"; 6743b4e3dcbSSimon L. B. Nielsen $disabled{"ssl3"} = "option(ssl)"; 6753b4e3dcbSSimon L. B. Nielsen } 6763b4e3dcbSSimon L. B. Nielsen elsif ($1 eq "tls") 6773b4e3dcbSSimon L. B. Nielsen { 6783b4e3dcbSSimon L. B. Nielsen $disabled{"tls1"} = "option(tls)" 6793b4e3dcbSSimon L. B. Nielsen } 6803b4e3dcbSSimon L. B. Nielsen else 6813b4e3dcbSSimon L. B. Nielsen { 6823b4e3dcbSSimon L. B. Nielsen $disabled{$1} = "option"; 6833b4e3dcbSSimon L. B. Nielsen } 6843b4e3dcbSSimon L. B. Nielsen } 6853b4e3dcbSSimon L. B. Nielsen elsif (/^enable-(.+)$/) 6863b4e3dcbSSimon L. B. Nielsen { 6873b4e3dcbSSimon L. B. Nielsen delete $disabled{$1}; 6883b4e3dcbSSimon L. B. Nielsen 6893b4e3dcbSSimon L. B. Nielsen $threads = 1 if ($1 eq "threads"); 6903b4e3dcbSSimon L. B. Nielsen } 6913b4e3dcbSSimon L. B. Nielsen elsif (/^--test-sanity$/) 692c1803d78SJacques Vidrine { 693c1803d78SJacques Vidrine exit(&test_sanity()); 694c1803d78SJacques Vidrine } 695ddd58736SKris Kennaway elsif (/^reconfigure/ || /^reconf/) 696ddd58736SKris Kennaway { 697ddd58736SKris Kennaway if (open(IN,"<$Makefile")) 698ddd58736SKris Kennaway { 699ddd58736SKris Kennaway while (<IN>) 700ddd58736SKris Kennaway { 7013b4e3dcbSSimon L. B. Nielsen chomp; 702ddd58736SKris Kennaway if (/^CONFIGURE_ARGS=(.*)/) 703ddd58736SKris Kennaway { 704ddd58736SKris Kennaway $argvstring=$1; 705ddd58736SKris Kennaway @argvcopy=split(' ',$argvstring); 706ddd58736SKris Kennaway die "Incorrect data to reconfigure, please do a normal configuration\n" 707ddd58736SKris Kennaway if (grep(/^reconf/,@argvcopy)); 708ddd58736SKris Kennaway print "Reconfiguring with: $argvstring\n"; 709ddd58736SKris Kennaway $argv_unprocessed=1; 710ddd58736SKris Kennaway close(IN); 711ddd58736SKris Kennaway last PROCESS_ARGS; 712ddd58736SKris Kennaway } 713ddd58736SKris Kennaway } 714ddd58736SKris Kennaway close(IN); 715ddd58736SKris Kennaway } 716ddd58736SKris Kennaway die "Insufficient data to reconfigure, please do a normal configuration\n"; 717ddd58736SKris Kennaway } 71874664626SKris Kennaway elsif (/^386$/) 71974664626SKris Kennaway { $processor=386; } 72074664626SKris Kennaway elsif (/^rsaref$/) 72174664626SKris Kennaway { 7225c87c606SMark Murray # No RSAref support any more since it's not needed. 7235c87c606SMark Murray # The check for the option is there so scripts aren't 7245c87c606SMark Murray # broken 72574664626SKris Kennaway } 72674664626SKris Kennaway elsif (/^[-+]/) 72774664626SKris Kennaway { 72874664626SKris Kennaway if (/^-[lL](.*)$/) 72974664626SKris Kennaway { 73074664626SKris Kennaway $libs.=$_." "; 73174664626SKris Kennaway } 73274664626SKris Kennaway elsif (/^-[^-]/ or /^\+/) 73374664626SKris Kennaway { 73474664626SKris Kennaway $flags.=$_." "; 73574664626SKris Kennaway } 73674664626SKris Kennaway elsif (/^--prefix=(.*)$/) 73774664626SKris Kennaway { 73874664626SKris Kennaway $prefix=$1; 73974664626SKris Kennaway } 74074664626SKris Kennaway elsif (/^--openssldir=(.*)$/) 74174664626SKris Kennaway { 74274664626SKris Kennaway $openssldir=$1; 74374664626SKris Kennaway } 74474664626SKris Kennaway elsif (/^--install.prefix=(.*)$/) 74574664626SKris Kennaway { 74674664626SKris Kennaway $install_prefix=$1; 74774664626SKris Kennaway } 7485c87c606SMark Murray elsif (/^--with-krb5-(dir|lib|include|flavor)=(.*)$/) 7495c87c606SMark Murray { 7505c87c606SMark Murray $withargs{"krb5-".$1}=$2; 7515c87c606SMark Murray } 7523b4e3dcbSSimon L. B. Nielsen elsif (/^--with-zlib-lib=(.*)$/) 7533b4e3dcbSSimon L. B. Nielsen { 7543b4e3dcbSSimon L. B. Nielsen $withargs{"zlib-lib"}=$1; 7553b4e3dcbSSimon L. B. Nielsen } 7563b4e3dcbSSimon L. B. Nielsen elsif (/^--with-zlib-include=(.*)$/) 7573b4e3dcbSSimon L. B. Nielsen { 7583b4e3dcbSSimon L. B. Nielsen $withargs{"zlib-include"}="-I$1"; 7593b4e3dcbSSimon L. B. Nielsen } 76074664626SKris Kennaway else 76174664626SKris Kennaway { 76274664626SKris Kennaway print STDERR $usage; 76374664626SKris Kennaway exit(1); 76474664626SKris Kennaway } 76574664626SKris Kennaway } 76674664626SKris Kennaway elsif ($_ =~ /^([^:]+):(.+)$/) 76774664626SKris Kennaway { 76874664626SKris Kennaway eval "\$table{\$1} = \"$2\""; # allow $xxx constructs in the string 76974664626SKris Kennaway $target=$1; 77074664626SKris Kennaway } 77174664626SKris Kennaway else 77274664626SKris Kennaway { 7733b4e3dcbSSimon L. B. Nielsen die "target already defined - $target (offending arg: $_)\n" if ($target ne ""); 77474664626SKris Kennaway $target=$_; 77574664626SKris Kennaway } 77674664626SKris Kennaway 7773b4e3dcbSSimon L. B. Nielsen unless ($_ eq $target || /^no-/ || /^disable-/) 7785c87c606SMark Murray { 7793b4e3dcbSSimon L. B. Nielsen # "no-..." follows later after implied disactivations 7803b4e3dcbSSimon L. B. Nielsen # have been derived. (Don't take this too seroiusly, 7813b4e3dcbSSimon L. B. Nielsen # we really only write OPTIONS to the Makefile out of 7823b4e3dcbSSimon L. B. Nielsen # nostalgia.) 7833b4e3dcbSSimon L. B. Nielsen 7843b4e3dcbSSimon L. B. Nielsen if ($options eq "") 7853b4e3dcbSSimon L. B. Nielsen { $options = $_; } 7863b4e3dcbSSimon L. B. Nielsen else 7873b4e3dcbSSimon L. B. Nielsen { $options .= " ".$_; } 7883b4e3dcbSSimon L. B. Nielsen } 7893b4e3dcbSSimon L. B. Nielsen } 7905c87c606SMark Murray } 7915c87c606SMark Murray 7923b4e3dcbSSimon L. B. Nielsen 7933b4e3dcbSSimon L. B. Nielsen 7943b4e3dcbSSimon L. B. Nielsenif ($processor eq "386") 7955c87c606SMark Murray { 7963b4e3dcbSSimon L. B. Nielsen $disabled{"sse2"} = "forced"; 7975c87c606SMark Murray } 7985c87c606SMark Murray 7993b4e3dcbSSimon L. B. Nielsenif (!defined($withargs{"krb5-flavor"}) || $withargs{"krb5-flavor"} eq "") 8005c87c606SMark Murray { 8013b4e3dcbSSimon L. B. Nielsen $disabled{"krb5"} = "krb5-flavor not specified"; 8025c87c606SMark Murray } 8035c87c606SMark Murray 8043b4e3dcbSSimon L. B. Nielsenif (!defined($disabled{"zlib-dynamic"})) 8053b4e3dcbSSimon L. B. Nielsen { 8063b4e3dcbSSimon L. B. Nielsen # "zlib-dynamic" was specifically enabled, so enable "zlib" 8073b4e3dcbSSimon L. B. Nielsen delete $disabled{"zlib"}; 8083b4e3dcbSSimon L. B. Nielsen } 8093b4e3dcbSSimon L. B. Nielsen 8103b4e3dcbSSimon L. B. Nielsenif (defined($disabled{"rijndael"})) 8113b4e3dcbSSimon L. B. Nielsen { 8123b4e3dcbSSimon L. B. Nielsen $disabled{"aes"} = "forced"; 8133b4e3dcbSSimon L. B. Nielsen } 8143b4e3dcbSSimon L. B. Nielsenif (defined($disabled{"des"})) 8153b4e3dcbSSimon L. B. Nielsen { 8163b4e3dcbSSimon L. B. Nielsen $disabled{"mdc2"} = "forced"; 8173b4e3dcbSSimon L. B. Nielsen } 8183b4e3dcbSSimon L. B. Nielsenif (defined($disabled{"ec"})) 8193b4e3dcbSSimon L. B. Nielsen { 8203b4e3dcbSSimon L. B. Nielsen $disabled{"ecdsa"} = "forced"; 8213b4e3dcbSSimon L. B. Nielsen $disabled{"ecdh"} = "forced"; 8223b4e3dcbSSimon L. B. Nielsen } 8233b4e3dcbSSimon L. B. Nielsen 8243b4e3dcbSSimon L. B. Nielsen# SSL 2.0 requires MD5 and RSA 8253b4e3dcbSSimon L. B. Nielsenif (defined($disabled{"md5"}) || defined($disabled{"rsa"})) 8263b4e3dcbSSimon L. B. Nielsen { 8273b4e3dcbSSimon L. B. Nielsen $disabled{"ssl2"} = "forced"; 8283b4e3dcbSSimon L. B. Nielsen } 8293b4e3dcbSSimon L. B. Nielsen 8303b4e3dcbSSimon L. B. Nielsen# SSL 3.0 and TLS requires MD5 and SHA and either RSA or DSA+DH 8313b4e3dcbSSimon L. B. Nielsenif (defined($disabled{"md5"}) || defined($disabled{"sha"}) 8323b4e3dcbSSimon L. B. Nielsen || (defined($disabled{"rsa"}) 8333b4e3dcbSSimon L. B. Nielsen && (defined($disabled{"dsa"}) || defined($disabled{"dh"})))) 8343b4e3dcbSSimon L. B. Nielsen { 8353b4e3dcbSSimon L. B. Nielsen $disabled{"ssl3"} = "forced"; 8363b4e3dcbSSimon L. B. Nielsen $disabled{"tls1"} = "forced"; 8373b4e3dcbSSimon L. B. Nielsen } 8383b4e3dcbSSimon L. B. Nielsen 8393b4e3dcbSSimon L. B. Nielsen 84074664626SKris Kennawayif ($target eq "TABLE") { 84174664626SKris Kennaway foreach $target (sort keys %table) { 84274664626SKris Kennaway print_table_entry($target); 84374664626SKris Kennaway } 84474664626SKris Kennaway exit 0; 84574664626SKris Kennaway} 84674664626SKris Kennaway 847f579bf8eSKris Kennawayif ($target eq "LIST") { 848f579bf8eSKris Kennaway foreach (sort keys %table) { 849f579bf8eSKris Kennaway print; 850f579bf8eSKris Kennaway print "\n"; 851f579bf8eSKris Kennaway } 852f579bf8eSKris Kennaway exit 0; 853f579bf8eSKris Kennaway} 854f579bf8eSKris Kennaway 855c1803d78SJacques Vidrineif ($target =~ m/^CygWin32(-.*)$/) { 856c1803d78SJacques Vidrine $target = "Cygwin".$1; 857c1803d78SJacques Vidrine} 858c1803d78SJacques Vidrine 859ddd58736SKris Kennawayprint "Configuring for $target\n"; 860ddd58736SKris Kennaway 86174664626SKris Kennaway&usage if (!defined($table{$target})); 86274664626SKris Kennaway 86374664626SKris Kennaway 8643b4e3dcbSSimon L. B. Nielsenforeach (sort (keys %disabled)) 8653b4e3dcbSSimon L. B. Nielsen { 8663b4e3dcbSSimon L. B. Nielsen $options .= " no-$_"; 8673b4e3dcbSSimon L. B. Nielsen 8683b4e3dcbSSimon L. B. Nielsen printf " no-%-12s %-10s", $_, "[$disabled{$_}]"; 8693b4e3dcbSSimon L. B. Nielsen 8703b4e3dcbSSimon L. B. Nielsen if (/^dso$/) 8713b4e3dcbSSimon L. B. Nielsen { $no_dso = 1; } 8723b4e3dcbSSimon L. B. Nielsen elsif (/^threads$/) 8733b4e3dcbSSimon L. B. Nielsen { $no_threads = 1; } 8743b4e3dcbSSimon L. B. Nielsen elsif (/^shared$/) 8753b4e3dcbSSimon L. B. Nielsen { $no_shared = 1; } 8763b4e3dcbSSimon L. B. Nielsen elsif (/^zlib$/) 8773b4e3dcbSSimon L. B. Nielsen { $zlib = 0; } 8783b4e3dcbSSimon L. B. Nielsen elsif (/^static-engine$/) 8793b4e3dcbSSimon L. B. Nielsen { } 8803b4e3dcbSSimon L. B. Nielsen elsif (/^zlib-dynamic$/) 8813b4e3dcbSSimon L. B. Nielsen { } 8823b4e3dcbSSimon L. B. Nielsen elsif (/^symlinks$/) 8833b4e3dcbSSimon L. B. Nielsen { $symlink = 0; } 8843b4e3dcbSSimon L. B. Nielsen elsif (/^sse2$/) 8853b4e3dcbSSimon L. B. Nielsen { $no_sse2 = 1; } 8863b4e3dcbSSimon L. B. Nielsen else 8873b4e3dcbSSimon L. B. Nielsen { 8883b4e3dcbSSimon L. B. Nielsen my ($ALGO, $algo); 8893b4e3dcbSSimon L. B. Nielsen ($ALGO = $algo = $_) =~ tr/[a-z]/[A-Z]/; 8903b4e3dcbSSimon L. B. Nielsen 8913b4e3dcbSSimon L. B. Nielsen if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/) 8923b4e3dcbSSimon L. B. Nielsen { 8933b4e3dcbSSimon L. B. Nielsen $openssl_other_defines .= "#define OPENSSL_NO_$ALGO\n"; 8943b4e3dcbSSimon L. B. Nielsen print " OPENSSL_NO_$ALGO"; 8953b4e3dcbSSimon L. B. Nielsen 8963b4e3dcbSSimon L. B. Nielsen if (/^err$/) { $flags .= "-DOPENSSL_NO_ERR "; } 8973b4e3dcbSSimon L. B. Nielsen elsif (/^asm$/) { $no_asm = 1; } 8983b4e3dcbSSimon L. B. Nielsen } 8993b4e3dcbSSimon L. B. Nielsen else 9003b4e3dcbSSimon L. B. Nielsen { 9013b4e3dcbSSimon L. B. Nielsen $openssl_algorithm_defines .= "#define OPENSSL_NO_$ALGO\n"; 9023b4e3dcbSSimon L. B. Nielsen print " OPENSSL_NO_$ALGO"; 9033b4e3dcbSSimon L. B. Nielsen 9043b4e3dcbSSimon L. B. Nielsen if (/^krb5$/) 9053b4e3dcbSSimon L. B. Nielsen { $no_krb5 = 1; } 9063b4e3dcbSSimon L. B. Nielsen else 9073b4e3dcbSSimon L. B. Nielsen { 9083b4e3dcbSSimon L. B. Nielsen push @skip, $algo; 9093b4e3dcbSSimon L. B. Nielsen print " (skip dir)"; 9103b4e3dcbSSimon L. B. Nielsen 9113b4e3dcbSSimon L. B. Nielsen $depflags .="-DOPENSSL_NO_$ALGO "; 9123b4e3dcbSSimon L. B. Nielsen } 9133b4e3dcbSSimon L. B. Nielsen } 9143b4e3dcbSSimon L. B. Nielsen } 9153b4e3dcbSSimon L. B. Nielsen 9163b4e3dcbSSimon L. B. Nielsen print "\n"; 9173b4e3dcbSSimon L. B. Nielsen } 9183b4e3dcbSSimon L. B. Nielsen 9193b4e3dcbSSimon L. B. Nielsen 9203b4e3dcbSSimon L. B. Nielsenmy $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds; 9213b4e3dcbSSimon L. B. Nielsen 922ed5d4f9aSSimon L. B. Nielsen$IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin" && !is_msys()); 9233b4e3dcbSSimon L. B. Nielsen 9243b4e3dcbSSimon L. B. Nielsen$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw"); 9253b4e3dcbSSimon L. B. Nielsen$exe_ext=".pm" if ($target =~ /vos/); 92674664626SKris Kennaway$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq ""); 92774664626SKris Kennaway$prefix=$openssldir if $prefix eq ""; 92874664626SKris Kennaway 9296be8ae07SJacques Vidrine$default_ranlib= &which("ranlib") or $default_ranlib="true"; 9306be8ae07SJacques Vidrine$perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl") 9316be8ae07SJacques Vidrine or $perl="perl"; 9326be8ae07SJacques Vidrine 93374664626SKris Kennawaychop $openssldir if $openssldir =~ /\/$/; 93474664626SKris Kennawaychop $prefix if $prefix =~ /\/$/; 93574664626SKris Kennaway 93674664626SKris Kennaway$openssldir=$prefix . "/ssl" if $openssldir eq ""; 9375c87c606SMark Murray$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/; 93874664626SKris Kennaway 93974664626SKris Kennaway 9403b4e3dcbSSimon L. B. Nielsenprint "IsMK1MF=$IsMK1MF\n"; 94174664626SKris Kennaway 942c1803d78SJacques Vidrinemy @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); 943c1803d78SJacques Vidrinemy $cc = $fields[$idx_cc]; 944c1803d78SJacques Vidrinemy $cflags = $fields[$idx_cflags]; 945c1803d78SJacques Vidrinemy $unistd = $fields[$idx_unistd]; 946c1803d78SJacques Vidrinemy $thread_cflag = $fields[$idx_thread_cflag]; 9475c87c606SMark Murraymy $sys_id = $fields[$idx_sys_id]; 948c1803d78SJacques Vidrinemy $lflags = $fields[$idx_lflags]; 949c1803d78SJacques Vidrinemy $bn_ops = $fields[$idx_bn_ops]; 9503b4e3dcbSSimon L. B. Nielsenmy $cpuid_obj = $fields[$idx_cpuid_obj]; 951c1803d78SJacques Vidrinemy $bn_obj = $fields[$idx_bn_obj]; 952c1803d78SJacques Vidrinemy $des_obj = $fields[$idx_des_obj]; 9533b4e3dcbSSimon L. B. Nielsenmy $aes_obj = $fields[$idx_aes_obj]; 954c1803d78SJacques Vidrinemy $bf_obj = $fields[$idx_bf_obj]; 9553b4e3dcbSSimon L. B. Nielsenmy $md5_obj = $fields[$idx_md5_obj]; 9563b4e3dcbSSimon L. B. Nielsenmy $sha1_obj = $fields[$idx_sha1_obj]; 957c1803d78SJacques Vidrinemy $cast_obj = $fields[$idx_cast_obj]; 958c1803d78SJacques Vidrinemy $rc4_obj = $fields[$idx_rc4_obj]; 9593b4e3dcbSSimon L. B. Nielsenmy $rmd160_obj = $fields[$idx_rmd160_obj]; 960c1803d78SJacques Vidrinemy $rc5_obj = $fields[$idx_rc5_obj]; 961c1803d78SJacques Vidrinemy $dso_scheme = $fields[$idx_dso_scheme]; 962c1803d78SJacques Vidrinemy $shared_target = $fields[$idx_shared_target]; 963c1803d78SJacques Vidrinemy $shared_cflag = $fields[$idx_shared_cflag]; 964c1803d78SJacques Vidrinemy $shared_ldflag = $fields[$idx_shared_ldflag]; 965c1803d78SJacques Vidrinemy $shared_extension = $fields[$idx_shared_extension]; 966c1803d78SJacques Vidrinemy $ranlib = $fields[$idx_ranlib]; 9675c87c606SMark Murraymy $arflags = $fields[$idx_arflags]; 968c1803d78SJacques Vidrine 969fceca8a3SJacques Vidrinemy $no_shared_warn=0; 9703b4e3dcbSSimon L. B. Nielsenmy $no_user_cflags=0; 971fceca8a3SJacques Vidrine 9723b4e3dcbSSimon L. B. Nielsenif ($flags ne "") { $cflags="$flags$cflags"; } 9733b4e3dcbSSimon L. B. Nielsenelse { $no_user_cflags=1; } 97474664626SKris Kennaway 9755c87c606SMark Murray# Kerberos settings. The flavor must be provided from outside, either through 9765c87c606SMark Murray# the script "config" or manually. 9773b4e3dcbSSimon L. B. Nielsenif (!$no_krb5) 9785c87c606SMark Murray { 9795c87c606SMark Murray my ($lresolv, $lpath, $lext); 9805c87c606SMark Murray if ($withargs{"krb5-flavor"} =~ /^[Hh]eimdal$/) 9815c87c606SMark Murray { 9825c87c606SMark Murray die "Sorry, Heimdal is currently not supported\n"; 9835c87c606SMark Murray } 9845c87c606SMark Murray ##### HACK to force use of Heimdal. 9855c87c606SMark Murray ##### WARNING: Since we don't really have adequate support for Heimdal, 9865c87c606SMark Murray ##### using this will break the build. You'll have to make 9875c87c606SMark Murray ##### changes to the source, and if you do, please send 9885c87c606SMark Murray ##### patches to openssl-dev@openssl.org 9895c87c606SMark Murray if ($withargs{"krb5-flavor"} =~ /^force-[Hh]eimdal$/) 9905c87c606SMark Murray { 9915c87c606SMark Murray warn "Heimdal isn't really supported. Your build WILL break\n"; 9925c87c606SMark Murray warn "If you fix the problems, please send a patch to openssl-dev\@openssl.org\n"; 9935c87c606SMark Murray $withargs{"krb5-dir"} = "/usr/heimdal" 9945c87c606SMark Murray if $withargs{"krb5-dir"} eq ""; 9955c87c606SMark Murray $withargs{"krb5-lib"} = "-L".$withargs{"krb5-dir"}. 9965c87c606SMark Murray "/lib -lgssapi -lkrb5 -lcom_err" 9973b4e3dcbSSimon L. B. Nielsen if $withargs{"krb5-lib"} eq "" && !$IsMK1MF; 9985c87c606SMark Murray $cflags="-DKRB5_HEIMDAL $cflags"; 9995c87c606SMark Murray } 10005c87c606SMark Murray if ($withargs{"krb5-flavor"} =~ /^[Mm][Ii][Tt]/) 10015c87c606SMark Murray { 10025c87c606SMark Murray $withargs{"krb5-dir"} = "/usr/kerberos" 10035c87c606SMark Murray if $withargs{"krb5-dir"} eq ""; 10045c87c606SMark Murray $withargs{"krb5-lib"} = "-L".$withargs{"krb5-dir"}. 10055c87c606SMark Murray "/lib -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto" 10063b4e3dcbSSimon L. B. Nielsen if $withargs{"krb5-lib"} eq "" && !$IsMK1MF; 10075c87c606SMark Murray $cflags="-DKRB5_MIT $cflags"; 10085c87c606SMark Murray $withargs{"krb5-flavor"} =~ s/^[Mm][Ii][Tt][._-]*//; 10095c87c606SMark Murray if ($withargs{"krb5-flavor"} =~ /^1[._-]*[01]/) 10105c87c606SMark Murray { 10115c87c606SMark Murray $cflags="-DKRB5_MIT_OLD11 $cflags"; 10125c87c606SMark Murray } 10135c87c606SMark Murray } 10145c87c606SMark Murray LRESOLV: 10155c87c606SMark Murray foreach $lpath ("/lib", "/usr/lib") 10165c87c606SMark Murray { 10175c87c606SMark Murray foreach $lext ("a", "so") 10185c87c606SMark Murray { 10195c87c606SMark Murray $lresolv = "$lpath/libresolv.$lext"; 10205c87c606SMark Murray last LRESOLV if (-r "$lresolv"); 10215c87c606SMark Murray $lresolv = ""; 10225c87c606SMark Murray } 10235c87c606SMark Murray } 10245c87c606SMark Murray $withargs{"krb5-lib"} .= " -lresolv" 10255c87c606SMark Murray if ("$lresolv" ne ""); 10265c87c606SMark Murray $withargs{"krb5-include"} = "-I".$withargs{"krb5-dir"}."/include" 10275c87c606SMark Murray if $withargs{"krb5-include"} eq "" && 10285c87c606SMark Murray $withargs{"krb5-dir"} ne ""; 10295c87c606SMark Murray } 10305c87c606SMark Murray 1031ddd58736SKris Kennaway# The DSO code currently always implements all functions so that no 1032ddd58736SKris Kennaway# applications will have to worry about that from a compilation point 1033ddd58736SKris Kennaway# of view. However, the "method"s may return zero unless that platform 1034ddd58736SKris Kennaway# has support compiled in for them. Currently each method is enabled 1035ddd58736SKris Kennaway# by a define "DSO_<name>" ... we translate the "dso_scheme" config 1036ddd58736SKris Kennaway# string entry into using the following logic; 1037ddd58736SKris Kennawaymy $dso_cflags; 1038ddd58736SKris Kennawayif (!$no_dso && $dso_scheme ne "") 1039ddd58736SKris Kennaway { 1040ddd58736SKris Kennaway $dso_scheme =~ tr/[a-z]/[A-Z]/; 1041ddd58736SKris Kennaway if ($dso_scheme eq "DLFCN") 1042ddd58736SKris Kennaway { 1043ddd58736SKris Kennaway $dso_cflags = "-DDSO_DLFCN -DHAVE_DLFCN_H"; 1044ddd58736SKris Kennaway } 1045ddd58736SKris Kennaway elsif ($dso_scheme eq "DLFCN_NO_H") 1046ddd58736SKris Kennaway { 1047ddd58736SKris Kennaway $dso_cflags = "-DDSO_DLFCN"; 1048ddd58736SKris Kennaway } 1049ddd58736SKris Kennaway else 1050ddd58736SKris Kennaway { 1051ddd58736SKris Kennaway $dso_cflags = "-DDSO_$dso_scheme"; 1052ddd58736SKris Kennaway } 1053ddd58736SKris Kennaway $cflags = "$dso_cflags $cflags"; 1054ddd58736SKris Kennaway } 1055ddd58736SKris Kennaway 105674664626SKris Kennawaymy $thread_cflags; 1057f579bf8eSKris Kennawaymy $thread_defines; 105874664626SKris Kennawayif ($thread_cflag ne "(unknown)" && !$no_threads) 105974664626SKris Kennaway { 106074664626SKris Kennaway # If we know how to do it, support threads by default. 106174664626SKris Kennaway $threads = 1; 106274664626SKris Kennaway } 10633b4e3dcbSSimon L. B. Nielsenif ($thread_cflag eq "(unknown)" && $threads) 106474664626SKris Kennaway { 10653b4e3dcbSSimon L. B. Nielsen # If the user asked for "threads", [s]he is also expected to 10663b4e3dcbSSimon L. B. Nielsen # provide any system-dependent compiler options that are 10673b4e3dcbSSimon L. B. Nielsen # necessary. 10683b4e3dcbSSimon L. B. Nielsen if ($no_user_cflags) 10693b4e3dcbSSimon L. B. Nielsen { 10703b4e3dcbSSimon L. B. Nielsen print "You asked for multi-threading support, but didn't\n"; 10713b4e3dcbSSimon L. B. Nielsen print "provide any system-specific compiler options\n"; 10723b4e3dcbSSimon L. B. Nielsen exit(1); 10733b4e3dcbSSimon L. B. Nielsen } 10745c87c606SMark Murray $thread_cflags="-DOPENSSL_THREADS $cflags" ; 10755c87c606SMark Murray $thread_defines .= "#define OPENSSL_THREADS\n"; 107674664626SKris Kennaway } 107774664626SKris Kennawayelse 107874664626SKris Kennaway { 10795c87c606SMark Murray $thread_cflags="-DOPENSSL_THREADS $thread_cflag $cflags"; 10805c87c606SMark Murray $thread_defines .= "#define OPENSSL_THREADS\n"; 1081f579bf8eSKris Kennaway# my $def; 1082f579bf8eSKris Kennaway# foreach $def (split ' ',$thread_cflag) 1083f579bf8eSKris Kennaway# { 1084f579bf8eSKris Kennaway# if ($def =~ s/^-D// && $def !~ /^_/) 1085f579bf8eSKris Kennaway# { 1086f579bf8eSKris Kennaway# $thread_defines .= "#define $def\n"; 1087f579bf8eSKris Kennaway# } 1088f579bf8eSKris Kennaway# } 108974664626SKris Kennaway } 109074664626SKris Kennaway 109174664626SKris Kennaway$lflags="$libs$lflags" if ($libs ne ""); 109274664626SKris Kennaway 109374664626SKris Kennawayif ($no_asm) 109474664626SKris Kennaway { 10953b4e3dcbSSimon L. B. Nielsen $cpuid_obj=$bn_obj=$des_obj=$aes_obj=$bf_obj=$cast_obj=$rc4_obj=$rc5_obj=""; 109674664626SKris Kennaway $sha1_obj=$md5_obj=$rmd160_obj=""; 109774664626SKris Kennaway } 109874664626SKris Kennaway 10995c87c606SMark Murrayif (!$no_shared) 11005c87c606SMark Murray { 11015c87c606SMark Murray $cast_obj=""; # CAST assembler is not PIC 11025c87c606SMark Murray } 11035c87c606SMark Murray 110474664626SKris Kennawayif ($threads) 110574664626SKris Kennaway { 110674664626SKris Kennaway $cflags=$thread_cflags; 1107f579bf8eSKris Kennaway $openssl_thread_defines .= $thread_defines; 110874664626SKris Kennaway } 110974664626SKris Kennaway 11105c87c606SMark Murrayif ($zlib) 11115c87c606SMark Murray { 11125c87c606SMark Murray $cflags = "-DZLIB $cflags"; 11133b4e3dcbSSimon L. B. Nielsen if (defined($disabled{"zlib-dynamic"})) 11143b4e3dcbSSimon L. B. Nielsen { 11153b4e3dcbSSimon L. B. Nielsen $lflags = "$lflags -lz"; 11163b4e3dcbSSimon L. B. Nielsen } 11173b4e3dcbSSimon L. B. Nielsen else 11183b4e3dcbSSimon L. B. Nielsen { 11193b4e3dcbSSimon L. B. Nielsen $cflags = "-DZLIB_SHARED $cflags"; 11203b4e3dcbSSimon L. B. Nielsen } 11215c87c606SMark Murray } 11225c87c606SMark Murray 1123ddd58736SKris Kennaway# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org 11245740a5e3SKris Kennawaymy $shared_mark = ""; 11255c87c606SMark Murrayif ($shared_target eq "") 11265c87c606SMark Murray { 1127fceca8a3SJacques Vidrine $no_shared_warn = 1 if !$no_shared; 11285c87c606SMark Murray $no_shared = 1; 11295c87c606SMark Murray } 11305c87c606SMark Murrayif (!$no_shared) 11315740a5e3SKris Kennaway { 1132ddd58736SKris Kennaway if ($shared_cflag ne "") 1133ddd58736SKris Kennaway { 11343b4e3dcbSSimon L. B. Nielsen $cflags = "$shared_cflag -DOPENSSL_PIC $cflags"; 11353b4e3dcbSSimon L. B. Nielsen } 11363b4e3dcbSSimon L. B. Nielsen } 11373b4e3dcbSSimon L. B. Nielsen 11383b4e3dcbSSimon L. B. Nielsenif (!$IsMK1MF) 11393b4e3dcbSSimon L. B. Nielsen { 11403b4e3dcbSSimon L. B. Nielsen if ($no_shared) 11413b4e3dcbSSimon L. B. Nielsen { 11423b4e3dcbSSimon L. B. Nielsen $openssl_other_defines.="#define OPENSSL_NO_DYNAMIC_ENGINE\n"; 11433b4e3dcbSSimon L. B. Nielsen } 11443b4e3dcbSSimon L. B. Nielsen else 11453b4e3dcbSSimon L. B. Nielsen { 11463b4e3dcbSSimon L. B. Nielsen $openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n"; 11473b4e3dcbSSimon L. B. Nielsen } 11483b4e3dcbSSimon L. B. Nielsen } 11493b4e3dcbSSimon L. B. Nielsen 11503b4e3dcbSSimon L. B. Nielsen$cpuid_obj.=" uplink.o uplink-cof.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/); 11513b4e3dcbSSimon L. B. Nielsen# Compiler fix-ups 11523b4e3dcbSSimon L. B. Nielsenif ($target =~ /icc$/) 11533b4e3dcbSSimon L. B. Nielsen { 11543b4e3dcbSSimon L. B. Nielsen my($iccver)=`$cc -V 2>&1`; 11553b4e3dcbSSimon L. B. Nielsen if ($iccver =~ /Version ([0-9]+)\./) { $iccver=$1; } 11563b4e3dcbSSimon L. B. Nielsen else { $iccver=0; } 11573b4e3dcbSSimon L. B. Nielsen if ($iccver>=8) 11583b4e3dcbSSimon L. B. Nielsen { 11593b4e3dcbSSimon L. B. Nielsen # Eliminate unnecessary dependency from libirc.a. This is 11603b4e3dcbSSimon L. B. Nielsen # essential for shared library support, as otherwise 11613b4e3dcbSSimon L. B. Nielsen # apps/openssl can end up in endless loop upon startup... 11623b4e3dcbSSimon L. B. Nielsen $cflags.=" -Dmemcpy=__builtin_memcpy -Dmemset=__builtin_memset"; 11635740a5e3SKris Kennaway } 1164ddd58736SKris Kennaway } 11655c87c606SMark Murray 11665c87c606SMark Murrayif ($sys_id ne "") 1167de7cdddaSKris Kennaway { 11683b4e3dcbSSimon L. B. Nielsen #$cflags="-DOPENSSL_SYSNAME_$sys_id $cflags"; 11695c87c606SMark Murray $openssl_sys_defines="#define OPENSSL_SYSNAME_$sys_id\n"; 1170de7cdddaSKris Kennaway } 1171ddd58736SKris Kennaway 11725740a5e3SKris Kennawayif ($ranlib eq "") 11735740a5e3SKris Kennaway { 11745740a5e3SKris Kennaway $ranlib = $default_ranlib; 11755740a5e3SKris Kennaway } 11765740a5e3SKris Kennaway 117774664626SKris Kennaway#my ($bn1)=split(/\s+/,$bn_obj); 117874664626SKris Kennaway#$bn1 = "" unless defined $bn1; 117974664626SKris Kennaway#$bn1=$bn_asm unless ($bn1 =~ /\.o$/); 118074664626SKris Kennaway#$bn_obj="$bn1"; 118174664626SKris Kennaway 11823b4e3dcbSSimon L. B. Nielsen$cpuid_obj="" if ($processor eq "386"); 118374664626SKris Kennaway 11843b4e3dcbSSimon L. B. Nielsen$bn_obj = $bn_asm unless $bn_obj ne ""; 11853b4e3dcbSSimon L. B. Nielsen# bn86* is the only one implementing bn_*_part_words 11863b4e3dcbSSimon L. B. Nielsen$cflags.=" -DOPENSSL_BN_ASM_PART_WORDS" if ($bn_obj =~ /bn86/); 11873b4e3dcbSSimon L. B. Nielsen$cflags.=" -DOPENSSL_IA32_SSE2" if (!$no_sse2 && $bn_obj =~ /bn86/); 11883b4e3dcbSSimon L. B. Nielsen 11893b4e3dcbSSimon L. B. Nielsen$des_obj=$des_enc unless ($des_obj =~ /\.o$/); 119074664626SKris Kennaway$bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/); 119174664626SKris Kennaway$cast_obj=$cast_enc unless ($cast_obj =~ /\.o$/); 119274664626SKris Kennaway$rc4_obj=$rc4_enc unless ($rc4_obj =~ /\.o$/); 119374664626SKris Kennaway$rc5_obj=$rc5_enc unless ($rc5_obj =~ /\.o$/); 11943b4e3dcbSSimon L. B. Nielsenif ($sha1_obj =~ /\.o$/) 119574664626SKris Kennaway { 119674664626SKris Kennaway# $sha1_obj=$sha1_enc; 11973b4e3dcbSSimon L. B. Nielsen $cflags.=" -DSHA1_ASM" if ($sha1_obj =~ /sx86/ || $sha1_obj =~ /sha1/); 11983b4e3dcbSSimon L. B. Nielsen $cflags.=" -DSHA256_ASM" if ($sha1_obj =~ /sha256/); 11993b4e3dcbSSimon L. B. Nielsen $cflags.=" -DSHA512_ASM" if ($sha1_obj =~ /sha512/); 12003b4e3dcbSSimon L. B. Nielsen if ($sha1_obj =~ /x86/) 12013b4e3dcbSSimon L. B. Nielsen { if ($no_sse2) 12023b4e3dcbSSimon L. B. Nielsen { $sha1_obj =~ s/\S*sse2\S+//; } 12033b4e3dcbSSimon L. B. Nielsen elsif ($cflags !~ /OPENSSL_IA32_SSE2/) 12043b4e3dcbSSimon L. B. Nielsen { $cflags.=" -DOPENSSL_IA32_SSE2"; } 12053b4e3dcbSSimon L. B. Nielsen } 120674664626SKris Kennaway } 120774664626SKris Kennawayif ($md5_obj =~ /\.o$/) 120874664626SKris Kennaway { 120974664626SKris Kennaway# $md5_obj=$md5_enc; 121074664626SKris Kennaway $cflags.=" -DMD5_ASM"; 121174664626SKris Kennaway } 121274664626SKris Kennawayif ($rmd160_obj =~ /\.o$/) 121374664626SKris Kennaway { 121474664626SKris Kennaway# $rmd160_obj=$rmd160_enc; 121574664626SKris Kennaway $cflags.=" -DRMD160_ASM"; 121674664626SKris Kennaway } 12173b4e3dcbSSimon L. B. Nielsenif ($aes_obj =~ /\.o$/) 12186be8ae07SJacques Vidrine { 12193b4e3dcbSSimon L. B. Nielsen $cflags.=" -DAES_ASM"; 12203b4e3dcbSSimon L. B. Nielsen } 12213b4e3dcbSSimon L. B. Nielsenelse { 12223b4e3dcbSSimon L. B. Nielsen $aes_obj=$aes_enc; 12236be8ae07SJacques Vidrine } 12246be8ae07SJacques Vidrine 12254f20a5a2SJacques Vidrine# "Stringify" the C flags string. This permits it to be made part of a string 12264f20a5a2SJacques Vidrine# and works as well on command lines. 12274f20a5a2SJacques Vidrine$cflags =~ s/([\\\"])/\\\1/g; 12284f20a5a2SJacques Vidrine 122974664626SKris Kennawaymy $version = "unknown"; 12303b4e3dcbSSimon L. B. Nielsenmy $version_num = "unknown"; 123174664626SKris Kennawaymy $major = "unknown"; 123274664626SKris Kennawaymy $minor = "unknown"; 1233ddd58736SKris Kennawaymy $shlib_version_number = "unknown"; 1234ddd58736SKris Kennawaymy $shlib_version_history = "unknown"; 1235ddd58736SKris Kennawaymy $shlib_major = "unknown"; 1236ddd58736SKris Kennawaymy $shlib_minor = "unknown"; 123774664626SKris Kennaway 123874664626SKris Kennawayopen(IN,'<crypto/opensslv.h') || die "unable to read opensslv.h:$!\n"; 123974664626SKris Kennawaywhile (<IN>) 124074664626SKris Kennaway { 124174664626SKris Kennaway $version=$1 if /OPENSSL.VERSION.TEXT.*OpenSSL (\S+) /; 12423b4e3dcbSSimon L. B. Nielsen $version_num=$1 if /OPENSSL.VERSION.NUMBER.*0x(\S+)/; 1243ddd58736SKris Kennaway $shlib_version_number=$1 if /SHLIB_VERSION_NUMBER *"([^"]+)"/; 1244ddd58736SKris Kennaway $shlib_version_history=$1 if /SHLIB_VERSION_HISTORY *"([^"]*)"/; 124574664626SKris Kennaway } 124674664626SKris Kennawayclose(IN); 1247ddd58736SKris Kennawayif ($shlib_version_history ne "") { $shlib_version_history .= ":"; } 124874664626SKris Kennaway 124974664626SKris Kennawayif ($version =~ /(^[0-9]*)\.([0-9\.]*)/) 125074664626SKris Kennaway { 125174664626SKris Kennaway $major=$1; 125274664626SKris Kennaway $minor=$2; 125374664626SKris Kennaway } 125474664626SKris Kennaway 1255ddd58736SKris Kennawayif ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/) 1256ddd58736SKris Kennaway { 1257ddd58736SKris Kennaway $shlib_major=$1; 1258ddd58736SKris Kennaway $shlib_minor=$2; 1259ddd58736SKris Kennaway } 1260ddd58736SKris Kennaway 126174664626SKris Kennawayopen(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n"; 12625c87c606SMark Murrayunlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new"; 12635c87c606SMark Murrayopen(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n"; 1264f579bf8eSKris Kennawayprint OUT "### Generated automatically from Makefile.org by Configure.\n\n"; 126574664626SKris Kennawaymy $sdirs=0; 126674664626SKris Kennawaywhile (<IN>) 126774664626SKris Kennaway { 12683b4e3dcbSSimon L. B. Nielsen chomp; 126974664626SKris Kennaway $sdirs = 1 if /^SDIRS=/; 127074664626SKris Kennaway if ($sdirs) { 127174664626SKris Kennaway my $dir; 127274664626SKris Kennaway foreach $dir (@skip) { 12735c87c606SMark Murray s/([ ])$dir /\1/; 127474664626SKris Kennaway } 127574664626SKris Kennaway } 127674664626SKris Kennaway $sdirs = 0 unless /\\$/; 127774664626SKris Kennaway s/^VERSION=.*/VERSION=$version/; 127874664626SKris Kennaway s/^MAJOR=.*/MAJOR=$major/; 127974664626SKris Kennaway s/^MINOR=.*/MINOR=$minor/; 1280ddd58736SKris Kennaway s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=$shlib_version_number/; 1281ddd58736SKris Kennaway s/^SHLIB_VERSION_HISTORY=.*/SHLIB_VERSION_HISTORY=$shlib_version_history/; 1282ddd58736SKris Kennaway s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=$shlib_major/; 1283ddd58736SKris Kennaway s/^SHLIB_MINOR=.*/SHLIB_MINOR=$shlib_minor/; 12845740a5e3SKris Kennaway s/^SHLIB_EXT=.*/SHLIB_EXT=$shared_extension/; 128574664626SKris Kennaway s/^INSTALLTOP=.*$/INSTALLTOP=$prefix/; 128674664626SKris Kennaway s/^OPENSSLDIR=.*$/OPENSSLDIR=$openssldir/; 128774664626SKris Kennaway s/^INSTALL_PREFIX=.*$/INSTALL_PREFIX=$install_prefix/; 128874664626SKris Kennaway s/^PLATFORM=.*$/PLATFORM=$target/; 128974664626SKris Kennaway s/^OPTIONS=.*$/OPTIONS=$options/; 1290ddd58736SKris Kennaway s/^CONFIGURE_ARGS=.*$/CONFIGURE_ARGS=$argvstring/; 129174664626SKris Kennaway s/^CC=.*$/CC= $cc/; 12925c87c606SMark Murray s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc"; 129374664626SKris Kennaway s/^CFLAG=.*$/CFLAG= $cflags/; 129474664626SKris Kennaway s/^DEPFLAG=.*$/DEPFLAG= $depflags/; 129574664626SKris Kennaway s/^EX_LIBS=.*$/EX_LIBS= $lflags/; 12965740a5e3SKris Kennaway s/^EXE_EXT=.*$/EXE_EXT= $exe_ext/; 12973b4e3dcbSSimon L. B. Nielsen s/^CPUID_OBJ=.*$/CPUID_OBJ= $cpuid_obj/; 129874664626SKris Kennaway s/^BN_ASM=.*$/BN_ASM= $bn_obj/; 129974664626SKris Kennaway s/^DES_ENC=.*$/DES_ENC= $des_obj/; 13003b4e3dcbSSimon L. B. Nielsen s/^AES_ASM_OBJ=.*$/AES_ASM_OBJ= $aes_obj/; 130174664626SKris Kennaway s/^BF_ENC=.*$/BF_ENC= $bf_obj/; 130274664626SKris Kennaway s/^CAST_ENC=.*$/CAST_ENC= $cast_obj/; 130374664626SKris Kennaway s/^RC4_ENC=.*$/RC4_ENC= $rc4_obj/; 130474664626SKris Kennaway s/^RC5_ENC=.*$/RC5_ENC= $rc5_obj/; 130574664626SKris Kennaway s/^MD5_ASM_OBJ=.*$/MD5_ASM_OBJ= $md5_obj/; 130674664626SKris Kennaway s/^SHA1_ASM_OBJ=.*$/SHA1_ASM_OBJ= $sha1_obj/; 130774664626SKris Kennaway s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/; 130874664626SKris Kennaway s/^PROCESSOR=.*/PROCESSOR= $processor/; 130974664626SKris Kennaway s/^RANLIB=.*/RANLIB= $ranlib/; 13105c87c606SMark Murray s/^ARFLAGS=.*/ARFLAGS= $arflags/; 131174664626SKris Kennaway s/^PERL=.*/PERL= $perl/; 13125c87c606SMark Murray s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/; 1313fceca8a3SJacques Vidrine s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/; 13143b4e3dcbSSimon L. B. Nielsen s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/; 13153b4e3dcbSSimon L. B. Nielsen s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/; 1316ddd58736SKris Kennaway s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/; 13175740a5e3SKris Kennaway s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/; 13185740a5e3SKris Kennaway s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared); 1319a21b1b38SKris Kennaway if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/) 1320a21b1b38SKris Kennaway { 1321a21b1b38SKris Kennaway my $sotmp = $1; 13224f20a5a2SJacques Vidrine s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/; 13234f20a5a2SJacques Vidrine } 13244f20a5a2SJacques Vidrine elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.dylib$/) 13254f20a5a2SJacques Vidrine { 13264f20a5a2SJacques Vidrine s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.dylib/; 1327a21b1b38SKris Kennaway } 1328a21b1b38SKris Kennaway elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/) 1329a21b1b38SKris Kennaway { 1330a21b1b38SKris Kennaway my $sotmp = $1; 1331a21b1b38SKris Kennaway s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/; 1332a21b1b38SKris Kennaway } 13334f20a5a2SJacques Vidrine elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/) 13344f20a5a2SJacques Vidrine { 13354f20a5a2SJacques Vidrine s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.\$(SHLIB_MAJOR).dylib .dylib/; 13364f20a5a2SJacques Vidrine } 1337c1803d78SJacques Vidrine s/^SHARED_LDFLAGS=.*/SHARED_LDFLAGS=$shared_ldflag/; 133874664626SKris Kennaway print OUT $_."\n"; 133974664626SKris Kennaway } 134074664626SKris Kennawayclose(IN); 134174664626SKris Kennawayclose(OUT); 13425c87c606SMark Murrayrename($Makefile,"$Makefile.bak") || die "unable to rename $Makefile\n" if -e $Makefile; 13435c87c606SMark Murrayrename("$Makefile.new",$Makefile) || die "unable to rename $Makefile.new\n"; 134474664626SKris Kennaway 134574664626SKris Kennawayprint "CC =$cc\n"; 134674664626SKris Kennawayprint "CFLAG =$cflags\n"; 134774664626SKris Kennawayprint "EX_LIBS =$lflags\n"; 13483b4e3dcbSSimon L. B. Nielsenprint "CPUID_OBJ =$cpuid_obj\n"; 134974664626SKris Kennawayprint "BN_ASM =$bn_obj\n"; 135074664626SKris Kennawayprint "DES_ENC =$des_obj\n"; 13513b4e3dcbSSimon L. B. Nielsenprint "AES_ASM_OBJ =$aes_obj\n"; 135274664626SKris Kennawayprint "BF_ENC =$bf_obj\n"; 135374664626SKris Kennawayprint "CAST_ENC =$cast_obj\n"; 135474664626SKris Kennawayprint "RC4_ENC =$rc4_obj\n"; 135574664626SKris Kennawayprint "RC5_ENC =$rc5_obj\n"; 135674664626SKris Kennawayprint "MD5_OBJ_ASM =$md5_obj\n"; 135774664626SKris Kennawayprint "SHA1_OBJ_ASM =$sha1_obj\n"; 135874664626SKris Kennawayprint "RMD160_OBJ_ASM=$rmd160_obj\n"; 135974664626SKris Kennawayprint "PROCESSOR =$processor\n"; 136074664626SKris Kennawayprint "RANLIB =$ranlib\n"; 13615c87c606SMark Murrayprint "ARFLAGS =$arflags\n"; 136274664626SKris Kennawayprint "PERL =$perl\n"; 13635c87c606SMark Murrayprint "KRB5_INCLUDES =",$withargs{"krb5-include"},"\n" 13645c87c606SMark Murray if $withargs{"krb5-include"} ne ""; 136574664626SKris Kennaway 136674664626SKris Kennawaymy $des_ptr=0; 136774664626SKris Kennawaymy $des_risc1=0; 136874664626SKris Kennawaymy $des_risc2=0; 136974664626SKris Kennawaymy $des_unroll=0; 137074664626SKris Kennawaymy $bn_ll=0; 137174664626SKris Kennawaymy $def_int=2; 137274664626SKris Kennawaymy $rc4_int=$def_int; 137374664626SKris Kennawaymy $md2_int=$def_int; 137474664626SKris Kennawaymy $idea_int=$def_int; 137574664626SKris Kennawaymy $rc2_int=$def_int; 137674664626SKris Kennawaymy $rc4_idx=0; 1377f579bf8eSKris Kennawaymy $rc4_chunk=0; 137874664626SKris Kennawaymy $bf_ptr=0; 137974664626SKris Kennawaymy @type=("char","short","int","long"); 138074664626SKris Kennawaymy ($b64l,$b64,$b32,$b16,$b8)=(0,0,1,0,0); 13815c87c606SMark Murraymy $export_var_as_fn=0; 138274664626SKris Kennaway 138374664626SKris Kennawaymy $des_int; 138474664626SKris Kennaway 138574664626SKris Kennawayforeach (sort split(/\s+/,$bn_ops)) 138674664626SKris Kennaway { 138774664626SKris Kennaway $des_ptr=1 if /DES_PTR/; 138874664626SKris Kennaway $des_risc1=1 if /DES_RISC1/; 138974664626SKris Kennaway $des_risc2=1 if /DES_RISC2/; 139074664626SKris Kennaway $des_unroll=1 if /DES_UNROLL/; 139174664626SKris Kennaway $des_int=1 if /DES_INT/; 139274664626SKris Kennaway $bn_ll=1 if /BN_LLONG/; 139374664626SKris Kennaway $rc4_int=0 if /RC4_CHAR/; 139474664626SKris Kennaway $rc4_int=3 if /RC4_LONG/; 139574664626SKris Kennaway $rc4_idx=1 if /RC4_INDEX/; 1396f579bf8eSKris Kennaway $rc4_chunk=1 if /RC4_CHUNK/; 1397f579bf8eSKris Kennaway $rc4_chunk=2 if /RC4_CHUNK_LL/; 139874664626SKris Kennaway $md2_int=0 if /MD2_CHAR/; 139974664626SKris Kennaway $md2_int=3 if /MD2_LONG/; 140074664626SKris Kennaway $idea_int=1 if /IDEA_SHORT/; 140174664626SKris Kennaway $idea_int=3 if /IDEA_LONG/; 140274664626SKris Kennaway $rc2_int=1 if /RC2_SHORT/; 140374664626SKris Kennaway $rc2_int=3 if /RC2_LONG/; 140474664626SKris Kennaway $bf_ptr=1 if $_ eq "BF_PTR"; 140574664626SKris Kennaway $bf_ptr=2 if $_ eq "BF_PTR2"; 140674664626SKris Kennaway ($b64l,$b64,$b32,$b16,$b8)=(0,1,0,0,0) if /SIXTY_FOUR_BIT/; 140774664626SKris Kennaway ($b64l,$b64,$b32,$b16,$b8)=(1,0,0,0,0) if /SIXTY_FOUR_BIT_LONG/; 140874664626SKris Kennaway ($b64l,$b64,$b32,$b16,$b8)=(0,0,1,0,0) if /THIRTY_TWO_BIT/; 140974664626SKris Kennaway ($b64l,$b64,$b32,$b16,$b8)=(0,0,0,1,0) if /SIXTEEN_BIT/; 141074664626SKris Kennaway ($b64l,$b64,$b32,$b16,$b8)=(0,0,0,0,1) if /EIGHT_BIT/; 14115c87c606SMark Murray $export_var_as_fn=1 if /EXPORT_VAR_AS_FN/; 141274664626SKris Kennaway } 141374664626SKris Kennaway 141474664626SKris Kennawayopen(IN,'<crypto/opensslconf.h.in') || die "unable to read crypto/opensslconf.h.in:$!\n"; 14155c87c606SMark Murrayunlink("crypto/opensslconf.h.new") || die "unable to remove old crypto/opensslconf.h.new:$!\n" if -e "crypto/opensslconf.h.new"; 14165c87c606SMark Murrayopen(OUT,'>crypto/opensslconf.h.new') || die "unable to create crypto/opensslconf.h.new:$!\n"; 1417f579bf8eSKris Kennawayprint OUT "/* opensslconf.h */\n"; 1418f579bf8eSKris Kennawayprint OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n"; 1419f579bf8eSKris Kennaway 1420f579bf8eSKris Kennawayprint OUT "/* OpenSSL was configured with the following options: */\n"; 14215c87c606SMark Murraymy $openssl_algorithm_defines_trans = $openssl_algorithm_defines; 14225c87c606SMark Murray$openssl_algorithm_defines_trans =~ s/^\s*#\s*define\s+OPENSSL_(.*)/# if defined(OPENSSL_$1) \&\& !defined($1)\n# define $1\n# endif/mg; 1423f579bf8eSKris Kennaway$openssl_algorithm_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg; 1424f579bf8eSKris Kennaway$openssl_algorithm_defines = " /* no ciphers excluded */\n" if $openssl_algorithm_defines eq ""; 1425f579bf8eSKris Kennaway$openssl_thread_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg; 14265c87c606SMark Murray$openssl_sys_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg; 1427f579bf8eSKris Kennaway$openssl_other_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg; 14285c87c606SMark Murrayprint OUT $openssl_sys_defines; 14295c87c606SMark Murrayprint OUT "#ifndef OPENSSL_DOING_MAKEDEPEND\n\n"; 14305c87c606SMark Murrayprint OUT $openssl_algorithm_defines; 14315c87c606SMark Murrayprint OUT "\n#endif /* OPENSSL_DOING_MAKEDEPEND */\n"; 14325c87c606SMark Murrayprint OUT $openssl_thread_defines; 14335c87c606SMark Murrayprint OUT $openssl_other_defines,"\n"; 14345c87c606SMark Murray 14355c87c606SMark Murrayprint OUT "/* The OPENSSL_NO_* macros are also defined as NO_* if the application\n"; 14365c87c606SMark Murrayprint OUT " asks for it. This is a transient feature that is provided for those\n"; 14375c87c606SMark Murrayprint OUT " who haven't had the time to do the appropriate changes in their\n"; 14385c87c606SMark Murrayprint OUT " applications. */\n"; 14395c87c606SMark Murrayprint OUT "#ifdef OPENSSL_ALGORITHM_DEFINES\n"; 14405c87c606SMark Murrayprint OUT $openssl_algorithm_defines_trans; 14415c87c606SMark Murrayprint OUT "#endif\n\n"; 1442f579bf8eSKris Kennaway 14433b4e3dcbSSimon L. B. Nielsenprint OUT "#define OPENSSL_CPUID_OBJ\n\n" if ($cpuid_obj); 14443b4e3dcbSSimon L. B. Nielsen 144574664626SKris Kennawaywhile (<IN>) 144674664626SKris Kennaway { 144774664626SKris Kennaway if (/^#define\s+OPENSSLDIR/) 144874664626SKris Kennaway { print OUT "#define OPENSSLDIR \"$openssldir\"\n"; } 14493b4e3dcbSSimon L. B. Nielsen elsif (/^#define\s+ENGINESDIR/) 14503b4e3dcbSSimon L. B. Nielsen { print OUT "#define ENGINESDIR \"$prefix/lib/engines\"\n"; } 14515c87c606SMark Murray elsif (/^#((define)|(undef))\s+OPENSSL_EXPORT_VAR_AS_FUNCTION/) 14525c87c606SMark Murray { printf OUT "#undef OPENSSL_EXPORT_VAR_AS_FUNCTION\n" 14535c87c606SMark Murray if $export_var_as_fn; 14545c87c606SMark Murray printf OUT "#%s OPENSSL_EXPORT_VAR_AS_FUNCTION\n", 14555c87c606SMark Murray ($export_var_as_fn)?"define":"undef"; } 145674664626SKris Kennaway elsif (/^#define\s+OPENSSL_UNISTD/) 145774664626SKris Kennaway { 145874664626SKris Kennaway $unistd = "<unistd.h>" if $unistd eq ""; 145974664626SKris Kennaway print OUT "#define OPENSSL_UNISTD $unistd\n"; 146074664626SKris Kennaway } 146174664626SKris Kennaway elsif (/^#((define)|(undef))\s+SIXTY_FOUR_BIT_LONG/) 146274664626SKris Kennaway { printf OUT "#%s SIXTY_FOUR_BIT_LONG\n",($b64l)?"define":"undef"; } 146374664626SKris Kennaway elsif (/^#((define)|(undef))\s+SIXTY_FOUR_BIT/) 146474664626SKris Kennaway { printf OUT "#%s SIXTY_FOUR_BIT\n",($b64)?"define":"undef"; } 146574664626SKris Kennaway elsif (/^#((define)|(undef))\s+THIRTY_TWO_BIT/) 146674664626SKris Kennaway { printf OUT "#%s THIRTY_TWO_BIT\n",($b32)?"define":"undef"; } 146774664626SKris Kennaway elsif (/^#((define)|(undef))\s+SIXTEEN_BIT/) 146874664626SKris Kennaway { printf OUT "#%s SIXTEEN_BIT\n",($b16)?"define":"undef"; } 146974664626SKris Kennaway elsif (/^#((define)|(undef))\s+EIGHT_BIT/) 147074664626SKris Kennaway { printf OUT "#%s EIGHT_BIT\n",($b8)?"define":"undef"; } 147174664626SKris Kennaway elsif (/^#((define)|(undef))\s+BN_LLONG\s*$/) 147274664626SKris Kennaway { printf OUT "#%s BN_LLONG\n",($bn_ll)?"define":"undef"; } 147374664626SKris Kennaway elsif (/^\#define\s+DES_LONG\s+.*/) 147474664626SKris Kennaway { printf OUT "#define DES_LONG unsigned %s\n", 147574664626SKris Kennaway ($des_int)?'int':'long'; } 147674664626SKris Kennaway elsif (/^\#(define|undef)\s+DES_PTR/) 147774664626SKris Kennaway { printf OUT "#%s DES_PTR\n",($des_ptr)?'define':'undef'; } 147874664626SKris Kennaway elsif (/^\#(define|undef)\s+DES_RISC1/) 147974664626SKris Kennaway { printf OUT "#%s DES_RISC1\n",($des_risc1)?'define':'undef'; } 148074664626SKris Kennaway elsif (/^\#(define|undef)\s+DES_RISC2/) 148174664626SKris Kennaway { printf OUT "#%s DES_RISC2\n",($des_risc2)?'define':'undef'; } 148274664626SKris Kennaway elsif (/^\#(define|undef)\s+DES_UNROLL/) 148374664626SKris Kennaway { printf OUT "#%s DES_UNROLL\n",($des_unroll)?'define':'undef'; } 148474664626SKris Kennaway elsif (/^#define\s+RC4_INT\s/) 148574664626SKris Kennaway { printf OUT "#define RC4_INT unsigned %s\n",$type[$rc4_int]; } 1486f579bf8eSKris Kennaway elsif (/^#undef\s+RC4_CHUNK/) 1487f579bf8eSKris Kennaway { 1488f579bf8eSKris Kennaway printf OUT "#undef RC4_CHUNK\n" if $rc4_chunk==0; 1489f579bf8eSKris Kennaway printf OUT "#define RC4_CHUNK unsigned long\n" if $rc4_chunk==1; 1490f579bf8eSKris Kennaway printf OUT "#define RC4_CHUNK unsigned long long\n" if $rc4_chunk==2; 1491f579bf8eSKris Kennaway } 149274664626SKris Kennaway elsif (/^#((define)|(undef))\s+RC4_INDEX/) 149374664626SKris Kennaway { printf OUT "#%s RC4_INDEX\n",($rc4_idx)?"define":"undef"; } 149474664626SKris Kennaway elsif (/^#(define|undef)\s+I386_ONLY/) 14953b4e3dcbSSimon L. B. Nielsen { printf OUT "#%s I386_ONLY\n", ($processor eq "386")? 149674664626SKris Kennaway "define":"undef"; } 149774664626SKris Kennaway elsif (/^#define\s+MD2_INT\s/) 149874664626SKris Kennaway { printf OUT "#define MD2_INT unsigned %s\n",$type[$md2_int]; } 149974664626SKris Kennaway elsif (/^#define\s+IDEA_INT\s/) 150074664626SKris Kennaway {printf OUT "#define IDEA_INT unsigned %s\n",$type[$idea_int];} 150174664626SKris Kennaway elsif (/^#define\s+RC2_INT\s/) 150274664626SKris Kennaway {printf OUT "#define RC2_INT unsigned %s\n",$type[$rc2_int];} 150374664626SKris Kennaway elsif (/^#(define|undef)\s+BF_PTR/) 150474664626SKris Kennaway { 150574664626SKris Kennaway printf OUT "#undef BF_PTR\n" if $bf_ptr == 0; 150674664626SKris Kennaway printf OUT "#define BF_PTR\n" if $bf_ptr == 1; 150774664626SKris Kennaway printf OUT "#define BF_PTR2\n" if $bf_ptr == 2; 150874664626SKris Kennaway } 150974664626SKris Kennaway else 151074664626SKris Kennaway { print OUT $_; } 151174664626SKris Kennaway } 151274664626SKris Kennawayclose(IN); 151374664626SKris Kennawayclose(OUT); 15145c87c606SMark Murrayrename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h"; 15155c87c606SMark Murrayrename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n"; 151674664626SKris Kennaway 151774664626SKris Kennaway 151874664626SKris Kennaway# Fix the date 151974664626SKris Kennaway 152074664626SKris Kennawayprint "SIXTY_FOUR_BIT_LONG mode\n" if $b64l; 152174664626SKris Kennawayprint "SIXTY_FOUR_BIT mode\n" if $b64; 152274664626SKris Kennawayprint "THIRTY_TWO_BIT mode\n" if $b32; 152374664626SKris Kennawayprint "SIXTEEN_BIT mode\n" if $b16; 152474664626SKris Kennawayprint "EIGHT_BIT mode\n" if $b8; 152574664626SKris Kennawayprint "DES_PTR used\n" if $des_ptr; 152674664626SKris Kennawayprint "DES_RISC1 used\n" if $des_risc1; 152774664626SKris Kennawayprint "DES_RISC2 used\n" if $des_risc2; 152874664626SKris Kennawayprint "DES_UNROLL used\n" if $des_unroll; 152974664626SKris Kennawayprint "DES_INT used\n" if $des_int; 153074664626SKris Kennawayprint "BN_LLONG mode\n" if $bn_ll; 153174664626SKris Kennawayprint "RC4 uses u$type[$rc4_int]\n" if $rc4_int != $def_int; 153274664626SKris Kennawayprint "RC4_INDEX mode\n" if $rc4_idx; 1533f579bf8eSKris Kennawayprint "RC4_CHUNK is undefined\n" if $rc4_chunk==0; 1534f579bf8eSKris Kennawayprint "RC4_CHUNK is unsigned long\n" if $rc4_chunk==1; 1535f579bf8eSKris Kennawayprint "RC4_CHUNK is unsigned long long\n" if $rc4_chunk==2; 153674664626SKris Kennawayprint "MD2 uses u$type[$md2_int]\n" if $md2_int != $def_int; 153774664626SKris Kennawayprint "IDEA uses u$type[$idea_int]\n" if $idea_int != $def_int; 153874664626SKris Kennawayprint "RC2 uses u$type[$rc2_int]\n" if $rc2_int != $def_int; 153974664626SKris Kennawayprint "BF_PTR used\n" if $bf_ptr == 1; 154074664626SKris Kennawayprint "BF_PTR2 used\n" if $bf_ptr == 2; 154174664626SKris Kennaway 15423b4e3dcbSSimon L. B. Nielsenif($IsMK1MF) { 154374664626SKris Kennaway open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h"; 154474664626SKris Kennaway printf OUT <<EOF; 154574664626SKris Kennaway#ifndef MK1MF_BUILD 154674664626SKris Kennaway /* auto-generated by Configure for crypto/cversion.c: 15473b4e3dcbSSimon L. B. Nielsen * for Unix builds, crypto/Makefile.ssl generates functional definitions; 154874664626SKris Kennaway * Windows builds (and other mk1mf builds) compile cversion.c with 154974664626SKris Kennaway * -DMK1MF_BUILD and use definitions added to this file by util/mk1mf.pl. */ 155074664626SKris Kennaway #error "Windows builds (PLATFORM=$target) use mk1mf.pl-created Makefiles" 155174664626SKris Kennaway#endif 155274664626SKris KennawayEOF 155374664626SKris Kennaway close(OUT); 155474664626SKris Kennaway} else { 15556be8ae07SJacques Vidrine my $make_command = "make PERL=\'$perl\'"; 15565c87c606SMark Murray my $make_targets = ""; 15575c87c606SMark Murray $make_targets .= " links" if $symlink; 15583b4e3dcbSSimon L. B. Nielsen $make_targets .= " depend" if $depflags ne $default_depflags && $make_depend; 15595c87c606SMark Murray $make_targets .= " gentests" if $symlink; 15605c87c606SMark Murray (system $make_command.$make_targets) == 0 or exit $? 15615c87c606SMark Murray if $make_targets ne ""; 156274664626SKris Kennaway if ( $perl =~ m@^/@) { 1563ddd58736SKris Kennaway &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); 1564f579bf8eSKris Kennaway &dofile("apps/CA.pl",$perl,'^#!/', '#!%s'); 156574664626SKris Kennaway } else { 156674664626SKris Kennaway # No path for Perl known ... 1567ddd58736SKris Kennaway &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); 1568f579bf8eSKris Kennaway &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); 156974664626SKris Kennaway } 15703b4e3dcbSSimon L. B. Nielsen if ($depflags ne $default_depflags && !$make_depend) { 15715c87c606SMark Murray print <<EOF; 15725c87c606SMark Murray 15733b4e3dcbSSimon L. B. NielsenSince you've disabled or enabled at least one algorithm, you need to do 15743b4e3dcbSSimon L. B. Nielsenthe following before building: 15755c87c606SMark Murray 15765c87c606SMark Murray make depend 15775c87c606SMark MurrayEOF 15785c87c606SMark Murray } 157974664626SKris Kennaway} 158074664626SKris Kennaway 15813b4e3dcbSSimon L. B. Nielsen# create the ms/version32.rc file if needed 15823b4e3dcbSSimon L. B. Nielsenif ($IsMK1MF) { 15833b4e3dcbSSimon L. B. Nielsen my ($v1, $v2, $v3, $v4); 15843b4e3dcbSSimon L. B. Nielsen if ($version_num =~ /(^[0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i) { 15853b4e3dcbSSimon L. B. Nielsen $v1=hex $1; 15863b4e3dcbSSimon L. B. Nielsen $v2=hex $2; 15873b4e3dcbSSimon L. B. Nielsen $v3=hex $3; 15883b4e3dcbSSimon L. B. Nielsen $v4=hex $4; 15893b4e3dcbSSimon L. B. Nielsen } 15903b4e3dcbSSimon L. B. Nielsen open (OUT,">ms/version32.rc") || die "Can't open ms/version32.rc"; 15913b4e3dcbSSimon L. B. Nielsen print OUT <<EOF; 15923b4e3dcbSSimon L. B. Nielsen#include <winver.h> 15933b4e3dcbSSimon L. B. Nielsen 15943b4e3dcbSSimon L. B. NielsenLANGUAGE 0x09,0x01 15953b4e3dcbSSimon L. B. Nielsen 15963b4e3dcbSSimon L. B. Nielsen1 VERSIONINFO 15973b4e3dcbSSimon L. B. Nielsen FILEVERSION $v1,$v2,$v3,$v4 15983b4e3dcbSSimon L. B. Nielsen PRODUCTVERSION $v1,$v2,$v3,$v4 15993b4e3dcbSSimon L. B. Nielsen FILEFLAGSMASK 0x3fL 16003b4e3dcbSSimon L. B. Nielsen#ifdef _DEBUG 16013b4e3dcbSSimon L. B. Nielsen FILEFLAGS 0x01L 16023b4e3dcbSSimon L. B. Nielsen#else 16033b4e3dcbSSimon L. B. Nielsen FILEFLAGS 0x00L 16043b4e3dcbSSimon L. B. Nielsen#endif 16053b4e3dcbSSimon L. B. Nielsen FILEOS VOS__WINDOWS32 16063b4e3dcbSSimon L. B. Nielsen FILETYPE VFT_DLL 16073b4e3dcbSSimon L. B. Nielsen FILESUBTYPE 0x0L 16083b4e3dcbSSimon L. B. NielsenBEGIN 16093b4e3dcbSSimon L. B. Nielsen BLOCK "StringFileInfo" 16103b4e3dcbSSimon L. B. Nielsen BEGIN 16113b4e3dcbSSimon L. B. Nielsen BLOCK "040904b0" 16123b4e3dcbSSimon L. B. Nielsen BEGIN 16133b4e3dcbSSimon L. B. Nielsen // Required: 16143b4e3dcbSSimon L. B. Nielsen VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0" 16153b4e3dcbSSimon L. B. Nielsen VALUE "FileDescription", "OpenSSL Shared Library\\0" 16163b4e3dcbSSimon L. B. Nielsen VALUE "FileVersion", "$version\\0" 16173b4e3dcbSSimon L. B. Nielsen#if defined(CRYPTO) 16183b4e3dcbSSimon L. B. Nielsen VALUE "InternalName", "libeay32\\0" 16193b4e3dcbSSimon L. B. Nielsen VALUE "OriginalFilename", "libeay32.dll\\0" 16203b4e3dcbSSimon L. B. Nielsen#elif defined(SSL) 16213b4e3dcbSSimon L. B. Nielsen VALUE "InternalName", "ssleay32\\0" 16223b4e3dcbSSimon L. B. Nielsen VALUE "OriginalFilename", "ssleay32.dll\\0" 16233b4e3dcbSSimon L. B. Nielsen#endif 16243b4e3dcbSSimon L. B. Nielsen VALUE "ProductName", "The OpenSSL Toolkit\\0" 16253b4e3dcbSSimon L. B. Nielsen VALUE "ProductVersion", "$version\\0" 16263b4e3dcbSSimon L. B. Nielsen // Optional: 16273b4e3dcbSSimon L. B. Nielsen //VALUE "Comments", "\\0" 16283b4e3dcbSSimon L. B. Nielsen VALUE "LegalCopyright", "Copyright � 1998-2005 The OpenSSL Project. Copyright � 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0" 16293b4e3dcbSSimon L. B. Nielsen //VALUE "LegalTrademarks", "\\0" 16303b4e3dcbSSimon L. B. Nielsen //VALUE "PrivateBuild", "\\0" 16313b4e3dcbSSimon L. B. Nielsen //VALUE "SpecialBuild", "\\0" 16323b4e3dcbSSimon L. B. Nielsen END 16333b4e3dcbSSimon L. B. Nielsen END 16343b4e3dcbSSimon L. B. Nielsen BLOCK "VarFileInfo" 16353b4e3dcbSSimon L. B. Nielsen BEGIN 16363b4e3dcbSSimon L. B. Nielsen VALUE "Translation", 0x409, 0x4b0 16373b4e3dcbSSimon L. B. Nielsen END 16383b4e3dcbSSimon L. B. NielsenEND 16393b4e3dcbSSimon L. B. NielsenEOF 16403b4e3dcbSSimon L. B. Nielsen close(OUT); 16413b4e3dcbSSimon L. B. Nielsen } 16423b4e3dcbSSimon L. B. Nielsen 164374664626SKris Kennawayprint <<EOF; 164474664626SKris Kennaway 1645f579bf8eSKris KennawayConfigured for $target. 164674664626SKris KennawayEOF 164774664626SKris Kennaway 164874664626SKris Kennawayprint <<\EOF if (!$no_threads && !$threads); 164974664626SKris Kennaway 165074664626SKris KennawayThe library could not be configured for supporting multi-threaded 165174664626SKris Kennawayapplications as the compiler options required on this system are not known. 165274664626SKris KennawaySee file INSTALL for details if you need multi-threading. 165374664626SKris KennawayEOF 165474664626SKris Kennaway 1655fceca8a3SJacques Vidrineprint <<\EOF if ($no_shared_warn); 1656fceca8a3SJacques Vidrine 1657fceca8a3SJacques VidrineYou gave the option 'shared'. Normally, that would give you shared libraries. 1658fceca8a3SJacques VidrineUnfortunately, the OpenSSL configuration doesn't include shared library support 1659fceca8a3SJacques Vidrinefor this platform yet, so it will pretend you gave the option 'no-shared'. If 1660fceca8a3SJacques Vidrineyou can inform the developpers (openssl-dev\@openssl.org) how to support shared 1661fceca8a3SJacques Vidrinelibraries on this platform, they will at least look at it and try their best 1662fceca8a3SJacques Vidrine(but please first make sure you have tried with a current version of OpenSSL). 1663fceca8a3SJacques VidrineEOF 1664fceca8a3SJacques Vidrine 166574664626SKris Kennawayexit(0); 166674664626SKris Kennaway 166774664626SKris Kennawaysub usage 166874664626SKris Kennaway { 166974664626SKris Kennaway print STDERR $usage; 1670f579bf8eSKris Kennaway print STDERR "\npick os/compiler from:\n"; 167174664626SKris Kennaway my $j=0; 167274664626SKris Kennaway my $i; 1673f579bf8eSKris Kennaway my $k=0; 167474664626SKris Kennaway foreach $i (sort keys %table) 167574664626SKris Kennaway { 167674664626SKris Kennaway next if $i =~ /^debug/; 1677f579bf8eSKris Kennaway $k += length($i) + 1; 1678f579bf8eSKris Kennaway if ($k > 78) 1679f579bf8eSKris Kennaway { 1680f579bf8eSKris Kennaway print STDERR "\n"; 1681f579bf8eSKris Kennaway $k=length($i); 1682f579bf8eSKris Kennaway } 1683f579bf8eSKris Kennaway print STDERR $i . " "; 168474664626SKris Kennaway } 168574664626SKris Kennaway foreach $i (sort keys %table) 168674664626SKris Kennaway { 168774664626SKris Kennaway next if $i !~ /^debug/; 1688f579bf8eSKris Kennaway $k += length($i) + 1; 1689f579bf8eSKris Kennaway if ($k > 78) 1690f579bf8eSKris Kennaway { 169174664626SKris Kennaway print STDERR "\n"; 1692f579bf8eSKris Kennaway $k=length($i); 1693f579bf8eSKris Kennaway } 1694f579bf8eSKris Kennaway print STDERR $i . " "; 1695f579bf8eSKris Kennaway } 1696f579bf8eSKris Kennaway print STDERR "\n\nNOTE: If in doubt, on Unix-ish systems use './config'.\n"; 169774664626SKris Kennaway exit(1); 169874664626SKris Kennaway } 169974664626SKris Kennaway 170074664626SKris Kennawaysub which 170174664626SKris Kennaway { 170274664626SKris Kennaway my($name)=@_; 170374664626SKris Kennaway my $path; 170474664626SKris Kennaway foreach $path (split /:/, $ENV{PATH}) 170574664626SKris Kennaway { 17066be8ae07SJacques Vidrine if (-f "$path/$name$exe_ext" and -x _) 170774664626SKris Kennaway { 17086be8ae07SJacques Vidrine return "$path/$name$exe_ext" unless ($name eq "perl" and 17096be8ae07SJacques Vidrine system("$path/$name$exe_ext -e " . '\'exit($]<5.0);\'')); 171074664626SKris Kennaway } 171174664626SKris Kennaway } 171274664626SKris Kennaway } 171374664626SKris Kennaway 171474664626SKris Kennawaysub dofile 171574664626SKris Kennaway { 171674664626SKris Kennaway my $f; my $p; my %m; my @a; my $k; my $ff; 171774664626SKris Kennaway ($f,$p,%m)=@_; 171874664626SKris Kennaway 171974664626SKris Kennaway open(IN,"<$f.in") || open(IN,"<$f") || die "unable to open $f:$!\n"; 172074664626SKris Kennaway @a=<IN>; 172174664626SKris Kennaway close(IN); 172274664626SKris Kennaway foreach $k (keys %m) 172374664626SKris Kennaway { 172474664626SKris Kennaway grep(/$k/ && ($_=sprintf($m{$k}."\n",$p)),@a); 172574664626SKris Kennaway } 1726f579bf8eSKris Kennaway open(OUT,">$f.new") || die "unable to open $f.new:$!\n"; 172774664626SKris Kennaway print OUT @a; 172874664626SKris Kennaway close(OUT); 1729f579bf8eSKris Kennaway rename($f,"$f.bak") || die "unable to rename $f\n" if -e $f; 1730f579bf8eSKris Kennaway rename("$f.new",$f) || die "unable to rename $f.new\n"; 173174664626SKris Kennaway } 173274664626SKris Kennaway 173374664626SKris Kennawaysub print_table_entry 173474664626SKris Kennaway { 173574664626SKris Kennaway my $target = shift; 173674664626SKris Kennaway 17375c87c606SMark Murray (my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags, 17383b4e3dcbSSimon L. B. Nielsen my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj, 1739ddd58736SKris Kennaway my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj, 17405740a5e3SKris Kennaway my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag, 17415c87c606SMark Murray my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags)= 17425740a5e3SKris Kennaway split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); 174374664626SKris Kennaway 174474664626SKris Kennaway print <<EOF 174574664626SKris Kennaway 174674664626SKris Kennaway*** $target 174774664626SKris Kennaway\$cc = $cc 174874664626SKris Kennaway\$cflags = $cflags 174974664626SKris Kennaway\$unistd = $unistd 175074664626SKris Kennaway\$thread_cflag = $thread_cflag 17515c87c606SMark Murray\$sys_id = $sys_id 175274664626SKris Kennaway\$lflags = $lflags 175374664626SKris Kennaway\$bn_ops = $bn_ops 17543b4e3dcbSSimon L. B. Nielsen\$cpuid_obj = $cpuid_obj 175574664626SKris Kennaway\$bn_obj = $bn_obj 175674664626SKris Kennaway\$des_obj = $des_obj 17573b4e3dcbSSimon L. B. Nielsen\$aes_obj = $aes_obj 175874664626SKris Kennaway\$bf_obj = $bf_obj 175974664626SKris Kennaway\$md5_obj = $md5_obj 176074664626SKris Kennaway\$sha1_obj = $sha1_obj 176174664626SKris Kennaway\$cast_obj = $cast_obj 176274664626SKris Kennaway\$rc4_obj = $rc4_obj 176374664626SKris Kennaway\$rmd160_obj = $rmd160_obj 176474664626SKris Kennaway\$rc5_obj = $rc5_obj 1765ddd58736SKris Kennaway\$dso_scheme = $dso_scheme 1766ddd58736SKris Kennaway\$shared_target= $shared_target 1767ddd58736SKris Kennaway\$shared_cflag = $shared_cflag 1768c1803d78SJacques Vidrine\$shared_ldflag = $shared_ldflag 17695740a5e3SKris Kennaway\$shared_extension = $shared_extension 17705740a5e3SKris Kennaway\$ranlib = $ranlib 17715c87c606SMark Murray\$arflags = $arflags 177274664626SKris KennawayEOF 177374664626SKris Kennaway } 1774c1803d78SJacques Vidrine 1775c1803d78SJacques Vidrinesub test_sanity 1776c1803d78SJacques Vidrine { 1777c1803d78SJacques Vidrine my $errorcnt = 0; 1778c1803d78SJacques Vidrine 1779c1803d78SJacques Vidrine print STDERR "=" x 70, "\n"; 1780c1803d78SJacques Vidrine print STDERR "=== SANITY TESTING!\n"; 1781c1803d78SJacques Vidrine print STDERR "=== No configuration will be done, all other arguments will be ignored!\n"; 1782c1803d78SJacques Vidrine print STDERR "=" x 70, "\n"; 1783c1803d78SJacques Vidrine 1784c1803d78SJacques Vidrine foreach $target (sort keys %table) 1785c1803d78SJacques Vidrine { 1786c1803d78SJacques Vidrine @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); 1787c1803d78SJacques Vidrine 1788c1803d78SJacques Vidrine if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/) 1789c1803d78SJacques Vidrine { 1790c1803d78SJacques Vidrine $errorcnt++; 1791c1803d78SJacques Vidrine print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n"; 1792c1803d78SJacques Vidrine print STDERR " in the previous field\n"; 1793c1803d78SJacques Vidrine } 1794c1803d78SJacques Vidrine elsif ($fields[$idx_dso_scheme+1] =~ /^(dl|dlfcn|win32|vms)$/) 1795c1803d78SJacques Vidrine { 1796c1803d78SJacques Vidrine $errorcnt++; 1797c1803d78SJacques Vidrine print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n"; 1798c1803d78SJacques Vidrine print STDERR " in the following field\n"; 1799c1803d78SJacques Vidrine } 1800c1803d78SJacques Vidrine elsif ($fields[$idx_dso_scheme] !~ /^(dl|dlfcn|win32|vms|)$/) 1801c1803d78SJacques Vidrine { 1802c1803d78SJacques Vidrine $errorcnt++; 1803c1803d78SJacques Vidrine print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n"; 1804c1803d78SJacques Vidrine print STDERR " valid values are 'dl', 'dlfcn', 'win32' and 'vms'\n"; 1805c1803d78SJacques Vidrine } 1806c1803d78SJacques Vidrine } 1807c1803d78SJacques Vidrine print STDERR "No sanity errors detected!\n" if $errorcnt == 0; 1808c1803d78SJacques Vidrine return $errorcnt; 1809c1803d78SJacques Vidrine } 1810ed5d4f9aSSimon L. B. Nielsen 1811ed5d4f9aSSimon L. B. Nielsen# Attempt to detect MSYS environment 1812ed5d4f9aSSimon L. B. Nielsen 1813ed5d4f9aSSimon L. B. Nielsensub is_msys 1814ed5d4f9aSSimon L. B. Nielsen { 1815ed5d4f9aSSimon L. B. Nielsen return 1 if (exists $ENV{"TERM"} && $ENV{"TERM"} eq "msys"); 1816ed5d4f9aSSimon L. B. Nielsen return 0; 1817ed5d4f9aSSimon L. B. Nielsen } 1818