Gfx Stack Update
[nyanlinux.git] / builders / bash-0 / builder-target.sh
blob43aaa070926c03e4e43e6335915bca08dbe404ee
1 src_name=bash
2 version=4.4.18
3 archive_name=$src_name-$version.tar.gz
4 url0=http://ftpmirror.gnu.org/$src_name/$archive_name
6 src_dir=$src_dir_root/$src_name-$version
7 cd $src_dir_root
8 rm -Rf $src_name-$version
9 tar xf $archive_name
11 cd $src_dir
12 ### we use wide version of ncurses, be brutal telling bash configure
13 ##sed -i 's/tinfo/tinfow/' ./configure
15 build_dir=$builds_dir_root/$pkg_name-$version-$target_gnu_triple
16 rm -Rf $build_dir
17 mkdir -p $build_dir
18 cd $build_dir
20 OLD_PATH=$PATH
21 export PATH=$cross_toolchain_dir_root/bin:$PATH
23 # help bash configuration find the right tinfo
24 ln -fs libtinfow.a $target_sysroot/nyan/ncurses/0/lib/libtinfo.a
26 # at link time, the only way to tell gnu ld where to look for shared lib dependencies is to pass the -rpath-link option
27 export "CC=$target_gnu_triple-gcc -B$target_sysroot/nyan/glibc/current/lib -L$target_sysroot/nyan/glibc/current/lib -Wl,-rpath-link,$target_sysroot/nyan/glibc/current/lib -static-libgcc"
28 export 'CFLAGS=-O2 -pipe -fPIC'
29 export "LDFLAGS=-L$target_sysroot/nyan/readline/0/lib -L$target_sysroot/nyan/ncurses/0/lib"
30 $src_dir/configure \
31 --build=$build_gnu_triple \
32 --host=$target_gnu_triple \
33 --prefix=/nyan/bash/0 \
34 --enable-multibyte \
35 --enable-net-redirections \
36 --disable-nls \
37 --with-installed-readline \
38 --with-curses
39 unset LDFLAGS
40 unset CFLAGS
41 unset CC
43 make -j $threads_n
44 make install DESTDIR=$target_sysroot
46 # cleanup and tidying
47 rm -Rf $target_sysroot/nyan/$src_name/0/share
48 find $target_sysroot/nyan/$src_name/0 -type f | while read f; do if file $f | egrep 'ELF.+(shared|executable)' >/dev/null; then $target_gnu_triple-strip -s $f; fi; done
50 rm -f $target_sysroot/nyan/ncurses/0/lib/libtinfo.a
52 rm -Rf $build_dir $src_dir
53 export PATH=$OLD_PATH