Blame configure.ac

Packit 56e0ee
#
Packit 56e0ee
#  Copyright © 2003 Keith Packard, Noah Levitt
Packit 56e0ee
#
Packit 56e0ee
#  Permission to use, copy, modify, distribute, and sell this software and its
Packit 56e0ee
#  documentation for any purpose is hereby granted without fee, provided that
Packit 56e0ee
#  the above copyright notice appear in all copies and that both that
Packit 56e0ee
#  copyright notice and this permission notice appear in supporting
Packit 56e0ee
#  documentation, and that the name of Keith Packard not be used in
Packit 56e0ee
#  advertising or publicity pertaining to distribution of the software without
Packit 56e0ee
#  specific, written prior permission.  Keith Packard makes no
Packit 56e0ee
#  representations about the suitability of this software for any purpose.  It
Packit 56e0ee
#  is provided "as is" without express or implied warranty.
Packit 56e0ee
#
Packit 56e0ee
#  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
Packit 56e0ee
#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
Packit 56e0ee
#  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Packit 56e0ee
#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
Packit 56e0ee
#  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
Packit 56e0ee
#  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
Packit 56e0ee
#  PERFORMANCE OF THIS SOFTWARE.
Packit 56e0ee
#
Packit 56e0ee
Packit 56e0ee
# Initialize Autoconf
Packit 56e0ee
AC_PREREQ([2.60])
Packit 56e0ee
AC_INIT([libXau], [1.0.9],
Packit 56e0ee
	[https://gitlab.freedesktop.org/xorg/lib/libXau/issues], [libXau])
Packit 56e0ee
AC_CONFIG_SRCDIR([Makefile.am])
Packit 56e0ee
AC_CONFIG_HEADERS([config.h])
Packit 56e0ee
AC_USE_SYSTEM_EXTENSIONS
Packit 56e0ee
Packit 56e0ee
# Initialize Automake
Packit 56e0ee
AM_INIT_AUTOMAKE([foreign dist-bzip2])
Packit 56e0ee
Packit 56e0ee
# Initialize libtool
Packit 56e0ee
AC_LIBTOOL_WIN32_DLL
Packit 56e0ee
AC_PROG_LIBTOOL
Packit 56e0ee
Packit 56e0ee
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
Packit 56e0ee
m4_ifndef([XORG_MACROS_VERSION],
Packit 56e0ee
          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
Packit 56e0ee
XORG_MACROS_VERSION(1.8)
Packit 56e0ee
XORG_DEFAULT_OPTIONS
Packit 56e0ee
Packit 56e0ee
# Checks for programs.
Packit 56e0ee
AC_PROG_LN_S
Packit 56e0ee
Packit 56e0ee
# Checks for library functions.
Packit 56e0ee
AC_CHECK_FUNCS([pathconf])
Packit 56e0ee
Packit 56e0ee
# Obtain compiler/linker options for depedencies
Packit 56e0ee
PKG_CHECK_MODULES(XAU, xproto)
Packit 56e0ee
Packit 56e0ee
AC_ARG_ENABLE(xthreads,
Packit 56e0ee
              AS_HELP_STRING([--disable-xthreads],
Packit 56e0ee
                [Disable libXau support for Multithreading]),
Packit 56e0ee
              [xthreads=$enableval],[xthreads=yes])
Packit 56e0ee
Packit 56e0ee
if test "x$xthreads" = "xyes" ; then
Packit 56e0ee
    AC_DEFINE(XTHREADS,1,[Whether libXau is compiled with thread support])
Packit 56e0ee
    AC_CHECK_LIB(c, gethostbyname_r, [mtsafe=yes])
Packit 56e0ee
    if test "x$mtsafe" = "x" ; then
Packit 56e0ee
	AC_CHECK_LIB(nsl, gethostbyname_r, [mtsafe=yes])
Packit 56e0ee
    fi
Packit 56e0ee
    if test "x$mtsafe" = "xyes" ; then
Packit 56e0ee
	AC_DEFINE(XUSE_MTSAFE_API, 1,
Packit 56e0ee
		  [Whether libXau needs to use MT safe API's])
Packit 56e0ee
    fi
Packit 56e0ee
Packit 56e0ee
# XXX incomplete, please fill this in
Packit 56e0ee
    case $host_os in
Packit 56e0ee
    solaris*)
Packit 56e0ee
	XTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" ;;
Packit 56e0ee
    esac
Packit 56e0ee
    XAU_CFLAGS="$XAU_CFLAGS $XTHREAD_CFLAGS"
Packit 56e0ee
fi
Packit 56e0ee
Packit 56e0ee
# Allow checking code with lint, sparse, etc.
Packit 56e0ee
XORG_WITH_LINT
Packit 56e0ee
XORG_LINT_LIBRARY([Xau])
Packit 56e0ee
LINT_FLAGS="${LINT_FLAGS} ${XAU_CFLAGS}"
Packit 56e0ee
Packit 56e0ee
AC_CONFIG_FILES([Makefile
Packit 56e0ee
		man/Makefile
Packit 56e0ee
		xau.pc])
Packit 56e0ee
AC_OUTPUT