2 AC_INIT(rpm, 4.10.90, rpm-maint@lists.rpm.org)
4 AC_CONFIG_SRCDIR([rpmqv.c])
5 AC_CONFIG_HEADERS([config.h])
6 AC_CONFIG_MACRO_DIR([m4])
8 AM_INIT_AUTOMAKE([1.10 foreign tar-ustar dist-bzip2 subdir-objects nostdinc])
9 dnl Allow silent build on automake versions that support it
10 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
12 AC_CONFIG_TESTDIR(tests)
14 AC_USE_SYSTEM_EXTENSIONS
20 dnl Checks for programs.
33 if test "$ac_cv_prog_cc_c99" = no; then
34 AC_MSG_ERROR([ISO C99 capable compiler required])
39 if test "$GCC" = yes; then
40 CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes"
41 cflags_to_try="-fno-strict-aliasing -fstack-protector -Wempty-body"
42 AC_MSG_CHECKING([supported compiler flags])
45 for flag in $cflags_to_try; do
46 CFLAGS="$CFLAGS $flag"
47 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[
49 RPMCFLAGS="$RPMCFLAGS $flag"
53 CFLAGS="$CFLAGS $RPMCFLAGS"
60 dnl look for POSIX chmod attributes
62 AC_MSG_CHECKING(POSIX chmod)
64 chmod 744 foo.chmodtest
65 chmod +X foo.chmodtest 2>/dev/null
66 a=`ls -l foo.chmodtest | awk '{print substr($1,1,10)}'`
68 if test "$a" = "-rwxr-xr-x"; then
70 FIXPERMS=a+rX,u+w,g-w,o-w
72 AC_MSG_RESULT(no (tell your OS vendor about GNU fileutils))
73 FIXPERMS=a+r,u+w,g-w,o-w
80 AC_CHECK_TOOL(AR, ar, :)
83 dnl use defaults if cross-compiling, otherwise use the default path.
85 if test "$cross_compiling" = "yes"; then
92 dnl Find some common programs
94 AC_PATH_PROG(__7ZIP, 7zip, /usr/bin/7za, $MYPATH)
95 AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH)
96 AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
97 AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH)
98 AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH)
99 AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH)
100 AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH)
101 AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
102 AC_PATH_PROG(__CURL, curl, /usr/bin/curl, $MYPATH)
103 AC_PATH_PROG(__FILE, file, /usr/bin/file, $MYPATH)
104 AC_PATH_PROG(__GPG, gpg, /usr/bin/gpg, $MYPATH)
105 AC_PATH_PROG(__GREP, grep, /bin/grep, $MYPATH)
106 AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
107 AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH)
108 AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
109 AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
110 AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH)
111 AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH)
112 AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH)
113 AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
114 AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
115 AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
116 AC_PATH_PROG(__PATCH, patch, /usr/bin/patch, $MYPATH)
117 AC_PATH_PROG(__RESTORECON, restorecon, /sbin/restorecon, $MYPATH)
118 AC_MSG_CHECKING(old version of patch)
119 PATCHVERSION=`patch --version 2>&1`
121 if test "$PATCHVERSION" = "Patch version 2.1"; then
122 AC_DEFINE(HAVE_OLDPATCH_21, 1,
123 [Define if the patch call you'll be using is 2.1 or older])
124 AC_MSG_RESULT(patch older then 2.2 found)
126 AC_MSG_RESULT(patch later then 2.2 found)
129 AC_PATH_PROG(__PERL, perl, /usr/bin/perl, $MYPATH)
130 AC_PATH_PROG(__PGP, pgp, /usr/bin/pgp, $MYPATH)
131 AC_PATH_PROG(__PYTHON, python, /usr/bin/python, $MYPATH)
132 AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
133 AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
134 AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
135 AC_PATH_PROG(__SEMODULE, semodule, /usr/bin/semodule, $MYPATH)
136 AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH)
137 AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH)
139 AC_PATH_PROG(__LD, ld, /usr/bin/ld, $MYPATH)
140 AC_PATH_PROG(__NM, nm, /usr/bin/nm, $MYPATH)
141 AC_PATH_PROG(__OBJCOPY, objcopy, /usr/bin/objcopy, $MYPATH)
142 AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
143 AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
145 AC_PATH_PROG(__FAKECHROOT, fakechroot, no, $MYPATH)
146 AM_CONDITIONAL(HAVE_FAKECHROOT, [test "$__FAKECHROOT" != "no"])
148 dnl see if we have a mkdir that supports `-p' for rpmbuild's purposes
150 if ! echo $MKDIR_P | grep -q mkdir; then
151 __MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`"
155 AC_DEFINE_UNQUOTED(__MKDIR_P, "${__MKDIR_P}",
156 [A full path to a program, possibly with arguments, that will create a
157 directory and all necessary parent directories, ala 'mkdir -p'])
161 # Check for zlib library.
166 AC_CHECK_HEADERS([zlib.h],[
167 AS_IF([test -z "${WITH_ZLIB_LIB}"],[
168 for zlib in z gz ; do
169 AC_CHECK_LIB(${zlib}, gzread,
170 [WITH_ZLIB_LIB="-l${zlib}"; break])
173 dnl zlib-1.0.4 has not gzseek
174 AC_CHECK_LIB(${zlib}, gzseek, [AC_DEFINE(HAVE_GZSEEK, 1, [Define as 1 if your zlib has gzseek()])])
177 AC_MSG_ERROR([missing required header zlib.h])
180 AC_SUBST(WITH_ZLIB_INCLUDE)
181 AC_SUBST(WITH_ZLIB_LIB)
184 # Check for bzip2 library.
186 AC_CHECK_HEADERS([bzlib.h],[
187 AC_CHECK_LIB(bz2, BZ2_bzread, [WITH_BZ2_LIB=-lbz2])
189 AC_SUBST(WITH_BZ2_LIB)
192 # Check for lzma library.
194 AC_CHECK_HEADERS([lzma.h],[
195 AC_CHECK_LIB(lzma, lzma_easy_encoder, [WITH_LZMA_LIB=-llzma])
197 AC_SUBST(WITH_LZMA_LIB)
202 dnl Check for features
205 dnl Checks for libraries.
207 AC_CHECK_FUNC(gethostname, [], [
208 AC_CHECK_LIB(nsl, gethostname)
211 AC_CHECK_HEADERS(pthread.h)
213 AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [
214 dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
215 AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [
216 AC_CHECK_LIB(thread, mutex_lock)
220 AC_SEARCH_LIBS(dlopen, [dl])
223 # Check for libelf library. Prefer external, otherwise none.
225 AC_CHECK_HEADER([libelf.h])
226 AC_CHECK_HEADERS([gelf.h], [
227 AC_CHECK_LIB(elf, gelf_getvernaux, [
228 AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
229 WITH_LIBELF_LIB="-lelf"
233 AC_SUBST(WITH_LIBELF_LIB)
234 AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
236 AC_CHECK_HEADERS([dwarf.h], [
239 AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])
242 # Check for NSS library.
243 # We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS
244 # have a header named nss.h... so make extra check for NSS's sechash.h
245 # which we use too and hopefully is slightly more unique to NSS.
248 AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [
249 AC_MSG_ERROR([missing required NSPR / NSS header])
251 AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
254 AC_MSG_ERROR([missing required NSS library 'nss3'])
256 AC_SUBST(WITH_NSS_INCLUDE)
257 AC_SUBST(WITH_NSS_LIB)
260 # Check for magic library.
264 AC_CHECK_HEADER([magic.h], [
265 AC_CHECK_LIB(magic, magic_open, [
267 WITH_MAGIC_LIB="-lmagic"
269 AC_MSG_ERROR([missing required library 'libmagic'])
272 AC_MSG_ERROR([missing required header magic.h])
275 AC_SUBST(WITH_MAGIC_INCLUDE)
276 AC_SUBST(WITH_MAGIC_LIB)
279 # Check for popt library.
283 AC_CHECK_HEADER([popt.h], [
284 AC_CHECK_LIB(popt, poptGetContext, [
286 WITH_POPT_LIB="-lpopt"
288 AC_MSG_ERROR([missing required library popt])
291 AC_MSG_ERROR([missing required header popt.h])
294 AC_SUBST(WITH_POPT_INCLUDE)
295 AC_SUBST(WITH_POPT_LIB)
298 # Process --with/without-external-db
299 AC_ARG_WITH(external_db, [AS_HELP_STRING([--with-external-db],[build against an external Berkeley db])],
300 [case "$with_external_db" in
302 *) AC_MSG_ERROR([invalid argument to --with-external-db]) ;;
304 [with_external_db=no])
306 case "$with_external_db" in
308 AC_CHECK_HEADERS([db.h],[
312 #if ((DB_VERSION_MAJOR < 4) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 5))
313 #error Berkeley DB too old
316 ],[ WITH_DB_LIB=-ldb ],
317 [ AC_MSG_ERROR([Berkeley DB version >= 4.5 required])
320 AC_MSG_ERROR([missing required header db.h])
323 * ) # Fall back to internal db if available
324 if [ test -x db/dist/configure ]; then
325 AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
327 AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL])
332 AC_SUBST([WITH_DB_LIB])
334 AM_GNU_GETTEXT_VERSION([0.16.1])
335 AM_GNU_GETTEXT([external])
337 dnl Checks for header files we can live without.
340 AC_STRUCT_DIRENT_D_TYPE
342 AC_CHECK_HEADERS(limits.h)
343 AC_CHECK_HEADERS(fcntl.h getopt.h)
345 AC_CHECK_HEADERS(sys/utsname.h)
347 AC_CHECK_HEADERS(sys/systemcfg.h)
348 AC_CHECK_HEADERS(sys/param.h)
350 AC_CHECK_HEADERS(glob.h)
352 dnl statfs portability fiddles.
354 dnl We should really emulate/steal sections of the statfs and struct statfs
355 dnl checks from GNU fileutils.
357 AC_MSG_CHECKING(for struct statfs)
360 dnl this is easier than nesting AC_TRY_COMPILEs...
362 found_struct_statfs=no
364 if test X$found_struct_statfs = Xno ; then
365 dnl Solaris 2.6+ wants to use statvfs
366 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
367 #ifdef HAVE_SYS_TYPES_H
368 #include <sys/types.h>
370 #include <sys/statvfs.h> ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
371 AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
372 [statfs in <sys/statvfs.h> (for solaris 2.6+ systems)])
373 found_struct_statfs=yes],[])
376 if test X$found_struct_statfs = Xno ; then
377 dnl first try including sys/vfs.h
378 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
379 #ifdef HAVE_SYS_TYPES_H
380 #include <sys/types.h>
382 #include <sys/vfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
383 AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in <sys/vfs.h> (for linux systems)])
384 found_struct_statfs=yes],[])
387 if test X$found_struct_statfs = Xno ; then
388 dnl ...next try including sys/mount.h
389 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
390 #ifdef HAVE_SYS_TYPES_H
391 #include <sys/types.h>
393 #ifdef HAVE_SYS_PARAM_H
394 #include <sys/param.h>
396 #include <sys/mount.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/mount.h)
397 AC_DEFINE(STATFS_IN_SYS_MOUNT, 1, [statfs in <sys/mount.h> (for Digital Unix 4.0D systems)])
398 found_struct_statfs=yes],[])
401 if test X$found_struct_statfs = Xno ; then
402 dnl ...still no joy. Try sys/statfs.h
403 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
404 #ifdef HAVE_SYS_TYPES_H
405 #include <sys/types.h>
407 #include <sys/statfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/statfs.h)
408 AC_DEFINE(STATFS_IN_SYS_STATFS, 1, [statfs in <sys/statfs.h> (for Irix 6.4 systems)])
409 found_struct_statfs=yes],[])
412 if test X$found_struct_statfs = Xno ; then
413 dnl ...no luck. Warn the user of impending doom.
414 AC_MSG_WARN(not found)
418 dnl if we found the struct, see if it has the f_bavail member. Some OSes
419 dnl don't, including IRIX 6.5+
421 if test X$found_struct_statfs = Xyes ; then
422 AC_MSG_CHECKING(for f_bavail member in struct statfs)
423 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
424 #ifdef HAVE_SYS_TYPES_H
425 #include <sys/types.h>
427 #if STATFS_IN_SYS_STATVFS
428 # include <sys/statvfs.h>
429 typedef struct statvfs STATFS_t;
431 typedef struct statfs STATFS_t;
432 # if STATFS_IN_SYS_VFS
433 # include <sys/vfs.h>
434 # elif STATFS_IN_SYS_MOUNT
435 # include <sys/mount.h>
436 # elif STATFS_IN_SYS_STATFS
437 # include <sys/statfs.h>
439 #endif ]], [[STATFS_t sfs;
440 sfs.f_bavail = 0;]])],[AC_MSG_RESULT(yes)
441 AC_DEFINE(STATFS_HAS_F_BAVAIL, 1, [Define if struct statfs has the f_bavail member])],[AC_MSG_RESULT(no)
445 if test X$found_struct_statfs = Xyes ; then
447 dnl now check to see if we have the 4-argument variant of statfs()
448 dnl this pretty much requires AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[])
450 AC_MSG_CHECKING([if statfs() requires 4 arguments])
451 AC_RUN_IFELSE([AC_LANG_SOURCE([[
452 #ifdef HAVE_SYS_TYPES_H
453 #include <sys/types.h>
455 #ifdef STATFS_IN_SYS_VFS
457 #elif STATFS_IN_SYS_MOUNT
458 #include <sys/mouht.h>
459 #elif STATFS_IN_SYS_STATFS
460 #include <sys/statfs.h>
464 exit (statfs(".", &sfs, sizeof(sfs), 0));
466 ]])],[AC_MSG_RESULT(yes)
467 AC_DEFINE(STAT_STATFS4, 1, [Define if the statfs() call takes 4 arguments])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)
471 dnl look for libc features
473 dnl Check for missing typedefs
479 dnl Checks for library functions.
482 AC_CHECK_FUNCS(putenv)
484 AC_REPLACE_FUNCS(stpcpy stpncpy)
486 AC_CHECK_FUNCS(__secure_getenv)
489 [mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown],
490 [], [AC_MSG_ERROR([function required by rpm])])
492 dnl XXX Glob *is* broken on linux with libc5, solaris and possibly aix when
493 dnl %files gets something like
494 dnl /usr/*/locale/*/LC_MESSAGES/*.mo
495 dnl (Note: more than one asterisk in glob pattern.)
497 dnl XXX Glob is "fixed" in glibc-2.3.3-61, but the cost is that
498 dnl dangling symlinks are no longer globbed. Always use the internal glob.
499 AC_DEFINE(USE_GNU_GLOB, 1, [Use the included glob.c?])
503 dnl check if python is requested
504 AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python],[build rpm python bindings])],
505 [case "$enable_python" in
507 *) AC_MSG_ERROR([invalid argument to --enable-python])
512 AS_IF([test "$enable_python" = yes],[
513 AM_PATH_PYTHON([2.6],[
514 WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'`
515 WITH_PYTHON_SUBPACKAGE=1
516 save_CPPFLAGS="$CPPFLAGS"
517 CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
518 AC_CHECK_HEADER([Python.h],[],
519 [AC_MSG_ERROR([missing Python.h])
521 CPPFLAGS="$save_CPPFLAGS"
523 AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
524 WITH_PYTHON_LIB="$ac_res"
525 ],[AC_MSG_ERROR([missing python library])
532 WITH_PYTHON_SUBPACKAGE=0
535 AC_SUBST(WITH_PYTHON_INCLUDE)
536 AC_SUBST(WITH_PYTHON_LIB)
538 AM_CONDITIONAL(ENABLE_PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = 1])
540 AC_PATH_PROG(DOXYGEN, doxygen, no)
542 dnl Only build internal API + source hacking docs on request
544 AC_ARG_WITH(hackingdocs, [AS_HELP_STRING([--with-hackingdocs],[build rpm hacking docs])],,[with_hackingdocs=no])
546 case "$with_hackingdocs" in
548 AS_IF([test "$DOXYGEN" = no],[with_hackingdocs=no],[with_hackingdocs=no])
551 AS_IF([test "$DOXYGEN" = no],
552 [AC_MSG_ERROR([rpm hacking docs eeds doxygen in PATH])])
555 AC_CHECK_PROG(HAVE_DOT,[dot],[YES],[NO])
558 AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux],[build with selinux support])],
559 [case "$with_selinux" in
561 *) AC_MSG_ERROR([invalid argument to --with-selinux])
566 AS_IF([test "$with_selinux" = yes],[
567 AC_CHECK_HEADER([selinux/selinux.h],[
569 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],[
570 AC_MSG_ERROR([--with-selinux given, but is_selinux_enabled not found in libselinux])])
571 AC_CHECK_LIB([selinux],[selinux_getpolicytype],[],[
572 AC_MSG_ERROR([--with-selinux given, but selinux_getpolicytype not found in libselinux])])
573 AC_CHECK_LIB([selinux],[selinux_reset_config],[],[
574 AC_MSG_ERROR([--with-selinux given, but selinux_reset_config not found in libselinux])])
577 AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found])
580 AC_CHECK_HEADER([selinux/label.h],[
582 AC_CHECK_LIB([selinux],[selabel_close],[],[
583 AC_MSG_ERROR([--with-selinux given, but selabel_close not found in libselinux])])
584 AC_CHECK_LIB([selinux],[selabel_lookup_raw],[],[
585 AC_MSG_ERROR([--with-selinux given, but selabel_lookup_raw not found in libselinux])])
586 AC_CHECK_LIB([selinux],[selabel_open],[],[
587 AC_MSG_ERROR([--with-selinux given, but selabel_open not found in libselinux])])
590 AC_MSG_ERROR([--with-selinux given, but selinux/label.h not found])
593 dnl FIXME: semanage is only needed for the sepolicy plugin
594 AC_CHECK_HEADER([semanage/semanage.h],[
596 AC_CHECK_LIB([semanage],[semanage_begin_transaction],[],[
597 AC_MSG_ERROR([--with-selinux given, but semanage_begin_transaction missing in libsemanage])])
598 AC_CHECK_LIB([semanage],[semanage_commit],[],[
599 AC_MSG_ERROR([--with-selinux given, but semanage_commit missing in libsemanage])])
600 AC_CHECK_LIB([semanage],[semanage_connect],[],[
601 AC_MSG_ERROR([--with-selinux given, but semanage_connect missing in libsemanage])])
602 AC_CHECK_LIB([semanage],[semanage_disconnect],[],[
603 AC_MSG_ERROR([--with-selinux given, but semanage_disconnect missing in libsemanage])])
604 AC_CHECK_LIB([semanage],[semanage_handle_create],[],[
605 AC_MSG_ERROR([--with-selinux given, but semanage_handle_create missing in libsemanage])])
606 AC_CHECK_LIB([semanage],[semanage_handle_destroy],[],[
607 AC_MSG_ERROR([--with-selinux given, but semanage_handle_destroy missing in libsemanage])])
608 AC_CHECK_LIB([semanage],[semanage_is_connected],[],[
609 AC_MSG_ERROR([--with-selinux given, but semanage_is_connected missing in libsemanage])])
610 AC_CHECK_LIB([semanage],[semanage_module_install_base_file],[],[
611 AC_MSG_ERROR([--with-selinux given, but semanage_module_install_base_file missing in libsemanage])])
612 AC_CHECK_LIB([semanage],[semanage_module_install_file],[],[
613 AC_MSG_ERROR([--with-selinux given, but semanage_module_install_file missing in libsemanage])])
614 AC_CHECK_LIB([semanage],[semanage_module_remove],[],[
615 AC_MSG_ERROR([--with-selinux given, but semanage_module_remove missing in libsemanage])])
616 AC_CHECK_LIB([semanage],[semanage_select_store],[],[
617 AC_MSG_ERROR([--with-selinux given, but semanage_select_store missing in libsemanage])])
618 AC_CHECK_LIB([semanage],[semanage_set_check_contexts],[],[
619 AC_MSG_ERROR([--with-selinux given, but semanage_set_check_contexts missing in libsemanage])])
620 AC_CHECK_LIB([semanage],[semanage_set_create_store],[],[
621 AC_MSG_ERROR([--with-selinux given, but semanage_set_create_store missing in libsemanage])])
622 AC_CHECK_LIB([semanage],[semanage_set_reload],[],[
623 AC_MSG_ERROR([--with-selinux given, but semanage_set_reload missing in libsemanage])])
626 AC_MSG_ERROR([--with-selinux given, but semanage/semanage.h not found])
630 AS_IF([test "$with_selinux" = yes],[
631 AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
632 WITH_SELINUX_LIB="-lselinux"
633 WITH_SEMANAGE_LIB="-lsemanage"
635 AC_SUBST(WITH_SELINUX_LIB)
636 AC_SUBST(WITH_SEMANAGE_LIB)
637 AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
641 AC_ARG_WITH(cap, [AS_HELP_STRING([--with-cap],[build with capability support])],
644 *) AC_MSG_ERROR([invalid argument to --with-cap])
649 AS_IF([test "$with_cap" = yes],[
650 AC_CHECK_HEADER([sys/capability.h],[
651 AC_CHECK_LIB(cap,[cap_get_file], [
654 AC_CHECK_LIB(cap,[cap_compare], [
655 AC_DEFINE(HAVE_CAP_COMPARE, 1, [Have cap_compare function?])
659 AC_MSG_ERROR([--with-cap given, but libcap not found])])
661 AC_MSG_ERROR([--with-cap given, but sys/capability.h not found])
665 AS_IF([test "$with_cap" = yes],[
666 AC_DEFINE(WITH_CAP, 1, [Build with capability support?])
669 AC_SUBST(WITH_CAP_LIB)
670 AM_CONDITIONAL(CAP,[test "$with_cap" = yes])
673 AC_ARG_WITH(acl, [AS_HELP_STRING([--with-acl],[build with acl support])],
676 *) AC_MSG_ERROR([invalid argument to --with-acl])
681 AS_IF([test "$with_acl" = yes],[
682 dnl verification uses non-portable acl_equiv_mode()
683 AC_CHECK_HEADER([acl/libacl.h],[
684 AC_CHECK_LIB(acl,[acl_equiv_mode],[with_acl=yes],[
685 AC_MSG_ERROR([--with-acl given, but libacl not found or not suitable])])
687 AC_MSG_ERROR([--with-acl given, but acl/libacl.h not found])
691 AS_IF([test "$with_acl" = yes],[
692 AC_DEFINE(WITH_ACL, 1, [Build with acl support?])
695 AC_SUBST(WITH_ACL_LIB)
696 AM_CONDITIONAL(ACL,[test "$with_acl" = yes])
698 AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [build with lua support])],
702 AS_IF([test "$with_lua" != no],[
703 PKG_CHECK_MODULES([LUA],
705 [AC_DEFINE(WITH_LUA, 1, [Build with lua support?])],
706 [AC_MSG_ERROR([lua not present (--without-lua to disable)])])
710 AM_CONDITIONAL(WITH_LUA,[test "$with_lua" = yes])
712 AC_ARG_ENABLE(plugins, [AS_HELP_STRING([--disable-plugins],[build without plugin support])],,[enable_plugins=yes])
713 AS_IF([test "$enable_plugins" = yes],[
714 AC_DEFINE(ENABLE_PLUGINS, 1, [Build with plugin support?])
716 AM_CONDITIONAL(ENABLE_PLUGINS,[test "$enable_plugins" = yes])
720 AC_ARG_WITH(dmalloc, [AS_HELP_STRING([--with-dmalloc],[build with dmalloc debugging support])])
721 if test "$with_dmalloc" = yes ; then
722 AC_DEFINE(DMALLOC, 1, [Build with dmalloc support?])
723 LIBS="$LIBS -ldmalloc"
726 AC_CHECK_FUNCS(getpassphrase)
729 # get rid of the 4-th tuple, if config.guess returned "linux-gnu" for host_os
732 if echo "$host_os" | grep '.*-gnulibc1' > /dev/null ; then
733 host_os=`echo "${host_os}" | sed 's/-gnulibc1$//'`
735 if echo "$host_os" | grep '.*-gnueabi' > /dev/null ; then
736 host_os=`echo "${host_os}" | sed 's/-gnueabi$//'`
739 if echo "$host_os" | grep '.*-gnu' > /dev/null ; then
740 host_os=`echo "${host_os}" | sed 's/-gnu$//'`
744 host_os_exact="${host_os}"
745 host_os_major=`echo "${host_os}" | sed 's/\..*$//'`
746 host_os_noversion=`echo "${host_os}" | sed 's/[0-9]*\..*$//'`
749 for provscript in ${host_cpu}-${host_os_exact}.prov ${host_os_exact}.prov ${host_os_major}.prov ${host_os_noversion}.prov none ; do {
750 if test -f ${srcdir}/autodeps/${provscript} ; then
751 if [[ ${provscript} == none ]] ; then
752 echo "*** no default provides information is available for ${host_os_noversion}"
754 echo "using ${srcdir}/autodeps/${provscript} for automatic provides generation"
756 ln -sf ${provscript} ${srcdir}/autodeps/find-provides
762 for reqscript in ${host_cpu}-${host_os_exact}.req ${host_os_exact}.req ${host_os_major}.req ${host_os_noversion}.req none ; do {
763 if test -f ${srcdir}/autodeps/${reqscript} ; then
764 if [[ ${reqscript} == none ]] ; then
765 echo "*** no default requires information is available for ${host_os_noversion}"
767 echo "using ${srcdir}/autodeps/${reqscript} for automatic requires generation"
769 ln -sf ${reqscript} ./autodeps/find-requires
774 dnl permit overriding build_vendor for "canonical rpm vendor"
775 RPMCANONVENDOR="$build_vendor"
776 AC_ARG_WITH([vendor],
777 AS_HELP_STRING([--with-vendor=VENDOR], [specify rpm vendor name]),
778 [RPMCANONVENDOR=$withval])
779 AC_DEFINE_UNQUOTED([RPMCANONVENDOR],["${RPMCANONVENDOR}"],[canonical vendor])
781 RPMCANONOS="$host_os_noversion"
782 RPMCANONGNU="$host_os_gnu"
783 AC_SUBST(RPMCANONVENDOR)
785 AC_SUBST(RPMCANONGNU)
787 if test X"$prefix" = XNONE ; then
788 usrprefix="$ac_default_prefix"
793 RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
794 AC_SUBST(RPMCONFIGDIR)
798 if test "$with_external_db" = no; then
799 AC_CONFIG_SUBDIRS(db3)
802 AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no])
803 AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
804 AM_CONDITIONAL([HACKINGDOCS],[test "$with_hackingdocs" = yes])
806 AC_PATH_PROG(AUTOM4TE,autom4te,:)
808 AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
810 AC_CONFIG_FILES([Makefile
811 rpmio/Makefile lib/Makefile build/Makefile sign/Makefile
812 po/Makefile.in scripts/Makefile fileattrs/Makefile