PageRenderTime 21ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/m4/as-version.m4

http://scim-python.googlecode.com/
m4 | 71 lines | 56 code | 15 blank | 0 comment | 0 complexity | 78135c8ee1871483899bede0d5fbaef0 MD5 | raw file
  1. dnl as-version.m4 0.2.0
  2. dnl autostars m4 macro for versioning
  3. dnl Thomas Vander Stichele <thomas at apestaart dot org>
  4. dnl $Id: as-version.m4,v 1.4 2004/06/01 09:40:05 thomasvs Exp $
  5. dnl AS_VERSION
  6. dnl example
  7. dnl AS_VERSION
  8. dnl this macro
  9. dnl - AC_SUBST's PACKAGE_VERSION_MAJOR, _MINOR, _MICRO
  10. dnl - AC_SUBST's PACKAGE_VERSION_RELEASE,
  11. dnl which can be used for rpm release fields
  12. dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
  13. dnl maintainer mode from running correctly
  14. dnl
  15. dnl don't forget to put #undef PACKAGE_VERSION_RELEASE in acconfig.h
  16. dnl if you use acconfig.h
  17. AC_DEFUN([AS_VERSION],
  18. [
  19. PACKAGE_VERSION_MAJOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f1)
  20. PACKAGE_VERSION_MINOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f2)
  21. PACKAGE_VERSION_MICRO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f3)
  22. AC_SUBST(PACKAGE_VERSION_MAJOR)
  23. AC_SUBST(PACKAGE_VERSION_MINOR)
  24. AC_SUBST(PACKAGE_VERSION_MICRO)
  25. ])
  26. dnl AS_NANO(ACTION-IF-NO-NANO, [ACTION-IF-NANO])
  27. dnl requires AC_INIT to be called before
  28. dnl For projects using a fourth or nano number in your versioning to indicate
  29. dnl development or prerelease snapshots, this macro allows the build to be
  30. dnl set up differently accordingly.
  31. dnl this macro:
  32. dnl - parses AC_PACKAGE_VERSION, set by AC_INIT, and extracts the nano number
  33. dnl - sets the variable PACKAGE_VERSION_NANO
  34. dnl - sets the variable PACKAGE_VERSION_RELEASE, which can be used
  35. dnl for rpm release fields
  36. dnl - executes ACTION-IF-NO-NANO or ACTION-IF-NANO
  37. dnl example:
  38. dnl AS_NANO(RELEASE="yes", RELEASE="no")
  39. AC_DEFUN([AS_NANO],
  40. [
  41. AC_MSG_CHECKING(nano version)
  42. NANO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f4)
  43. if test x"$NANO" = x || test "x$NANO" = "x0" ; then
  44. AC_MSG_RESULT([0 (release)])
  45. NANO=0
  46. PACKAGE_VERSION_RELEASE=1
  47. ifelse([$1], , :, [$1])
  48. else
  49. AC_MSG_RESULT($NANO)
  50. PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S`
  51. ifelse([$2], , :, [$2])
  52. fi
  53. PACKAGE_VERSION_NANO=$NANO
  54. AC_SUBST(PACKAGE_VERSION_NANO)
  55. AC_SUBST(PACKAGE_VERSION_RELEASE)
  56. ])