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
24# Initialize Autoconf
25AC_PREREQ([2.60])
26AC_INIT([xclock],
27	[1.1.1],
28	[https://gitlab.freedesktop.org/xorg/app/xclock/issues],
29	[xclock])
30AC_CONFIG_SRCDIR([Makefile.am])
31AC_CONFIG_HEADERS([config.h])
32
33# Initialize Automake
34AM_INIT_AUTOMAKE([foreign dist-xz])
35
36# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
37m4_ifndef([XORG_MACROS_VERSION],
38          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
39XORG_MACROS_VERSION(1.8)
40XORG_DEFAULT_OPTIONS
41
42AC_CHECK_FUNCS([strlcpy getpid nl_langinfo])
43
44AM_ICONV
45
46dnl Required dependencies
47PKG_CHECK_MODULES(XCLOCK, [xaw7 xmu x11 xproto >= 7.0.17])
48XCLOCK_LIBS="$XCLOCK_LIBS $LIBICONV"
49
50dnl Optional dependencies
51AC_ARG_WITH(xft, AS_HELP_STRING([--with-xft],[Use Xft2 and Xrender for rendering (Default is YES)]),use_xft="$withval",use_xft="try")
52if test x$use_xft != xno ; then
53	PKG_CHECK_MODULES(XFT, [xrender xft])
54	# Solaris 11 has sqrt in libc but needs libm for sincos
55	AC_SEARCH_LIBS(sqrt, [m])
56	AC_SEARCH_LIBS(sincos, [m],
57            AC_DEFINE([HAVE_SINCOS], [1],
58                      [Define to 1 if you have the `sincos' function.]))
59	XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XFT_CFLAGS"
60	XCLOCK_LIBS="$XCLOCK_LIBS $XFT_LIBS"
61	AC_DEFINE([XRENDER],1,[Define to use X Render Extension])
62	AC_DEFINE([XFREE86_FT2],1,[Define to use Xft2 library])
63fi
64
65AC_ARG_WITH(xkb, AS_HELP_STRING([--with-xkb],[Use XKB to sound bells (Default is YES)]),use_xkb="$withval",use_xkb="try")
66if test x$use_xkb != xno ; then
67	PKG_CHECK_MODULES(XKB, xkbfile)
68	XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XKB_CFLAGS"
69	XCLOCK_LIBS="$XCLOCK_LIBS $XKB_LIBS"
70	AC_DEFINE([XKB],1,[Define to use XkbStdBell])
71fi
72
73
74PKG_CHECK_MODULES(APPDEFS, xt)
75xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`
76AC_ARG_WITH(appdefaultdir,
77	AS_HELP_STRING([--with-appdefaultdir=<pathname>],
78	  [specify directory for app-defaults files (default is autodetected)]),
79	[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
80AC_SUBST(appdefaultdir)
81
82AC_CONFIG_FILES([
83	Makefile
84	man/Makefile])
85AC_OUTPUT
86