-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-binutils
More file actions
executable file
·74 lines (61 loc) · 1.84 KB
/
Copy pathmake-binutils
File metadata and controls
executable file
·74 lines (61 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/zsh
if [[ $# -ne 3 ]]; then
echo "Usage: $0 PACKAGE_VERSION TARGETED_HOST CHECK"
exit 2
fi
name=binutils
# Use static libraries as much as possible, because the toolchain gets
# tricky otherwise. We will build our static libraries with
# position-independent code.
static_libraries=`mktemp -d`
echo 'GROUP ( /usr/local/lib/libzstd.a )' > ${static_libraries}/libzstd.so || exit 1
export LIBRARY_PATH=${static_libraries}:/usr/local/lib
environment_variables=( )
configure_arguments=(
--prefix=/usr/local
--libdir=/usr/local/lib
--with-native-system-header-dir=/usr/local/include
--enable-default-pie
--disable-multilib
--disable-nls
--disable-canonical-system-headers
--enable-year2038
--enable-lto
--enable-host-shared
--enable-{gcov,gprof,gprofng}
--enable-threads
--disable-werror
--enable-new-dtags
--enable-install-libiberty
--with-zstd-include=/usr/local
--with-zstd-lib=${static_libraries}
--without-{target-,}system-zlib
)
source shared/basic.zsh
#
# Remove temporary directories from .la files.
#
find "${abs_destdir}" -name '*.la' |
xargs sed -i -E "s:-L${static_libraries}::g" \
|| ${bail_out}
#
# Modify linker scripts. Rid them of library directories outside the
# /usr/local.
#
sed -i -E 's:SEARCH_DIR\("(/usr)?/lib[^[:space:]]*"\);::g' \
"${abs_destdir}"/usr/local/*/lib/ldscripts/* || ${bail_out}
#
# If necessary, move libiberty.a
#
# (Apparently, however, setting libdir in config.site works to put
# libiberty.a in the correct place.)
#
if [[ -e "${abs_destdir}"/usr/local/lib64/libiberty.a ]]; then
mv "${abs_destdir}"/usr/local/lib{64,}/libiberty.a || ${bail_out}
rmdir "${abs_destdir}"/usr/local/lib64 || ${bail_out}
fi
#
# Remake the tarball.
#
make_package "${bin_tarball}" "${abs_destdir}" || ${bail_out}
rm -R -f ${static_libraries}