# see INSTALL for instructions.
-my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n";
+my $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-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n";
# Options:
#
# Minimum warning options... any contributions to OpenSSL should at least get
# past these.
-my $gcc_devteam_warn = "-DPEDANTIC -DREF_DEBUG -DDEBUG_UNUSED"
+my $gcc_devteam_warn = "-DPEDANTIC -DREF_DEBUG -DDEBUG_UNUSED -DBIO_DEBUG"
. " -pedantic"
. " -Wall"
. " -Wno-long-long"
"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
"ec_nistp_64_gcc_128",
"egd",
"engine",
- "err", # Really???
+ "err",
+ "filenames",
"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",
# All of the following is disabled by default (RC5 was enabled before 0.9.8):
-my %disabled = ( # "what" => "comment" [or special keyword "experimental"]
+my %disabled = ( # "what" => "comment"
"ec_nistp_64_gcc_128" => "default",
"egd" => "default",
- "jpake" => "experimental",
"md2" => "default",
"rc5" => "default",
"sctp" => "default",
"crypto-mdebug" => "default",
"heartbeats" => "default",
);
-my @experimental = ();
# Note: => pair form used for aesthetics, not to truly make a hash table
my @disable_cascades = (
"rijndael" => [ "aes" ],
"des" => [ "mdc2" ],
"ec" => [ "ecdsa", "ecdh" ],
- "psk" => [ "jpake" ],
"dgram" => [ "dtls" ],
"dtls" => [ @dtls ],
unshift @list, $second;
}
-# Construct the string of what $config{depdefines} should look like with
-# the defaults from %disabled above. (we need this to see if we should
-# advise the user to run "make depend"):
-my @default_depdefines =
- map { my $x = $_; $x =~ tr{[a-z]-}{[A-Z]_}; "OPENSSL_NO_$x"; }
- grep { $disabled{$_} !~ /\(no-depdefines\)$/ }
- sort keys %disabled;
-
# Explicit "no-..." options will be collected in %disabled along with the defaults.
-# To remove something from %disabled, use "enable-foo" (unless it's experimental).
+# To remove something from %disabled, use "enable-foo".
# For symmetry, "disable-foo" is a synonym for "no-foo".
-# For features called "experimental" here, a more explicit "experimental-foo" is needed to enable.
-# We will collect such requests in @experimental.
-# To avoid accidental use of experimental features, applications will have to use -DOPENSSL_EXPERIMENTAL_FOO.
-
my @generated_headers = (
"include/openssl/opensslconf.h",
- "crypto/include/internal/bn_conf.h"
+ "crypto/include/internal/bn_conf.h",
+ "crypto/include/internal/dso_conf.h"
);
my @generated_by_make_headers = (
my $user_cflags="";
my @user_defines=();
my $unified = 0;
-$config{depdefines}=[];
-$config{openssl_experimental_defines}=[];
$config{openssl_api_defines}=[];
$config{openssl_algorithm_defines}=[];
$config{openssl_thread_defines}=[];
s /^zlib$/enable-zlib/;
s /^zlib-dynamic$/enable-zlib-dynamic/;
- if (/^(no|disable|enable|experimental)-(.+)$/)
+ if (/^(no|disable|enable)-(.+)$/)
{
my $word = $2;
if (!grep { $word =~ /^${_}$/ } @disablables)
}
if (/^no-(.+)$/ || /^disable-(.+)$/)
{
- if (!($disabled{$1} eq "experimental"))
- {
- foreach my $proto ((@tls, @dtls))
- {
- if ($1 eq "$proto-method")
- {
- $disabled{"$proto"} = "option($proto-method)";
- last;
- }
- }
- if ($1 eq "dtls")
- {
- foreach my $proto (@dtls)
- {
- $disabled{$proto} = "option(dtls)";
- }
- }
- elsif ($1 eq "ssl")
- {
- # Last one of its kind
- $disabled{"ssl3"} = "option(ssl)";
- }
- elsif ($1 eq "tls")
- {
- # XXX: Tests will fail if all SSL/TLS
- # protocols are disabled.
- foreach my $proto (@tls)
- {
- $disabled{$proto} = "option(tls)";
- }
- }
- else
- {
- $disabled{$1} = "option";
- }
- }
+ foreach my $proto ((@tls, @dtls))
+ {
+ if ($1 eq "$proto-method")
+ {
+ $disabled{"$proto"} = "option($proto-method)";
+ last;
+ }
+ }
+ if ($1 eq "dtls")
+ {
+ foreach my $proto (@dtls)
+ {
+ $disabled{$proto} = "option(dtls)";
+ }
+ }
+ elsif ($1 eq "ssl")
+ {
+ # Last one of its kind
+ $disabled{"ssl3"} = "option(ssl)";
+ }
+ elsif ($1 eq "tls")
+ {
+ # XXX: Tests will fail if all SSL/TLS
+ # protocols are disabled.
+ foreach my $proto (@tls)
+ {
+ $disabled{$proto} = "option(tls)";
+ }
+ }
+ else
+ {
+ $disabled{$1} = "option";
+ }
}
- elsif (/^enable-(.+)$/ || /^experimental-(.+)$/)
+ elsif (/^enable-(.+)$/)
{
my $algo = $1;
- if ($disabled{$algo} eq "experimental")
- {
- die "You are requesting an experimental feature; please say 'experimental-$algo' if you are sure\n"
- unless (/^experimental-/);
- push @experimental, $algo;
- }
delete $disabled{$algo};
$threads = 1 if ($algo eq "threads");
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";
($ALGO,$algo) = ("RMD160","rmd160") if ($algo eq "ripemd");
push @{$config{openssl_algorithm_defines}}, "OPENSSL_NO_$ALGO";
- push @{$config{depdefines}}, "OPENSSL_NO_$ALGO";
print " OPENSSL_NO_$ALGO";
# fix-up crypto/directory name(s)
print "\n";
}
-foreach (sort @experimental)
- {
- my $ALGO;
- ($ALGO = $_) =~ tr/[a-z]/[A-Z]/;
-
- # opensslconf.h will set OPENSSL_NO_... unless OPENSSL_EXPERIMENTAL_... is defined
- push @{$config{openssl_experimental_defines}}, "OPENSSL_NO_$ALGO";
- }
-
print "Configuring for $target\n";
# Support for legacy targets having a name starting with 'debug-'
&usage if (!%target || $target{template});
$target{exe_extension}="";
-$target{exe_extension}=".exe" if ($config{target} eq "Cygwin" || $config{target} eq "DJGPP" || $config{target} =~ /^mingw/);
+$target{exe_extension}=".exe" if ($config{target} eq "DJGPP"
+ || $config{target} =~ /^(?:Cygwin|mingw)/);
$target{exe_extension}=".nlm" if ($config{target} =~ /netware/);
$target{exe_extension}=".pm" if ($config{target} =~ /vos/);
+($target{shared_extension_simple}=$target{shared_extension})
+ =~ s|\.\$\(SHLIB_MAJOR\)\.\$\(SHLIB_MINOR\)||;
+$target{dso_extension}=$target{shared_extension_simple};
+($target{shared_import_extension}=$target{shared_extension_simple}.".a")
+ if ($config{target} =~ /^(?:Cygwin|mingw)/);
+
+
$default_ranlib = which("ranlib") || "true";
$config{perl} = $ENV{'PERL'} || which("perl5") || which("perl") || "perl";
my $make = $ENV{'MAKE'} || "make";
###### 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" ];
}
my ($builder, $builder_platform, @builder_opts) =
@{$target{build_scheme}};
-push @{$config{defines}},
- 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)
{
$config{cflags} .= " -mno-cygwin";
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{bn_asm_src} =~ s/\w+-gf2m.c// if (defined($disabled{ec2m}));
# bn-586 is the only one implementing bn_*_part_words
close(PIPE);
}
-$config{depflags} =~ s/^\s*//;
-
# Deal with bn_ops ###################################################
if (defined($config{api})) {
$config{openssl_api_defines} = [ "OPENSSL_MIN_API=".$apitable->{$config{api}} ];
my $apiflag = sprintf("OPENSSL_API_COMPAT=%s", $apitable->{$config{api}});
- push @default_depdefines, $apiflag;
push @{$config{defines}}, $apiflag;
}
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|$)/)
}
}
}
{
foreach my $wopt (split /\s+/, $memleak_devteam_backtrace)
{
- $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/)
+ $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(?:^|\s)$wopt(?:\s|$)/)
}
if ($target =~ /^BSD-/)
{
# For the schemes that need it, we provide the old *_obj configs
# from the *_asm_obj ones
-foreach (grep /_asm_src$/, keys %target) {
+foreach (grep /_(asm|aux)_src$/, keys %target) {
my $src = $_;
- (my $obj = $_) =~ s/_asm_src$/_obj/;
+ (my $obj = $_) =~ s/_(asm|aux)_src$/_obj/;
($target{$obj} = $target{$src}) =~ s/\.[csS]\b/.o/g;
}
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_ldflag",
"shared_rcflag",
"shared_extension",
+ "shared_extension_simple",
+ "shared_import_extension",
+ "dso_extension",
"obj_extension",
"exe_extension",
"ranlib",