From 367b3c8c584f317a40e0543911ac8b2f9484504d Mon Sep 17 00:00:00 2001 From: Abdelhakim Qbaich Date: Sat, 4 Apr 2026 11:40:24 -0400 Subject: [PATCH] Add $BUILD to $RPATH and set after $BIN/$BUILD canonicalization --- build.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/build.sh b/build.sh index ae7aa09bd..96cb58b81 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # KLayout Layout Viewer @@ -516,10 +516,6 @@ fi if [ $HAVE_LSTREAM != 0 ]; then echo " Includes LStream plugin" fi -if [ "$RPATH" = "" ]; then - RPATH="$BIN" -fi - # Check Ruby installation if [ "$RUBYINCLUDE" != "" ]; then HAVE_RUBY=1 @@ -574,6 +570,20 @@ if [ "$BIN" = "" ]; then BIN=$CURR_DIR/bin-$CONFIG fi +# qmake needs absolute paths, so we get them now: +# OSX does not have `readlink -f` command. Use equivalent Perl script. +if [ "$IS_MAC" = "no" ]; then + BUILD=`readlink -f $BUILD` + BIN=`readlink -f $BIN` +else + BUILD=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BUILD` + BIN=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BIN` +fi + +if [ "$RPATH" = "" ]; then + RPATH="$BIN:$BUILD" +fi + if [ "$QMAKE_CCACHE" = 1 ]; then echo " Compilation caching is activated." else @@ -608,16 +618,6 @@ mkdir -p $BUILD # source the version script . $(dirname $(which $0))/version.sh -# qmake needs absolute paths, so we get them now: -# OSX does not have `readlink -f` command. Use equivalent Perl script. -if [ "$IS_MAC" = "no" ]; then - BUILD=`readlink -f $BUILD` - BIN=`readlink -f $BIN` -else - BUILD=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BUILD` - BIN=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BIN` -fi - if [ "$IS_MAC" = "no" ]; then if ( gmake -v >/dev/null 2>/dev/null ); then MAKE_PRG=gmake