Rafael Sadowski:

> It is very easy to reproduce:
> $ cd /usr/ports/security/argon2 && make test
> 
> ===>  Regression tests for argon2-20190702
> Building without optimizations
> cc -O2 -pipe -std=c89 -Wall -g -Iinclude -Isrc -pthread  -Wextra 
> -Wno-type-limits src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c 
> src/encoding.c src/ref.c src/test.c -o testcase
> Default build
> *** Parse error in 
> /usr/ports/pobj/argon2-20190702/phc-winner-argon2-20190702: Error in archive 
> specification: "(, 1)" (Makefile:42)

The test target runs "sh kats/test.sh", which in turn calls "make"(!).
The errors are from our make(1) choking on the GNU makefile syntax.

Here's a fix: Export the MAKE variable, which always contains the
path with which the current make was invoked, and use it in the
kat/test.sh script.

Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/security/argon2/patches/patch-Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 patch-Makefile
--- patches/patch-Makefile      17 Sep 2020 04:41:43 -0000      1.2
+++ patches/patch-Makefile      20 Sep 2020 20:09:58 -0000
@@ -21,3 +21,12 @@ Index: Makefile
        LIB_CFLAGS := -shared -fPIC
        PC_EXTRA_LIBS ?=
  endif
+@@ -212,6 +212,8 @@ $(PC_NAME): $(PC_SRC)
+ dist:
+               cd ..; \
+               tar -c --exclude='.??*' -z -f $(DIST)-`date "+%Y%m%d"`.tgz 
$(DIST)/*
++
++export MAKE
+ 
+ .PHONY: test
+ test:           $(SRC) src/test.c
Index: patches/patch-kats_test_sh
===================================================================
RCS file: patches/patch-kats_test_sh
diff -N patches/patch-kats_test_sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-kats_test_sh  20 Sep 2020 20:09:58 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: kats/test.sh
+--- kats/test.sh.orig
++++ kats/test.sh
+@@ -9,7 +9,7 @@ do
+     printf "Force OPTTEST=1\n"
+   fi
+ 
+-  make genkat $opttest > /dev/null
++  ${MAKE:-make} genkat $opttest > /dev/null
+   if [ $? -ne 0 ]
+   then
+     exit $?
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to