After looking at tinyproxy a bit more I noticed a few issues.

It was passing a warning flag to Clang that was not valid and it was
complaining about it all though the build.

So I fixed the autoconf test so it properly detects that the flag is
not valid. Also there was an issue with the autoconf script and
SEPARATE_BUILD. The author does not appear to test with separate
build trees.


Index: Makefile
===================================================================
RCS file: /cvs/ports/www/tinyproxy/Makefile,v
retrieving revision 1.39
diff -u -p -u -p -r1.39 Makefile
--- Makefile    9 May 2024 08:35:47 -0000       1.39
+++ Makefile    12 May 2024 00:58:36 -0000
@@ -2,6 +2,7 @@ COMMENT =               lightweight HTTP/SSL proxy
 
 V =                    1.11.2
 DISTNAME =             tinyproxy-$V
+REVISION =             0
 CATEGORIES =           www net
 
 HOMEPAGE =             https://tinyproxy.github.io/
@@ -11,10 +12,14 @@ PERMIT_PACKAGE =            Yes
 
 WANTLIB += c pthread
 
-BUILD_DEPENDS =                textproc/asciidoc
+BUILD_DEPENDS =                devel/gperf \
+                       textproc/asciidoc
+
+AUTOCONF_VERSION=      2.71
 
 SEPARATE_BUILD =       Yes
-CONFIGURE_STYLE =      gnu
+USE_GMAKE =            Yes
+CONFIGURE_STYLE =      autoconf
 
 SITES =                
https://github.com/tinyproxy/tinyproxy/releases/download/$V/
 
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac  12 May 2024 00:58:36 -0000
@@ -0,0 +1,30 @@
+- Fix detection of compiler flags with Clang; by default Clang issues a warning
+- Fix separate build tree issue
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -156,12 +156,12 @@ if test -n "${MAINTAINER_MODE_FALSE}"; then
+ fi
+ 
+ all_desired_work=false
+-AS_COMPILER_FLAG([$DESIRED_FLAGS], [all_desired_work=true])
++AS_COMPILER_FLAG([-Werror $DESIRED_FLAGS], [all_desired_work=true])
+ if $all_desired_work ; then
+     CFLAGS="$CFLAGS $DESIRED_FLAGS"
+ else
+ for flag in $DESIRED_FLAGS; do
+-  AS_COMPILER_FLAG([$flag], [CFLAGS="$CFLAGS $flag"])
++  AS_COMPILER_FLAG([-Werror $flag], [CFLAGS="$CFLAGS $flag"])
+ done
+ fi
+ 
+@@ -200,7 +200,7 @@ AH_TEMPLATE([HAVE_GPERF],
+ tmp_gperf=false
+ if test "x$GPERF" != "x" -a "x$GPERF" != "xno" ; then
+   AS_ECHO_N(["checking whether gperf is recent enough... "])
+-  if "$GPERF" < src/conf-tokens.gperf >/dev/null 2>&1 ; then
++  if "$GPERF" < $srcdir/src/conf-tokens.gperf >/dev/null 2>&1 ; then
+     AS_ECHO("yes")
+     AC_DEFINE(HAVE_GPERF)
+     tmp_gperf=true

Reply via email to