1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs native bash build
|
---|
4 | # ---------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 | cd ${SRC}
|
---|
12 | LOG=bash-native.log
|
---|
13 |
|
---|
14 | set_libdirname
|
---|
15 | setup_multiarch
|
---|
16 |
|
---|
17 | unpack_tarball bash-${BASH_VER} &&
|
---|
18 | cd ${PKGDIR}
|
---|
19 |
|
---|
20 | # If using gcc-3.4.x, patch some syntax gcc-3.4 doesn't like
|
---|
21 | # TODO: Get gcc version from cross-gcc itself
|
---|
22 |
|
---|
23 | case ${BASH_VER} in
|
---|
24 | 2.05b )
|
---|
25 | # Apply published official patches for bash-2.05b
|
---|
26 | apply_patch bash-2.05b-gnu_fixes-2
|
---|
27 | case ${GCC_VER} in
|
---|
28 | 3.4* )
|
---|
29 | apply_patch bash-2.05b-gcc34-1
|
---|
30 | ;;
|
---|
31 | esac
|
---|
32 | ;;
|
---|
33 | 3.0 )
|
---|
34 | # Reported on bug-bash by Tim Waugh <twaugh@redhat.com>
|
---|
35 | # http://lists.gnu.org/archive/html/bug-bash/2004-09/msg00081.html
|
---|
36 | apply_patch bash-3.0-fixes-1
|
---|
37 | apply_patch bash-3.0-avoid_WCONTINUED-1
|
---|
38 | ;;
|
---|
39 | esac
|
---|
40 |
|
---|
41 | if [ "${USE_READLINE}" = "Y" ]; then
|
---|
42 | extra_conf="--with-installed-readline"
|
---|
43 | else
|
---|
44 | # as was used with 2.05b w/o readline in the way old days
|
---|
45 | extra_conf="--with-curses"
|
---|
46 | fi
|
---|
47 |
|
---|
48 | max_log_init Bash ${BASH_VER} "native (shared)" ${CONFLOGS} ${LOG}
|
---|
49 | CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
50 | CXX="${CXX-g++} ${ARCH_CFLAGS}" \
|
---|
51 | CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
52 | CXXFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
53 | ./configure --prefix=/usr --bindir=/bin \
|
---|
54 | --without-bash-malloc ${extra_conf} \
|
---|
55 | >> ${LOGFILE} 2>&1 &&
|
---|
56 | echo " o Configure OK" || barf
|
---|
57 |
|
---|
58 | min_log_init ${BUILDLOGS} &&
|
---|
59 | make LDFLAGS="-s" \
|
---|
60 | >> ${LOGFILE} 2>&1 &&
|
---|
61 | echo " o Build OK" || barf
|
---|
62 |
|
---|
63 | min_log_init ${TESTLOGS} &&
|
---|
64 | make tests \
|
---|
65 | >> ${LOGFILE} 2>&1 &&
|
---|
66 | echo " o Test OK" || errmsg
|
---|
67 |
|
---|
68 | min_log_init ${INSTLOGS} &&
|
---|
69 | make install \
|
---|
70 | >> ${LOGFILE} 2>&1 &&
|
---|
71 | echo " o ALL OK" || barf
|
---|
72 |
|
---|
73 | # Added symlink for /bin/sh
|
---|
74 | ln -sf bash /bin/sh
|
---|
75 |
|
---|