pandora_flex.m4 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. dnl Copyright (C) 2010 Monty Taylor
  2. dnl Copyright (C) 2010 Hartmut Holzgraefe
  3. dnl This file is free software; Monty Taylor and Hartmut Holzgraefe
  4. dnl give unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. AC_DEFUN([_PANDORA_SEARCH_FLEX],[
  7. dnl --------------------------------------------------------------------
  8. dnl Check for flex
  9. dnl --------------------------------------------------------------------
  10. AC_CHECK_PROGS([LEX], ['flex'], [:])
  11. AS_IF([test "x$LEX" = "x:"],[
  12. pandora_have_flex=no
  13. LEX='if test -f "$@"; then echo "WARNING: no proper flex binary found, ignoring changes to $<"; exit 0; else echo "ERROR: no proper flex binary found"; exit 1; fi;'
  14. ],[
  15. pandora_have_flex=yes
  16. ])
  17. AM_CONDITIONAL(HAVE_FLEX, [test "x${pandora_have_flex}" = "xyes"])
  18. ])
  19. AC_DEFUN([PANDORA_HAVE_FLEX],[
  20. AC_REQUIRE([_PANDORA_SEARCH_FLEX])
  21. ])
  22. AC_DEFUN([PANDORA_REQUIRE_FLEX],[
  23. AC_REQUIRE([PANDORA_HAVE_FLEX])
  24. AS_IF([test "x${pandora_have_flex}" = "xno" -a "$pandora_building_from_bzr" = "yes"],
  25. PANDORA_MSG_ERROR(["flex is required for ${PACKAGE} to build from a bzr branch"])
  26. )
  27. ])