summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cloos <cloos@jhcloos.com>2007-09-03 05:57:21 -0400
committerJames Cloos <cloos@jhcloos.com>2007-09-03 05:57:21 -0400
commit02187ef55aa08b7ca0b354257f9bf1935420dd36 (patch)
tree2ccb1c890d73d90f84daf6cd8bf6c0daa4ba88e8
parent902c7ceb43ea8c9f48032dcbddf9beb026fb7a0e (diff)
parent05c862263da36ce578ae208fdad0f101c495fd61 (diff)
Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/app/constype
-rw-r--r--ChangeLog13
-rw-r--r--Makefile.am52
-rw-r--r--configure.ac8
-rw-r--r--constype.c26
-rw-r--r--constype.man2
5 files changed, 53 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index a6d8868..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Update package version number for final X11R7 release candidate.
-
-2005-10-18 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Update package version number for RC1 release.
-
-2005-10-05 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * Makefile.am: Add constype.man to EXTRA_DIST even when not building
diff --git a/Makefile.am b/Makefile.am
index 510aa03..bdefeca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,31 +34,45 @@ bin_PROGRAMS = constype
constype_SOURCES = constype.c
-man1_MANS = constype.man
+appman_PRE = constype.man
-CLEANFILES = $(man1_MANS)
+appmandir = $(APP_MAN_DIR)
-all-local: $(man1_MANS)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-# Rules for generating files using the C pre-processor
-# (Replaces CppFileTarget from Imake)
+CLEANFILES = $(appman_DATA)
SED = sed
-SUFFIXES = .1 .man
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+ XORGMANNAME = X Version 11
-# Delete line numbers from the cpp output (-P is not portable, I guess).
+MAN_SUBSTS = \
+ -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+ -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+ -e 's|__xservername__|Xorg|g' \
+ -e 's|__xconfigfile__|xorg.conf|g' \
+ -e 's|__projectroot__|$(prefix)|g' \
+ -e 's|__apploaddir__|$(appdefaultdir)|' \
+ -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
+ -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
+ -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
+ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
+ -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
-CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
- -e '/^\#line *[0-9][0-9]* *.*$$/d'
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
-XORGRELSTRING = @PACKAGE_STRING@
- XORGMANNAME = X Version 11
+.man.$(APP_MAN_SUFFIX):
+ $(SED) $(MAN_SUBSTS) < $< > $@
-CPP_FILES_FLAGS = -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\""
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
-.man.1:
- $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(constype_SOURCES)
+endif LINT
else
@@ -67,4 +81,12 @@ all-local:
endif
-EXTRA_DIST = constype.man
+EXTRA_DIST = constype.man ChangeLog autogen.sh
+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)
+
+dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index 4a7c275..02ad48e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,13 +31,17 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57])
-AC_INIT(constype,[1.0.0],
+AC_INIT(constype,[1.0.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],constype)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
+# Require xorg-macros version 1.1.0 or newer for XORG_WITH_LINT macro
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.1)
+
AC_PROG_CC
AC_PROG_INSTALL
XORG_PROG_RAWCPP
@@ -48,6 +52,8 @@ AC_CHECK_HEADERS([sys/visual_io.h sys/fbio.h machine/fbio.h sun/fbio.h],
AM_CONDITIONAL(BUILD_CONSTYPE, [test x$BUILD_CONSTYPE = xyes])
+XORG_WITH_LINT
+XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
AC_OUTPUT([Makefile])
diff --git a/constype.c b/constype.c
index 878f4ce..11f3948 100644
--- a/constype.c
+++ b/constype.c
@@ -41,27 +41,10 @@ style.
#ifdef HAVE_CONFIG_H
# include "config.h"
-#else
-# if defined(SVR4) || defined(CSRG_BASED)
-# define STDC_HEADERS 1
-# endif
-# if defined(SVR4) || defined(__bsdi__)
-# define HAVE_SYS_FBIO_H 1
-# if defined(SVR4) && defined(sun)
-# define HAVE_SYS_VISUAL_IO_H 1
-# endif
-# elif defined(CSRG_BASED)
-# define HAVE_MACHINE_FBIO_H
-# endif
#endif
#include <stdio.h>
-#ifdef STDC_HEADERS
#include <string.h>
-#else
-/* SunOS */
-#include <strings.h>
-#endif
#include <unistd.h>
static int wu_fbid(const char *devname, char **fbname, int *fbtype);
@@ -169,7 +152,14 @@ wu_fbid(const char* devname, char** fbname, int* fbtype)
struct vis_identifier fbid;
#endif
- if ( (fd = open(devname, O_RDWR, 0)) == -1 ) {
+
+#ifdef sun
+# define DEV_OPEN_MODE O_RDONLY
+#else
+# define DEV_OPEN_MODE O_RDWR
+#endif
+
+ if ( (fd = open(devname, DEV_OPEN_MODE, 0)) == -1 ) {
*fbname = "unable to open fb";
return 2;
}
diff --git a/constype.man b/constype.man
index 4da1e9f..abad85b 100644
--- a/constype.man
+++ b/constype.man
@@ -2,7 +2,7 @@
.\" $XdotOrg: $
.\" $XFree86$
.\"
-.TH CONSTYPE 1 __xorgversion__
+.TH CONSTYPE __appmansuffix__ __xorgversion__
.SH NAME
constype \- print type of Sun console
.SH SYNOPSIS