This centralizes the optimization defaults into configure.in, rather
authorBruce Momjian <bruce@momjian.us>
Thu, 9 Oct 2003 03:20:34 +0000 (03:20 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 9 Oct 2003 03:20:34 +0000 (03:20 +0000)
than having CFLAGS= in the template files.

It uses -O2 for gcc (generated by autoconf), and -O for non-gcc, unless
the template overrides it.

24 files changed:
configure
configure.in
src/template/beos
src/template/bsdi
src/template/cygwin
src/template/dgux
src/template/freebsd
src/template/hpux
src/template/irix5
src/template/linux
src/template/netbsd
src/template/nextstep
src/template/openbsd
src/template/osf
src/template/qnx4
src/template/sco
src/template/solaris
src/template/sunos4
src/template/svr4
src/template/ultrix4
src/template/univel
src/template/unixware
src/template/win
src/template/win32

index c4bb3df6018d0dd707f005c2677f8f4c10a561df..0ee499a304d9e3f6834dc6858ea5cbe443e947d0 100755 (executable)
--- a/configure
+++ b/configure
@@ -2393,6 +2393,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test "$ac_env_CFLAGS_set" = set; then
   CFLAGS=$ac_env_CFLAGS_value
 fi
+# 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
index 62ede6dde0019677790107548d8f961730e8874b..18d612729b67eb77656abbfe3911fe14fefad202 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.293 2003/10/03 03:08:14 pgsql Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.294 2003/10/09 03:20:33 momjian Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -238,6 +238,10 @@ AC_PROG_CC([$pgac_cc_list])
 if test "$ac_env_CFLAGS_set" = set; then
   CFLAGS=$ac_env_CFLAGS_value
 fi
+# 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
index c435200929cfbf5a37ef1f1b2ae290bb7fd6297c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-CFLAGS='-O2'
index acb2c42d3c9a75646bfec88c6366c1a30e12ca5b..5e044ffad2d6c2edcc551a46611bf1c4b4356ba1 100644 (file)
@@ -5,9 +5,7 @@ case $host_cpu in
 esac
 
 case $host_os in
-  bsdi2.0 | bsdi2.1 | bsdi3*)
-    CC=gcc2
-    ;;
+  bsdi2.0 | bsdi2.1 | bsdi3*) CC=gcc2;;
 esac
 
 THREAD_SUPPORT=yes
index eb8921984aab2f1cc04534a72628e63068943650..8a9fa0051eacb459cd0b6694fb18e48d27fbcc30 100644 (file)
@@ -1,2 +1 @@
-CFLAGS='-O2'
 SRCH_LIB='/usr/local/lib'
index 7abc138a9f95dfa0a3db3f20fb88b58abe4309ca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-CFLAGS=
index 082afc077b29646946eb7aca0affc25682db9792..651593232d3138d74f46f01034ed31103d176748 100644 (file)
@@ -1,17 +1,11 @@
-CFLAGS='-pipe'
-
 case $host_cpu in
-  alpha*)   CFLAGS="$CFLAGS -O" ;;
+  alpha*)   CFLAGS="-O";;
 esac
 
 THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=yes
 THREAD_CPPFLAGS="-D_THREAD_SAFE"
 case $host_os in
-               freebsd2*|freebsd3*|freebsd4*)
-                       THREAD_LIBS="-pthread"
-                       ;;
-               *)
-                       THREAD_LIBS="-lc_r"
-                       ;;
+       freebsd2*|freebsd3*|freebsd4*) THREAD_LIBS="-pthread";;
+       *) THREAD_LIBS="-lc_r";;
 esac
index 34a5e8614426748ee1ad2d512d6c7e44af5b56d5..28d836e0120483cd3721efb76f87fff14ee4ebf1 100644 (file)
@@ -1,8 +1,6 @@
-if test "$GCC" = yes ; then
-  CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
-  CFLAGS="-O2"
-else
+CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
+
+if test "$GCC" != yes ; then
   CC="$CC -Ae"
-  CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
   CFLAGS="+O2"
 fi
index 7abc138a9f95dfa0a3db3f20fb88b58abe4309ca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-CFLAGS=
index 44b046033abbb538dba8604ecd864ac2277672ca..529da9c1694e84d9ea05d73ab64e9dc61bd0cd8a 100644 (file)
@@ -1,4 +1,3 @@
-CFLAGS=-O2
 # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
 CPPFLAGS="-D_GNU_SOURCE"
 
@@ -6,4 +5,3 @@ THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=yes       # Debian kernel 2.2 2003-09-27
 THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
 THREAD_LIBS="-lpthread"
-
index f510dc9ef0c47305e2921d36b017296b9d45480d..0d119a0136183f43de1e428b05fd0615805b7119 100644 (file)
@@ -1,4 +1,2 @@
-CFLAGS='-O2 -pipe'
-
 THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=yes       # 1.6 2003-09-14
index c8b14f4d8b73132a621b673a74ca317c59b29a86..d6b3c35e6cb53b86880d0f9ed64536a59d43404b 100644 (file)
@@ -1,4 +1,3 @@
 AROPT=rc
-CFLAGS=
 SHARED_LIB=
 DLSUFFIX=.o
index bfbcbdd59755014424118ae8abec0bfcb1abe81d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-CFLAGS='-O2 -pipe'
index b5c60413de88b39641489a9337625e679ff79a77..133a4516ab00b9682ce746b853ad4f8defe590ce 100644 (file)
@@ -1,6 +1,4 @@
-if test "$GCC" = yes ; then
-  CFLAGS=
-else
+if test "$GCC" != yes ; then
   CC="$CC -std"
   CFLAGS='-O4 -Olimit 2000'
 fi
index d153324b9a6cbe992efbc440e21e7dc07425b2d2..c4bc9531b91e705edd8c739ab2f643ca78d93e24 100644 (file)
@@ -1,2 +1,2 @@
-CFLAGS=-I/usr/local/include
-LIBS=-lunix
+CFLAGS="-O2 -I/usr/local/include"
+LIBS="-lunix"
index 3126e062cedf1f3fe93769f36bbce9eb0fd98060..e0b08471db1d1cf75e656c3e6f1692fbf58c3d0c 100644 (file)
@@ -1,7 +1,2 @@
-if test "$GCC" = yes; then
-  CFLAGS=-O2
-else
-  CFLAGS=-O
-fi
 CC="$CC -b elf"
 
index 083b1d3659fa37ea8982a9dd1d555e01d5ecab5b..f5ff36064bebc2c91730ed535edadb7f6058aeda 100644 (file)
@@ -1,8 +1,6 @@
-if test "$GCC" = yes ; then
-  CFLAGS=
-else
+if test "$GCC" != yes ; then
   CC="$CC -Xa"                 # relaxed ISO C mode
-  CFLAGS=-v                    # -v is like gcc -Wall
+  CFLAGS="-O -v"               # -v is like gcc -Wall
 fi
 
 THREAD_SUPPORT=yes
index 7abc138a9f95dfa0a3db3f20fb88b58abe4309ca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-CFLAGS=
index 7abc138a9f95dfa0a3db3f20fb88b58abe4309ca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-CFLAGS=
index 7abc138a9f95dfa0a3db3f20fb88b58abe4309ca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-CFLAGS=
index 025fbda7bf4d6611b0e376ce47fb07938418de32..d48aa7c3111570f58a1aa29a35b1dba242c4983b 100644 (file)
@@ -1,2 +1,2 @@
 CFLAGS='-v -O -K i486,host,inline,loop_unroll -Dsvr4'
-LIBS=-lc89 
+LIBS="-lc89"
index e1991bcc9c8ad682778be843ad33faa50af8c1f2..cb1381d8fbd48987a7f10911223049004ac88335 100644 (file)
@@ -1,5 +1,4 @@
 if test "$GCC" = yes; then
-  CFLAGS=-O2
   THREAD_CPPFLAGS="-pthread"
 else
 # the -Kno_host is temporary for a bug in the compiler.  See -hackers
index 736e0f293d32b3246a6f979d90dbbeaa4d378c29..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-if test "$GCC" = yes; then
-  CFLAGS="-O2"
-fi
index 736e0f293d32b3246a6f979d90dbbeaa4d378c29..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-if test "$GCC" = yes; then
-  CFLAGS="-O2"
-fi