configure.ac revision e08b657d
1# 2# Copyright © 2003 Keith Packard, Noah Levitt 3# 4# Permission to use, copy, modify, distribute, and sell this software and its 5# documentation for any purpose is hereby granted without fee, provided that 6# the above copyright notice appear in all copies and that both that 7# copyright notice and this permission notice appear in supporting 8# documentation, and that the name of Keith Packard not be used in 9# advertising or publicity pertaining to distribution of the software without 10# specific, written prior permission. Keith Packard makes no 11# representations about the suitability of this software for any purpose. It 12# is provided "as is" without express or implied warranty. 13# 14# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 15# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 16# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR 17# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 18# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 20# PERFORMANCE OF THIS SOFTWARE. 21# 22 23# Initialize Autoconf 24AC_PREREQ([2.60]) 25AC_INIT([libXdmcp], [1.1.5], 26 [https://gitlab.freedesktop.org/xorg/lib/libxdmcp/-/issues], [libXdmcp]) 27AC_CONFIG_SRCDIR([Makefile.am]) 28AC_CONFIG_HEADERS([config.h]) 29AC_CONFIG_MACRO_DIRS([m4]) 30 31# Set common system defines for POSIX extensions, such as _GNU_SOURCE 32# Must be called before any macros that run the compiler (like LT_INIT) 33# to avoid autoconf errors. 34AC_USE_SYSTEM_EXTENSIONS 35 36# Initialize Automake 37AM_INIT_AUTOMAKE([foreign dist-xz]) 38 39# Initialize libtool 40LT_INIT([win32-dll]) 41 42# Require xorg-macros minimum of 1.16 for unit testing with memory checks 43m4_ifndef([XORG_MACROS_VERSION], 44 [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])]) 45XORG_MACROS_VERSION(1.16) 46XORG_DEFAULT_OPTIONS 47XORG_ENABLE_DOCS 48XORG_WITH_XMLTO(0.0.22) 49XORG_WITH_FOP 50XORG_WITH_XSLTPROC 51XORG_CHECK_SGML_DOCTOOLS(1.8) 52 53# Checks for programs. 54AC_PROG_LN_S 55 56# Checks for header files. 57AC_CHECK_HEADERS([sys/random.h]) 58 59# Checks for libraries. 60AC_SEARCH_LIBS([recvfrom],[socket]) 61 62case $host_os in 63 *mingw*) 64 AC_CHECK_LIB([ws2_32],[main]) 65 ;; 66 *) 67 ;; 68esac 69 70# Checks for non-standard functions and fallback to libbsd if we can 71# We only check for arc4random_buf, because if we have that, we don't 72# need/use getentropy. 73AC_LINK_IFELSE([AC_LANG_CALL([], [arc4random_buf])], 74 [TRY_LIBBSD="no"], [TRY_LIBBSD="yes"]) 75AS_IF([test "x$TRY_LIBBSD" = "xyes"], 76 [PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay], [ 77 CFLAGS="$CFLAGS $LIBBSD_CFLAGS" 78 LIBS="$LIBS $LIBBSD_LIBS" 79], [:])]) 80 81# Checks for library functions. 82AC_CHECK_FUNCS([srand48 lrand48 arc4random_buf getentropy]) 83 84# Obtain compiler/linker options for dependencies 85PKG_CHECK_MODULES(XDMCP, xproto) 86 87if test -f ${srcdir}/Wraphelp.c; then 88 AC_DEFINE(HASXDMAUTH,1,[Has Wraphelp.c needed for XDM AUTH protocols]) 89 HASXDMAUTH=yes 90else 91 HASXDMAUTH=no 92fi 93 94AM_CONDITIONAL(HASXDMAUTH,test x$HASXDMAUTH = xyes) 95 96# Allow checking code with lint, sparse, etc. 97XORG_WITH_LINT 98XORG_LINT_LIBRARY([Xdmcp]) 99 100# --enable-unit-tests 101XORG_ENABLE_UNIT_TESTS([yes]) 102 103AC_CONFIG_FILES([Makefile 104 doc/Makefile 105 test/Makefile 106 xdmcp.pc]) 107AC_OUTPUT 108