configure.ac revision 0ea508b1
1#
2#  Copyright © 2003 Keith Packard
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])
25#
26# This is the package version number, not the shared library
27# version.  This version number will be substituted into Xcursor.h
28#
29AC_INIT([libXcursor], [1.2.2],
30        [https://gitlab.freedesktop.org/xorg/lib/libxcursor/-/issues],
31        [libXcursor])
32AC_CONFIG_SRCDIR([Makefile.am])
33AC_CONFIG_HEADERS([config.h include/X11/Xcursor/Xcursor.h])
34AC_CONFIG_MACRO_DIRS([m4])
35
36# Set common system defines for POSIX extensions, such as _GNU_SOURCE
37# Must be called before any macros that run the compiler (like LT_INIT)
38# to avoid autoconf errors.
39AC_USE_SYSTEM_EXTENSIONS
40
41# Initialize Automake
42AM_INIT_AUTOMAKE([foreign dist-xz])
43
44# Initialize libtool
45LT_INIT
46
47# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
48m4_ifndef([XORG_MACROS_VERSION],
49          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
50XORG_MACROS_VERSION(1.8)
51XORG_DEFAULT_OPTIONS
52
53# Set library version for Xcursor.h from package version set in AC_INIT
54# copied from PACKAGE_VERSION_* settings in XORG_VERSION
55AC_DEFINE_UNQUOTED([XCURSOR_LIB_MAJOR],
56                   [`echo $PACKAGE_VERSION | cut -d . -f 1`],
57                   [Major version of libXcursor])
58AC_DEFINE_UNQUOTED([XCURSOR_LIB_MINOR],
59                   [`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`],
60                   [Minor version of libXcursor])
61AC_DEFINE_UNQUOTED([XCURSOR_LIB_REVISION],
62                   [`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`],
63                   [Micro revision of libXcursor])
64
65
66AC_ARG_WITH(icondir,
67        AS_HELP_STRING([--with-icondir=<path>],
68                       [Set default icon directory (default: ${datadir}/icons)]),
69        [ICONDIR="$withval"],
70        [ICONDIR=${datadir}/icons])
71AC_SUBST([ICONDIR])
72
73DEF_CURSORPATH="~/.local/share/icons:~/.icons:${datadir}/icons:${datadir}/pixmaps"
74if test "x${ICONDIR}" != "x${datadir}/icons"; then
75	DEF_CURSORPATH="${DEF_CURSORPATH}:${ICONDIR}"
76fi
77AC_ARG_WITH(cursorpath,
78        AS_HELP_STRING([--with-cursorpath=<paths>],
79                       [Set default search path for cursors]),
80        [XCURSORPATH="$withval"],
81        [XCURSORPATH=$DEF_CURSORPATH])
82AC_SUBST([XCURSORPATH])
83
84# Obtain compiler/linker options for dependencies
85PKG_CHECK_MODULES(XCURSOR, xrender >= 0.8.2 xfixes x11 fixesproto)
86AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have Xfixes])
87
88# Allow checking code with lint, sparse, etc.
89XORG_WITH_LINT
90
91AC_CONFIG_FILES([Makefile
92		src/Makefile
93		man/Makefile
94		xcursor.pc])
95AC_OUTPUT
96