From c2aa4f2081e18999ccf2ca466ac69afe67c2b291 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 16 Jul 2002 08:53:32 +0000 Subject: [PATCH] For those wanting to build for several platforms with the same source directory, making a separate directory tree with lots of symbolic links seems to be the solution. Unfortunatelt, Configure doesn't take appropriate steps to support this solution (as in removing a file that's going to be rewritten). This change corrects that situation. Now I just have to find all other places where there's lack of support for this. --- Configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Configure b/Configure index da3033c684..0b47b3c1c8 100755 --- a/Configure +++ b/Configure @@ -1170,7 +1170,8 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/) } open(IN,'$Makefile") || die "unable to create $Makefile:$!\n"; +unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new"; +open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n"; print OUT "### Generated automatically from Makefile.org by Configure.\n\n"; my $sdirs=0; while () @@ -1244,6 +1245,8 @@ while () } close(IN); close(OUT); +rename($Makefile,"$Makefile.bak") || die "unable to rename $Makefile\n" if -e $Makefile; +rename("$Makefile.new",$Makefile) || die "unable to rename $Makefile.new\n"; print "CC =$cc\n"; print "CFLAG =$cflags\n"; @@ -1314,7 +1317,8 @@ foreach (sort split(/\s+/,$bn_ops)) } open(IN,'crypto/opensslconf.h') || die "unable to create crypto/opensslconf.h:$!\n"; +unlink("crypto/opensslconf.h.new") || die "unable to remove old crypto/opensslconf.h.new:$!\n" if -e "crypto/opensslconf.h.new"; +open(OUT,'>crypto/opensslconf.h.new') || die "unable to create crypto/opensslconf.h.new:$!\n"; print OUT "/* opensslconf.h */\n"; print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n"; @@ -1408,6 +1412,8 @@ while () } close(IN); close(OUT); +rename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h"; +rename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n"; # Fix the date