configure.ac revision da4a0041
1
2dnl  Copyright 2005 Red Hat, Inc.
3dnl 
4dnl  Permission to use, copy, modify, distribute, and sell this software and its
5dnl  documentation for any purpose is hereby granted without fee, provided that
6dnl  the above copyright notice appear in all copies and that both that
7dnl  copyright notice and this permission notice appear in supporting
8dnl  documentation, and that the name of Red Hat not be used in
9dnl  advertising or publicity pertaining to distribution of the software without
10dnl  specific, written prior permission.  Red Hat makes no
11dnl  representations about the suitability of this software for any purpose.  It
12dnl  is provided "as is" without express or implied warranty.
13dnl 
14dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20dnl  PERFORMANCE OF THIS SOFTWARE.
21dnl
22dnl Process this file with autoconf to create configure.
23
24# Initialize Autoconf
25AC_PREREQ([2.60])
26AC_INIT([xman], [1.1.4],
27        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xman])
28AC_CONFIG_SRCDIR([Makefile.am])
29AC_CONFIG_HEADERS([config.h])
30
31# Initialize Automake
32AM_INIT_AUTOMAKE([foreign dist-bzip2])
33
34# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
35m4_ifndef([XORG_MACROS_VERSION],
36	  [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
37XORG_MACROS_VERSION(1.8)
38XORG_DEFAULT_OPTIONS
39
40AC_CANONICAL_HOST
41
42AC_CHECK_PROG([GROFF], [groff], [found], [missing])
43if test "x$GROFF" = "xfound" ; then
44   AC_DEFINE([HAS_GROFF], 1, [Define to 1 if you have the groff package.])
45fi
46
47AC_CHECK_FUNCS([mkstemp])
48
49AC_ARG_WITH(helpdir,
50        AS_HELP_STRING([--with-helpdir=<path>],
51                       [Set default directory for xman.help (default: ${datadir}/X11)]),
52        [HELPDIR="$withval"],
53        [HELPDIR=${datadir}/X11])
54AC_SUBST([HELPDIR])
55
56AC_ARG_WITH(sysmanpath,
57        AS_HELP_STRING([--with-sysmanpath=<path>],
58                       [Set default system man page search path]),
59        [SYSMANPATH="$withval"], [])
60if test x$SYSMANPATH != x; then
61    AC_DEFINE_UNQUOTED(SYSMANPATH, "$SYSMANPATH", 
62	[Default system man page search path (default: none)])
63fi
64
65AC_ARG_WITH(localmanpath,
66        AS_HELP_STRING([--with-localmanpath=<path>],
67                       [Set default local man page search path]),
68        [LOCALMANPATH="$withval"], [])
69if test x$LOCALMANPATH != x; then
70    AC_DEFINE_UNQUOTED(LOCALMANPATH, "$LOCALMANPATH", 
71	[Default local man page search path (default: none)])
72fi
73
74# Obtain compiler/linker options from depedencies
75PKG_CHECK_MODULES(XMAN, [xproto >= 7.0.17 xaw7 xt])
76
77AC_ARG_WITH(manconfig,
78        AS_HELP_STRING([--with-manconfig=<filename>],
79                       [Set default system man configuration file]),
80        [MANCONF="$withval"], [])
81if test x$MANCONF = x; then
82# Check for man page config files
83    AC_CHECK_FILE([/etc/man.conf], [MANCONF="/etc/man.conf"], 
84                  AC_CHECK_FILE([/etc/man.config], [MANCONF="/etc/man.config"], 
85                                AC_CHECK_FILE([/etc/manpath.config], [MANCONF="/etc/manpath.config"],
86                                              AC_CHECK_FILE([/usr/share/misc/man.conf], [MANCONF="/usr/share/misc/man.conf"]))))
87fi
88
89if test x$MANCONF != x ; then
90    AC_DEFINE_UNQUOTED(MANCONF, "$MANCONF", 
91	[Define to path to man config file if you have one])
92
93    # Try to determine format of config file
94    # would be better to somehow determine from the files themselves, but
95    # we'll guess based on pathname and OS for now (mirrors old Imake tests)
96    AC_MSG_CHECKING([man config file format])
97    if test x$MANCONF = x/etc/manpath.config ; then
98	MAN_CONFIG_STYLE="FreeBSD"
99    else
100	case $host_os in
101	*darwin* | *openbsd* | *netbsd* )
102	    MAN_CONFIG_STYLE="OpenBSD"
103	    ;;
104	*linux* | cygwin* )
105	    MAN_CONFIG_STYLE="Linux"
106	    ;;
107	*bsd* )
108	    MAN_CONFIG_STYLE="BSD"
109	    ;;
110	*)
111	    ;;
112	esac
113    fi
114    AC_MSG_RESULT($MAN_CONFIG_STYLE)
115
116    case $MAN_CONFIG_STYLE in
117	FreeBSD)
118	    AC_DEFINE([MANCONFIGSTYLE_FreeBSD],1,
119		[Define to 1 if you have FreeBSD format manpath.config])
120	    ;;
121	OpenBSD)
122	    AC_DEFINE([MANCONFIGSTYLE_OpenBSD],1,
123		[Define to 1 if you have OpenBSD format manpath.config])
124	    ;;
125	BSD)
126	    AC_DEFINE([MANCONFIGSTYLE_BSD],1,
127		[Define to 1 if you have BSD format manpath.config])
128	    ;;
129	Linux)
130	    AC_DEFINE([MANCONFIGSTYLE_Linux],1,
131		[Define to 1 if you have Linux format man.conf or man.config])
132	    ;;
133	*)
134	    AC_MSG_ERROR([Could not determine man page file config format.])
135    esac
136fi
137
138PKG_CHECK_MODULES(APPDEFS, xt)
139xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`
140AC_ARG_WITH(appdefaultdir,
141	AS_HELP_STRING([--with-appdefaultdir=<pathname>],
142	  [specify directory for app-defaults files (default is autodetected)]),
143	[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
144AC_SUBST(appdefaultdir)
145
146if test "x$RELEASE_VERSION" != "x"; then
147	AC_DEFINE_UNQUOTED([RELEASE_VERSION], "$RELEASE_VERSION", 
148		[Release version string if set])
149fi
150
151AC_CONFIG_FILES([
152	Makefile
153	man/Makefile])
154AC_OUTPUT
155