summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-05-27 11:35:02 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-05-27 11:35:02 -0400
commitbb038280d2b5e12916d14587fd5e82455b456698 (patch)
treed33aa2ec22b9cc4fd7cce68a152cc6078a37a0ff /binutils
parentcd85778597a709c5d589c9f984d039e5b96bafca (diff)
downloadspm_packages-bb038280d2b5e12916d14587fd5e82455b456698.tar.gz
Darwin pass 2
Diffstat (limited to 'binutils')
-rw-r--r--binutils/build.sh40
1 files changed, 26 insertions, 14 deletions
diff --git a/binutils/build.sh b/binutils/build.sh
index 9743b96..635fdcb 100644
--- a/binutils/build.sh
+++ b/binutils/build.sh
@@ -25,27 +25,39 @@ function prepare() {
tar xf ${name}-${version}.tar.gz
mkdir -p ${blddir}
cd "${blddir}"
+
+ if [[ $(uname -s) == Darwin ]]; then
+ LDFLAGS="-L${_runtime}/lib"
+ fi
}
function build() {
- export LD_LIBRARY_PATH="${_runtime}/lib:${_prefix}/lib64"
- export LDFLAGS="$LDFLAGS -L${_runtime}/lib64"
- export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${_runtime}/lib64/pkgconfig"
+ opts=(
+ --enable-shared
+ --enable-lto
+ --enable-ld=default
+ --enable-plugins
+ --enable-threads
+ --disable-static
+ --disable-multilib
+ --with-system-zlib
+ --with-sysroot=/
+ --with-tune=generic
+ )
+
+ if [[ $(uname -s) == Linux ]]; then
+ opts+=(--target=x86_64-pc-linux-gnu)
+ export LD_LIBRARY_PATH="${_runtime}/lib:${_prefix}/lib64"
+ export LDFLAGS="$LDFLAGS -L${_runtime}/lib64"
+ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${_runtime}/lib64/pkgconfig"
+ fi
+
../${src}/configure \
--prefix=${_prefix} \
--libdir=${_prefix}/lib \
--with-lib-path=${_prefix}/lib:${_runtime}/lib:${_prefix}/lib64:${_runtime}/lib64:/lib64:/usr/lib64:/usr/local/lib:/usr/local/lib64 \
- --target=x86_64-pc-linux-gnu \
- --enable-shared \
- --enable-lto \
- --enable-ld=default \
- --enable-plugins \
- --enable-threads \
- --disable-static \
- --disable-multilib \
- --with-system-zlib \
- --with-sysroot=/ \
- --with-tune=generic
+ ${opts[@]}
+
make -j${_maxjobs}
}