Configure: 'reconf' to respect CROSS_COMPILE and CC.
authorAndy Polyakov <appro@openssl.org>
Sat, 12 Dec 2015 11:23:41 +0000 (12:23 +0100)
committerAndy Polyakov <appro@openssl.org>
Sun, 13 Dec 2015 19:54:22 +0000 (20:54 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Configure

index 913773bd1b687d1155d3f8780b3fea477af19ded..b6672a026726f69f415c9403455a995b5e72650e 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1032,6 +1032,7 @@ PROCESS_ARGS:
                        {
                        if (open(IN,"<$Makefile"))
                                {
+                               my $config_args_found=0;
                                while (<IN>)
                                        {
                                        chomp;
@@ -1043,11 +1044,19 @@ PROCESS_ARGS:
                                                        if (grep(/^reconf/,@argvcopy));
                                                print "Reconfiguring with: $argvstring\n";
                                                $argv_unprocessed=1;
-                                               close(IN);
-                                               last PROCESS_ARGS;
+                                               $config_args_found=1;
+                                               }
+                                       elsif (/^CROSS_COMPILE=\s*(.*)/)
+                                               {
+                                               $ENV{CROSS_COMPILE}=$1;
+                                               }
+                                       elsif (/^CC=\s*(?:\$\(CROSS_COMPILE\))?(.*?)/)
+                                               {
+                                               $ENV{CC}=$1;
                                                }
                                        }
                                close(IN);
+                               last PROCESS_ARGS if ($config_args_found);
                                }
                        die "Insufficient data to reconfigure, please do a normal configuration\n";
                        }