1 dnl Copyright 2005 Red Hat, Inc.
3 dnl Permission to use, copy, modify, distribute, and sell this software and its
4 dnl documentation for any purpose is hereby granted without fee, provided that
5 dnl the above copyright notice appear in all copies and that both that
6 dnl copyright notice and this permission notice appear in supporting
7 dnl documentation, and that the name of Red Hat not be used in
8 dnl advertising or publicity pertaining to distribution of the software without
9 dnl specific, written prior permission. Red Hat makes no
10 dnl representations about the suitability of this software for any purpose. It
11 dnl is provided "as is" without express or implied warranty.
13 dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15 dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16 dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 dnl PERFORMANCE OF THIS SOFTWARE.
21 dnl Process this file with autoconf to create configure.
25 AC_INIT([xrdb], [1.0.9],
26 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xrdb])
27 AC_CONFIG_SRCDIR([Makefile.am])
28 AC_CONFIG_HEADERS([config.h])
29 AC_USE_SYSTEM_EXTENSIONS
32 AM_INIT_AUTOMAKE([foreign dist-bzip2])
35 # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
36 m4_ifndef([XORG_MACROS_VERSION],
37 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
38 XORG_MACROS_VERSION(1.8)
41 AC_CHECK_FUNCS([mkstemp asprintf])
43 # Find MAXHOSTNAMELEN definition
45 # BSD & Linux - <sys/param.h>
48 AC_CHECK_DECL([MAXHOSTNAMELEN],[FOUND_MAXHOSTNAMELEN=yes])
50 if test x$FOUND_MAXHOSTNAMELEN != xyes ; then
51 AC_MSG_CHECKING([for header that defines MAXHOSTNAMELEN])
53 FOUND_MAXHOSTNAMELEN='not found'
56 AC_LANG_PROGRAM([#include <sys/param.h>],
57 [int h = MAXHOSTNAMELEN;]),
58 [FOUND_MAXHOSTNAMELEN='sys/param.h'
59 AC_DEFINE(NEED_SYS_PARAM_H,1,
60 [Define to 1 if you need <sys/param.h> to define MAXHOSTNAMELEN])])
63 AC_LANG_PROGRAM([#include <netdb.h>],
64 [int h = MAXHOSTNAMELEN;]),
65 [FOUND_MAXHOSTNAMELEN='netdb.h'
66 AC_DEFINE(NEED_NETDB_H,1,
67 [Define to 1 if you need <netdb.h> to define MAXHOSTNAMELEN])])
69 AC_MSG_RESULT([$FOUND_MAXHOSTNAMELEN])
72 # xrdb needs to know where to find cpp at runtime - previously set as CppCmd
73 # in Imake config files for each OS
75 AS_HELP_STRING([--with-cpp=path],
76 [comma-separated list of paths to cpp command for xrdb to use at runtime]),
77 [AC_MSG_CHECKING(for cpp)
79 AC_MSG_RESULT(--with-cpp specified $CPP_PATH)],
80 [AC_PATH_PROG([CPP_PATH],[cpp], [cpp],
81 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])])
82 CPP_PATH=`echo ${CPP_PATH} | sed 's/,/\\",\\"/g'`
83 AC_DEFINE_UNQUOTED([CPP], "$CPP_PATH", [Path to CPP program])
85 # Checks for pkg-config packages
86 PKG_CHECK_MODULES(XRDB, xmuu x11)