|
Packit Service |
6dc6e9 |
dnl
|
|
Packit Service |
6dc6e9 |
define([AC_INIT_NOTICE],
|
|
Packit Service |
6dc6e9 |
[### Generated automatically using autoconf version] AC_ACVERSION [
|
|
Packit Service |
6dc6e9 |
### Copyright 2009-2017 Steve Grubb <sgrubb@redhat.com>
|
|
Packit Service |
6dc6e9 |
###
|
|
Packit Service |
6dc6e9 |
### Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit Service |
6dc6e9 |
### copy of this software and associated documentation files (the "Software"),
|
|
Packit Service |
6dc6e9 |
### to deal in the Software without restriction, including without limitation
|
|
Packit Service |
6dc6e9 |
### the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
Packit Service |
6dc6e9 |
### and/or sell copies of the Software, and to permit persons to whom the
|
|
Packit Service |
6dc6e9 |
### Software is furnished to do so, subject to the following conditions:
|
|
Packit Service |
6dc6e9 |
###
|
|
Packit Service |
6dc6e9 |
### The above copyright notice and this permission notice shall be included
|
|
Packit Service |
6dc6e9 |
### in all copies or substantial portions of the Software.
|
|
Packit Service |
6dc6e9 |
###
|
|
Packit Service |
6dc6e9 |
### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit Service |
6dc6e9 |
### IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit Service |
6dc6e9 |
### FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
Packit Service |
6dc6e9 |
### THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
Packit Service |
6dc6e9 |
### OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
Packit Service |
6dc6e9 |
### ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
Packit Service |
6dc6e9 |
### OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit Service |
6dc6e9 |
###
|
|
Packit Service |
6dc6e9 |
### For usage, run `./configure --help'
|
|
Packit Service |
6dc6e9 |
### For more detailed information on installation, read the file `INSTALL'.
|
|
Packit Service |
6dc6e9 |
###
|
|
Packit Service |
6dc6e9 |
### If configuration succeeds, status is in the file `config.status'.
|
|
Packit Service |
6dc6e9 |
### A log of configuration tests is in `config.log'.
|
|
Packit Service |
6dc6e9 |
])
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_REVISION($Revision: 1.3 $)dnl
|
|
Packit Service |
6dc6e9 |
AC_INIT(libcap-ng,0.7.9)
|
|
Packit Service |
6dc6e9 |
AC_PREREQ(2.12)dnl
|
|
Packit Service |
6dc6e9 |
AM_CONFIG_HEADER(config.h)
|
|
Packit Service |
6dc6e9 |
AC_CONFIG_MACRO_DIR([m4])
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
echo Configuring libcap-ng $VERSION
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_CANONICAL_TARGET
|
|
Packit Service |
6dc6e9 |
AM_INIT_AUTOMAKE
|
|
Packit Service |
6dc6e9 |
AM_PROG_LIBTOOL
|
|
Packit Service |
6dc6e9 |
AC_SUBST(LIBTOOL_DEPS)
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
echo .
|
|
Packit Service |
6dc6e9 |
echo Checking for programs
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_PROG_CC
|
|
Packit Service |
6dc6e9 |
AC_PROG_INSTALL
|
|
Packit Service |
6dc6e9 |
AC_PROG_AWK
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
echo .
|
|
Packit Service |
6dc6e9 |
echo Checking for header files
|
|
Packit Service |
6dc6e9 |
AC_HEADER_STDC
|
|
Packit Service |
6dc6e9 |
AC_CHECK_HEADERS(linux/capability.h, [], [AC_MSG_ERROR(linux/capability.h is required in order to build libcap-ng.)])
|
|
Packit Service |
6dc6e9 |
AC_CHECK_HEADERS(sys/xattr.h, [], [
|
|
Packit Service |
6dc6e9 |
AC_CHECK_HEADERS(attr/xattr.h, [], [AC_MSG_WARN(attr/xattr.h not found, disabling file system capabilities.)])
|
|
Packit Service |
6dc6e9 |
])
|
|
Packit Service |
6dc6e9 |
AC_CHECK_HEADERS(linux/securebits.h, [], [])
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_C_CONST
|
|
Packit Service |
6dc6e9 |
AC_C_INLINE
|
|
Packit Service |
6dc6e9 |
AM_PROG_CC_C_O
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
ALLWARNS=""
|
|
Packit Service |
6dc6e9 |
ALLDEBUG="-g"
|
|
Packit Service |
6dc6e9 |
OPT="-O"
|
|
Packit Service |
6dc6e9 |
if test x"$GCC" = x"yes"; then
|
|
Packit Service |
6dc6e9 |
OPT="-O2 -pipe"
|
|
Packit Service |
6dc6e9 |
case "$target" in
|
|
Packit Service |
6dc6e9 |
*linux*)
|
|
Packit Service |
6dc6e9 |
ALLWARNS="-W -Wall -Wundef -Wpointer-arith -Wcast-align \
|
|
Packit Service |
6dc6e9 |
-Wwrite-strings -Waggregate-return -Wstrict-prototypes \
|
|
Packit Service |
6dc6e9 |
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
|
|
Packit Service |
6dc6e9 |
-Wnested-externs -Winline -Wfloat-equal -Wchar-subscripts"
|
|
Packit Service |
6dc6e9 |
;;
|
|
Packit Service |
6dc6e9 |
esac
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
ALLDEBUG="-g"
|
|
Packit Service |
6dc6e9 |
AC_ARG_WITH(debug,
|
|
Packit Service |
6dc6e9 |
[ --with-debug turn on debugging [[default=no]]],
|
|
Packit Service |
6dc6e9 |
[
|
|
Packit Service |
6dc6e9 |
if test "x${withval}" = xyes; then
|
|
Packit Service |
6dc6e9 |
DEBUG="$ALLDEBUG"
|
|
Packit Service |
6dc6e9 |
OPT="-O"
|
|
Packit Service |
6dc6e9 |
AM_CONDITIONAL(DEBUG, true)
|
|
Packit Service |
6dc6e9 |
else
|
|
Packit Service |
6dc6e9 |
DEBUG="-DNDEBUG"
|
|
Packit Service |
6dc6e9 |
AM_CONDITIONAL(DEBUG, false)
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
],
|
|
Packit Service |
6dc6e9 |
[ DEBUG="-DNDEBUG"; AM_CONDITIONAL(DEBUG, false) ])
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_ARG_WITH(warn,
|
|
Packit Service |
6dc6e9 |
[ --with-warn turn on warnings [[default=yes]]],
|
|
Packit Service |
6dc6e9 |
[
|
|
Packit Service |
6dc6e9 |
if test "x${withval}" = xyes; then
|
|
Packit Service |
6dc6e9 |
WARNS="$ALLWARNS"
|
|
Packit Service |
6dc6e9 |
else
|
|
Packit Service |
6dc6e9 |
WARNS=""
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
],WARNS="$ALLWARNS")
|
|
Packit Service |
6dc6e9 |
AC_SUBST(DEBUG)
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_CHECK_HEADER(sys/syscall.h,
|
|
Packit Service |
6dc6e9 |
[AC_DEFINE([HAVE_SYSCALL_H], [1],
|
|
Packit Service |
6dc6e9 |
[Define to 1 if you have <sys/syscall.h>.])], [],)
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_CHECK_PROG(swig_found, swig, yes, no)
|
|
Packit Service |
6dc6e9 |
if test x"${swig_found}" = x"no" ; then
|
|
Packit Service |
6dc6e9 |
AC_MSG_WARN("Swig not found - python bindings will not be made")
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
AM_CONDITIONAL(HAVE_SWIG, test x"${swig_found}" = x"yes")
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_MSG_CHECKING(whether to create python bindings)
|
|
Packit Service |
6dc6e9 |
AC_ARG_WITH(python,
|
|
Packit Service |
6dc6e9 |
AS_HELP_STRING([--with-python],[enable building python bindings]),
|
|
Packit Service |
6dc6e9 |
use_python=$withval,
|
|
Packit Service |
6dc6e9 |
use_python=auto)
|
|
Packit Service |
6dc6e9 |
if test x$use_python = xno ; then
|
|
Packit Service |
6dc6e9 |
python_found="no"
|
|
Packit Service |
6dc6e9 |
AC_MSG_RESULT(no)
|
|
Packit Service |
6dc6e9 |
else
|
|
Packit Service |
6dc6e9 |
AC_MSG_RESULT(testing)
|
|
Packit Service |
6dc6e9 |
AM_PATH_PYTHON
|
|
Packit Service |
6dc6e9 |
PYINCLUDEDIR=`python${am_cv_python_version} -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"`
|
|
Packit Service |
6dc6e9 |
if test -f ${PYINCLUDEDIR}/Python.h ; then
|
|
Packit Service |
6dc6e9 |
python_found="yes"
|
|
Packit Service |
6dc6e9 |
AC_SUBST(PYINCLUDEDIR)
|
|
Packit Service |
6dc6e9 |
pybind_dir="python"
|
|
Packit Service |
6dc6e9 |
AC_SUBST(pybind_dir)
|
|
Packit Service |
6dc6e9 |
AC_MSG_NOTICE(Python bindings will be built)
|
|
Packit Service |
6dc6e9 |
else
|
|
Packit Service |
6dc6e9 |
python_found="no"
|
|
Packit Service |
6dc6e9 |
if test x$use_python = xyes ; then
|
|
Packit Service |
6dc6e9 |
AC_MSG_ERROR([Python explicitly requested and python headers were not found])
|
|
Packit Service |
6dc6e9 |
else
|
|
Packit Service |
6dc6e9 |
AC_MSG_WARN("Python headers not found - python bindings will not be made")
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes")
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
withval=""
|
|
Packit Service |
6dc6e9 |
AC_MSG_CHECKING(whether to create python3 bindings)
|
|
Packit Service |
6dc6e9 |
AC_ARG_WITH(python3,
|
|
Packit Service |
6dc6e9 |
AS_HELP_STRING([--with-python3],[enable building python3 bindings]),
|
|
Packit Service |
6dc6e9 |
use_python3=$withval,
|
|
Packit Service |
6dc6e9 |
use_python3=auto)
|
|
Packit Service |
6dc6e9 |
if test x$use_python3 = xno ; then
|
|
Packit Service |
6dc6e9 |
AC_MSG_RESULT(no)
|
|
Packit Service |
6dc6e9 |
else
|
|
Packit Service |
6dc6e9 |
AC_MSG_RESULT(investigating)
|
|
Packit Service |
6dc6e9 |
AC_PATH_PROG([use_python3], [python3-config], [no])
|
|
Packit Service |
6dc6e9 |
if test ${use_python3} = no ; then
|
|
Packit Service |
6dc6e9 |
if test ${withval} = yes ; then
|
|
Packit Service |
6dc6e9 |
echo "Python3 bindings were selected but python3-config was not found."
|
|
Packit Service |
6dc6e9 |
echo "Please ensure that it's installed or pass --without-python3 to ./configure"
|
|
Packit Service |
6dc6e9 |
exit 1
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
echo "Python3 bindings will NOT be built"
|
|
Packit Service |
6dc6e9 |
else
|
|
Packit Service |
6dc6e9 |
echo "Python3 bindings WILL be built"
|
|
Packit Service |
6dc6e9 |
use_python3=yes
|
|
Packit Service |
6dc6e9 |
AC_PATH_PROG([PYTHON3], [python3], [no])
|
|
Packit Service |
6dc6e9 |
if test "x$PYTHON3" == "xno" ; then
|
|
Packit Service |
6dc6e9 |
echo "The python3 program was not found in the search path. Please ensure"
|
|
Packit Service |
6dc6e9 |
echo "that it is installed and its directory is included in the search path or"
|
|
Packit Service |
6dc6e9 |
echo "pass --without-python3 to ./configure."
|
|
Packit Service |
6dc6e9 |
exit 1
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
PYTHON3_CFLAGS=`python3-config --cflags 2> /dev/null`
|
|
Packit Service |
6dc6e9 |
PYTHON3_LIBS=`python3-config --libs 2> /dev/null`
|
|
Packit Service |
6dc6e9 |
PYTHON3_INCLUDES=`python3-config --includes 2> /dev/null`
|
|
Packit Service |
6dc6e9 |
AC_SUBST([PYTHON3_PREFIX], ['${prefix}'])
|
|
Packit Service |
6dc6e9 |
AC_SUBST([PYTHON3_EXEC_PREFIX], ['${exec_prefix}'])
|
|
Packit Service |
6dc6e9 |
PYTHON3_DIR=`$PYTHON3 -c "import distutils.sysconfig; \
|
|
Packit Service |
6dc6e9 |
print(distutils.sysconfig.get_python_lib(0,0,prefix='$PYTHON3_PREFIX'))"`
|
|
Packit Service |
6dc6e9 |
PYTHON3_EXECDIR=`$PYTHON3 -c "import distutils.sysconfig; \
|
|
Packit Service |
6dc6e9 |
print(distutils.sysconfig.get_python_lib(1,0,prefix='$PYTHON3_EXEC_PREFIX'))"`
|
|
Packit Service |
6dc6e9 |
AC_SUBST(PYTHON3_CFLAGS)
|
|
Packit Service |
6dc6e9 |
AC_SUBST(PYTHON3_LIBS)
|
|
Packit Service |
6dc6e9 |
AC_SUBST(PYTHON3_INCLUDES)
|
|
Packit Service |
6dc6e9 |
AC_SUBST(python3dir, $PYTHON3_DIR)
|
|
Packit Service |
6dc6e9 |
AC_SUBST(py3execdir, $PYTHON3_EXECDIR)
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
fi
|
|
Packit Service |
6dc6e9 |
AM_CONDITIONAL(USE_PYTHON3, test ${use_python3} = "yes")
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
AC_OUTPUT(Makefile src/Makefile src/libcap-ng.pc src/test/Makefile
|
|
Packit Service |
6dc6e9 |
bindings/Makefile bindings/python/Makefile
|
|
Packit Service |
6dc6e9 |
bindings/python3/Makefile bindings/src/Makefile
|
|
Packit Service |
6dc6e9 |
bindings/python/test/Makefile utils/Makefile
|
|
Packit Service |
6dc6e9 |
m4/Makefile docs/Makefile)
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
echo .
|
|
Packit Service |
6dc6e9 |
echo "
|
|
Packit Service |
6dc6e9 |
|
|
Packit Service |
6dc6e9 |
libcap-ng Version: $VERSION
|
|
Packit Service |
6dc6e9 |
Target: $target
|
|
Packit Service |
6dc6e9 |
Installation prefix: $prefix
|
|
Packit Service |
6dc6e9 |
Compiler: $CC
|
|
Packit Service |
6dc6e9 |
Compiler flags:
|
|
Packit Service |
6dc6e9 |
`echo $CFLAGS | fmt -w 50 | sed 's,^, ,'`
|
|
Packit Service |
6dc6e9 |
"
|