configure.ac revision 8b6d6341
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
24AC_PREREQ([2.57])
25AC_INIT(xman, [1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xman)
26AM_INIT_AUTOMAKE([dist-bzip2])
27AM_MAINTAINER_MODE
28
29# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
30m4_ifndef([XORG_MACROS_VERSION],
31	  [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
32XORG_MACROS_VERSION(1.3)
33
34AM_CONFIG_HEADER(config.h)
35
36AC_PROG_CC
37AC_PROG_INSTALL
38AC_CANONICAL_HOST
39
40XORG_DEFAULT_OPTIONS
41
42AC_CHECK_FUNC([mkstemp], 
43   AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the "mkstemp" function.]))
44
45AC_ARG_WITH(helpdir,
46        AC_HELP_STRING([--with-helpdir=<path>],
47                       [Set default directory for xman.help (default: ${datadir}/X11)]),
48        [HELPDIR="$withval"],
49        [HELPDIR=${datadir}/X11])
50AC_SUBST([HELPDIR])
51
52AC_ARG_WITH(sysmanpath,
53        AC_HELP_STRING([--with-sysmanpath=<path>],
54                       [Set default system man page search path]),
55        [SYSMANPATH="$withval"], [])
56if test x$SYSMANPATH != x; then
57    AC_DEFINE_UNQUOTED(SYSMANPATH, "$SYSMANPATH", 
58	[Default system man page search path (default: none)])
59fi
60
61AC_ARG_WITH(localmanpath,
62        AC_HELP_STRING([--with-localmanpath=<path>],
63                       [Set default local man page search path]),
64        [LOCALMANPATH="$withval"], [])
65if test x$LOCALMANPATH != x; then
66    AC_DEFINE_UNQUOTED(LOCALMANPATH, "$LOCALMANPATH", 
67	[Default local man page search path (default: none)])
68fi
69
70# Checks for pkg-config packages
71PKG_CHECK_MODULES(XMAN, xaw7)
72
73AC_ARG_WITH(manconfig,
74        AC_HELP_STRING([--with-manconfig=<filename>],
75                       [Set default system man configuration file]),
76        [MANCONF="$withval"], [])
77if test x$MANCONF = x; then
78# Check for man page config files
79    AC_CHECK_FILE([/etc/man.conf], [MANCONF="/etc/man.conf"], 
80                  AC_CHECK_FILE([/etc/man.config], [MANCONF="/etc/man.config"], 
81                                AC_CHECK_FILE([/etc/manpath.config], [MANCONF="/etc/manpath.config"],
82                                              AC_CHECK_FILE([/usr/share/misc/man.conf], [MANCONF="/usr/share/misc/man.conf"]))))
83fi
84
85if test x$MANCONF != x ; then
86    AC_DEFINE_UNQUOTED(MANCONF, "$MANCONF", 
87	[Define to path to man config file if you have one])
88
89    # Try to determine format of config file
90    # would be better to somehow determine from the files themselves, but
91    # we'll guess based on pathname and OS for now (mirrors old Imake tests)
92    AC_MSG_CHECKING([man config file format])
93    if test x$MANCONF = x/etc/manpath.config ; then
94	MAN_CONFIG_STYLE="FreeBSD"
95    else
96	case $host_os in
97	*darwin* | *openbsd* | *netbsd* )
98	    MAN_CONFIG_STYLE="OpenBSD"
99	    ;;
100	*linux* | cygwin* )
101	    MAN_CONFIG_STYLE="Linux"
102	    ;;
103	*bsd* )
104	    MAN_CONFIG_STYLE="BSD"
105	    ;;
106	*)
107	    ;;
108	esac
109    fi
110    AC_MSG_RESULT($MAN_CONFIG_STYLE)
111
112    case $MAN_CONFIG_STYLE in
113	FreeBSD)
114	    AC_DEFINE([MANCONFIGSTYLE_FreeBSD],1,
115		[Define to 1 if you have FreeBSD format manpath.config])
116	    ;;
117	OpenBSD)
118	    AC_DEFINE([MANCONFIGSTYLE_OpenBSD],1,
119		[Define to 1 if you have OpenBSD format manpath.config])
120	    ;;
121	BSD)
122	    AC_DEFINE([MANCONFIGSTYLE_BSD],1,
123		[Define to 1 if you have BSD format manpath.config])
124	    ;;
125	Linux)
126	    AC_DEFINE([MANCONFIGSTYLE_Linux],1,
127		[Define to 1 if you have Linux format man.conf or man.config])
128	    ;;
129	*)
130	    AC_MSG_ERROR([Could not determine man page file config format.])
131    esac
132fi
133AC_SUBST(XMAN_CFLAGS)
134AC_SUBST(XMAN_LIBS)
135
136PKG_CHECK_MODULES(APPDEFS, xt)
137xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
138AC_ARG_WITH(appdefaultdir,
139	AC_HELP_STRING([--with-appdefaultdir=<pathname>],
140	  [specify directory for app-defaults files (default is autodetected)]),
141	[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
142AC_SUBST(appdefaultdir)
143
144AC_OUTPUT([Makefile])
145