X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.ac;h=af593fed5d288bd2be7263dd999fd9e14b1a00c7;hb=6b52f62e25ed30e68b4997fac0c52ad1876d4665;hp=f24e555d74bd9b803c8f75a5dee51ac28a6db22b;hpb=dbea7fa32e1eb0b69a24a10d6edc4265861e083d;p=platform%2Fupstream%2Frpm.git diff --git a/configure.ac b/configure.ac index f24e555..af593fe 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,13 @@ AC_PREREQ(2.61) -AC_INIT(rpm, 4.9.90, rpm-maint@lists.rpm.org) +AC_INIT(rpm, 4.11.0.1, 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]) +dnl Allow silent build on automake versions that support it +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_CONFIG_TESTDIR(tests) @@ -35,20 +37,19 @@ fi AS=${AS-as} AC_SUBST(AS) if test "$GCC" = yes; then - CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes" cflags_to_try="-fno-strict-aliasing -fstack-protector -Wempty-body" AC_MSG_CHECKING([supported compiler flags]) old_cflags=$CFLAGS echo for flag in $cflags_to_try; do - CFLAGS="$CFLAGS $flag" + CFLAGS="$CFLAGS $flag -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ echo " $flag" RPMCFLAGS="$RPMCFLAGS $flag" ],[]) CFLAGS=$old_cflags done - CFLAGS="$CFLAGS $RPMCFLAGS" + CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes $RPMCFLAGS" fi export CFLAGS @@ -89,6 +90,7 @@ fi dnl dnl Find some common programs dnl +AC_PATH_PROG(__7ZIP, 7zip, /usr/bin/7za, $MYPATH) AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH) AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH) AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH) @@ -139,6 +141,11 @@ 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(__GIT, git, /usr/bin/git, $MYPATH) +AC_PATH_PROG(__HG, hg, /usr/bin/hg, $MYPATH) +AC_PATH_PROG(__BZR, bzr, /usr/bin/bzr, $MYPATH) +AC_PATH_PROG(__QUILT, quilt, /usr/bin/quilt, $MYPATH) + AC_PATH_PROG(__FAKECHROOT, fakechroot, no, $MYPATH) AM_CONDITIONAL(HAVE_FAKECHROOT, [test "$__FAKECHROOT" != "no"]) @@ -236,20 +243,56 @@ AC_CHECK_HEADERS([dwarf.h], [ AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes]) #================= +# Check for beecrypt library if requested. +AC_ARG_WITH(beecrypt, [ --with-beecrypt build with beecrypt support ],,[with_beecrypt=no]) +AC_ARG_WITH(internal_beecrypt, [ --with-internal-beecrypt build with internal beecrypt library ],,[with_internal_beecrypt=no]) +AM_CONDITIONAL([WITH_INTERNAL_BEECRYPT],[test "$with_internal_beecrypt" = yes]) +if test "$with_internal_beecrypt" = yes ; then + with_beecrypt=yes +fi +AM_CONDITIONAL([WITH_BEECRYPT],[test "$with_beecrypt" = yes]) + +WITH_BEECRYPT_INCLUDE= +WITH_BEECRYPT_LIB= +if test "$with_beecrypt" = yes ; then + 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 header file.]) + else + AC_CHECK_LIB(beecrypt, mpfprintln, [ + WITH_BEECRYPT_LIB="-lbeecrypt" + ],[ + AC_MSG_ERROR([missing required library 'beecrypt']) + ]) + AC_CHECK_HEADER([beecrypt/api.h], [AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the header file.]) + ]) + fi +fi +AC_SUBST(WITH_BEECRYPT_LIB) +AC_SUBST(WITH_BEECRYPT_INCLUDE) + +#================= # 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= +if test "$with_beecrypt" != yes ; then AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [ AC_MSG_ERROR([missing required NSPR / NSS header]) ]) -AC_CHECK_LIB(nss3, NSS_NoDB_Init, [ +AC_CHECK_LIB(nss3, VFY_VerifyDigestDirect, [ WITH_NSS_LIB=-lnss3 + 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]) + ]) ], [ - AC_MSG_ERROR([missing required NSS library 'nss3']) + AC_MSG_ERROR([required NSS library 'nss3' missing or too old]) ]) +fi AC_SUBST(WITH_NSS_INCLUDE) AC_SUBST(WITH_NSS_LIB) @@ -344,8 +387,6 @@ AC_CHECK_HEADERS(sys/utsname.h) AC_CHECK_HEADERS(sys/systemcfg.h) AC_CHECK_HEADERS(sys/param.h) -AC_CHECK_HEADERS(glob.h) - dnl statfs portability fiddles. dnl dnl We should really emulate/steal sections of the statfs and struct statfs @@ -359,25 +400,25 @@ dnl found_struct_statfs=no if test X$found_struct_statfs = Xno ; then -dnl Solaris 2.6+ wants to use statvfs +dnl first try including sys/vfs.h AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include #endif -#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h) - AC_DEFINE(STATFS_IN_SYS_STATVFS, 1, - [statfs in (for solaris 2.6+ systems)]) +#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h) + AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)]) found_struct_statfs=yes],[]) fi if test X$found_struct_statfs = Xno ; then -dnl first try including sys/vfs.h +dnl Solaris 2.6+ wants to use statvfs AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include #endif -#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h) - AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)]) +#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h) + AC_DEFINE(STATFS_IN_SYS_STATVFS, 1, + [statfs in (for solaris 2.6+ systems)]) found_struct_statfs=yes],[]) fi @@ -474,27 +515,18 @@ AC_TYPE_PID_T AC_TYPE_SIZE_T dnl Checks for library functions. -AC_FUNC_MMAP - AC_CHECK_FUNCS(putenv) +AC_CHECK_FUNCS(mempcpy) +AC_CHECK_FUNCS(fdatasync) AC_REPLACE_FUNCS(stpcpy stpncpy) -AC_CHECK_FUNCS(__secure_getenv) +AC_CHECK_FUNCS([secure_getenv __secure_getenv]) AC_CHECK_FUNCS( [mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown], [], [AC_MSG_ERROR([function required by rpm])]) -dnl XXX Glob *is* broken on linux with libc5, solaris and possibly aix when -dnl %files gets something like -dnl /usr/*/locale/*/LC_MESSAGES/*.mo -dnl (Note: more than one asterisk in glob pattern.) -dnl -dnl XXX Glob is "fixed" in glibc-2.3.3-61, but the cost is that -dnl dangling symlinks are no longer globbed. Always use the internal glob. -AC_DEFINE(USE_GNU_GLOB, 1, [Use the included glob.c?]) -AC_LIBOBJ(glob) AC_LIBOBJ(fnmatch) dnl check if python is requested @@ -633,6 +665,70 @@ AC_SUBST(WITH_SELINUX_LIB) AC_SUBST(WITH_SEMANAGE_LIB) AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes]) + +WITH_MSM_LIB= +AC_ARG_WITH(msm, [AS_HELP_STRING([--with-msm],[build with msm support])], +[case "$with_msm" in +yes|no) ;; +*) AC_MSG_ERROR([invalid argument to --with-msm]) + ;; +esac], +[with_msm=no]) + +AS_IF([test "$with_msm" = yes],[ + save_LIBS="$LIBS" + AC_CHECK_LIB([xml2],[xmlReaderForMemory],[],[ + AC_MSG_ERROR([--with-msm given, but xmlReaderForMemory not found in libxml2])]) + LIBS="$save_LIBS" + AC_CHECK_HEADER([sys/capability.h],[ + save_LIBS="$LIBS" + AC_CHECK_LIB([cap],[cap_set_file],[],[ + AC_MSG_ERROR([--with-msm given, but cap_set_file not found in libcap])]) + LIBS="$save_LIBS" + ],[ + AC_MSG_ERROR([--with-msm given, but sys/capability.h not found]) + ]) + + PKG_CHECK_MODULES( + [LIBXML2], + [libxml-2.0 >= 2.0], + [AC_DEFINE(WITH_LIBXML2, 1, [Build with libxml2 support])], + [AC_MSG_ERROR([--with-msm given, but libxml2 not found])] + ) + AC_SUBST(LIBXML2_CFLAGS) + AC_SUBST(LIBXML2_LIBS) + + AC_CHECK_HEADER([attr/xattr.h],[ + save_LIBS="$LIBS" + AC_CHECK_LIB([attr],[setxattr],[],[ + AC_MSG_ERROR([--with-msm given, but setxattr not found in libattr])]) + LIBS="$save_LIBS" + ],[ + AC_MSG_ERROR([--with-msm given, but attr/xattr.h not found]) + ]) + AC_CHECK_HEADER([uthash.h],[ + save_LIBS="$LIBS" + LIBS="$save_LIBS" + ],[ + AC_MSG_ERROR([--with-msm given, but uthash.h not found]) + ]) + AC_CHECK_HEADER([sys/smack.h],[ + save_LIBS="$LIBS" + LIBS="$save_LIBS" + ],[ + AC_MSG_ERROR([--with-msm given, but smack.h not found]) + ]) +]) + +AS_IF([test "$with_msm" = yes],[ + AC_DEFINE(WITH_MSM, 1, [Build with msm support?]) + WITH_MSM_LIB="`xml2-config --libs` -lcap -lattr -lsmack -lmagic" + WITH_MSM_INCLUDE="`xml2-config --cflags`" +]) +AC_SUBST(WITH_MSM_LIB) +AC_SUBST(WITH_MSM_INCLUDE) +AM_CONDITIONAL(MSM,[test "$with_msm" = yes]) + # libcap WITH_CAP_LIB= AC_ARG_WITH(cap, [AS_HELP_STRING([--with-cap],[build with capability support])], @@ -736,6 +832,9 @@ fi if echo "$host_os" | grep '.*-gnu' > /dev/null ; then host_os=`echo "${host_os}" | sed 's/-gnu$//'` fi +if echo "$host_os" | grep '.*-uclibc' > /dev/null ; then + host_os=`echo "${host_os}" | sed 's/-uclibc$//'` +fi changequote(<, >) host_os_exact="${host_os}"