Commit f59f678210193155b31b9a546321b68299f20548

Thomas de Grivel 2023-10-21T17:02:16

fix build on OpenBSD

diff --git a/config.subr b/config.subr
index 379e9c4..9cf939c 100644
--- a/config.subr
+++ b/config.subr
@@ -90,8 +90,8 @@ config_include() {
         echo "#define $1 0" >> "${CONFIG_H}"
         eval "$1=No"
     fi
-    rm "$OUT_C"
-    rm "$OUT"
+    rm -f "$OUT_C"
+    rm -f "$OUT"
 }
 
 config_lib() {
@@ -216,7 +216,7 @@ if ${HAVE_GCOV}; then
 fi
 
 if [ "x$GMAKE" = "x" ]; then
-    if which gmake 2>/dev/null; then
+    if which gmake >/dev/null 2>&1; then
         GMAKE=gmake
     else
         GMAKE=make
diff --git a/libc3/configure b/libc3/configure
index e4c6154..42c2eaa 100755
--- a/libc3/configure
+++ b/libc3/configure
@@ -34,7 +34,7 @@ OBJECTS_DEBUG="$(c2ext .debug.lo "$LO_SOURCES")"
 CPPFLAGS="${CPPFLAGS:=}"
 ENV_CFLAGS="${CFLAGS:=}"
 DEFAULT_CFLAGS="-O2 -pipe"
-LDFLAGS="--shared ${LDFLAGS}"
+LDFLAGS="--shared -no-undefined ${LDFLAGS}"
 LIBS="${LIBS} -lm -pthread -rpath ${PREFIX}/lib"
 
 # Common config for all targets
diff --git a/test/ic3_test b/test/ic3_test
index 9b80c1c..280d9e7 100755
--- a/test/ic3_test
+++ b/test/ic3_test
@@ -9,7 +9,11 @@ TEST_KO=0
 TEST_OK=0
 
 if [ "x$IC3" = "x" ]; then
-    IC3=../../ic3/ic3
+    if [ -f ../../ic3/ic3 ]; then
+	IC3=../../ic3/ic3
+    elif [ -f ../../ic3 ]; then
+	IC3=../../ic3
+    fi
 fi
 
 test_ko() {