From 74790206e182031bcf01c628622e2b646f699530 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Sat, 18 May 2019 14:03:24 +0200 Subject: make update_pch also work with libs in external/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I65b3461fd227e7e997b82a84631bbd5d00b28eb6 Reviewed-on: https://gerrit.libreoffice.org/72520 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- bin/update_pch | 17 +++++++++++++++-- bin/update_pch.sh | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/update_pch b/bin/update_pch index 0ccf38f347f5..372867393c93 100755 --- a/bin/update_pch +++ b/bin/update_pch @@ -520,7 +520,9 @@ def sort_by_category(list, root, module, filter_local): def parse_makefile(groups, lines, lineno, lastif, ifstack): inobjects = False + ingeneratedobjects = False inelse = False + suffix = 'cxx' os_cond_re = re.compile('(ifeq|ifneq)\s*\(\$\(OS\)\,(\w*)\)') line = lines[lineno] @@ -542,12 +544,21 @@ def parse_makefile(groups, lines, lineno, lastif, ifstack): if line == '))': inobjects = False + ingeneratedobjects = False elif 'add_exception_objects' in line or \ 'add_cxxobject' in line: inobjects = True #print('inobjects') #if ifstack and not SILENT: #sys.stderr.write('Sources in a conditional, ignoring for now.\n') + elif 'add_generated_exception_objects' in line or \ + 'add_generated_cxxobject' in line: + ingeneratedobjects = True + elif 'set_generated_cxx_suffix' in line: + suffix_re = re.compile('.*set_generated_cxx_suffix,[^,]*,([^)]*).*') + match = suffix_re.match(line) + if match: + suffix = match.group(1) elif line.startswith('if'): lineno = parse_makefile(groups, lines, lineno, line, ifstack+1) continue @@ -557,10 +568,10 @@ def parse_makefile(groups, lines, lineno, lastif, ifstack): continue elif line.startswith('else'): inelse = True - elif inobjects: + elif inobjects or ingeneratedobjects: if EXCLUDE_SYSTEM and ifstack: continue - file = line + '.cxx' + file = line + '.' + suffix if ',' in line or '(' in line or ')' in line: #print('passing: ' + line) pass # $if() probably, or something similar @@ -582,6 +593,8 @@ def parse_makefile(groups, lines, lineno, lastif, ifstack): if osname not in groups: groups[osname] = [] + if ingeneratedobjects: + file = 'workdir/' + file groups[osname].append(file) return groups diff --git a/bin/update_pch.sh b/bin/update_pch.sh index c4a5f3d6d88a..6ea8eb664cf0 100755 --- a/bin/update_pch.sh +++ b/bin/update_pch.sh @@ -42,6 +42,9 @@ for x in $headers; do header=$x echo updating `echo $header | sed -e s%$root/%%` module=`readlink -f $header | sed -e s%$root/%% -e s%/.*%%` + if [ "$module" = "external" ]; then + module=external/`readlink -f $header | sed -e s%$root/external/%% -e s%/.*%%` + fi libname=`echo $header | sed -e s/.*precompiled_// -e s/\.hxx//` ./bin/update_pch "$module" "$libname" -- cgit