diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2006-07-13 13:46:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alanc@alf.(none)> | 2006-07-13 13:46:43 -0700 |
commit | a3ce32d91835471b7f91742850d78b186c4cbe8f (patch) | |
tree | f710ae531d8fa98315deb068be543a7407b59e7c | |
parent | 29e3f6d9c7670ff95dc03c9d494dc5f4b93741a4 (diff) |
Add XORG_MACROS_VERSION macro to check minimum version of xorg-macros.m4
- Move xorg-macros.m4 to xorg-macros.m4.in so @VERSION@ can be substituted from
the version listed in configure.ac
- Add comments to each macro listing what version it was first added in
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | xorg-macros.m4.in | 42 |
2 files changed, 42 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 1b48b89..f31a93a 100644 --- a/configure.ac +++ b/configure.ac @@ -41,4 +41,4 @@ if test "x$RELEASE_VERSION" != "x"; then AC_MSG_NOTICE([Building with package name set to $PACKAGE]) fi -AC_OUTPUT([Makefile]) +AC_OUTPUT([Makefile xorg-macros.m4]) diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in index 468d2dc..136758d 100644 --- a/xorg-macros.m4.in +++ b/xorg-macros.m4.in @@ -1,4 +1,3 @@ -dnl $Id$ dnl dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. dnl @@ -27,8 +26,41 @@ dnl shall not be used in advertising or otherwise to promote the sale, use dnl or other dealings in this Software without prior written authorization dnl of the copyright holder. +# XORG_MACROS_VERSION(required-version) +# ------------------------------------- +# Minimum version: 1.1.0 +# +# If you're using a macro added in Version 1.1 or newer, include this in +# your configure.ac with the minimum required version, such as: +# XORG_MACROS_VERSION(1.1) +# +# To force at least a version with this macro defined, also add: +# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])]) +# +# +# See the "minimum version" comment for each macro you use to see what +# version you require. +AC_DEFUN([XORG_MACROS_VERSION],[ + [XORG_MACROS_needed_version=$1 + XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` + XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) + [XORG_MACROS_version=@VERSION@ + XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` + XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then + AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x]) + fi + if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then + AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer]) + fi + AC_MSG_RESULT([yes, $XORG_MACROS_version]) +]) # XORG_MACROS_VERSION + # XORG_PROG_RAWCPP() # ------------------ +# Minimum version: 1.0.0 +# # Find cpp program and necessary flags for use in pre-processing text files # such as man pages and config files AC_DEFUN([XORG_PROG_RAWCPP],[ @@ -71,6 +103,8 @@ AC_SUBST(RAWCPPFLAGS) # XORG_MANPAGE_SECTIONS() # ----------------------- +# Minimum version: 1.0.0 +# # Determine which sections man pages go in for the different man page types # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. # Not sure if there's any better way than just hardcoding by OS name. @@ -178,6 +212,8 @@ AC_SUBST([ADMIN_MAN_DIR]) # XORG_CHECK_LINUXDOC # ------------------- +# Minimum version: 1.0.0 +# # Defines the variable MAKE_TEXT if the necessary tools and # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. # Whether or not the necessary tools and files are found can be checked @@ -229,6 +265,8 @@ AC_SUBST(MAKE_HTML) # XORG_CHECK_MALLOC_ZERO # ---------------------- +# Minimum version: 1.0.0 +# # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if # malloc(0) returns NULL. Packages should add one of these cflags to # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. @@ -275,6 +313,8 @@ AC_SUBST([XTMALLOC_ZERO_CFLAGS]) # XORG_WITH_LINT() # ---------------- +# Minimum version: 1.1.0 +# # Sets up flags for source checkers such as lint and sparse if --with-lint # is specified. (Use --with-lint=sparse for sparse.) # Sets $LINT to name of source checker passed with --with-lint (default: lint) |