diff options
author | Ian Lance Taylor <ian@airs.com> | 1997-06-16 19:46:12 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1997-06-16 19:46:12 +0000 |
commit | 572728c6f90dbeab734b6cffc59a2f63f21a2974 (patch) | |
tree | 84f05a6717bed59e02acd61f70f039606801c5e9 /configure | |
parent | a86bf27a922c8cd9b24983d345a81559fcc3d803 (diff) | |
download | fsf-binutils-gdb-572728c6f90dbeab734b6cffc59a2f63f21a2974.zip fsf-binutils-gdb-572728c6f90dbeab734b6cffc59a2f63f21a2974.tar.gz fsf-binutils-gdb-572728c6f90dbeab734b6cffc59a2f63f21a2974.tar.bz2 |
* configure: Set CFLAGS and CXXFLAGS, and substitute them into
Makefile. From Jeff Makey <jeff@cts.com>.
* Makefile.in: Add comment for CFLAGS and CXXFLAGS.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -760,7 +760,9 @@ t loop AS=${AS-${host_alias}-as} AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as} CC=${CC-${host_alias}-gcc} + CFLAGS=${CFLAGS-"-g -O2"} CXX=${CXX-${host_alias}-c++} + CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc} CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++} @@ -830,7 +832,16 @@ else for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc; then - CC="gcc -O2" + CC="gcc" + echo 'void f(){}' > conftest.c + if test -z "`${CC} -g -c conftest.c 2>&1`"; then + CFLAGS=${CFLAGS-"-g -O2"} + CXXFLAGS=${CFLAGS-"-g -O2"} + else + CFLAGS=${CFLAGS-"-O2"} + CXXFLAGS=${CFLAGS-"-O2"} + fi + rm -f conftest* break fi done @@ -839,10 +850,14 @@ else fi CXX=${CXX-"c++"} + CFLAGS=${CFLAGS-"-g"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} fi export CC export CXX +export CFLAGS +export CXXFLAGS case "$host" in *go32*) @@ -1121,6 +1136,20 @@ EOF t loop2 s%^CXX[ ]*=.*$%CXX = ${CXX}% }" \ + -e "/^CFLAGS[ ]*=/{ + :loop3 + /\\\\$/ N + s/\\\\\\n//g + t loop3 + s%^CFLAGS[ ]*=.*$%CFLAGS = ${CFLAGS}% + }" \ + -e "/^CXXFLAGS[ ]*=/{ + :loop4 + /\\\\$/ N + s/\\\\\\n//g + t loop4 + s%^CXXFLAGS[ ]*=.*$%CXXFLAGS = ${CXXFLAGS}% + }" \ -e "s:^SHELL[ ]*=.*$:SHELL = ${config_shell}:" \ -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" \ -e "s|^srcdir[ ]*=.*$|srcdir = ${makesrcdir}|" \ |