Adding make targets for lint/sparse/etc.
Alan Coopersmith
alan.coopersmith at sun.com
Thu Jul 13 10:03:37 PDT 2006
Donnie Berkholz wrote:
> It would probably be less painful if util-macros installed a pkgconfig
> file so the configure.ac's could require specific versions.
Can the configure.ac's require it at configure script generation time?
It doesn't need to be on the system for users building from tarballs,
just for developers running autoconf.
I suppose we could put the check in autogen.sh if we assume that's what
all developers would be using.
Or we could define a new macro XORG_MACROS_VERSION that took an argument
of the minimum version required and printed an error if the version defined
in the macro was too low. Something like this (having @VERSION@ replaced
by the xorg-macros configure script) seems to work:
# XORG_MACROS_VERSION(required-version)
# -------------------------------------
# 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)
AC_DEFUN([XORG_MACROS_VERSION],[
AC_MSG_CHECKING([version of xorg-macros.m4 configure was built with])
[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/\..*$//'`]
AC_MSG_RESULT([$XORG_MACROS_version])
[XORG_needed_version=$1
XORG_needed_major=`echo $XORG_needed_version | sed 's/\..*$//'`
XORG_needed_minor=`echo $XORG_needed_version | sed -e 's/^[0-9]*\.//' -e
's/\..*$//'`]
if test $XORG_MACROS_major -ne $XORG_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_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
])
Does using that seem reasonable?
> Putting it in a macro will buy a whole lot if we ever want to change it,
> and the configure.ac appears much more likely to change (e.g., whenever
> some OS besides solaris wants to add its own lint flags).
I've put the configure.ac portions into xorg-macros.m4 now.
Worst case for developers who don't update their macros is they'll get
"XORG_WITH_LINT: command not found" message from running configure
and not be able to configure --with-lint until updating.
--
-Alan Coopersmith- alan.coopersmith at sun.com
Sun Microsystems, Inc. - X Window System Engineering
More information about the xorg
mailing list