| 1 | #!/bin/sh | 
|---|
| 2 | # | 
|---|
| 3 | # | 
|---|
| 4 | # This can probably be smarter about | 
|---|
| 5 | # (like reading an ENV variable) | 
|---|
| 6 | # | 
|---|
| 7 | KBUILD_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 | # | 
|---|
| 29 | SYSBIN=/usr/bin | 
|---|
| 30 | BSDBIN=/usr/ucb | 
|---|
| 31 | GNUBIN=/opt/csw/bin | 
|---|
| 32 | KBUILD_BIN=${KBUILD_TOP}/kBuild/bin | 
|---|
| 33 | SOLX86BIN=${KBUILD_BIN}/solaris.x86 | 
|---|
| 34 | # | 
|---|
| 35 | # Create the target/bin directory | 
|---|
| 36 | # | 
|---|
| 37 | if [ ! -d ${SOLX86BIN} ];  then | 
|---|
| 38 | mkdir -p ${SOLX86BIN} | 
|---|
| 39 | fi | 
|---|
| 40 | # | 
|---|
| 41 | # have to use bash to bootstrap because Solaris has | 
|---|
| 42 | # no ash. this will have to do in bootstrapping, | 
|---|
| 43 | # | 
|---|
| 44 | cp /usr/bin/bash ${SOLX86BIN}/kmk_ash | 
|---|
| 45 | # | 
|---|
| 46 | # Use Solaris versions of these commands to | 
|---|
| 47 | # bootstrap kmk | 
|---|
| 48 | # | 
|---|
| 49 | for i in cat echo mkdir rm rmdir | 
|---|
| 50 | do | 
|---|
| 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 | 
|---|
| 57 | done | 
|---|
| 58 |  | 
|---|
| 59 | # | 
|---|
| 60 | # Have to use GNU versions of these commands | 
|---|
| 61 | # to build kmk due to "Solarisisms". | 
|---|
| 62 | # | 
|---|
| 63 | for i in cp ln mv sed | 
|---|
| 64 | do | 
|---|
| 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 | 
|---|
| 71 | done | 
|---|
| 72 | # | 
|---|
| 73 | # cheat and use /usr/ucb/install just because it does | 
|---|
| 74 | # the right things | 
|---|
| 75 | # | 
|---|
| 76 | for i in install | 
|---|
| 77 | do | 
|---|
| 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 | 
|---|
| 84 | done | 
|---|
| 85 | # | 
|---|
| 86 | # Have to put GNU's sed in front of the /usr/bin/sed | 
|---|
| 87 | # so that sed's configure will complete. | 
|---|
| 88 | # | 
|---|