X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 96059D1B515 for ; Mon, 13 Oct 2003 22:25:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 45542-09 for ; Mon, 13 Oct 2003 19:25:05 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 93559D1B4E9 for ; Mon, 13 Oct 2003 19:25:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h9DMP4hn001254; Mon, 13 Oct 2003 18:25:04 -0400 (EDT) To: Bruce Momjian Cc: Neil Conway , Jeff , PostgreSQL Performance , PostgreSQL Hackers Subject: Re: [HACKERS] Sun performance - Major discovery! In-reply-to: <200310090319.h993JpM10523@candle.pha.pa.us> References: <200310090319.h993JpM10523@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 08 Oct 2003 23:19:51 -0400" Date: Mon, 13 Oct 2003 18:25:04 -0400 Message-ID: <1253.1066083904@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/436 X-Sequence-Number: 4184 Bruce Momjian writes: > OK, patch attached and applied. It centralizes the optimization > defaults into configure.in, rather than having CFLAGS= in the template > files. I think there's a problem here: > + # configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc > + if test x"$CFLAGS" = x""; then > + CFLAGS="-O" > + fi > if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then > CFLAGS="$CFLAGS -g" > fi since this will cause "configure --enable-debug" to default to selecting CFLAGS="-O -g" for non-gcc compilers. On a lot of compilers that combination does not work, and will generate tons of useless warnings. I think it might be better to do if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then CFLAGS="$CFLAGS -g" + else + # configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc + if test x"$CFLAGS" = x""; then + CFLAGS="-O" + fi fi regards, tom lane