configure.ac revision e19dfac4
127702724Smrgdnl 
2e19dfac4Smrgdnl  $Id: configure.ac,v 1.1.1.2 2009/11/08 09:42:42 mrg Exp $
327702724Smrgdnl 
427702724Smrgdnl  Copyright © 2003 Keith Packard, Noah Levitt
527702724Smrgdnl 
627702724Smrgdnl  Permission to use, copy, modify, distribute, and sell this software and its
727702724Smrgdnl  documentation for any purpose is hereby granted without fee, provided that
827702724Smrgdnl  the above copyright notice appear in all copies and that both that
927702724Smrgdnl  copyright notice and this permission notice appear in supporting
1027702724Smrgdnl  documentation, and that the name of Keith Packard not be used in
1127702724Smrgdnl  advertising or publicity pertaining to distribution of the software without
1227702724Smrgdnl  specific, written prior permission.  Keith Packard makes no
1327702724Smrgdnl  representations about the suitability of this software for any purpose.  It
1427702724Smrgdnl  is provided "as is" without express or implied warranty.
1527702724Smrgdnl 
1627702724Smrgdnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1727702724Smrgdnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1827702724Smrgdnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1927702724Smrgdnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
2027702724Smrgdnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
2127702724Smrgdnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2227702724Smrgdnl  PERFORMANCE OF THIS SOFTWARE.
2327702724Smrgdnl
2427702724Smrgdnl Process this file with autoconf to create configure.
2527702724Smrg
2627702724SmrgAC_PREREQ([2.57])
27e19dfac4SmrgAC_INIT(libXau, 1.0.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],libXau)
2827702724SmrgAM_INIT_AUTOMAKE([dist-bzip2])
2927702724SmrgAM_MAINTAINER_MODE
3027702724Smrg
3127702724SmrgAM_CONFIG_HEADER(config.h)
3227702724Smrg
33e19dfac4Smrg# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG, XORG_WITH_LINT
34e19dfac4Smrgm4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
35e19dfac4SmrgXORG_MACROS_VERSION(1.2)
3627702724Smrg
3727702724SmrgAC_PROG_CC
3827702724SmrgAC_PROG_INSTALL
3927702724SmrgAC_PROG_LN_S
4027702724SmrgAC_LIBTOOL_WIN32_DLL
4127702724SmrgAM_PROG_LIBTOOL
4227702724SmrgAC_PROG_MAKE_SET
43e19dfac4SmrgXORG_CWARNFLAGS
4427702724Smrg
4527702724SmrgPKG_CHECK_MODULES(XAU, xproto)
46e19dfac4SmrgXAU_CFLAGS="$CWARNFLAGS $XAU_CFLAGS"
4727702724SmrgAC_SUBST(XAU_CFLAGS)
4827702724SmrgAC_SUBST(XAU_LIBS)
4927702724Smrg
5027702724SmrgAC_ARG_ENABLE(xthreads,
5127702724Smrg              AC_HELP_STRING([--disable-xthreads],
5227702724Smrg                [Disable libXau support for Multithreading]),
5327702724Smrg              [xthreads=$enableval],[xthreads=yes])
5427702724Smrg
5527702724Smrgif test "x$xthreads" = "xyes" ; then
5627702724Smrg    AC_DEFINE(XTHREADS,1,[Whether libXau is compiled with thread support])
57e19dfac4Smrg    AC_CHECK_LIB(c, gethostbyname_r, [mtsafe=yes])
58e19dfac4Smrg    if test "x$mtsafe" = "x" ; then
59e19dfac4Smrg	AC_CHECK_LIB(nsl, gethostbyname_r, [mtsafe=yes])
60e19dfac4Smrg    fi
61e19dfac4Smrg    if test "x$mtsafe" = "xyes" ; then
62e19dfac4Smrg	AC_DEFINE(XUSE_MTSAFE_API, 1, 
63e19dfac4Smrg		  [Whether libXau needs to use MT safe API's])
64e19dfac4Smrg    fi
6527702724Smrg
6627702724Smrgdnl XXX incomplete, please fill this in
6727702724Smrg    case $host_os in
6827702724Smrg    solaris*)
6927702724Smrg	XTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" ;;
7027702724Smrg    esac
7127702724Smrg    XAU_CFLAGS="$XAU_CFLAGS $XTHREAD_CFLAGS"
7227702724Smrgfi
7327702724Smrg
7427702724Smrgdnl Allow checking code with lint, sparse, etc.
7527702724SmrgXORG_WITH_LINT
7627702724SmrgXORG_LINT_LIBRARY([Xau])
7727702724SmrgLINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}"
7827702724Smrg
7927702724SmrgXORG_MANPAGE_SECTIONS
8027702724SmrgXORG_RELEASE_VERSION
81e19dfac4SmrgXORG_CHANGELOG
8227702724Smrg
8327702724SmrgAC_OUTPUT([Makefile
8427702724Smrg           xau.pc])
85