From b1443d7b5d96c1bf56da31873b7bc0e585be2236 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Sun, 10 Nov 2019 18:48:06 +0100 Subject: make bin/update_pch work with srcdir != builddir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I guess I'm tired of symlinking builddir/workdir to srcdir. Change-Id: I6192bb981d6727479cd2ce4b3ac75bb0a71c3fe9 Reviewed-on: https://gerrit.libreoffice.org/82397 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- bin/update_pch | 7 ++++++- bin/update_pch.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/update_pch b/bin/update_pch index 10f5e2e9df65..6112fc654555 100755 --- a/bin/update_pch +++ b/bin/update_pch @@ -33,6 +33,7 @@ EXCLUDE_MODULE = False EXCLUDE_LOCAL = False EXCLUDE_SYSTEM = True SILENT = False +WORKDIR = 'workdir' # System includes: oox, sal, sd, svl, vcl @@ -607,7 +608,7 @@ def parse_makefile(groups, lines, lineno, lastif, ifstack): if osname not in groups: groups[osname] = [] if ingeneratedobjects: - file = 'workdir/' + file + file = WORKDIR + '/' + file groups[osname].append(file) return groups @@ -909,6 +910,10 @@ def main(): global EXCLUDE_LOCAL global EXCLUDE_SYSTEM global SILENT + global WORKDIR + + if os.getenv('WORKDIR'): + WORKDIR = os.getenv('WORKDIR') root = '.' module = sys.argv[1] diff --git a/bin/update_pch.sh b/bin/update_pch.sh index 5299242b9d7c..78b4a47e6044 100755 --- a/bin/update_pch.sh +++ b/bin/update_pch.sh @@ -11,8 +11,12 @@ # Usage: update_pch.sh [] # Invoke: make cmd cmd="./bin/update_pch.sh [..]" -root=`dirname $0` -root=`cd $root/.. >/dev/null && pwd` +if test -n "$SRC_DIR"; then + root="$SRC_DIR" +else + root=`dirname $0` + root=`cd $root/.. >/dev/null && pwd` +fi root=`readlink -f $root` cd $root -- cgit