configure.ac revision c2b339b4
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(xclock,[1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xclock)
26AM_INIT_AUTOMAKE([dist-bzip2])
27AM_MAINTAINER_MODE
28
29# Require xorg-macros: XORG_DEFAULT_OPTIONS
30m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])])
31XORG_MACROS_VERSION(1.3)
32
33AM_CONFIG_HEADER(config.h)
34
35AC_PROG_CC
36AC_PROG_INSTALL
37
38XORG_DEFAULT_OPTIONS
39
40AC_CHECK_FUNCS([strlcpy getpid])
41
42AC_SEARCH_LIBS([iconv], [iconv],
43	[AC_DEFINE(HAVE_ICONV, 1, [Define to 1 if iconv() is available.])])
44
45dnl Required dependencies
46PKG_CHECK_MODULES(XCLOCK_X11, x11)
47PKG_CHECK_MODULES(XAW, xaw7)
48XCLOCK_CFLAGS="$XCLOCK_X11_CFLAGS $XAW_CFLAGS"
49XCLOCK_LIBS="$XCLOCK_X11_LIBS $XAW_LIBS"
50
51dnl Optional dependencies
52AC_ARG_WITH(xft, AC_HELP_STRING([--with-xft],[Use Xft2 and Xrender for rendering (Default is YES)]),use_xft="$withval",use_xft="try")
53if test x$use_xft != xno ; then
54	PKG_CHECK_MODULES(XFT, [xrender xft])
55	AC_SEARCH_LIBS(sqrt, [m])
56	XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XFT_CFLAGS"
57	XCLOCK_LIBS="$XCLOCK_LIBS $XFT_LIBS"
58	AC_DEFINE([XRENDER],1,[Define to use X Render Extension])
59	AC_DEFINE([XFREE86_FT2],1,[Define to use Xft2 library])
60fi
61
62AC_ARG_WITH(xkb, AC_HELP_STRING([--with-xkb],[Use XKB to sound bells (Default is YES)]),use_xkb="$withval",use_xkb="try")
63if test x$use_xkb != xno ; then
64	PKG_CHECK_MODULES(XKB, xkbfile)
65	XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XKB_CFLAGS"
66	XCLOCK_LIBS="$XCLOCK_LIBS $XKB_LIBS"
67	AC_DEFINE([XKB],1,[Define to use XkbStdBell])
68fi
69
70AC_SUBST(XCLOCK_CFLAGS)
71AC_SUBST(XCLOCK_LIBS)
72
73PKG_CHECK_MODULES(APPDEFS, xt)
74xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
75AC_ARG_WITH(appdefaultdir,
76	AC_HELP_STRING([--with-appdefaultdir=<pathname>],
77	  [specify directory for app-defaults files (default is autodetected)]),
78	[appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
79AC_SUBST(appdefaultdir)
80
81AC_OUTPUT([Makefile])
82