diff mbox

[libdrm,18/24] libkms: add symbols test

Message ID 1427904935-14387-19-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov April 1, 2015, 4:15 p.m. UTC
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 libkms/Makefile.am      |  3 ++-
 libkms/kms-symbol-check | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100755 libkms/kms-symbol-check
diff mbox

Patch

diff --git a/libkms/Makefile.am b/libkms/Makefile.am
index 4baf4fc..6c0ab7a 100644
--- a/libkms/Makefile.am
+++ b/libkms/Makefile.am
@@ -43,4 +43,5 @@  libkmsinclude_HEADERS = $(LIBKMS_H_FILES)
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libkms.pc
 
-EXTRA_DIST = Android.mk
+TESTS = kms-symbol-check
+EXTRA_DIST = Android.mk $(TESTS)
diff --git a/libkms/kms-symbol-check b/libkms/kms-symbol-check
new file mode 100755
index 0000000..658b269
--- /dev/null
+++ b/libkms/kms-symbol-check
@@ -0,0 +1,25 @@ 
+#!/bin/bash
+
+# The following symbols (past the first five) are taken from the public headers.
+# A list of the latter should be available Makefile.sources/LIBKMS_H_FILES
+
+FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do
+( grep -q "^$func$" || echo $func )  <<EOF
+__bss_start
+_edata
+_end
+_fini
+_init
+kms_bo_create
+kms_bo_destroy
+kms_bo_get_prop
+kms_bo_map
+kms_bo_unmap
+kms_create
+kms_destroy
+kms_get_prop
+EOF
+done)
+
+test ! -n "$FUNCS" || echo $FUNCS
+test ! -n "$FUNCS"