#! /bin/sh set -eu test -n ${CPP} && test -n $PROJROOT \ || do { echo "Require variables PROJROOT, CPP, CFLAGS, CPPFLAGS" >&2; exit 1; } do { echo "#define INCLUDE_SDL"; echo "#define INCLUDE_GL"; echo "#include \"config.h\""; while read ConstName { echo "#ifdef $ConstName"; echo "validconst_$ConstName"; echo "#endif"; }; } | ${CPP} ${CFLAGS} ${CPPFLAGS} - | grep validconst_ \ | sed -e 's/validconst_\(.*\)$/\1/' shell { 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