#! /bin/sh set -eu [ -n "${CPP}" ] && [ -n "$PROJROOT" ] \ || { echo "Require variables PROJROOT, CPP, CFLAGS, CPPFLAGS" >&2; exit 1; } { echo "#define INCLUDE_SDL"; echo "#define INCLUDE_GL"; echo "#include \"config.h\""; while read ConstName; do echo "#ifdef $ConstName"; echo "validconst_$ConstName"; echo "#endif"; done; } | ${CPP} ${CFLAGS} ${CPPFLAGS} - | grep validconst_ \ | sed -e 's/validconst_\(.*\)$/\1/' ( echo echo " ConstList.txt has been generated by taking my own machine's valid list of" echo " constants and running it through your preprocessor. Hopefully it works" echo " for you. If not, try grepping your GL header files for #define GL*, and" echo " put the name of every constant you'd like to have at runtime into the" echo " ConstList.txt file." echo " Note that CmdlineGL can only use integer constants, and not all GL_* are." echo " Also beware: 'make clean' will remove it!" echo ) >&2