Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2005 01:06:11 +0800 (CST)
From:      Rong-En Fan <rafan@infor.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/83736: [PATCH] www/mgstat: fix build for GCC 3.4 by patching instead of using 3.3
Message-ID:  <200507191706.j6JH6BQ9045877@svm.csie.ntu.edu.tw>
Resent-Message-ID: <200507191710.j6JHAKNB045662@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         83736
>Category:       ports
>Synopsis:       [PATCH] www/mgstat: fix build for GCC 3.4 by patching instead of using 3.3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 19 17:10:20 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Rong-En Fan
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
NTU CSIE
>Environment:
FreeBSD 5.4-RELEASE
>Description:
GCC 3.4 treats __FUNCTION__ as variable instead of constant
string, which differs to GCC 3.3. A better way to fix
is patching the source instead of installing GCC 3.3.
(It's a similar fix as ports/71239 did)

Added file(s):
- files/patch-gcc34

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- mgstat-0.11_3.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/www/mgstat/Makefile /home/rafan/tmp/ports/mgstat/Makefile
--- /usr/ports/www/mgstat/Makefile	Sun Oct 31 03:11:06 2004
+++ /home/rafan/tmp/ports/mgstat/Makefile	Wed Jul 20 01:04:19 2005
@@ -7,7 +7,7 @@
 
 PORTNAME=	mgstat
 PORTVERSION=	0.11
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	www
 MASTER_SITES=	http://wizard.ae.krakow.pl/~mike/download/
 
@@ -22,10 +22,6 @@
 PLIST_FILES=	bin/mgstat
 
 .include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 502126
-USE_GCC=	3.3
-.endif
 
 post-install:
 .if !defined(NOPORTDOCS)
diff -ruN --exclude=CVS /usr/ports/www/mgstat/files/patch-gcc34 /home/rafan/tmp/ports/mgstat/files/patch-gcc34
--- /usr/ports/www/mgstat/files/patch-gcc34	Thu Jan  1 08:00:00 1970
+++ /home/rafan/tmp/ports/mgstat/files/patch-gcc34	Wed Jul 20 01:04:08 2005
@@ -0,0 +1,151 @@
+--- mgstat.c.orig	Wed Jul 20 00:56:00 2005
++++ mgstat.c	Wed Jul 20 01:01:07 2005
+@@ -96,7 +96,7 @@
+ 	struct list_head *h;
+ 	struct year_t *t;
+ 	
+-	debug(5, __FUNCTION__ ": looking for %d\n", year);
++	debug(5, "%s: looking for %d\n", __FUNCTION__, year);
+ 	list_for_each(h, &years_l) {
+ 		t = list_entry(h, struct year_t, head);
+ 		if(t->year == year) return t;
+@@ -113,7 +113,7 @@
+ 	list_add(&t->head, &years_l);
+ 	INIT_LIST_HEAD(&t->months);
+ 	
+-	debug(5, __FUNCTION__ ": %d year added.\n", year);
++	debug(5, "%s: %d year added.\n", __FUNCTION__, year);
+ 	
+ 	return t;
+ }
+@@ -130,7 +130,7 @@
+ 	INIT_LIST_HEAD(&t->days);
+ 	months_nr++;
+ 
+-	debug(5, __FUNCTION__ ": searching for %s %d\n", s, year);	
++	debug(5, "%s: searching for %s %d\n", __FUNCTION__, s, year);	
+ 
+ 	if(!(y = find_year(year))) y = new_year(year);
+ 	y->nr_months++;
+@@ -156,9 +156,9 @@
+ 	}
+ 	t = new_entry(day, head);
+ 	cur_day = t;
+-	debug(5, __FUNCTION__ ": %d day created\n", day);
++	debug(5, "%s: %d day created\n", __FUNCTION__, day);
+ FOUND:
+-	debug(5, __FUNCTION__ ": %d day found - %lld\n", day, t->req_c);
++	debug(5, "%s: %d day found - %lld\n", __FUNCTION__, day, t->req_c);
+ 	cur_day = t;
+ 	return t;
+ }
+@@ -186,7 +186,7 @@
+ FOUND:
+ 	cur_month = t;
+ 	cur_day = 0;
+-	debug(5, __FUNCTION__ ": FOUND %s %s %d\n", t->month, month, year);	
++	debug(5, "%s: FOUND %s %s %d\n", __FUNCTION__, t->month, month, year);	
+ 	return find_day(day, &t->days);
+ }
+ 
+@@ -223,7 +223,7 @@
+                 return;
+         }
+         e->req_c++;
+-	debug(2, __FUNCTION__ ": req increased for %d (%lld)\n", 
++	debug(2, "%s: req increased for %d (%lld)\n", __FUNCTION__, 
+ 		e->day, e->req_c);
+         if(!(t = strstr(s, MOD_GZIP_ID))) return;
+ 	id = t;
+@@ -237,7 +237,7 @@
+         for(i = 0; i < sizeof gzip_ok/sizeof(char *); i++)
+                 if(!strncmp(t, gzip_ok[i], strlen(gzip_ok[i]))) goto FOUND;
+         e->ncomp_c++;
+-	debug(2, __FUNCTION__ "non compressed req - %lld\n", e->ncomp_c);	
++	debug(2, "%snon compressed req - %lld\n", __FUNCTION__, e->ncomp_c);	
+ 	while(*--id == ' ') ;
+ 	if(!isdigit((int)*id)) {
+ #ifdef DEBUG
+@@ -622,7 +622,7 @@
+ 	if (!strcasecmp(log_file, "-")) f = stdin;
+ 	else f = fopen(log_file, "r");
+ 		
+-	if(!f) errx(1, __FUNCTION__ ": cannot open log file %s: %s", 
++	if(!f) errx(1, "%s: cannot open log file %s: %s", __FUNCTION__,
+ 		log_file, strerror(errno));
+ 	read_hist(mk_filename(out_dir, MG_HIST, 0));
+ //dump_list(); exit(0);
+--- output.c.orig	Wed Jul 20 01:01:11 2005
++++ output.c	Wed Jul 20 01:02:17 2005
+@@ -205,7 +205,7 @@
+ 		if(!strncasecmp(m_name[i], m, 3)) 
+ 			return i+1;
+ 	}
+-	errx(1, __FUNCTION__ ": Invalid month name %s", m);
++	errx(1, "%s: Invalid month name %s", __FUNCTION__, m);
+ 	return 0;
+ }
+ 
+@@ -263,7 +263,7 @@
+ 		}
+ 		p++;
+ 	}
+-	errx(1, __FUNCTION__": internal error - unknown month %s.", m->month);
++	errx(1, "%s: internal error - unknown month %s.", __FUNCTION__, m->month);
+ 	return 0;
+ }
+ 
+@@ -304,10 +304,10 @@
+ 	else if(!gethostname(buf, sizeof buf)) tmp = buf;
+ 	else tmp = "localhost";	
+ 	tab = calloc(h->nr_months, sizeof m);
+-	if(!tab) errx(1, __FUNCTION__ ": Cannot allocate memory.");
++	if(!tab) errx(1, "%s: Cannot allocate memory.", __FUNCTION__);
+ 	list_for_each_r(x, &h->months) {
+ 		m = list_entry(x, struct month_t, l_year);
+-		if(i > h->nr_months) errx(1, __FUNCTION__ ": Internal error.");
++		if(i > h->nr_months) errx(1, "%s: Internal error.", __FUNCTION__);
+ 		tab[i] = m;
+ 		get_max(&m->days);
+ 		i++;
+@@ -376,9 +376,9 @@
+ #endif 	
+ 	max_r = max = total = max_all_b = 0;
+ 	tab = calloc(m->nr_days, sizeof t);
+-	if(!tab) errx(1, __FUNCTION__ ": Cannot allocate memory.");
++	if(!tab) errx(1, ": Cannot allocate memory.", __FUNCTION__);
+ 	list_for_each_r(x, &m->days) {
+-		if(i == 31) errx(1, __FUNCTION__ ": internal error: too many days.");
++		if(i == 31) errx(1, "%s: internal error: too many days.", __FUNCTION__);
+ 		t = list_entry(x, struct entry_t, l_month);
+ 		tab[i] = t;
+ 		i++;
+--- graph.c.orig	Wed Jul 20 01:02:20 2005
++++ graph.c	Wed Jul 20 01:02:47 2005
+@@ -35,7 +35,7 @@
+ {
+ 	struct gd_image *p;
+ 	p = calloc(1, sizeof *p);
+-	if(!p) errx(1, __FUNCTION__ ": cannot allocate memory.");
++	if(!p) errx(1, "%s: cannot allocate memory.", __FUNCTION__);
+ 	return p;
+ }
+ 
+@@ -127,7 +127,7 @@
+ 	gdImageRectangle(g->im, G_MARG_X-1, G_MARG_Y-2, G_END_X, G_END_Y+1, g->colors[GRAY]);
+ 	snprintf(buf, sizeof buf, "%s/%s", out_dir, s);
+ 	f = fopen(buf, "wb");
+-	if(!f) errx(1, __FUNCTION__ ": cannot open %s: %s", buf, strerror(errno));
++	if(!f) errx(1, "%s: cannot open %s: %s", __FUNCTION__, buf, strerror(errno));
+ #ifdef HAVE_GD_GIF
+ 	gdImageGif(g->im, f);
+ #else
+@@ -137,7 +137,7 @@
+ 	gdImageDestroy(g->im);
+ 	free(g);
+ #ifdef DEBUG	
+-	printf(__FUNCTION__": Writing %s\n", s);	
++	printf("%s: Writing %s\n", __FUNCTION__, s);	
+ #endif
+ }	
+ 
--- mgstat-0.11_3.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507191706.j6JH6BQ9045877>