Commit 0e22cb12 authored by Bruce Momjian's avatar Bruce Momjian

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.
parent c1a0d72d
...@@ -2393,6 +2393,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ...@@ -2393,6 +2393,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "$ac_env_CFLAGS_set" = set; then if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value CFLAGS=$ac_env_CFLAGS_value
fi 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 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g" CFLAGS="$CFLAGS -g"
fi fi
......
dnl Process this file with autoconf to produce a configure script. 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
dnl Developers, please strive to achieve this order: dnl Developers, please strive to achieve this order:
dnl dnl
...@@ -238,6 +238,10 @@ AC_PROG_CC([$pgac_cc_list]) ...@@ -238,6 +238,10 @@ AC_PROG_CC([$pgac_cc_list])
if test "$ac_env_CFLAGS_set" = set; then if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value CFLAGS=$ac_env_CFLAGS_value
fi 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 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g" CFLAGS="$CFLAGS -g"
fi fi
......
...@@ -5,9 +5,7 @@ case $host_cpu in ...@@ -5,9 +5,7 @@ case $host_cpu in
esac esac
case $host_os in case $host_os in
bsdi2.0 | bsdi2.1 | bsdi3*) bsdi2.0 | bsdi2.1 | bsdi3*) CC=gcc2;;
CC=gcc2
;;
esac esac
THREAD_SUPPORT=yes THREAD_SUPPORT=yes
......
CFLAGS='-O2'
SRCH_LIB='/usr/local/lib' SRCH_LIB='/usr/local/lib'
CFLAGS='-pipe'
case $host_cpu in case $host_cpu in
alpha*) CFLAGS="$CFLAGS -O" ;; alpha*) CFLAGS="-O";;
esac esac
THREAD_SUPPORT=yes THREAD_SUPPORT=yes
NEED_REENTRANT_FUNCS=yes NEED_REENTRANT_FUNCS=yes
THREAD_CPPFLAGS="-D_THREAD_SAFE" THREAD_CPPFLAGS="-D_THREAD_SAFE"
case $host_os in case $host_os in
freebsd2*|freebsd3*|freebsd4*) freebsd2*|freebsd3*|freebsd4*) THREAD_LIBS="-pthread";;
THREAD_LIBS="-pthread" *) THREAD_LIBS="-lc_r";;
;;
*)
THREAD_LIBS="-lc_r"
;;
esac esac
if test "$GCC" = yes ; then CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
CFLAGS="-O2" if test "$GCC" != yes ; then
else
CC="$CC -Ae" CC="$CC -Ae"
CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
CFLAGS="+O2" CFLAGS="+O2"
fi fi
CFLAGS=-O2
# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
CPPFLAGS="-D_GNU_SOURCE" CPPFLAGS="-D_GNU_SOURCE"
...@@ -6,4 +5,3 @@ THREAD_SUPPORT=yes ...@@ -6,4 +5,3 @@ THREAD_SUPPORT=yes
NEED_REENTRANT_FUNCS=yes # Debian kernel 2.2 2003-09-27 NEED_REENTRANT_FUNCS=yes # Debian kernel 2.2 2003-09-27
THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS" THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
THREAD_LIBS="-lpthread" THREAD_LIBS="-lpthread"
CFLAGS='-O2 -pipe'
THREAD_SUPPORT=yes THREAD_SUPPORT=yes
NEED_REENTRANT_FUNCS=yes # 1.6 2003-09-14 NEED_REENTRANT_FUNCS=yes # 1.6 2003-09-14
AROPT=rc AROPT=rc
CFLAGS=
SHARED_LIB= SHARED_LIB=
DLSUFFIX=.o DLSUFFIX=.o
if test "$GCC" = yes ; then if test "$GCC" != yes ; then
CFLAGS=
else
CC="$CC -std" CC="$CC -std"
CFLAGS='-O4 -Olimit 2000' CFLAGS='-O4 -Olimit 2000'
fi fi
......
CFLAGS=-I/usr/local/include CFLAGS="-O2 -I/usr/local/include"
LIBS=-lunix LIBS="-lunix"
if test "$GCC" = yes; then
CFLAGS=-O2
else
CFLAGS=-O
fi
CC="$CC -b elf" CC="$CC -b elf"
if test "$GCC" = yes ; then if test "$GCC" != yes ; then
CFLAGS=
else
CC="$CC -Xa" # relaxed ISO C mode CC="$CC -Xa" # relaxed ISO C mode
CFLAGS=-v # -v is like gcc -Wall CFLAGS="-O -v" # -v is like gcc -Wall
fi fi
THREAD_SUPPORT=yes THREAD_SUPPORT=yes
......
CFLAGS='-v -O -K i486,host,inline,loop_unroll -Dsvr4' CFLAGS='-v -O -K i486,host,inline,loop_unroll -Dsvr4'
LIBS=-lc89 LIBS="-lc89"
if test "$GCC" = yes; then if test "$GCC" = yes; then
CFLAGS=-O2
THREAD_CPPFLAGS="-pthread" THREAD_CPPFLAGS="-pthread"
else else
# the -Kno_host is temporary for a bug in the compiler. See -hackers # the -Kno_host is temporary for a bug in the compiler. See -hackers
......
if test "$GCC" = yes; then
CFLAGS="-O2"
fi
if test "$GCC" = yes; then
CFLAGS="-O2"
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment