configure.ac revision 00084f2c
1dnl 
2dnl  Copyright © 2003 Keith Packard, Noah Levitt
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 Keith Packard not be used in
9dnl  advertising or publicity pertaining to distribution of the software without
10dnl  specific, written prior permission.  Keith Packard 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  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16dnl  EVENT SHALL KEITH PACKARD 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.60])
25AC_INIT(libXau, 1.0.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],libXau)
26AM_INIT_AUTOMAKE([foreign dist-bzip2])
27AM_MAINTAINER_MODE
28
29AM_CONFIG_HEADER(config.h)
30
31# Require xorg-macros: XORG_DEFAULT_OPTIONS
32m4_ifndef([XORG_MACROS_VERSION],
33          [m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])])
34XORG_MACROS_VERSION(1.4)
35XORG_DEFAULT_OPTIONS
36
37AC_PROG_CC
38AC_PROG_INSTALL
39AC_PROG_LN_S
40AC_LIBTOOL_WIN32_DLL
41AM_PROG_LIBTOOL
42AC_PROG_MAKE_SET
43AC_PROG_SED
44
45PKG_CHECK_MODULES(XAU, xproto)
46
47AC_ARG_ENABLE(xthreads,
48              AC_HELP_STRING([--disable-xthreads],
49                [Disable libXau support for Multithreading]),
50              [xthreads=$enableval],[xthreads=yes])
51
52if test "x$xthreads" = "xyes" ; then
53    AC_DEFINE(XTHREADS,1,[Whether libXau is compiled with thread support])
54    AC_CHECK_LIB(c, gethostbyname_r, [mtsafe=yes])
55    if test "x$mtsafe" = "x" ; then
56	AC_CHECK_LIB(nsl, gethostbyname_r, [mtsafe=yes])
57    fi
58    if test "x$mtsafe" = "xyes" ; then
59	AC_DEFINE(XUSE_MTSAFE_API, 1, 
60		  [Whether libXau needs to use MT safe API's])
61    fi
62
63dnl XXX incomplete, please fill this in
64    case $host_os in
65    solaris*)
66	XTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" ;;
67    esac
68    XAU_CFLAGS="$XAU_CFLAGS $XTHREAD_CFLAGS"
69fi
70
71dnl Allow checking code with lint, sparse, etc.
72XORG_WITH_LINT
73XORG_LINT_LIBRARY([Xau])
74LINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}"
75
76
77AC_OUTPUT([Makefile
78           xau.pc])
79