[PATCH] Janitor: make distcheck, compile warnings, .gitignore.

Paulo Cesar Pereira de Andrade pcpa at mandriva.com.br
Mon Feb 9 09:41:18 PST 2009


  Add .gitignore file.
  Prefer usage of $(VAR) over @VAR@ to simplify configure.ac,
removing the AC_SUBST(VAR).
  Use same pattern for $moduledir and $sdkdir, that works with
make distcheck.
  Use XORG_CWARNFLAGS instead of a check for GCC and use of almost
the same warnings as CWARNFLAGS.
  Remove the visibility configure option. It is already defined
in XORG_CFLAGS; having it in a per driver basis works, but should
be simpler to just use whatever was configured in the X Server.

Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
---
 .gitignore      |   25 +++++++++++++++++++++++++
 Makefile.am     |    4 ++--
 configure.ac    |   53 +++++++++++------------------------------------------
 src/Makefile.am |    6 +++---
 4 files changed, 41 insertions(+), 47 deletions(-)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9fa2a3f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,25 @@
+.deps
+.libs
+Makefile
+Makefile.in
+*.la
+*.lo
+aclocal.m4
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+stamp-h1
+*~
+xf86-video-geode-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index e5d6028..665572b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,13 +21,13 @@
 AUTOMAKE_OPTIONS = foreign
 SUBDIRS = src
 
-EXTRA_DIST = autogen.sh ChangeLog
+EXTRA_DIST = ChangeLog
 
 MAINTAINERCLEANFILES = 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 ea35cbe..0bf06fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,9 @@ AC_INIT([xf86-video-geode],
         xf86-video-geode)
 
 AC_CONFIG_SRCDIR([Makefile.am])
+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.2)
 AM_CONFIG_HEADER([config.h])
 AC_CONFIG_AUX_DIR(.)
 
@@ -39,14 +42,13 @@ AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 AC_PROG_CC
 AM_PROG_AS
+XORG_CWARNFLAGS
 
 AH_TOP([#include "xorg-server.h"])
-
-AC_ARG_WITH(xorg-module-dir,
-            AC_HELP_STRING([--with-xorg-module-dir=DIR],
-                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
-            [moduledir="$withval"],
-            [moduledir="$libdir/xorg/modules"])
+moduledir="$libdir/xorg/modules"
+sdkdir="$includedir/xorg"
+AC_SUBST(moduledir)
+AC_SUBST(sdkdir)
 
 AC_ARG_ENABLE(geodegx-panel, 
 	      AC_HELP_STRING([--disable-geodegx-panel],
@@ -57,21 +59,8 @@ AC_ARG_ENABLE(geodegx-panel,
 AC_ARG_ENABLE(werror,        AC_HELP_STRING([--enable-werror],
 				  [Treat warnings as errors (default: disabled)]),
 			        [WERROR=$enableval], [WERROR=no])
-AC_ARG_ENABLE(visibility,
-	      AC_HELP_STRING([--enable-visibility],
-			     [Enable GCC visibility optimizations]),
-			     [ AMD_CFLAGS="$AMD_CFLAGS -fvisibility=hidden" ],
-			     [ : ])
-
-if test "x$GCC" = "xyes"; then
-       GCC_WARNINGS1="-Wall -Wpointer-arith -Wstrict-prototypes"
-       GCC_WARNINGS2="-Wmissing-prototypes -Wmissing-declarations"
-       GCC_WARNINGS3="-Wnested-externs -fno-strict-aliasing"
-       GCC_WARNINGS="$GCC_WARNINGS1 $GCC_WARNINGS2 $GCC_WARNINGS3"
-       if test "x$WERROR" = "xyes"; then
-               GCC_WARNINGS="${GCC_WARNINGS} -Werror"
-       fi
-       AMD_CFLAGS="$GCC_WARNINGS $AMD_CFLAGS"
+if x$GCC = xyes -a x$WERROR != xno; then
+    CWARNFLAGS="-Werror $CWARNFLAGS"
 fi
 
 # Checks for extensions
@@ -83,28 +72,10 @@ XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
 
 # Checks for pkg-config packages
 PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
-sdkdir=$(pkg-config --variable=sdkdir xorg-server)
-
-# Checks for libraries.
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
-AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
-              [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
-              [#include "xorg-server.h"])
-CPPFLAGS="$SAVE_CPPFLAGS"
 
 # Checks for header files.
 AC_HEADER_STDC
 
-if test "x$XSERVER_LIBPCIACCESS" = xyes; then
-    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
-    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
-fi
-
-AC_SUBST([XORG_CFLAGS])
-AC_SUBST([moduledir])
-AC_SUBST([AMD_CFLAGS])
-
 is386=false
 
 case $host_cpu in
@@ -120,11 +91,9 @@ fi
 
 AM_CONDITIONAL([I386ARCH], [test $is386 = true])
 
-DRIVER_NAME=geode
-AC_SUBST([DRIVER_NAME])
-
 XORG_MANPAGE_SECTIONS
 XORG_RELEASE_VERSION
+XORG_CHANGELOG
 
 AC_OUTPUT([
 	Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index a162d26..697a3a6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,11 +29,11 @@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) \
 
 # -DPNL_SUP is now provided by AMD_CFLAGS
 #
-AM_CFLAGS = @XORG_CFLAGS@ \
+AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) \
    -DHAVE_GX -DHAVE_LX -DAMD_V4L2_VIDEO -DOPT_ACCEL \
-   -DLINUX_2_6 @AMD_CFLAGS@
+   -DLINUX_2_6 $(AMD_CFLAGS)
 
-AM_CCASFLAGS = @XORG_CFLAGS@
+AM_CCASFLAGS = $(XORG_CFLAGS)
 geode_drv_la_LTLIBRARIES = geode_drv.la
 geode_drv_la_LDFLAGS = -module -avoid-version
 geode_drv_ladir = @moduledir@/drivers
-- 
1.6.1

------=_20090209163616_39134--



More information about the xorg-devel mailing list