configure.ac 2.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
dnl ***************************************************************************
dnl *** configure.ac for nxcompshad                                         ***
dnl ***************************************************************************

m4_define([nxcompshad_version], m4_esyscmd([tr -d '\n' < VERSION]))

# Initialize Autoconf
AC_PREREQ(2.60)

AC_INIT([libXcompshad], [nxcompshad_version], [https://github.com/ArcticaProject/nx-libs/issues])
AC_PROG_CXX
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])

17
AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-bzip2])
18 19 20 21 22 23 24

# Initialize libtool
AC_PROG_LIBTOOL

COMPSHAD_VERSION=nxcompshad_version
AC_SUBST([COMPSHAD_VERSION])

25
LT_COMPSHAD_VERSION=["$(printf '%s\n' "${COMPSHAD_VERSION}" | awk -F '.' '/^[0-9]+\.[0-9]+\.[0-9]+.*$/ { print $1 ":" $2 ":" $3; }')"]
26 27
AC_SUBST([LT_COMPSHAD_VERSION])

28 29 30
# Silence warning: ar: 'u' modifier ignored since 'D' is the default
AC_SUBST(AR_FLAGS, [cr])

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
PKG_CHECK_MODULES(Xext, xext)
PKG_CHECK_MODULES(Xdamage, xdamage)
PKG_CHECK_MODULES(Xrandr, xrandr)
PKG_CHECK_MODULES(Xtst, xtst)

# Upstream's pkg.m4 (since 0.27) offers this now, but define our own
# compatible version in case the local version of pkgconfig isn't new enough.
# https://bugs.freedesktop.org/show_bug.cgi?id=48743
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR],
         [AC_ARG_WITH([pkgconfigdir],
                      [AS_HELP_STRING([--with-pkgconfigdir],
                      [install directory for nxcompshad.pc pkg-config file])],
                       [],[with_pkgconfigdir='$(libdir)/pkgconfig'])
          AC_SUBST([pkgconfigdir], [${with_pkgconfigdir}])])

AC_LANG([C++])
NX_COMPILER_BRAND
48
NX_DEFAULT_OPTIONS
49

50 51
NX_TARGET_USE_ELF

52 53 54 55 56 57
AC_ARG_ENABLE([cxx11],
              [AS_HELP_STRING([--enable-cxx11],
                              [enable optional features requiring C++11 support (disabled by default)])],
              [AS_IF([test x$enableval = xyes],
                     [AX_CXX_COMPILE_STDCXX_11([], [mandatory])])])

58 59 60 61 62 63 64
AC_CONFIG_FILES([
Makefile
src/Makefile
nxcompshad.pc
])

AC_OUTPUT