summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-06 11:16:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-06 11:16:15 +0000
commitd456f0aabe786310116cbe2cedaf01c97e6070bb (patch)
treeb39e59a1900fc24cea751c4d45fffc53ecac303b /configure.in
parent228d3e46a3dc29d8a2dcff51e58e4dd2ffc04626 (diff)
downloadruby-d456f0aabe786310116cbe2cedaf01c97e6070bb.tar.gz
* configure.in (CFLAGS, CXXFLAGS): use orignal values if given.
[ruby-core:23130] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in30
1 files changed, 21 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index fffca333eb..7a48d3e137 100644
--- a/configure.in
+++ b/configure.in
@@ -214,8 +214,14 @@ AC_ARG_PROGRAM
dnl Checks for programs.
-: ${CFLAGS=} ${cflags='${optflags} ${debugflags} ${warnflags}'}
-: ${CXXFLAGS=} ${cxxflags='${optflags} ${debugflags} ${warnflags}'}
+if test -z "${CFLAGS+set}"; then
+ orig_cflags="$cflags"
+ cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'}
+fi
+if test -z "${CXXFLAGS+set}"; then
+ orig_cxxflags="$cxxflags"
+ cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'}
+fi
if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
fi
@@ -341,8 +347,8 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
warnflags="-Wall -Wno-unused-parameter -Wno-parentheses ${warnflags+$warnflags }-Wpointer-arith -Wwrite-strings"
fi
-CFLAGS="${CFLAGS} `eval echo $cflags`"
-CXXFLAGS="${CXXFLAGS} `eval echo $cxxflags`"
+test -n "${cflags+set}" && CFLAGS="${CFLAGS} `eval echo $cflags`"
+test -n "${cxxflags+set}" && CXXFLAGS="${CXXFLAGS} `eval echo $cxxflags`"
dnl check for large file stuff
mv confdefs.h confdefs1.h
@@ -2198,17 +2204,23 @@ fi
CPPFLAGS="$CPPFLAGS "'$(DEFS)'
test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
-cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g'`
-CFLAGS=`echo "$CFLAGS" | sed "s|$cflagspat"'|${cflags}|'`
+if test -n "${cflags+set}"; then
+ cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ CFLAGS=`echo "$CFLAGS" | sed "s|$cflagspat"'|${cflags}|'`
+fi
+if test -n "${cxxflags+set}"; then
+ cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ CXXFLAGS=`echo "$CXXFLAGS" | sed "s|$cxxflagspat"'|${cxxflags}|'`
+fi
if test "${ARCH_FLAG}"; then
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
CFLAGS=`echo "$CFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
+ CXXFLAGS=`echo "$CXXFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
LDFLAGS=`echo "$LDFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
fi
-cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g'`
-CXXFLAGS=`echo "$CXXFLAGS" | sed "s|$cxxflagspat"'|${cxxflags}|'`
AC_SUBST(cppflags, [])dnl
-AC_SUBST(cflags, ['${optflags} ${debugflags} ${warnflags}'])dnl
+AC_SUBST(cflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
+AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
AC_SUBST(optflags)dnl
AC_SUBST(debugflags)dnl
AC_SUBST(warnflags)dnl