make/chklib.sh

changeset 197
9cbd4f09a22f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/chklib.sh	Mon Aug 31 15:49:31 2026 +0200
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+libname="$1"
+cc="$CC"
+if test -z "$cc"; then cc=cc; fi
+if test -z "$libname"; then exit 1; fi
+
+echo 'int main(){return 0;}' > .chklib-test.c
+
+if $cc -o /dev/null .chklib-test.c "-l$libname" ; then
+  rm .chklib-test.c
+  exit 0
+else
+  rm .chklib-test.c
+  exit 1
+fi

mercurial