2007-08-05 16:30:55 +08:00
|
|
|
AC_PREREQ(2.61)
|
2019-06-26 21:02:25 +08:00
|
|
|
AC_INIT(rpm, 4.15.90, rpm-maint@lists.rpm.org)
|
2007-08-06 20:46:11 +08:00
|
|
|
|
2019-06-03 18:44:24 +08:00
|
|
|
AC_CONFIG_SRCDIR([rpm.c])
|
2007-10-27 11:48:53 +08:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2008-11-18 18:23:26 +08:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2004-01-05 22:09:47 +08:00
|
|
|
|
2014-04-07 17:40:53 +08:00
|
|
|
AM_INIT_AUTOMAKE([1.10 foreign tar-pax dist-bzip2 subdir-objects nostdinc])
|
2012-03-09 18:16:11 +08:00
|
|
|
dnl Allow silent build on automake versions that support it
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
|
2004-01-05 22:09:47 +08:00
|
|
|
|
2007-08-20 18:31:28 +08:00
|
|
|
AC_CONFIG_TESTDIR(tests)
|
|
|
|
|
2007-11-21 23:51:57 +08:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2007-09-10 13:11:54 +08:00
|
|
|
|
2007-11-21 23:51:57 +08:00
|
|
|
AC_DISABLE_STATIC
|
2007-06-06 19:42:19 +08:00
|
|
|
|
2011-03-28 17:47:34 +08:00
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl Checks for programs.
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_AWK
|
1996-12-12 11:32:40 +08:00
|
|
|
AC_PROG_CC
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2007-06-06 19:42:19 +08:00
|
|
|
AC_PROG_LIBTOOL
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_PROG_YACC
|
|
|
|
|
2008-11-04 17:36:01 +08:00
|
|
|
AC_SUBST(__CC, $CC)
|
2008-04-28 18:53:35 +08:00
|
|
|
AC_PROG_CC_C99
|
|
|
|
if test "$ac_cv_prog_cc_c99" = no; then
|
|
|
|
AC_MSG_ERROR([ISO C99 capable compiler required])
|
|
|
|
fi
|
|
|
|
|
2001-08-01 02:13:22 +08:00
|
|
|
AS=${AS-as}
|
|
|
|
AC_SUBST(AS)
|
2007-08-27 22:16:12 +08:00
|
|
|
if test "$GCC" = yes; then
|
2009-09-07 23:41:32 +08:00
|
|
|
cflags_to_try="-fno-strict-aliasing -fstack-protector -Wempty-body"
|
2007-06-20 17:06:36 +08:00
|
|
|
AC_MSG_CHECKING([supported compiler flags])
|
|
|
|
old_cflags=$CFLAGS
|
|
|
|
echo
|
|
|
|
for flag in $cflags_to_try; do
|
2012-07-12 17:52:31 +08:00
|
|
|
CFLAGS="$CFLAGS $flag -Werror"
|
2016-12-08 16:07:09 +08:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[#include <alloca.h>
|
|
|
|
alloca(100);]])],[
|
2007-06-20 17:06:36 +08:00
|
|
|
echo " $flag"
|
|
|
|
RPMCFLAGS="$RPMCFLAGS $flag"
|
2007-10-27 12:28:06 +08:00
|
|
|
],[])
|
2007-06-20 17:06:36 +08:00
|
|
|
CFLAGS=$old_cflags
|
|
|
|
done
|
2018-02-19 21:14:28 +08:00
|
|
|
RPMCFLAGS="-D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes $RPMCFLAGS"
|
1998-10-08 18:40:27 +08:00
|
|
|
fi
|
2019-10-15 18:55:04 +08:00
|
|
|
AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror], [build with -Werror])],
|
|
|
|
[RPMCFLAGS="$RPMCFLAGS -Werror"], [])
|
2016-12-08 18:51:23 +08:00
|
|
|
AC_SUBST(RPMCFLAGS)
|
1998-10-08 18:40:27 +08:00
|
|
|
|
2002-11-20 02:40:21 +08:00
|
|
|
AC_SYS_LARGEFILE
|
2001-05-10 06:58:56 +08:00
|
|
|
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
|
|
|
dnl look for POSIX chmod attributes
|
|
|
|
dnl
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(POSIX chmod)
|
1997-01-17 01:23:44 +08:00
|
|
|
touch foo.chmodtest
|
|
|
|
chmod 744 foo.chmodtest
|
|
|
|
chmod +X foo.chmodtest 2>/dev/null
|
2009-12-02 21:30:27 +08:00
|
|
|
a=`ls -l foo.chmodtest | awk '{print substr($1,1,10)}'`
|
1997-01-17 01:23:44 +08:00
|
|
|
rm -f foo.chmodtest
|
|
|
|
if test "$a" = "-rwxr-xr-x"; then
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
2004-03-28 08:49:54 +08:00
|
|
|
FIXPERMS=a+rX,u+w,g-w,o-w
|
1997-01-17 01:23:44 +08:00
|
|
|
else
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(no (tell your OS vendor about GNU fileutils))
|
2004-03-28 08:49:54 +08:00
|
|
|
FIXPERMS=a+r,u+w,g-w,o-w
|
1997-01-17 01:23:44 +08:00
|
|
|
fi
|
1999-04-16 13:44:36 +08:00
|
|
|
AC_SUBST(FIXPERMS)
|
1997-01-17 01:23:44 +08:00
|
|
|
|
1999-07-16 06:26:15 +08:00
|
|
|
dnl AM_DISABLE_SHARED
|
1999-01-22 06:30:50 +08:00
|
|
|
AM_PROG_LIBTOOL
|
1996-12-12 11:32:40 +08:00
|
|
|
|
|
|
|
AC_CHECK_TOOL(AR, ar, :)
|
|
|
|
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
2002-05-17 00:55:21 +08:00
|
|
|
dnl use defaults if cross-compiling, otherwise use the default path.
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
2002-05-17 00:55:21 +08:00
|
|
|
if test "$cross_compiling" = "yes"; then
|
2005-01-30 00:05:03 +08:00
|
|
|
MYPATH=":"
|
2002-05-17 00:55:21 +08:00
|
|
|
else
|
|
|
|
MYPATH=$PATH
|
|
|
|
fi
|
1998-05-26 21:19:52 +08:00
|
|
|
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
|
|
|
dnl Find some common programs
|
|
|
|
dnl
|
2013-07-30 03:34:01 +08:00
|
|
|
AC_PATH_PROGS(__7ZIP, [7zip 7za 7z], /usr/bin/7za, $MYPATH)
|
2007-09-18 20:55:58 +08:00
|
|
|
AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
|
2007-09-12 18:42:59 +08:00
|
|
|
AC_PATH_PROG(__CURL, curl, /usr/bin/curl, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__FILE, file, /usr/bin/file, $MYPATH)
|
2016-11-22 22:21:08 +08:00
|
|
|
AC_PATH_PROGS(__GPG, gpg2 gpg, /usr/bin/gpg2, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__GREP, grep, /bin/grep, $MYPATH)
|
2007-09-18 20:55:58 +08:00
|
|
|
AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
|
|
|
|
AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
|
|
|
|
AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
|
2011-04-24 20:57:23 +08:00
|
|
|
AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH)
|
2011-04-24 20:56:11 +08:00
|
|
|
AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH)
|
2009-03-18 15:42:23 +08:00
|
|
|
AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH)
|
2015-11-05 21:29:21 +08:00
|
|
|
AC_PATH_PROG(__GEM, gem, /usr/bin/gem, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
|
|
|
|
AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
|
|
|
|
AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
|
|
|
|
AC_PATH_PROG(__PATCH, patch, /usr/bin/patch, $MYPATH)
|
2010-08-31 04:32:31 +08:00
|
|
|
AC_PATH_PROG(__RESTORECON, restorecon, /sbin/restorecon, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
|
|
|
|
AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
|
|
|
|
AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
|
2010-08-31 04:32:31 +08:00
|
|
|
AC_PATH_PROG(__SEMODULE, semodule, /usr/bin/semodule, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH)
|
|
|
|
AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH)
|
2017-08-09 22:42:56 +08:00
|
|
|
AC_PATH_PROG(__ZSTD, zstd, /usr/bin/zstd, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
|
|
|
|
AC_PATH_PROG(__LD, ld, /usr/bin/ld, $MYPATH)
|
|
|
|
AC_PATH_PROG(__NM, nm, /usr/bin/nm, $MYPATH)
|
|
|
|
AC_PATH_PROG(__OBJCOPY, objcopy, /usr/bin/objcopy, $MYPATH)
|
|
|
|
AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
|
|
|
|
AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
|
2011-04-04 19:31:17 +08:00
|
|
|
|
2012-06-21 18:45:13 +08:00
|
|
|
AC_PATH_PROG(__GIT, git, /usr/bin/git, $MYPATH)
|
|
|
|
AC_PATH_PROG(__HG, hg, /usr/bin/hg, $MYPATH)
|
2012-06-25 15:34:22 +08:00
|
|
|
AC_PATH_PROG(__BZR, bzr, /usr/bin/bzr, $MYPATH)
|
|
|
|
AC_PATH_PROG(__QUILT, quilt, /usr/bin/quilt, $MYPATH)
|
2012-06-21 18:45:13 +08:00
|
|
|
|
2011-04-04 19:31:17 +08:00
|
|
|
AC_PATH_PROG(__FAKECHROOT, fakechroot, no, $MYPATH)
|
|
|
|
AM_CONDITIONAL(HAVE_FAKECHROOT, [test "$__FAKECHROOT" != "no"])
|
1996-12-12 11:32:40 +08:00
|
|
|
|
2009-12-23 17:40:55 +08:00
|
|
|
dnl see if we have a mkdir that supports `-p' for rpmbuild's purposes
|
|
|
|
AC_PROG_MKDIR_P
|
|
|
|
if ! echo $MKDIR_P | grep -q mkdir; then
|
|
|
|
__MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`"
|
|
|
|
else
|
|
|
|
__MKDIR_P=$MKDIR_P
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(__MKDIR_P, "${__MKDIR_P}",
|
|
|
|
[A full path to a program, possibly with arguments, that will create a
|
|
|
|
directory and all necessary parent directories, ala 'mkdir -p'])
|
|
|
|
AC_SUBST(__MKDIR_P)
|
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-06-06 18:37:18 +08:00
|
|
|
# Check for zlib library.
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2001-11-23 23:49:11 +08:00
|
|
|
WITH_ZLIB_INCLUDE=
|
|
|
|
WITH_ZLIB_LIB=
|
|
|
|
|
2007-09-20 20:45:40 +08:00
|
|
|
AC_CHECK_HEADERS([zlib.h],[
|
|
|
|
AS_IF([test -z "${WITH_ZLIB_LIB}"],[
|
|
|
|
for zlib in z gz ; do
|
|
|
|
AC_CHECK_LIB(${zlib}, gzread,
|
|
|
|
[WITH_ZLIB_LIB="-l${zlib}"; break])
|
|
|
|
done
|
2005-02-17 10:36:37 +08:00
|
|
|
|
|
|
|
dnl zlib-1.0.4 has not gzseek
|
2007-09-20 20:45:40 +08:00
|
|
|
AC_CHECK_LIB(${zlib}, gzseek, [AC_DEFINE(HAVE_GZSEEK, 1, [Define as 1 if your zlib has gzseek()])])
|
|
|
|
])
|
2011-07-08 15:31:34 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required header zlib.h])
|
2007-09-20 20:45:40 +08:00
|
|
|
])
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2007-06-06 18:37:18 +08:00
|
|
|
AC_SUBST(WITH_ZLIB_INCLUDE)
|
|
|
|
AC_SUBST(WITH_ZLIB_LIB)
|
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-08-15 15:02:34 +08:00
|
|
|
# Check for bzip2 library.
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2007-09-20 12:53:19 +08:00
|
|
|
AC_CHECK_HEADERS([bzlib.h],[
|
2011-08-19 15:19:58 +08:00
|
|
|
AC_CHECK_LIB(bz2, BZ2_bzread, [WITH_BZ2_LIB=-lbz2])
|
2007-09-20 12:53:19 +08:00
|
|
|
])
|
|
|
|
AC_SUBST(WITH_BZ2_LIB)
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2008-04-22 18:36:27 +08:00
|
|
|
#=================
|
|
|
|
# Check for lzma library.
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS([lzma.h],[
|
2009-03-10 03:19:37 +08:00
|
|
|
AC_CHECK_LIB(lzma, lzma_easy_encoder, [WITH_LZMA_LIB=-llzma])
|
2008-04-22 18:36:27 +08:00
|
|
|
])
|
|
|
|
AC_SUBST(WITH_LZMA_LIB)
|
|
|
|
|
2019-06-20 16:53:19 +08:00
|
|
|
# AC_OPENMP supports --enable/disable-openmp out of the box, but it doesn't
|
|
|
|
# actually give us a way to conditionalize the build based on that. Argh.
|
|
|
|
OPENMP_CFLAGS=
|
|
|
|
AC_OPENMP
|
|
|
|
AS_IF([test "x$ac_cv_prog_c_openmp" != x &&
|
|
|
|
test "x$ac_cv_prog_c_openmp" != unsupported],[
|
|
|
|
AC_DEFINE(ENABLE_OPENMP, 1, [Enable multithreading support?])
|
|
|
|
])
|
|
|
|
AC_SUBST(OPENMP_CFLAGS)
|
|
|
|
|
2017-08-09 22:42:56 +08:00
|
|
|
#=================
|
|
|
|
# Check for zstd.
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([zstd],
|
|
|
|
[AS_HELP_STRING([--enable-zstd=@<:@yes/no/auto@:>@],
|
|
|
|
[build without zstd support (default=auto)])],
|
|
|
|
[enable_zstd="$enableval"],
|
|
|
|
[enable_zstd=auto])
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_zstd" != "xno"], [
|
|
|
|
PKG_CHECK_MODULES([ZSTD], [libzstd], [have_zstd=yes], [have_zstd=no])
|
|
|
|
AS_IF([test "$enable_zstd" = "yes"], [
|
|
|
|
if test "$have_zstd" = "no"; then
|
|
|
|
AC_MSG_ERROR([--enable-zstd specified, but not available])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$have_zstd" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_ZSTD], [1], [Define if libzstd is available])
|
|
|
|
ZSTD_REQUIRES=libzstd
|
|
|
|
AC_SUBST(ZSTD_REQUIRES)
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_ZSTD], [test "x$have_zstd" = "xyes"])
|
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
|
|
|
|
1999-07-09 06:10:33 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for features
|
|
|
|
dnl
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl Checks for libraries.
|
1996-09-26 03:10:44 +08:00
|
|
|
|
2009-12-23 18:25:32 +08:00
|
|
|
AC_CHECK_FUNC(gethostname, [], [
|
|
|
|
AC_CHECK_LIB(nsl, gethostname)
|
2005-02-17 10:36:37 +08:00
|
|
|
])
|
|
|
|
|
2007-10-01 18:58:32 +08:00
|
|
|
AC_CHECK_HEADERS(pthread.h)
|
2005-02-17 10:36:37 +08:00
|
|
|
|
|
|
|
AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [
|
|
|
|
dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
|
|
|
|
AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [
|
|
|
|
AC_CHECK_LIB(thread, mutex_lock)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2010-06-23 20:59:49 +08:00
|
|
|
AC_SEARCH_LIBS(dlopen, [dl])
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2005-01-10 01:48:19 +08:00
|
|
|
#=================
|
2007-08-10 19:48:51 +08:00
|
|
|
# Check for libelf library. Prefer external, otherwise none.
|
2002-06-20 10:19:21 +08:00
|
|
|
WITH_LIBELF_LIB=
|
2002-12-01 05:07:08 +08:00
|
|
|
AC_CHECK_HEADER([libelf.h])
|
2007-08-10 21:22:25 +08:00
|
|
|
AC_CHECK_HEADERS([gelf.h], [
|
2002-11-30 05:35:53 +08:00
|
|
|
AC_CHECK_LIB(elf, gelf_getvernaux, [
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
|
2002-12-02 02:03:22 +08:00
|
|
|
WITH_LIBELF_LIB="-lelf"
|
2007-08-10 21:22:25 +08:00
|
|
|
WITH_LIBELF=yes
|
2002-11-30 05:35:53 +08:00
|
|
|
])
|
|
|
|
])
|
2002-06-20 10:19:21 +08:00
|
|
|
AC_SUBST(WITH_LIBELF_LIB)
|
2007-08-10 21:22:25 +08:00
|
|
|
AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
|
2002-06-20 10:19:21 +08:00
|
|
|
|
2007-08-10 20:01:36 +08:00
|
|
|
AC_CHECK_HEADERS([dwarf.h], [
|
|
|
|
WITH_LIBDWARF=yes
|
2002-11-30 05:35:53 +08:00
|
|
|
])
|
2007-08-10 20:01:36 +08:00
|
|
|
AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])
|
2002-10-19 02:45:47 +08:00
|
|
|
|
2012-10-19 20:43:09 +08:00
|
|
|
#=================
|
2017-01-16 22:19:43 +08:00
|
|
|
# Select crypto library
|
|
|
|
AC_ARG_WITH(crypto,
|
|
|
|
[AC_HELP_STRING([--with-crypto=CRYPTO_LIB],
|
2020-03-23 17:19:09 +08:00
|
|
|
[The cryptographic library to use (nss|beecrypt|openssl|libgcrypt). The default is libgcrypt. beecrypt is DEPRECATED.])
|
2017-01-16 22:19:43 +08:00
|
|
|
],[],
|
2019-09-10 16:05:03 +08:00
|
|
|
[with_crypto=libgcrypt])
|
2017-01-16 22:19:43 +08:00
|
|
|
|
2012-10-19 20:43:09 +08:00
|
|
|
# Check for beecrypt library if requested.
|
2020-03-23 17:19:09 +08:00
|
|
|
AC_ARG_WITH(internal_beecrypt, [ --with-internal-beecrypt build with internal beecrypt library (DEPRECATED)],,[with_internal_beecrypt=no])
|
2012-10-19 20:43:09 +08:00
|
|
|
AM_CONDITIONAL([WITH_INTERNAL_BEECRYPT],[test "$with_internal_beecrypt" = yes])
|
|
|
|
if test "$with_internal_beecrypt" = yes ; then
|
2017-01-16 22:19:43 +08:00
|
|
|
with_crypto=beecrypt
|
2012-10-19 20:43:09 +08:00
|
|
|
fi
|
2017-01-16 22:19:43 +08:00
|
|
|
AM_CONDITIONAL([WITH_BEECRYPT],[test "$with_crypto" = beecrypt])
|
2012-10-19 20:43:09 +08:00
|
|
|
|
|
|
|
WITH_BEECRYPT_INCLUDE=
|
|
|
|
WITH_BEECRYPT_LIB=
|
2017-01-16 22:19:43 +08:00
|
|
|
if test "$with_crypto" = beecrypt ; then
|
2012-10-19 20:43:09 +08:00
|
|
|
AC_DEFINE(WITH_BEECRYPT, 1, [Build with beecrypt instead of nss3 support?])
|
|
|
|
if test "$with_internal_beecrypt" = yes ; then
|
|
|
|
WITH_BEECRYPT_INCLUDE="-I\$(top_srcdir)/beecrypt"
|
|
|
|
AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the <beecrypt/api.h> header file.])
|
|
|
|
else
|
|
|
|
AC_CHECK_LIB(beecrypt, mpfprintln, [
|
|
|
|
WITH_BEECRYPT_LIB="-lbeecrypt"
|
|
|
|
],[
|
2017-01-16 22:19:43 +08:00
|
|
|
AC_MSG_ERROR([missing required library 'beecrypt'])
|
2012-10-19 20:43:09 +08:00
|
|
|
])
|
|
|
|
AC_CHECK_HEADER([beecrypt/api.h], [AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the <beecrypt/api.h> header file.])
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(WITH_BEECRYPT_LIB)
|
|
|
|
AC_SUBST(WITH_BEECRYPT_INCLUDE)
|
|
|
|
|
2017-01-16 22:19:43 +08:00
|
|
|
#=================
|
|
|
|
# Check for OpenSSL library.
|
|
|
|
# We need evp.h from OpenSSL.
|
|
|
|
|
|
|
|
WITH_OPENSSL_INCLUDE=
|
|
|
|
WITH_OPENSSL_LIB=
|
|
|
|
if test "$with_crypto" = openssl; then
|
|
|
|
# If we have pkgconfig make sure CPPFLAGS are setup correctly for the OpenSSL
|
|
|
|
# -I include path.
|
|
|
|
AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], [$PATH:/usr/bin:/usr/local/bin])
|
|
|
|
if test "x$PKGCONFIG" != "xno"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS $($PKGCONFIG --cflags libcrypto)"
|
|
|
|
WITH_OPENSSL_LIB=$($PKGCONFIG --libs libcrypto)
|
|
|
|
else
|
|
|
|
WITH_OPENSSL_LIB=-lcrypto
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS([openssl/evp.h], [], [
|
|
|
|
AC_MSG_ERROR([missing required OpenSSL header])
|
|
|
|
])
|
|
|
|
AC_CHECK_HEADERS([openssl/rsa.h], [], [
|
|
|
|
AC_MSG_ERROR([missing required OpenSSL header])
|
|
|
|
])
|
|
|
|
AC_CHECK_HEADERS([openssl/dsa.h], [], [
|
|
|
|
AC_MSG_ERROR([missing required OpenSSL header])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, EVP_DigestInit_ex, [], [
|
|
|
|
AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [
|
|
|
|
AC_DEFINE(HAVE_EVP_MD_CTX_NEW, 1, [Define to 1 if OpenSSL has EVP_MD_CTX_new])
|
|
|
|
AC_SUBST(HAVE_EVP_MD_CTX_NEW, [1])
|
|
|
|
], [
|
2017-10-16 14:21:02 +08:00
|
|
|
AC_CHECK_LIB(crypto, EVP_MD_CTX_create, [], [
|
2017-01-16 22:19:43 +08:00
|
|
|
AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, EVP_PKEY_CTX_new, [], [
|
|
|
|
AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, DSA_set0_key, [
|
|
|
|
AC_DEFINE(HAVE_DSA_SET0_KEY, 1, [Define to 1 if OpenSSL has DSA_set0_key])
|
|
|
|
AC_SUBST(HAVE_DSA_SET0_KEY, [1])
|
|
|
|
], []
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, DSA_set0_pqg, [
|
|
|
|
AC_DEFINE(HAVE_DSA_SET0_PQG, 1, [Define to 1 if OpenSSL has DSA_set0_pqg])
|
|
|
|
AC_SUBST(HAVE_DSA_SET0_PQG, [1])
|
|
|
|
], []
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, DSA_SIG_set0, [
|
|
|
|
AC_DEFINE(HAVE_DSA_SIG_SET0, 1, [Define to 1 if OpenSSL has DSA_SIG_set0])
|
|
|
|
AC_SUBST(HAVE_DSA_SIG_SET0, [1])
|
|
|
|
], []
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, RSA_set0_key, [
|
|
|
|
AC_DEFINE(HAVE_RSA_SET0_KEY, 1, [Define to 1 if OpenSSL has RSA_set0_key])
|
|
|
|
AC_SUBST(HAVE_RSA_SET0_KEY, [1])
|
|
|
|
], []
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_LIB(crypto, BN_bn2binpad, [
|
|
|
|
AC_DEFINE(HAVE_BN2BINPAD, 1, [Define to 1 if OpenSSL has BN_bn2binpad])
|
|
|
|
AC_SUBST(HAVE_BN2BINPAD, [1])
|
|
|
|
], []
|
|
|
|
)
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([WITH_OPENSSL],[test "$with_crypto" = openssl])
|
|
|
|
AC_SUBST(WITH_OPENSSL_INCLUDE)
|
|
|
|
AC_SUBST(WITH_OPENSSL_LIB)
|
|
|
|
|
2019-08-30 17:47:33 +08:00
|
|
|
#=================
|
|
|
|
# Check for libgcrypt library.
|
|
|
|
WITH_LIBGCRYPT_INCLUDE=
|
|
|
|
WITH_LIBGCRYPT_LIB=
|
|
|
|
if test "$with_crypto" = libgcrypt ; then
|
2019-11-20 21:06:51 +08:00
|
|
|
# libgcrypt 1.8.5 onwards ships a pkg-config file so prefer that
|
|
|
|
PKG_CHECK_MODULES([LIBGCRYPT], [libgcrypt], [have_libgcrypt=yes], [have_libgcrypt=no])
|
|
|
|
if test "$have_libgcrypt" = "yes"; then
|
|
|
|
WITH_LIBGCRYPT_INCLUDE="$LIBGCRYPT_CFLAGS"
|
|
|
|
WITH_LIBGCRYPT_LIB="$LIBGCRYPT_LIBS"
|
|
|
|
else
|
|
|
|
AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, notfound)
|
|
|
|
if test notfound != "$LIBGCRYPT_CONFIG" ; then
|
|
|
|
WITH_LIBGCRYPT_INCLUDE=`$LIBGCRYPT_CONFIG --cflags`
|
|
|
|
WITH_LIBGCRYPT_LIB=`$LIBGCRYPT_CONFIG --libs`
|
|
|
|
fi
|
|
|
|
if test -z "$WITH_LIBGCRYPT_LIB" ; then
|
|
|
|
AC_MSG_ERROR([libgcrypt not found])
|
|
|
|
fi
|
|
|
|
fi
|
2019-08-30 17:47:33 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([WITH_LIBGCRYPT],[test "$with_crypto" = libgcrypt])
|
|
|
|
AC_SUBST(WITH_LIBGCRYPT_INCLUDE)
|
|
|
|
AC_SUBST(WITH_LIBGCRYPT_LIB)
|
|
|
|
|
2005-01-10 01:48:19 +08:00
|
|
|
#=================
|
2007-11-02 16:02:40 +08:00
|
|
|
# Check for NSS library.
|
2017-01-16 22:19:43 +08:00
|
|
|
# We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS
|
|
|
|
# have a header named nss.h... so make extra check for NSS's sechash.h
|
2008-08-19 18:33:21 +08:00
|
|
|
# which we use too and hopefully is slightly more unique to NSS.
|
2007-11-02 16:02:40 +08:00
|
|
|
WITH_NSS_INCLUDE=
|
|
|
|
WITH_NSS_LIB=
|
2017-01-16 22:19:43 +08:00
|
|
|
if test "$with_crypto" = nss; then
|
2016-03-18 23:54:39 +08:00
|
|
|
# If we have pkgconfig make sure CPPFLAGS are setup correctly for the nss
|
|
|
|
# -I include path. Otherwise the below checks will fail because nspr.h
|
|
|
|
# cannot be found.
|
|
|
|
AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], [$PATH:/usr/bin:/usr/local/bin])
|
|
|
|
if test "x$PKGCONFIG" != "xno"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS $($PKGCONFIG --cflags nss)"
|
|
|
|
fi
|
2008-08-19 18:33:21 +08:00
|
|
|
AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [
|
|
|
|
AC_MSG_ERROR([missing required NSPR / NSS header])
|
|
|
|
])
|
2012-11-29 18:35:13 +08:00
|
|
|
AC_CHECK_LIB(nss3, VFY_VerifyDigestDirect, [
|
2008-08-19 18:33:21 +08:00
|
|
|
WITH_NSS_LIB=-lnss3
|
2012-10-31 15:43:38 +08:00
|
|
|
AC_CHECK_LIB(nss3, NSS_InitContext, [
|
|
|
|
AC_DEFINE(HAVE_NSS_INITCONTEXT, 1, [Define to 1 if NSS has NSS_InitContext])
|
|
|
|
AC_SUBST(HAVE_NSS_INITCONTEXT, [1])
|
2012-11-29 18:31:52 +08:00
|
|
|
])
|
2008-08-19 18:33:21 +08:00
|
|
|
], [
|
2012-11-29 18:35:13 +08:00
|
|
|
AC_MSG_ERROR([required NSS library 'nss3' missing or too old])
|
2003-05-31 00:58:13 +08:00
|
|
|
])
|
2012-10-19 20:43:09 +08:00
|
|
|
fi
|
2007-11-02 16:02:40 +08:00
|
|
|
AC_SUBST(WITH_NSS_INCLUDE)
|
|
|
|
AC_SUBST(WITH_NSS_LIB)
|
2003-05-23 05:21:43 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-07-24 14:59:33 +08:00
|
|
|
# Check for magic library.
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_MAGIC_INCLUDE=
|
|
|
|
WITH_MAGIC_LIB=
|
|
|
|
|
2007-07-24 14:59:33 +08:00
|
|
|
AC_CHECK_HEADER([magic.h], [
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_CHECK_LIB(magic, magic_open, [
|
|
|
|
WITH_MAGIC_INCLUDE=
|
|
|
|
WITH_MAGIC_LIB="-lmagic"
|
2007-08-10 23:07:17 +08:00
|
|
|
],[
|
2007-09-18 18:41:47 +08:00
|
|
|
AC_MSG_ERROR([missing required library 'libmagic'])
|
2005-02-17 10:36:37 +08:00
|
|
|
])
|
2007-08-10 23:07:17 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required header magic.h])
|
2007-07-24 14:59:33 +08:00
|
|
|
])
|
2004-05-29 23:56:01 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_SUBST(WITH_MAGIC_INCLUDE)
|
|
|
|
AC_SUBST(WITH_MAGIC_LIB)
|
2002-04-15 05:48:44 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-08-10 15:43:52 +08:00
|
|
|
# Check for popt library.
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_POPT_INCLUDE=
|
|
|
|
WITH_POPT_LIB=
|
|
|
|
|
2007-08-10 15:43:52 +08:00
|
|
|
AC_CHECK_HEADER([popt.h], [
|
|
|
|
AC_CHECK_LIB(popt, poptGetContext, [
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_POPT_INCLUDE=
|
|
|
|
WITH_POPT_LIB="-lpopt"
|
2007-08-10 15:43:52 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required library popt])
|
2002-04-15 05:48:44 +08:00
|
|
|
])
|
2007-08-10 15:43:52 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required header popt.h])
|
|
|
|
])
|
2002-04-15 05:48:44 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_SUBST(WITH_POPT_INCLUDE)
|
|
|
|
AC_SUBST(WITH_POPT_LIB)
|
1999-06-18 05:35:34 +08:00
|
|
|
|
2014-03-05 20:52:40 +08:00
|
|
|
#=================
|
|
|
|
# Check for libarchive library.
|
|
|
|
AC_ARG_WITH([archive], [AS_HELP_STRING([--with-archive], [build rpm2archive - requires libarchive])],
|
|
|
|
[],
|
|
|
|
[with_archive=yes])
|
|
|
|
|
|
|
|
WITH_ARCHIVE_INCLUDE=
|
|
|
|
WITH_ARCHIVE_LIB=
|
|
|
|
AS_IF([test "$with_archive" != no],[
|
|
|
|
AC_CHECK_HEADER([archive.h], [
|
|
|
|
AC_CHECK_LIB(archive, archive_write_open_filename, [
|
|
|
|
WITH_ARCHIVE_INCLUDE=
|
|
|
|
WITH_ARCHIVE_LIB="-larchive"
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required library 'libarchive'])
|
|
|
|
])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required header archive.h])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_SUBST(WITH_ARCHIVE_INCLUDE)
|
|
|
|
AC_SUBST(WITH_ARCHIVE_LIB)
|
|
|
|
AM_CONDITIONAL(WITH_ARCHIVE,[test "$with_archive" = yes])
|
|
|
|
|
2016-06-14 23:07:12 +08:00
|
|
|
#=================
|
|
|
|
# Check for elfutils libdw library with dwelf_elf_gnu_build_id.
|
2016-08-10 19:58:30 +08:00
|
|
|
WITH_LIBDW_LIB=
|
2017-02-27 23:28:18 +08:00
|
|
|
HAVE_LIBDW_STRTAB=
|
2016-08-24 23:06:34 +08:00
|
|
|
AS_IF([test "$WITH_LIBELF" = yes],[
|
2016-06-14 23:07:12 +08:00
|
|
|
AC_CHECK_HEADERS([elfutils/libdwelf.h],[
|
2017-02-27 23:28:18 +08:00
|
|
|
# dwelf_elf_gnu_build_id was introduced in elfutils 0.159
|
2016-06-14 23:07:12 +08:00
|
|
|
AC_CHECK_LIB(dw, dwelf_elf_gnu_build_id, [
|
|
|
|
AC_DEFINE(HAVE_LIBDW, 1,
|
|
|
|
[Define to 1 if you have elfutils libdw library])
|
|
|
|
WITH_LIBDW_LIB="-ldw"
|
|
|
|
WITH_LIBDW=yes
|
2017-02-27 23:28:18 +08:00
|
|
|
# If possible we also want the strtab functions from elfutils 0.167.
|
|
|
|
# But we can fall back on the (unsupported) ebl alternatives if not.
|
|
|
|
AC_CHECK_LIB(dw, dwelf_strtab_init, [HAVE_LIBDW_STRTAB=yes])
|
2019-04-02 21:07:56 +08:00
|
|
|
# whether libdw supports compressed ELF objects
|
|
|
|
AC_CHECK_LIB(dw, dwelf_elf_begin, [
|
|
|
|
AC_DEFINE(HAVE_DWELF_ELF_BEGIN, 1, [Have dwelf_elf_begin?])
|
|
|
|
])
|
2016-06-14 23:07:12 +08:00
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
2016-08-10 19:58:30 +08:00
|
|
|
AC_SUBST(WITH_LIBDW_LIB)
|
|
|
|
AM_CONDITIONAL(LIBDW,[test "$WITH_LIBDW" = yes])
|
2017-02-27 23:28:18 +08:00
|
|
|
AM_CONDITIONAL(HAVE_LIBDW_STRTAB,[test "$HAVE_LIBDW_STRTAB" = yes])
|
2016-06-14 23:07:12 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2019-02-01 21:08:24 +08:00
|
|
|
# Check for BDB support
|
|
|
|
AC_ARG_ENABLE([bdb],
|
|
|
|
[AS_HELP_STRING([--enable-bdb=@<:@yes/no/auto@:>@],
|
|
|
|
[build with Berkeley DB rpm database format support (default=yes)])],
|
|
|
|
[enable_bdb="$enableval"],
|
|
|
|
[enable_bdb=yes])
|
|
|
|
|
2019-12-19 00:42:31 +08:00
|
|
|
have_bdb="no"
|
2019-02-01 21:08:24 +08:00
|
|
|
AS_IF([test "x$enable_bdb" != "xno"], [
|
2008-01-10 01:07:20 +08:00
|
|
|
if [ test -x db/dist/configure ]; then
|
2019-02-01 21:08:24 +08:00
|
|
|
have_bdb="internal"
|
2008-01-10 01:07:20 +08:00
|
|
|
else
|
2019-02-01 21:08:24 +08:00
|
|
|
AC_CHECK_HEADERS([db.h],[
|
|
|
|
AC_PREPROC_IFELSE([
|
|
|
|
AC_LANG_SOURCE([
|
|
|
|
#include <db.h>
|
|
|
|
#if ((DB_VERSION_MAJOR < 4) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 5))
|
|
|
|
#error Berkeley DB too old
|
|
|
|
#endif
|
2016-03-19 00:14:43 +08:00
|
|
|
])
|
2019-02-01 21:08:24 +08:00
|
|
|
],[ have_bdb="yes" ])
|
|
|
|
])
|
2008-01-10 01:07:20 +08:00
|
|
|
fi
|
2019-02-01 21:08:24 +08:00
|
|
|
AC_MSG_CHECKING(for Berkeley DB >= 4.5)
|
|
|
|
AC_MSG_RESULT($have_bdb)
|
|
|
|
AS_IF([test "x$enable_bdb" = "xyes"], [
|
|
|
|
if test "x$have_bdb" = "xno"; then
|
|
|
|
AC_MSG_ERROR([--enable-bdb specified, but not available])
|
|
|
|
fi
|
|
|
|
AC_DEFINE([WITH_BDB], [1], [Define if BDB is available])
|
|
|
|
WITH_DB_LIB=-ldb
|
|
|
|
AC_SUBST([WITH_DB_LIB])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([BDB], [test "x$have_bdb" != "xno"])
|
|
|
|
AM_CONDITIONAL([WITH_INTERNAL_DB],[test "x$have_bdb" = "xinternal"])
|
|
|
|
if test "x$have_bdb" = "xinternal"; then
|
|
|
|
AC_CONFIG_SUBDIRS(db3)
|
|
|
|
fi
|
2007-09-18 11:01:45 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2015-07-16 23:20:51 +08:00
|
|
|
#=================
|
|
|
|
# Process --enable-ndb
|
2020-01-10 22:56:59 +08:00
|
|
|
AC_ARG_ENABLE([ndb], [AS_HELP_STRING([--enable-ndb],[enable the new rpm database format])],
|
2015-07-16 23:20:51 +08:00
|
|
|
[case "$enable_ndb" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --enable-ndb])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[enable_ndb=no])
|
|
|
|
AS_IF([test "$enable_ndb" = yes],[
|
2019-10-11 21:57:47 +08:00
|
|
|
AC_DEFINE(ENABLE_NDB, 1, [Enable new rpm database format?])
|
|
|
|
AC_CHECK_FUNCS(mremap, [], [], [#include <sys/mman.h>])
|
2015-07-16 23:20:51 +08:00
|
|
|
])
|
|
|
|
AM_CONDITIONAL([NDB], [test "$enable_ndb" = yes])
|
|
|
|
|
2019-12-19 21:08:50 +08:00
|
|
|
#=================
|
|
|
|
# Process --enable-bdb-ro
|
|
|
|
AC_ARG_ENABLE([bdb-ro], [AS_HELP_STRING([--enable-bdb-ro (EXPERIMENTAL)],[enable the read-only Berkeley DB code])],
|
|
|
|
[case "$enable_bdb_ro" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --enable-bdb-ro])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[enable_bdb_ro=no])
|
|
|
|
AS_IF([test "$enable_bdb_ro" = yes],[
|
|
|
|
AC_DEFINE(WITH_BDB_RO, 1, [Build with read-only Berkeley DB])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL([BDB_RO], [test "$enable_bdb_ro" = yes])
|
|
|
|
|
2019-09-24 16:24:06 +08:00
|
|
|
# Check for SQLITE support
|
|
|
|
AC_ARG_ENABLE([sqlite],
|
|
|
|
[AS_HELP_STRING([--enable-sqlite=@<:@yes/no/auto@:>@)],
|
|
|
|
[build with sqlite rpm database format support (default=auto)])],
|
|
|
|
[enable_sqlite="$enableval"],
|
|
|
|
[enable_sqlite=auto])
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_sqlite" != "xno"], [
|
2019-11-20 21:00:21 +08:00
|
|
|
PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.22.0], [have_sqlite=yes], [have_sqlite=no])
|
2019-09-24 16:24:06 +08:00
|
|
|
AS_IF([test "$enable_sqlite" = "yes"], [
|
|
|
|
if test "$have_sqlite" = "no"; then
|
|
|
|
AC_MSG_ERROR([--enable-sqlite specified, but not available])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$have_sqlite" = "xyes"; then
|
|
|
|
AC_DEFINE([WITH_SQLITE], [1], [Define if SQLITE is available])
|
|
|
|
SQLITE_REQUIRES=sqlite
|
|
|
|
AC_SUBST(SQLITE_REQUIRES)
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([SQLITE], [test "x$have_sqlite" = "xyes"])
|
|
|
|
|
2007-07-24 19:21:32 +08:00
|
|
|
AM_GNU_GETTEXT_VERSION([0.16.1])
|
2007-03-14 23:46:17 +08:00
|
|
|
AM_GNU_GETTEXT([external])
|
2014-09-08 18:46:48 +08:00
|
|
|
AM_ICONV
|
1998-10-08 22:59:17 +08:00
|
|
|
|
1996-09-29 10:27:07 +08:00
|
|
|
dnl Checks for header files we can live without.
|
1997-01-25 03:04:51 +08:00
|
|
|
AC_HEADER_STDC
|
2017-07-19 20:43:28 +08:00
|
|
|
dnl glibc and autoconf don't really play well together.
|
|
|
|
dnl glibc will produce a warning when including the wrong header.
|
|
|
|
dnl but still define major and minor. Causing us to include the header
|
|
|
|
dnl that produces a giant warning for each major/minor use.
|
|
|
|
dnl Use -Werror to work around that.
|
|
|
|
old_CFLAGS=$CFLAGS
|
|
|
|
CFLAGS="$CFLAGS -Werror"
|
1997-05-06 04:46:58 +08:00
|
|
|
AC_HEADER_MAJOR
|
2017-07-19 20:43:28 +08:00
|
|
|
CFLAGS=$old_CFLAGS
|
2011-06-28 13:37:41 +08:00
|
|
|
AC_STRUCT_DIRENT_D_TYPE
|
1998-10-06 02:31:48 +08:00
|
|
|
|
2008-08-14 20:02:52 +08:00
|
|
|
AC_CHECK_HEADERS(limits.h)
|
2011-03-23 20:37:44 +08:00
|
|
|
AC_CHECK_HEADERS(fcntl.h getopt.h)
|
1997-01-17 03:44:24 +08:00
|
|
|
|
2010-01-05 18:35:54 +08:00
|
|
|
AC_CHECK_HEADERS(sys/utsname.h)
|
1998-10-08 22:59:17 +08:00
|
|
|
|
2010-02-05 23:08:05 +08:00
|
|
|
AC_CHECK_HEADERS(sys/systemcfg.h)
|
|
|
|
AC_CHECK_HEADERS(sys/param.h)
|
2014-06-27 15:11:26 +08:00
|
|
|
AC_CHECK_HEADERS(sys/auxv.h)
|
1996-09-26 03:10:44 +08:00
|
|
|
|
1999-04-09 04:09:48 +08:00
|
|
|
dnl statfs portability fiddles.
|
1999-04-14 19:28:31 +08:00
|
|
|
dnl
|
|
|
|
dnl We should really emulate/steal sections of the statfs and struct statfs
|
|
|
|
dnl checks from GNU fileutils.
|
|
|
|
dnl
|
1999-03-23 02:36:23 +08:00
|
|
|
AC_MSG_CHECKING(for struct statfs)
|
2005-02-17 10:36:37 +08:00
|
|
|
|
1999-04-09 04:09:48 +08:00
|
|
|
dnl
|
|
|
|
dnl this is easier than nesting AC_TRY_COMPILEs...
|
|
|
|
dnl
|
|
|
|
found_struct_statfs=no
|
|
|
|
|
1999-04-17 07:05:00 +08:00
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl Solaris 2.6+ wants to use statvfs
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-17 07:05:00 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/statvfs.h> ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
|
|
|
|
[statfs in <sys/statvfs.h> (for solaris 2.6+ systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-17 07:05:00 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
1999-04-09 04:09:48 +08:00
|
|
|
dnl first try including sys/vfs.h
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-09 04:09:48 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/vfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in <sys/vfs.h> (for linux systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-17 07:05:00 +08:00
|
|
|
fi
|
1999-04-09 04:09:48 +08:00
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl ...next try including sys/mount.h
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-09 04:09:48 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2000-03-16 22:27:04 +08:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/mount.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/mount.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_MOUNT, 1, [statfs in <sys/mount.h> (for Digital Unix 4.0D systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-09 04:09:48 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl ...still no joy. Try sys/statfs.h
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-09 04:09:48 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/statfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/statfs.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_STATFS, 1, [statfs in <sys/statfs.h> (for Irix 6.4 systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-09 04:09:48 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl ...no luck. Warn the user of impending doom.
|
|
|
|
AC_MSG_WARN(not found)
|
|
|
|
fi
|
|
|
|
|
1999-04-14 19:28:31 +08:00
|
|
|
dnl
|
|
|
|
dnl if we found the struct, see if it has the f_bavail member. Some OSes
|
|
|
|
dnl don't, including IRIX 6.5+
|
|
|
|
dnl
|
|
|
|
if test X$found_struct_statfs = Xyes ; then
|
|
|
|
AC_MSG_CHECKING(for f_bavail member in struct statfs)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-14 19:28:31 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
1999-04-17 07:05:00 +08:00
|
|
|
#if STATFS_IN_SYS_STATVFS
|
|
|
|
# include <sys/statvfs.h>
|
|
|
|
typedef struct statvfs STATFS_t;
|
|
|
|
#else
|
|
|
|
typedef struct statfs STATFS_t;
|
|
|
|
# if STATFS_IN_SYS_VFS
|
|
|
|
# include <sys/vfs.h>
|
|
|
|
# elif STATFS_IN_SYS_MOUNT
|
2007-09-18 16:49:20 +08:00
|
|
|
# include <sys/mount.h>
|
1999-04-17 07:05:00 +08:00
|
|
|
# elif STATFS_IN_SYS_STATFS
|
|
|
|
# include <sys/statfs.h>
|
|
|
|
# endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#endif ]], [[STATFS_t sfs;
|
|
|
|
sfs.f_bavail = 0;]])],[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(STATFS_HAS_F_BAVAIL, 1, [Define if struct statfs has the f_bavail member])],[AC_MSG_RESULT(no)
|
|
|
|
])
|
1999-04-14 19:28:31 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xyes ; then
|
|
|
|
dnl
|
|
|
|
dnl now check to see if we have the 4-argument variant of statfs()
|
2004-01-05 22:09:47 +08:00
|
|
|
dnl this pretty much requires AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[])
|
1999-04-14 19:28:31 +08:00
|
|
|
dnl
|
|
|
|
AC_MSG_CHECKING([if statfs() requires 4 arguments])
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
1999-04-14 19:28:31 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
#ifdef STATFS_IN_SYS_VFS
|
|
|
|
#include <sys/vfs.h>
|
|
|
|
#elif STATFS_IN_SYS_MOUNT
|
|
|
|
#include <sys/mouht.h>
|
|
|
|
#elif STATFS_IN_SYS_STATFS
|
|
|
|
#include <sys/statfs.h>
|
|
|
|
#endif
|
|
|
|
main() {
|
|
|
|
struct statfs sfs;
|
|
|
|
exit (statfs(".", &sfs, sizeof(sfs), 0));
|
|
|
|
}
|
2004-01-05 22:09:47 +08:00
|
|
|
]])],[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(STAT_STATFS4, 1, [Define if the statfs() call takes 4 arguments])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)
|
|
|
|
])
|
1999-04-14 19:28:31 +08:00
|
|
|
fi
|
1999-03-23 02:36:23 +08:00
|
|
|
|
1997-01-21 06:34:47 +08:00
|
|
|
dnl look for libc features
|
|
|
|
|
1998-10-07 01:56:44 +08:00
|
|
|
dnl Check for missing typedefs
|
2003-11-24 03:50:52 +08:00
|
|
|
AC_TYPE_MODE_T
|
2003-04-17 06:13:18 +08:00
|
|
|
AC_TYPE_OFF_T
|
1998-10-07 01:56:44 +08:00
|
|
|
AC_TYPE_PID_T
|
2003-04-17 06:13:18 +08:00
|
|
|
AC_TYPE_SIZE_T
|
1998-10-07 01:56:44 +08:00
|
|
|
|
1996-08-20 01:15:47 +08:00
|
|
|
dnl Checks for library functions.
|
2010-01-04 20:15:20 +08:00
|
|
|
AC_CHECK_FUNCS(putenv)
|
2012-05-31 23:09:23 +08:00
|
|
|
AC_CHECK_FUNCS(mempcpy)
|
2012-06-21 14:45:16 +08:00
|
|
|
AC_CHECK_FUNCS(fdatasync)
|
2015-09-29 11:49:24 +08:00
|
|
|
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
|
2013-03-13 17:39:00 +08:00
|
|
|
AC_CHECK_FUNCS(lutimes)
|
2013-03-19 14:20:20 +08:00
|
|
|
AC_CHECK_FUNCS(mergesort)
|
2013-07-01 08:25:32 +08:00
|
|
|
AC_CHECK_FUNCS(getauxval)
|
2017-03-24 19:33:02 +08:00
|
|
|
AC_CHECK_FUNCS(setprogname, [], [], [#include <stdlib.h>])
|
2017-09-07 16:40:10 +08:00
|
|
|
AC_CHECK_FUNCS(syncfs)
|
2019-01-15 17:16:04 +08:00
|
|
|
AC_CHECK_FUNCS(sched_getaffinity, [], [], [#include <sched.h>])
|
2019-01-17 19:35:42 +08:00
|
|
|
AC_CHECK_FUNCS(unshare, [], [], [#include <sched.h>])
|
Replace AC_CHECK_FUNCS by AC_REPLACE_FUNCS for basename, getcwd, getwd, putenv, realpath, setenv, stpcpy, stpncpy, strcspn, strdup, strtol, strtoul, strspn, strstr.
2007-10-30 22:51:53 +08:00
|
|
|
|
2017-03-24 20:20:48 +08:00
|
|
|
AC_MSG_CHECKING([whether __progname is defined])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([extern const char *__progname;],
|
|
|
|
[if (*__progname == 0) return 0;])],
|
|
|
|
AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined])
|
|
|
|
AC_MSG_RESULT([yes]),
|
|
|
|
AC_MSG_RESULT([no]))
|
|
|
|
|
2009-12-23 20:52:49 +08:00
|
|
|
AC_REPLACE_FUNCS(stpcpy stpncpy)
|
1999-09-12 08:41:51 +08:00
|
|
|
|
2013-01-29 00:49:01 +08:00
|
|
|
AC_CHECK_FUNCS([secure_getenv __secure_getenv])
|
2003-05-01 04:04:58 +08:00
|
|
|
|
2010-01-04 20:58:51 +08:00
|
|
|
AC_CHECK_FUNCS(
|
2017-11-09 22:12:51 +08:00
|
|
|
[mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown \
|
2019-10-31 17:34:02 +08:00
|
|
|
utimes getline localtime_r ],
|
2010-01-04 20:58:51 +08:00
|
|
|
[], [AC_MSG_ERROR([function required by rpm])])
|
2003-12-27 01:36:38 +08:00
|
|
|
|
2007-06-20 15:20:15 +08:00
|
|
|
AC_LIBOBJ(fnmatch)
|
|
|
|
|
2007-09-10 18:49:51 +08:00
|
|
|
dnl check if python is requested
|
2009-11-27 21:57:44 +08:00
|
|
|
AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python],[build rpm python bindings])],
|
2007-09-10 18:49:51 +08:00
|
|
|
[case "$enable_python" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --enable-python])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[enable_python=no])
|
|
|
|
|
2017-09-05 17:00:30 +08:00
|
|
|
WITH_PYTHON_SUBPACKAGE=0
|
2007-09-10 18:49:51 +08:00
|
|
|
AS_IF([test "$enable_python" = yes],[
|
2019-02-26 17:58:15 +08:00
|
|
|
PYTHON="${PYTHON:-python3}"
|
2019-08-07 16:56:40 +08:00
|
|
|
AM_PATH_PYTHON([3.1],[
|
2017-09-05 17:00:30 +08:00
|
|
|
PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}], [WITH_PYTHON_SUBPACKAGE=1])
|
|
|
|
AC_SUBST(PYTHON_CFLAGS)
|
|
|
|
AC_SUBST(PYTHON_LIB)
|
2007-09-10 18:49:51 +08:00
|
|
|
])
|
|
|
|
])
|
2004-11-09 14:59:34 +08:00
|
|
|
|
2010-10-01 15:34:36 +08:00
|
|
|
AM_CONDITIONAL(ENABLE_PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = 1])
|
2007-08-06 17:04:05 +08:00
|
|
|
|
2007-10-18 14:34:37 +08:00
|
|
|
AC_PATH_PROG(DOXYGEN, doxygen, no)
|
2000-12-04 08:55:17 +08:00
|
|
|
dnl
|
2007-12-05 17:56:33 +08:00
|
|
|
dnl Only build internal API + source hacking docs on request
|
2000-12-04 08:55:17 +08:00
|
|
|
dnl
|
2009-11-27 21:57:44 +08:00
|
|
|
AC_ARG_WITH(hackingdocs, [AS_HELP_STRING([--with-hackingdocs],[build rpm hacking docs])],,[with_hackingdocs=no])
|
2007-08-13 12:42:49 +08:00
|
|
|
|
2007-12-05 17:56:33 +08:00
|
|
|
case "$with_hackingdocs" in
|
2007-08-13 12:42:49 +08:00
|
|
|
auto)
|
2007-12-05 17:56:33 +08:00
|
|
|
AS_IF([test "$DOXYGEN" = no],[with_hackingdocs=no],[with_hackingdocs=no])
|
2007-08-13 12:42:49 +08:00
|
|
|
;;
|
|
|
|
yes)
|
2007-10-18 14:34:37 +08:00
|
|
|
AS_IF([test "$DOXYGEN" = no],
|
2007-12-05 17:56:33 +08:00
|
|
|
[AC_MSG_ERROR([rpm hacking docs eeds doxygen in PATH])])
|
2007-08-13 12:42:49 +08:00
|
|
|
;;
|
|
|
|
esac
|
2007-10-05 16:37:55 +08:00
|
|
|
AC_CHECK_PROG(HAVE_DOT,[dot],[YES],[NO])
|
2000-12-13 04:03:45 +08:00
|
|
|
|
2004-01-05 22:09:47 +08:00
|
|
|
WITH_SELINUX_LIB=
|
2009-11-27 21:57:44 +08:00
|
|
|
AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux],[build with selinux support])],
|
2007-09-04 20:19:18 +08:00
|
|
|
[case "$with_selinux" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --with-selinux])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[with_selinux=no])
|
2007-08-13 15:35:48 +08:00
|
|
|
|
2007-09-04 20:19:18 +08:00
|
|
|
AS_IF([test "$with_selinux" = yes],[
|
2007-08-13 15:35:48 +08:00
|
|
|
AC_CHECK_HEADER([selinux/selinux.h],[
|
2010-08-31 04:32:31 +08:00
|
|
|
save_LIBS="$LIBS"
|
|
|
|
AC_CHECK_LIB([selinux],[is_selinux_enabled],[],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but is_selinux_enabled not found in libselinux])])
|
|
|
|
AC_CHECK_LIB([selinux],[selinux_getpolicytype],[],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selinux_getpolicytype not found in libselinux])])
|
|
|
|
AC_CHECK_LIB([selinux],[selinux_reset_config],[],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selinux_reset_config not found in libselinux])])
|
2015-01-16 00:01:48 +08:00
|
|
|
AC_CHECK_LIB([selinux],[setexecfilecon],[
|
|
|
|
AC_DEFINE([HAVE_SETEXECFILECON],[1],[Define to 1 if SELinux setexecfilecon is present])])
|
2010-08-31 04:32:31 +08:00
|
|
|
LIBS="$save_LIBS"
|
2007-08-13 15:35:48 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found])
|
|
|
|
])
|
Use selabel interfaces instead of matchpathcon
This replaces the old matchpathcon interfaces with the new selabel
interfaces for relabeling files, storing an selabel handle in the
transaction set.
With this change, also comes an added distinction between --nocontexts
being specified and a failure to read the load file contexts.
Previously, there was no distinction, and both cases used the
RPMTRANS_FLAG_NOCONTEXTS flag.
However, with the new policy plugin, it is necessary to make such a
distinction. This is because matchpathcon_init (now selabel interfaces)
can fail at the beginning of the transaction, but succeed later after
new policy is installed. Because of this, we may need to enable/disable
RPMTRANS_FLAG_NOCONTEXTS multiple times. However, because this flag
could also mean --nocontexts, we cannot do that. By storing the selabel
handle in the rpmts, we can easily keep track if the handle has been
successfully created, rather than overloading RPMTRANS_FLAG_NOCONTEXTS
with two meanings.
2010-08-31 04:32:30 +08:00
|
|
|
|
|
|
|
AC_CHECK_HEADER([selinux/label.h],[
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
AC_CHECK_LIB([selinux],[selabel_close],[],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selabel_close not found in libselinux])])
|
|
|
|
AC_CHECK_LIB([selinux],[selabel_lookup_raw],[],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selabel_lookup_raw not found in libselinux])])
|
|
|
|
AC_CHECK_LIB([selinux],[selabel_open],[],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selabel_open not found in libselinux])])
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selinux/label.h not found])
|
|
|
|
])
|
2007-09-04 20:19:18 +08:00
|
|
|
])
|
2007-08-13 15:35:48 +08:00
|
|
|
|
|
|
|
AS_IF([test "$with_selinux" = yes],[
|
2004-01-06 01:15:18 +08:00
|
|
|
AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
|
2010-12-22 20:58:11 +08:00
|
|
|
WITH_SELINUX_LIB="-lselinux"
|
2007-08-13 15:35:48 +08:00
|
|
|
])
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_SUBST(WITH_SELINUX_LIB)
|
2010-12-22 20:58:11 +08:00
|
|
|
AC_SUBST(WITH_SEMANAGE_LIB)
|
2007-08-15 19:40:10 +08:00
|
|
|
AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
|
2004-01-05 22:09:47 +08:00
|
|
|
|
2015-07-22 01:00:40 +08:00
|
|
|
# libimaevm
|
|
|
|
with_iamevm=no
|
|
|
|
AC_ARG_WITH(imaevm, [AS_HELP_STRING([--with-imaevm],[build with imaevm support])])
|
|
|
|
if test "$with_imaevm" = yes ; then
|
2017-06-09 16:13:47 +08:00
|
|
|
AC_MSG_CHECKING([libimaevm >= 1.0])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
[[#include <imaevm.h>]],
|
|
|
|
[[return sign_hash(NULL, NULL, 0, NULL, NULL, NULL);]]
|
|
|
|
)],
|
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(WITH_IMAEVM, 1, [Build with imaevm support?])
|
|
|
|
WITH_IMAEVM_LIB="-limaevm"
|
|
|
|
],
|
|
|
|
[AC_MSG_ERROR([libimaevm not present or too old (< 1.0)])]
|
|
|
|
)
|
2015-07-22 01:00:40 +08:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(WITH_IMAEVM,[test "$with_imaevm" = yes])
|
2017-06-08 22:20:37 +08:00
|
|
|
AC_SUBST(WITH_IMAEVM_LIB)
|
2015-07-22 01:00:40 +08:00
|
|
|
|
2008-10-26 20:17:16 +08:00
|
|
|
# libcap
|
|
|
|
WITH_CAP_LIB=
|
2009-11-27 21:57:44 +08:00
|
|
|
AC_ARG_WITH(cap, [AS_HELP_STRING([--with-cap],[build with capability support])],
|
2008-10-26 20:17:16 +08:00
|
|
|
[case "$with_cap" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --with-cap])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[with_cap=no])
|
|
|
|
|
|
|
|
AS_IF([test "$with_cap" = yes],[
|
|
|
|
AC_CHECK_HEADER([sys/capability.h],[
|
2008-11-14 15:47:43 +08:00
|
|
|
AC_CHECK_LIB(cap,[cap_get_file], [
|
|
|
|
with_cap=yes
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
AC_CHECK_LIB(cap,[cap_compare], [
|
|
|
|
AC_DEFINE(HAVE_CAP_COMPARE, 1, [Have cap_compare function?])
|
|
|
|
])
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
],[
|
2008-10-26 20:17:16 +08:00
|
|
|
AC_MSG_ERROR([--with-cap given, but libcap not found])])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([--with-cap given, but sys/capability.h not found])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AS_IF([test "$with_cap" = yes],[
|
|
|
|
AC_DEFINE(WITH_CAP, 1, [Build with capability support?])
|
|
|
|
WITH_CAP_LIB="-lcap"
|
|
|
|
])
|
|
|
|
AC_SUBST(WITH_CAP_LIB)
|
|
|
|
AM_CONDITIONAL(CAP,[test "$with_cap" = yes])
|
|
|
|
|
2008-10-26 20:18:17 +08:00
|
|
|
WITH_ACL_LIB=
|
2009-11-27 21:57:44 +08:00
|
|
|
AC_ARG_WITH(acl, [AS_HELP_STRING([--with-acl],[build with acl support])],
|
2008-10-26 20:18:17 +08:00
|
|
|
[case "$with_acl" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --with-acl])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[with_acl=no])
|
|
|
|
|
|
|
|
AS_IF([test "$with_acl" = yes],[
|
|
|
|
dnl verification uses non-portable acl_equiv_mode()
|
|
|
|
AC_CHECK_HEADER([acl/libacl.h],[
|
|
|
|
AC_CHECK_LIB(acl,[acl_equiv_mode],[with_acl=yes],[
|
|
|
|
AC_MSG_ERROR([--with-acl given, but libacl not found or not suitable])])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([--with-acl given, but acl/libacl.h not found])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AS_IF([test "$with_acl" = yes],[
|
|
|
|
AC_DEFINE(WITH_ACL, 1, [Build with acl support?])
|
|
|
|
WITH_ACL_LIB="-lacl"
|
|
|
|
])
|
|
|
|
AC_SUBST(WITH_ACL_LIB)
|
|
|
|
AM_CONDITIONAL(ACL,[test "$with_acl" = yes])
|
|
|
|
|
2011-03-28 17:47:34 +08:00
|
|
|
AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [build with lua support])],
|
|
|
|
[],
|
|
|
|
[with_lua=yes])
|
|
|
|
|
|
|
|
AS_IF([test "$with_lua" != no],[
|
|
|
|
PKG_CHECK_MODULES([LUA],
|
|
|
|
[lua >= 5.1],
|
|
|
|
[AC_DEFINE(WITH_LUA, 1, [Build with lua support?])],
|
|
|
|
[AC_MSG_ERROR([lua not present (--without-lua to disable)])])
|
|
|
|
AC_SUBST(LUA_CFLAGS)
|
|
|
|
AC_SUBST(LUA_LIBS)
|
2007-08-13 13:30:28 +08:00
|
|
|
])
|
2011-03-28 17:47:34 +08:00
|
|
|
AM_CONDITIONAL(WITH_LUA,[test "$with_lua" = yes])
|
2004-07-06 03:21:18 +08:00
|
|
|
|
2010-10-01 15:43:55 +08:00
|
|
|
AC_ARG_ENABLE(plugins, [AS_HELP_STRING([--disable-plugins],[build without plugin support])],,[enable_plugins=yes])
|
|
|
|
AS_IF([test "$enable_plugins" = yes],[
|
|
|
|
AC_DEFINE(ENABLE_PLUGINS, 1, [Build with plugin support?])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL(ENABLE_PLUGINS,[test "$enable_plugins" = yes])
|
|
|
|
|
2018-02-26 22:31:07 +08:00
|
|
|
AC_ARG_ENABLE(inhibit_plugin, [AS_HELP_STRING([--disable-inhibit-plugin],[build without systemd inhibit plugin])],,[enable_inhibit_plugin=yes])
|
|
|
|
AS_IF([test "$enable_inhibit_plugin" = yes],[
|
|
|
|
AC_DEFINE(ENABLE_INHIBIT_PLUGIN, 1, [Build with systemd inhibit plugin?])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL(ENABLE_INHIBIT_PLUGIN,[test "$enable_inhibit_plugin" = yes])
|
|
|
|
|
2013-01-15 17:12:52 +08:00
|
|
|
with_dbus=no
|
|
|
|
AS_IF([test "$enable_plugins" != no],[
|
2018-02-26 22:31:07 +08:00
|
|
|
AS_IF([test "$enable_inhibit_plugin" != no],[
|
2013-01-15 17:12:52 +08:00
|
|
|
PKG_CHECK_MODULES([DBUS],
|
2013-03-06 03:35:19 +08:00
|
|
|
[dbus-1 >= 1.3],
|
2013-01-15 17:12:52 +08:00
|
|
|
[AC_DEFINE(DBUS, 1, [Build with dbus support?]) with_dbus=yes],
|
|
|
|
[with_dbus=no])
|
|
|
|
AC_SUBST(DBUS_CFLAGS)
|
|
|
|
AC_SUBST(DBUS_LIBS)
|
2018-02-26 22:31:07 +08:00
|
|
|
])
|
2013-01-15 17:12:52 +08:00
|
|
|
])
|
|
|
|
AM_CONDITIONAL(DBUS, [test "$with_dbus" = yes])
|
2010-10-01 15:43:55 +08:00
|
|
|
|
2017-10-27 17:49:29 +08:00
|
|
|
AS_IF([test "$enable_plugins" != no],[
|
|
|
|
AC_CHECK_FUNCS(lsetxattr, [], [], [#include <sys/xattr.h>])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL(IMA, [test "x$ac_cv_func_lsetxattr" = xyes])
|
|
|
|
|
2019-03-28 19:56:07 +08:00
|
|
|
#=================
|
|
|
|
# Check for audit library.
|
|
|
|
AC_ARG_WITH(audit,
|
|
|
|
AS_HELP_STRING([--with-audit],[Linux audit plugin]),
|
|
|
|
with_audit=$withval,
|
|
|
|
with_audit=auto)
|
|
|
|
|
|
|
|
WITH_AUDIT_LIB=
|
|
|
|
AS_IF([test "$enable_plugins" != no],[
|
|
|
|
AS_IF([test "x$with_audit" != xno],[
|
|
|
|
AC_SEARCH_LIBS([audit_open],[audit],[
|
|
|
|
WITH_AUDIT_LIB="$ac_res"
|
|
|
|
AC_DEFINE(WITH_AUDIT, 1, [libaudit support])
|
|
|
|
with_audit=yes
|
|
|
|
],[
|
|
|
|
if test "x$with_audit" != xauto; then
|
|
|
|
AC_MSG_ERROR([missing audit library])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AC_SUBST(WITH_AUDIT_LIB)
|
|
|
|
AM_CONDITIONAL(AUDIT,[test "$with_audit" = yes])
|
|
|
|
|
2007-08-24 12:05:45 +08:00
|
|
|
with_dmalloc=no
|
2009-11-27 21:57:44 +08:00
|
|
|
AC_ARG_WITH(dmalloc, [AS_HELP_STRING([--with-dmalloc],[build with dmalloc debugging support])])
|
2007-08-24 12:05:45 +08:00
|
|
|
if test "$with_dmalloc" = yes ; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(DMALLOC, 1, [Build with dmalloc support?])
|
2000-12-13 04:03:45 +08:00
|
|
|
LIBS="$LIBS -ldmalloc"
|
|
|
|
fi
|
|
|
|
|
2018-01-04 22:39:51 +08:00
|
|
|
user_with_uid0=$(awk -F: '$3==0 {print $1;exit}' /etc/passwd)
|
|
|
|
group_with_gid0=$(awk -F: '$3==0 {print $1;exit}' /etc/group)
|
2017-05-16 15:42:11 +08:00
|
|
|
AC_DEFINE_UNQUOTED([UID_0_USER],["$user_with_uid0"],[Get the user name having userid 0])
|
|
|
|
AC_DEFINE_UNQUOTED([GID_0_GROUP],["$group_with_gid0"],[Get the group name having groupid 0])
|
|
|
|
|
1998-04-04 00:33:19 +08:00
|
|
|
#
|
2007-11-26 22:38:20 +08:00
|
|
|
# get rid of the 4-th tuple, if config.guess returned "linux-gnu" for host_os
|
1998-04-04 00:33:19 +08:00
|
|
|
#
|
2007-11-26 22:38:20 +08:00
|
|
|
host_os_gnu=-gnu
|
|
|
|
if echo "$host_os" | grep '.*-gnulibc1' > /dev/null ; then
|
|
|
|
host_os=`echo "${host_os}" | sed 's/-gnulibc1$//'`
|
1999-04-21 03:17:23 +08:00
|
|
|
fi
|
2007-11-26 22:38:20 +08:00
|
|
|
if echo "$host_os" | grep '.*-gnueabi' > /dev/null ; then
|
|
|
|
host_os=`echo "${host_os}" | sed 's/-gnueabi$//'`
|
|
|
|
host_os_gnu=-gnueabi
|
2007-06-21 20:13:04 +08:00
|
|
|
fi
|
2007-11-26 22:38:20 +08:00
|
|
|
if echo "$host_os" | grep '.*-gnu' > /dev/null ; then
|
|
|
|
host_os=`echo "${host_os}" | sed 's/-gnu$//'`
|
1998-04-04 00:33:19 +08:00
|
|
|
fi
|
|
|
|
|
1998-04-09 10:41:13 +08:00
|
|
|
changequote(<, >)
|
2007-11-26 22:38:20 +08:00
|
|
|
host_os_exact="${host_os}"
|
|
|
|
host_os_major=`echo "${host_os}" | sed 's/\..*$//'`
|
|
|
|
host_os_noversion=`echo "${host_os}" | sed 's/[0-9]*\..*$//'`
|
1998-04-09 10:41:13 +08:00
|
|
|
changequote([, ])
|
1998-04-04 00:33:19 +08:00
|
|
|
|
2011-03-25 17:25:47 +08:00
|
|
|
dnl permit overriding build_vendor for "canonical rpm vendor"
|
1999-03-14 06:37:47 +08:00
|
|
|
RPMCANONVENDOR="$build_vendor"
|
2011-03-25 17:25:47 +08:00
|
|
|
AC_ARG_WITH([vendor],
|
|
|
|
AS_HELP_STRING([--with-vendor=VENDOR], [specify rpm vendor name]),
|
|
|
|
[RPMCANONVENDOR=$withval])
|
|
|
|
AC_DEFINE_UNQUOTED([RPMCANONVENDOR],["${RPMCANONVENDOR}"],[canonical vendor])
|
|
|
|
|
2007-11-26 22:38:20 +08:00
|
|
|
RPMCANONOS="$host_os_noversion"
|
|
|
|
RPMCANONGNU="$host_os_gnu"
|
1999-03-14 06:37:47 +08:00
|
|
|
AC_SUBST(RPMCANONVENDOR)
|
|
|
|
AC_SUBST(RPMCANONOS)
|
2007-08-06 19:47:10 +08:00
|
|
|
AC_SUBST(RPMCANONGNU)
|
1999-03-14 06:37:47 +08:00
|
|
|
|
2014-05-07 14:12:46 +08:00
|
|
|
RUNDIR="/run"
|
|
|
|
AC_ARG_WITH([rundir],
|
|
|
|
AS_HELP_STRING([--with-rundir=RUNDIR], [specify run-time variable directory]),
|
|
|
|
[RUNDIR=$withval])
|
|
|
|
AC_DEFINE_UNQUOTED([RUNDIR],["${RUNDIR}"],[run-time variable directory])
|
|
|
|
AC_SUBST(RUNDIR)
|
|
|
|
|
1999-08-26 04:00:26 +08:00
|
|
|
if test X"$prefix" = XNONE ; then
|
|
|
|
usrprefix="$ac_default_prefix"
|
|
|
|
else
|
|
|
|
usrprefix=$prefix
|
|
|
|
fi
|
2007-07-25 22:10:57 +08:00
|
|
|
|
1999-08-26 04:00:26 +08:00
|
|
|
RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
|
1998-10-16 00:34:51 +08:00
|
|
|
AC_SUBST(RPMCONFIGDIR)
|
2000-08-28 03:43:51 +08:00
|
|
|
|
2000-12-04 08:55:17 +08:00
|
|
|
AC_SUBST(OBJDUMP)
|
|
|
|
|
2007-10-18 22:04:00 +08:00
|
|
|
AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
|
2007-12-11 16:12:12 +08:00
|
|
|
AM_CONDITIONAL([HACKINGDOCS],[test "$with_hackingdocs" = yes])
|
2007-09-17 17:33:18 +08:00
|
|
|
|
2007-08-20 18:31:28 +08:00
|
|
|
AC_PATH_PROG(AUTOM4TE,autom4te,:)
|
|
|
|
|
2007-11-22 22:54:42 +08:00
|
|
|
AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
|
|
|
|
|
2016-12-09 16:31:58 +08:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2010-10-22 20:00:49 +08:00
|
|
|
rpmio/Makefile lib/Makefile build/Makefile sign/Makefile
|
2010-03-23 22:21:27 +08:00
|
|
|
po/Makefile.in scripts/Makefile fileattrs/Makefile
|
2007-07-24 19:21:32 +08:00
|
|
|
misc/Makefile
|
2002-06-21 01:17:23 +08:00
|
|
|
doc/Makefile
|
|
|
|
python/Makefile
|
2008-04-16 20:13:25 +08:00
|
|
|
luaext/Makefile
|
2007-08-21 22:29:51 +08:00
|
|
|
tests/Makefile
|
2010-06-22 05:04:40 +08:00
|
|
|
plugins/Makefile
|
2011-03-09 21:37:07 +08:00
|
|
|
python/setup.py
|
2004-01-05 22:09:47 +08:00
|
|
|
])
|
|
|
|
AC_OUTPUT
|