1# this script prepares the /boot/develop/tools/gnupro-folder for distribution
2#
3GCC_VER=`gcc --version`
4FULL_VER=gcc-2.95.3_binutils-2.15
5# strip executables
6strip --strip-unneeded /boot/develop/tools/gnupro/bin/*
7strip --strip-unneeded /boot/develop/tools/gnupro/i586-pc-beos/bin/*
8strip --strip-unneeded /boot/develop/tools/gnupro/lib/*
9strip --strip-unneeded /boot/develop/tools/gnupro/lib/gcc-lib/i586-pc-beos/$GCC_VER/*
10# remove info- and man-docs, install html-docs
11rm -rf /boot/develop/tools/gnupro/info
12rm -rf /boot/develop/tools/gnupro/man
13rm -rf /boot/develop/tools/gnupro/html-docs
14cp -a html-docs /boot/develop/tools/gnupro
15rm /boot/develop/tools/gnupro/html-docs/asconfig.texi
16rm /boot/develop/tools/gnupro/html-docs/create-docs.sh
17# remove locale files
18rm -rf /boot/develop/tools/gnupro/share
19# install separate specs-files for R5 and Dano, use Dano by default
20sed "s/-lroot/-lroot -lnet/" /boot/develop/tools/gnupro/lib/gcc-lib/i586-pc-beos/$GCC_VER/specs >/boot/develop/tools/gnupro/lib/gcc-lib/i586-pc-beos/$GCC_VER/specs.R5
21mv /boot/develop/tools/gnupro/lib/gcc-lib/i586-pc-beos/$GCC_VER/specs /boot/develop/tools/gnupro/lib/gcc-lib/i586-pc-beos/$GCC_VER/specs.Default
22ln -sf /boot/develop/tools/gnupro/lib/gcc-lib/i586-pc-beos/$GCC_VER/specs.Default /boot/develop/tools/gnupro/lib/gcc-lib/i586-pc-beos/$GCC_VER/specs
23cp -a ../gcc/COPYING* /boot/develop/tools/gnupro/
24# install readline lib, headers and html-docs
25#strip --strip-unneeded ~/Sources/ports/readline-5.0/lib*.a
26#cp -a ~/Sources/ports/readline-5.0/lib*.a /boot/develop/tools/gnupro/lib/
27#cp -a /boot/home/config/include/readline /boot/develop/tools/gnupro/include/
28#cp -a ~/Sources/ports/readline-5.0/doc/readline.html /boot/develop/tools/gnupro/html-docs/
29# identify all files
30mimeset /boot/develop/tools/gnupro/
31# add sdk-subfolder and create the required links:
32rm -rf /boot/develop/tools/sdk_$FULL_VER
33mkdir -p /boot/develop/tools/sdk_$FULL_VER
34cat >/boot/develop/tools/sdk_$FULL_VER/Readme <<EOF
35This folder exists to integrate gcc into the Dano/Zeta layout of the
36development-tools. If you want to activate $GCC_VER, just make a link from 
37/etc/develop/zeta-r1-gcc2-x86/tools/sdk to this folder.
38EOF
39mkdir -p /boot/develop/tools/sdk_$FULL_VER/release/H-i586-pc-beos5/T-i586-pc-beos5/i586-pc-beos5
40pushd /boot/develop/tools/sdk_$FULL_VER/release/H-i586-pc-beos5/T-i586-pc-beos5/i586-pc-beos5
41ln -sf ../../../../../$FULL_VER/i586-pc-beos/lib lib
42cd ..
43ln -sf ../../../../$FULL_VER/bin bin
44ln -sf ../../../../$FULL_VER/lib lib
45popd
46