make_buildopts_h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. GREP=${GREP:-grep}
  3. MD5=${MD5:-md5sum}
  4. cat << END
  5. /*
  6. * buildopts.h
  7. * Automatically generated
  8. */
  9. END
  10. if ${GREP} "AST_DEVMODE" makeopts | ${GREP} -q "yes"
  11. then
  12. echo "#define AST_DEVMODE 1"
  13. BUILDOPTS="AST_DEVMODE"
  14. fi
  15. TMP=`${GREP} -e "^MENUSELECT_CFLAGS" menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
  16. for x in ${TMP}; do
  17. echo "#define ${x} 1"
  18. if test "${x}" = "DONT_OPTIMIZE" \
  19. -o "${x}" = "BETTER_BACKTRACES" \
  20. -o "${x}" = "LOTS_OF_SPANS" \
  21. -o "${x}" = "BUILD_NATIVE" \
  22. -o "${x}" = "AO2_DEBUG" \
  23. -o "${x}" = "REBUILD_PARSERS" \
  24. -o "${x}" = "RADIO_RELAX" \
  25. -o "${x}" = "DEBUG_SCHEDULER" \
  26. -o "${x}" = "DETECT_DEADLOCKS" \
  27. -o "${x}" = "DUMP_SCHEDULER" ; then
  28. # These aren't ABI affecting options, keep them out of AST_BUILDOPTS
  29. continue
  30. fi
  31. if test "x${BUILDOPTS}" != "x" ; then
  32. BUILDOPTS="${BUILDOPTS}, ${x}"
  33. else
  34. BUILDOPTS="${x}"
  35. fi
  36. done
  37. BUILDSUM=`echo ${BUILDOPTS} | ${MD5} | cut -c1-32`
  38. echo "#define AST_BUILDOPT_SUM \"${BUILDSUM}\""
  39. echo "#define AST_BUILDOPTS \"${BUILDOPTS}\""