diff options
Diffstat (limited to 'binutils/build.sh')
-rw-r--r-- | binutils/build.sh | 40 |
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} } |