summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-01-10 11:09:42 -0500
committerAshod Nakashian <ashnakash@gmail.com>2016-01-11 03:55:46 +0000
commit24ef3924d885a37fb15442208c027c77781175b8 (patch)
treee0f65212139149d3792b2a1a1c92d3eb85d5ce56 /bin
parent09a1566bf18cdf98b111d4979e4f4ad52ce65b07 (diff)
PCH support on Linux
Fixes and improvements to support Precompiled Headers on Linux. Change-Id: I8145c146b0dba56c7a4d0fdf9c330164b67ada53 Reviewed-on: https://gerrit.libreoffice.org/21307 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update_pch12
-rwxr-xr-xbin/update_pch_autotune.sh31
-rwxr-xr-x[-rw-r--r--]bin/update_pch_bisect3
3 files changed, 36 insertions, 10 deletions
diff --git a/bin/update_pch b/bin/update_pch
index a21b0692b6d1..18eba85368da 100755
--- a/bin/update_pch
+++ b/bin/update_pch
@@ -88,7 +88,7 @@ DEFAULTS = \
'reportdesign.rpt' : ( 9, EXCLUDE, INCLUDE, INCLUDE), # 9.4
'reportdesign.rptui' : ( 4, EXCLUDE, INCLUDE, INCLUDE), # 13.1
'reportdesign.rptxml' : ( 2, EXCLUDE, EXCLUDE, INCLUDE), # 7.6
- 'sal.sal' : ( 5, EXCLUDE, INCLUDE, INCLUDE), # 4.2
+ 'sal.sal' : ( 2, EXCLUDE, EXCLUDE, INCLUDE), # 4.2
'sc.sc' : (12, EXCLUDE, INCLUDE, INCLUDE), # 92.6
'sc.scfilt' : ( 4, EXCLUDE, EXCLUDE, INCLUDE), # 39.9
'sc.scui' : ( 1, EXCLUDE, EXCLUDE, INCLUDE), # 15.0
@@ -407,6 +407,7 @@ def filter_ignore(line, module):
'vcl/jobset.hxx',
'vcl/oldprintadaptor.hxx',
'vcl/opengl/OpenGLContext.hxx',
+ 'vcl/opengl/OpenGLHelper.hxx', # Conflicts with X header on *ix
'vcl/print.hxx',
'vcl/prntypes.hxx', # redefines Orientation from filter/jpeg/Exif.hxx
'vcl/sysdata.hxx',
@@ -418,6 +419,11 @@ def filter_ignore(line, module):
'XMLEventImportHelper.hxx', # NameMap redefined in XMLEventExport.hxx
'xmloff/XMLEventExport.hxx', # enums redefined
]
+ if module == 'xmlsecurity':
+ ignore_list += [
+ 'xmlsec/crypto.h',
+ 'xmlsecurity/xmlsec-wrapper.h',
+ ]
for i in ignore_list:
if line.startswith(i):
@@ -737,7 +743,7 @@ def generate(includes, libname, filename, module):
f.write('\n Generated on {} using:\n {}\n'.format(
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
make_command_line()))
- f.write('\n If after updating build fails, use the following command to locate conflicting headers:\n ./bin/update_pch_bisect {} "/opt/lo/bin/make {}.build" --find-conflicts\n*/\n'.format(
+ f.write('\n If after updating build fails, use the following command to locate conflicting headers:\n ./bin/update_pch_bisect {} "make {}.build" --find-conflicts\n*/\n'.format(
filename, module))
# svx needs this (sendreportw32.cxx)
@@ -760,7 +766,7 @@ def generate(includes, libname, filename, module):
(module == 'xmlsecurity' and libname == 'xsec_xmlsec'):
ado_define = """
// Cleanup windows header macro pollution.
-#ifdef WNT
+#if defined(WNT) && defined(WINAPI)
# include <postwin.h>
# undef RGB
#endif
diff --git a/bin/update_pch_autotune.sh b/bin/update_pch_autotune.sh
index 5513a69a3a9c..b3a73783dc77 100755
--- a/bin/update_pch_autotune.sh
+++ b/bin/update_pch_autotune.sh
@@ -28,16 +28,22 @@ else
modules="$@"
fi
+if [[ "$OSTYPE" == "cygwin" ]]; then
+ MAKE=/opt/lo/bin/make
+else
+ MAKE=make
+fi
+
function build()
{
local START=$(date +%s.%N)
- /opt/lo/bin/make "$module.build" > /dev/null
+ $MAKE -sr "$module" > /dev/null
status=$?
if [ $status -ne 0 ];
then
# Spurious failures happen.
- /opt/lo/bin/make "$module.build" > /dev/null
+ $MAKE "$module.build" > /dev/null
status=$?
fi
@@ -48,7 +54,20 @@ function build()
score="FAILED"
if [ $status -eq 0 ];
then
+ # The total size of the object files.
size="$(du -s workdir/CxxObject/$module/ | awk '{print $1}')"
+ # Add the pch file size.
+ filename_rel="workdir/PrecompiledHeader/nodebug/$(basename $header)*"
+ filename_dbg="workdir/PrecompiledHeader/debug/$(basename $header)*"
+ if [[ $filename_rel -nt $filename_dbg ]]; then
+ pch_size="$(du -s $filename_rel | awk '{print $1}' | paste -sd+ | bc)"
+ else
+ pch_size="$(du -s $filename_dbg | awk '{print $1}' | paste -sd+ | bc)"
+ fi
+ size="$(echo "$pch_size + $size" | bc)"
+
+ # Compute a score based on the build time and size.
+ # The shorter the build time, and smaller disk usage, the higher the score.
score=$(printf %.2f $(echo "10000 / ($build_time * e($size/1048576))" | bc -l))
fi
}
@@ -134,19 +153,19 @@ for module in $modules; do
#run "$root" "$module" --cutoff=999
# Build before updating pch.
- /opt/lo/bin/make "$module.build" > /dev/null
+ $MAKE "$module.build" > /dev/null
if [ $? -ne 0 ];
then
# Build with dependencies before updating pch.
echo "Failed to build $module, building known state with dependencies..."
./bin/update_pch.sh "$module" > /dev/null
- /opt/lo/bin/make "$module.clean" > /dev/null
- /opt/lo/bin/make "$module.all" > /dev/null
+ $MAKE "$module.clean" > /dev/null
+ $MAKE "$module.all" > /dev/null
if [ $? -ne 0 ];
then
# Build all!
echo "Failed to build $module with dependencies, building all..."
- /opt/lo/bin/make build-nocheck > /dev/null
+ $MAKE build-nocheck > /dev/null
if [ $? -ne 0 ];
then
>&2 echo "Broken build. Please revert changes and try again."
diff --git a/bin/update_pch_bisect b/bin/update_pch_bisect
index 86cb78396d2c..07f0dbb650ae 100644..100755
--- a/bin/update_pch_bisect
+++ b/bin/update_pch_bisect
@@ -24,7 +24,7 @@ it contains one or more required
include without which it wouldn't
compile, which it identifies.
-Usage: ./bin/update_pch_bisect ./vcl/inc/pch/precompiled_vcl.hxx "/opt/lo/bin/make vcl.build" --find-required --verbose
+Usage: ./bin/update_pch_bisect ./vcl/inc/pch/precompiled_vcl.hxx "make vcl.build" --find-required --verbose
"""
from __future__ import print_function
@@ -240,6 +240,7 @@ if __name__ == '__main__':
print(' --find-required - Finds all required includes.')
print(' Must compile with all includes.\n')
print(' --verbose - print noisy progress.')
+ print('Example: ./bin/update_pch_bisect ./vcl/inc/pch/precompiled_vcl.hxx "make vcl.build" --find-required --verbose')
print('\nRunning unit-tests...')