# 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";
-
-# Warn that "make depend" should be run?
-my $warn_make_depend = 0;
-
-# 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;
"cms",
"comp",
"crypto-mdebug",
+ "crypto-mdebug-backtrace",
"ct",
"deprecated",
"des",
"unit-test" => "default",
"zlib" => "default",
"crypto-mdebug" => "default",
+ "heartbeats" => "default",
);
my @experimental = ();
# 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
# 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"
+ );
+
+my @generated_by_make_headers = (
+ "crypto/buildinf.h"
+ );
+
my $no_sse2=0;
my $libs="";
my $target="";
$config{options}="";
-my $make_depend=0;
my %withargs=();
my $build_prefix = "release_";
# 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+/, $_;
{
$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 ($_ =~ /^([^:]+):(.+)$/)
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
$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;
foreach (@{$depends{$dest}}) {
my $d = cleanfile($sourced, $_, $blddir);
- # If it isn't found in the source, let's assume it's generated
- # and that the Makefile template has the lines
- if (! -f $d) {
+ # If we know it's generated, or assume it is because we can't
+ # find it in the source tree, we set file we depend on to be
+ # in the build tree rather than the source tree, and assume
+ # and that there are lines to build it in a BEGINRAW..ENDRAW
+ # section or in the Makefile template.
+ if (! -f $d
+ || !(grep { $d eq $_ }
+ map { cleanfile($srcdir, $_, $blddir) }
+ (@generated_headers, @generated_by_make_headers))) {
$d = cleanfile($buildd, $_, $blddir);
}
# Take note if the file to depend on is being renamed
print "BN_LLONG mode\n" if $config{bn_ll};
print "RC4 uses $config{rc4_int}\n" if $config{rc4_int} != $def_int;
-mkpath(catdir($blddir, "include/openssl"));
-run_dofile(catfile($blddir, "include/openssl/opensslconf.h"),
- catfile($srcdir, "include/openssl/opensslconf.h.in"));
-
-mkpath(catdir($blddir, "crypto/include/internal"));
-foreach my $alg ( 'bn' ) {
- run_dofile(catfile($blddir, "crypto/include/internal/${alg}_conf.h"),
- catfile($srcdir, "crypto/include/internal/${alg}_conf.h.in"));
+for (@generated_headers) {
+ mkpath(catdir($blddir, dirname($_)));
+ run_dofile(catfile($blddir, $_),
+ catfile($srcdir, $_.".in"));
}
###
run_dofile(catfile($blddir, $target{build_file}),
$config{build_file_template},
catfile($srcdir, "Configurations", "common.tmpl"));
-
- my $make_command = "$make PERL=\'$config{perl}\'";
- my $make_targets = "";
- my $need_make_depend =
- join(" ", @{$config{depdefines}}) ne join(" ", @default_depdefines);
- $make_targets .= " depend"
- if $need_make_depend && $make_depend;
-
- (system $make_command.$make_targets) == 0
- or die "make $make_targets failed"
- if $make_targets ne "";
-
- if ($need_make_depend && !$make_depend) {
- $warn_make_depend++;
- }
},
unixmake => sub {
build_Makefile();
run_dofile("util/domd", "util/domd.in");
chmod 0755, "util/domd";
-
- my $make_command = "$make PERL=\'$config{perl}\'";
- my $make_targets = "";
- my $need_make_depend =
- join(" ", @{$config{depdefines}}) ne join(" ", @default_depdefines);
- $make_targets .= " depend"
- if $need_make_depend && $make_depend;
-
- (system $make_command.$make_targets) == 0
- or die "make $make_targets failed"
- if $make_targets ne "";
-
- if ($need_make_depend && !$make_depend) {
- $warn_make_depend++;
- }
},
mk1mf => sub {
my $platform = shift;
# The only reason we do this is to have something to build MINFO from
build_Makefile();
- open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h";
- printf OUT <<"EOF";
-#ifndef MK1MF_BUILD
- /* auto-generated by Configure for crypto/cversion.c:
- * for Unix builds, crypto/Makefile.ssl generates functional definitions;
- * Windows builds (and other mk1mf builds) compile cversion.c with
- * -DMK1MF_BUILD and use definitions added to this file by util/mk1mf.pl. */
- #error "Windows builds (PLATFORM=$target) use mk1mf.pl-created Makefiles"
-#endif
-EOF
- close(OUT);
-
# create the ms/version32.rc file if needed
if ($platform ne "netware") {
my ($v1, $v2, $v3, $v4);
tried with a current version of OpenSSL).
EOF
-print <<"EOF" if ($warn_make_depend);
-
-*** Because of configuration changes, you MUST do the following before
-*** building:
-
- make depend
-EOF
-
###### TO BE REMOVED BEFORE FINAL RELEASE
######
###### If the user hasn't chosen --unified, try to nudge them.
"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/) {