summaryrefslogtreecommitdiff
path: root/src/diff_exports.sh
blob: 7920f4754d0d681da9aa915f1023d6502c8008f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash -u

# Copyright (c) 2018 Yubico AB. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

[[ ! -f export.gnu || ! -f export.llvm || ! -f export.msvc ]] && exit 1

TMPDIR=$(mktemp -d)
GNU=${TMPDIR}/gnu
LLVM=${TMPDIR}/llvm
MSVC=${TMPDIR}/msvc

egrep -o $'([^*{}\t]+);$' export.gnu | tr -d ';' | sort > ${GNU}
sed 's/^_//g' export.llvm | sort > ${LLVM}
egrep -v "^EXPORTS$" export.msvc | sort > ${MSVC}
diff -u ${GNU} ${LLVM} && diff -u ${MSVC} ${LLVM}
ERROR=$?

rm ${GNU} ${LLVM} ${MSVC}
rmdir ${TMPDIR}

exit ${ERROR}