From: Jarkko Hietaniemi Date: Mon, 18 Jun 2001 22:17:05 +0000 (+0000) Subject: More cross-compilation defaults gleaned from -Dcc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=93bc48faf83afc24e3501cff22973c0d6498c26e;p=p5sagit%2Fp5-mst-13.2.git More cross-compilation defaults gleaned from -Dcc if it is CPU-OS-gcc. p4raw-id: //depot/perl@10690 --- diff --git a/Configure b/Configure index d8e406f..e7d4ced 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sat Jun 16 19:06:04 EET DST 2001 [metaconfig 3.0 PL70] +# Generated on Tue Jun 19 02:14:42 EET DST 2001 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ < try.c + set X `$cc -v -E perl.c 2>&1 | $awk '/^#include &4 + for i in $*; do + j=`$echo $i|$sed 's,/include$,/lib,'` + if $test -d $j; then + libpth="$libpth $j" + fi + done + libpth="$echo $libpth|$sed 's/^ //'" + echo "Guessing libpth $libpth." >&4 + fi + $rm -f try.c ;; esac case "$targetarch" in - '') echo "Cross-compiling: you should define targetarch." >&4; croak=y ;; - esac - case "$usrinc" in - '') echo "Cross-compiling: you should define usrinc." >&4; croak=y ;; + '') echo "Targetarch not defined." >&4; croak=y ;; + *) echo "Using targetarch $targetarch." >&4 ;; esac case "$incpth" in - '') echo "Cross-compiling: you should define incpth." >&4; croak=y ;; + '') echo "Incpth not defined." >&4; croak=y ;; + *) echo "Using incpth $incpth." >&4 ;; esac case "$libpth" in - '') echo "Cross-compiling: you should define libpth." >&4; croak=y ;; + '') echo "Libpth not defined." >&4; croak=y ;; + *) echo "Using libpth $libpth." >&4 ;; esac - case "$targethost" in - '') echo "Cross-compiling: targethost not defined." >&4; croak=y ;; + case "$usrinc" in + '') for i in $incpth; do + if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then + usrinc=$i + echo "Guessing usrinc $usrinc." >&4 + break + fi + done + case "$usrinc" in + '') echo "Usrinc not defined." >&4; croak=y ;; + esac + ;; + *) echo "Using usrinc $usrinc." >&4 ;; esac - case "$targetdir" in - '') echo "Cross compiling: targetdir not defined." >&4; croak=y ;; + case "$targethost" in + '') echo "Targethost not defined." >&4; croak=y ;; + *) echo "Using targethost $targethost." >&4 esac - locincpth='' - loclibpth='' + locincpth=' ' + loclibpth=' ' case "$croak" in - y) exit 1 ;; + y) echo "Cannot continue, aborting." >&4; exit 1 ;; esac case "$src" in /*) run=$src/Cross/run to=$src/Cross/to from=$src/Cross/from ;; - *) pwd=`test -f ../Configure & cd ..; pwd` + *) pwd=`$test -f ../Configure & cd ..; pwd` run=$pwd/Cross/run to=$pwd/Cross/to from=$pwd/Cross/from @@ -2369,8 +2399,15 @@ $define|true|[yY]*) run=$run-$targetrun to=$to-$targetto from=$from-$targetfrom + case "$targetdir" in + '') targetdir=/tmp + echo "Guessing targetdir $targetdir." >&4 + ;; + esac case "$targetuser" in - '') targetuser=root ;; + '') targetuser=root + echo "Guessing targetuser $targetuser." >&4 + ;; esac case "$targetfrom" in scp) q=-q ;; @@ -2386,7 +2423,7 @@ $to \$exe $targetrun -l $targetuser $targethost "cd $targetdir && ./\$exe \$@" EOF ;; - *) echo "Cross-compiling: unknown targetrun '$targetrun'" >&4 + *) echo "Unknown targetrun '$targetrun'" >&4 exit 1 ;; esac @@ -2406,7 +2443,7 @@ EOF cp \$@ $targetdir/. EOF ;; - *) echo "Cross-compiling: unknown targetto '$targetto'" >&4 + *) echo "Unknown targetto '$targetto'" >&4 exit 1 ;; esac @@ -2430,33 +2467,31 @@ done exit 0 EOF ;; - *) echo "Cross-compiling: unknown targetfrom '$targetfrom'" >&4 + *) echo "Unknown targetfrom '$targetfrom'" >&4 exit 1 ;; esac - if test ! -f $run; then - echo "Cross-compiling: target 'run' script '$run' not found." >&4 + if $test ! -f $run; then + echo "Target 'run' script '$run' not found." >&4 else chmod a+rx $run fi - if test ! -f $to; then - echo "Cross-compiling: target 'to' script '$to' not found." >&4 + if $test ! -f $to; then + echo "Target 'to' script '$to' not found." >&4 else chmod a+rx $to fi - if test ! -f $from; then - echo "Cross-compiling: target 'from' script '$from' not found." >&4 + if $test ! -f $from; then + echo "Target 'from' script '$from' not found." >&4 else chmod a+rx $from fi - if test ! -f $run -o ! -f $to -o ! -f $from; then + if $test ! -f $run -o ! -f $to -o ! -f $from; then exit 1 fi cat >&4 < has the usual GNU C semantics for cross compilers, that is, CPU-OS-gcc, the names of the C, C, and C will also be automatically chosen to be CPU-OS-ar and so on. -(The C requires more thought and will be chosen later by Configure.) +(The C requires more thought and will be chosen later by Configure +as appropriate.) Also, in this case the incpth, libpth, and usrinc +will be guessed by Configure (unless explicitly set to something else, +in which case Configure's guesses with be appended). In addition to the default execution/transfer methods you can also choose B for execution, and B or B for transfer, @@ -1814,7 +1824,8 @@ for example: Putting it all together: sh ./Configure -des -Dusecrosscompile \ - -Dtargethost=so.me.ho.st -Dtargetdir=/tar/get/dir \ + -Dtargethost=so.me.ho.st \ + -Dtargetdir=/tar/get/dir \ -Dtargetuser=root \ -Dtargetarch=arm-linux \ -Dcc=arm-linux-gcc \ @@ -1823,6 +1834,13 @@ Putting it all together: -Dlibpth=/skiff/local/arm-linux/lib \ -D... +or if you are happy with the defaults + + sh ./Configure -des -Dusecrosscompile \ + -Dtargethost=so.me.ho.st \ + -Dcc=arm-linux-gcc \ + -D... + =head1 make test This will run the regression tests on the perl you just made. If