If --prefix="C:\foo\bar" is supplied to Configure for a windows target,
authorGeoff Thorpe <geoff@openssl.org>
Thu, 10 Jul 2008 20:08:47 +0000 (20:08 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Thu, 10 Jul 2008 20:08:47 +0000 (20:08 +0000)
then the backslashes need escaping to avoid being treated as switches in
the auto-generated strings in opensslconf.h. Perl users are welcome to
suggest a less hokey way of doing this ...

Configure

index 09c356da9d5a61e6d6ea33a088191646ae5f8190..67878ec5f66004c18570c3b0a7db433d73ead633 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1557,9 +1557,17 @@ print OUT "#define OPENSSL_CPUID_OBJ\n\n" if ($cpuid_obj ne "mem_clr.o");
 while (<IN>)
        {
        if      (/^#define\s+OPENSSLDIR/)
-               { print OUT "#define OPENSSLDIR \"$openssldir\"\n"; }
+               {
+               my $foo = $openssldir;
+               $foo =~ s/\\/\\\\/g;
+               print OUT "#define OPENSSLDIR \"$foo\"\n";
+               }
        elsif   (/^#define\s+ENGINESDIR/)
-               { print OUT "#define ENGINESDIR \"$prefix/lib/engines\"\n"; }
+               {
+               my $foo = "$prefix/lib/engines";
+               $foo =~ s/\\/\\\\/g;
+               print OUT "#define ENGINESDIR \"$foo\"\n";
+               }
        elsif   (/^#((define)|(undef))\s+OPENSSL_EXPORT_VAR_AS_FUNCTION/)
                { printf OUT "#undef OPENSSL_EXPORT_VAR_AS_FUNCTION\n"
                        if $export_var_as_fn;