提交 9e43c6b5 编写于 作者: R Richard Levitte

Correct the request of debug builds

./config would translate -d into having the target get a 'debug-'
prefix, and then run './Configure LIST' to find out if such a
debugging target exists or not.

With the recent changes, the separate 'debug-foo' targets are
disappearing, and we're giving the normal targets debugging
capabilities instead.  Unfortunately, './config' wasn't changed to
match this new behavior.

This change introduces the arguments '--debug' and '--release' - the
latter just for orthogonality - to ./Configure, and ./config now
treats -d by adding '--debug' to the options for ./Configure.
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 11abf922
...@@ -946,6 +946,7 @@ my $options; ...@@ -946,6 +946,7 @@ my $options;
my $symlink; my $symlink;
my $make_depend=0; my $make_depend=0;
my %withargs=(); my %withargs=();
my $build_prefix = "release_";
my @argvcopy=@ARGV; my @argvcopy=@ARGV;
my $argvstring=""; my $argvstring="";
...@@ -1020,10 +1021,18 @@ PROCESS_ARGS: ...@@ -1020,10 +1021,18 @@ PROCESS_ARGS:
{ {
exit(&test_sanity()); exit(&test_sanity());
} }
elsif (/^--strict-warnings/) elsif (/^--strict-warnings$/)
{ {
$strict_warnings = 1; $strict_warnings = 1;
} }
elsif (/^--debug$/)
{
$build_prefix = "debug_";
}
elsif (/^--release$/)
{
$build_prefix = "release_";
}
elsif (/^reconfigure/ || /^reconf/) elsif (/^reconfigure/ || /^reconf/)
{ {
if (open(IN,"<$Makefile")) if (open(IN,"<$Makefile"))
...@@ -1234,10 +1243,10 @@ if ($target =~ m/^CygWin32(-.*)$/) { ...@@ -1234,10 +1243,10 @@ if ($target =~ m/^CygWin32(-.*)$/) {
print "Configuring for $target\n"; print "Configuring for $target\n";
# Support for legacy targets having a name starting with 'debug-'
my ($d, $t) = $target =~ m/^(debug-)?(.*)$/; my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
my $debug_prefix = "release_";
if ($d) { if ($d) {
$debug_prefix = "debug_"; $build_prefix = "debug_";
# If we do not find debug-foo in the table, the target is set to foo, # If we do not find debug-foo in the table, the target is set to foo,
# but only if the foo target has a noon-empty debug_cflags or debug_lflags # but only if the foo target has a noon-empty debug_cflags or debug_lflags
...@@ -1248,7 +1257,11 @@ if ($d) { ...@@ -1248,7 +1257,11 @@ if ($d) {
} }
} }
&usage if (!defined($table{$target}) || $table{$target}->{template}); &usage if (!defined($table{$target})
|| $table{$target}->{template}
|| ($build_prefix eq "debug_"
&& !($table{$target}->{debug_cflags}
|| $table{$target}->{debug_lflags})));
if ($fips) if ($fips)
{ {
...@@ -1359,10 +1372,10 @@ my $cc = $ENV{CC} || $table{$t}->{cc}; ...@@ -1359,10 +1372,10 @@ my $cc = $ENV{CC} || $table{$t}->{cc};
# Do it in such a way that no spurious space is appended (hence the grep). # Do it in such a way that no spurious space is appended (hence the grep).
my $cflags = join(" ", my $cflags = join(" ",
grep { $_ } ($table{$t}->{cflags}, grep { $_ } ($table{$t}->{cflags},
$table{$t}->{$debug_prefix."cflags"})); $table{$t}->{$build_prefix."cflags"}));
my $lflags = join(" ", my $lflags = join(" ",
grep { $_ } ($table{$t}->{lflags}, grep { $_ } ($table{$t}->{lflags},
$table{$t}->{$debug_prefix."lflags"})); $table{$t}->{$build_prefix."lflags"}));
my $unistd = $table{$t}->{unistd}; my $unistd = $table{$t}->{unistd};
my $thread_cflag = $table{$t}->{thread_cflag}; my $thread_cflag = $table{$t}->{thread_cflag};
......
...@@ -29,7 +29,7 @@ EXE="" ...@@ -29,7 +29,7 @@ EXE=""
for i for i
do do
case "$i" in case "$i" in
-d*) PREFIX="debug-";; -d*) options=$options" --debug";;
-t*) TEST="true";; -t*) TEST="true";;
-h*) TEST="true"; cat <<EOF -h*) TEST="true"; cat <<EOF
Usage: config [options] Usage: config [options]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册