This allows www/squidguard to build with -fno-common.  Compile tested
only, on amd64.  I'm not sure if this requires a bump or not.

Thanks,
Jeremy

Index: patches/patch-src_lex_yy_c_flex
===================================================================
RCS file: patches/patch-src_lex_yy_c_flex
diff -N patches/patch-src_lex_yy_c_flex
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_lex_yy_c_flex     29 Jan 2021 19:02:36 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/lex.yy.c.flex
+--- src/lex.yy.c.flex.orig
++++ src/lex.yy.c.flex
+@@ -262,7 +262,7 @@ static void yy_flex_free YY_PROTO(( void * ));
+ #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+ 
+ typedef unsigned char YY_CHAR;
+-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
++extern FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+ typedef int yy_state_type;
+ extern char *yytext;
+ #define yytext_ptr yytext
Index: patches/patch-src_main_c
===================================================================
RCS file: /cvs/ports/www/squidguard/patches/patch-src_main_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_main_c
--- patches/patch-src_main_c    15 May 2014 17:27:39 -0000      1.2
+++ patches/patch-src_main_c    29 Jan 2021 18:58:54 -0000
@@ -1,10 +1,15 @@
---- src/main.c.orig    Sat Aug 30 12:27:41 2008
-+++ src/main.c Thu May 15 16:32:39 2014
-
-Fix broken use of the old squid-2.5 helper protocol, see
-http://bugs.squid-cache.org/show_bug.cgi?id=3978#c3
-
-@@ -175,7 +175,7 @@ int main(argc, argv, envp)
+Index: src/main.c
+--- src/main.c.orig
++++ src/main.c
+@@ -16,6 +16,7 @@
+   (GPL) along with this program.
+ */
+ 
++#define MAIN_EXTERN
+ #include "sg.h"
+ 
+ struct Setting *lastSetting = NULL;
+@@ -175,7 +176,7 @@ int main(argc, argv, envp)
        sgReloadConfig();
        }
        if(failsafe_mode) {
@@ -13,7 +18,7 @@ http://bugs.squid-cache.org/show_bug.cgi
        fflush(stdout);
        if(sig_hup){
            sgReloadConfig();
-@@ -184,7 +184,7 @@ int main(argc, argv, envp)
+@@ -184,7 +185,7 @@ int main(argc, argv, envp)
        }
        if(parseLine(buf,&squidInfo) != 1){
        sgLogError("Error parsing squid line: %s",buf);
@@ -22,7 +27,7 @@ http://bugs.squid-cache.org/show_bug.cgi
        }
          else {
        src = Source;
-@@ -196,14 +196,14 @@ int main(argc, argv, envp)
+@@ -196,14 +197,14 @@ int main(argc, argv, envp)
          acl = sgAclCheckSource(src);
          if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){
            if(src == NULL || src->cont_search == 0){
@@ -39,7 +44,7 @@ http://bugs.squid-cache.org/show_bug.cgi
                break;
              }
          } else {
-@@ -215,9 +215,10 @@ int main(argc, argv, envp)
+@@ -215,9 +216,10 @@ int main(argc, argv, envp)
              squidInfo.ident[0] = '-';
              squidInfo.ident[1] = '\0';
            }
Index: patches/patch-src_sg_h_in
===================================================================
RCS file: /cvs/ports/www/squidguard/patches/patch-src_sg_h_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_sg_h_in
--- patches/patch-src_sg_h_in   12 Aug 2013 20:01:49 -0000      1.2
+++ patches/patch-src_sg_h_in   29 Jan 2021 18:58:57 -0000
@@ -6,8 +6,9 @@ Fix segfault on 64-bit due to calling an
 is supposed to return a pointer (64-bit) but when undeclared returns an int
 (32-bit). 
 
---- src/sg.h.in.orig   Fri Nov 16 08:58:32 2007
-+++ src/sg.h.in        Mon Aug 12 02:40:28 2013
+Index: src/sg.h.in
+--- src/sg.h.in.orig
++++ src/sg.h.in
 @@ -73,7 +73,7 @@ int tolower();
  #define REQUEST_TYPE_REDIRECT   2
  #define REQUEST_TYPE_PASS       3
@@ -17,7 +18,30 @@ is supposed to return a pointer (64-bit)
  
  #define DEFAULT_LOGFILE "squidGuard.log"
  #define WARNING_LOGFILE "squidGuard.log"
-@@ -412,6 +412,7 @@ char   *niso __P((time_t));
+@@ -114,8 +114,12 @@ int tolower();
+ #define REDIRECT_PERMANENT   "301:"
+ #define REDIRECT_TEMPORARILY "302:"
+ 
+-char *progname;
++#ifndef MAIN_EXTERN
++#define MAIN_EXTERN extern
++#endif
+ 
++MAIN_EXTERN char *progname;
++
+ struct LogFileStat {
+   char *name;
+   FILE *fd;
+@@ -307,7 +311,7 @@ struct AclDest {
+   struct AclDest *next;
+ };
+ 
+-int lineno;
++MAIN_EXTERN int lineno;
+ 
+ char   *sgParseRedirect       __P((char *, struct SquidInfo *, struct Acl *, 
struct AclDest *));
+ char   *sgAclAccess __P((struct Source *, struct Acl *, struct SquidInfo *));
+@@ -412,6 +416,7 @@ char   *niso __P((time_t));
  struct UserQuotaInfo *setuserquota __P(());
  void sgSourceUserQuota __P((char *, char *, char *));
  
Index: patches/patch-src_y_tab_c_bison
===================================================================
RCS file: /cvs/ports/www/squidguard/patches/patch-src_y_tab_c_bison,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_y_tab_c_bison
--- patches/patch-src_y_tab_c_bison     9 Apr 2009 23:53:13 -0000       1.2
+++ patches/patch-src_y_tab_c_bison     29 Jan 2021 19:05:00 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: patch-src_y_tab_c_bison,v 1.2 2009/04/09 23:53:13 sthen Exp $
---- src/y.tab.c.bison.orig     Tue Feb 17 19:47:27 2009
-+++ src/y.tab.c.bison  Tue Feb 17 19:48:25 2009
-@@ -198,8 +198,11 @@
+Index: src/y.tab.c.bison
+--- src/y.tab.c.bison.orig
++++ src/y.tab.c.bison
+@@ -198,9 +198,12 @@
  extern int globalDebug;
  
  #ifdef HAVE_LIBLDAP
@@ -9,9 +10,19 @@ $OpenBSD: patch-src_y_tab_c_bison,v 1.2 
 -#include "ldap.h"
 +#ifndef LDAP_DEPRECATED
 +#define LDAP_DEPRECATED 1
-+#endif
+ #endif
 +#include <lber.h>
 +#include <ldap.h>
- #endif
++#endif
  
  #ifdef HAVE_MYSQL
+ #include <mysql.h>
+@@ -208,7 +211,7 @@ extern int globalDebug;
+ 
+ #include "sgEx.h"
+ 
+-FILE *yyin, *yyout;
++extern FILE *yyin, *yyout;
+ char *configFile;
+ 
+ int numTimeElements;

Reply via email to