test/make/toolchain.sh

changeset 31
4c6060dad560
parent 15
971ac4f0f1df
child 35
57ea620a54ac
--- a/test/make/toolchain.sh	Sat Sep 02 14:25:05 2023 +0200
+++ b/test/make/toolchain.sh	Sat Sep 02 18:19:43 2023 +0200
@@ -63,6 +63,26 @@
 	return 0
 }
 
+check_lib()
+{
+	if [ -z "$TOOLCHAIN_LD" ]; then
+		return 1
+	fi
+	cat > $TEMP_DIR/test.c << __EOF__
+/* libtest file */
+int main(int argc, char **argv) {
+	return 0;
+}
+__EOF__
+	rm -f $TEMP_DIR/checklib
+	$TOOLCHAIN_LD -o $TEMP_DIR/checklib $CFLAGS $LDFLAGS "-l$1" $TEMP_DIR/test.c 2> /dev/null
+
+	if [ $? -ne 0 ]; then
+		return 1
+	fi
+	return 0
+}
+
 printf "detect C compiler... "
 
 for COMP in $C_COMPILERS

mercurial