configure.ac revision 4d939ec7
1c63293b5Smrg#
2c63293b5Smrg#  Copyright © 2003 Keith Packard
3c63293b5Smrg#
4c63293b5Smrg#  Permission to use, copy, modify, distribute, and sell this software and its
5c63293b5Smrg#  documentation for any purpose is hereby granted without fee, provided that
6c63293b5Smrg#  the above copyright notice appear in all copies and that both that
7c63293b5Smrg#  copyright notice and this permission notice appear in supporting
8c63293b5Smrg#  documentation, and that the name of Keith Packard not be used in
9c63293b5Smrg#  advertising or publicity pertaining to distribution of the software without
10c63293b5Smrg#  specific, written prior permission.  Keith Packard makes no
11c63293b5Smrg#  representations about the suitability of this software for any purpose.  It
12c63293b5Smrg#  is provided "as is" without express or implied warranty.
13c63293b5Smrg#
14c63293b5Smrg#  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15c63293b5Smrg#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16c63293b5Smrg#  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17c63293b5Smrg#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18c63293b5Smrg#  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19c63293b5Smrg#  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20c63293b5Smrg#  PERFORMANCE OF THIS SOFTWARE.
21c63293b5Smrg#
227914d74bSmrg
23c63293b5Smrg# Initialize Autoconf
24e8ead290SmrgAC_PREREQ([2.60])
25c63293b5Smrg#
26c63293b5Smrg# This is the package version number, not the shared library
27e6d5e4e0Smrg# version.  This version number will be substituted into Xcursor.h
28c63293b5Smrg#
294d939ec7SmrgAC_INIT([libXcursor], [1.2.1],
30cdce750aSmrg        [https://gitlab.freedesktop.org/xorg/lib/libXcursor/issues],[libXcursor])
317914d74bSmrgAC_CONFIG_SRCDIR([Makefile.am])
32e6d5e4e0SmrgAC_CONFIG_HEADERS([config.h include/X11/Xcursor/Xcursor.h])
339d0ccd10Smrg# Set common system defines for POSIX extensions, such as _GNU_SOURCE
349d0ccd10Smrg# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
359d0ccd10Smrg# to avoid autoconf errors.
369d0ccd10SmrgAC_USE_SYSTEM_EXTENSIONS
37c63293b5Smrg
38c63293b5Smrg# Initialize Automake
394d939ec7SmrgAM_INIT_AUTOMAKE([foreign dist-xz])
40c63293b5Smrg
41c63293b5Smrg# Initialize libtool
42c63293b5SmrgAC_PROG_LIBTOOL
437914d74bSmrg
44e8ead290Smrg# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
45e8ead290Smrgm4_ifndef([XORG_MACROS_VERSION],
46e8ead290Smrg          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
47e8ead290SmrgXORG_MACROS_VERSION(1.8)
48e8ead290SmrgXORG_DEFAULT_OPTIONS
497914d74bSmrg
50e6d5e4e0Smrg# Set library version for Xcursor.h from package version set in AC_INIT
51e6d5e4e0Smrg# copied from PACKAGE_VERSION_* settings in XORG_VERSION
52e6d5e4e0SmrgAC_DEFINE_UNQUOTED([XCURSOR_LIB_MAJOR],
53e6d5e4e0Smrg                   [`echo $PACKAGE_VERSION | cut -d . -f 1`],
54e6d5e4e0Smrg                   [Major version of libXcursor])
55e6d5e4e0SmrgAC_DEFINE_UNQUOTED([XCURSOR_LIB_MINOR],
56e6d5e4e0Smrg                   [`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`],
57e6d5e4e0Smrg                   [Minor version of libXcursor])
58e6d5e4e0SmrgAC_DEFINE_UNQUOTED([XCURSOR_LIB_REVISION],
59e6d5e4e0Smrg                   [`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`],
60e6d5e4e0Smrg                   [Micro revision of libXcursor])
61e6d5e4e0Smrg
62e6d5e4e0Smrg
637914d74bSmrgAC_ARG_WITH(icondir,
64c63293b5Smrg        AS_HELP_STRING([--with-icondir=<path>],
657914d74bSmrg                       [Set default icon directory (default: ${datadir}/icons)]),
667914d74bSmrg        [ICONDIR="$withval"],
677914d74bSmrg        [ICONDIR=${datadir}/icons])
687914d74bSmrgAC_SUBST([ICONDIR])
697914d74bSmrg
70cdce750aSmrgDEF_CURSORPATH="~/.local/share/icons:~/.icons:${datadir}/icons:${datadir}/pixmaps"
717914d74bSmrgif test "x${ICONDIR}" != "x${datadir}/icons"; then
727914d74bSmrg	DEF_CURSORPATH="${DEF_CURSORPATH}:${ICONDIR}"
737914d74bSmrgfi
747914d74bSmrgAC_ARG_WITH(cursorpath,
75c63293b5Smrg        AS_HELP_STRING([--with-cursorpath=<paths>],
767914d74bSmrg                       [Set default search path for cursors]),
777914d74bSmrg        [XCURSORPATH="$withval"],
787914d74bSmrg        [XCURSORPATH=$DEF_CURSORPATH])
797914d74bSmrgAC_SUBST([XCURSORPATH])
807914d74bSmrg
814d939ec7Smrg# Obtain compiler/linker options for dependencies
827914d74bSmrgPKG_CHECK_MODULES(XCURSOR, xrender >= 0.8.2 xfixes x11 fixesproto)
837914d74bSmrgAC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have Xfixes])
847914d74bSmrg
85c63293b5Smrg# Allow checking code with lint, sparse, etc.
867914d74bSmrgXORG_WITH_LINT
877914d74bSmrg
88c63293b5SmrgAC_CONFIG_FILES([Makefile
89c63293b5Smrg		src/Makefile
90c63293b5Smrg		man/Makefile
91c63293b5Smrg		xcursor.pc])
92c63293b5SmrgAC_OUTPUT
93