6 # This script is for building the sixgill GCC plugin for Linux. It relies on
7 # the gcc checkout because it needs to recompile gmp and the gcc build script
8 # determines the version of gmp to download.
10 root_dir
=$MOZ_FETCHES_DIR
11 build_dir
=$GECKO_PATH/build
12 data_dir
=$GECKO_PATH/build
/unix
/build-gcc
14 sixgill_rev
=a84b31ab04ee
15 sixgill_repo
=https
://hg.mozilla.org
/users
/sfink_mozilla.com
/sixgill
17 .
$data_dir/build-gcc.sh
19 mkdir
$root_dir/gcc-source || true
20 pushd $root_dir/gcc-source
21 ln -sf ..
/gmp-source gmp
22 ln -sf ..
/isl-source isl
23 ln -sf ..
/mpc-source mpc
24 ln -sf ..
/mpfr-source mpfr
27 export TMPDIR
=${TMPDIR:-/tmp/}
28 export gcc_bindir
=$MOZ_FETCHES_DIR/gcc
/bin
29 export gmp_prefix
=/tools
/gmp
30 export gmp_dir
=$root_dir$gmp_prefix
34 hg clone
-r $sixgill_rev $sixgill_repo ||
( cd sixgill
&& hg update
-r $sixgill_rev )
38 if ! [ -x $gcc_bindir/gcc
]; then
39 echo "GCC not found in $gcc_bindir/gcc" >&2
43 # The sixgill plugin uses some gmp symbols, including some not exported by
44 # cc1/cc1plus. So link the plugin statically to libgmp. Except that the
45 # default static build does not have -fPIC, and will result in a relocation
46 # error, so build our own. This requires the gcc and related source to be
47 # in $root_dir/gcc-source.
49 mkdir
$root_dir/gmp-objdir || true
51 cd $root_dir/gmp-objdir
52 $root_dir/gcc-source
/gmp
/configure
--disable-shared --with-pic --prefix=$gmp_prefix
54 make install DESTDIR
=$root_dir
60 export CC
=$gcc_bindir/gcc
61 export CXX
=$gcc_bindir/g
++
62 export PATH
="$gcc_bindir:$PATH"
63 export LD_LIBRARY_PATH
="${gcc_bindir%/bin}/lib64"
65 export CPPFLAGS
=-I$gmp_dir/include
66 export EXTRA_LDFLAGS
=-L$gmp_dir/lib
67 export HOST_CFLAGS
=$CPPFLAGS
69 .
/release.sh
--build-and-package --with-gmp=$gmp_dir
70 tarball
=$
(ls -td *-sixgill |
head -1)/sixgill.
tar.xz
71 cp $tarball $root_dir/sixgill.
tar.xz
78 # Put a tarball in the artifacts dir
80 cp $MOZ_FETCHES_DIR/sixgill.
tar.
* $UPLOAD_DIR