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