Skip to content

Commit

Permalink
Separate out CXXFLAGS from ECXXFLAGS in configure.
Browse files Browse the repository at this point in the history
When the code in "configure" calls the add_cxxflags() function, the
new flag is currently added the value to ECXXFLAGS variable and not
the CXXFLAGS variable. That means that the compiler flag is never used
again during configure and is only passed on to the actual
compilations. This cause configure to fail when using
"--profile=hardened" because test compiles fail due to missing
arguments.

Fix this function to add to the CXXFLAGS variable, and add another
function for use by the "--extra-cxxflags" argument that adds to the
ECXXFLAGS variable. Update the qmake.pro files so that both of these
sets of flags are used in program compiles.
  • Loading branch information
linuxdude42 committed Sep 14, 2020
1 parent 849c2b3 commit c7196b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions mythplugins/configure
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ add_ldflags(){
}

add_cxxflags(){
append CXXFLAGS "$@"
}

add_ecxxflags(){
append ECXXFLAGS "$@"
}

Expand Down Expand Up @@ -556,6 +560,8 @@ CFLAGS=$(cat mythconfig.mak | grep -e "^CFLAGS=")
CFLAGS=${CFLAGS#CFLAGS=}
CPPFLAGS=$(cat mythconfig.mak | grep -e "^CPPFLAGS=")
CPPFLAGS=${CPPFLAGS#CPPFLAGS=}
CXXFLAGS=$(cat mythconfig.mak | grep -e "^CXXFLAGS=")
CXXFLAGS=${CXXFLAGS#CXXFLAGS=}
LDFLAGS=$(cat mythconfig.mak | grep -e "^LDFLAGS=")
LDFLAGS="${LDFLAGS#LDFLAGS=} ${ELDFLAGS}"
CXX=$(cat mythconfig.mak | grep -e "^QMAKE_CXX=")
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/settings.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ macx:CONFIG += console
QMAKE_CXXFLAGS += $$ARCHFLAGS
QMAKE_CXXFLAGS += $$CONFIG_DIRECTFB_CXXFLAGS
QMAKE_CXXFLAGS_SHLIB = -DPIC -fPIC
QMAKE_CXXFLAGS += $$ECXXFLAGS
QMAKE_CXXFLAGS += $$CXXFLAGS $$ECXXFLAGS

profile:!win32:!macx:CONFIG += debug

Expand Down
6 changes: 5 additions & 1 deletion mythtv/configure
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,10 @@ add_cflags_headers(){
}

add_cxxflags(){
append CXXFLAGS "$@"
}

add_ecxxflags(){
append ECXXFLAGS "$@"
}

Expand Down Expand Up @@ -2988,7 +2992,7 @@ for opt do
;;
--libdir-name=*) libdir_name=$optval
;;
--extra-cxxflags=*) add_cxxflags $optval
--extra-cxxflags=*) add_ecxxflags $optval
;;
--firewire-sdk=*) firewiresdk_path="${optval}"
;;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/settings.pro
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ macx:QMAKE_CFLAGS_STATIC_LIB += -fno-common
# clang 3.0 on Linux does not like duplicate arguments.
macx {
QMAKE_CFLAGS += $$CPPFLAGS $$CFLAGS
QMAKE_CXXFLAGS += $$CXXPPFLAGS $$ECXXFLAGS
QMAKE_CXXFLAGS += $$CXXPPFLAGS $$CXXFLAGS $$ECXXFLAGS
} else {
QMAKE_CFLAGS *= $$CPPFLAGS $$CFLAGS
QMAKE_CXXFLAGS *= $$CXXPPFLAGS $$ECXXFLAGS
QMAKE_CXXFLAGS *= $$CXXPPFLAGS $$CXXFLAGS $$ECXXFLAGS
}

profile:!win32:!macx:CONFIG += debug
Expand Down

0 comments on commit c7196b3

Please sign in to comment.