how to set CFLAGS variable for compiling Xorg

Peter Breitenlohner peb at mppmu.mpg.de
Thu Nov 6 00:30:59 PST 2008


On Wed, 5 Nov 2008, Peter Breitenlohner wrote:

> On Wed, 5 Nov 2008, Julien Cristau wrote:
>
>>> this is in a separate (new) file xorg-changelog-cmd.m4,
>>> such that we can use it before it is installed
>> 
>> meh. we can just depend on xorg-macros 1.2...
>
> Hi Julien,
>
> yes (of course) for all other modules, but not for xorg-macros which is
> about to install these macros (chicken-or-egg).  When building xorg-macros
> from git, any already installed macros should not be used.

Hi Julien,

yesterday we probably talked about two different things. You thought I want
to install xorg-changelog-cmd.m4 as a separate file, whereas I followed the
habit of old-style ChangeLogs to mention new source files.

Anyway, attached is a new version which does just the opposite: appending
xorgversion.m4 to xorg-macros.m4.in instead of installing it as a separate
files.

Regards,
Peter Breitenlohner <peb at mppmu.mpg.de>
-------------- next part --------------
From 6275fc6861cdd1403f980776a060c03326e9c700 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Thu, 6 Nov 2008 09:22:59 +0100
Subject: [PATCH] define the XORG_CHANGELOG_CMD macro

xorgversion.m4 is appended to xorg-macros.m4.in, not installed
avoid copying code from xorgversion.m4 to configure.ac.
---
 Makefile.am    |    9 +++++++--
 configure.ac   |   22 ++++++++--------------
 xorgversion.m4 |   15 +++++++++++++++
 3 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fd5c1ea..39ea9b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,14 +20,19 @@
 #  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 aclocaldir = $(datadir)/aclocal
-aclocal_DATA = xorgversion.m4 xorg-macros.m4
+aclocal_DATA = xorg-macros.m4
 
 EXTRA_DIST = $(aclocal_DATA) ChangeLog
 
 .PHONY: ChangeLog
 
 ChangeLog:
-	(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+	@CHANGELOG_CMD@
+
+# There used to be xorgversion.m4, now integrated into xorg-macros.m4,
+# explicitly remove it to avoid a macro defined in two different files.
+install-data-hook:
+	rm -f $(DESTDIR)$(aclocaldir)/xorgversion.m4
 
 dist-hook: ChangeLog
 
diff --git a/configure.ac b/configure.ac
index 676a70d..3e309f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,18 +27,12 @@ AC_INIT([util-macros],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 
-# Since this is the package that installs the xorgversion.m4 file, we
-# cannot use it here.  Therefore, we copy the code from the m4 file.
-# Please try to keep them in sync.
-AC_ARG_WITH(release-version,
-		AC_HELP_STRING([--with-release-version=STRING]
-			[Use release version string in package name]),
-		[RELEASE_VERSION="$withval"],
-		[RELEASE_VERSION=""])
-if test "x$RELEASE_VERSION" != "x"; then
-	PACKAGE="$PACKAGE-$RELEASE_VERSION"
-	PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
-	AC_MSG_NOTICE([Building with package name set to $PACKAGE])
-fi
+# This is the package that installs xorgversion.m4,
+# in order to use it here, we include it explicitly.
 
-AC_OUTPUT([Makefile xorg-macros.m4])
+m4_include([xorgversion.m4])
+
+XORG_RELEASE_VERSION
+XORG_CHANGELOG_CMD
+
+AC_OUTPUT([Makefile xorg-macros.m4:xorg-macros.m4.in:xorgversion.m4])
diff --git a/xorgversion.m4 b/xorgversion.m4
index 7d3dda8..627a45e 100644
--- a/xorgversion.m4
+++ b/xorgversion.m4
@@ -59,3 +59,18 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
 		[$PVP],
 		[Patch version of this package])
 ])
+
+# XORG_CHANGELOG_CMD()
+# --------------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+AC_DEFUN([XORG_CHANGELOG_CMD], [
+xorg_c1='GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog'
+xorg_c2='rm -f .changelog.tmp'
+xorg_c3="touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.'"
+CHANGELOG_CMD="($xorg_c1) || ($xorg_c2; $xorg_c3 >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG_CMD
-- 
1.6.0.3



More information about the xorg mailing list