diff --git a/mythtv/configure b/mythtv/configure
index 4aa8727..7583aae 100755
--- a/mythtv/configure
+++ b/mythtv/configure
@@ -5321,6 +5321,7 @@ fi

 check_optflags(){
     check_cflags "$@"
+    check_cxxflags "$@"
     enabled lto && check_ldflags "$@"
 }

@@ -5328,6 +5329,7 @@ check_optflags(){
 if enabled lto; then
     test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
     check_cflags  -flto
+    check_cxxflags -flto
     check_ldflags -flto $cpuflags
 fi

@@ -5569,15 +5571,22 @@ fi

 if [ -n "$optflags" ]; then
     add_cflags $optflags
+    add_cxxflags $optflags
 elif enabled small; then
     add_cflags $cflags_size
+    add_cxxflags $cflags_size
 elif enabled optimizations; then
     add_cflags $cflags_speed
+    add_cxxflags $cflags_speed
 else
     add_cflags $cflags_noopt
+    add_cxxflags $cflags_noopt
 fi
 check_cflags -fno-math-errno
+check_cxxflags -fno-math-errno
 check_cflags -fno-signed-zeros
+check_cxxflags -fno-signed-zeros
+
 check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
 int x;
 EOF