configure.ac revision 27702724
1dnl 
2dnl  $Id: configure.ac,v 1.1.1.1 2008/07/30 02:44:43 mrg Exp $
3dnl 
4dnl  Copyright © 2003 Keith Packard, Noah Levitt
5dnl 
6dnl  Permission to use, copy, modify, distribute, and sell this software and its
7dnl  documentation for any purpose is hereby granted without fee, provided that
8dnl  the above copyright notice appear in all copies and that both that
9dnl  copyright notice and this permission notice appear in supporting
10dnl  documentation, and that the name of Keith Packard not be used in
11dnl  advertising or publicity pertaining to distribution of the software without
12dnl  specific, written prior permission.  Keith Packard makes no
13dnl  representations about the suitability of this software for any purpose.  It
14dnl  is provided "as is" without express or implied warranty.
15dnl 
16dnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18dnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22dnl  PERFORMANCE OF THIS SOFTWARE.
23dnl
24dnl Process this file with autoconf to create configure.
25
26AC_PREREQ([2.57])
27AC_INIT(libXau, 1.0.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],libXau)
28AM_INIT_AUTOMAKE([dist-bzip2])
29AM_MAINTAINER_MODE
30
31AM_CONFIG_HEADER(config.h)
32
33# Require xorg-macros version 1.1.0 or newer for XORG_WITH_LINT macro
34m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
35XORG_MACROS_VERSION(1.1)
36
37AC_PROG_CC
38AC_PROG_INSTALL
39AC_PROG_LN_S
40AC_LIBTOOL_WIN32_DLL
41AM_PROG_LIBTOOL
42AC_PROG_MAKE_SET
43
44PKG_CHECK_MODULES(XAU, xproto)
45AC_SUBST(XAU_CFLAGS)
46AC_SUBST(XAU_LIBS)
47
48kerberos=false
49AM_CONDITIONAL(KERBEROS, test x$kerberos = xtrue)
50
51AC_ARG_ENABLE(xthreads,
52              AC_HELP_STRING([--disable-xthreads],
53                [Disable libXau support for Multithreading]),
54              [xthreads=$enableval],[xthreads=yes])
55
56if test "x$xthreads" = "xyes" ; then
57    AC_DEFINE(XTHREADS,1,[Whether libXau is compiled with thread support])
58    AC_CHECK_LIB(c, gethostbyname_r, AC_DEFINE(XUSE_MTSAFE_API,1,
59			[Whether libXau needs to use MT safe API's]))
60
61dnl XXX incomplete, please fill this in
62    case $host_os in
63    solaris*)
64	XTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" ;;
65    esac
66    XAU_CFLAGS="$XAU_CFLAGS $XTHREAD_CFLAGS"
67fi
68
69dnl Allow checking code with lint, sparse, etc.
70XORG_WITH_LINT
71XORG_LINT_LIBRARY([Xau])
72LINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}"
73
74if test "x$GCC" = "xyes"; then
75	GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \
76	-Wmissing-prototypes -Wmissing-declarations \
77	-Wnested-externs -fno-strict-aliasing"
78	XAU_CFLAGS="$GCC_WARNINGS $XAU_CFLAGS"
79fi
80
81XORG_MANPAGE_SECTIONS
82XORG_RELEASE_VERSION
83
84AC_OUTPUT([Makefile
85           xau.pc])
86