Contents of /trunk/toolchain/toolchain-libstdc++/toolchain-libstdc++-3.4.3-r3.smage2
Parent Directory | Revision Log
Revision 160 -
(show annotations)
(download)
Fri Jul 29 13:44:31 2005 UTC (19 years, 2 months ago) by niro
File size: 2797 byte(s)
Fri Jul 29 13:44:31 2005 UTC (19 years, 2 months ago) by niro
File size: 2797 byte(s)
fixed srcinstall
1 | # $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-libstdc++/toolchain-libstdc++-3.4.3-r3.smage2,v 1.2 2005-07-29 13:44:31 niro Exp $ |
2 | |
3 | PNAME="toolchain-libstdc++" |
4 | PVER="3.4.3" |
5 | PBUILD="r3" |
6 | |
7 | SRCFILE="gcc-${PVER}.tar.bz2" |
8 | SRCDIR="${BUILDDIR}/gcc-${PVER}" |
9 | |
10 | # languages to build into gcc |
11 | MyLanguages=c,c++ |
12 | |
13 | SRC_URI=( |
14 | mirror://gcc/${SRCFILE} |
15 | mirror://gcc/gcc-${PVER}-no_fixincludes-1.patch |
16 | mirror://gcc/gcc-${PVER}-linkonce-1.patch |
17 | mirror://gcc/gcc-${PVER}-fix_configure_for_target_native-1.patch |
18 | mirror://gcc/gcc-${PVER}-magellan-version.patch |
19 | ) |
20 | |
21 | # need: libstdc++ to run, tcsh to compile ada |
22 | # compile time: unkown (Athlon XP 1900+, 512mb DDR400) |
23 | |
24 | ## global toolchain var ## |
25 | # export CFLAGS, CHOST, TOOLCHAIN_PREFIX |
26 | export CFLAGS="-mtune=i486 -Os -pipe" |
27 | export CXXFLAGS="${CFLAGS}" |
28 | export TOOLCHAIN_PREFIX="/tools" |
29 | |
30 | zapmost() { |
31 | local rootdir |
32 | rootdir="${1}/" |
33 | [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1 |
34 | install -d ${BUILDDIR}/zap |
35 | local dirs |
36 | shift |
37 | local x |
38 | for x in ${*} |
39 | do |
40 | if [ "${x##*/}" = "${x}" ] |
41 | then |
42 | #one deep |
43 | mv ${rootdir}${x} ${BUILDDIR}/zap |
44 | else |
45 | #more than one deep; create intermediate directories |
46 | dirs=${x%/*} |
47 | install -d ${BUILDDIR}/zap/${dirs} |
48 | mv ${rootdir}${x} ${BUILDDIR}/zap/${x} |
49 | fi |
50 | done |
51 | rm -rf ${rootdir}* |
52 | mv ${BUILDDIR}/zap/* ${rootdir} |
53 | } |
54 | |
55 | |
56 | src_prepare() { |
57 | munpack ${SRCFILE} || die |
58 | cd ${SRCDIR} |
59 | |
60 | mpatch -Np1 gcc-${PVER}-no_fixincludes-1.patch || die |
61 | mpatch -Np1 gcc-${PVER}-linkonce-1.patch || die |
62 | mpatch -Np1 gcc-${PVER}-fix_configure_for_target_native-1.patch || die |
63 | mpatch -Np0 gcc-${PVER}-magellan-version.patch || die |
64 | |
65 | # suppress installation of libiberty, as we will be |
66 | # using the one from binutils |
67 | sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die |
68 | |
69 | mkdir ${SRCDIR}/build || die |
70 | cd ${SRCDIR}/build |
71 | } |
72 | |
73 | src_compile() { |
74 | cd ${SRCDIR}/build |
75 | |
76 | ../configure \ |
77 | --host=${CHOST} \ |
78 | --prefix=${TOOLCHAIN_PREFIX} \ |
79 | --enable-shared \ |
80 | --enable-threads=posix \ |
81 | --enable-__cxa_atexit \ |
82 | --enable-clocale=gnu \ |
83 | --disable-checking \ |
84 | --disable-libunwind-exceptions \ |
85 | --with-system-zlib \ |
86 | --enable-long-long \ |
87 | --enable-cstdio=stdio \ |
88 | --enable-languages=${MyLanguages} \ |
89 | --disable-libstdcxx-pch \ |
90 | || die |
91 | |
92 | # bootstrap-lean seems to be broken |
93 | # gcc does not like MAKEOPTS >= -j1 |
94 | make bootstrap || die |
95 | } |
96 | |
97 | src_install() { |
98 | cd ${SRCDIR}/build |
99 | install -d ${BINDIR}/lib || die |
100 | |
101 | make DESTDIR=${BINDIR} install || die |
102 | |
103 | # deletes everything excluding libgcc_s and libstdc++ |
104 | zapmost ${BINDIR}${TOOLCHAIN_PREFIX}/lib libgcc_s*.* libstdc++*.* || die |
105 | |
106 | # other not needed |
107 | rm -rf ${BINDIR}${TOOLCHAIN_PREFIX}/lib || die |
108 | rm -rf ${BINDIR}${TOOLCHAIN_PREFIX}/{bin,include,share} || die |
109 | rm -rf ${BINDIR}${TOOLCHAIN_PREFIX}/{info,man,libexec} || die |
110 | } |