first stage of new bootstrap
[nyanlinux.git] / builders / make-0 / builder-target.sh
blob9784c9c5ada75d60ad15b3e912bcfdd448934c15
1 src_name=make
2 git_commit=8a731d1b2cc262d03e0246a4869c704b6c1599ec
3 git_url0=git://git.savannah.gnu.org/$src_name.git
5 pkg_dir=$pkgs_dir_root/$pkg_name
6 src_dir=$src_dir_root/$src_name
7 rm -Rf $pkg_dir
8 mkdir -p $pkgs_dir_root
9 cp -r $src_dir $pkg_dir
11 #-------------------------------------------------------------------------------
12 cd $pkg_dir
13 OLD_PATH=$PATH
14 export PATH=$sdk_gettext_path/bin:$PATH
16 git checkout --force $git_commit
17 git reset --hard
19 # remove doc
20 sed -i -e 's:doc/Makefile::' ./configure.ac
21 sed -i -e '/^SUBDIRS/ cSUBDIRS = glob config po' ./Makefile.am
23 autoreconf -i
24 export PATH=$OLD_PATH
25 #-------------------------------------------------------------------------------
27 build_dir=$builds_dir_root/$pkg_name-$target_gnu_triple
28 rm -Rf $build_dir
29 mkdir -p $build_dir
30 cd $build_dir
32 OLD_PATH=$PATH
33 export PATH=$cross_toolchain_dir_root/bin:$PATH
35 export PKG_CONFIG_LIBDIR=
36 export PKG_CONFIG_SYSROOT_DIR=$target_sysroot
38 # at link time, the only way to tell gnu ld where to look for shared lib dependencies is to pass the -rpath-link option
39 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"
40 export 'CFLAGS=-O2 -pipe -fPIC'
41 $pkg_dir/configure \
42 --build=$build_gnu_triple \
43 --host=$target_gnu_triple \
44 --prefix=/nyan/make/0 \
45 --disable-nls
46 unset CFLAGS
47 unset CC
49 make -j $threads_n
50 make install DESTDIR=$target_sysroot
52 # cleanup and tidying
53 rm -Rf $target_sysroot/nyan/$src_name/0/share
54 $target_gnu_triple-strip -s $target_sysroot/nyan/$src_name/0/bin/$src_name
56 rm -Rf $build_dir $pkg_dir
57 export PATH=$OLD_PATH