From: Jim Russell <[EMAIL PROTECTED]>
jrussell> I have a quick question for the developers, before I go spelunking
jrussell> through the perl scripts... Has anyone tried a Make process that
jrussell> leaves the source tree undisturbed? You know, where you create a
jrussell> separate "build-for-my-target-platform" directory outside the
jrussell> source 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/.
--
Richard Levitte \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken \ S-168 35 BROMMA \ T: +46-8-26 52 47
Redakteur@Stacken \ SWEDEN \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/
Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
#!/bin/sh
#
# $1 Directory with source.
# $2 Directory where the build tree should be.
#
# NOTE: It's not a good idea to have one be the subdirectory of the other.
# Trust me on this.
# Make damn sure the directories don't have an ending slash
srcdir="`echo \"$1\" | sed -e 's,^\./,,' -e 's,/\./,/,g' -e 's,/\.$,,' -e 's,/$,,g'`"
objdir="`echo \"$2\" | sed -e 's,^\./,,' -e 's,/\./,/,g' -e 's,/\.$,,' -e 's,/$,,g'`"
find $srcdir -type d -print | grep -v '/CVS$' | grep -v '/CVS/' |\
while read d; do
if [ "$d" = "$srcdir" ]; then
goal=.
else
goal="`echo $d | sed -e \"s,$srcdir/,,\"`"
fi
objgoal="`echo $objdir/$goal | sed -e 's,/\.$,,'`"
srcgoal="`echo $srcdir/$goal | sed -e 's,/\.$,,'`"
dots="`echo $objgoal/ | sed -e 's,[^/][^/]*,..,g'`"
echo Softlinking $srcdir/$goal '->' $objdir/$goal '(' $dots ')'
(mkdir -p $objgoal && cd $objgoal && \
(ls -a $dots$srcgoal |\
while read f; do
test -f $dots$srcgoal/$f && \
ln -s $dots$srcgoal/$f .; \
done))
done