summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-05-18 14:03:24 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-05-19 09:47:20 +0200
commit74790206e182031bcf01c628622e2b646f699530 (patch)
treecc18e125dfb187710fa22d39214d5d46e4c2cd18 /bin
parent8265e36cdcaa475282344c2e01bee5e323d0f0a0 (diff)
make update_pch also work with libs in external/
Change-Id: I65b3461fd227e7e997b82a84631bbd5d00b28eb6 Reviewed-on: https://gerrit.libreoffice.org/72520 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update_pch17
-rwxr-xr-xbin/update_pch.sh3
2 files changed, 18 insertions, 2 deletions
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"