aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMax Horn2013-04-18 19:56:07 +0200
committerMax Horn2013-04-18 19:56:07 +0200
commitab50935afcecc343a4b770f8248d0dc71485145d (patch)
tree91e9ff352b56a9f574d02dfd1f3b1cd39c78b94d /configure
parent6c55213cd5a63ff198a25573ad38672e7faa02ce (diff)
downloadscummvm-rg350-ab50935afcecc343a4b770f8248d0dc71485145d.tar.gz
scummvm-rg350-ab50935afcecc343a4b770f8248d0dc71485145d.tar.bz2
scummvm-rg350-ab50935afcecc343a4b770f8248d0dc71485145d.zip
CONFIGURE: Do not pass LDFLAGS to compiler when -c is specified
This fixes compatibility issues with clang when using -enable-Werror: clang generates a warning when being passed both "-c" and linker-only flags like "-L" or "-l". Combined with -Werror, this causes a spurious configure failure.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure8
1 files changed, 6 insertions, 2 deletions
diff --git a/configure b/configure
index 70648631e7..db347c160d 100755
--- a/configure
+++ b/configure
@@ -230,7 +230,11 @@ cc_check_no_clean() {
echo >> "$TMPLOG"
echo "$CXX $LDFLAGS $CXXFLAGS $TMPC -o $TMPO$HOSTEXEEXT $@" >> "$TMPLOG"
rm -f "$TMPO$HOSTEXEEXT"
- ( $CXX $LDFLAGS $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
+ if test "-c" = "$*" ; then
+ ( $CXX $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
+ else
+ ( $CXX $LDFLAGS $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
+ fi
TMPR="$?"
echo "return code: $TMPR" >> "$TMPLOG"
echo >> "$TMPLOG"
@@ -1566,7 +1570,7 @@ EOF
if test -n "$_host"; then
# In cross-compiling mode, we cannot run the result
- eval "$1 $CXXFLAGS $LDFLAGS -o $TMPO.o -c tmp_cxx_compiler.cpp" 2> /dev/null && cc_check_clean tmp_cxx_compiler.cpp
+ eval "$1 $CXXFLAGS -o $TMPO.o -c tmp_cxx_compiler.cpp" 2> /dev/null && cc_check_clean tmp_cxx_compiler.cpp
else
eval "$1 $CXXFLAGS $LDFLAGS -o $TMPO$HOSTEXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "$TMPO$HOSTEXEEXT 2> /dev/null" && cc_check_clean tmp_cxx_compiler.cpp
fi