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