summaryrefslogtreecommitdiff
path: root/src/make-cairo-def.sh
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2021-08-30 07:27:44 +0930
committerAdrian Johnson <ajohnson@redneon.com>2023-01-02 22:43:39 +1030
commite8b622ebe63e8e1000ba2b7c60f54143a5376363 (patch)
treea969149c2c08e25a4817e87922cd5b4ab1eeeb39 /src/make-cairo-def.sh
parent7f83c30943951d87b24913452f94fb529ce7504f (diff)
downloadcairo-e8b622ebe63e8e1000ba2b7c60f54143a5376363.tar.gz
Support check-def.sh in meson build
The original check-def.sh called make. In meson, check-def.sh is replaced by two shell scripts, one for generating cairo.def, the other for comparing with the library symbols. The library filename appended to the cairo.def has been omitted as this is only reqired in autotools builds where the cairo.def is also to generate cairo.dll in the windows build. make-cairo-def.sh is based on the cairo.def target in Makefile.am. meson-check-def.sh is based on check-def.sh
Diffstat (limited to 'src/make-cairo-def.sh')
-rw-r--r--src/make-cairo-def.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/make-cairo-def.sh b/src/make-cairo-def.sh
new file mode 100644
index 000000000..664df0887
--- /dev/null
+++ b/src/make-cairo-def.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+LC_ALL=C
+export LC_ALL
+
+if [ $# -lt 3 ];
+then
+ echo "Generate cairo def file"
+ echo "Usage: $0 <def-filename> <cairo-features-file> <cairo-headers>..."
+ exit 1
+fi
+
+def_file="$1"
+cairo_features_h="$2"
+shift 2
+
+echo Generating $def_file
+(echo EXPORTS; \
+ (cat $* || echo 'cairo_ERROR ()' ) | \
+ egrep -v '^# *include' | \
+ ( cat "$cairo_features_h" - | cpp -D__cplusplus - || echo 'cairo_ERROR ()' ) | \
+ egrep '^cairo_.* \(' | \
+ sed -e 's/[ ].*//' | \
+ sort; \
+ ) > "$def_file"
+grep -q -v cairo_ERROR "$def_file" || (rm "$def_file"; false)