options.m4 1.1 KB

123456789101112131415161718192021222324252627282930
  1. # Helper functions for option handling. -*- Autoconf -*-
  2. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  3. #
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # _AM_MANGLE_OPTION(NAME)
  8. # -----------------------
  9. AC_DEFUN([_AM_MANGLE_OPTION],
  10. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  11. # _AM_SET_OPTION(NAME)
  12. # --------------------
  13. # Set option NAME. Presently that only means defining a flag for this option.
  14. AC_DEFUN([_AM_SET_OPTION],
  15. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  16. # _AM_SET_OPTIONS(OPTIONS)
  17. # ------------------------
  18. # OPTIONS is a space-separated list of Automake options.
  19. AC_DEFUN([_AM_SET_OPTIONS],
  20. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  21. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  22. # -------------------------------------------
  23. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  24. AC_DEFUN([_AM_IF_OPTION],
  25. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])