1 # Maintainer: Lukas Jirkovsky <l.jirkovsky@gmail.com>
6 pkgdesc="A call graph generation utility for C/C++"
8 url="http://www.csn.ul.ie/~mel/projects/codeviz/"
10 depends=('perl' 'graphviz')
11 source=(http://www.csn.ul.ie/~mel/projects/codeviz/codeviz-$pkgver.tar.gz \
12 ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$_gccver/gcc-$_gccver.tar.gz \
13 gcc_build_fixes.diff \
15 install=codeviz.install
16 md5sums=('9de2506f8d87eebea86a93197ee58316'
17 'b0c915e554aaf475dde0571677c15a9c'
18 '6796b290d7f734ee9d92e1e38f363bd7'
19 'eb834abd7620a5f11492ee2c243b8346')
21 _gccprefix=/opt/gccgraph
27 # unset the C(XX)FLAGS because they would break the compilation if they contained
28 # options not supported in $_gccver
31 cd "$srcdir"/gcc-$_gccver
32 # apply codeviz patches
33 patch -Np1 < "$srcdir"/$pkgname-$pkgver/compilers/gcc-patches/gcc-$_gccver-cdepn.diff || true
34 # apply fixes needed for build
35 patch -Np1 < "$srcdir"/gcc_build_fixes.diff || true
37 if [ "${CARCH}" = "x86_64" ]; then
38 patch -Np1 < "$srcdir"/gcc_pure64.diff || true
41 if [ ! -d "$srcdir"/gcc-build ]; then
42 mkdir "$srcdir"/gcc-build
44 cd "$srcdir"/gcc-build
45 ../gcc-$_gccver/configure --prefix=$_gccprefix --enable-shared --enable-languages=c,c++ \
46 --enable-threads=posix --enable-__cxa_atexit --disable-multilib \
47 --enable-clocale=gnu --libdir=$_gccprefix/lib \
48 --libexecdir=$_gccprefix/lib
50 # now the build most likely failed
51 # we have to fix some problems and try to build gcc again
52 sed 's/.*undef HAVE_LIMITS_H.*/\#define HAVE_LIMITS_H 1/' -i $CHOST/libiberty/config.h
53 sed 's/.*undef HAVE_STDLIB_H.*/\#define HAVE_STDLIB_H 1/' -i $CHOST/libiberty/config.h
54 sed 's/.*undef HAVE_UNISTD_H.*/\#define HAVE_UNISTD_H 1/' -i $CHOST/libiberty/config.h
55 echo "#undef HAVE_SYS_STAT_H" >> $CHOST/libiberty/config.h
56 echo "#define HAVE_SYS_STAT_H 1" >> $CHOST/libiberty/config.h
63 cd "$srcdir"/gcc-build
64 make DESTDIR="$pkgdir" install
67 cd "$srcdir/$pkgname-$pkgver"
69 install -d -m755 "$pkgdir"/usr/lib/perl5/vendor_perl/CodeViz
70 install -m444 lib/CodeViz/* "$pkgdir"/usr/lib/perl5/vendor_perl/CodeViz/
71 # install codeviz binaries
72 install -d -m755 "$pkgdir"/usr/bin
73 install -m755 bin/* "$pkgdir"/usr/bin/
76 # vim:set ts=2 sw=2 et: