Blame acinclude.m4

Packit Service af52df
dnl autoconf macros for libbytesize
Packit Service af52df
dnl
Packit Service af52df
dnl Copyright (C) 2014  Red Hat, Inc.
Packit Service af52df
dnl
Packit Service af52df
dnl This program is free software; you can redistribute it and/or modify
Packit Service af52df
dnl it under the terms of the GNU Lesser General Public License as published
Packit Service af52df
dnl by the Free Software Foundation; either version 2.1 of the License, or
Packit Service af52df
dnl (at your option) any later version.
Packit Service af52df
dnl
Packit Service af52df
dnl This program is distributed in the hope that it will be useful,
Packit Service af52df
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service af52df
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service af52df
dnl GNU Lesser General Public License for more details.
Packit Service af52df
dnl
Packit Service af52df
dnl You should have received a copy of the GNU Lesser General Public License
Packit Service af52df
dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service af52df
dnl
Packit Service af52df
dnl THIS IS A MODIFIED VERSION OF THE ANACONDA'S acinclude.m4 FILE.
Packit Service af52df
dnl
Packit Service af52df
dnl Author: David Shea <dshea@redhat.com>
Packit Service af52df
dnl         Vratislav Podzimek <vpodzime@redhat.com>
Packit Service af52df
Packit Service af52df
dnl LIBBYTESIZE_SOFT_FAILURE(MESSAGE)
Packit Service af52df
dnl
Packit Service af52df
dnl Store a message that in some contexts could be considered indicative
Packit Service af52df
dnl of a failure, but in other contexts could be indicative of who cares.
Packit Service af52df
dnl
Packit Service af52df
dnl Any message sent to this macro will be stored, and they can all be
Packit Service af52df
dnl displayed at the end of configure using the LIBBYTESIZE_FAILURES macro.
Packit Service af52df
AC_DEFUN([LIBBYTESIZE_SOFT_FAILURE], [dnl
Packit Service af52df
AS_IF([test x"$libbytesize_failure_messages" = x],
Packit Service af52df
    [libbytesize_failure_messages="[$1]"],
Packit Service af52df
    [libbytesize_failure_messages="$libbytesize_failure_messages
Packit Service af52df
[$1]"
Packit Service af52df
])])dnl
Packit Service af52df
Packit Service af52df
dnl LIBBYTESIZE_PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES)
Packit Service af52df
dnl
Packit Service af52df
dnl Check whether a module is available, using pkg-config. Instead of failing
Packit Service af52df
dnl if a module is not found, store the failure in a message that can be
Packit Service af52df
dnl printed using the LIBBYTESIZE_FAILURES macro.
Packit Service af52df
dnl
Packit Service af52df
dnl The syntax and behavior of VARIABLE-PREFIX and MODULES is the same as for
Packit Service af52df
dnl PKG_CHECK_MODULES.
Packit Service af52df
AC_DEFUN([LIBBYTESIZE_PKG_CHECK_MODULES], [dnl
Packit Service af52df
PKG_CHECK_MODULES([$1], [$2], [], [LIBBYTESIZE_SOFT_FAILURE($[$1]_PKG_ERRORS)])
Packit Service af52df
])dnl
Packit Service af52df
Packit Service af52df
dnl LIBBYTESIZE_PKG_CHECK_EXISTS(MODULES)
Packit Service af52df
dnl
Packit Service af52df
dnl Check whether a module exists, using pkg-config. Instead of failing
Packit Service af52df
dnl if a module is not found, store the failure in a message that can be
Packit Service af52df
dnl printed using the LIBBYTESIZE_FAILURES macro.
Packit Service af52df
dnl
Packit Service af52df
dnl The syntax and behavior of MODULES is the same as for
Packit Service af52df
dnl PKG_CHECK_EXISTS.
Packit Service af52df
AC_DEFUN([LIBBYTESIZE_PKG_CHECK_EXISTS], [dnl
Packit Service af52df
PKG_CHECK_EXISTS([$1], [], [LIBBYTESIZE_SOFT_FAILURE([Check for $1 failed])])
Packit Service af52df
])dnl
Packit Service af52df
Packit Service af52df
dnl LIBBYTESIZE_FAILURES
Packit Service af52df
dnl
Packit Service af52df
dnl Print the failure messages collected by LIBBYTESIZE_SOFT_FAILURE and
Packit Service af52df
dnl LIBBYTESIZE_PKG_CHECK_MODULES
Packit Service af52df
AC_DEFUN([LIBBYTESIZE_FAILURES], [dnl
Packit Service af52df
AS_IF([test x"$libbytesize_failure_messages" = x], [], [dnl
Packit Service af52df
echo ""
Packit Service af52df
echo "*** Libbytesize encountered the following issues during configuration:"
Packit Service af52df
echo "$libbytesize_failure_messages"
Packit Service af52df
echo ""
Packit Service af52df
echo "*** Libbytesize will not successfully build without these missing dependencies"
Packit Service af52df
])])dnl