BoostrappingOld: prepop-bin-solx86.sh

File prepop-bin-solx86.sh, 1.8 KB (added by bird, 17 years ago)

Script for poluation kBuild/bin/solaris.x86/ when bootstrapping.

Line 
1#!/bin/sh
2#
3#
4# This can probably be smarter about
5# (like reading an ENV variable)
6#
7KBUILD_TOP=/export/src/kmk/021907/kmk
8#
9#############################################
10#
11# setup the parts we need to bootstrap
12# kmk on Solaris
13#
14# Have to use GNU cp, ln, mv and sed
15# because cp, ln, and mv won't work out
16# of any other directory but /usr/bin,
17# and solaris's sed is busticated for
18# doing sed's configure.
19#
20# I just make a temporary directory for
21# GNU's sed and put that path in front
22# so that the sed configure picks it.
23# I might be able to do something with
24# defining which sed to use, but I've
25# already got this working.
26#
27#############################################
28#
29SYSBIN=/usr/bin
30BSDBIN=/usr/ucb
31GNUBIN=/opt/csw/bin
32KBUILD_BIN=${KBUILD_TOP}/kBuild/bin
33SOLX86BIN=${KBUILD_BIN}/solaris.x86
34#
35# Create the target/bin directory
36#
37if [ ! -d ${SOLX86BIN} ];  then
38        mkdir -p ${SOLX86BIN}
39fi
40#
41# have to use bash to bootstrap because Solaris has
42# no ash. this will have to do in bootstrapping,
43#
44cp /usr/bin/bash ${SOLX86BIN}/kmk_ash
45#
46# Use Solaris versions of these commands to
47# bootstrap kmk
48#
49for i in cat echo mkdir rm rmdir
50do
51        SRCFILE=${SYSBIN}/${i}
52        if [ -f ${SRCFILE} ]; then
53                cp ${SRCFILE} ${SOLX86BIN}/kmk_${i}
54        else
55                echo "couldn't find ${SRCFILE}"
56        fi
57done
58
59#
60# Have to use GNU versions of these commands
61# to build kmk due to "Solarisisms".
62#
63for i in cp ln mv sed
64do
65        SRCFILE=${GNUBIN}/g${i}
66        if [ -f ${SRCFILE} ]; then
67                cp ${SRCFILE} ${SOLX86BIN}/kmk_${i}
68        else
69                echo "couldn't find ${SRCFILE}"
70        fi
71done
72#
73# cheat and use /usr/ucb/install just because it does
74# the right things
75#
76for i in install
77do
78        SRCFILE=${BSDBIN}/${i}
79        if [ -f ${SRCFILE} ]; then
80                cp ${SRCFILE} ${SOLX86BIN}/kmk_${i}
81        else
82                echo "couldn't find ${SRCFILE}"
83        fi
84done
85#
86# Have to put GNU's sed in front of the /usr/bin/sed
87# so that sed's configure will complete.
88#