Subject: Why is mozilla built with "-O"?
To: None <taya@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-pkg
Date: 08/10/2002 21:22:50
I notice that mozilla is built with "-O". What's more, if you try to
set CFLAGS=-O2 in the environment, it's overridden by the -O, which
comes later on the command line. "gcc -O2" is generally believed to
work, and we use it all the time everywhere else.

Therefore, I suggest the following:


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/mozilla/Makefile,v
retrieving revision 1.96
diff -u -r1.96 Makefile
--- Makefile	2002/08/02 05:40:48	1.96
+++ Makefile	2002/08/11 02:05:29
@@ -72,7 +72,8 @@
 .if ${MACHINE_ARCH} == "m68k"
 DBG=
 .else
-CONFIGURE_ARGS+= --enable-optimize
+COPTS?=		-O2
+CONFIGURE_ARGS+= --enable-optimize='${COPTS}'
 .endif

 XPTCFILES+=	xptcinvoke_asm_sparc64_netbsd.s xptcstubs_asm_sparc64_netbsd.s


I used "COPTS", instead of "CFLAGS", because "CFLAGS" expands to the
environment variable plus all the buildlink goo. "COPTS" here serves
the same purpose as it does in the main tree, in that it lets the user
experiment with optimizations. "mozilla", of course, is a reasonable
target for such experiments, being big and slow and frequently used.


Frederick