From root@helo.liwing.de  Mon Oct  6 06:43:31 2003
Return-Path: <root@helo.liwing.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8D47316A4C0
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Oct 2003 06:43:31 -0700 (PDT)
Received: from helo.liwing.de (helo.liwing.de [213.70.188.163])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B9CE243FB1
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Oct 2003 06:43:29 -0700 (PDT)
	(envelope-from root@helo.liwing.de)
Received: from helo.liwing.de (localhost.liwing.de [127.0.0.1])
	by helo.liwing.de (8.12.9p2/8.12.9) with ESMTP id h96DhRUn036121;
	Mon, 6 Oct 2003 13:43:27 GMT
	(envelope-from root@helo.liwing.de)
Received: (from root@localhost)
	by helo.liwing.de (8.12.9p2/8.12.9/Submit) id h96DhOTl036120;
	Mon, 6 Oct 2003 13:43:24 GMT
	(envelope-from root)
Message-Id: <200310061343.h96DhOTl036120@helo.liwing.de>
Date: Mon, 6 Oct 2003 13:43:24 GMT
From: Jens Rehsack <rehsack@liwing.de>
Reply-To: Jens Rehsack <rehsack@liwing.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Jens Rehsack <rehsack@liwing.de>, sysadmin@alexdupre.com
Subject: [PATCH] changing CFLAGS and CPUTYPE respection of databases/mysql40-server
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         57644
>Category:       ports
>Synopsis:       [PATCH] changing CFLAGS and CPUTYPE respection of databases/mysql40-server
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    ale
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 06 06:50:18 PDT 2003
>Closed-Date:    Mon Dec 29 02:07:46 PST 2003
>Last-Modified:  Mon Dec 29 02:07:46 PST 2003
>Originator:     Jens Rehsack
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
LiWing IT-Services
>Environment:
System: FreeBSD statler 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Fri Oct 3 22:18:43 GMT 2003 root@statler:/usr/obj/usr/src/sys/STATLER i386


	
>Description:
	This patch corrects 3 (IMHO) little issues of databases/mysql40-server
	1) "-O3 ..." is added to CFLAGS only when optimized build is wished
	   The machine admin may have reasons for wanting lower optimization.
	2) If gcc3 < 3.4 is used on x86 architecture, gcse is disabled because
	   of bugs in gcc3 < 3.4
	3) -mcpu in CFLAGS is changed into CPUTYPE?=, because the admin
	   may have it's CPUTYPE already defined in /etc/make.conf (etc.)
	   and the -mcpu flag to gcc is included in -march= which is generated
	   by bsd.cpu.mk (/usr/share/mk/). Furthermore the admin may have
	   the chance to avoid using of cpu based optimization by setting
	   NO_CPU_CFLAGS in /etc/make.conf.
>How-To-Repeat:
	
>Fix:

	

--- patch-optimized begins here ---
Index: databases/mysql40-server/Makefile
===================================================================
diff -u databases/mysql40-server/Makefile.orig databases/mysql40-server/Makefile
--- databases/mysql40-server/Makefile.orig	Mon Oct  6 13:11:15 2003
+++ databases/mysql40-server/Makefile	Mon Oct  6 13:27:45 2003
@@ -52,6 +52,10 @@
 
 .include <bsd.port.pre.mk>
 
+.if defined(BUILD_OPTIMIZED)
+CFLAGS+=	-O3 -fno-omit-frame-pointer
+.endif
+
 .if ${MACHINE_ARCH} == "i386"
 CONFIGURE_ARGS+=--enable-assembler --with-berkeley-db
 .endif
@@ -69,7 +73,10 @@
 CONFIGURE_ARGS+=--with-mysqld-ldflags=-all-static
 .endif
 .if defined(BUILD_OPTIMIZED)
-CFLAGS+=	-mcpu=i686
+CPUTYPE?=	i686
+.if ${OSVERSION} > 500000 || defined(USE_GCC) && ( ${USE_GCC} == 3.0 || ${USE_GCC} == 3.1 || ${USE_GCC} == 3.2 || ${USE_GCC} == 3.3 )
+CFLAGS+=	-fno-gcse
+.endif
 .endif
 .if defined(WITH_LINUXTHREADS)
 CONFIGURE_ARGS+=--with-named-thread-libs='-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
@@ -85,7 +92,6 @@
 .endif
 .endif
 
-CFLAGS+=	-O3 -fno-omit-frame-pointer
 CXXFLAGS=	${CFLAGS} -felide-constructors -fno-rtti
 
 .if ${OSVERSION} >= 400002
--- patch-optimized ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: roam 
State-Changed-When: Tue Oct 7 02:10:49 PDT 2003 
State-Changed-Why:  
Awaiting maintainer approval. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57644 
State-Changed-From-To: feedback->closed 
State-Changed-By: ale 
State-Changed-When: Mon Dec 29 02:05:01 PST 2003 
State-Changed-Why:  
Patch committed, thanks! 


Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: ale 
Responsible-Changed-When: Mon Dec 29 02:05:01 PST 2003 
Responsible-Changed-Why:  
I'm the maintainer :) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57644 
>Unformatted:
