summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-23 04:00:21 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-23 04:00:21 +0000
commit74ba25b351708c74827f5d332b172e992331ec92 (patch)
treeb63690143bd53c7eb62f2ffb23bde7781c992190 /configure.in
parenta3b2161c6de88bae20afd86bb033434b51be80e6 (diff)
merge revision(s) r39255:
* configure.in: Fix a bug introduced in r38342 that the cflagspat substitution is messed up by the way CFLAGS and optflags are modified, which affected FreeBSD and NetBSD/amd64 when configured to use libexecinfo. This bug resulted in CFLAGS and CXXFLAGS in RbConfig::CONFIG having warnflags expanded in them, forcing third-party C/C++ extensions to follow what warnflags demands, like ANSI/ISO-C90 conformance. ref [Bug #7101] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 19b9b40039..48eac465e6 100644
--- a/configure.in
+++ b/configure.in
@@ -2389,8 +2389,15 @@ AS_CASE(["$target_cpu-$target_os"],
execinfo_frame_pointer=no
RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [execinfo_frame_pointer=yes])
if test "x$execinfo_frame_pointer" = xyes; then
- optflags="${optflags+$optflags }-fno-omit-frame-pointer"
- CFLAGS="$CFLAGS -fno-omit-frame-pointer"
+ # optflags must be manipulated very carefully. For the
+ # later cflagspat/cxxflagspat substitution to work, CFLAGS
+ # and CXXFLAGS must start exactly with the value of
+ # optflags.
+ CFLAGS="${CFLAGS# }"; CFLAGS="${CFLAGS#"$optflags "}"
+ CXXFLAGS="${CXXFLAGS# }"; CXXFLAGS="${CXXFLAGS#"$optflags "}"
+ RUBY_APPEND_OPTION(optflags, -fno-omit-frame-pointer)
+ CFLAGS=" $optflags $CFLAGS"
+ CXXFLAGS=" $optflags $CXXFLAGS"
fi
fi])
AC_CHECK_FUNCS(backtrace)