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