AC_PREREQ(2.61)
-AC_INIT(rpm, 4.5.90, rpm-maint@lists.rpm.org)
+AC_INIT(rpm, 4.7.90, rpm-maint@lists.rpm.org)
AC_CONFIG_SRCDIR([rpmqv.c])
AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.10 foreign tar-ustar dist-bzip2 subdir-objects nostdinc])
AC_PROG_LIBTOOL
AC_PROG_YACC
+AC_SUBST(__CC, $CC)
AC_PROG_CC_C99
if test "$ac_cv_prog_cc_c99" = no; then
AC_MSG_ERROR([ISO C99 capable compiler required])
CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts"
# XXX disabled for now due to noise from NSPR headers
# CFLAGS="$CFLAGS -Wstrict-prototypes"
- cflags_to_try="-fno-strict-aliasing -fstack-protector"
+ cflags_to_try="-fno-strict-aliasing -fstack-protector -Wempty-body"
AC_MSG_CHECKING([supported compiler flags])
old_cflags=$CFLAGS
echo
AC_SYS_LARGEFILE
dnl
-dnl This now uses libtool. Put
-dnl LDFLAGS_STATIC="-all"
-dnl to attempt static executables using libtool. Otherwise
-dnl LDFLAGS_STATIC=""
-dnl
-AC_MSG_CHECKING(flag used by libtool to link rpm)
-if test X"$GCC" = Xyes ; then
- case "$host" in
- *-*-linux*) LDFLAGS_STATIC="-all-static" ;;
- *-*-solaris*) LDFLAGS_STATIC="-static";;
- *-*-hpux*) LDFLAGS_STATIC="-static";;
- *-*-darwin*) LDFLAGS_STATIC="";; # Mac OS X does not do static binaries.
- *-*-sysv5uw*) LDFLAGS_STATUS="-static";; # Unixware has no shared libthread.
- *-*-*) LDFLAGS_STATIC="";;
- esac
-elif test X"$CC" = Xcc ; then
- case "$host" in
- *-*-linux*) LDFLAGS_STATIC="-all-static";;
- *-*-freebsd*) LDFLAGS_STATIC="-all-static";;
- *-*-osf*) LDFLAGS_STATIC="";; # OSF5 has no shared pthreads libs
- *-*-aix*) LDFLAGS_STATIC="-static";; # -Wl,-bnso doesn't seem to work...
- *-*-hpux*) LDFLAGS_STATIC="-static";;
- *-*-solaris*) LDFLAGS_STATIC="-static";;
- *-*-irix*) LDFLAGS_STATIC="-static";; #should be -non_shared, but can't
- # link because of crt1.o then.
- *-*-ultrix*) LDFLAGS_STATIC="-all-static";; #ultrix doesn't have shared libs.
- *-*-*) LDFLAGS_STATIC=""
-AC_MSG_WARN([
-
-Unable to guess what option to pass to $CC to generate a static
-executable. You will need to set the LDFLAGS_STATIC macro in Makefile.inc to
-the appropriate argument(s) if you want to build a static rpm executable.
-
-])
- ;;
- esac
-else
- # just link it dynamically
- LDFLAGS_STATIC=""
-fi
-LDFLAGS_STATIC="${LDFLAGS} ${LDFLAGS_STATIC}" # libtool format
-AC_MSG_RESULT($LDFLAGS_STATIC)
-AC_SUBST(LDFLAGS_STATIC)
-
-dnl
dnl look for POSIX chmod attributes
dnl
AC_MSG_CHECKING(POSIX chmod)
AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
AC_PATH_PROG(__LZMA, lzma, /usr/bin/lzma, $MYPATH)
+AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH)
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(__OBJCOPY, objcopy, /usr/bin/objcopy, $MYPATH)
AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
+AC_PATH_PROG(__FAKECHROOT, fakechroot, /usr/bin/fakechroot, $MYPATH)
#=================
# Check for zlib library.
# Check for lzma library.
AC_CHECK_HEADERS([lzma.h],[
- AC_CHECK_LIB(lzma, lzma_auto_decoder, [WITH_LZMA_LIB=-llzma])
+ AC_CHECK_LIB(lzma, lzma_easy_encoder, [WITH_LZMA_LIB=-llzma])
])
AC_SUBST(WITH_LZMA_LIB)
AC_DEFINE(HAVE_S_ISSOCK, 1, [Define as 1 if <sys/stat.h> defines S_ISSOCK])
fi
-AC_MSG_CHECKING(if timezone is defined)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[printf("%ld", timezone)]])],[HAS_TIMEZONE=yes],[HAS_TIMEZONE=no])
-AC_MSG_RESULT($HAS_TIMEZONE)
-
dnl Check for missing typedefs
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_SUBST(WITH_SELINUX_LIB)
AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
+# libcap
+WITH_CAP_LIB=
+AC_ARG_WITH(cap, [ --with-cap build with capability support ],
+[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],[
+ 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"
+ ],[
+ 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])
+
+WITH_ACL_LIB=
+AC_ARG_WITH(acl, [ --with-acl build with acl support ],
+[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])
+
WITH_LUA_LIB=
WITH_LUA_INCLUDE=
AC_ARG_WITH(lua, [ --with-lua build with lua support ],,[with_lua=yes])
AS_IF([test "$with_lua" = yes],[
AC_DEFINE(WITH_LUA, 1, [Build with lua support?])
- WITH_LUA_INCLUDE="-I\${top_srcdir}/luaext"
- WITH_LUA_LIB="-llua -lm \$(top_builddir)/luaext/libluaext.la"
+ WITH_LUA_INCLUDE=
+ WITH_LUA_LIB="-llua -lm"
])
AC_SUBST(WITH_LUA_LIB)
AC_SUBST(WITH_LUA_INCLUDE)
esac
RPMCANONVENDOR="$build_vendor"
case "${build_vendor}" in
-unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos)
+unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse)
test -f /etc/redhat-release && RPMCANONVENDOR=redhat
+ test -f /etc/SuSE-release && RPMCANONVENDOR=suse
test -f /etc/pld-release && RPMCANONVENDOR=pld
test -f /etc/mandrake-release && RPMCANONVENDOR=mandrake
test -f /etc/conectiva-release && RPMCANONVENDOR=conectiva