source: scripts/target-scripts/target-bash.sh@ f118837

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since f118837 was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100755
File size: 3.3 KB
Line 
1#!/bin/bash
2
3# cross-lfs target bash build
4# ---------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG=bash-target.log
13
14unpack_tarball bash-${BASH_VER} &&
15cd ${PKGDIR}
16
17set_libdirname
18setup_multiarch
19
20if [ "${USE_SYSROOT}" = "Y" ]; then
21 BUILD_PREFIX=/usr
22 INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
23 INSTALL_OPTIONS="DESTDIR=${LFS}"
24else
25 BUILD_PREFIX=${TGT_TOOLS}
26 INSTALL_PREFIX="${TGT_TOOLS}"
27 INSTALL_OPTIONS=""
28fi
29
30case ${BASH_VER} in
31 2.05b )
32 # Apply published official patches fro bash-2.05b
33 apply_patch bash-2.05b-gnu_fixes-2
34 if [ x${TGT_ARCH} = xm68k ]; then
35 cat >config.cache <<END
36ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
37bash_cv_dup2_broken=${bash_cv_dup2_broken=no}
38bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
39bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken=yes}
40bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen=no}
41bash_cv_getenv_redef=${bash_cv_getenv_redef=yes}
42bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
43bash_cv_job_control_missing=${bash_cv_job_control_missing=present}
44bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers=no}
45bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe=no}
46bash_cv_printf_a_format=${bash_cv_printf_a_format=yes}
47bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes=present}
48bash_cv_sys_siglist=${bash_cv_sys_siglist=yes}
49bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds=yes}
50bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=yes}
51bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust=no}
52bash_cv_unusable_rtsigs=${bash_cv_unusable_rtsigs=no}
53END
54 else
55 cat >config.cache <<END
56bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
57END
58 fi
59
60 # If using gcc-3.4.x, patch some syntax gcc-3.4 doesn't like
61 # TODO: Get gcc version from cross-gcc itself
62 case ${GCC_VER} in
63 3.4* )
64 apply_patch bash-2.05b-gcc34-1
65 ;;
66 esac
67 ;;
68 3.0 )
69 # Reported on bug-bash by Tim Waugh <twaugh@redhat.com>
70 # http://lists.gnu.org/archive/html/bug-bash/2004-09/msg00081.html
71 apply_patch bash-3.0-fixes-1
72 apply_patch bash-3.0-avoid_WCONTINUED-1
73 ;;
74esac
75
76# Patch Makefile.in to use ${TARGET}-size instead of size
77test -f Makefile.in-ORIG ||
78 mv Makefile.in Makefile.in-ORIG
79
80# Following defaults to powerpc if doing ppc* build...
81#sed 's@size \$(Program)@\$(MACHTYPE)-&@g' Makefile.in-ORIG > Makefile.in
82sed "s@size \$(Program)@${TARGET}-&@g" Makefile.in-ORIG > Makefile.in
83
84max_log_init Bash ${BASH_VER} "target (shared)" ${CONFLOGS} ${LOG}
85CC="${TARGET}-gcc ${ARCH_CFLAGS}" \
86CXX="${TARGET}-g++ ${ARCH_CFLAGS}" \
87AR="${TARGET}-ar" RANLIB="${TARGET}-ranlib" \
88CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
89CXXFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
90./configure --prefix=${BUILD_PREFIX} \
91 --host=${TARGET} --with-curses --cache-file=config.cache \
92 --without-bash-malloc \
93 >> ${LOGFILE} 2>&1 &&
94echo " o Configure OK" &&
95
96# Don't build bash with parallelism, race conditions cause version.h
97# not to be created
98min_log_init ${BUILDLOGS} &&
99make LDFLAGS="-s" \
100 >> ${LOGFILE} 2>&1 &&
101echo " o Build OK" &&
102
103min_log_init ${INSTLOGS} &&
104make ${INSTALL_OPTIONS} install \
105 >> ${LOGFILE} 2>&1 &&
106echo " o ALL OK" || barf
107
108ln -sf bash ${INSTALL_PREFIX}/bin/sh
Note: See TracBrowser for help on using the repository browser.