Magellan Linux

Contents of /branches/magellan-next/deprecated/gcj/gcj-4.6.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9734 - (show annotations) (download)
Mon Jan 9 23:15:15 2012 UTC (12 years, 5 months ago) by niro
File size: 4434 byte(s)
-moved to 'deprecated'
1 # $Id$
2
3 PNAME="gcj"
4 PVER="4.6.2"
5 PBUILD="r2"
6
7 PCATEGORIE="sys-dev"
8
9 DESCRIPTION="Java compiler written by the GNU people."
10 HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
11
12 DEPEND="== sys-libs/libstdc++-${PVER}
13 == sys-dev/gcc-${PVER}
14 >= dev-java/eclipse-ecj-3.7
15 >= sys-apps/file-5
16 >= app-arch/unzip-6
17 >= app-arch/zip-3
18 >= media-libs/alsa-lib-1.0.24
19 >= x11-libs/libSM-1.2
20 >= x11-libs/libXtst-1.2
21 >= x11-libs/gtk2+-2.24
22 >= media-libs/libart_lgpl-2.3.21
23 >= dev-java/java-environment-1"
24
25 SDEPEND=">= sys-dev/binutils-2.21
26 >= dev-libs/gmp-5.0.2
27 >= dev-libs/mpfr-3.0.1
28 >= dev-libs/mpc-0.9
29 >= dev-libs/ppl-0.11.2
30 >= dev-libs/cloog-ppl-0.15.11
31 >= dev-libs/elfutils-0.152"
32
33 SRCFILE="gcc-${PVER}.tar.bz2"
34 SRCDIR="${BUILDDIR}/gcc-${PVER}"
35
36 # you better off when not using distcc to compile
37 # your new compiler :) maybe not all are the same
38 msetfeature "!distcc"
39
40 # languages to build into gcc
41 MyLanguages=java
42
43 sminclude mtools cleanutils libtool
44
45 SRC_URI=(
46 gnu://gcc/gcc-${PVER}/${SRCFILE}
47 mirror://gcc/${SRCFILE}
48 mirror://gcc/gcc-4.5.1-no-fixincludes.patch
49 )
50
51 UP2DATE="updatecmd \"http://ftp.gnu.org/gnu/gcc/?C=M;O=A\" | sed -n 's/.*gcc-\(.*\)\//\1/;$ p'"
52
53 # gcc don't like strong CFLAGS
54 export CFLAGS="${CFLAGS//-O?} -O2"
55 export CXXFLAGS="${CFLAGS}"
56
57 # check for crosscompile or export default CHOST
58 if [[ -z ${CTARGET} ]]
59 then
60 # no crosscompile defined
61 export CTARGET=${CHOST}
62 else
63 # use crosscompile host
64 export CTARGET=${CTARGET}
65 fi
66
67 src_prepare()
68 {
69 munpack ${SRCFILE} || die
70 cd ${SRCDIR}
71
72 # generic fixes
73 mpatch gcc-4.5.1-no-fixincludes.patch || die
74
75 # suppress installation of libiberty, as we will be
76 # using the one from binutils
77 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die
78
79 install -d ${SRCDIR}/build || die
80 cd ${SRCDIR}/build
81 }
82
83 src_compile()
84 {
85 cd ${SRCDIR}/build
86
87 local myconf
88
89 # Straight from the GCC install doc:
90 # "GCC has code to correctly determine the correct value for target
91 # for nearly all native systems. Therefore, we highly recommend you
92 # not provide a configure target when configuring a native compiler."
93 if [[ ${CHOST} != ${CTARGET} ]]
94 then
95 myconf+=" --target=${CTARGET}"
96 fi
97
98 # gcc >= 4.3 has now configure flags for uri and version - yeah!
99 AR=ar \
100 ../configure \
101 --with-bugurl="http://bugs.magellan-linux.de/" \
102 --with-pkgversion="Magellan-Linux" \
103 --build=${CHOST} \
104 --host=${CHOST} \
105 --prefix=/usr \
106 --mandir=/usr/share/man \
107 --infodir=/usr/share/info \
108 --libdir=/usr/$(mlibdir) \
109 --libexecdir=/usr/$(mlibdir) \
110 --enable-shared \
111 --enable-threads=posix \
112 --enable-__cxa_atexit \
113 --enable-clocale=gnu \
114 --disable-checking \
115 --with-system-zlib \
116 --enable-languages=${MyLanguages} \
117 --disable-libstdcxx-pch \
118 --enable-java-awt=gtk \
119 --enable-gtk-cairo \
120 --enable-libgcj-multifile \
121 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar \
122 --with-fastjar=/usr/bin/fastjar \
123 --disable-plugin \
124 ${myconf} \
125 || die
126
127 # parallel builds seems to break sometimes on x86_64
128 local myopts
129 [[ ${ARCH} = x86_64 ]] && myopts=-j1
130
131 mmake ${myopts} || die
132 }
133
134 src_install()
135 {
136 cd ${SRCDIR}/build
137
138 # install only java targets
139 make DESTDIR=${BINDIR} install-target-libjava || die
140 make -C gcc DESTDIR=${BINDIR} java.install-common || die
141 make -C gcc DESTDIR=${BINDIR} java.install-man || die
142
143 # missing bins
144 minstallexec gcc/jc1 /usr/$(mlibdir)/gcc/${CHOST}/${PVER}/ || die
145 minstallexec gcc/jvgenmain /usr/$(mlibdir)/gcc/${CHOST}/${PVER}/ || die
146
147 # versionize classes
148 local jar
149 local jarbase
150 local libbase
151 libbase="$(basename ${BINDIR}/usr/$(mlibdir)/gcj-${PVER}*)"
152 mlink ${libbase} /usr/$(mlibdir)/gcj-${PVER%.*} || die
153 if [[ $(mlibdir) != lib ]]
154 then
155 libbase="$(basename ${BINDIR}/usr/lib/gcj-${PVER}*)"
156 mlink ${libbase} /usr/lib/gcj-${PVER%.*} || die
157 fi
158 for jar in $(find ${BINDIR}/usr/share/java -type f -name \*.jar)
159 do
160 jarbase="$(basename ${jar})"
161 mlink ${jarbase} /usr/share/java/${jarbase/-${PVER}.jar/}-${PVER%.*}.jar || die
162 mlink ${jarbase} /usr/share/java/${jarbase/-${PVER}/} || die
163 done
164 # versionize all bins and symlink them
165 local bin
166 for bin in $(find ${BINDIR}/usr/bin -type f)
167 do
168 echo ${bin}
169 mv ${bin} ${bin}-${PVER} || die
170 ln -snf $(basename ${bin}-${PVER}) ${bin} || die
171 done
172
173 # fix all .la files
174 # they may contain invalid libpathes which are not needed
175 local la
176 for la in $(find ${BINDIR} -name \*.la)
177 do
178 fix_la_file ${la} || die ${la}
179 done
180 }