This is a multi-part message in MIME format.
--------------010008000305020600090503
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Patch attached against 0.9.7, out of cycles to try applying this to HEAD at
this exact moment. The patch does one other small conservation, when it
splits options it leaves one lingering ::::::: value beyond the last used
element rather than several dozen unused array values.

Again, comments and feedback welcome.

Bill


William A. Rowe, Jr. wrote:
>
> ./Configure platform:cc:cflags:unistd:thread_cflag:sys_id:lfla gs
>
> today sets the remaining 17 flags to defaults - not to {platform}'s original
> defaults, but far less useful defaults. For an illustration, compare
> configuring with your {platform}:gcc to simply {platform}.
>
> I'm not suggesting we break this syntax; we really shouldn't.
>
> So the alternate syntax I'm thinking of is...
>
> platform:=gcc:+{more_cflags}::::={lflags_override}
>
> which would preserve all but the three fields assigned by default
> to the given platform.
>
> The rule is that the first option, the cc choice, must have a leading
> = or + to trigger the behavior. A field of :=value: would replace the
> existing table field, a field of :=: would unset the table field, and
> a other :value: entries would append to the existing table field (space
> separated).
>
> In the first field :+-m32: would append -m32 and trigger this behavior,
> :=gcc33: would set gcc32 and trigger the behavior, while :+: alone is
> a shorthand to simply trigger the new behavior but leave the existing
> cc value alone. The :+ meaning applies ONLY to the first field.
>
> I specifically choose not to give :+xxx: a different meaning in the
> remaining fields because + is very often a legitimate leading character,
> while there's not a single example where = is a legitimate leading character.


Note if I had, the format platform:+-m32:+:+:+:+:+:+:+:+:+:+:+:+:+:+:+:+:+:+
required was damned ugly

> I considered a corresponding remove partial syntax but that seems just a
> bit to aggravating, and can usually be accomplished by simply overriding
> the default with :=value: syntax.
>
> Feedback on this proposal?


--------------010008000305020600090503
Content-Type: text/x-patch;
name="openssl-platform-opts.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="openssl-platform-opts.patch"

--- Configure 6 Sep 2006 03:01:18 -0000 1.3
+++ Configure 18 Jan 2007 20:54:48 -0000
@@ -616,6 +616,7 @@
my $idx_shared_extension = $idx++;
my $idx_ranlib = $idx++;
my $idx_arflags = $idx++;
+my $idx_count = $idx;

my $prefix="";
my $openssldir="";
@@ -891,8 +892,14 @@
}
elsif ($_ =~ /^([^:]+).+)$/)
{
- eval "\$table{\$1} = \"$2\""; # allow $xxx constructs in the string
- $target=$1;
+ my $scheme;
+ $target = $1;
+ eval "\$scheme = \"$2\""; # allow $xxx constructs in the string
+ if (defined $table{$target})
+ {
+ $scheme = merge_build_cmds($scheme, $table{$target});
+ }
+ $table{$target} = $scheme;
}
else
{
@@ -1000,7 +1007,7 @@

print "IsWindows=$IsWindows\n";

-my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
+my @fields = split(/\s*:\s*/,$table{$target} . ":" x $idx_count, $idx_count + 1);
for (@fields) { s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; }
my $cc = $fields[$idx_cc];
my $cflags = $fields[$idx_cflags];
@@ -1699,7 +1706,7 @@
{
my $target = shift;

- my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
+ my @fields = split(/\s*:\s*/,$table{$target} . ":" x $idx_count, $idx_count + 1);
for (@fields) { s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; }
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags,
my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
@@ -1747,7 +1754,7 @@

foreach $target (sort keys %table)
{
- @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
+ @fields = split(/\s*:\s*/,$table{$target} . ":" x $idx_count, $idx_count + 1);
for (@fields) { s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; }

if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/)
@@ -1772,3 +1779,39 @@
print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
return $errorcnt;
}
+
+sub merge_build_cmds
+ {
+ my $new; my $orig;
+ ($new, $orig)=@_;
+ print 'Base: ' . $orig . "\n";
+ print 'Add: ' . $new . "\n";
+ if ( ! (( $new =~ m/^=/ ) || ( $new =~ s/^\+// )) )
+ {
+ return $new;
+ }
+
+ my @newfields = split(/\s*:\s*/,$new . ':' x $idx_count, $idx_count + 1);
+ my @origfields = split(/\s*:\s*/,$orig . ':' x $idx_count, $idx_count + 1);
+ my $idx = 0;
+ while ($idx < $idx_count)
+ {
+ if ( ! ( $newfields[$idx] =~ s/^=// ) )
+ {
+ if ( ! length($newfields[$idx]) )
+ {
+ $newfields[$idx] = $origfields[$idx];
+ }
+ elsif ( length($origfields[$idx]) )
+ {
+ $newfields[$idx] = $origfields[$idx] . ' '
+ . $newfields[$idx];
+ }
+ }
+ $idx++;
+ }
+ $new = join(':',@newfields);
+ print 'Fin: ' . $new . "\n";
+ return $new;
+ }
+

--------------010008000305020600090503--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org