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