Make it possible for the user to specify a different default build file
authorRichard Levitte <levitte@openssl.org>
Mon, 29 Aug 2016 19:45:19 +0000 (21:45 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 30 Aug 2016 03:13:11 +0000 (05:13 +0200)
Make sure the information is kept for reconfiguration too.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Configure

index 3604ba4f73eaed8b89d8b4bb4dc7ac6c78a55bee..a0bf5de8bb88a189721f76671be4d1a337643fc2 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -502,11 +502,14 @@ if (grep /^reconf(igure)?$/, @argvcopy) {
            if defined($configdata::config{cross_compile_prefix});
        $ENV{CC} = $configdata::config{cc}
            if defined($configdata::config{cc});
            if defined($configdata::config{cross_compile_prefix});
        $ENV{CC} = $configdata::config{cc}
            if defined($configdata::config{cc});
+       $ENV{BUILDFILE} = $configdata::config{build_file}
+           if defined($configdata::config{build_file});
 
        print "Reconfiguring with: ", join(" ",@argvcopy), "\n";
        print "    CROSS_COMPILE = ",$ENV{CROSS_COMPILE},"\n"
            if $ENV{CROSS_COMPILE};
        print "    CC = ",$ENV{CC},"\n" if $ENV{CC};
 
        print "Reconfiguring with: ", join(" ",@argvcopy), "\n";
        print "    CROSS_COMPILE = ",$ENV{CROSS_COMPILE},"\n"
            if $ENV{CROSS_COMPILE};
        print "    CC = ",$ENV{CC},"\n" if $ENV{CC};
+       print "    BUILDFILE = ",$ENV{BUILDFILE},"\n" if $ENV{BUILDFILE};
     } elsif (open IN, "<Makefile") {
         #
         # THIS SECTION IS TEMPORARY, it helps transitioning from Makefile
     } elsif (open IN, "<Makefile") {
         #
         # THIS SECTION IS TEMPORARY, it helps transitioning from Makefile
@@ -938,8 +941,12 @@ $target{nm} =      $ENV{'NM'}      || $target{nm}      || "nm";
 $target{rc} =
     $ENV{'RC'}  || $ENV{'WINDRES'} || $target{rc}      || "windres";
 
 $target{rc} =
     $ENV{'RC'}  || $ENV{'WINDRES'} || $target{rc}      || "windres";
 
-# Cache the C compiler command for reconfiguration
+# Allow overriding the build file name
+$target{build_file} = $ENV{BUILDFILE} || $target{build_file} || "Makefile";
+
+# Cache information necessary for reconfiguration
 $config{cc} = $target{cc};
 $config{cc} = $target{cc};
+$config{build_file} = $target{build_file};
 
 # For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_
 # or release_ attributes.
 
 # For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_
 # or release_ attributes.