2 AC_INIT(rpm, 4.8.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])
10 AC_CONFIG_TESTDIR(tests)
12 AC_USE_SYSTEM_EXTENSIONS
16 dnl Checks for programs.
29 if test "$ac_cv_prog_cc_c99" = no; then
30 AC_MSG_ERROR([ISO C99 capable compiler required])
35 if test "$GCC" = yes; then
36 CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts"
37 # XXX disabled for now due to noise from NSPR headers
38 # CFLAGS="$CFLAGS -Wstrict-prototypes"
39 cflags_to_try="-fno-strict-aliasing -fstack-protector -Wempty-body"
40 AC_MSG_CHECKING([supported compiler flags])
43 for flag in $cflags_to_try; do
44 CFLAGS="$CFLAGS $flag"
45 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[
47 RPMCFLAGS="$RPMCFLAGS $flag"
51 CFLAGS="$CFLAGS $RPMCFLAGS"
58 dnl look for POSIX chmod attributes
60 AC_MSG_CHECKING(POSIX chmod)
62 chmod 744 foo.chmodtest
63 chmod +X foo.chmodtest 2>/dev/null
64 a=`ls -l foo.chmodtest | awk '{print substr($1,1,10)}'`
66 if test "$a" = "-rwxr-xr-x"; then
68 FIXPERMS=a+rX,u+w,g-w,o-w
70 AC_MSG_RESULT(no (tell your OS vendor about GNU fileutils))
71 FIXPERMS=a+r,u+w,g-w,o-w
78 AC_CHECK_TOOL(AR, ar, :)
81 dnl use defaults if cross-compiling, otherwise use the default path.
83 if test "$cross_compiling" = "yes"; then
90 dnl Find some common programs
92 AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH)
93 AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
94 AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH)
95 AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH)
96 AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH)
97 AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH)
98 AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
99 AC_PATH_PROG(__CURL, curl, /usr/bin/curl, $MYPATH)
100 AC_PATH_PROG(__FILE, file, /usr/bin/file, $MYPATH)
101 AC_PATH_PROG(__GPG, gpg, /usr/bin/gpg, $MYPATH)
102 AC_PATH_PROG(__GREP, grep, /bin/grep, $MYPATH)
103 AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
104 AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH)
105 AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
106 AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
107 AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH)
108 AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
109 AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
110 AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
111 AC_PATH_PROG(__PATCH, patch, /usr/bin/patch, $MYPATH)
112 AC_MSG_CHECKING(old version of patch)
113 PATCHVERSION=`patch --version 2>&1`
115 if test "$PATCHVERSION" = "Patch version 2.1"; then
116 AC_DEFINE(HAVE_OLDPATCH_21, 1,
117 [Define if the patch call you'll be using is 2.1 or older])
118 AC_MSG_RESULT(patch older then 2.2 found)
120 AC_MSG_RESULT(patch later then 2.2 found)
123 AC_PATH_PROG(__PERL, perl, /usr/bin/perl, $MYPATH)
124 AC_PATH_PROG(__PGP, pgp, /usr/bin/pgp, $MYPATH)
125 AC_PATH_PROG(__PYTHON, python, /usr/bin/python, $MYPATH)
126 AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
127 AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
128 AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
129 AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH)
130 AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH)
132 AC_PATH_PROG(__LD, ld, /usr/bin/ld, $MYPATH)
133 AC_PATH_PROG(__NM, nm, /usr/bin/nm, $MYPATH)
134 AC_PATH_PROG(__OBJCOPY, objcopy, /usr/bin/objcopy, $MYPATH)
135 AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
136 AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
137 AC_PATH_PROG(__FAKECHROOT, fakechroot, /usr/bin/fakechroot, $MYPATH)
139 dnl see if we have a mkdir that supports `-p' for rpmbuild's purposes
141 if ! echo $MKDIR_P | grep -q mkdir; then
142 __MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`"
146 AC_DEFINE_UNQUOTED(__MKDIR_P, "${__MKDIR_P}",
147 [A full path to a program, possibly with arguments, that will create a
148 directory and all necessary parent directories, ala 'mkdir -p'])
152 # Check for zlib library.
157 AC_CHECK_HEADERS([zlib.h],[
158 AS_IF([test -z "${WITH_ZLIB_LIB}"],[
159 for zlib in z gz ; do
160 AC_CHECK_LIB(${zlib}, gzread,
161 [WITH_ZLIB_LIB="-l${zlib}"; break])
164 dnl zlib-1.0.4 has not gzseek
165 AC_CHECK_LIB(${zlib}, gzseek, [AC_DEFINE(HAVE_GZSEEK, 1, [Define as 1 if your zlib has gzseek()])])
169 AC_SUBST(WITH_ZLIB_INCLUDE)
170 AC_SUBST(WITH_ZLIB_LIB)
173 # Check for bzip2 library.
175 AC_CHECK_HEADERS([bzlib.h],[
176 AC_CHECK_LIB(bz2, bzread, [WITH_BZ2_LIB=-lbz2],
178 AC_CHECK_LIB(bz2, BZ2_bzread,[
180 AC_DEFINE(HAVE_BZ2_1_0, 1, [Define as 1 if you bzip2 1.0])
184 AC_SUBST(WITH_BZ2_LIB)
187 # Check for lzma library.
189 AC_CHECK_HEADERS([lzma.h],[
190 AC_CHECK_LIB(lzma, lzma_easy_encoder, [WITH_LZMA_LIB=-llzma])
192 AC_SUBST(WITH_LZMA_LIB)
197 dnl Check for features
200 dnl Checks for libraries.
202 AC_CHECK_FUNC(gethostname, [], [
203 AC_CHECK_LIB(nsl, gethostname)
206 AC_CHECK_HEADERS(poll.h)
208 AC_CHECK_HEADERS(pthread.h)
210 AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [
211 dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
212 AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [
213 AC_CHECK_LIB(thread, mutex_lock)
217 AC_SEARCH_LIBS(aio_read, [c rt aio posix4])
218 AC_SEARCH_LIBS(dlopen, [dl])
220 dnl Temporary hack for MiNT. Some functions (writev, snprintf) are
221 dnl not in the libc but in libport (for political reasons). This check
222 dnl can hopefully be removed soon. Please use the default action
223 dnl for this macro (not LIBS=...), otherwise the check for dbopen
225 AC_CHECK_LIB(port, writev)
228 # Check for libelf library. Prefer external, otherwise none.
230 AC_CHECK_HEADER([libelf.h])
231 AC_CHECK_HEADERS([gelf.h], [
232 AC_CHECK_LIB(elf, gelf_getvernaux, [
233 AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
234 WITH_LIBELF_LIB="-lelf"
238 AC_SUBST(WITH_LIBELF_LIB)
239 AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
241 AC_CHECK_HEADERS([dwarf.h], [
244 AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])
247 # Check for NSS library.
248 # We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS
249 # have a header named nss.h... so make extra check for NSS's sechash.h
250 # which we use too and hopefully is slightly more unique to NSS.
253 AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [
254 AC_MSG_ERROR([missing required NSPR / NSS header])
256 AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
259 AC_MSG_ERROR([missing required NSS library 'nss3'])
261 AC_SUBST(WITH_NSS_INCLUDE)
262 AC_SUBST(WITH_NSS_LIB)
265 # Check for magic library.
269 AC_CHECK_HEADER([magic.h], [
270 AC_CHECK_LIB(magic, magic_open, [
272 WITH_MAGIC_LIB="-lmagic"
274 AC_MSG_ERROR([missing required library 'libmagic'])
277 AC_MSG_ERROR([missing required header magic.h])
280 AC_SUBST(WITH_MAGIC_INCLUDE)
281 AC_SUBST(WITH_MAGIC_LIB)
284 # Check for popt library.
288 AC_CHECK_HEADER([popt.h], [
289 AC_CHECK_LIB(popt, poptGetContext, [
291 WITH_POPT_LIB="-lpopt"
293 AC_MSG_ERROR([missing required library popt])
296 AC_MSG_ERROR([missing required header popt.h])
299 AC_SUBST(WITH_POPT_INCLUDE)
300 AC_SUBST(WITH_POPT_LIB)
303 # Process --with/without-external-db
304 AC_ARG_WITH(external_db, [AS_HELP_STRING([--with-external-db],[build against an external Berkeley db])],
305 [case "$with_external_db" in
307 *) AC_MSG_ERROR([invalid argument to --with-external-db]) ;;
309 [with_external_db=no])
311 case "$with_external_db" in
313 AC_CHECK_HEADERS([db.h],[
316 #if !(DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 5)
317 #error Berkeley DB too old
319 ],[ WITH_DB_LIB=-ldb ],
320 [ AC_MSG_ERROR([Berkeley DB version >= 4.5 required])
323 AC_MSG_ERROR([missing required header db.h])
326 * ) # Fall back to internal db if available
327 if [ test -x db/dist/configure ]; then
328 AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
330 AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL])
335 AC_SUBST([WITH_DB_LIB])
337 AM_GNU_GETTEXT_VERSION([0.16.1])
338 AM_GNU_GETTEXT([external])
340 dnl Checks for header files we can live without.
345 AC_CHECK_HEADERS(limits.h)
346 AC_CHECK_HEADERS(fcntl.h getopt.h memory.h)
348 AC_CHECK_HEADERS(sys/ipc.h)
349 AC_CHECK_HEADERS(sys/utsname.h)
351 AC_CHECK_HEADERS(sys/systemcfg.h)
352 AC_CHECK_HEADERS(sys/param.h)
353 AC_CHECK_HEADERS(libio.h)
354 AC_CHECK_HEADERS(mcheck.h)
356 AC_CHECK_HEADERS(glob.h)
358 dnl statfs portability fiddles.
360 dnl We should really emulate/steal sections of the statfs and struct statfs
361 dnl checks from GNU fileutils.
363 AC_MSG_CHECKING(for struct statfs)
366 dnl this is easier than nesting AC_TRY_COMPILEs...
368 found_struct_statfs=no
370 if test X$found_struct_statfs = Xno ; then
371 dnl Solaris 2.6+ wants to use statvfs
372 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
373 #ifdef HAVE_SYS_TYPES_H
374 #include <sys/types.h>
376 #include <sys/statvfs.h> ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
377 AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
378 [statfs in <sys/statvfs.h> (for solaris 2.6+ systems)])
379 found_struct_statfs=yes],[])
382 if test X$found_struct_statfs = Xno ; then
383 dnl first try including sys/vfs.h
384 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
385 #ifdef HAVE_SYS_TYPES_H
386 #include <sys/types.h>
388 #include <sys/vfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
389 AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in <sys/vfs.h> (for linux systems)])
390 found_struct_statfs=yes],[])
393 if test X$found_struct_statfs = Xno ; then
394 dnl ...next try including sys/mount.h
395 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
396 #ifdef HAVE_SYS_TYPES_H
397 #include <sys/types.h>
399 #ifdef HAVE_SYS_PARAM_H
400 #include <sys/param.h>
402 #include <sys/mount.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/mount.h)
403 AC_DEFINE(STATFS_IN_SYS_MOUNT, 1, [statfs in <sys/mount.h> (for Digital Unix 4.0D systems)])
404 found_struct_statfs=yes],[])
407 if test X$found_struct_statfs = Xno ; then
408 dnl ...still no joy. Try sys/statfs.h
409 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
410 #ifdef HAVE_SYS_TYPES_H
411 #include <sys/types.h>
413 #include <sys/statfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/statfs.h)
414 AC_DEFINE(STATFS_IN_SYS_STATFS, 1, [statfs in <sys/statfs.h> (for Irix 6.4 systems)])
415 found_struct_statfs=yes],[])
418 if test X$found_struct_statfs = Xno ; then
419 dnl ...no luck. Warn the user of impending doom.
420 AC_MSG_WARN(not found)
424 dnl if we found the struct, see if it has the f_bavail member. Some OSes
425 dnl don't, including IRIX 6.5+
427 if test X$found_struct_statfs = Xyes ; then
428 AC_MSG_CHECKING(for f_bavail member in struct statfs)
429 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
430 #ifdef HAVE_SYS_TYPES_H
431 #include <sys/types.h>
433 #if STATFS_IN_SYS_STATVFS
434 # include <sys/statvfs.h>
435 typedef struct statvfs STATFS_t;
437 typedef struct statfs STATFS_t;
438 # if STATFS_IN_SYS_VFS
439 # include <sys/vfs.h>
440 # elif STATFS_IN_SYS_MOUNT
441 # include <sys/mount.h>
442 # elif STATFS_IN_SYS_STATFS
443 # include <sys/statfs.h>
445 #endif ]], [[STATFS_t sfs;
446 sfs.f_bavail = 0;]])],[AC_MSG_RESULT(yes)
447 AC_DEFINE(STATFS_HAS_F_BAVAIL, 1, [Define if struct statfs has the f_bavail member])],[AC_MSG_RESULT(no)
451 if test X$found_struct_statfs = Xyes ; then
453 dnl now check to see if we have the 4-argument variant of statfs()
454 dnl this pretty much requires AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[])
456 AC_MSG_CHECKING([if statfs() requires 4 arguments])
457 AC_RUN_IFELSE([AC_LANG_SOURCE([[
458 #ifdef HAVE_SYS_TYPES_H
459 #include <sys/types.h>
461 #ifdef STATFS_IN_SYS_VFS
463 #elif STATFS_IN_SYS_MOUNT
464 #include <sys/mouht.h>
465 #elif STATFS_IN_SYS_STATFS
466 #include <sys/statfs.h>
470 exit (statfs(".", &sfs, sizeof(sfs), 0));
472 ]])],[AC_MSG_RESULT(yes)
473 AC_DEFINE(STAT_STATFS4, 1, [Define if the statfs() call takes 4 arguments])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)
477 dnl look for libc features
479 dnl Check for missing typedefs
485 dnl Checks for library functions.
488 AC_CHECK_FUNCS(mtrace)
489 AC_CHECK_FUNCS(putenv)
491 AC_REPLACE_FUNCS(stpcpy stpncpy)
493 AC_CHECK_FUNCS(__secure_getenv)
496 [mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown],
497 [], [AC_MSG_ERROR([function required by rpm])])
499 dnl XXX Glob *is* broken on linux with libc5, solaris and possibly aix when
500 dnl %files gets something like
501 dnl /usr/*/locale/*/LC_MESSAGES/*.mo
502 dnl (Note: more than one asterisk in glob pattern.)
504 dnl XXX Glob is "fixed" in glibc-2.3.3-61, but the cost is that
505 dnl dangling symlinks are no longer globbed. Always use the internal glob.
506 AC_DEFINE(USE_GNU_GLOB, 1, [Use the included glob.c?])
510 dnl check if python is requested
511 AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python],[build rpm python bindings])],
512 [case "$enable_python" in
514 *) AC_MSG_ERROR([invalid argument to --enable-python])
519 AS_IF([test "$enable_python" = yes],[
520 AM_PATH_PYTHON([2.6],[
521 WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'`
522 WITH_PYTHON_SUBPACKAGE=1
523 save_CPPFLAGS="$CPPFLAGS"
524 CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
525 AC_CHECK_HEADER([Python.h],[],
526 [AC_MSG_ERROR([missing Python.h])
528 CPPFLAGS="$save_CPPFLAGS"
530 AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
531 WITH_PYTHON_LIB="$ac_res"
532 ],[AC_MSG_ERROR([missing python library])
539 WITH_PYTHON_SUBPACKAGE=0
542 AC_SUBST(WITH_PYTHON_INCLUDE)
543 AC_SUBST(WITH_PYTHON_LIB)
545 AM_CONDITIONAL(PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = 1])
547 AC_PATH_PROG(DOXYGEN, doxygen, no)
549 dnl Only build internal API + source hacking docs on request
551 AC_ARG_WITH(hackingdocs, [AS_HELP_STRING([--with-hackingdocs],[build rpm hacking docs])],,[with_hackingdocs=no])
553 case "$with_hackingdocs" in
555 AS_IF([test "$DOXYGEN" = no],[with_hackingdocs=no],[with_hackingdocs=no])
558 AS_IF([test "$DOXYGEN" = no],
559 [AC_MSG_ERROR([rpm hacking docs eeds doxygen in PATH])])
562 AC_CHECK_PROG(HAVE_DOT,[dot],[YES],[NO])
565 AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux],[build with selinux support])],
566 [case "$with_selinux" in
568 *) AC_MSG_ERROR([invalid argument to --with-selinux])
573 AS_IF([test "$with_selinux" = yes],[
574 AC_CHECK_HEADER([selinux/selinux.h],[
575 AC_CHECK_LIB(selinux,[is_selinux_enabled],[with_selinux=yes],[
576 AC_MSG_ERROR([--with-selinux given, but libselinux not found])])
578 AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found])
581 AC_CHECK_HEADER([selinux/label.h],[
583 AC_CHECK_LIB([selinux],[selabel_close],[],[
584 AC_MSG_ERROR([--with-selinux given, but selabel_close not found in libselinux])])
585 AC_CHECK_LIB([selinux],[selabel_lookup_raw],[],[
586 AC_MSG_ERROR([--with-selinux given, but selabel_lookup_raw not found in libselinux])])
587 AC_CHECK_LIB([selinux],[selabel_open],[],[
588 AC_MSG_ERROR([--with-selinux given, but selabel_open not found in libselinux])])
591 AC_MSG_ERROR([--with-selinux given, but selinux/label.h not found])
595 AS_IF([test "$with_selinux" = yes],[
596 AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
597 WITH_SELINUX_LIB="-lselinux"
599 AC_SUBST(WITH_SELINUX_LIB)
600 AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
604 AC_ARG_WITH(cap, [AS_HELP_STRING([--with-cap],[build with capability support])],
607 *) AC_MSG_ERROR([invalid argument to --with-cap])
612 AS_IF([test "$with_cap" = yes],[
613 AC_CHECK_HEADER([sys/capability.h],[
614 AC_CHECK_LIB(cap,[cap_get_file], [
617 AC_CHECK_LIB(cap,[cap_compare], [
618 AC_DEFINE(HAVE_CAP_COMPARE, 1, [Have cap_compare function?])
622 AC_MSG_ERROR([--with-cap given, but libcap not found])])
624 AC_MSG_ERROR([--with-cap given, but sys/capability.h not found])
628 AS_IF([test "$with_cap" = yes],[
629 AC_DEFINE(WITH_CAP, 1, [Build with capability support?])
632 AC_SUBST(WITH_CAP_LIB)
633 AM_CONDITIONAL(CAP,[test "$with_cap" = yes])
636 AC_ARG_WITH(acl, [AS_HELP_STRING([--with-acl],[build with acl support])],
639 *) AC_MSG_ERROR([invalid argument to --with-acl])
644 AS_IF([test "$with_acl" = yes],[
645 dnl verification uses non-portable acl_equiv_mode()
646 AC_CHECK_HEADER([acl/libacl.h],[
647 AC_CHECK_LIB(acl,[acl_equiv_mode],[with_acl=yes],[
648 AC_MSG_ERROR([--with-acl given, but libacl not found or not suitable])])
650 AC_MSG_ERROR([--with-acl given, but acl/libacl.h not found])
654 AS_IF([test "$with_acl" = yes],[
655 AC_DEFINE(WITH_ACL, 1, [Build with acl support?])
658 AC_SUBST(WITH_ACL_LIB)
659 AM_CONDITIONAL(ACL,[test "$with_acl" = yes])
663 AC_ARG_WITH(lua, [AS_HELP_STRING([--with-lua],[build with lua support])],,[with_lua=yes])
664 AS_IF([test "$with_lua" = yes],[
665 AC_CHECK_HEADER([lua.h],[
666 AC_CHECK_LIB(lua,[luaL_openlibs],[with_lua=yes],[
667 AC_MSG_ERROR([--with-lua given, but liblua not found])
671 AC_MSG_ERROR([--with-lua given, but lua.h not found])
675 AS_IF([test "$with_lua" = yes],[
676 AC_DEFINE(WITH_LUA, 1, [Build with lua support?])
678 WITH_LUA_LIB="-llua -lm"
680 AC_SUBST(WITH_LUA_LIB)
681 AC_SUBST(WITH_LUA_INCLUDE)
682 AM_CONDITIONAL(WITH_LUAEXT,[test "$with_lua" = yes])
685 AC_ARG_WITH(dmalloc, [AS_HELP_STRING([--with-dmalloc],[build with dmalloc debugging support])])
686 if test "$with_dmalloc" = yes ; then
687 AC_DEFINE(DMALLOC, 1, [Build with dmalloc support?])
688 LIBS="$LIBS -ldmalloc"
691 AC_CHECK_FUNCS(getpassphrase)
694 # get rid of the 4-th tuple, if config.guess returned "linux-gnu" for host_os
697 if echo "$host_os" | grep '.*-gnulibc1' > /dev/null ; then
698 host_os=`echo "${host_os}" | sed 's/-gnulibc1$//'`
700 if echo "$host_os" | grep '.*-gnueabi' > /dev/null ; then
701 host_os=`echo "${host_os}" | sed 's/-gnueabi$//'`
704 if echo "$host_os" | grep '.*-gnu' > /dev/null ; then
705 host_os=`echo "${host_os}" | sed 's/-gnu$//'`
709 host_os_exact="${host_os}"
710 host_os_major=`echo "${host_os}" | sed 's/\..*$//'`
711 host_os_noversion=`echo "${host_os}" | sed 's/[0-9]*\..*$//'`
714 rm -f ./find-provides
715 if test -f ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov ; then
716 echo "using ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov for automatic provides generation"
717 ln -s ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov ./find-provides
718 elif test -f ${srcdir}/autodeps/${host_os_exact}.prov ; then
719 echo "using ${srcdir}/autodeps/${host_os_exact}.prov for automatic provides generation"
720 ln -s ${srcdir}/autodeps/${host_os_exact}.prov ./find-provides
721 elif test -f ${srcdir}/autodeps/${host_os_major}.prov ; then
722 echo "using ${srcdir}/autodeps/${host_os_major}.prov for automatic provides generation"
723 ln -s ${srcdir}/autodeps/${host_os_major}.prov ./find-provides
724 elif test -f ${srcdir}/autodeps/${host_os_noversion}.prov ; then
725 echo "using ${srcdir}/autodeps/${host_os_noversion}.prov for automatic provides generation"
726 ln -s ${srcdir}/autodeps/${host_os_noversion}.prov ./find-provides
728 echo "*** no default provides information is available for ${host_os_noversion}"
729 ln -s ${srcdir}/autodeps/none ./find-provides
732 rm -f ./find-requires
733 if test -f ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req ; then
734 echo "using ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req for automatic requires generation"
735 ln -s ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req ./find-requires
736 elif test -f ${srcdir}/autodeps/${host_os_exact}.req ; then
737 echo "using ${srcdir}/autodeps/${host_os_exact}.req for automatic requires generation"
738 ln -s ${srcdir}/autodeps/${host_os_exact}.req ./find-requires
739 elif test -f ${srcdir}/autodeps/${host_os_major}.req ; then
740 echo "using ${srcdir}/autodeps/${host_os_major}.req for automatic requires generation"
741 ln -s ${srcdir}/autodeps/${host_os_major}.req ./find-requires
742 elif test -f ${srcdir}/autodeps/${host_os_noversion}.req ; then
743 echo "using ${srcdir}/autodeps/${host_os_noversion}.req for automatic requires generation"
744 ln -s ${srcdir}/autodeps/${host_os_noversion}.req ./find-requires
746 echo "*** no default requires information is available for ${host_os_noversion}"
747 ln -s ${srcdir}/autodeps/none ./find-requires
750 dnl Determine the canonical arch-vendor-os for the host machine
751 case "${host_cpu}" in
752 *86) RPMCANONCOLOR=0; RPMCANONARCH=i386 ;;
753 ia32e*) RPMCANONCOLOR=3; RPMCANONARCH=ia32e ;;
754 amd64*) RPMCANONCOLOR=3; RPMCANONARCH=amd64 ;;
755 x86_64*) RPMCANONCOLOR=3; RPMCANONARCH=x86_64 ;;
756 alpha*) RPMCANONCOLOR=0; RPMCANONARCH=alpha ;;
757 sparc64*) RPMCANONCOLOR=3; RPMCANONARCH=sparc64 ;;
758 sparc*) RPMCANONCOLOR=3; RPMCANONARCH=sparc ;;
759 ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64 ;;
760 s390x*) RPMCANONCOLOR=3; RPMCANONARCH=s390x ;;
761 s390*) RPMCANONCOLOR=0; RPMCANONARCH=s390 ;;
762 powerpc64*|ppc64*) RPMCANONCOLOR=3; RPMCANONARCH=ppc64 ;;
763 powerpc*|ppc*) RPMCANONCOLOR=0; RPMCANONARCH=ppc ;;
764 arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm ;;
765 mipsel*) RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
766 mips*) RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
767 m68k*) RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
768 sh3*) RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
769 sh4*) RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
770 *) RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
772 case "${host_os_noversion}" in
773 mint) RPMCANONARCH=m68kmint ;;
775 RPMCANONVENDOR="$build_vendor"
776 case "${build_vendor}" in
777 unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse)
778 test -f /etc/redhat-release && RPMCANONVENDOR=redhat
779 test -f /etc/SuSE-release && RPMCANONVENDOR=suse
780 test -f /etc/pld-release && RPMCANONVENDOR=pld
781 test -f /etc/mandrake-release && RPMCANONVENDOR=mandrake
782 test -f /etc/conectiva-release && RPMCANONVENDOR=conectiva
783 test -f /etc/lvr-release && RPMCANONVENDOR=lvr
784 test -f /etc/yellowdog-release && RPMCANONVENDOR=yellowdog
785 test -f /etc/caos-release && RPMCANONVENDOR=caos
788 RPMCANONOS="$host_os_noversion"
789 RPMCANONGNU="$host_os_gnu"
790 AC_SUBST(RPMCANONCOLOR)
791 AC_SUBST(RPMCANONARCH)
792 AC_SUBST(RPMCANONVENDOR)
794 AC_SUBST(RPMCANONGNU)
795 AC_DEFINE_UNQUOTED([RPMCANONVENDOR],["${RPMCANONVENDOR}"],[canonical vendor])
797 if test X"$prefix" = XNONE ; then
798 usrprefix="$ac_default_prefix"
803 RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
804 AC_SUBST(RPMCONFIGDIR)
808 if test "$with_external_db" = no; then
809 AC_CONFIG_SUBDIRS(db3)
812 AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no])
813 AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
814 AM_CONDITIONAL([HACKINGDOCS],[test "$with_hackingdocs" = yes])
816 AC_PATH_PROG(AUTOM4TE,autom4te,:)
818 AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
820 AC_CONFIG_FILES([Makefile
821 rpmio/Makefile lib/Makefile build/Makefile
822 po/Makefile.in scripts/Makefile fileattrs/Makefile