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