source: scripts_home/scripts/cross-scripts/cross-binutils.sh@ 1c9c5c3

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

r624@server (orig r622): jim | 2005-10-31 12:40:28 -0800
Rearranging Archive

  • Property mode set to 100755
File size: 4.3 KB
Line 
1#!/bin/bash
2
3# cross-lfs cross-binutils build
4# ------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG="binutils-cross.log"
13
14#NOTE: This to be revisited... could well be satisfied by setup_multiarch...
15set -x
16
17if [ "Y" = "${MULTIARCH}" ]; then
18 vendor_os=`echo ${TARGET} | sed 's@\([^-]*\)-\(.*\)@\2@'`
19 case ${TGT_ARCH} in
20 x86_64 )
21 ;;
22 mipsel* | mips64el )
23 TARGET=mips64el-${vendor_os}
24 ;;
25 sparc* )
26 TARGET=sparc64-${vendor_os}
27 ;;
28 powerpc* | ppc* )
29 TARGET=powerpc64-${vendor_os}
30 ;;
31 s390* )
32 TARGET=s390x-${vendor_os}
33 ;;
34 * )
35 # TODO: add some error messages etc
36 barf
37 ;;
38 esac
39fi
40
41# if target is same as build host, adjust host slightly to
42# trick configure so we do not produce native tools
43if [ "${TARGET}" = "${BUILD}" ]; then
44 althost=`echo ${BUILD} | sed 's@\([_a-zA-Z0-9]*\)\(-[_a-zA-Z0-9]*\)\(.*\)@\1\2x\3@'`
45 extra_conf="--host=${althost}"
46fi
47
48set +x
49
50unpack_tarball binutils-${BINUTILS_VER} &&
51
52# Determine whether this binutils requires
53# 'make configure-host' and whether
54# ld search path can be set with --with-lib-path.
55# Returned in ${BINUTILS_CONF_HOST} and
56# ${BINUTILS_WITH_LIB_PATH} respectively
57
58# TODO: check for architecture specific patches in check_binutils
59# ( alpha )
60check_binutils
61
62cd ${SRC}/${PKGDIR}
63
64case ${BINUTILS_VER} in
65 # 20031015 - fix static linking issues during testsuite
66 # with current CVS glibc. kernel 2.5.68+
67 # Will only patch HJL 2.14.90.0.[6-7]
68 2.14.90.0.[6-7] ) apply_patch binutils-2.14.90.0.7-fix-static-link ;;
69
70 # Issue with HJL binutils 2.15.94.0.1 stripping needed information
71 # one manifestation is with stripping TLS info from libc.a
72 2.15.94.0.1 ) apply_patch binutils-2.15.94.0.1-fix-strip-1 ;;
73esac
74
75# Check if we have sysroot set
76if [ "${USE_SYSROOT}" = "Y" ]; then
77 # if sysroot not already defined, set it to ${LFS}
78 extra_conf="${extra_conf} --with-sysroot=${LFS}"
79 INSTALL_PREFIX=${LFS}/usr
80else
81 # sysroot not set, just set libpath
82 test Y == "${BINUTILS_WITH_LIB_PATH}" &&
83 BINUTILS_LIB_PATH="--with-lib-path=${TGT_TOOLS}/lib" ||
84 BINUTILS_LIB_PATH=""
85
86 INSTALL_PREFIX=${TGT_TOOLS}
87fi
88
89# These are probably not required for sysrooted builds, but
90# they don't hurt...
91case ${BINUTILS_VER} in
92 2.14 )
93 apply_patch binutils-2.14-genscripts-multilib
94 ;;
95 2.14.90.0.8 )
96 apply_patch binutils-2.14.90.0.8-genscripts-multilib
97 ;;
98 # Following works for HJL and FSF binutils 2.15
99 2.15.9[0124].0.* | 2.15 )
100 apply_patch binutils-2.15.91.0.1-genscripts-multilib-2
101 ;;
102 # Following works for HJL and FSF binutils 2.15
103 2.16* )
104 apply_patch binutils-2.15.91.0.1-genscripts-multilib-2
105 ;;
106esac
107
108cd ${SRC}
109
110# Remove pre-existing build directory and recreate
111test -d binutils-${BINUTILS_VER}-cross-build &&
112 rm -rf binutils-${BINUTILS_VER}-cross-build
113
114mkdir binutils-${BINUTILS_VER}-cross-build
115cd binutils-${BINUTILS_VER}-cross-build
116
117max_log_init Binutils ${BINUTILS_VER} Cross ${CONFLOGS} ${LOG}
118../${PKGDIR}/configure --prefix=${HST_TOOLS} \
119 --target=${TARGET} ${extra_conf} --disable-nls \
120 --enable-shared ${SYSROOT_OPTS} \
121 --enable-64-bit-bfd ${BINUTILS_LIB_PATH} \
122 >> ${LOGFILE} 2>&1 &&
123{
124 # Run make configure-host if required
125 test Y != "${BINUTILS_CONF_HOST}" ||
126 {
127 echo -e "\nmake configure-host\n${BRKLN}" >> ${LOGFILE}
128 make configure-host >> ${LOGFILE} 2>&1
129 }
130} &&
131echo " o Configure OK" &&
132
133min_log_init ${BUILDLOGS} &&
134#make ${PMFLAGS} headers -C bfd \
135make headers -C bfd \
136 >> ${LOGFILE} 2>&1 &&
137make \
138 >> ${LOGFILE} 2>&1 &&
139echo " o Build OK" || barf
140
141min_log_init ${INSTLOGS} &&
142make install \
143 >> ${LOGFILE} 2>&1 &&
144echo " o All OK" || barf
145
146# Copy over libiberty.h
147cp -p ${SRC}/${PKGDIR}/include/libiberty.h ${INSTALL_PREFIX}/include/libiberty.h
148
Note: See TracBrowser for help on using the repository browser.