1dnl  Copyright 2005 Red Hat, Inc.
2dnl
3dnl  Permission to use, copy, modify, distribute, and sell this software and its
4dnl  documentation for any purpose is hereby granted without fee, provided that
5dnl  the above copyright notice appear in all copies and that both that
6dnl  copyright notice and this permission notice appear in supporting
7dnl  documentation, and that the name of Red Hat not be used in
8dnl  advertising or publicity pertaining to distribution of the software without
9dnl  specific, written prior permission.  Red Hat makes no
10dnl  representations about the suitability of this software for any purpose.  It
11dnl  is provided "as is" without express or implied warranty.
12dnl
13dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19dnl  PERFORMANCE OF THIS SOFTWARE.
20dnl
21dnl Process this file with autoconf to create configure.
22
23# Initialize Autoconf
24AC_PREREQ([2.60])
25AC_INIT([xlogo], [1.0.7],
26        [https://gitlab.freedesktop.org/xorg/app/xlogo/-/issues], [xlogo])
27AC_CONFIG_SRCDIR([Makefile.am])
28AC_CONFIG_HEADERS([config.h])
29
30# Initialize Automake
31AM_INIT_AUTOMAKE([foreign dist-xz])
32
33# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
34m4_ifndef([XORG_MACROS_VERSION],
35          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
36XORG_MACROS_VERSION(1.8)
37XORG_DEFAULT_OPTIONS
38
39# Checks for library functions.
40AC_CHECK_FUNCS([strlcat strlcpy])
41
42# Base set of required pkg-config packages
43XLOGO_DEPS="sm xaw7 xmu xt >= 1.0 xext x11 xproto >= 7.0.22"
44
45# Ensure pkg-config is initialized, since first call to macros is conditional
46PKG_PROG_PKG_CONFIG
47
48# Use render & xft2 to draw logo?
49AC_MSG_CHECKING([whether to use render & xft2 to draw logo])
50AC_ARG_WITH(render,
51	AS_HELP_STRING([--with-render], [Use Xrender & Xft2 to draw logo]),
52	USE_RENDER="$withval", USE_RENDER="try")
53
54if test "x$USE_RENDER" = "xtry" ; then
55	PKG_CHECK_EXISTS([xrender xft], USE_RENDER="yes", USE_RENDER="no")
56fi
57AC_MSG_RESULT([$USE_RENDER])
58
59if test "x$USE_RENDER" = "xyes" ; then
60	XLOGO_DEPS="xft xrender $XLOGO_DEPS"
61
62	AC_DEFINE(XRENDER, 1, [Define to 1 to use Xrender & Xft2 to draw logo])
63fi
64AM_CONDITIONAL([USE_RENDER], [test "x$USE_RENDER" = "xyes"])
65
66# Use XKB to ring the bell?
67AC_MSG_CHECKING([whether to use XkbStdBell])
68AC_ARG_WITH(xkb,
69	AS_HELP_STRING([--with-xkb], [Use XKB to sound bells]),
70	USE_XKB="$withval", USE_XKB="try")
71
72if test "x$USE_XKB" = "xtry" ; then
73	PKG_CHECK_EXISTS([xkbfile], USE_XKB="yes", USE_XKB="no")
74fi
75AC_MSG_RESULT([$USE_XKB])
76
77if test "x$USE_XKB" = "xyes" ; then
78	XLOGO_DEPS="xkbfile $XLOGO_DEPS"
79
80	AC_DEFINE(XKB, 1, [Define to 1 to use XkbStdBell])
81fi
82
83PKG_CHECK_MODULES(XLOGO, $XLOGO_DEPS)
84
85PKG_CHECK_MODULES(APPDEFS, xt)
86xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`
87AC_ARG_WITH(appdefaultdir,
88	AS_HELP_STRING([--with-appdefaultdir=<pathname>],
89	  [specify directory for app-defaults files (default is autodetected)]),
90	[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
91AC_SUBST(appdefaultdir)
92
93AC_CONFIG_FILES([
94	Makefile
95	man/Makefile])
96AC_OUTPUT
97