#!/usr/local/bin/perl
# A bit of an evil hack but it post processes the file ../MINFO which
# is generated by `make files` in the top directory.
# This script outputs one mega makefile that has no shell stuff or any
# funny stuff
#
$INSTALLTOP="/usr/local/ssl";
$OPTIONS="";
$ssl_version="";
$banner="\t\@echo Building OpenSSL";
local $zlib_opt = 0; # 0 = no zlib, 1 = static, 2 = dynamic
local $zlib_lib = "";
my $fips_canister_path = "";
my $fips_premain_dso_exe_path = "";
my $fips_premain_c_path = "";
my $fips_sha1_exe_path = "";
my $fipslibdir = "";
my $ex_l_libs = "";
open(IN,"<Makefile") || die "unable to open Makefile!\n";
while(<IN>) {
$ssl_version=$1 if (/^VERSION=(.*)$/);
$OPTIONS=$1 if (/^OPTIONS=(.*)$/);
$INSTALLTOP=$1 if (/^INSTALLTOP=(.*$)/);
}
close(IN);
die "Makefile is not the toplevel Makefile!\n" if $ssl_version eq "";
$infile="MINFO";
%ops=(
"VC-WIN32", "Microsoft Visual C++ [4-6] - Windows NT or 9X",
"VC-WIN32-GMAKE", "Microsoft Visual C++ [4-6] - Windows NT or 9X, GNU make",
"VC-CE", "Microsoft eMbedded Visual C++ 3.0 - Windows CE ONLY",
"VC-NT", "Microsoft Visual C++ [4-6] - Windows NT ONLY",
"VC-W31-16", "Microsoft Visual C++ 1.52 - Windows 3.1 - 286",
"VC-WIN16", "Alias for VC-W31-32",
"VC-W31-32", "Microsoft Visual C++ 1.52 - Windows 3.1 - 386+",
"VC-MSDOS","Microsoft Visual C++ 1.52 - MSDOS",
"Mingw32", "GNU C++ - Windows NT or 9x",
"Mingw32-files", "Create files with DOS copy ...",
"BC-NT", "Borland C++ 4.5 - Windows NT",
"BC-W31", "Borland C++ 4.5 - Windows 3.1 - PROBABLY NOT WORKING",
"BC-MSDOS","Borland C++ 4.5 - MSDOS",
"linux-elf","Linux elf",
"ultrix-mips","DEC mips ultrix",
"FreeBSD","FreeBSD distribution",
"OS2-EMX", "EMX GCC OS/2",
"default","cc under unix",
);
$platform="";
my $xcflags="";
foreach (@ARGV)
{
if (!&read_options && !defined($ops{$_}))
{
print STDERR "unknown option - $_\n";
print STDERR "usage: perl mk1mf.pl [options] [system]\n";
print STDERR "\nwhere [system] can be one of the following\n";
foreach $i (sort keys %ops)
{ printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; }
print STDERR <<"EOF";
and [options] can be one of
no-md2 no-md4 no-md5 no-sha no-mdc2 - Skip this digest
no-ripemd
no-rc2 no-rc4 no-rc5 no-idea no-des - Skip this symetric cipher
no-bf no-cast no-aes
no-rsa no-dsa no-dh - Skip this public key cipher
no-ssl2 no-ssl3 - Skip this version of SSL
just-ssl - remove all non-ssl keys/digest
no-asm - No x86 asm
no-krb5 - No KRB5
no-ec - No EC
no-engine - No engine
no-hw - No hw
nasm - Use NASM for x86 asm
gaswin - Use GNU as with Mingw32
no-socks - No socket code
no-err - No error strings
dll/shlib - Build shared libraries (MS)
debug - Debug build
profile - Profiling build
gcc - Use Gcc (unix)
Values that can be set
TMP=tmpdir OUT=outdir SRC=srcdir BIN=binpath INC=header-outdir CC=C-compiler
-L<ex_lib_path> -l<ex_lib> - extra library flags (unix)
-<ex_cc_flags> - extra 'cc' flags,
added (MS), or replace (unix)
EOF
exit(1);
}
$platform=$_;
}
foreach (grep(!/^$/, split(/ /, $OPTIONS)))
{
print STDERR "unknown option - $_\n" if !&read_options;
}
$no_mdc2=1 if ($no_des);
$no_ssl3=1 if ($no_md5 || $no_sha);
$no_ssl3=1 if ($no_rsa && $no_dh);
$no_ssl2=1 if ($no_md5);
$no_ssl2=1 if ($no_rsa);
$out_def="out";
$inc_def