aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorThierry Crozat2017-08-18 11:22:42 +0200
committerEugene Sandulenko2017-08-19 11:08:14 +0200
commit8e31ffa2328bbbfa358530d231dfa5c140b3f15a (patch)
treec8ee30adfbf215527fc90cc4de7b9c252ea2b1c3 /configure
parentd9d325ac6c97cb53be64639cf5d6b8a2038c9d0f (diff)
downloadscummvm-rg350-8e31ffa2328bbbfa358530d231dfa5c140b3f15a.tar.gz
scummvm-rg350-8e31ffa2328bbbfa358530d231dfa5c140b3f15a.tar.bz2
scummvm-rg350-8e31ffa2328bbbfa358530d231dfa5c140b3f15a.zip
CONFIGURE: Silence undefined-var-template warning
We get this warning a lot for the Singleton class due to the way we instantiate its specializations. Also in case we forget the instantiation we get a link error anyway, so the warning is not very useful anyway.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 19 insertions, 1 deletions
diff --git a/configure b/configure
index 4d8c23501c..3f35902f78 100755
--- a/configure
+++ b/configure
@@ -164,6 +164,7 @@ _build_scalers=yes
_build_hq_scalers=yes
_enable_prof=no
_global_constructors=no
+_no_undefined_var_template=no
_bink=yes
_cloud=auto
# Default vkeybd/keymapper/eventrec options
@@ -2023,13 +2024,30 @@ echocheck "whether -Wglobal-constructors work"
cat > $TMPC << EOF
int main() { return 0; }
EOF
-cc_check -Wglobal-constructors && _global_constructors=yes
+cc_check -Wglobal-constructors -Werror && _global_constructors=yes
if test "$_global_constructors" = yes; then
append_var CXXFLAGS "-Wglobal-constructors"
fi
echo $_global_constructors
+# If the compiler supports the -Wundefined-var-template flag, silence that warning.
+# We get this warning a lot with regard to the Singleton class as we explicitly
+# instantiate each specialisation. An alternate way to deal with it would be to
+# change the way we instantiate the singleton classes as done in PR #967.
+# Note: we check the -Wundefined-var-template as gcc does not error out on unknown
+# -Wno-xxx flags.
+echocheck "whether -Wno-undefined-var-template work"
+cat > $TMPC << EOF
+int main() { return 0; }
+EOF
+cc_check -Wundefined-var-template -Werror && _no_undefined_var_template=yes
+
+if test "$_no_undefined_var_template" = yes; then
+ append_var CXXFLAGS "-Wno-undefined-var-template"
+fi
+echo $_no_undefined_var_template
+
echo_n "Checking for $_host_alias-strings... " >> "$TMPLOG"
if `which $_host_alias-strings >/dev/null 2>&1`; then
_strings=$_host_alias-strings