]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
sarg: Fix build with newer GCCs
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 26 Apr 2019 23:21:39 +0000 (00:21 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Apr 2019 08:43:08 +0000 (09:43 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/sarg
src/patches/sarg/sarg-2.3.11-configure.patch [new file with mode: 0644]
src/patches/sarg/sarg-2.3.11-format.patch

index c35ca8df0ff1a7dc4bc533c6d2118e4a8ad93122..622f719fd8c5a06f848dfcee1dd6bb374628859e 100644 (file)
--- a/lfs/sarg
+++ b/lfs/sarg
@@ -80,6 +80,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        $(UPDATE_AUTOMAKE)
 
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/sarg/sarg-2.3.11-format.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/sarg/sarg-2.3.11-configure.patch
+
+       cd $(DIR_APP) && autoreconf -vfi
 
        # Update gettext Makefile
        cd $(DIR_APP) && cp -vf /usr/share/gettext/po/Makefile.in.in po/Makefile.in.in
diff --git a/src/patches/sarg/sarg-2.3.11-configure.patch b/src/patches/sarg/sarg-2.3.11-configure.patch
new file mode 100644 (file)
index 0000000..ca96955
--- /dev/null
@@ -0,0 +1,38 @@
+--- sarg-2.3.11/configure.ac~  2019-04-26 22:34:33.499022406 +0000
++++ sarg-2.3.11/configure.ac   2019-04-26 22:35:11.886556020 +0000
+@@ -29,35 +29,6 @@
+ # Report more warnings to improve code quality.
+ CFLAGS="${CFLAGS} -Wall -Wno-sign-compare"
+-dnl Check for supported compiler options
+-
+-AC_MSG_CHECKING([for extra warnings flag in $CC])
+-saved_CFLAGS="${CFLAGS}"
+-CFLAGS="${CFLAGS} -Wextra -Wno-unused-parameter"
+-AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],[have_extra_warnings="yes"],[have_extra_warnings="no"])
+-AC_MSG_RESULT($have_extra_warnings)
+-if test "$have_extra_warnings" = "no" ; then
+-    CFLAGS="${saved_CFLAGS}"
+-fi
+-
+-AC_MSG_CHECKING([for implicit-function-declaration error flag in $CC])
+-saved_CFLAGS="${CFLAGS}"
+-CFLAGS="${CFLAGS} -Werror=implicit-function-declaration"
+-AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],[have_implicit_function_declaration="yes"],[have_implicit_function_declaration="no"])
+-AC_MSG_RESULT($have_implicit_function_declaration)
+-if test "$have_implicit_function_declaration" = "no" ; then
+-    CFLAGS="${saved_CFLAGS}"
+-fi
+-
+-AC_MSG_CHECKING([for format error flag in $CC])
+-saved_CFLAGS="${CFLAGS}"
+-CFLAGS="${CFLAGS} -Werror=format"
+-AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],[have_error_format="yes"],[have_error_format="no"])
+-AC_MSG_RESULT($have_error_format)
+-if test "$have_error_format" = "no" ; then
+-    CFLAGS="${saved_CFLAGS}"
+-fi
+-
+ case "$host" in
+    *-solaris*)
+    LDFLAGS="${LDFLAGS} -lsocket -lnsl"
index b03636d0c338679ca547b1715778de70561c7c1b..d8ed22028ccce5e5ce073ca4c7560dbd5da2f28a 100644 (file)
@@ -1,39 +1,45 @@
-diff -Naur sarg-2.3.11.org/index.c sarg-2.3.11/index.c
---- sarg-2.3.11.org/index.c    2018-01-14 19:00:22.000000000 +0100
-+++ sarg-2.3.11/index.c        2018-01-24 14:38:19.746338020 +0100
-@@ -89,9 +89,9 @@
-       char monthdir[MAXLEN];
-       char monthname1[9], monthname2[9];
-       char nmonth[30];
--      char monthnum[10];
-+      char monthnum[15];
-       char dayindex[MAXLEN];
--      char daynum[10];
-+      char daynum[15];
-       char title[80];
-       int yearsort[150];
-       int nyears;
-diff -Naur sarg-2.3.11.org/report.c sarg-2.3.11/report.c
---- sarg-2.3.11.org/report.c   2018-01-14 19:00:23.000000000 +0100
-+++ sarg-2.3.11/report.c       2018-01-24 14:38:19.742337939 +0100
+diff -wbBur sarg-2.3.11/index.c sarg-2.3.11.my/index.c
+--- sarg-2.3.11/index.c        2018-01-14 21:00:22.000000000 +0300
++++ sarg-2.3.11.my/index.c     2018-02-19 12:20:15.896203347 +0300
+@@ -208,7 +208,7 @@
+                       m1=month / 16;
+                       if(month % 16 != 0) {
+                               m2=month % 16;
+-                              sprintf(monthnum,"%02d-%02d",m1,m2);
++                              sprintf(monthnum,"%02u-%02u",(unsigned int)m1,(unsigned int)m2);
+                               sprintf(monthname1,"%02d",m1);
+                               sprintf(monthname2,"%02d",m2);
+                               name_month(monthname1,sizeof(monthname1));
+@@ -269,7 +269,7 @@
+                               d1=day / 32;
+                               if(day % 32 != 0) {
+                                       d2=day % 32;
+-                                      sprintf(daynum,"%02d-%02d",d1,d2);
++                                      sprintf(daynum,"%02u-%02u",(unsigned int)d1,(unsigned int)d2);
+                               } else {
+                                       sprintf(daynum,"%02d",d1);
+                               }
+diff -wbBur sarg-2.3.11/report.c sarg-2.3.11.my/report.c
+--- sarg-2.3.11/report.c       2018-01-14 21:00:23.000000000 +0300
++++ sarg-2.3.11.my/report.c    2018-02-19 12:18:45.151207192 +0300
 @@ -54,7 +54,7 @@
        char accsmart[MAXLEN];
        char crc2[MAXLEN/2 -1];
        char siteind[MAX_TRUNCATED_URL];
 -      char arqtt[256];
-+      char arqtt[MAX_USER_FNAME_LEN * 2 + MAXLEN + 10];
++      char arqtt[267];
        char *oldurltt=NULL;
        char oldaccdiatt[11],oldacchoratt[9];
        char tmp3[MAXLEN];
-diff -Naur sarg-2.3.11.org/userinfo.c sarg-2.3.11/userinfo.c
---- sarg-2.3.11.org/userinfo.c 2013-06-01 20:02:04.000000000 +0200
-+++ sarg-2.3.11/userinfo.c     2018-01-24 14:38:19.746338020 +0100
+diff -wbBur sarg-2.3.11/userinfo.c sarg-2.3.11.my/userinfo.c
+--- sarg-2.3.11/userinfo.c     2013-06-01 22:02:04.000000000 +0400
++++ sarg-2.3.11.my/userinfo.c  2018-02-19 12:21:16.103200796 +0300
 @@ -67,7 +67,7 @@
        int skip;
        int flen;
        int count, clen;
 -      char cstr[9];
-+      char cstr[10];
++      char cstr[11];
  
        last=NULL;
        for (group=first_user_group ; group ; group=group->next) {