1e9554658Smrg
2e9554658Smrgdnl  Copyright 2005 Red Hat, Inc.
3c2b339b4Smrgdnl
4e9554658Smrgdnl  Permission to use, copy, modify, distribute, and sell this software and its
5e9554658Smrgdnl  documentation for any purpose is hereby granted without fee, provided that
6e9554658Smrgdnl  the above copyright notice appear in all copies and that both that
7e9554658Smrgdnl  copyright notice and this permission notice appear in supporting
8e9554658Smrgdnl  documentation, and that the name of Red Hat not be used in
9e9554658Smrgdnl  advertising or publicity pertaining to distribution of the software without
10e9554658Smrgdnl  specific, written prior permission.  Red Hat makes no
11e9554658Smrgdnl  representations about the suitability of this software for any purpose.  It
12e9554658Smrgdnl  is provided "as is" without express or implied warranty.
13c2b339b4Smrgdnl
14e9554658Smrgdnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15e9554658Smrgdnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16e9554658Smrgdnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17e9554658Smrgdnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18e9554658Smrgdnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19e9554658Smrgdnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20e9554658Smrgdnl  PERFORMANCE OF THIS SOFTWARE.
21e9554658Smrgdnl
22e9554658Smrgdnl Process this file with autoconf to create configure.
23e9554658Smrg
24688b3aecSmrg# Initialize Autoconf
258903d43aSmrgAC_PREREQ([2.60])
268903d43aSmrgAC_INIT([xclock],
2714bc0770Smrg	[1.1.1],
28688b3aecSmrg	[https://gitlab.freedesktop.org/xorg/app/xclock/issues],
298903d43aSmrg	[xclock])
30688b3aecSmrgAC_CONFIG_SRCDIR([Makefile.am])
31688b3aecSmrgAC_CONFIG_HEADERS([config.h])
32688b3aecSmrg
33688b3aecSmrg# Initialize Automake
3414bc0770SmrgAM_INIT_AUTOMAKE([foreign dist-xz])
35e9554658Smrg
368903d43aSmrg# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
378903d43aSmrgm4_ifndef([XORG_MACROS_VERSION],
388903d43aSmrg          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
398903d43aSmrgXORG_MACROS_VERSION(1.8)
408903d43aSmrgXORG_DEFAULT_OPTIONS
41c2b339b4Smrg
42688b3aecSmrgAC_CHECK_FUNCS([strlcpy getpid nl_langinfo])
43e9554658Smrg
44309c398aSmrgAM_ICONV
45e9554658Smrg
46e9554658Smrgdnl Required dependencies
475dd5f640SmrgPKG_CHECK_MODULES(XCLOCK, [xaw7 xmu x11 xproto >= 7.0.17])
48309c398aSmrgXCLOCK_LIBS="$XCLOCK_LIBS $LIBICONV"
49e9554658Smrg
50e9554658Smrgdnl Optional dependencies
51309c398aSmrgAC_ARG_WITH(xft, AS_HELP_STRING([--with-xft],[Use Xft2 and Xrender for rendering (Default is YES)]),use_xft="$withval",use_xft="try")
52e9554658Smrgif test x$use_xft != xno ; then
53e9554658Smrg	PKG_CHECK_MODULES(XFT, [xrender xft])
5414bc0770Smrg	# Solaris 11 has sqrt in libc but needs libm for sincos
55e9554658Smrg	AC_SEARCH_LIBS(sqrt, [m])
5614bc0770Smrg	AC_SEARCH_LIBS(sincos, [m],
5714bc0770Smrg            AC_DEFINE([HAVE_SINCOS], [1],
5814bc0770Smrg                      [Define to 1 if you have the `sincos' function.]))
59e9554658Smrg	XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XFT_CFLAGS"
60e9554658Smrg	XCLOCK_LIBS="$XCLOCK_LIBS $XFT_LIBS"
61e9554658Smrg	AC_DEFINE([XRENDER],1,[Define to use X Render Extension])
62e9554658Smrg	AC_DEFINE([XFREE86_FT2],1,[Define to use Xft2 library])
63c2b339b4Smrgfi
64e9554658Smrg
65309c398aSmrgAC_ARG_WITH(xkb, AS_HELP_STRING([--with-xkb],[Use XKB to sound bells (Default is YES)]),use_xkb="$withval",use_xkb="try")
66e9554658Smrgif test x$use_xkb != xno ; then
67e9554658Smrg	PKG_CHECK_MODULES(XKB, xkbfile)
68e9554658Smrg	XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XKB_CFLAGS"
69e9554658Smrg	XCLOCK_LIBS="$XCLOCK_LIBS $XKB_LIBS"
70e9554658Smrg	AC_DEFINE([XKB],1,[Define to use XkbStdBell])
71e9554658Smrgfi
72e9554658Smrg
73e9554658Smrg
74e9554658SmrgPKG_CHECK_MODULES(APPDEFS, xt)
758903d43aSmrgxt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`
76c2b339b4SmrgAC_ARG_WITH(appdefaultdir,
77309c398aSmrg	AS_HELP_STRING([--with-appdefaultdir=<pathname>],
78c2b339b4Smrg	  [specify directory for app-defaults files (default is autodetected)]),
79c2b339b4Smrg	[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
80e9554658SmrgAC_SUBST(appdefaultdir)
81e9554658Smrg
82309c398aSmrgAC_CONFIG_FILES([
83309c398aSmrg	Makefile
84309c398aSmrg	man/Makefile])
85309c398aSmrgAC_OUTPUT
86