Skip to content

Commit b251aa1

Browse files
committed
ShellScriptlets: Sanity-check CCFLAGS/CXXFLAGS for -O in runConfigure.
configure uses -O2 -g by default, but not if the CCFLAGS/CXXFLAGS are overridden, so we need to make sure that we are specifying them in this case.
1 parent 5d4e50c commit b251aa1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

HaikuPorter/ShellScriptlets.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,13 @@ def getShellVariableSetters(shellVariables):
299299
exit 1
300300
fi
301301
302+
if ( [ ! -z "$CCFLAGS" ] && [[ $CCFLAGS != *"-O"* ]] ) \
303+
|| ( [ ! -z "$CXXFLAGS" ] && [[ $CXXFLAGS != *"-O"* ]] ); then
304+
echo "runConfigure: Must specify optimization flags when overriding CCFLAGS/CXXFLAGS."
305+
echo " (autotools configure will not use the default ones in that case.)"
306+
exit 1
307+
fi
308+
302309
configure=$1
303310
shift 1
304311

0 commit comments

Comments
 (0)