Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tools/gcc use mknative.common
details: https://anonhg.NetBSD.org/src/rev/0b55057f9f6f
branches: trunk
changeset: 555754:0b55057f9f6f
user: mrg <mrg%NetBSD.org@localhost>
date: Thu Nov 27 01:05:45 2003 +0000
description:
use mknative.common
diffstat:
tools/gcc/mknative-gcc | 66 ++++++-------------------------------------------
1 files changed, 8 insertions(+), 58 deletions(-)
diffs (88 lines):
diff -r e70adaaecdf7 -r 0b55057f9f6f tools/gcc/mknative-gcc
--- a/tools/gcc/mknative-gcc Thu Nov 27 01:05:32 2003 +0000
+++ b/tools/gcc/mknative-gcc Thu Nov 27 01:05:45 2003 +0000
@@ -1,63 +1,19 @@
#!/bin/sh
-# $NetBSD: mknative-gcc,v 1.8 2003/11/27 00:56:20 mrg Exp $
+# $NetBSD: mknative-gcc,v 1.9 2003/11/27 01:05:45 mrg Exp $
#
# Shell script for generating all the constants needed for a native
# platform build of src/gnu/dist/toolchain.
#
-bomb () {
- echo >&1 "ABORT: $*"
- exit 1
-}
-
-# usage: getvars MAKEFILE VARNAME [VARNAME...]
-getvars () {
- _mf="$1"; shift
- $MAKE -f - _x_ <<EOF || bomb "getvars $_mf $* failed"
-_x_:
-.for var in $*
- @echo G_\${var}=\${\${var}:Q} | sed 's,$_VPATH,\$\${GNUHOSTDIST},g'
-.endfor
-.include "$_TMPDIR/$_mf"
-EOF
-}
-
-# usage: write_c FILENAME
-write_c () {
- echo '/* This file is automatically generated. DO NOT EDIT! */' >$_TOP/$1.tmp || \
- bomb "cannot create $1"
- grep '$''NetBSD' $0 | sed 's,[#$],,g;s,.*,/* Generated from: & */,' >>$_TOP/$1.tmp
- echo '' >>$_TOP/$1.tmp
- writefile $1
-}
+# initialise
-# usage: write_mk FILENAME
-write_mk () {
- echo '# This file is automatically generated. DO NOT EDIT!' >$_TOP/$1.tmp || \
- bomb "cannot create $1"
- grep '$''NetBSD' $0 | sed 's,[#$],,g;s,.*,# Generated from: &,' >>$_TOP/$1.tmp
- echo '#' >>$_TOP/$1.tmp
- writefile $1
-}
-
-writefile () {
- sed -e 's,netbsd\(elf\)*1[0-9\.]*\(_\)*[A-Z]*,netbsd\1,' \
- -e 's,^/\* #undef HAVE_MMAP \*/$,#define HAVE_MMAP 1,' >>$_TOP/$1.tmp
+_TMPDIR=$2
+_TOP=$3
+_PLATFORM=$4
+_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*= ,,'`
+_GNU_DIST=`cd ${_VPATH}; pwd`
- # Compare new file, sans "generated from" comments and RCS Id, to
- # old file. If they match, don't change anything.
- rm -f $_TMPDIR/.1 $_TMPDIR/.2
- grep -v 'Generated from:' $_TOP/$1 >$_TMPDIR/.1 2>/dev/null
- grep -v 'Generated from:' $_TOP/$1.tmp >$_TMPDIR/.2
-
- # will not overwrite a file that has the same content
- if cmp $_TMPDIR/.1 $_TMPDIR/.2 >/dev/null 2>&1; then
- rm -f $_TOP/$1.tmp
- else
- echo >&2 "$1 changed"
- mv -f $_TOP/$1.tmp $_TOP/$1
- fi
-}
+. $_TOP/tools/gcc/mknative.common
##### gnu/lib/libg2c #####
@@ -194,12 +150,6 @@
##### main #####
-_TMPDIR=$2
-_TOP=$3
-_PLATFORM=$4
-_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*= ,,'`
-_GNU_DIST=`cd ${_VPATH}; pwd`
-
case $1 in
libgcc) # .mk and .h files for libgcc bootstrap (from host build)
get_libgcc
Home |
Main Index |
Thread Index |
Old Index