summaryrefslogtreecommitdiffstats
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
commit05a1d34cfb4516d6df466c3371d4a76e142820cf (patch)
treeb39e59a1900fc24cea751c4d45fffc53ecac303b /configure.in
parent394ec62d83cc7119b374224cea2c56a345c553f0 (diff)
downloadruby-05a1d34cfb4516d6df466c3371d4a76e142820cf.tar.gz
ruby-05a1d34cfb4516d6df466c3371d4a76e142820cf.tar.xz
ruby-05a1d34cfb4516d6df466c3371d4a76e142820cf.zip
* configure.in (CFLAGS, CXXFLAGS): use orignal values if given.
[ruby-core:23130] git-svn-id: http://svn.ruby-lang.org/repos/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 fffca333e..7a48d3e13 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