Fix capability verification
[platform/upstream/rpm.git] / configure.ac
1 AC_PREREQ(2.61)
2 AC_INIT(rpm, 4.7.0, rpm-maint@lists.rpm.org)
3
4 AC_CONFIG_SRCDIR([rpmqv.c])
5 AC_CONFIG_HEADERS([config.h])
6
7 AM_INIT_AUTOMAKE([1.10 foreign tar-ustar dist-bzip2 subdir-objects nostdinc])
8
9 AC_CONFIG_TESTDIR(tests)
10
11 AC_USE_SYSTEM_EXTENSIONS
12
13 AC_DISABLE_STATIC
14
15 dnl Checks for programs.
16 AC_PROG_CXX
17 AC_PROG_AWK
18 AC_PROG_CC
19 AC_PROG_CPP
20 AC_PROG_INSTALL
21 AC_PROG_LN_S
22 AC_PROG_MAKE_SET
23 AC_PROG_LIBTOOL
24 AC_PROG_YACC
25
26 AC_SUBST(__CC, $CC)
27 AC_PROG_CC_C99
28 if test "$ac_cv_prog_cc_c99" = no; then
29     AC_MSG_ERROR([ISO C99 capable compiler required])
30 fi
31
32 AS=${AS-as}
33 AC_SUBST(AS)
34 if test "$GCC" = yes; then
35     CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts"
36     # XXX disabled for now due to noise from NSPR headers
37     # CFLAGS="$CFLAGS -Wstrict-prototypes"
38     cflags_to_try="-fno-strict-aliasing -fstack-protector"
39     AC_MSG_CHECKING([supported compiler flags])
40     old_cflags=$CFLAGS
41     echo
42     for flag in $cflags_to_try; do
43         CFLAGS="$CFLAGS $flag"
44         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[
45                 echo "   $flag"
46                 RPMCFLAGS="$RPMCFLAGS $flag"
47         ],[])
48         CFLAGS=$old_cflags
49     done
50     CFLAGS="$CFLAGS $RPMCFLAGS"
51 fi
52 export CFLAGS
53
54 AC_SYS_LARGEFILE
55
56 dnl
57 dnl look for POSIX chmod attributes
58 dnl
59 AC_MSG_CHECKING(POSIX chmod)
60 touch foo.chmodtest
61 chmod 744 foo.chmodtest
62 chmod +X foo.chmodtest 2>/dev/null
63 a=`ls -l foo.chmodtest | awk '{print $1}'`
64 rm -f foo.chmodtest
65 if test "$a" = "-rwxr-xr-x"; then
66     AC_MSG_RESULT(yes)
67     FIXPERMS=a+rX,u+w,g-w,o-w 
68 else
69     AC_MSG_RESULT(no (tell your OS vendor about GNU fileutils))
70     FIXPERMS=a+r,u+w,g-w,o-w 
71 fi
72 AC_SUBST(FIXPERMS)
73
74 dnl
75 dnl see if we have a mkdir that supports `-p'.
76 dnl
77 AC_PATH_PROGS(RPM_MKDIR, mkdir, mkdir)
78 AC_MSG_CHECKING(if $RPM_MKDIR supports -p)
79 rm -rf conftest
80 $RPM_MKDIR -p conftest/a 2>/dev/null
81 if test $? = 0 ; then
82         rmdir conftest/a 2>/dev/null
83         if test $? = 0  ; then
84                 :
85         else
86                 RPM_MKDIR_P=0
87         fi
88
89         rmdir conftest 2>/dev/null
90         if test $? = 0 ; then
91                 RPM_MKDIR_P="$RPM_MKDIR -p"
92         else
93                 RPM_MKDIR_P=0
94         fi
95 else
96         RPM_MKDIR_P=0
97 fi
98
99 if test X"$RPM_MKDIR_P" = X0 ; then
100         AC_MSG_RESULT(no)
101         RPM_MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`"
102 else
103         AC_MSG_RESULT(yes)
104 fi
105 dnl
106 dnl substitute this into config.h, so the C source picks it up.
107 dnl
108 AC_DEFINE_UNQUOTED(RPM_MKDIR_P, "${RPM_MKDIR_P}",
109 [A full path to a program, possibly with arguments, that will create a
110    directory and all necessary parent directories, ala 'mkdir -p'])
111 AC_SUBST(RPM_MKDIR_P)
112
113 dnl AM_DISABLE_SHARED
114 AM_PROG_LIBTOOL
115
116 AC_CHECK_TOOL(AR, ar, :)
117
118 dnl
119 dnl use defaults if cross-compiling, otherwise use the default path.
120 dnl
121 if test "$cross_compiling" = "yes"; then
122     MYPATH=":"
123 else
124     MYPATH=$PATH
125 fi
126
127 dnl
128 dnl Find some common programs
129 dnl
130 AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH)
131 AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
132 AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH)
133 AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH)
134 AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH)
135 AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH)
136 AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
137 AC_PATH_PROG(__CURL, curl, /usr/bin/curl, $MYPATH)
138 AC_PATH_PROG(__FILE, file, /usr/bin/file, $MYPATH)
139 AC_PATH_PROG(__GPG, gpg, /usr/bin/gpg, $MYPATH)
140 AC_PATH_PROG(__GREP, grep, /bin/grep, $MYPATH)
141 AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
142 AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH)
143
144 AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
145 AC_MSG_CHECKING(checking whether id supports -u)
146     if ${__ID} -u 2>&1 > /dev/null ; then
147         __ID_U="%{__id} -u"
148         AC_MSG_RESULT(yes)
149     else
150         __ID_U="%{__id} | %{__sed} 's/[[^=]]*=\\\\([[0-9]][[0-9]]*\\\\).*$/\\\\1/'"
151         AC_MSG_RESULT(no)
152     fi
153 AC_SUBST(__ID_U)
154
155 AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
156 AC_PATH_PROG(__LZMA, lzma, /usr/bin/lzma, $MYPATH)
157 AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
158 AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
159 AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
160 AC_PATH_PROG(__PATCH, patch, /usr/bin/patch, $MYPATH)
161 AC_MSG_CHECKING(old version of patch)
162     PATCHVERSION=`patch --version 2>&1`
163
164     if test "$PATCHVERSION" = "Patch version 2.1"; then
165         AC_DEFINE(HAVE_OLDPATCH_21, 1,
166                 [Define if the patch call you'll be using is 2.1 or older])
167         AC_MSG_RESULT(patch older then 2.2 found)
168     else
169         AC_MSG_RESULT(patch later then 2.2 found)
170     fi
171
172 AC_PATH_PROG(__PERL, perl, /usr/bin/perl, $MYPATH)
173 AC_PATH_PROG(__PGP, pgp, /usr/bin/pgp, $MYPATH)
174 AC_PATH_PROG(__PYTHON, python, /usr/bin/python, $MYPATH) 
175 AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
176 AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
177 AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
178 AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH)
179 AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH)
180
181 AC_PATH_PROG(__LD, ld, /usr/bin/ld, $MYPATH)
182 AC_PATH_PROG(__NM, nm, /usr/bin/nm, $MYPATH)
183 AC_PATH_PROG(__OBJCOPY, objcopy, /usr/bin/objcopy, $MYPATH)
184 AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
185 AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
186
187 #=================
188 # Check for zlib library. 
189
190 WITH_ZLIB_INCLUDE=
191 WITH_ZLIB_LIB=
192
193 AC_CHECK_HEADERS([zlib.h],[
194   AS_IF([test -z "${WITH_ZLIB_LIB}"],[
195     for zlib in z gz ; do
196       AC_CHECK_LIB(${zlib}, gzread, 
197         [WITH_ZLIB_LIB="-l${zlib}"; break])
198     done
199
200 dnl zlib-1.0.4 has not gzseek
201     AC_CHECK_LIB(${zlib}, gzseek, [AC_DEFINE(HAVE_GZSEEK, 1, [Define as 1 if your zlib has gzseek()])])
202   ])
203 ])
204
205 AC_SUBST(WITH_ZLIB_INCLUDE)
206 AC_SUBST(WITH_ZLIB_LIB)
207
208 #=================
209 # Check for bzip2 library.
210
211 AC_CHECK_HEADERS([bzlib.h],[
212   AC_CHECK_LIB(bz2, bzread, [WITH_BZ2_LIB=-lbz2],
213   [
214     AC_CHECK_LIB(bz2, BZ2_bzread,[ 
215       WITH_BZ2_LIB="-lbz2"
216       AC_DEFINE(HAVE_BZ2_1_0, 1, [Define as 1 if you bzip2 1.0])
217     ]) 
218   ])
219 ])
220 AC_SUBST(WITH_BZ2_LIB)
221
222 #=================
223 # Check for lzma library.
224
225 AC_CHECK_HEADERS([lzma.h],[
226   AC_CHECK_LIB(lzma, lzma_auto_decoder, [WITH_LZMA_LIB=-llzma])
227 ])
228 AC_SUBST(WITH_LZMA_LIB)
229
230 #=================
231
232 dnl
233 dnl Check for features
234 dnl
235
236 dnl Checks for libraries.
237
238 AC_CHECK_FUNC(setreuid, [], [
239     AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
240 ])
241
242 AC_CHECK_FUNC(rand, [], [
243     AC_CHECK_LIB(rand, rand, [])
244 ])
245
246 AC_CHECK_FUNC(getdomainname, [], [
247     AC_CHECK_LIB(nsl, getdomainname)
248 ])
249 AC_CHECK_FUNC(socket, [], [
250     AC_CHECK_LIB(socket, socket)
251 ])
252
253 AC_CHECK_HEADERS(error.h)
254 AC_CHECK_FUNCS(error)
255
256 AC_CHECK_HEADERS(poll.h)
257
258 AC_CHECK_HEADERS(pthread.h)
259
260 AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [
261   dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
262   AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [
263     AC_CHECK_LIB(thread, mutex_lock)
264   ])
265 ])
266
267 AC_SEARCH_LIBS(aio_read, [c rt aio posix4])
268
269 AC_CHECK_FUNCS(vsnprintf snprintf)
270
271 dnl Temporary hack for MiNT.  Some functions (writev, snprintf) are
272 dnl not in the libc but in libport (for political reasons).  This check
273 dnl can hopefully be removed soon.  Please use the default action
274 dnl for this macro (not LIBS=...), otherwise the check for dbopen
275 dnl will fail.
276 AC_CHECK_LIB(port, writev)
277
278 #=================
279 # Check for libelf library. Prefer external, otherwise none.
280 WITH_LIBELF_INCLUDE=
281 WITH_LIBELF_LIB=
282 AC_CHECK_HEADER([libelf.h])
283 AC_CHECK_HEADERS([gelf.h], [
284         AC_CHECK_LIB(elf, gelf_getvernaux, [
285             AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
286             WITH_LIBELF_LIB="-lelf"
287             WITH_LIBELF=yes
288         ])
289 ])
290 AC_SUBST(WITH_LIBELF_INCLUDE)
291 AC_SUBST(WITH_LIBELF_LIB)
292 AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
293
294 AC_CHECK_HEADERS([dwarf.h], [
295   WITH_LIBDWARF=yes
296 ])
297 AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])
298
299 #=================
300 # Check for NSS library.
301 # We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS 
302 # have a header named nss.h... so make extra check for NSS's sechash.h 
303 # which we use too and hopefully is slightly more unique to NSS.
304 WITH_NSS_INCLUDE=
305 WITH_NSS_LIB=
306 AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [
307   AC_MSG_ERROR([missing required NSPR / NSS header])
308 ])
309 AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
310   WITH_NSS_LIB=-lnss3
311 ], [
312   AC_MSG_ERROR([missing required NSS library 'nss3'])
313 ])
314 AC_SUBST(WITH_NSS_INCLUDE)
315 AC_SUBST(WITH_NSS_LIB)
316
317 #=================
318 # Check for magic library.
319 WITH_MAGIC_INCLUDE=
320 WITH_MAGIC_LIB=
321
322 AC_CHECK_HEADER([magic.h], [
323     AC_CHECK_LIB(magic, magic_open, [
324       WITH_MAGIC_INCLUDE=
325       WITH_MAGIC_LIB="-lmagic"
326     ],[
327       AC_MSG_ERROR([missing required library 'libmagic']) 
328     ])
329 ],[
330       AC_MSG_ERROR([missing required header magic.h]) 
331 ])
332
333 AC_SUBST(WITH_MAGIC_INCLUDE)
334 AC_SUBST(WITH_MAGIC_LIB)
335
336 #=================
337 # Check for popt library.
338 WITH_POPT_INCLUDE=
339 WITH_POPT_LIB=
340
341 AC_CHECK_HEADER([popt.h], [
342   AC_CHECK_LIB(popt, poptGetContext, [
343       WITH_POPT_INCLUDE=
344       WITH_POPT_LIB="-lpopt"
345   ],[
346     AC_MSG_ERROR([missing required library popt])
347   ])
348 ],[
349   AC_MSG_ERROR([missing required header popt.h])
350 ])
351
352 AC_SUBST(WITH_POPT_INCLUDE)
353 AC_SUBST(WITH_POPT_LIB)
354
355 #=================
356 # Process --with/without-external-db
357 AC_ARG_WITH(external_db, [  --with-external-db      build against an external Berkeley db],
358 [case "$with_external_db" in
359 yes|no) ;;
360 *) AC_MSG_ERROR([invalid argument to --with-external-db]) ;;
361 esac],
362 [with_external_db=no])
363
364 case "$with_external_db" in
365 yes )
366   AC_CHECK_HEADERS([db.h],[
367     AC_CHECK_TYPE([db_threadid_t],[],
368       [AC_MSG_WARN([missing type db_threadid_t])],
369       [#include <db.h>])
370     save_LIBS="$LIBS"
371     AC_CHECK_LIB([db],[db_create],[],[
372       AC_MSG_ERROR([missing db_create in libdb])
373       ])
374     AC_CHECK_LIB([db],[db_env_create],[],[
375       AC_MSG_ERROR([missing db_env_create in libdb])
376       ])
377     AC_CHECK_LIB([db],[db_env_set_func_fsync],[],[
378       AC_MSG_ERROR([missing db_env_set_func_fsync in libdb])
379       ])
380     AC_CHECK_LIB([db],[db_strerror],[],[
381       AC_MSG_ERROR([missing db_strerror in libdb])
382       ])
383     WITH_DB_LIB=-ldb
384     LIBS="$save_LIBS"
385   ],[
386     AC_MSG_ERROR([missing required header db.h])
387   ])
388   ;;
389 * ) # Fall back to internal db if available
390   if [ test -x db/dist/configure ]; then
391     AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
392   else
393     AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL])
394   fi
395   ;;
396 esac
397
398 AC_SUBST([WITH_DB_LIB])
399
400 #=================
401 # Check for sqlite3 library.
402 AC_ARG_ENABLE(sqlite3, [  --enable-sqlite3        enable sqlite3 support],
403 [case "$enable_sqlite3" in
404 yes|no) ;;
405 *) AC_MSG_ERROR([invalid argument to --enable-sqlite3])
406   ;;
407 esac],
408 [enable_sqlite3=no])
409
410 WITH_SQLITE3_INCLUDE=
411 WITH_SQLITE3_LIB=
412 WITH_SQLITE3=no
413 AS_IF([test "$enable_sqlite3" = yes],[
414   AC_CHECK_HEADERS([sqlite3.h],
415   [ AC_CHECK_LIB(sqlite3, sqlite3_open, [
416       WITH_SQLITE3_INCLUDE=
417       WITH_SQLITE3_LIB="-lsqlite3"
418       WITH_SQLITE3=yes
419     ],[
420       AC_MSG_ERROR([missing libsqlite3])
421     ])
422   ],[
423     AC_MSG_ERROR([missing sqlite3.h])
424   ])
425 ])
426
427 AC_SUBST(WITH_SQLITE3_INCLUDE)
428 AC_SUBST(WITH_SQLITE3_LIB)
429 AM_CONDITIONAL([SQLITE3],[test "$WITH_SQLITE3" = yes])
430
431 #=================
432
433 dnl AmigaOS and IXEmul have a fork() dummy
434   case "$host" in
435     m68k-*-amigaos ) 
436         echo "Building for AmigaOS: using vfork() instead of fork()"; 
437         CFLAGS="$CFLAGS -Dfork=vfork" 
438         ;;
439   esac
440
441 AM_GNU_GETTEXT_VERSION([0.16.1])
442 AM_GNU_GETTEXT([external])
443
444 dnl Checks for header files we can live without.
445 AC_HEADER_STDC
446 AC_HEADER_MAJOR
447 AC_HEADER_DIRENT
448 AC_HEADER_TIME
449
450 AC_CHECK_HEADERS(locale.h)
451 AC_CHECK_HEADERS(limits.h)
452 AC_CHECK_HEADERS(fcntl.h getopt.h grp.h memory.h netdb.h pwd.h utime.h)
453
454 AC_CHECK_HEADERS(sys/ipc.h sys/socket.h sys/select.h)
455 AC_CHECK_HEADERS(sys/types.h sys/stdtypes.h)
456 AC_CHECK_HEADERS(sys/mman.h sys/resource.h sys/utsname.h sys/wait.h)
457
458 AC_CHECK_HEADERS(netinet/in_systm.h)
459 AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
460 AC_CHECK_HEADERS(sys/mount.h sys/mntctl.h sys/param.h sys/vmount.h)
461 AC_CHECK_HEADERS(libio.h)
462 AC_CHECK_HEADERS(err.h mcheck.h)
463
464 AC_CHECK_HEADERS(glob.h)
465
466 dnl statfs portability fiddles.
467 dnl
468 dnl We should really emulate/steal sections of the statfs and struct statfs
469 dnl checks from GNU fileutils.
470 dnl
471 AC_MSG_CHECKING(for struct statfs)
472
473 dnl
474 dnl this is easier than nesting AC_TRY_COMPILEs...
475 dnl
476 found_struct_statfs=no
477
478 if test X$found_struct_statfs = Xno ; then
479 dnl Solaris 2.6+ wants to use statvfs
480 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
481 #ifdef HAVE_SYS_TYPES_H
482 #include <sys/types.h>
483 #endif
484 #include <sys/statvfs.h> ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
485         AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
486                 [statfs in <sys/statvfs.h> (for solaris 2.6+ systems)])
487         found_struct_statfs=yes],[])
488 fi
489
490 if test X$found_struct_statfs = Xno ; then
491 dnl first try including sys/vfs.h
492 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
493 #ifdef HAVE_SYS_TYPES_H
494 #include <sys/types.h>
495 #endif
496 #include <sys/vfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
497         AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in <sys/vfs.h> (for linux systems)])
498         found_struct_statfs=yes],[])
499 fi
500
501 if test X$found_struct_statfs = Xno ; then
502 dnl ...next try including sys/mount.h
503 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
504 #ifdef HAVE_SYS_TYPES_H
505 #include <sys/types.h>
506 #endif
507 #ifdef HAVE_SYS_PARAM_H
508 #include <sys/param.h>
509 #endif
510 #include <sys/mount.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/mount.h)
511         AC_DEFINE(STATFS_IN_SYS_MOUNT, 1, [statfs in <sys/mount.h> (for Digital Unix 4.0D systems)])
512         found_struct_statfs=yes],[])
513 fi
514
515 if test X$found_struct_statfs = Xno ; then
516 dnl ...still no joy.  Try sys/statfs.h
517 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
518 #ifdef HAVE_SYS_TYPES_H
519 #include <sys/types.h>
520 #endif
521 #include <sys/statfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/statfs.h)
522         AC_DEFINE(STATFS_IN_SYS_STATFS, 1, [statfs in <sys/statfs.h> (for Irix 6.4 systems)])
523         found_struct_statfs=yes],[])
524 fi
525
526 if test X$found_struct_statfs = Xno ; then
527 dnl ...no luck.  Warn the user of impending doom.
528 AC_MSG_WARN(not found)
529 fi
530
531 dnl
532 dnl if we found the struct, see if it has the f_bavail member.  Some OSes
533 dnl don't, including IRIX 6.5+
534 dnl
535 if test X$found_struct_statfs = Xyes ; then
536 AC_MSG_CHECKING(for f_bavail member in struct statfs)
537 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
538 #ifdef HAVE_SYS_TYPES_H
539 #include <sys/types.h>
540 #endif
541 #if STATFS_IN_SYS_STATVFS
542 # include <sys/statvfs.h>
543   typedef struct statvfs STATFS_t;
544 #else
545   typedef struct statfs STATFS_t;
546 # if STATFS_IN_SYS_VFS
547 #  include <sys/vfs.h>
548 # elif STATFS_IN_SYS_MOUNT
549 #  include <sys/mount.h>
550 # elif STATFS_IN_SYS_STATFS
551 #  include <sys/statfs.h>
552 # endif
553 #endif ]], [[STATFS_t sfs;
554         sfs.f_bavail = 0;]])],[AC_MSG_RESULT(yes)
555         AC_DEFINE(STATFS_HAS_F_BAVAIL, 1, [Define if struct statfs has the f_bavail member])],[AC_MSG_RESULT(no)
556 ])
557 fi
558
559 if test X$found_struct_statfs = Xyes ; then
560 dnl
561 dnl now check to see if we have the 4-argument variant of statfs()
562 dnl this pretty much requires AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[])
563 dnl
564 AC_MSG_CHECKING([if statfs() requires 4 arguments])
565 AC_RUN_IFELSE([AC_LANG_SOURCE([[
566 #ifdef HAVE_SYS_TYPES_H
567 #include <sys/types.h>
568 #endif
569 #ifdef STATFS_IN_SYS_VFS
570 #include <sys/vfs.h>
571 #elif STATFS_IN_SYS_MOUNT
572 #include <sys/mouht.h>
573 #elif STATFS_IN_SYS_STATFS
574 #include <sys/statfs.h>
575 #endif
576 main() {
577         struct statfs sfs;
578         exit (statfs(".", &sfs, sizeof(sfs), 0));
579 }
580 ]])],[AC_MSG_RESULT(yes)
581         AC_DEFINE(STAT_STATFS4, 1, [Define if the statfs() call takes 4 arguments])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)
582 ])
583 fi
584
585 AC_C_INLINE
586
587 dnl look for libc features
588 PROVIDES_ERRNO=no
589 AC_MSG_CHECKING(if <netdb.h> defines h_errno)
590 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[printf("%d",h_errno)]])],[PROVIDES_ERRNO=yes],[])
591 AC_MSG_RESULT($PROVIDES_ERRNO)
592 if test $PROVIDES_ERRNO = yes; then
593         AC_DEFINE(HAVE_HERRNO, 1, [ Define as 1 if <netdb.h> defines h_errno])
594 fi
595
596 dnl If a system doesn't have S_IFSOCK, define it as 0 which will
597 dnl make S_ISSOCK always return false (nice, eh?)
598 AC_MSG_CHECKING(if <sys/stat.h> defines S_IFSOCK)
599 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_IFSOCK)]])],[HAS_S_IFSOCK=yes],[HAS_S_IFSOCK=no])
600 AC_MSG_RESULT($HAS_S_IFSOCK)
601 if test $HAS_S_IFSOCK = yes; then
602         AC_DEFINE(HAVE_S_IFSOCK, 1, [Define as 1 if <sys/stat.h> defines S_IFSOCK])
603 fi
604
605 dnl Some Unix's are missing S_ISLNK, S_ISSOCK
606 AC_MSG_CHECKING(if <sys/stat.h> defines S_ISLNK)
607 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_ISLNK(0755))]])],[HAS_S_ISLNK=yes],[HAS_S_ISLNK=no])
608 AC_MSG_RESULT($HAS_S_ISLNK)
609 if test $HAS_S_ISLNK = yes; then
610         AC_DEFINE(HAVE_S_ISLNK, 1, [Define as 1 if <sys/stat.h> defines S_ISLNK])
611 fi
612
613 AC_MSG_CHECKING(if <sys/stat.h> defines S_ISSOCK)
614 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_ISSOCK(0755))]])],[HAS_S_ISSOCK=yes],[HAS_S_ISSOCK=no])
615 AC_MSG_RESULT($HAS_S_ISSOCK)
616 if test $HAS_S_ISSOCK = yes; then
617         AC_DEFINE(HAVE_S_ISSOCK, 1, [Define as 1 if <sys/stat.h> defines S_ISSOCK])
618 fi
619
620 dnl Check for missing typedefs
621 AC_TYPE_MODE_T
622 AC_TYPE_OFF_T
623 AC_TYPE_PID_T
624 AC_TYPE_SIZE_T
625
626 dnl Checks for library functions.
627 AC_FUNC_VPRINTF
628 dnl XXX don't want to re-enable code that's been unused for years at this
629 dnl point, but should offer good performance improvements, check after
630 dnl 4.4.2.1...
631 dnl AC_FUNC_MMAP
632
633 AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_aton)
634 AC_CHECK_FUNCS(mtrace)
635 AC_CHECK_FUNCS(strndup strerror)
636
637 AC_REPLACE_FUNCS(basename getcwd getwd)
638 AC_REPLACE_FUNCS(putenv realpath setenv)
639 AC_REPLACE_FUNCS(stpcpy stpncpy strcspn)
640 AC_REPLACE_FUNCS(strdup strtol strtoul strspn strstr)
641
642 AC_CHECK_FUNCS(__secure_getenv)
643
644 AC_CHECK_FUNCS(regcomp)
645
646 AC_CHECK_FUNCS(ftok)
647
648 AC_CHECK_FUNCS([mkstemp], [], [AC_MSG_ERROR([mkstemp() is required by rpm])])
649
650 dnl XXX Glob *is* broken on linux with libc5, solaris and possibly aix when
651 dnl %files gets something like
652 dnl     /usr/*/locale/*/LC_MESSAGES/*.mo
653 dnl (Note: more than one asterisk in glob pattern.)
654 dnl
655 dnl XXX Glob is "fixed" in glibc-2.3.3-61, but the cost is that
656 dnl dangling symlinks are no longer globbed. Always use the internal glob.
657 AC_DEFINE(USE_GNU_GLOB, 1, [Use the included glob.c?])
658 AC_LIBOBJ(glob)
659 AC_LIBOBJ(fnmatch)
660
661 dnl check if python is requested
662 AC_ARG_ENABLE(python, [  --enable-python         build rpm python bindings ],
663 [case "$enable_python" in
664 yes|no) ;;
665 *) AC_MSG_ERROR([invalid argument to --enable-python])
666   ;;
667 esac],
668 [enable_python=no])
669
670 AS_IF([test "$enable_python" = yes],[
671 # rpm-python is based on python-2.5, 
672 # with legacy hacks to allow building against python >= 2.3
673   AM_PATH_PYTHON([2.3],[
674     WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; print get_python_inc()'`
675     WITH_PYTHON_SUBPACKAGE=1
676     save_CPPFLAGS="$CPPFLAGS"
677     CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
678     AC_CHECK_HEADER([Python.h],[],
679       [AC_MSG_ERROR([missing Python.h])
680       ])
681     CPPFLAGS="$save_CPPFLAGS"
682     save_LIBS="$LIBS"
683     AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
684       WITH_PYTHON_LIB="$ac_res"
685     ],[AC_MSG_ERROR([missing python library])
686     ])
687     LIBS="$save_LIBS"
688   ])
689 ],[
690     WITH_PYTHON_INCLUDE=
691     WITH_PYTHON_LIB=
692     WITH_PYTHON_SUBPACKAGE=0
693 ])
694
695 AC_SUBST(WITH_PYTHON_INCLUDE)
696 AC_SUBST(WITH_PYTHON_LIB)
697
698 AM_CONDITIONAL(PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = 1])
699
700 AC_PATH_PROG(DOXYGEN, doxygen, no)
701 dnl
702 dnl Only build internal API + source hacking docs on request
703 dnl
704 AC_ARG_WITH(hackingdocs, [  --with-hackingdocs          build rpm hacking docs ],,[with_hackingdocs=no])
705
706 case "$with_hackingdocs" in
707 auto)
708   AS_IF([test "$DOXYGEN" = no],[with_hackingdocs=no],[with_hackingdocs=no])
709   ;;
710 yes)
711   AS_IF([test "$DOXYGEN" = no],
712     [AC_MSG_ERROR([rpm hacking docs eeds doxygen in PATH])])
713   ;;
714 esac
715 AC_CHECK_PROG(HAVE_DOT,[dot],[YES],[NO])
716
717 WITH_SELINUX_LIB=
718 AC_ARG_WITH(selinux, [  --with-selinux          build with selinux support ],
719 [case "$with_selinux" in
720 yes|no) ;;
721 *) AC_MSG_ERROR([invalid argument to --with-selinux])
722   ;;
723 esac],
724 [with_selinux=no])
725
726 AS_IF([test "$with_selinux" = yes],[
727   AC_CHECK_HEADER([selinux/selinux.h],[
728     AC_CHECK_LIB(selinux,[is_selinux_enabled],[with_selinux=yes],[
729       AC_MSG_ERROR([--with-selinux given, but libselinux not found])])
730   ],[
731     AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found])
732   ])
733 ])
734
735 AS_IF([test "$with_selinux" = yes],[
736   AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
737   WITH_SELINUX_LIB="-lselinux"
738 ])
739 AC_SUBST(WITH_SELINUX_LIB)
740 AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
741
742 # libcap
743 WITH_CAP_LIB=
744 AC_ARG_WITH(cap, [  --with-cap              build with capability support ],
745 [case "$with_cap" in
746 yes|no) ;;
747 *) AC_MSG_ERROR([invalid argument to --with-cap])
748   ;;
749 esac],
750 [with_cap=no])
751
752 AS_IF([test "$with_cap" = yes],[
753   AC_CHECK_HEADER([sys/capability.h],[
754     AC_CHECK_LIB(cap,[cap_get_file], [
755       with_cap=yes
756       save_LIBS="$LIBS"
757       AC_CHECK_LIB(cap,[cap_compare], [
758         AC_DEFINE(HAVE_CAP_COMPARE, 1, [Have cap_compare function?])
759       ])
760       LIBS="$save_LIBS"
761     ],[
762       AC_MSG_ERROR([--with-cap given, but libcap not found])])
763   ],[
764     AC_MSG_ERROR([--with-cap given, but sys/capability.h not found])
765   ])
766 ])
767
768 AS_IF([test "$with_cap" = yes],[
769   AC_DEFINE(WITH_CAP, 1, [Build with capability support?])
770   WITH_CAP_LIB="-lcap"
771 ])
772 AC_SUBST(WITH_CAP_LIB)
773 AM_CONDITIONAL(CAP,[test "$with_cap" = yes])
774
775 WITH_ACL_LIB=
776 AC_ARG_WITH(acl, [  --with-acl              build with acl support ],
777 [case "$with_acl" in
778 yes|no) ;;
779 *) AC_MSG_ERROR([invalid argument to --with-acl])
780   ;;
781 esac],
782 [with_acl=no])
783
784 AS_IF([test "$with_acl" = yes],[
785   dnl verification uses non-portable acl_equiv_mode() 
786   AC_CHECK_HEADER([acl/libacl.h],[
787     AC_CHECK_LIB(acl,[acl_equiv_mode],[with_acl=yes],[
788       AC_MSG_ERROR([--with-acl given, but libacl not found or not suitable])])
789   ],[
790     AC_MSG_ERROR([--with-acl given, but acl/libacl.h not found])
791   ])
792 ])
793
794 AS_IF([test "$with_acl" = yes],[
795   AC_DEFINE(WITH_ACL, 1, [Build with acl support?])
796   WITH_ACL_LIB="-lacl"
797 ])
798 AC_SUBST(WITH_ACL_LIB)
799 AM_CONDITIONAL(ACL,[test "$with_acl" = yes])
800
801 WITH_LUA_LIB=
802 WITH_LUA_INCLUDE=
803 AC_ARG_WITH(lua, [  --with-lua              build with lua support ],,[with_lua=yes])
804 AS_IF([test "$with_lua" = yes],[
805   AC_CHECK_HEADER([lua.h],[
806     AC_CHECK_LIB(lua,[luaL_openlibs],[with_lua=yes],[
807       AC_MSG_ERROR([--with-lua given, but liblua not found])
808     ], 
809     [-lm])
810   ],[
811       AC_MSG_ERROR([--with-lua given, but lua.h not found])
812   ])
813 ])
814
815 AS_IF([test "$with_lua" = yes],[
816   AC_DEFINE(WITH_LUA, 1, [Build with lua support?])
817   WITH_LUA_INCLUDE=
818   WITH_LUA_LIB="-llua -lm" 
819 ])
820 AC_SUBST(WITH_LUA_LIB)
821 AC_SUBST(WITH_LUA_INCLUDE)
822 AM_CONDITIONAL(WITH_LUAEXT,[test "$with_lua" = yes])
823
824 with_dmalloc=no
825 AC_ARG_WITH(dmalloc, [  --with-dmalloc          build with dmalloc debugging support ])
826 if test "$with_dmalloc" = yes ; then
827   AC_DEFINE(DMALLOC, 1, [Build with dmalloc support?])
828   LIBS="$LIBS -ldmalloc"
829 fi
830
831 AC_CHECK_FUNCS(setlocale)
832
833 AC_CHECK_FUNCS(getpassphrase)
834
835 AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT, 1, [Define if you have the getmntent() function]), [
836   AC_CHECK_FUNC(mntctl, AC_DEFINE(HAVE_MNTCTL, 1, [Define as 1 if you have mntctl() (only aix?)]),[
837     AC_CHECK_FUNC(getmntinfo, AC_DEFINE(HAVE_GETMNTINFO, 1, [Define as 1 if you have getmntinfo() (Mac OS X)]), [
838       AC_CHECK_FUNC(getmntinfo_r, AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)]), [
839         AC_CHECK_LIB(c_r, getmntinfo_r, [LIBS="$LIBS -lc_r"; 
840                                         AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)])], [
841                  AC_DEFINE([USE_GETMNTENT], 1, [Defined if getmntent replacement is used])
842                  AC_LIBOBJ(getmntent)])
843       ])
844     ])
845   ])
846 ])
847
848 AC_CHECK_FUNC(lchown,
849    [__CHOWN_RHF="%{__chown} -Rhf"
850     __CHGRP_RHF="%{__chgrp} -Rhf"
851     AC_DEFINE(HAVE_LCHOWN, 1, [Define as 1 if you have lchown()])],
852    [__CHOWN_RHF="%{__chown} -Rf"
853     __CHGRP_RHF="%{__chgrp} -Rf"
854     dnl Does chown() follow symlinks? This should be a good enough test.
855     AC_MSG_CHECKING(whether chown() follows symlinks)
856     AC_ARG_ENABLE([broken-chown],
857     [  --enable-broken-chown   this system's chown follows symbolic links], 
858             result=$enableval, result=unknown)
859     if echo "$build" | ${EGREP} "(aix)|(hpux)|(linux)" > /dev/null ; then
860         result=yes
861     elif echo "$build" | ${EGREP} "(nextstep)" > /dev/null ; then
862         result=no
863     fi
864     if test $result = unknown; then
865         if test `${__ID} | cut -f2 -d\= | cut -f1 -d\(` = 0; then
866             rm -f foo bar
867             touch foo
868             ln -s foo bar
869             ${__CHOWN} 10 bar
870             if test `ls -l foo | awk '{print $3}'` != "root"; then
871                 result=yes
872             else
873                 result=no
874             fi
875             ${__RM} -f foo bar
876         else
877             AC_MSG_CHECKING((cannot check by non-root user))
878             result=no
879         fi
880     fi
881
882     AC_MSG_RESULT($result)
883     if test $result = yes; then
884             AC_DEFINE(CHOWN_FOLLOWS_SYMLINK, 1, [Define as 1 if chown() follows symlinks and you don't have lchown()])
885     fi])
886 AC_SUBST(__CHOWN_RHF)
887 AC_SUBST(__CHGRP_RHF)
888
889 if echo "$host_os" | grep sco > /dev/null; then
890         echo "hacking things up for sco"
891         AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include <strings.h> (along with <string.h>)])
892         AC_DEFINE(HAVE_STRUCT_MNTTAB, 1,
893         [Define as 1 if you have "struct mnttab" (only sco?)])
894 elif echo "$host_os" | grep sunos > /dev/null; then
895         echo "hacking things up for sunos"
896         CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__"
897         AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include <strings.h> (along with <string.h>)])
898         AC_DEFINE(NEED_MYREALLOC, 1, [Define as 1 if we need myrealloc])
899         AC_LIBOBJ(myrealloc)
900 fi
901
902 #
903 # get rid of the 4-th tuple, if config.guess returned "linux-gnu" for host_os
904 #
905 host_os_gnu=-gnu
906 if echo "$host_os" | grep '.*-gnulibc1' > /dev/null ; then
907         host_os=`echo "${host_os}" | sed 's/-gnulibc1$//'`
908 fi
909 if echo "$host_os" | grep '.*-gnueabi' > /dev/null ; then
910         host_os=`echo "${host_os}" | sed 's/-gnueabi$//'`
911         host_os_gnu=-gnueabi
912 fi
913 if echo "$host_os" | grep '.*-gnu' > /dev/null ; then
914         host_os=`echo "${host_os}" | sed 's/-gnu$//'`
915 fi
916
917 changequote(<, >)
918 host_os_exact="${host_os}"
919 host_os_major=`echo "${host_os}" | sed 's/\..*$//'`
920 host_os_noversion=`echo "${host_os}" | sed 's/[0-9]*\..*$//'`
921 changequote([, ])
922
923 rm -f ./find-provides
924 if test -f ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov ; then
925         echo "using ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov for automatic provides generation"
926     ln -s ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov ./find-provides
927 elif test -f ${srcdir}/autodeps/${host_os_exact}.prov ; then
928         echo "using ${srcdir}/autodeps/${host_os_exact}.prov for automatic provides generation"
929     ln -s ${srcdir}/autodeps/${host_os_exact}.prov ./find-provides
930 elif test -f ${srcdir}/autodeps/${host_os_major}.prov ; then
931         echo "using ${srcdir}/autodeps/${host_os_major}.prov for automatic provides generation"
932     ln -s ${srcdir}/autodeps/${host_os_major}.prov ./find-provides
933 elif test -f ${srcdir}/autodeps/${host_os_noversion}.prov ; then
934         echo "using ${srcdir}/autodeps/${host_os_noversion}.prov for automatic provides generation"
935     ln -s ${srcdir}/autodeps/${host_os_noversion}.prov ./find-provides
936 else
937     echo "*** no default provides information is available for ${host_os_noversion}"
938     ln -s ${srcdir}/autodeps/none ./find-provides
939 fi
940
941 rm -f ./find-requires
942 if test -f ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req ; then
943         echo "using ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req for automatic requires generation"
944     ln -s ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req ./find-requires
945 elif test -f ${srcdir}/autodeps/${host_os_exact}.req ; then
946         echo "using ${srcdir}/autodeps/${host_os_exact}.req for automatic requires generation"
947     ln -s ${srcdir}/autodeps/${host_os_exact}.req ./find-requires
948 elif test -f ${srcdir}/autodeps/${host_os_major}.req ; then
949         echo "using ${srcdir}/autodeps/${host_os_major}.req for automatic requires generation"
950     ln -s ${srcdir}/autodeps/${host_os_major}.req ./find-requires
951 elif test -f ${srcdir}/autodeps/${host_os_noversion}.req ; then
952         echo "using ${srcdir}/autodeps/${host_os_noversion}.req for automatic requires generation"
953     ln -s ${srcdir}/autodeps/${host_os_noversion}.req ./find-requires
954 else
955     echo "*** no default requires information is available for ${host_os_noversion}"
956     ln -s ${srcdir}/autodeps/none ./find-requires
957 fi
958
959 dnl Determine the canonical arch-vendor-os for the host machine
960 case "${host_cpu}" in
961 *86)            RPMCANONCOLOR=0; RPMCANONARCH=i386 ;;
962 ia32e*)         RPMCANONCOLOR=3; RPMCANONARCH=ia32e ;;
963 amd64*)         RPMCANONCOLOR=3; RPMCANONARCH=amd64 ;;
964 x86_64*)        RPMCANONCOLOR=3; RPMCANONARCH=x86_64 ;;
965 alpha*)         RPMCANONCOLOR=0; RPMCANONARCH=alpha ;;
966 sparc64*)       RPMCANONCOLOR=3; RPMCANONARCH=sparc64 ;;
967 sparc*)         RPMCANONCOLOR=3; RPMCANONARCH=sparc ;;
968 ia64*)          RPMCANONCOLOR=2; RPMCANONARCH=ia64 ;;
969 s390x*)         RPMCANONCOLOR=3; RPMCANONARCH=s390x ;;
970 s390*)          RPMCANONCOLOR=0; RPMCANONARCH=s390 ;;
971 powerpc64*|ppc64*)      RPMCANONCOLOR=3; RPMCANONARCH=ppc64 ;;
972 powerpc*|ppc*)  RPMCANONCOLOR=0; RPMCANONARCH=ppc ;;
973 arm*)           RPMCANONCOLOR=0; RPMCANONARCH=arm ;;
974 mipsel*)        RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
975 mips*)          RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
976 m68k*)          RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
977 sh3*)           RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
978 sh4*)           RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
979 *)              RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
980 esac
981 case "${host_os_noversion}" in
982 mint)           RPMCANONARCH=m68kmint ;;
983 esac
984 RPMCANONVENDOR="$build_vendor"
985 case "${build_vendor}" in
986 unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse)
987         test -f /etc/redhat-release &&          RPMCANONVENDOR=redhat
988         test -f /etc/SuSE-release &&            RPMCANONVENDOR=suse
989         test -f /etc/pld-release &&             RPMCANONVENDOR=pld
990         test -f /etc/mandrake-release &&        RPMCANONVENDOR=mandrake
991         test -f /etc/conectiva-release &&       RPMCANONVENDOR=conectiva
992         test -f /etc/lvr-release &&             RPMCANONVENDOR=lvr
993         test -f /etc/yellowdog-release &&       RPMCANONVENDOR=yellowdog
994         test -f /etc/caos-release &&            RPMCANONVENDOR=caos
995         ;;
996 esac
997 RPMCANONOS="$host_os_noversion"
998 RPMCANONGNU="$host_os_gnu"
999 AC_SUBST(RPMCANONCOLOR)
1000 AC_SUBST(RPMCANONARCH)
1001 AC_SUBST(RPMCANONVENDOR)
1002 AC_SUBST(RPMCANONOS)
1003 AC_SUBST(RPMCANONGNU)
1004 AC_DEFINE_UNQUOTED([RPMCANONVENDOR],["${RPMCANONVENDOR}"],[canonical vendor])
1005
1006 if test X"$prefix" = XNONE ; then
1007     usrprefix="$ac_default_prefix"
1008 else
1009     usrprefix=$prefix
1010 fi
1011
1012 RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
1013 AC_SUBST(RPMCONFIGDIR)
1014
1015 AC_SUBST(OBJDUMP)
1016
1017 if test "$with_external_db" = no; then
1018     AC_CONFIG_SUBDIRS(db3)
1019 fi
1020
1021 AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no])
1022 AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
1023 AM_CONDITIONAL([HACKINGDOCS],[test "$with_hackingdocs" = yes])
1024
1025 AC_PATH_PROG(AUTOM4TE,autom4te,:)
1026
1027 AS_IF([test "$ac_cv_header_stdint_h" = "yes"],[
1028 AC_DEFINE([__RPM_USES_STDINT_H__],[1],[if rpm uses stdint.h])
1029 ])
1030
1031 AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
1032
1033 AC_CONFIG_FILES([Makefile
1034         rpmio/Makefile lib/Makefile build/Makefile
1035         po/Makefile.in scripts/Makefile 
1036         misc/Makefile 
1037         doc/Makefile
1038         python/Makefile
1039         luaext/Makefile
1040         tests/Makefile
1041   ])
1042 AC_OUTPUT