source: scripts/native-scripts/native-binutils.sh@ 60454e2

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 60454e2 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.1 KB
Line 
1#!/bin/bash
2
3# cross-lfs native binutils build
4# -------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG="binutils-native.log"
13
14set_libdirname
15setup_multiarch
16
17if [ ! "${libdirname}" = "lib" ]; then
18 extra_conf="--libdir=/usr/${libdirname}"
19fi
20
21unpack_tarball binutils-${BINUTILS_VER} &&
22
23# Determine whether this binutils requires
24# 'make configure-host' and whether
25# ld search path can be set with --with-lib-path.
26# Returned in ${BINUTILS_CONF_HOST} and
27# ${BINUTILS_WITH_LIB_PATH} respectively
28
29# TODO: check for architecture specific patches in check_binutils
30# ( alpha )
31check_binutils
32
33cd ${SRC}/${PKGDIR}
34
35case ${BINUTILS_VER} in
36 # 20031015 - fix static linking issues during testsuite
37 # with current CVS glibc. kernel 2.5.68+
38 # Will only patch HJL 2.14.90.0.[6-7]
39 2.14.90.0.[6-7] ) apply_patch binutils-2.14.90.0.7-fix-static-link ;;
40
41 # Issue with HJL binutils 2.15.94.0.1 stripping needed information
42 # one manifestation is with stripping TLS info from libc.a
43 2.15.94.0.1 ) apply_patch binutils-2.15.94.0.1-fix-strip-1 ;;
44esac
45
46# remove libpath from ldscript search paths so we can use
47# --libpath= to set library install location
48# ( ie /usr/lib64 if building binutils bins and libs 64bit )
49# TODO: we dont need the whole genscripts-multilib patch, we only really
50# need to remove libpath
51# TODO: also need to update patches for 2.14.x
52
53case ${BINUTILS_VER} in
54 2.14 )
55 apply_patch binutils-2.14-genscripts-multilib
56 ;;
57 2.14.90.0.8 )
58 apply_patch binutils-2.14.90.0.8-genscripts-multilib
59 ;;
60 2.15.9[0124].0.* | 2.15 )
61 apply_patch binutils-2.15.91.0.1-genscripts-multilib-2
62 ;;
63esac
64
65cd ${SRC}
66
67# Remove pre-existing build directory and recreate
68test -d binutils-${BINUTILS_VER}-native-build &&
69 rm -rf binutils-${BINUTILS_VER}-native-build
70
71mkdir binutils-${BINUTILS_VER}-native-build
72cd binutils-${BINUTILS_VER}-native-build
73
74# --host=${TARGET} here, or it will be set *-unknown-linux-gnu
75max_log_init Binutils ${BINUTILS_VER} native ${CONFLOGS} ${LOG}
76CC="${CC-gcc} ${ARCH_CFLAGS}" \
77../${PKGDIR}/configure \
78 --prefix=/usr \
79 --host=${TARGET} \
80 --disable-nls ${extra_conf} \
81 --enable-shared \
82 --enable-64-bit-bfd \
83 >> ${LOGFILE} 2>&1 &&
84{
85 # Run make configure-host if required
86 test Y != "${BINUTILS_CONF_HOST}" ||
87 {
88 echo -e "\nmake configure-host\n${BRKLN}" >> ${LOGFILE}
89 make configure-host >> ${LOGFILE} 2>&1
90 }
91} &&
92echo " o Configure OK" &&
93
94min_log_init ${BUILDLOGS} &&
95make ${PMFLAGS} LDFLAGS="-s" \
96 >> ${LOGFILE} 2>&1 &&
97echo " o Build OK" || barf
98
99min_log_init ${TESTLOGS} &&
100make -k check \
101 >> ${LOGFILE} 2>&1 &&
102echo " o Test OK" || errmsg
103
104min_log_init ${INSTLOGS} &&
105make install \
106 >> ${LOGFILE} 2>&1 &&
107echo " o All OK" || barf
108
109# Copy over libiberty.h
110cp -p ${SRC}/${PKGDIR}/include/libiberty.h /usr/include/libiberty.h
Note: See TracBrowser for help on using the repository browser.