# it grew impossible to resolve this without sizeable additional
# code, so we just tell compiler to be pedantic about everything
# but 'long long' type.
+ . " -Wswitch"
. " -DPEDANTIC -pedantic -Wno-long-long"
. " -Wall"
. " -Wsign-compare"
# 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
# -Wcast-align
# -Wunreachable-code
# -Wlanguage-extension-token -- no, we use asm()
my $clang_devteam_warn = ""
. " -Qunused-arguments"
. " -Wextra"
+ . " -Wswitch -Wswitch-default"
. " -Wno-unused-parameter"
. " -Wno-missing-field-initializers"
. " -Wno-language-extension-token"
if defined($configdata::config{cross_compile_prefix});
$ENV{CC} = $configdata::config{cc}
if defined($configdata::config{cc});
+ $ENV{CXX} = $configdata::config{cxx}
+ if defined($configdata::config{cxx});
$ENV{BUILDFILE} = $configdata::config{build_file}
if defined($configdata::config{build_file});
$ENV{$local_config_envname} = $configdata::config{local_config_dir}
print " CROSS_COMPILE = ",$ENV{CROSS_COMPILE},"\n"
if $ENV{CROSS_COMPILE};
print " CC = ",$ENV{CC},"\n" if $ENV{CC};
+ print " CXX = ",$ENV{CXX},"\n" if $ENV{CXX};
print " BUILDFILE = ",$ENV{BUILDFILE},"\n" if $ENV{BUILDFILE};
print " $local_config_envname = ",$ENV{$local_config_envname},"\n"
if $ENV{$local_config_envname};
}
-print "Configuring OpenSSL version $config{version} (0x$config{version_num})\n";
+print "Configuring OpenSSL version $config{version} ($config{version_num})\n";
$config{prefix}="";
$config{openssldir}="";
"fuzz-afl" => "default",
"heartbeats" => "default",
"md2" => "default",
+ "mdc2" => "default",
"msan" => "default",
"rc5" => "default",
"sctp" => "default",
my %unsupported_options = ();
my %deprecated_options = ();
-foreach (@argvcopy)
+while (@argvcopy)
{
+ $_ = shift @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.
{
$libs.=$_." ";
}
+ elsif (/^-rpath$/ or /^-R$/)
+ # -rpath is the OSF1 rpath flag
+ # -R is the old Solaris rpath flag
+ {
+ my $rpath = shift(@argvcopy) || "";
+ $rpath .= " " if $rpath ne "";
+ $libs.=$_." ".$rpath;
+ }
elsif (/^-static$/)
{
$libs.=$_." ";
$config{conf_files} = [ sort keys %conf_files ];
%target = ( %{$table{DEFAULTS}}, %target );
+$target{cxxflags}=$target{cflags} unless defined $target{cxxflags};
$target{exe_extension}="";
$target{exe_extension}=".exe" if ($config{target} eq "DJGPP"
|| $config{target} =~ /^(?:Cygwin|mingw)/);
$config{hashbangperl} =
$ENV{'HASHBANGPERL'} || $ENV{'PERL'} || "/usr/bin/env perl";
$target{cc} = $ENV{'CC'} || $target{cc} || "cc";
+$target{cxx} = $ENV{'CXX'} || $target{cxx} || "c++";
$target{ranlib} = $ENV{'RANLIB'} || $target{ranlib} ||
(which("$config{cross_compile_prefix}ranlib") ?
"\$(CROSS_COMPILE)ranlib" : "true");
# Cache information necessary for reconfiguration
$config{cc} = $target{cc};
+$config{cxx} = $target{cxx};
$config{build_file} = $target{build_file};
# For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_
# Do it in such a way that no spurious space is appended (hence the grep).
$config{defines} = [];
$config{cflags} = "";
+$config{cxxflags} = "";
$config{ex_libs} = "";
$config{shared_ldflag} = "";
if (! -f $s) {
$s = cleanfile($buildd, $_, $blddir);
}
- # We recognise C and asm files
- if ($s =~ /\.[csS]\b$/) {
- (my $o = $_) =~ s/\.[csS]\b$/.o/;
+ # We recognise C++, C and asm files
+ if ($s =~ /\.(cc|cpp|c|s|S)$/) {
+ my $o = $_;
+ $o =~ s/\.[csS]$/.o/; # C and assembler
+ $o =~ s/\.(cc|cpp)$/_cc.o/; # C++
$o = cleanfile($buildd, $o, $blddir);
$unified_info{sources}->{$ddest}->{$o} = 1;
$unified_info{sources}->{$o}->{$s} = 1;
if (! -f $s) {
$s = cleanfile($buildd, $_, $blddir);
}
- # We recognise C and asm files
- if ($s =~ /\.[csS]\b$/) {
- (my $o = $_) =~ s/\.[csS]\b$/.o/;
+ # We recognise C++, C and asm files
+ if ($s =~ /\.(cc|cpp|c|s|S)$/) {
+ my $o = $_;
+ $o =~ s/\.[csS]$/.o/; # C and assembler
+ $o =~ s/\.(cc|cpp)$/_cc.o/; # C++
$o = cleanfile($buildd, $o, $blddir);
$unified_info{shared_sources}->{$ddest}->{$o} = 1;
$unified_info{sources}->{$o}->{$s} = 1;
foreach (grep /_(asm|aux)_src$/, keys %target) {
my $src = $_;
(my $obj = $_) =~ s/_(asm|aux)_src$/_obj/;
- ($target{$obj} = $target{$src}) =~ s/\.[csS]\b/.o/g;
+ $target{$obj} = $target{$src};
+ $target{$obj} =~ s/\.[csS]\b/.o/g; # C and assembler
+ $target{$obj} =~ s/\.(cc|cpp)\b/_cc.o/g; # C++
}
# Write down our configuration where it fits #########################
print "HASHBANGPERL =$config{hashbangperl}\n";
print "CC =$config{cross_compile_prefix}$target{cc}\n";
print "CFLAG =$target{cflags} $config{cflags}\n";
+print "CXX =$config{cross_compile_prefix}$target{cxx}\n"
+ if defined $target{cxx};
+print "CXXFLAG =$target{cxxflags} $config{cxxflags}\n"
+ if defined $target{cxx};
print "DEFINES =",join(" ", @{$target{defines}}, @{$config{defines}}),"\n";
#print "RANLIB =", $target{ranlib} eq '$(CROSS_COMPILE)ranlib' ?
# "$config{cross_compile_prefix}ranlib" :