configure.ac revision b71ad168
1dnl Process this file with autoconf to create configure.
2
3# Initialize Autoconf
4AC_PREREQ([2.60])
5AC_INIT([xhost], [1.0.9],
6        [https://gitlab.freedesktop.org/xorg/app/xhost/-/issues], [xhost])
7AC_CONFIG_SRCDIR([Makefile.am])
8AC_CONFIG_HEADERS([config.h])
9
10# Initialize Automake
11AM_INIT_AUTOMAKE([foreign dist-xz])
12
13# Set common system defines for POSIX extensions, such as _GNU_SOURCE
14# Must be called before any macros that run the compiler (like
15# XORG_DEFAULT_OPTIONS) to avoid autoconf errors.
16AC_USE_SYSTEM_EXTENSIONS
17
18# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
19m4_ifndef([XORG_MACROS_VERSION],
20	  [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
21XORG_MACROS_VERSION(1.8)
22XORG_DEFAULT_OPTIONS
23
24# Checks for pkg-config packages
25# - Both CFLAGS & LIBS needed:
26PKG_CHECK_MODULES(XHOST, [xproto >= 7.0.22 x11 xmuu])
27# - Only CFLAGS needed, not libs:
28PKG_CHECK_MODULES(XAU, xau)
29
30# Transport selection macro from xtrans.m4
31XTRANS_CONNECTION_FLAGS
32
33# Secure RPC detection macro from xtrans.m4
34XTRANS_SECURE_RPC_FLAGS
35
36# Link with winsock if mingw target
37case $host_os in
38 *mingw*)
39  AC_CHECK_LIB([ws2_32],[main])
40  ;;
41 *)
42  ;;
43esac
44
45# Checks for library functions.
46AC_CHECK_FUNCS([inet_aton])
47
48# Internationalization & localization support
49AC_SEARCH_LIBS([gettext], [intl], [USE_GETTEXT="yes"], [USE_GETTEXT="no"])
50AC_MSG_CHECKING([where to install localized messages])
51AC_ARG_WITH([localedir], AS_HELP_STRING([--with-localedir=<path>],
52	[Path to install message files in (default: datadir/locale)]),
53	[LOCALEDIR=${withval}], [LOCALEDIR=${datadir}/locale])
54if test "x$LOCALEDIR" = "xno" -o "x$USE_GETTEXT" = "xno" ; then
55	AC_MSG_RESULT([nowhere])
56	USE_GETTEXT="no"
57else
58	AC_SUBST([LOCALEDIR])
59	AC_MSG_RESULT([$LOCALEDIR])
60fi
61
62if test "x$USE_GETTEXT" = "xyes" ; then
63	AC_DEFINE([USE_GETTEXT], 1,
64		  [Define to 1 if you want to use the gettext() function.])
65fi
66AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes")
67
68
69AC_CONFIG_FILES([
70	Makefile
71	man/Makefile])
72AC_OUTPUT
73