AC_PREREQ(2.61)
-AC_INIT(rpm, 4.4.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])
+fi
+
AS=${AS-as}
AC_SUBST(AS)
if test "$GCC" = yes; then
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"
+ cflags_to_try="-fno-strict-aliasing -fstack-protector -Wempty-body"
AC_MSG_CHECKING([supported compiler flags])
old_cflags=$CFLAGS
echo
AC_SYS_LARGEFILE
-AC_CHECK_HEADER([stdarg.h])
-AC_MSG_CHECKING([for va_copy])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdarg.h>
-void foo(int i, ...) {
- va_list ap, aq;
- va_start(ap, i);
- va_copy(aq,ap);
- va_end(aq);
-}]], [[
- foo(1,2,3,4);
-]])],[ac_cv_va_copy=yes],[ac_cv_va_copy=no])
-AC_MSG_RESULT([$ac_cv_va_copy])
-
-RPMUSER=rpm
-RPMUID=37
-RPMGROUP=rpm
-RPMGID=37
-export RPMUSER RPMUID RPMGROUP RPMGID
-AC_SUBST(RPMUSER)
-AC_SUBST(RPMUID)
-AC_SUBST(RPMGROUP)
-AC_SUBST(RPMGID)
-
-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_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.
AC_SUBST(WITH_BZ2_LIB)
#=================
+# Check for lzma library.
+
+AC_CHECK_HEADERS([lzma.h],[
+ AC_CHECK_LIB(lzma, lzma_easy_encoder, [WITH_LZMA_LIB=-llzma])
+])
+AC_SUBST(WITH_LZMA_LIB)
+
+#=================
dnl
dnl Check for features
#=================
# Check for NSS library.
+# 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
+# which we use too and hopefully is slightly more unique to NSS.
WITH_NSS_INCLUDE=
WITH_NSS_LIB=
-check=`pkg-config --version 2>/dev/null`
-if test -n "$check"; then
- addlib=$(pkg-config --libs nss | sed 's/-lsmime3//;s/-lssl3//')
- addcppflags=$(pkg-config --cflags nss)
-else
-# Without pkg-config, we'll kludge in some defaults
- addlib="-lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
- addcppflags="-I/usr/include/nss3 -I/usr/include/nspr4"
-fi
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$save_CPPFLAGS $addcppflags"
-AC_CHECK_HEADER([nss3/nss.h], [
- AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
- AC_DEFINE(HAVE_LIBNSS, 1, [Define to 1 if you have the 'NSS' library (-lnss3).])
- WITH_NSS_INCLUDE="$addcppflags"
- WITH_NSS_LIB="$addlib"
- ])
-],[
- AC_MSG_ERROR([missing required header nss3/nss.h])
+AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [
+ AC_MSG_ERROR([missing required NSPR / NSS header])
+])
+AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
+ WITH_NSS_LIB=-lnss3
+], [
+ AC_MSG_ERROR([missing required NSS library 'nss3'])
])
-CPPFLAGS="$save_CPPFLAGS"
AC_SUBST(WITH_NSS_INCLUDE)
AC_SUBST(WITH_NSS_LIB)
AC_MSG_ERROR([missing required header db.h])
])
;;
-* ) # Fall back to internal db
- # XXX for now we always have in-tree BDB available...
- AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
+* ) # Fall back to internal db if available
+ if [ test -x db/dist/configure ]; then
+ AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
+ else
+ AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL])
+ fi
;;
esac
AC_HEADER_TIME
AC_CHECK_HEADERS(locale.h)
-
+AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(fcntl.h getopt.h grp.h memory.h netdb.h pwd.h utime.h)
AC_CHECK_HEADERS(sys/ipc.h sys/socket.h sys/select.h)
AC_CHECK_HEADERS(err.h mcheck.h)
AC_CHECK_HEADERS(glob.h)
-AC_CHECK_HEADERS(locale.h)
dnl statfs portability fiddles.
dnl
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_TYPE_SIZE_T
dnl Checks for library functions.
-AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
dnl XXX don't want to re-enable code that's been unused for years at this
dnl point, but should offer good performance improvements, check after
AC_CHECK_FUNCS(ftok)
-AC_CHECK_FUNCS(mkstemp)
+AC_CHECK_FUNCS([mkstemp], [], [AC_MSG_ERROR([mkstemp() is required by rpm])])
dnl XXX Glob *is* broken on linux with libc5, solaris and possibly aix when
dnl %files gets something like
AC_PATH_PROG(DOXYGEN, doxygen, no)
dnl
-dnl Auto-detect whether doxygen generated API docs should be included.
+dnl Only build internal API + source hacking docs on request
dnl
-AC_ARG_WITH(apidocs, [ --with-apidocs build rpm API docs ],,[with_apidocs=auto])
+AC_ARG_WITH(hackingdocs, [ --with-hackingdocs build rpm hacking docs ],,[with_hackingdocs=no])
-case "$with_apidocs" in
+case "$with_hackingdocs" in
auto)
- AS_IF([test "$DOXYGEN" = no],[with_apidocs=no],[with_apidocs=yes])
+ AS_IF([test "$DOXYGEN" = no],[with_hackingdocs=no],[with_hackingdocs=no])
;;
yes)
AS_IF([test "$DOXYGEN" = no],
- [AC_MSG_ERROR([rpm API docs needs doxygen in PATH])])
+ [AC_MSG_ERROR([rpm hacking docs eeds doxygen in PATH])])
;;
esac
AC_CHECK_PROG(HAVE_DOT,[dot],[YES],[NO])
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_CHECK_HEADER([lua.h],[
+ AC_CHECK_LIB(lua,[luaL_openlibs],[with_lua=yes],[
+ AC_MSG_ERROR([--with-lua given, but liblua not found])
+ ],
+ [-lm])
+ ],[
+ AC_MSG_ERROR([--with-lua given, but lua.h not found])
+ ])
+])
+
+AS_IF([test "$with_lua" = yes],[
AC_DEFINE(WITH_LUA, 1, [Build with lua support?])
- WITH_LUA_INCLUDE="-I\${top_srcdir}/lua/include -I\${top_srcdir}/lua/local"
- WITH_LUA_LIB="\$(top_builddir)/lua/liblua.la"
+ WITH_LUA_INCLUDE=
+ WITH_LUA_LIB="-llua -lm"
])
AC_SUBST(WITH_LUA_LIB)
AC_SUBST(WITH_LUA_INCLUDE)
+AM_CONDITIONAL(WITH_LUAEXT,[test "$with_lua" = yes])
with_dmalloc=no
AC_ARG_WITH(dmalloc, [ --with-dmalloc build with dmalloc debugging support ])
AC_SUBST(__CHOWN_RHF)
AC_SUBST(__CHGRP_RHF)
-dnl
-dnl figure out what root's primary group is
-dnl
-AC_MSG_CHECKING(root's primary group)
-AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
-
-int main()
-{
- struct passwd *root = NULL;
- struct group *roots_group = NULL;
- FILE * tempfile = NULL;
-
- root = getpwuid( (uid_t) 0 );
- if (root != NULL) {
- roots_group = getgrgid(root->pw_gid);
- if (roots_group != NULL) {
- tempfile = fopen("conftest_rootg", "w");
- if (tempfile != NULL) {
- fprintf(tempfile, "%s\n", roots_group->gr_name);
- fclose(tempfile);
- exit(0);
- }
- }
- }
-
- exit(1);
-}]])],[ROOT_GROUP=`cat conftest_rootg`],[ROOT_GROUP="root"],[ROOT_GROUP="root"
-])
-AC_MSG_RESULT($ROOT_GROUP)
-AC_SUBST(ROOT_GROUP)
-
if echo "$host_os" | grep sco > /dev/null; then
echo "hacking things up for sco"
AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include <strings.h> (along with <string.h>)])
fi
dnl Determine the canonical arch-vendor-os for the host machine
-autorelocate_path='%{nil}'
-autorelocate_dcolor='0'
case "${host_cpu}" in
*86) RPMCANONCOLOR=0; RPMCANONARCH=i386 ;;
ia32e*) RPMCANONCOLOR=3; RPMCANONARCH=ia32e ;;
alpha*) RPMCANONCOLOR=0; RPMCANONARCH=alpha ;;
sparc64*) RPMCANONCOLOR=3; RPMCANONARCH=sparc64 ;;
sparc*) RPMCANONCOLOR=3; RPMCANONARCH=sparc ;;
-ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64;
- autorelocate_path='/emul/%%{ARCH}-%%{OS}'
- autorelocate_dcolor='1' ;;
+ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64 ;;
s390x*) RPMCANONCOLOR=3; RPMCANONARCH=s390x ;;
s390*) RPMCANONCOLOR=0; RPMCANONARCH=s390 ;;
powerpc64*|ppc64*) RPMCANONCOLOR=3; RPMCANONARCH=ppc64 ;;
mipsel*) RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
mips*) RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
m68k*) RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
+sh3*) RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
+sh4*) RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
*) RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
esac
case "${host_os_noversion}" in
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
RPMCANONOS="$host_os_noversion"
RPMCANONGNU="$host_os_gnu"
AC_SUBST(RPMCANONCOLOR)
-AC_SUBST(autorelocate_path)
-AC_SUBST(autorelocate_dcolor)
AC_SUBST(RPMCANONARCH)
AC_SUBST(RPMCANONVENDOR)
AC_SUBST(RPMCANONOS)
AC_SUBST(OBJDUMP)
-AC_CONFIG_SUBDIRS(db3)
+if test "$with_external_db" = no; then
+ AC_CONFIG_SUBDIRS(db3)
+fi
AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no])
AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
-AM_CONDITIONAL([APIDOCS],[test "$with_apidocs" == yes])
+AM_CONDITIONAL([HACKINGDOCS],[test "$with_hackingdocs" = yes])
AC_PATH_PROG(AUTOM4TE,autom4te,:)
AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
-AC_CONFIG_HEADERS([rpmdb/rpmints.h])
-
AC_CONFIG_FILES([Makefile
- rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
+ rpmio/Makefile lib/Makefile build/Makefile
po/Makefile.in scripts/Makefile
misc/Makefile
doc/Makefile
python/Makefile
- lua/Makefile
+ luaext/Makefile
tests/Makefile
])
AC_OUTPUT