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