configure.ac revision 95b7a5c8
1313a12fdSmrg# 2313a12fdSmrg# Copyright © 2003 Keith Packard, Noah Levitt 3313a12fdSmrg# 4313a12fdSmrg# Permission to use, copy, modify, distribute, and sell this software and its 5313a12fdSmrg# documentation for any purpose is hereby granted without fee, provided that 6313a12fdSmrg# the above copyright notice appear in all copies and that both that 7313a12fdSmrg# copyright notice and this permission notice appear in supporting 8313a12fdSmrg# documentation, and that the name of Keith Packard not be used in 9313a12fdSmrg# advertising or publicity pertaining to distribution of the software without 10313a12fdSmrg# specific, written prior permission. Keith Packard makes no 11313a12fdSmrg# representations about the suitability of this software for any purpose. It 12313a12fdSmrg# is provided "as is" without express or implied warranty. 13313a12fdSmrg# 14313a12fdSmrg# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 15313a12fdSmrg# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 16313a12fdSmrg# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR 17313a12fdSmrg# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 18313a12fdSmrg# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19313a12fdSmrg# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 20313a12fdSmrg# PERFORMANCE OF THIS SOFTWARE. 21313a12fdSmrg# 2227702724Smrg 23313a12fdSmrg# Initialize Autoconf 2400084f2cSmrgAC_PREREQ([2.60]) 2595b7a5c8SmrgAC_INIT([libXau], [1.0.10], 2695b7a5c8Smrg [https://gitlab.freedesktop.org/xorg/lib/libxau/-/issues], [libXau]) 27313a12fdSmrgAC_CONFIG_SRCDIR([Makefile.am]) 28313a12fdSmrgAC_CONFIG_HEADERS([config.h]) 29313a12fdSmrgAC_USE_SYSTEM_EXTENSIONS 30313a12fdSmrg 31313a12fdSmrg# Initialize Automake 3295b7a5c8SmrgAM_INIT_AUTOMAKE([foreign dist-xz]) 3327702724Smrg 34313a12fdSmrg# Initialize libtool 35313a12fdSmrgAC_LIBTOOL_WIN32_DLL 36313a12fdSmrgAC_PROG_LIBTOOL 3727702724Smrg 38313a12fdSmrg# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS 3900084f2cSmrgm4_ifndef([XORG_MACROS_VERSION], 40313a12fdSmrg [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) 41313a12fdSmrgXORG_MACROS_VERSION(1.8) 4200084f2cSmrgXORG_DEFAULT_OPTIONS 4327702724Smrg 44313a12fdSmrg# Checks for programs. 4527702724SmrgAC_PROG_LN_S 4627702724Smrg 47313a12fdSmrg# Checks for library functions. 4895b7a5c8SmrgAC_CHECK_FUNCS([explicit_bzero pathconf]) 49313a12fdSmrg 5095b7a5c8Smrg# Obtain compiler/linker options for dependencies 5127702724SmrgPKG_CHECK_MODULES(XAU, xproto) 5227702724Smrg 5327702724SmrgAC_ARG_ENABLE(xthreads, 54313a12fdSmrg AS_HELP_STRING([--disable-xthreads], 5527702724Smrg [Disable libXau support for Multithreading]), 5627702724Smrg [xthreads=$enableval],[xthreads=yes]) 5727702724Smrg 5827702724Smrgif test "x$xthreads" = "xyes" ; then 5927702724Smrg AC_DEFINE(XTHREADS,1,[Whether libXau is compiled with thread support]) 60e19dfac4Smrg AC_CHECK_LIB(c, gethostbyname_r, [mtsafe=yes]) 61e19dfac4Smrg if test "x$mtsafe" = "x" ; then 62e19dfac4Smrg AC_CHECK_LIB(nsl, gethostbyname_r, [mtsafe=yes]) 63e19dfac4Smrg fi 64e19dfac4Smrg if test "x$mtsafe" = "xyes" ; then 65313a12fdSmrg AC_DEFINE(XUSE_MTSAFE_API, 1, 66e19dfac4Smrg [Whether libXau needs to use MT safe API's]) 67e19dfac4Smrg fi 6827702724Smrg 69313a12fdSmrg# XXX incomplete, please fill this in 7027702724Smrg case $host_os in 7127702724Smrg solaris*) 7227702724Smrg XTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" ;; 7327702724Smrg esac 7427702724Smrg XAU_CFLAGS="$XAU_CFLAGS $XTHREAD_CFLAGS" 7527702724Smrgfi 7627702724Smrg 77313a12fdSmrg# Allow checking code with lint, sparse, etc. 7827702724SmrgXORG_WITH_LINT 7927702724SmrgXORG_LINT_LIBRARY([Xau]) 8027702724SmrgLINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}" 8127702724Smrg 82313a12fdSmrgAC_CONFIG_FILES([Makefile 83313a12fdSmrg man/Makefile 84313a12fdSmrg xau.pc]) 85313a12fdSmrgAC_OUTPUT 86