# This becomes the value of OPENSSLDIR in Makefile and in C.
# (Default: PREFIX/ssl)
#
-# --install_prefix Additional prefix for package builders (empty by
-# default). This needn't be set in advance, you can
-# just as well use "make INSTALL_PREFIX=/whatever install".
-#
# --cross-compile-prefix Add specified prefix to binutils components.
#
# --api One of 0.9.8, 1.0.0 or 1.1.0. Do not compile support for
# Minimum warning options... any contributions to OpenSSL should at least get
# past these.
-my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Wtype-limits -Werror -DREF_CHECK -DDEBUG_UNUSED";
+my $gcc_devteam_warn = "-DPEDANTIC -DREF_DEBUG -DDEBUG_UNUSED"
+ . " -pedantic"
+ . " -Wall"
+ . " -Wno-long-long"
+ . " -Wsign-compare"
+ . " -Wmissing-prototypes"
+ . " -Wshadow"
+ . " -Wformat"
+ . " -Wtype-limits"
+ . " -Werror"
+ ;
# These are used in addition to $gcc_devteam_warn when the compiler is clang.
# TODO(openssl-team): fix problems and investigate if (at least) the
# following warnings can also be enabled:
-# -Wswitch-enum, -Wunused-macros, -Wmissing-field-initializers,
-# -Wcast-align,
-# -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token
-# -Wextended-offsetof
-my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Qunused-arguments -Wincompatible-pointer-types-discards-qualifiers -Wmissing-variable-declarations";
-
-# These are used in addition to $gcc_devteam_warn unless this is a mingw build.
-# This adds backtrace information to the memory leak info.
-my $memleak_devteam_backtrace = "-rdynamic -DCRYPTO_MDEBUG_BACKTRACE";
+# -Wswitch-enum
+# -Wunused-macros
+# -Wcast-align
+# -Wunreachable-code
+# -Wlanguage-extension-token
+# -Wextended-offsetof
+my $clang_devteam_warn = ""
+ . " -Qunused-arguments"
+ . " -Wextra"
+ . " -Wno-unused-parameter"
+ . " -Wno-missing-field-initializers"
+ . " -Wno-language-extension-token"
+ . " -Wno-extended-offsetof"
+ . " -Wconditional-uninitialized"
+ . " -Wincompatible-pointer-types-discards-qualifiers"
+ . " -Wmissing-variable-declarations"
+ ;
+
+# This adds backtrace information to the memory leak info. Is only used
+# when crypto-mdebug-backtrace is enabled.
+my $memleak_devteam_backtrace = "-rdynamic";
my $strict_warnings = 0;
$config{openssldir}="";
$config{processor}="";
$config{libdir}="";
-$config{install_prefix}= "$ENV{'INSTALL_PREFIX'}";
$config{cross_compile_prefix}="";
$config{fipslibdir}="/usr/local/ssl/fips-2.0/lib/";
my $nofipscanistercheck=0;
"bn", "ec", "rsa", "dsa", "dh", "dso", "engine",
"buffer", "bio", "stack", "lhash", "rand", "err",
"evp", "asn1", "pem", "x509", "x509v3", "conf", "txt_db", "pkcs7", "pkcs12", "comp", "ocsp", "ui",
- "cms", "ts", "jpake", "srp", "cmac", "ct", "async", "kdf"
+ "cms", "ts", "srp", "cmac", "ct", "async", "kdf"
];
# Known TLS and DTLS protocols
"cms",
"comp",
"crypto-mdebug",
+ "crypto-mdebug-backtrace",
"ct",
"deprecated",
"des",
"ec_nistp_64_gcc_128",
"egd",
"engine",
- "err", # Really???
+ "err",
"heartbeats",
"hmac",
"hw(-.+)?",
"idea",
- "jpake",
- "locking", # Really???
+ "locking",
"md2",
"md4",
"md5",
"rdrand",
"rfc3779",
"rijndael", # Old AES name
+ "ripemd",
"rmd160",
"rsa",
"scrypt",
"stdio",
"threads",
"tls",
+ "ts",
+ "ui",
"unit-test",
"whirlpool",
"zlib",
my %disabled = ( # "what" => "comment" [or special keyword "experimental"]
"ec_nistp_64_gcc_128" => "default",
"egd" => "default",
- "jpake" => "experimental",
"md2" => "default",
"rc5" => "default",
"sctp" => "default",
"unit-test" => "default",
"zlib" => "default",
"crypto-mdebug" => "default",
+ "heartbeats" => "default",
);
my @experimental = ();
"rijndael" => [ "aes" ],
"des" => [ "mdc2" ],
"ec" => [ "ecdsa", "ecdh" ],
- "psk" => [ "jpake" ],
"dgram" => [ "dtls" ],
"dtls" => [ @dtls ],
# SRP and HEARTBEATS require TLSEXT
"tlsext" => [ "srp", "heartbeats" ],
+
+ "crypto-mdebug" => [ "crypto-mdebug-backtrace" ],
);
# Avoid protocol support holes. Also disable all versions below N, if version
# centered information gathering the reading configdata.pm
#
while (<IN>) {
- chomp;
+ s|\R$||;
if (/^CONFIGURE_ARGS=\s*(.*)\s*/) {
# Older form, we split the string and hope for the best
@argvcopy = split /\s+/, $_;
my %unsupported_options = ();
foreach (@argvcopy)
{
+ # VMS is a case insensitive environment, and depending on settings
+ # out of our control, we may receive options uppercased. Let's
+ # downcase at least the part before any equal sign.
+ if ($^O eq "VMS")
+ {
+ s/^([^=]*)/lc($1)/e;
+ }
s /^-no-/no-/; # some people just can't read the instructions
# rewrite some options in "enable-..." form
{
$config{openssldir}=$1;
}
- elsif (/^--install.prefix=(.*)$/)
- {
- $config{install_prefix}=$1;
- }
elsif (/^--with-zlib-lib=(.*)$/)
{
$withargs{zlib_lib}=$1;
else # common if (/^[-+]/), just pass down...
{
$_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
- $user_cflags.=$_." ";
+ $user_cflags.=" ".$_;
}
}
elsif ($_ =~ /^([^:]+):(.+)$/)
elsif (/^sse2$/)
{ $no_sse2 = 1; }
elsif (/^engine$/)
- { @{$config{dirs}} = grep !/^engine$/, @{$config{dirs}}; }
+ {
+ @{$config{dirs}} = grep !/^engines$/, @{$config{dirs}};
+ @{$config{sdirs}} = grep !/^engine$/, @{$config{sdirs}};
+ push @{$config{openssl_other_defines}}, "OPENSSL_NO_ENGINE";
+ }
else
{
my ($ALGO, $algo);
($ALGO = $algo = $_) =~ tr/[\-a-z]/[_A-Z]/;
- if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/ || /^async$/
+ if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/
|| /^autoalginit/ || /^autoerrinit/)
{
push @{$config{openssl_other_defines}}, "OPENSSL_NO_$ALGO";
###### TO BE REMOVED BEFORE FINAL RELEASE
######
###### If the user has chosen --unified, we give it to them.
+###### The same happens if we detect that they try to build out-of-source.
if ($target{build_file} eq "Makefile"
&& $target{build_scheme}->[0] eq "unixmake"
- && $unified) {
+ && ($unified || $srcdir ne $blddir)) {
$target{build_scheme} = [ "unified", "unix" ];
}
map { (my $x = $_) =~ s/^OPENSSL_NO_/OPENSSL_EXPERIMENTAL_/; $x }
@{$config{openssl_experimental_defines}};
-if ($target =~ /^mingw/ && `$target{cc} --target-help 2>&1` !~ m/-mno-cygwin/m)
+if ($target =~ /^mingw/ && `$target{cc} --target-help 2>&1` =~ m/-mno-cygwin/m)
{
- $config{cflags} =~ s/-mno-cygwin\s*//;
- $target{shared_ldflag} =~ s/-mno-cygwin\s*//;
+ $config{cflags} .= " -mno-cygwin";
+ $target{shared_ldflag} .= " -mno-cygwin";
}
if ($target =~ /linux.*-mips/ && !$no_asm && $user_cflags !~ /-m(ips|arch=)/) {
my $no_user_cflags=0;
my $no_user_defines=0;
-if ($user_cflags ne "") { $config{cflags}="$user_cflags$config{cflags}"; }
-else { $no_user_cflags=1; }
-if (@user_defines) { $config{defines}=[ @user_defines, @{$config{defines}} ]; }
-else { $no_user_defines=1; }
-
# The DSO code currently always implements all functions so that no
# applications will have to worry about that from a compilation point
# of view. However, the "method"s may return zero unless that platform
if (!$no_asm) {
$target{cpuid_asm_src}=$table{BASE}->{cpuid_asm_src} if ($config{processor} eq "386");
- $target{cpuid_asm_src}.=" uplink.c uplink-x86.s" if (grep { $_ eq "OPENSSL_USE_APPLINK"} @{$config{defines}});
+ $target{cpuid_asm_src}.=" uplink.c uplink-x86.s"
+ if (grep { $_ eq "OPENSSL_USE_APPLINK"} @{$config{defines}}
+ || $config{cflags} =~ /(?:^|\s)-DOPENSSL_USE_APPLINK(?:\s|$)/);
$target{bn_asm_src} =~ s/\w+-gf2m.c// if (defined($disabled{ec2m}));
}
}
-# Is the compiler gcc or clang? $ecc is used below to see if error-checking
-# can be turned on.
my $ecc = $target{cc};
-my $ccpcc = "$config{cross_compile_prefix}$target{cc}";
-$config{makedepprog} = 'makedepend';
-open(PIPE, "$ccpcc --version 2>&1 | head -2 |");
-while ( <PIPE> ) {
- $config{makedepprog} = $ccpcc if /clang|gcc/;
- $ecc = "clang" if /clang/;
- $ecc = "gcc" if /gcc/;
+if ($^O ne "VMS") {
+ # Is the compiler gcc or clang? $ecc is used below to see if
+ # error-checking can be turned on.
+ my $ccpcc = "$config{cross_compile_prefix}$target{cc}";
+ $config{makedepprog} = 'makedepend';
+ open(PIPE, "$ccpcc --version 2>&1 | head -2 |");
+ while ( <PIPE> ) {
+ $config{makedepprog} = $ccpcc if /clang|gcc/;
+ $ecc = "clang" if /clang/;
+ $ecc = "gcc" if /gcc/;
+ }
+ close(PIPE);
}
-close(PIPE);
$config{depflags} =~ s/^\s*//;
unless $ecc eq 'gcc' || $ecc eq 'clang';
foreach $wopt (split /\s+/, $gcc_devteam_warn)
{
- $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/)
+ $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(?:^|\s)$wopt(?:\s|$)/)
}
if ($ecc eq "clang")
{
foreach $wopt (split /\s+/, $clang_devteam_warn)
{
- $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/)
+ $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(?:^|\s)$wopt(?:\s|$)/)
}
}
- if ($target !~ /^mingw/)
+ }
+
+unless ($disabled{"crypto-mdebug-backtrace"})
+ {
+ foreach my $wopt (split /\s+/, $memleak_devteam_backtrace)
{
- foreach $wopt (split /\s+/, $memleak_devteam_backtrace)
- {
- $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/)
- }
- if ($target =~ /^BSD-/)
- {
- $config{ex_libs} .= " -lexecinfo";
- }
+ $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(?:^|\s)$wopt(?:\s|$)/)
+ }
+ if ($target =~ /^BSD-/)
+ {
+ $config{ex_libs} .= " -lexecinfo";
}
}
+if ($user_cflags ne "") { $config{cflags}="$config{cflags}$user_cflags"; }
+else { $no_user_cflags=1; }
+if (@user_defines) { $config{defines}=[ @{$config{defines}}, @user_defines ]; }
+else { $no_user_defines=1; }
+
+# ALL MODIFICATIONS TO %config and %target MUST BE DONE FROM HERE ON
+
# If we use the unified build, collect information from build.info files
my %unified_info = ();
my $lineiterator = shift;
my $target_kind = $1;
while (defined $lineiterator->()) {
- chomp;
+ s|\R$||;
if (/^\s*ENDRAW\[((?:\\.|[^\\\]])+)\]\s*$/) {
die "ENDRAW doesn't match BEGINRAW"
if $1 ne $target_kind;
print OUT "1;\n";
close(OUT);
-die <<"EOF" if $builder ne "unified" && $srcdir ne $blddir;
-
-***** Trying building anywhere else than in the source tree will not
-***** work for target $config{target}. To make it possible, it needs
-***** to use the "unified" build scheme.
-
-EOF
print "IsMK1MF =", ($builder eq "mk1mf" ? "yes" : "no"), "\n";
print "CC =$target{cc}\n";
"shared_target",
"shared_cflag",
"shared_ldflag",
+ "shared_rcflag",
"shared_extension",
"obj_extension",
"exe_extension",
my $saved_line = "";
$_ = "";
while (<$fh>) {
- chomp;
+ s|\R$||;
if (defined $line_concat) {
$_ = $line_concat->($saved_line, $_);
$saved_line = "";
my $saved_line = "";
$_ = "";
while (defined($_ = shift @array)) {
- chomp;
+ s|\R$||;
if (defined $line_concat) {
$_ = $line_concat->($saved_line, $_);
$saved_line = "";
my %collectors = @_;
while(defined($_ = $lineiterator->())) {
- chomp;
+ s|\R$||;
my $found = 0;
foreach my $re (keys %collectors) {
if ($re ne "OTHERWISE" && /$re/) {