18771a6360cfda7a480a4a2e0da0b91e8e7c5f8a
[framework/uifw/xorg/lib/libxau.git] / configure.ac
1 dnl 
2 dnl  Copyright © 2003 Keith Packard, Noah Levitt
3 dnl 
4 dnl  Permission to use, copy, modify, distribute, and sell this software and its
5 dnl  documentation for any purpose is hereby granted without fee, provided that
6 dnl  the above copyright notice appear in all copies and that both that
7 dnl  copyright notice and this permission notice appear in supporting
8 dnl  documentation, and that the name of Keith Packard not be used in
9 dnl  advertising or publicity pertaining to distribution of the software without
10 dnl  specific, written prior permission.  Keith Packard makes no
11 dnl  representations about the suitability of this software for any purpose.  It
12 dnl  is provided "as is" without express or implied warranty.
13 dnl 
14 dnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 dnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 dnl  PERFORMANCE OF THIS SOFTWARE.
21 dnl
22 dnl Process this file with autoconf to create configure.
23
24 AC_PREREQ([2.60])
25 AC_INIT(libXau, 1.0.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],libXau)
26 AM_INIT_AUTOMAKE([foreign dist-bzip2])
27 AM_MAINTAINER_MODE
28
29 AM_CONFIG_HEADER(config.h)
30
31 # Require xorg-macros: XORG_DEFAULT_OPTIONS
32 m4_ifndef([XORG_MACROS_VERSION],
33           [m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])])
34 XORG_MACROS_VERSION(1.4)
35 XORG_DEFAULT_OPTIONS
36
37 AC_PROG_CC
38 AC_PROG_INSTALL
39 AC_PROG_LN_S
40 AC_LIBTOOL_WIN32_DLL
41 AM_PROG_LIBTOOL
42 AC_PROG_MAKE_SET
43 AC_PROG_SED
44
45 PKG_CHECK_MODULES(XAU, xproto)
46
47 AC_ARG_ENABLE(xthreads,
48               AC_HELP_STRING([--disable-xthreads],
49                 [Disable libXau support for Multithreading]),
50               [xthreads=$enableval],[xthreads=yes])
51
52 if 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
63 dnl 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"
69 fi
70
71 dnl Allow checking code with lint, sparse, etc.
72 XORG_WITH_LINT
73 XORG_LINT_LIBRARY([Xau])
74 LINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}"
75
76
77 AC_OUTPUT([Makefile
78            xau.pc])