Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2003 13:43:24 GMT
From:      Jens Rehsack <rehsack@liwing.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        sysadmin@alexdupre.com
Subject:   ports/57644: [PATCH] changing CFLAGS and CPUTYPE respection of databases/mysql40-server
Message-ID:  <200310061343.h96DhOTl036120@helo.liwing.de>
Resent-Message-ID: <200310061350.h96DoIPx026136@freefall.freebsd.org>

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

>Number:         57644
>Category:       ports
>Synopsis:       [PATCH] changing CFLAGS and CPUTYPE respection of databases/mysql40-server
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 06 06:50:18 PDT 2003
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



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