-#!/bin/bash
+#!/bin/sh
+set -eu
-FUNCS=$(nm -D --defined-only ${1-.libs/libEGL.so} | grep -o "T .*" | cut -c 3- | while read func; do
+if [ "$(uname)" = "Darwin" ]
+then
+ LIB=${1-.libs/libEGL.dylib}
+else
+ LIB=${1-.libs/libEGL.so}
+fi
+
+if ! [ -f "$LIB" ]
+then
+ exit 1
+fi
+
+FUNCS=$($NM -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do
( grep -q "^$func$" || echo $func ) <<EOF
eglBindAPI
eglBindTexImage
eglWaitGL
eglWaitNative
eglWaitSync
+MesaGLInteropEGLQueryDeviceInfo
+MesaGLInteropEGLExportObject
_fini
_init
EOF