Gfx Stack Update
[nyanlinux.git] / builders / libffi-3.3 / builder.sh
blob55172ed24d4a5784a73f0bc473a550570ef0d3c1
1 src_name=libffi
2 version=${pkg_name##*-}
3 slot=$version
4 archive_name=$src_name-$version.tar.gz
5 url0=ftp://sourceware.org/pub/$src_name/$archive_name
7 pkg_dir=$pkgs_dir_root/$src_name-$version
8 rm -Rf $pkg_dir
9 mkdir -p $pkgs_dir_root
10 cp -f $src_dir_root/$archive_name $pkgs_dir_root
11 cd $pkgs_dir_root
12 tar xf $archive_name
14 build_dir=$builds_dir_root/$src_name-$version
15 rm -Rf $build_dir
16 mkdir -p $build_dir
17 cd $build_dir
19 PATH_SAVED=$PATH
20 export PATH="\
21 /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin:\
22 /nyan/make/current/bin:\
23 $PATH\
25 target_gnu_triple=$(basename "$(ls -d /nyan/toolchains/binutils-2.36.1-gcc-4.7.4/current/bin/*-gcc)")
26 target_gnu_triple=${target_gnu_triple%-gcc}
28 export 'CFLAGS=-O2 -pipe -fPIC'
29 export "CC=$target_gnu_triple-gcc \
30 -isystem /nyan/glibc/current/include \
31 -isystem /nyan/linux-headers/current/include \
32 -B/nyan/glibc/current/lib \
33 -L/nyan/glibc/current/lib \
34 -Wl,-rpath-link,/nyan/glibc/current/lib \
35 -Wl,-s \
36 -static-libgcc"
37 export AR=$target_gnu_triple-ar
38 $pkg_dir/configure \
39 --prefix=/nyan/$src_name/$slot \
40 --disable-shared
41 unset CFLAGS
42 unset CC
43 unset AR
45 make -j $threads_n
46 make install
48 rm -Rf $target_sysroot/nyan/$src_name/$slot/share
49 rm -f $target_sysroot/nyan/$src_name/$slot/lib64/*.la
51 export PATH=$PATH_SAVED
52 unset PATH_SAVED
53 unset target_gnu_triple
54 rm -f $pkgs_dir_root/$archive_name
55 rm -Rf $build_dir $pkg_dir