Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0e22cb1

Browse files
committed
This centralizes the optimization defaults into configure.in, rather
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.
1 parent c1a0d72 commit 0e22cb1

File tree

24 files changed

+22
-53
lines changed

24 files changed

+22
-53
lines changed

configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,6 +2393,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
23932393
if test "$ac_env_CFLAGS_set" = set; then
23942394
CFLAGS=$ac_env_CFLAGS_value
23952395
fi
2396+
# configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc
2397+
if test x"$CFLAGS" = x""; then
2398+
CFLAGS="-O"
2399+
fi
23962400
if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
23972401
CFLAGS="$CFLAGS -g"
23982402
fi

configure.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.293 2003/10/03 03:08:14 pgsql Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.294 2003/10/09 03:20:33 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -238,6 +238,10 @@ AC_PROG_CC([$pgac_cc_list])
238238
if test "$ac_env_CFLAGS_set" = set; then
239239
CFLAGS=$ac_env_CFLAGS_value
240240
fi
241+
# configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc
242+
if test x"$CFLAGS" = x""; then
243+
CFLAGS="-O"
244+
fi
241245
if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
242246
CFLAGS="$CFLAGS -g"
243247
fi

src/template/beos

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CFLAGS='-O2'

src/template/bsdi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ case $host_cpu in
55
esac
66

77
case $host_os in
8-
bsdi2.0 | bsdi2.1 | bsdi3*)
9-
CC=gcc2
10-
;;
8+
bsdi2.0 | bsdi2.1 | bsdi3*) CC=gcc2;;
119
esac
1210

1311
THREAD_SUPPORT=yes

src/template/cygwin

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
CFLAGS='-O2'
21
SRCH_LIB='/usr/local/lib'

src/template/dgux

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CFLAGS=

src/template/freebsd

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
CFLAGS='-pipe'
2-
31
case $host_cpu in
4-
alpha*) CFLAGS="$CFLAGS -O" ;;
2+
alpha*) CFLAGS="-O";;
53
esac
64

75
THREAD_SUPPORT=yes
86
NEED_REENTRANT_FUNCS=yes
97
THREAD_CPPFLAGS="-D_THREAD_SAFE"
108
case $host_os in
11-
freebsd2*|freebsd3*|freebsd4*)
12-
THREAD_LIBS="-pthread"
13-
;;
14-
*)
15-
THREAD_LIBS="-lc_r"
16-
;;
9+
freebsd2*|freebsd3*|freebsd4*) THREAD_LIBS="-pthread";;
10+
*) THREAD_LIBS="-lc_r";;
1711
esac

src/template/hpux

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if test "$GCC" = yes ; then
2-
CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
3-
CFLAGS="-O2"
4-
else
1+
CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
2+
3+
if test "$GCC" != yes ; then
54
CC="$CC -Ae"
6-
CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
75
CFLAGS="+O2"
86
fi

src/template/irix5

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CFLAGS=

src/template/linux

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
CFLAGS=-O2
21
# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
32
CPPFLAGS="-D_GNU_SOURCE"
43

54
THREAD_SUPPORT=yes
65
NEED_REENTRANT_FUNCS=yes # Debian kernel 2.2 2003-09-27
76
THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
87
THREAD_LIBS="-lpthread"
9-

src/template/netbsd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
CFLAGS='-O2 -pipe'
2-
31
THREAD_SUPPORT=yes
42
NEED_REENTRANT_FUNCS=yes # 1.6 2003-09-14

src/template/nextstep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
AROPT=rc
2-
CFLAGS=
32
SHARED_LIB=
43
DLSUFFIX=.o

src/template/openbsd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CFLAGS='-O2 -pipe'

src/template/osf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
if test "$GCC" = yes ; then
2-
CFLAGS=
3-
else
1+
if test "$GCC" != yes ; then
42
CC="$CC -std"
53
CFLAGS='-O4 -Olimit 2000'
64
fi

src/template/qnx4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
CFLAGS=-I/usr/local/include
2-
LIBS=-lunix
1+
CFLAGS="-O2 -I/usr/local/include"
2+
LIBS="-lunix"

src/template/sco

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
if test "$GCC" = yes; then
2-
CFLAGS=-O2
3-
else
4-
CFLAGS=-O
5-
fi
61
CC="$CC -b elf"
72

src/template/solaris

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if test "$GCC" = yes ; then
2-
CFLAGS=
3-
else
1+
if test "$GCC" != yes ; then
42
CC="$CC -Xa" # relaxed ISO C mode
5-
CFLAGS=-v # -v is like gcc -Wall
3+
CFLAGS="-O -v" # -v is like gcc -Wall
64
fi
75

86
THREAD_SUPPORT=yes

src/template/sunos4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CFLAGS=

src/template/svr4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CFLAGS=

src/template/ultrix4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
CFLAGS=

src/template/univel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CFLAGS='-v -O -K i486,host,inline,loop_unroll -Dsvr4'
2-
LIBS=-lc89
2+
LIBS="-lc89"

src/template/unixware

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
if test "$GCC" = yes; then
2-
CFLAGS=-O2
32
THREAD_CPPFLAGS="-pthread"
43
else
54
# the -Kno_host is temporary for a bug in the compiler. See -hackers

src/template/win

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
if test "$GCC" = yes; then
2-
CFLAGS="-O2"
3-
fi

src/template/win32

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
if test "$GCC" = yes; then
2-
CFLAGS="-O2"
3-
fi

0 commit comments

Comments
 (0)