1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
#!/bin/bash
if [ "$#" == "0" ] ; then
echo "
Usage: bootstrap root-directory
root-directory: directory under which all icmake files will be
installed. For a normal system-installation use, e.g., /
This script assumes that the GCC compiler is available, and that
the function glob() is available in the gcc-runtime library.
If that's not the case, remove the -DHAVE_GLOB define from the
gcc flags.
Furthermore, it assumes that the parser files parser.c and parser.h have
already been generated from the file parser and that the file lexer.c has
already been generated from the file lexer.
"
exit 1
fi
try()
{
echo $*
$* || exit 1
}
echo Creating the intermediate destination directory ./tmp
try rm -rf tmp
try mkdir -p tmp
echo Writing tmp/ROOT
echo "ROOT=$1/" > tmp/ROOT
. scripts/conversions
echo "
#define BINDIR \"${BINDIR}\"
#define SKELDIR \"${SKELDIR}\"
#define MANDIR \"${MANDIR}\"
#define LIBDIR \"${LIBDIR}\"
#define CONFDIR \"${CONFDIR}\"
#define DOCDIR \"${DOCDIR}\"
#define DOCDOCDIR \"${DOCDOCDIR}\"
#define VERSION \"${VERSION}\"
#define YEARS \"${YEARS}\"
" > tmp/INSTALL.im
cat tmp/INSTALL.im
echo Creating remaining intermediate destination directories
try mkdir -p tmp/${BINDIR} tmp/${LIBDIR} tmp/${SKELDIR} \
tmp/${CONFDIR} tmp/${MANDIR}/man1 tmp/${MANDIR}/man7 \
tmp/${DOCDIR} tmp/${DOCDOCDIR}
echo Creating tmp/libicrss.a
try cd rss
try gcc -c -O2 -g -Wall -DHAVE_GLOB *.c
try ar rs ../tmp/libicrss.a *.o
rm *.o
cd ..
echo Creating tmp/${BINDIR}/icmake${EXTENSION}
try cd make
try gcc -O2 -g -Wall -DHAVE_GLOB -o ../tmp/${BINDIR}/icmake${EXTENSION} *.c ../tmp/libicrss.a
cd ..
echo Creating tmp/${BINDIR}/icmun${EXTENSION}
try cd un
try gcc -O2 -g -Wall -DHAVE_GLOB -o ../tmp/${BINDIR}/icmun${EXTENSION} *.c ../tmp/libicrss.a
cd ..
echo Creating tmp/${LIBDIR}/icm-pp${EXTENSION}
try cd pp
try gcc -O2 -g -Wall -DHAVE_GLOB -o ../tmp/${LIBDIR}/icm-pp${EXTENSION} *.c ../tmp/libicrss.a
cd ..
echo Creating tmp/${LIBDIR}/icm-comp${EXTENSION}
try cd comp
try gcc -O2 -g -Wall -DHAVE_GLOB -o ../tmp/${LIBDIR}/icm-comp${EXTENSION} *.c ../tmp/libicrss.a
cd ..
echo Creating tmp/${LIBDIR}/icm-exec${EXTENSION}
try cd exec
try gcc -O2 -g -Wall -DHAVE_GLOB -c *.c
for x in auks var virtual int list string stack opcodefun builtin
do
try cd $x
try gcc -O2 -g -Wall -DHAVE_GLOB -c *.c
try cd ..
done
try gcc -o ../tmp/${LIBDIR}/icm-exec${EXTENSION} *.o */*.o ../tmp/libicrss.a
rm *.o */*.o
cd ..
echo Copying icmbuild/icmstart from scripts to tmp
cp scripts/icmbuild.in scripts/icmstart.in tmp/
echo Copying the skeleton files in usr/share/icmake/
try cp -r usr/share/icmake/* tmp/${SKELDIR}
echo Copying the configuration files in etc/icmake/
try cp -r etc/icmake/* tmp/${CONFDIR}
echo Copying the man-pages from doc/
try cp doc/*.1 tmp/${MANDIR}/man1
try cp doc/*.7 tmp/${MANDIR}/man7
echo Copying additional documentation to doc/
try mkdir -p tmp/${DOCDIR}/doc
try cp changelog tmp/${DOCDIR}/doc
echo Copying additional documentation to doc-doc/
try cp -r examples doc/icmake.doc doc/icmake.ps doc/README.icmbuild tmp/${DOCDOCDIR}
echo Copying etc files to etc/
try cp -r etc tmp/
echo Done.
|