[cairo-commit] roadster/macros ChangeLog, 1.1.1.1, NONE Makefile.am, 1.1.1.1, NONE autogen.sh, 1.1.1.1, NONE ax_compare_version.m4, NONE, 1.1 check-utmp.m4, 1.1.1.1, NONE compiler-flags.m4, 1.1.1.1, NONE curses.m4, 1.1.1.1, NONE gnome-common.m4, 1.1.1.1, NONE gnome-cxx-check.m4, 1.1.1.1, NONE gnome-gettext.m4, 1.1.1.1, NONE gnome-pkgconfig.m4, 1.1.1.1, NONE gnome-platform.m4, 1.1.1.1, NONE gnome-pthread-check.m4, 1.1.1.1, NONE gnome-x-checks.m4, 1.1.1.1, NONE linger.m4, 1.1.1.1, NONE

Ian McIntosh commit at pdx.freedesktop.org
Wed Feb 23 10:16:43 PST 2005


Committed by: ian

Update of /cvs/cairo/roadster/macros
In directory gabe:/tmp/cvs-serv32407/macros

Added Files:
	ax_compare_version.m4 
Removed Files:
	ChangeLog Makefile.am autogen.sh check-utmp.m4 
	compiler-flags.m4 curses.m4 gnome-common.m4 gnome-cxx-check.m4 
	gnome-gettext.m4 gnome-pkgconfig.m4 gnome-platform.m4 
	gnome-pthread-check.m4 gnome-x-checks.m4 linger.m4 
Log Message:
        * include/.cvsignore: Removed.
        * intl/.cvsignore: Removed.
        * macros/* Removed.
        * macros/ax_compare_version.m4: Added.



--- ChangeLog DELETED ---

--- Makefile.am DELETED ---

--- autogen.sh DELETED ---

--- NEW FILE: ax_compare_version.m4 ---
dnl http://autoconf-archive.cryp.to/ax_compare_version.html
dnl #########################################################################
AC_DEFUN([AX_COMPARE_VERSION], [
  # Used to indicate true or false condition
  ax_compare_version=false

  # Convert the two version strings to be compared into a format that
  # allows a simple string comparison.  The end result is that a version
  # string of the form 1.12.5-r617 will be converted to the form
  # 0001001200050617.  In other words, each number is zero padded to four
  # digits, and non digits are removed.
  AS_VAR_PUSHDEF([A],[ax_compare_version_A])
  A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
                     -e 's/[[^0-9]]//g'`

  AS_VAR_PUSHDEF([B],[ax_compare_version_B])
  B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
                     -e 's/[[^0-9]]//g'`

  dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
  dnl # then the first line is used to determine if the condition is true.
  dnl # The sed right after the echo is to remove any indented white space.
  m4_case(m4_tolower($2),
  [lt],[
    ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
  ],
  [gt],[
    ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
  ],
  [le],[
    ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
  ],
  [ge],[
    ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
  ],[
    dnl Split the operator from the subversion count if present.
    m4_bmatch(m4_substr($2,2),
    [0],[
      # A count of zero means use the length of the shorter version.
      # Determine the number of characters in A and B.
      ax_compare_version_len_A=`echo "$A" | awk '{print(length)}'`
      ax_compare_version_len_B=`echo "$B" | awk '{print(length)}'`

      # Set A to no more than B's length and B to no more than A's length.
      A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
      B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
    ],
    [[0-9]+],[
      # A count greater than zero means use only that many subversions
      A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
      B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
    ],
    [.+],[
      AC_WARNING(
        [illegal OP numeric parameter: $2])
    ],[])

    # Pad zeros at end of numbers to make same length.
    ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
    B="$B`echo $A | sed 's/./0/g'`"
    A="$ax_compare_version_tmp_A"

    # Check for equality or inequality as necessary.
    m4_case(m4_tolower(m4_substr($2,0,2)),
    [eq],[
      test "x$A" = "x$B" && ax_compare_version=true
    ],
    [ne],[
      test "x$A" != "x$B" && ax_compare_version=true
    ],[
      AC_WARNING([illegal OP parameter: $2])
    ])
  ])

  AS_VAR_POPDEF([A])dnl
  AS_VAR_POPDEF([B])dnl

  dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
  if test "$ax_compare_version" = "true" ; then
    m4_ifvaln([$4],[$4],[:])dnl
    m4_ifvaln([$5],[else $5])dnl
  fi
]) dnl AX_COMPARE_VERSION


--- check-utmp.m4 DELETED ---

--- compiler-flags.m4 DELETED ---

--- curses.m4 DELETED ---

--- gnome-common.m4 DELETED ---

--- gnome-cxx-check.m4 DELETED ---

--- gnome-gettext.m4 DELETED ---

--- gnome-pkgconfig.m4 DELETED ---

--- gnome-platform.m4 DELETED ---

--- gnome-pthread-check.m4 DELETED ---

--- gnome-x-checks.m4 DELETED ---

--- linger.m4 DELETED ---




More information about the cairo-commit mailing list