summaryrefslogtreecommitdiffstats
path: root/bin/gen-boost-headers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /bin/gen-boost-headers
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/gen-boost-headers')
-rwxr-xr-xbin/gen-boost-headers69
1 files changed, 69 insertions, 0 deletions
diff --git a/bin/gen-boost-headers b/bin/gen-boost-headers
new file mode 100755
index 000000000..2f6a6ecc8
--- /dev/null
+++ b/bin/gen-boost-headers
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# generate a bunch of dummy headers that wrap the crappy boost headers and
+# suppress a myriad of warnings; requires GCC's #include_next extension
+# To run this do: make cmd cmd="bin/gen-boost-headers"
+
+set -euo pipefail
+IFS=$'\n\t'
+
+GENDIR=${SRCDIR}/external/boost/include
+
+rm -rf ${GENDIR}
+mkdir ${GENDIR}
+
+# note: clucene contains a copy of half of boost, so ignore it too
+# note: firebird contains a copy of half of boost, so ignore it too
+
+cat <(cd ${SRCDIR} && git grep -h '^# *include') \
+ <(find ${WORKDIR}/UnpackedTarball/ -mindepth 1 -maxdepth 1 -type d \
+ | grep -v boost \
+ | grep -v clucene \
+ | grep -v firebird \
+ | xargs grep -hr '^# *include') \
+ | grep -o '\bboost.*\.\(h\|hpp\|ipp\)' \
+ | sort | uniq \
+ | while read -r HEADER; do
+ mkdir -p "$(dirname ${GENDIR}/${HEADER})"
+ cat > "${GENDIR}/${HEADER}" << _EOF
+/* generated by $0, do not edit! */
+#pragma once
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */
+#pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5
+#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic ignored "-Wdeprecated-copy"
+#pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor"
+#pragma GCC diagnostic ignored "-Wextra"
+#pragma GCC diagnostic ignored "-Wignored-qualifiers"
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#pragma GCC diagnostic ignored "-Winvalid-constexpr"
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend"
+#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
+#pragma GCC diagnostic ignored "-Wnonnull"
+#pragma GCC diagnostic ignored "-Wparentheses"
+#pragma GCC diagnostic ignored "-Wplacement-new"
+#pragma GCC diagnostic ignored "-Wreturn-type"
+#pragma GCC diagnostic ignored "-Wshadow"
+#pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
+#pragma GCC diagnostic ignored "-Wtype-limits"
+#pragma GCC diagnostic ignored "-Wundef"
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#pragma GCC diagnostic ignored "-Wunused-macros"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#include_next <${HEADER}>
+#pragma GCC diagnostic pop
+_EOF
+ done
+