On 2000-11-07, Richard Levitte - VMS Whacker <[EMAIL PROTECTED]> wrote:

> jrussell> Has anyone tried a Make process that leaves the source tree
> jrussell> undisturbed?  You know, where you create a separate
> jrussell> "build-for-my-target-platform" directory outside the source
> jrussell> tree, and run a configure and make from there? 

> Yup.  The attached script (create-build-tree.sh) helps you doing
> exactly that.  If you rsync the openssl-play part of the CVS
> repository, it's found in openssl-play/levitte/hacks/.

I was looking to do exactly this, and found Richard's post in the
archives. Thank you Richard!  (Although, for platforms with gnu cp at
least--and I realize that's not all of them--I think cp -al or cp -as
works just as well?)

Small problem, though.  Out of the box Openssl-0.9.6's Configure script
rebuilds a few files by simply open(FOO, ">file")'ing them.  Important
ones, like Makefile.ssl and opensslconf.h.  Richard's script produces a
tree of symlinks, but that means that when those files are (re)generated
the symlinks are followed, so the originals are modified :(  This means
that make'ing in a few shadow-directories, then doing a make install in
a previous one will detect that various files have changed, and try to
rebuild the library--now with a Makefile that is set up for a different
architecture :(

This simple patch to Configure makes things happie by simply
unlink()'ing the target file (a symlink or hardlink) before opening it
for writing (so a "private" copy will be created in the shadow build
directory, rather than the original being shared and overwritten).
I know this isn't an officially-supported thing to do / way to build
openssl, but this is such a small change, unless there's some
substantial problem w/it I wonder if it could be rolled into the
distribution, if something similar isn't already done in the current
CVS tree.

Thanks,

Hank Leininger <[EMAIL PROTECTED]>

###

--- Configure.orig      Sun Sep 24 11:27:37 2000
+++ Configure   Tue Jan  2 04:04:06 2001
@@ -779,6 +779,7 @@
        }
 
 open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
+unlink("$Makefile") || die "unable to unlink $Makefile:$!\n";
 open(OUT,">$Makefile") || die "unable to create $Makefile:$!\n";
 print OUT "### Generated automatically from Makefile.org by Configure.\n\n";
 my $sdirs=0;
@@ -894,6 +895,7 @@
        }
 
 open(IN,'<crypto/opensslconf.h.in') || die "unable to read 
crypto/opensslconf.h.in:$!\n";
+unlink('crypto/opensslconf.h') || die "unable to unlink crypto/opensslconf.h:$!\n";
 open(OUT,'>crypto/opensslconf.h') || die "unable to create crypto/opensslconf.h:$!\n";
 print OUT "/* opensslconf.h */\n";
 print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. 
*/\n\n";

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to