headers-generated-default-cflags headers-nonexisting hooks \
idl ignore_errors includes invocation_dir libraries no-print-directory \
no_vpath omk_config override-config parallel_make programs \
-programs-cflags programs-cflags-cmdline programs-defs \
+programs-cflags programs-cxxflags programs-cflags-cmdline programs-defs \
programs-test_PROGRAMS qt qt-qmake shlibs sources_dir \
sources_in_subdirectory sources_list subdirs_first \
subdirs_first-force-subdir use_leaf_makefiles vxworks whole_tree
--- /dev/null
+#!/bin/bash
+
+. ./functions.sh
+
+cat > 'test.cc' <<'EOF'
+#include <stdio.h>
+
+int main()
+{
+#if NUMBER == 123
+ printf("NUMBER is %d\n", NUMBER);
+#else
+# error No NUMBER defined
+#endif
+ return 0;
+}
+EOF
+
+cat > 'Makefile.omk' <<'EOF'
+bin_PROGRAMS = test
+
+test_SOURCES = test.cc
+EOF
+
+needs_valid_CC
+WVPASS make CXXFLAGS=-DNUMBER=123
+
+if [ $OMK_RULES = linux ]; then
+ # The following should work only with Linux rules
+ _compiled/bin/test|grep 123 || error "Custom CXXFLAGS didn't influence the output"
+fi