how to set CFLAGS variable for compiling Xorg
Peter Breitenlohner
peb at mppmu.mpg.de
Wed Nov 5 09:45:26 PST 2008
On Wed, 5 Nov 2008, Alan Coopersmith wrote:
> Okay, makes sense to me. I'd like to proceed on the plan of getting
> these rules (changelog & warning flags) into the xorg-macros.m4 before
> anyone does a massive cleanup pass across all modules. It's not hard
> to get a xorg-macros 1.2.0 release out quickly.
Attached is a patch for the changelog part.
> For the warnings one, I have a preference (not surprisingly) for the example
> in the libxcb configure.ac that handles gcc & Sun Studio, though the gcc
> warnings list there seems a bit short:
>
> if test "x$GCC" = xyes ; then
> CWARNFLAGS="-Wall -pedantic -Wpointer-arith \
> -Wstrict-prototypes -Wmissing-declarations -Wnested-externs"
> else
> AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
> if test "x$SUNCC" = "xyes"; then
> CWARNFLAGS="-v"
> fi
> fi
> AC_SUBST(CWARNFLAGS)
Indeed, for gcc I'd like to have those in, e.g., libX11:
if test "x$GCC" = "xyes"; then
GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
X11_CFLAGS="$GCC_WARNINGS $X11_CFLAGS"
fi
plus the three suggested by Paulo
-Wold-style-definition, -Wbad-function-cast, and
-Wdeclaration-after-statement
these either unconditional or conditional (e.g., via
--enable-extra-warnings); yet to be decided.
I'm not so sure about -pedantic for gcc, that warns about 'long long', extra
long strings, and others we can hardly avoid.
Regards
Peter Breitenlohner <peb at mppmu.mpg.de>
-------------- next part --------------
From 597894712187f6c3941dcc656a0722cc3518b1f5 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Wed, 5 Nov 2008 18:20:40 +0100
Subject: [PATCH] define the macro XORG_CHANGELOG_CMD
this is in a separate (new) file xorg-changelog-cmd.m4,
such that we can use it before it is installed
---
Makefile.am | 4 +++-
configure.ac | 3 +++
xorg-changelog-cmd.m4 | 15 +++++++++++++++
3 files changed, 21 insertions(+), 1 deletions(-)
create mode 100644 xorg-changelog-cmd.m4
diff --git a/Makefile.am b/Makefile.am
index fd5c1ea..8bd33cb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,8 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ACLOCAL_AMFLAGS = -I .
+
aclocaldir = $(datadir)/aclocal
aclocal_DATA = xorgversion.m4 xorg-macros.m4
@@ -27,7 +29,7 @@ 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@
dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index 676a70d..bbc8b37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,4 +41,6 @@ if test "x$RELEASE_VERSION" != "x"; then
AC_MSG_NOTICE([Building with package name set to $PACKAGE])
fi
-AC_OUTPUT([Makefile xorg-macros.m4])
+XORG_CHANGELOG_CMD
+
+AC_OUTPUT([Makefile xorg-macros.m4:xorg-macros.m4.in:xorg-changelog-cmd.m4])
diff --git a/xorg-changelog-cmd.m4 b/xorg-changelog-cmd.m4
new file mode 100644
index 0000000..7e99d88
--- /dev/null
+++ b/xorg-changelog-cmd.m4
@@ -0,0 +1,15 @@
+
+# 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