Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_switch_flags.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_SWITCH_FLAGS(newnamespace,[oldnamespace])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Switch common compilation flags from temporary variables between two
  12. # compilation namespace.
  13. #
  14. # Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
  15. # OBJCFLAGS.
  16. #
  17. # By default these flags are restored to a global (empty) namespace, but
  18. # user could restore from specific NAMESPACE by using
  19. # AX_RESTORE_FLAGS(NAMESPACE) macro.
  20. #
  21. # Typical usage is like:
  22. #
  23. # AX_SAVE_FLAGS(beginprogram)
  24. # CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
  25. # AX_SWITCH_FLAGS(mypackage,beginprogram)
  26. #
  27. # LICENSE
  28. #
  29. # Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
  30. # Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University
  31. # Copyright (c) 2011 Russ Allbery <rra@stanford.edu>
  32. # Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf@gmail.com>
  33. #
  34. # Copying and distribution of this file, with or without modification, are
  35. # permitted in any medium without royalty provided the copyright notice
  36. # and this notice are preserved. This file is offered as-is, without any
  37. # warranty.
  38. #serial 4
  39. AC_DEFUN([AX_SWITCH_FLAGS], [
  40. AC_REQUIRE(AX_SAVE_FLAGS)
  41. AC_REQUIRE(AX_RESTORE_FLAGS)
  42. AS_IF([test "X$1" = "X"], AC_MSG_ERROR(newnamespace is empty)]
  43. AX_SAVE_FLAGS($1[])
  44. AX_RESTORE_FLAGS($2[])
  45. ])