1dnl  Copyright 2005 Red Hat, Inc.
2dnl 
3dnl  Permission to use, copy, modify, distribute, and sell this software and its
4dnl  documentation for any purpose is hereby granted without fee, provided that
5dnl  the above copyright notice appear in all copies and that both that
6dnl  copyright notice and this permission notice appear in supporting
7dnl  documentation, and that the name of Red Hat not be used in
8dnl  advertising or publicity pertaining to distribution of the software without
9dnl  specific, written prior permission.  Red Hat makes no
10dnl  representations about the suitability of this software for any purpose.  It
11dnl  is provided "as is" without express or implied warranty.
12dnl 
13dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19dnl  PERFORMANCE OF THIS SOFTWARE.
20dnl
21dnl Process this file with autoconf to create configure.
22
23# Initialize Autoconf
24AC_PREREQ([2.60])
25AC_INIT([lndir], [1.0.5],
26	[https://gitlab.freedesktop.org/xorg/util/lndir/-/issues], [lndir])
27AC_CONFIG_SRCDIR([Makefile.am])
28AC_CONFIG_HEADERS([config.h])
29AC_USE_SYSTEM_EXTENSIONS
30
31# Initialize Automake
32AM_INIT_AUTOMAKE([foreign dist-xz])
33
34# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
35m4_ifndef([XORG_MACROS_VERSION],
36	  [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
37XORG_MACROS_VERSION(1.8)
38XORG_DEFAULT_OPTIONS
39
40# Avoid stat() failures if a file has a size that doesn't fit in 32-bits
41AC_SYS_LARGEFILE
42
43# Checks for pkg-config packages
44PKG_CHECK_MODULES(XPROTO, xproto >= 7.0.17)
45
46# Checks for non-standard functions and fallback to libbsd if we can
47AC_LINK_IFELSE([AC_LANG_CALL([], [strlcpy])],
48               [TRY_LIBBSD="no"], [TRY_LIBBSD="yes"])
49AS_IF([test "x$TRY_LIBBSD" = "xyes"],
50      [PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay],
51          [CFLAGS="$CFLAGS $LIBBSD_CFLAGS" ; LIBS="$LIBS $LIBBSD_LIBS"], [:])])
52AC_CHECK_FUNCS([strlcat strlcpy])
53
54AC_CONFIG_FILES([Makefile])
55AC_OUTPUT
56