2007-08-05 16:30:55 +08:00
|
|
|
AC_PREREQ(2.61)
|
2007-07-25 22:10:57 +08:00
|
|
|
AC_INIT(rpm, 4.4.90, rpm-maint@lists.rpm.org)
|
2007-08-06 20:46:11 +08:00
|
|
|
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_CONFIG_SRCDIR([rpmqv.c])
|
2007-10-27 11:48:53 +08:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2004-01-05 22:09:47 +08:00
|
|
|
|
2007-10-17 22:42:21 +08:00
|
|
|
AM_INIT_AUTOMAKE([1.10 foreign tar-ustar dist-bzip2 subdir-objects nostdinc])
|
2004-01-05 22:09:47 +08:00
|
|
|
|
2007-08-20 18:31:28 +08:00
|
|
|
AC_CONFIG_TESTDIR(tests)
|
|
|
|
|
2007-11-21 23:51:57 +08:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2007-09-10 13:11:54 +08:00
|
|
|
|
2007-11-21 23:51:57 +08:00
|
|
|
AC_DISABLE_STATIC
|
2007-06-06 19:42:19 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl Checks for programs.
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_AWK
|
1996-12-12 11:32:40 +08:00
|
|
|
AC_PROG_CC
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2007-06-06 19:42:19 +08:00
|
|
|
AC_PROG_LIBTOOL
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_PROG_YACC
|
|
|
|
|
2001-08-01 02:13:22 +08:00
|
|
|
AS=${AS-as}
|
|
|
|
AC_SUBST(AS)
|
2007-08-27 22:16:12 +08:00
|
|
|
if test "$GCC" = yes; then
|
2007-11-21 23:51:57 +08:00
|
|
|
CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts"
|
2007-11-08 18:57:02 +08:00
|
|
|
# XXX disabled for now due to noise from NSPR headers
|
|
|
|
# CFLAGS="$CFLAGS -Wstrict-prototypes"
|
2007-06-20 17:06:36 +08:00
|
|
|
cflags_to_try="-fno-strict-aliasing"
|
|
|
|
AC_MSG_CHECKING([supported compiler flags])
|
|
|
|
old_cflags=$CFLAGS
|
|
|
|
echo
|
|
|
|
for flag in $cflags_to_try; do
|
|
|
|
CFLAGS="$CFLAGS $flag"
|
2007-10-27 12:28:06 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[
|
2007-06-20 17:06:36 +08:00
|
|
|
echo " $flag"
|
|
|
|
RPMCFLAGS="$RPMCFLAGS $flag"
|
2007-10-27 12:28:06 +08:00
|
|
|
],[])
|
2007-06-20 17:06:36 +08:00
|
|
|
CFLAGS=$old_cflags
|
|
|
|
done
|
|
|
|
CFLAGS="$CFLAGS $RPMCFLAGS"
|
1998-10-08 18:40:27 +08:00
|
|
|
fi
|
2001-05-08 08:03:14 +08:00
|
|
|
export CFLAGS
|
1998-10-08 18:40:27 +08:00
|
|
|
|
2002-11-20 02:40:21 +08:00
|
|
|
AC_SYS_LARGEFILE
|
2001-05-10 06:58:56 +08:00
|
|
|
|
2007-10-27 10:12:19 +08:00
|
|
|
AC_CHECK_HEADER([stdarg.h])
|
|
|
|
AC_MSG_CHECKING([for va_copy])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <stdarg.h>
|
|
|
|
void foo(int i, ...) {
|
|
|
|
va_list ap, aq;
|
|
|
|
va_start(ap, i);
|
|
|
|
va_copy(aq,ap);
|
|
|
|
va_end(aq);
|
|
|
|
}]], [[
|
|
|
|
foo(1,2,3,4);
|
|
|
|
]])],[ac_cv_va_copy=yes],[ac_cv_va_copy=no])
|
|
|
|
AC_MSG_RESULT([$ac_cv_va_copy])
|
2001-08-15 22:03:03 +08:00
|
|
|
|
2001-05-10 06:58:56 +08:00
|
|
|
RPMUSER=rpm
|
|
|
|
RPMUID=37
|
|
|
|
RPMGROUP=rpm
|
|
|
|
RPMGID=37
|
|
|
|
export RPMUSER RPMUID RPMGROUP RPMGID
|
|
|
|
AC_SUBST(RPMUSER)
|
|
|
|
AC_SUBST(RPMUID)
|
|
|
|
AC_SUBST(RPMGROUP)
|
|
|
|
AC_SUBST(RPMGID)
|
1996-12-12 11:32:40 +08:00
|
|
|
|
1998-03-05 00:53:54 +08:00
|
|
|
dnl
|
1999-01-26 03:46:40 +08:00
|
|
|
dnl This now uses libtool. Put
|
|
|
|
dnl LDFLAGS_STATIC="-all"
|
|
|
|
dnl to attempt static executables using libtool. Otherwise
|
|
|
|
dnl LDFLAGS_STATIC=""
|
1998-03-05 00:53:54 +08:00
|
|
|
dnl
|
1999-01-26 03:46:40 +08:00
|
|
|
AC_MSG_CHECKING(flag used by libtool to link rpm)
|
1998-03-05 00:53:54 +08:00
|
|
|
if test X"$GCC" = Xyes ; then
|
2007-08-06 20:46:11 +08:00
|
|
|
case "$host" in
|
2007-06-20 15:26:14 +08:00
|
|
|
*-*-linux*) LDFLAGS_STATIC="-all-static" ;;
|
2001-02-28 05:30:27 +08:00
|
|
|
*-*-solaris*) LDFLAGS_STATIC="-static";;
|
|
|
|
*-*-hpux*) LDFLAGS_STATIC="-static";;
|
2005-01-05 03:31:31 +08:00
|
|
|
*-*-darwin*) LDFLAGS_STATIC="";; # Mac OS X does not do static binaries.
|
2001-02-28 05:30:27 +08:00
|
|
|
*-*-sysv5uw*) LDFLAGS_STATUS="-static";; # Unixware has no shared libthread.
|
2005-01-18 07:58:09 +08:00
|
|
|
*-*-*) LDFLAGS_STATIC="";;
|
1998-03-05 00:53:54 +08:00
|
|
|
esac
|
|
|
|
elif test X"$CC" = Xcc ; then
|
2007-08-06 20:46:11 +08:00
|
|
|
case "$host" in
|
2001-02-28 05:30:27 +08:00
|
|
|
*-*-linux*) LDFLAGS_STATIC="-all-static";;
|
|
|
|
*-*-freebsd*) LDFLAGS_STATIC="-all-static";;
|
|
|
|
*-*-osf*) LDFLAGS_STATIC="";; # OSF5 has no shared pthreads libs
|
|
|
|
*-*-aix*) LDFLAGS_STATIC="-static";; # -Wl,-bnso doesn't seem to work...
|
|
|
|
*-*-hpux*) LDFLAGS_STATIC="-static";;
|
|
|
|
*-*-solaris*) LDFLAGS_STATIC="-static";;
|
|
|
|
*-*-irix*) LDFLAGS_STATIC="-static";; #should be -non_shared, but can't
|
1998-03-05 00:53:54 +08:00
|
|
|
# link because of crt1.o then.
|
2001-02-28 05:30:27 +08:00
|
|
|
*-*-ultrix*) LDFLAGS_STATIC="-all-static";; #ultrix doesn't have shared libs.
|
2005-01-18 07:58:09 +08:00
|
|
|
*-*-*) LDFLAGS_STATIC=""
|
1998-03-05 00:53:54 +08:00
|
|
|
AC_MSG_WARN([
|
|
|
|
|
|
|
|
Unable to guess what option to pass to $CC to generate a static
|
1998-05-02 03:33:51 +08:00
|
|
|
executable. You will need to set the LDFLAGS_STATIC macro in Makefile.inc to
|
1998-03-05 00:53:54 +08:00
|
|
|
the appropriate argument(s) if you want to build a static rpm executable.
|
|
|
|
|
|
|
|
])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
1998-05-02 03:33:51 +08:00
|
|
|
# just link it dynamically
|
|
|
|
LDFLAGS_STATIC=""
|
1998-03-05 00:53:54 +08:00
|
|
|
fi
|
2001-02-28 05:30:27 +08:00
|
|
|
LDFLAGS_STATIC="${LDFLAGS} ${LDFLAGS_STATIC}" # libtool format
|
1998-05-02 03:33:51 +08:00
|
|
|
AC_MSG_RESULT($LDFLAGS_STATIC)
|
1999-04-16 13:44:36 +08:00
|
|
|
AC_SUBST(LDFLAGS_STATIC)
|
1998-03-05 00:53:54 +08:00
|
|
|
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
|
|
|
dnl look for POSIX chmod attributes
|
|
|
|
dnl
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(POSIX chmod)
|
1997-01-17 01:23:44 +08:00
|
|
|
touch foo.chmodtest
|
|
|
|
chmod 744 foo.chmodtest
|
|
|
|
chmod +X foo.chmodtest 2>/dev/null
|
|
|
|
a=`ls -l foo.chmodtest | awk '{print $1}'`
|
|
|
|
rm -f foo.chmodtest
|
|
|
|
if test "$a" = "-rwxr-xr-x"; then
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
2004-03-28 08:49:54 +08:00
|
|
|
FIXPERMS=a+rX,u+w,g-w,o-w
|
1997-01-17 01:23:44 +08:00
|
|
|
else
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(no (tell your OS vendor about GNU fileutils))
|
2004-03-28 08:49:54 +08:00
|
|
|
FIXPERMS=a+r,u+w,g-w,o-w
|
1997-01-17 01:23:44 +08:00
|
|
|
fi
|
1999-04-16 13:44:36 +08:00
|
|
|
AC_SUBST(FIXPERMS)
|
1997-01-17 01:23:44 +08:00
|
|
|
|
1998-03-05 00:53:54 +08:00
|
|
|
dnl
|
|
|
|
dnl see if we have a mkdir that supports `-p'.
|
|
|
|
dnl
|
2007-08-15 19:49:01 +08:00
|
|
|
AC_PATH_PROGS(RPM_MKDIR, mkdir, mkdir)
|
|
|
|
AC_MSG_CHECKING(if $RPM_MKDIR supports -p)
|
1998-03-05 00:53:54 +08:00
|
|
|
rm -rf conftest
|
2007-08-15 19:49:01 +08:00
|
|
|
$RPM_MKDIR -p conftest/a 2>/dev/null
|
1998-03-05 00:53:54 +08:00
|
|
|
if test $? = 0 ; then
|
|
|
|
rmdir conftest/a 2>/dev/null
|
|
|
|
if test $? = 0 ; then
|
|
|
|
:
|
|
|
|
else
|
2007-08-15 19:49:01 +08:00
|
|
|
RPM_MKDIR_P=0
|
1998-03-05 00:53:54 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
rmdir conftest 2>/dev/null
|
|
|
|
if test $? = 0 ; then
|
2007-08-15 19:49:01 +08:00
|
|
|
RPM_MKDIR_P="$RPM_MKDIR -p"
|
1998-03-05 00:53:54 +08:00
|
|
|
else
|
2007-08-15 19:49:01 +08:00
|
|
|
RPM_MKDIR_P=0
|
1998-03-05 00:53:54 +08:00
|
|
|
fi
|
|
|
|
else
|
2007-08-15 19:49:01 +08:00
|
|
|
RPM_MKDIR_P=0
|
1998-03-05 00:53:54 +08:00
|
|
|
fi
|
|
|
|
|
2007-08-15 19:49:01 +08:00
|
|
|
if test X"$RPM_MKDIR_P" = X0 ; then
|
1998-03-05 00:53:54 +08:00
|
|
|
AC_MSG_RESULT(no)
|
2007-08-15 19:49:01 +08:00
|
|
|
RPM_MKDIR_P="`echo ${prefix}/lib/rpm/mkinstalldirs`"
|
1998-03-05 00:53:54 +08:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
fi
|
|
|
|
dnl
|
|
|
|
dnl substitute this into config.h, so the C source picks it up.
|
|
|
|
dnl
|
2007-08-15 19:49:01 +08:00
|
|
|
AC_DEFINE_UNQUOTED(RPM_MKDIR_P, "${RPM_MKDIR_P}",
|
2002-05-02 06:13:00 +08:00
|
|
|
[A full path to a program, possibly with arguments, that will create a
|
2005-02-17 10:36:37 +08:00
|
|
|
directory and all necessary parent directories, ala 'mkdir -p'])
|
2007-08-15 19:49:01 +08:00
|
|
|
AC_SUBST(RPM_MKDIR_P)
|
1998-03-05 00:53:54 +08:00
|
|
|
|
1999-07-16 06:26:15 +08:00
|
|
|
dnl AM_DISABLE_SHARED
|
1999-01-22 06:30:50 +08:00
|
|
|
AM_PROG_LIBTOOL
|
1996-12-12 11:32:40 +08:00
|
|
|
|
|
|
|
AC_CHECK_TOOL(AR, ar, :)
|
|
|
|
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
2002-05-17 00:55:21 +08:00
|
|
|
dnl use defaults if cross-compiling, otherwise use the default path.
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
2002-05-17 00:55:21 +08:00
|
|
|
if test "$cross_compiling" = "yes"; then
|
2005-01-30 00:05:03 +08:00
|
|
|
MYPATH=":"
|
2002-05-17 00:55:21 +08:00
|
|
|
else
|
|
|
|
MYPATH=$PATH
|
|
|
|
fi
|
1998-05-26 21:19:52 +08:00
|
|
|
|
1999-04-16 13:44:36 +08:00
|
|
|
dnl
|
|
|
|
dnl Find some common programs
|
|
|
|
dnl
|
2007-09-18 20:55:58 +08:00
|
|
|
AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH)
|
|
|
|
AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
|
2007-09-12 18:42:59 +08:00
|
|
|
AC_PATH_PROG(__CURL, curl, /usr/bin/curl, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__FILE, file, /usr/bin/file, $MYPATH)
|
|
|
|
AC_PATH_PROG(__GPG, gpg, /usr/bin/gpg, $MYPATH)
|
|
|
|
AC_PATH_PROG(__GREP, grep, /bin/grep, $MYPATH)
|
2007-09-18 20:55:58 +08:00
|
|
|
AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
|
|
|
|
AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
|
|
|
|
AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
|
|
|
|
AC_MSG_CHECKING(checking whether id supports -u)
|
|
|
|
if ${__ID} -u 2>&1 > /dev/null ; then
|
2000-03-10 02:13:02 +08:00
|
|
|
__ID_U="%{__id} -u"
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
2000-03-10 04:48:15 +08:00
|
|
|
__ID_U="%{__id} | %{__sed} 's/[[^=]]*=\\\\([[0-9]][[0-9]]*\\\\).*$/\\\\1/'"
|
2000-03-10 02:13:02 +08:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_SUBST(__ID_U)
|
|
|
|
|
|
|
|
AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
|
2007-10-08 23:12:10 +08:00
|
|
|
AC_PATH_PROG(__LZMA, lzma, /usr/bin/lzma, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
|
|
|
|
AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
|
|
|
|
AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
|
|
|
|
AC_PATH_PROG(__PATCH, patch, /usr/bin/patch, $MYPATH)
|
|
|
|
AC_MSG_CHECKING(old version of patch)
|
1997-10-23 23:10:03 +08:00
|
|
|
PATCHVERSION=`patch --version 2>&1`
|
1997-10-22 08:20:06 +08:00
|
|
|
|
1997-10-23 23:10:03 +08:00
|
|
|
if test "$PATCHVERSION" = "Patch version 2.1"; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_OLDPATCH_21, 1,
|
|
|
|
[Define if the patch call you'll be using is 2.1 or older])
|
1997-10-22 08:20:06 +08:00
|
|
|
AC_MSG_RESULT(patch older then 2.2 found)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(patch later then 2.2 found)
|
|
|
|
fi
|
1999-04-16 13:44:36 +08:00
|
|
|
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__PERL, perl, /usr/bin/perl, $MYPATH)
|
2007-09-18 20:55:58 +08:00
|
|
|
AC_PATH_PROG(__PGP, pgp, /usr/bin/pgp, $MYPATH)
|
2007-09-10 18:49:51 +08:00
|
|
|
AC_PATH_PROG(__PYTHON, python, /usr/bin/python, $MYPATH)
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
|
|
|
|
AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
|
|
|
|
AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
|
|
|
|
AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH)
|
|
|
|
AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH)
|
|
|
|
|
|
|
|
AC_PATH_PROG(__LD, ld, /usr/bin/ld, $MYPATH)
|
|
|
|
AC_PATH_PROG(__NM, nm, /usr/bin/nm, $MYPATH)
|
|
|
|
AC_PATH_PROG(__OBJCOPY, objcopy, /usr/bin/objcopy, $MYPATH)
|
|
|
|
AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
|
|
|
|
AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
|
1996-12-12 11:32:40 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-06-06 18:37:18 +08:00
|
|
|
# Check for zlib library.
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2001-11-23 23:49:11 +08:00
|
|
|
WITH_ZLIB_INCLUDE=
|
|
|
|
WITH_ZLIB_LIB=
|
|
|
|
|
2007-09-20 20:45:40 +08:00
|
|
|
AC_CHECK_HEADERS([zlib.h],[
|
|
|
|
AS_IF([test -z "${WITH_ZLIB_LIB}"],[
|
|
|
|
for zlib in z gz ; do
|
|
|
|
AC_CHECK_LIB(${zlib}, gzread,
|
|
|
|
[WITH_ZLIB_LIB="-l${zlib}"; break])
|
|
|
|
done
|
2005-02-17 10:36:37 +08:00
|
|
|
|
|
|
|
dnl zlib-1.0.4 has not gzseek
|
2007-09-20 20:45:40 +08:00
|
|
|
AC_CHECK_LIB(${zlib}, gzseek, [AC_DEFINE(HAVE_GZSEEK, 1, [Define as 1 if your zlib has gzseek()])])
|
|
|
|
])
|
|
|
|
])
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2007-06-06 18:37:18 +08:00
|
|
|
AC_SUBST(WITH_ZLIB_INCLUDE)
|
|
|
|
AC_SUBST(WITH_ZLIB_LIB)
|
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-08-15 15:02:34 +08:00
|
|
|
# Check for bzip2 library.
|
2005-02-17 10:36:37 +08:00
|
|
|
|
2007-09-20 12:53:19 +08:00
|
|
|
AC_CHECK_HEADERS([bzlib.h],[
|
|
|
|
AC_CHECK_LIB(bz2, bzread, [WITH_BZ2_LIB=-lbz2],
|
|
|
|
[
|
|
|
|
AC_CHECK_LIB(bz2, BZ2_bzread,[
|
|
|
|
WITH_BZ2_LIB="-lbz2"
|
|
|
|
AC_DEFINE(HAVE_BZ2_1_0, 1, [Define as 1 if you bzip2 1.0])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AC_SUBST(WITH_BZ2_LIB)
|
2005-02-17 10:36:37 +08:00
|
|
|
|
|
|
|
#=================
|
|
|
|
|
1999-07-09 06:10:33 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for features
|
|
|
|
dnl
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl Checks for libraries.
|
1996-09-26 03:10:44 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_CHECK_FUNC(setreuid, [], [
|
|
|
|
AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(rand, [], [
|
|
|
|
AC_CHECK_LIB(rand, rand, [])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(getdomainname, [], [
|
|
|
|
AC_CHECK_LIB(nsl, getdomainname)
|
|
|
|
])
|
|
|
|
AC_CHECK_FUNC(socket, [], [
|
|
|
|
AC_CHECK_LIB(socket, socket)
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(error.h)
|
|
|
|
AC_CHECK_FUNCS(error)
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(poll.h)
|
|
|
|
|
2007-10-01 18:58:32 +08:00
|
|
|
AC_CHECK_HEADERS(pthread.h)
|
2005-02-17 10:36:37 +08:00
|
|
|
|
|
|
|
AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [
|
|
|
|
dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
|
|
|
|
AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [
|
|
|
|
AC_CHECK_LIB(thread, mutex_lock)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(aio_read, [c rt aio posix4])
|
|
|
|
|
|
|
|
AC_CHECK_FUNCS(vsnprintf snprintf)
|
|
|
|
|
|
|
|
dnl Temporary hack for MiNT. Some functions (writev, snprintf) are
|
|
|
|
dnl not in the libc but in libport (for political reasons). This check
|
|
|
|
dnl can hopefully be removed soon. Please use the default action
|
|
|
|
dnl for this macro (not LIBS=...), otherwise the check for dbopen
|
|
|
|
dnl will fail.
|
|
|
|
AC_CHECK_LIB(port, writev)
|
|
|
|
|
2005-01-10 01:48:19 +08:00
|
|
|
#=================
|
2007-08-10 19:48:51 +08:00
|
|
|
# Check for libelf library. Prefer external, otherwise none.
|
2002-06-20 10:19:21 +08:00
|
|
|
WITH_LIBELF_INCLUDE=
|
|
|
|
WITH_LIBELF_LIB=
|
2002-12-01 05:07:08 +08:00
|
|
|
AC_CHECK_HEADER([libelf.h])
|
2007-08-10 21:22:25 +08:00
|
|
|
AC_CHECK_HEADERS([gelf.h], [
|
2002-11-30 05:35:53 +08:00
|
|
|
AC_CHECK_LIB(elf, gelf_getvernaux, [
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
|
2002-12-02 02:03:22 +08:00
|
|
|
WITH_LIBELF_LIB="-lelf"
|
2007-08-10 21:22:25 +08:00
|
|
|
WITH_LIBELF=yes
|
2002-11-30 05:35:53 +08:00
|
|
|
])
|
|
|
|
])
|
2002-06-20 10:19:21 +08:00
|
|
|
AC_SUBST(WITH_LIBELF_INCLUDE)
|
|
|
|
AC_SUBST(WITH_LIBELF_LIB)
|
2007-08-10 21:22:25 +08:00
|
|
|
AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
|
2002-06-20 10:19:21 +08:00
|
|
|
|
2007-08-10 20:01:36 +08:00
|
|
|
AC_CHECK_HEADERS([dwarf.h], [
|
|
|
|
WITH_LIBDWARF=yes
|
2002-11-30 05:35:53 +08:00
|
|
|
])
|
2007-08-10 20:01:36 +08:00
|
|
|
AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])
|
2002-10-19 02:45:47 +08:00
|
|
|
|
2005-01-10 01:48:19 +08:00
|
|
|
#=================
|
2007-11-02 16:02:40 +08:00
|
|
|
# Check for NSS library.
|
|
|
|
WITH_NSS_INCLUDE=
|
|
|
|
WITH_NSS_LIB=
|
|
|
|
check=`pkg-config --version 2>/dev/null`
|
|
|
|
if test -n "$check"; then
|
|
|
|
addlib=$(pkg-config --libs nss | sed 's/-lsmime3//;s/-lssl3//')
|
|
|
|
addcppflags=$(pkg-config --cflags nss)
|
|
|
|
else
|
|
|
|
# Without pkg-config, we'll kludge in some defaults
|
|
|
|
addlib="-lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
|
|
|
|
addcppflags="-I/usr/include/nss3 -I/usr/include/nspr4"
|
|
|
|
fi
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$save_CPPFLAGS $addcppflags"
|
|
|
|
AC_CHECK_HEADER([nss3/nss.h], [
|
|
|
|
AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
|
|
|
|
AC_DEFINE(HAVE_LIBNSS, 1, [Define to 1 if you have the 'NSS' library (-lnss3).])
|
|
|
|
WITH_NSS_INCLUDE="$addcppflags"
|
|
|
|
WITH_NSS_LIB="$addlib"
|
2005-02-17 10:36:37 +08:00
|
|
|
])
|
|
|
|
],[
|
2007-11-02 16:02:40 +08:00
|
|
|
AC_MSG_ERROR([missing required header nss3/nss.h])
|
2003-05-31 00:58:13 +08:00
|
|
|
])
|
2007-11-02 16:02:40 +08:00
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
AC_SUBST(WITH_NSS_INCLUDE)
|
|
|
|
AC_SUBST(WITH_NSS_LIB)
|
2003-05-23 05:21:43 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-07-24 14:59:33 +08:00
|
|
|
# Check for magic library.
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_MAGIC_INCLUDE=
|
|
|
|
WITH_MAGIC_LIB=
|
|
|
|
|
2007-07-24 14:59:33 +08:00
|
|
|
AC_CHECK_HEADER([magic.h], [
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_CHECK_LIB(magic, magic_open, [
|
|
|
|
WITH_MAGIC_INCLUDE=
|
|
|
|
WITH_MAGIC_LIB="-lmagic"
|
2007-08-10 23:07:17 +08:00
|
|
|
],[
|
2007-09-18 18:41:47 +08:00
|
|
|
AC_MSG_ERROR([missing required library 'libmagic'])
|
2005-02-17 10:36:37 +08:00
|
|
|
])
|
2007-08-10 23:07:17 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required header magic.h])
|
2007-07-24 14:59:33 +08:00
|
|
|
])
|
2004-05-29 23:56:01 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_SUBST(WITH_MAGIC_INCLUDE)
|
|
|
|
AC_SUBST(WITH_MAGIC_LIB)
|
2002-04-15 05:48:44 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-08-10 15:43:52 +08:00
|
|
|
# Check for popt library.
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_POPT_INCLUDE=
|
|
|
|
WITH_POPT_LIB=
|
|
|
|
|
2007-08-10 15:43:52 +08:00
|
|
|
AC_CHECK_HEADER([popt.h], [
|
|
|
|
AC_CHECK_LIB(popt, poptGetContext, [
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_POPT_INCLUDE=
|
|
|
|
WITH_POPT_LIB="-lpopt"
|
2007-08-10 15:43:52 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required library popt])
|
2002-04-15 05:48:44 +08:00
|
|
|
])
|
2007-08-10 15:43:52 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required header popt.h])
|
|
|
|
])
|
2002-04-15 05:48:44 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_SUBST(WITH_POPT_INCLUDE)
|
|
|
|
AC_SUBST(WITH_POPT_LIB)
|
1999-06-18 05:35:34 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
2007-09-19 11:32:03 +08:00
|
|
|
# Process --with/without-external-db
|
2007-09-19 21:02:40 +08:00
|
|
|
AC_ARG_WITH(external_db, [ --with-external-db build against an external Berkeley db],
|
2007-09-19 11:32:03 +08:00
|
|
|
[case "$with_external_db" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --with-external-db]) ;;
|
|
|
|
esac],
|
|
|
|
[with_external_db=no])
|
1999-06-18 05:35:34 +08:00
|
|
|
|
2007-09-19 11:32:03 +08:00
|
|
|
case "$with_external_db" in
|
|
|
|
yes )
|
2007-10-17 19:55:41 +08:00
|
|
|
AC_CHECK_HEADERS([db.h],[
|
2007-09-19 21:02:40 +08:00
|
|
|
AC_CHECK_TYPE([db_threadid_t],[],
|
2007-09-19 01:18:09 +08:00
|
|
|
[AC_MSG_WARN([missing type db_threadid_t])],
|
|
|
|
[#include <db.h>])
|
2007-09-18 11:01:45 +08:00
|
|
|
save_LIBS="$LIBS"
|
|
|
|
AC_CHECK_LIB([db],[db_create],[],[
|
|
|
|
AC_MSG_ERROR([missing db_create in libdb])
|
|
|
|
])
|
|
|
|
AC_CHECK_LIB([db],[db_env_create],[],[
|
|
|
|
AC_MSG_ERROR([missing db_env_create in libdb])
|
|
|
|
])
|
|
|
|
AC_CHECK_LIB([db],[db_env_set_func_fsync],[],[
|
|
|
|
AC_MSG_ERROR([missing db_env_set_func_fsync in libdb])
|
|
|
|
])
|
|
|
|
AC_CHECK_LIB([db],[db_strerror],[],[
|
|
|
|
AC_MSG_ERROR([missing db_strerror in libdb])
|
|
|
|
])
|
|
|
|
WITH_DB_LIB=-ldb
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required header db.h])
|
|
|
|
])
|
|
|
|
;;
|
|
|
|
* ) # Fall back to internal db
|
2007-10-17 19:55:41 +08:00
|
|
|
# XXX for now we always have in-tree BDB available...
|
|
|
|
AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
|
2007-09-18 11:01:45 +08:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_SUBST([WITH_DB_LIB])
|
2005-02-17 10:36:37 +08:00
|
|
|
|
|
|
|
#=================
|
2007-08-15 00:29:54 +08:00
|
|
|
# Check for sqlite3 library.
|
2007-09-04 15:09:39 +08:00
|
|
|
AC_ARG_ENABLE(sqlite3, [ --enable-sqlite3 enable sqlite3 support],
|
2007-08-15 00:29:54 +08:00
|
|
|
[case "$enable_sqlite3" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --enable-sqlite3])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[enable_sqlite3=no])
|
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_SQLITE3_INCLUDE=
|
|
|
|
WITH_SQLITE3_LIB=
|
2007-08-14 22:18:10 +08:00
|
|
|
WITH_SQLITE3=no
|
2007-08-15 00:29:54 +08:00
|
|
|
AS_IF([test "$enable_sqlite3" = yes],[
|
|
|
|
AC_CHECK_HEADERS([sqlite3.h],
|
|
|
|
[ AC_CHECK_LIB(sqlite3, sqlite3_open, [
|
|
|
|
WITH_SQLITE3_INCLUDE=
|
|
|
|
WITH_SQLITE3_LIB="-lsqlite3"
|
|
|
|
WITH_SQLITE3=yes
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing libsqlite3])
|
|
|
|
])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing sqlite3.h])
|
2005-02-17 10:36:37 +08:00
|
|
|
])
|
2005-02-14 09:34:12 +08:00
|
|
|
])
|
2001-05-08 03:21:16 +08:00
|
|
|
|
2005-02-03 02:47:42 +08:00
|
|
|
AC_SUBST(WITH_SQLITE3_INCLUDE)
|
|
|
|
AC_SUBST(WITH_SQLITE3_LIB)
|
2007-08-14 22:18:10 +08:00
|
|
|
AM_CONDITIONAL([SQLITE3],[test "$WITH_SQLITE3" = yes])
|
2001-05-08 03:21:16 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl AmigaOS and IXEmul have a fork() dummy
|
2007-08-06 20:46:11 +08:00
|
|
|
case "$host" in
|
2002-05-02 06:13:00 +08:00
|
|
|
m68k-*-amigaos )
|
|
|
|
echo "Building for AmigaOS: using vfork() instead of fork()";
|
|
|
|
CFLAGS="$CFLAGS -Dfork=vfork"
|
|
|
|
;;
|
|
|
|
esac
|
1996-12-12 11:32:40 +08:00
|
|
|
|
2007-07-24 19:21:32 +08:00
|
|
|
AM_GNU_GETTEXT_VERSION([0.16.1])
|
2007-03-14 23:46:17 +08:00
|
|
|
AM_GNU_GETTEXT([external])
|
1998-10-08 22:59:17 +08:00
|
|
|
|
1996-09-29 10:27:07 +08:00
|
|
|
dnl Checks for header files we can live without.
|
1997-01-25 03:04:51 +08:00
|
|
|
AC_HEADER_STDC
|
1997-05-06 04:46:58 +08:00
|
|
|
AC_HEADER_MAJOR
|
1998-10-06 23:26:55 +08:00
|
|
|
AC_HEADER_DIRENT
|
1998-10-08 22:59:17 +08:00
|
|
|
AC_HEADER_TIME
|
1998-10-06 02:31:48 +08:00
|
|
|
|
2007-11-13 19:03:38 +08:00
|
|
|
AC_CHECK_HEADERS(locale.h)
|
|
|
|
|
1999-01-01 06:09:43 +08:00
|
|
|
AC_CHECK_HEADERS(fcntl.h getopt.h grp.h memory.h netdb.h pwd.h utime.h)
|
1997-01-17 03:44:24 +08:00
|
|
|
|
2001-05-10 06:58:56 +08:00
|
|
|
AC_CHECK_HEADERS(sys/ipc.h sys/socket.h sys/select.h)
|
1998-10-08 22:59:17 +08:00
|
|
|
AC_CHECK_HEADERS(sys/types.h sys/stdtypes.h)
|
|
|
|
AC_CHECK_HEADERS(sys/mman.h sys/resource.h sys/utsname.h sys/wait.h)
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(netinet/in_systm.h)
|
|
|
|
AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
|
2000-03-16 22:27:04 +08:00
|
|
|
AC_CHECK_HEADERS(sys/mount.h sys/mntctl.h sys/param.h sys/vmount.h)
|
2007-09-20 20:45:40 +08:00
|
|
|
AC_CHECK_HEADERS(libio.h)
|
1999-09-21 11:22:53 +08:00
|
|
|
AC_CHECK_HEADERS(err.h mcheck.h)
|
1996-09-26 03:10:44 +08:00
|
|
|
|
1999-04-17 07:05:00 +08:00
|
|
|
AC_CHECK_HEADERS(glob.h)
|
2007-08-28 16:58:48 +08:00
|
|
|
AC_CHECK_HEADERS(locale.h)
|
1999-04-17 07:05:00 +08:00
|
|
|
|
1999-04-09 04:09:48 +08:00
|
|
|
dnl statfs portability fiddles.
|
1999-04-14 19:28:31 +08:00
|
|
|
dnl
|
|
|
|
dnl We should really emulate/steal sections of the statfs and struct statfs
|
|
|
|
dnl checks from GNU fileutils.
|
|
|
|
dnl
|
1999-03-23 02:36:23 +08:00
|
|
|
AC_MSG_CHECKING(for struct statfs)
|
2005-02-17 10:36:37 +08:00
|
|
|
|
1999-04-09 04:09:48 +08:00
|
|
|
dnl
|
|
|
|
dnl this is easier than nesting AC_TRY_COMPILEs...
|
|
|
|
dnl
|
|
|
|
found_struct_statfs=no
|
|
|
|
|
1999-04-17 07:05:00 +08:00
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl Solaris 2.6+ wants to use statvfs
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-17 07:05:00 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/statvfs.h> ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
|
|
|
|
[statfs in <sys/statvfs.h> (for solaris 2.6+ systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-17 07:05:00 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
1999-04-09 04:09:48 +08:00
|
|
|
dnl first try including sys/vfs.h
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-09 04:09:48 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/vfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in <sys/vfs.h> (for linux systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-17 07:05:00 +08:00
|
|
|
fi
|
1999-04-09 04:09:48 +08:00
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl ...next try including sys/mount.h
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-09 04:09:48 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2000-03-16 22:27:04 +08:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/mount.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/mount.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_MOUNT, 1, [statfs in <sys/mount.h> (for Digital Unix 4.0D systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-09 04:09:48 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl ...still no joy. Try sys/statfs.h
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-09 04:09:48 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#include <sys/statfs.h> ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/statfs.h)
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(STATFS_IN_SYS_STATFS, 1, [statfs in <sys/statfs.h> (for Irix 6.4 systems)])
|
2004-01-05 22:09:47 +08:00
|
|
|
found_struct_statfs=yes],[])
|
1999-04-09 04:09:48 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xno ; then
|
|
|
|
dnl ...no luck. Warn the user of impending doom.
|
|
|
|
AC_MSG_WARN(not found)
|
|
|
|
fi
|
|
|
|
|
1999-04-14 19:28:31 +08:00
|
|
|
dnl
|
|
|
|
dnl if we found the struct, see if it has the f_bavail member. Some OSes
|
|
|
|
dnl don't, including IRIX 6.5+
|
|
|
|
dnl
|
|
|
|
if test X$found_struct_statfs = Xyes ; then
|
|
|
|
AC_MSG_CHECKING(for f_bavail member in struct statfs)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
1999-04-14 19:28:31 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
1999-04-17 07:05:00 +08:00
|
|
|
#if STATFS_IN_SYS_STATVFS
|
|
|
|
# include <sys/statvfs.h>
|
|
|
|
typedef struct statvfs STATFS_t;
|
|
|
|
#else
|
|
|
|
typedef struct statfs STATFS_t;
|
|
|
|
# if STATFS_IN_SYS_VFS
|
|
|
|
# include <sys/vfs.h>
|
|
|
|
# elif STATFS_IN_SYS_MOUNT
|
2007-09-18 16:49:20 +08:00
|
|
|
# include <sys/mount.h>
|
1999-04-17 07:05:00 +08:00
|
|
|
# elif STATFS_IN_SYS_STATFS
|
|
|
|
# include <sys/statfs.h>
|
|
|
|
# endif
|
2004-01-05 22:09:47 +08:00
|
|
|
#endif ]], [[STATFS_t sfs;
|
|
|
|
sfs.f_bavail = 0;]])],[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(STATFS_HAS_F_BAVAIL, 1, [Define if struct statfs has the f_bavail member])],[AC_MSG_RESULT(no)
|
|
|
|
])
|
1999-04-14 19:28:31 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test X$found_struct_statfs = Xyes ; then
|
|
|
|
dnl
|
|
|
|
dnl now check to see if we have the 4-argument variant of statfs()
|
2004-01-05 22:09:47 +08:00
|
|
|
dnl this pretty much requires AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[])
|
1999-04-14 19:28:31 +08:00
|
|
|
dnl
|
|
|
|
AC_MSG_CHECKING([if statfs() requires 4 arguments])
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
1999-04-14 19:28:31 +08:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
#ifdef STATFS_IN_SYS_VFS
|
|
|
|
#include <sys/vfs.h>
|
|
|
|
#elif STATFS_IN_SYS_MOUNT
|
|
|
|
#include <sys/mouht.h>
|
|
|
|
#elif STATFS_IN_SYS_STATFS
|
|
|
|
#include <sys/statfs.h>
|
|
|
|
#endif
|
|
|
|
main() {
|
|
|
|
struct statfs sfs;
|
|
|
|
exit (statfs(".", &sfs, sizeof(sfs), 0));
|
|
|
|
}
|
2004-01-05 22:09:47 +08:00
|
|
|
]])],[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(STAT_STATFS4, 1, [Define if the statfs() call takes 4 arguments])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)
|
|
|
|
])
|
1999-04-14 19:28:31 +08:00
|
|
|
fi
|
1999-03-23 02:36:23 +08:00
|
|
|
|
1998-03-28 01:41:19 +08:00
|
|
|
AC_C_INLINE
|
1996-08-20 01:15:47 +08:00
|
|
|
|
1997-01-21 06:34:47 +08:00
|
|
|
dnl look for libc features
|
1997-01-24 04:29:16 +08:00
|
|
|
PROVIDES_ERRNO=no
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(if <netdb.h> defines h_errno)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[printf("%d",h_errno)]])],[PROVIDES_ERRNO=yes],[])
|
1997-01-24 04:29:16 +08:00
|
|
|
AC_MSG_RESULT($PROVIDES_ERRNO)
|
|
|
|
if test $PROVIDES_ERRNO = yes; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_HERRNO, 1, [ Define as 1 if <netdb.h> defines h_errno])
|
1997-01-21 06:34:47 +08:00
|
|
|
fi
|
|
|
|
|
1997-04-30 23:32:40 +08:00
|
|
|
dnl If a system doesn't have S_IFSOCK, define it as 0 which will
|
|
|
|
dnl make S_ISSOCK always return false (nice, eh?)
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(if <sys/stat.h> defines S_IFSOCK)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_IFSOCK)]])],[HAS_S_IFSOCK=yes],[HAS_S_IFSOCK=no])
|
1997-04-30 23:32:40 +08:00
|
|
|
AC_MSG_RESULT($HAS_S_IFSOCK)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test $HAS_S_IFSOCK = yes; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_S_IFSOCK, 1, [Define as 1 if <sys/stat.h> defines S_IFSOCK])
|
1997-04-30 23:32:40 +08:00
|
|
|
fi
|
|
|
|
|
1997-03-20 23:18:07 +08:00
|
|
|
dnl Some Unix's are missing S_ISLNK, S_ISSOCK
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(if <sys/stat.h> defines S_ISLNK)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_ISLNK(0755))]])],[HAS_S_ISLNK=yes],[HAS_S_ISLNK=no])
|
1997-03-20 23:18:07 +08:00
|
|
|
AC_MSG_RESULT($HAS_S_ISLNK)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test $HAS_S_ISLNK = yes; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_S_ISLNK, 1, [Define as 1 if <sys/stat.h> defines S_ISLNK])
|
1997-03-20 23:18:07 +08:00
|
|
|
fi
|
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(if <sys/stat.h> defines S_ISSOCK)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_ISSOCK(0755))]])],[HAS_S_ISSOCK=yes],[HAS_S_ISSOCK=no])
|
1997-03-20 23:18:07 +08:00
|
|
|
AC_MSG_RESULT($HAS_S_ISSOCK)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test $HAS_S_ISSOCK = yes; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_S_ISSOCK, 1, [Define as 1 if <sys/stat.h> defines S_ISSOCK])
|
1997-03-20 23:18:07 +08:00
|
|
|
fi
|
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(if timezone is defined)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[printf("%ld", timezone)]])],[HAS_TIMEZONE=yes],[HAS_TIMEZONE=no])
|
1998-04-09 10:41:13 +08:00
|
|
|
AC_MSG_RESULT($HAS_TIMEZONE)
|
1997-05-15 22:02:36 +08:00
|
|
|
|
1998-10-07 01:56:44 +08:00
|
|
|
dnl Check for missing typedefs
|
2003-11-24 03:50:52 +08:00
|
|
|
AC_TYPE_MODE_T
|
2003-04-17 06:13:18 +08:00
|
|
|
AC_TYPE_OFF_T
|
1998-10-07 01:56:44 +08:00
|
|
|
AC_TYPE_PID_T
|
2003-04-17 06:13:18 +08:00
|
|
|
AC_TYPE_SIZE_T
|
1998-10-07 01:56:44 +08:00
|
|
|
|
1996-08-20 01:15:47 +08:00
|
|
|
dnl Checks for library functions.
|
1998-10-08 18:40:27 +08:00
|
|
|
AC_FUNC_ALLOCA
|
1998-10-09 02:49:59 +08:00
|
|
|
AC_FUNC_VPRINTF
|
2007-06-20 15:58:10 +08:00
|
|
|
dnl XXX don't want to re-enable code that's been unused for years at this
|
|
|
|
dnl point, but should offer good performance improvements, check after
|
|
|
|
dnl 4.4.2.1...
|
|
|
|
dnl AC_FUNC_MMAP
|
1998-10-08 18:40:27 +08:00
|
|
|
|
Replace AC_CHECK_FUNCS by AC_REPLACE_FUNCS for basename, getcwd, getwd, putenv, realpath, setenv, stpcpy, stpncpy, strcspn, strdup, strtol, strtoul, strspn, strstr.
2007-10-30 22:51:53 +08:00
|
|
|
AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_aton)
|
|
|
|
AC_CHECK_FUNCS(mtrace)
|
|
|
|
AC_CHECK_FUNCS(strndup strerror)
|
|
|
|
|
|
|
|
AC_REPLACE_FUNCS(basename getcwd getwd)
|
|
|
|
AC_REPLACE_FUNCS(putenv realpath setenv)
|
|
|
|
AC_REPLACE_FUNCS(stpcpy stpncpy strcspn)
|
|
|
|
AC_REPLACE_FUNCS(strdup strtol strtoul strspn strstr)
|
1999-09-12 08:41:51 +08:00
|
|
|
|
2003-05-01 04:04:58 +08:00
|
|
|
AC_CHECK_FUNCS(__secure_getenv)
|
|
|
|
|
2000-03-10 04:48:15 +08:00
|
|
|
AC_CHECK_FUNCS(regcomp)
|
1998-10-08 18:40:27 +08:00
|
|
|
|
2001-05-10 06:58:56 +08:00
|
|
|
AC_CHECK_FUNCS(ftok)
|
|
|
|
|
2003-12-27 01:36:38 +08:00
|
|
|
AC_CHECK_FUNCS(mkstemp)
|
|
|
|
|
2000-03-12 04:14:07 +08:00
|
|
|
dnl XXX Glob *is* broken on linux with libc5, solaris and possibly aix when
|
|
|
|
dnl %files gets something like
|
|
|
|
dnl /usr/*/locale/*/LC_MESSAGES/*.mo
|
|
|
|
dnl (Note: more than one asterisk in glob pattern.)
|
1999-09-27 06:50:47 +08:00
|
|
|
dnl
|
2004-10-10 04:22:01 +08:00
|
|
|
dnl XXX Glob is "fixed" in glibc-2.3.3-61, but the cost is that
|
|
|
|
dnl dangling symlinks are no longer globbed. Always use the internal glob.
|
2007-06-20 15:20:15 +08:00
|
|
|
AC_DEFINE(USE_GNU_GLOB, 1, [Use the included glob.c?])
|
|
|
|
AC_LIBOBJ(glob)
|
|
|
|
AC_LIBOBJ(fnmatch)
|
|
|
|
|
2007-09-10 18:49:51 +08:00
|
|
|
dnl check if python is requested
|
2007-09-12 17:31:17 +08:00
|
|
|
AC_ARG_ENABLE(python, [ --enable-python build rpm python bindings ],
|
2007-09-10 18:49:51 +08:00
|
|
|
[case "$enable_python" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --enable-python])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[enable_python=no])
|
|
|
|
|
|
|
|
AS_IF([test "$enable_python" = yes],[
|
2007-09-12 07:21:13 +08:00
|
|
|
# rpm-python is based on python-2.5,
|
2007-09-12 14:23:51 +08:00
|
|
|
# with legacy hacks to allow building against python >= 2.3
|
|
|
|
AM_PATH_PYTHON([2.3],[
|
2007-09-10 18:49:51 +08:00
|
|
|
WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; print get_python_inc()'`
|
|
|
|
WITH_PYTHON_SUBPACKAGE=1
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
|
|
|
|
AC_CHECK_HEADER([Python.h],[],
|
|
|
|
[AC_MSG_ERROR([missing Python.h])
|
|
|
|
])
|
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
|
|
|
|
WITH_PYTHON_LIB="$ac_res"
|
|
|
|
],[AC_MSG_ERROR([missing python library])
|
|
|
|
])
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
])
|
|
|
|
],[
|
|
|
|
WITH_PYTHON_INCLUDE=
|
|
|
|
WITH_PYTHON_LIB=
|
|
|
|
WITH_PYTHON_SUBPACKAGE=0
|
|
|
|
])
|
2004-11-09 14:59:34 +08:00
|
|
|
|
2007-07-24 16:55:37 +08:00
|
|
|
AC_SUBST(WITH_PYTHON_INCLUDE)
|
|
|
|
AC_SUBST(WITH_PYTHON_LIB)
|
2000-12-04 08:55:17 +08:00
|
|
|
|
2007-09-10 18:49:51 +08:00
|
|
|
AM_CONDITIONAL(PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = 1])
|
2007-08-06 17:04:05 +08:00
|
|
|
|
2007-10-18 14:34:37 +08:00
|
|
|
AC_PATH_PROG(DOXYGEN, doxygen, no)
|
2000-12-04 08:55:17 +08:00
|
|
|
dnl
|
|
|
|
dnl Auto-detect whether doxygen generated API docs should be included.
|
|
|
|
dnl
|
2007-08-13 12:42:49 +08:00
|
|
|
AC_ARG_WITH(apidocs, [ --with-apidocs build rpm API docs ],,[with_apidocs=auto])
|
|
|
|
|
|
|
|
case "$with_apidocs" in
|
|
|
|
auto)
|
2007-10-18 14:34:37 +08:00
|
|
|
AS_IF([test "$DOXYGEN" = no],[with_apidocs=no],[with_apidocs=yes])
|
2007-08-13 12:42:49 +08:00
|
|
|
;;
|
|
|
|
yes)
|
2007-10-18 14:34:37 +08:00
|
|
|
AS_IF([test "$DOXYGEN" = no],
|
2007-08-15 13:36:31 +08:00
|
|
|
[AC_MSG_ERROR([rpm API docs needs doxygen in PATH])])
|
2007-08-13 12:42:49 +08:00
|
|
|
;;
|
|
|
|
esac
|
2007-10-05 16:37:55 +08:00
|
|
|
AC_CHECK_PROG(HAVE_DOT,[dot],[YES],[NO])
|
2000-12-13 04:03:45 +08:00
|
|
|
|
2004-01-05 22:09:47 +08:00
|
|
|
WITH_SELINUX_LIB=
|
2007-09-04 20:19:18 +08:00
|
|
|
AC_ARG_WITH(selinux, [ --with-selinux build with selinux support ],
|
|
|
|
[case "$with_selinux" in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid argument to --with-selinux])
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
[with_selinux=no])
|
2007-08-13 15:35:48 +08:00
|
|
|
|
2007-09-04 20:19:18 +08:00
|
|
|
AS_IF([test "$with_selinux" = yes],[
|
2007-08-13 15:35:48 +08:00
|
|
|
AC_CHECK_HEADER([selinux/selinux.h],[
|
|
|
|
AC_CHECK_LIB(selinux,[is_selinux_enabled],[with_selinux=yes],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but libselinux not found])])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found])
|
|
|
|
])
|
2007-09-04 20:19:18 +08:00
|
|
|
])
|
2007-08-13 15:35:48 +08:00
|
|
|
|
|
|
|
AS_IF([test "$with_selinux" = yes],[
|
2004-01-06 01:15:18 +08:00
|
|
|
AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
|
2004-01-05 22:09:47 +08:00
|
|
|
WITH_SELINUX_LIB="-lselinux"
|
2007-08-13 15:35:48 +08:00
|
|
|
])
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_SUBST(WITH_SELINUX_LIB)
|
2007-08-15 19:40:10 +08:00
|
|
|
AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
|
2004-01-05 22:09:47 +08:00
|
|
|
|
2004-07-06 03:21:18 +08:00
|
|
|
WITH_LUA_LIB=
|
|
|
|
WITH_LUA_INCLUDE=
|
2007-08-13 13:30:28 +08:00
|
|
|
AC_ARG_WITH(lua, [ --with-lua build with lua support ],,[with_lua=yes])
|
|
|
|
AS_IF([test "$with_lua" = yes],[
|
2004-07-06 03:21:18 +08:00
|
|
|
AC_DEFINE(WITH_LUA, 1, [Build with lua support?])
|
2007-08-12 14:07:11 +08:00
|
|
|
WITH_LUA_INCLUDE="-I\${top_srcdir}/lua/include -I\${top_srcdir}/lua/local"
|
|
|
|
WITH_LUA_LIB="\$(top_builddir)/lua/liblua.la"
|
2007-08-13 13:30:28 +08:00
|
|
|
])
|
2004-07-06 03:21:18 +08:00
|
|
|
AC_SUBST(WITH_LUA_LIB)
|
|
|
|
AC_SUBST(WITH_LUA_INCLUDE)
|
|
|
|
|
2007-08-24 12:05:45 +08:00
|
|
|
with_dmalloc=no
|
2000-12-13 04:03:45 +08:00
|
|
|
AC_ARG_WITH(dmalloc, [ --with-dmalloc build with dmalloc debugging support ])
|
2007-08-24 12:05:45 +08:00
|
|
|
if test "$with_dmalloc" = yes ; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(DMALLOC, 1, [Build with dmalloc support?])
|
2000-12-13 04:03:45 +08:00
|
|
|
LIBS="$LIBS -ldmalloc"
|
|
|
|
fi
|
|
|
|
|
1998-10-08 22:59:17 +08:00
|
|
|
AC_CHECK_FUNCS(setlocale)
|
|
|
|
|
1999-09-08 06:46:19 +08:00
|
|
|
AC_CHECK_FUNCS(getpassphrase)
|
|
|
|
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT, 1, [Define if you have the getmntent() function]), [
|
|
|
|
AC_CHECK_FUNC(mntctl, AC_DEFINE(HAVE_MNTCTL, 1, [Define as 1 if you have mntctl() (only aix?)]),[
|
2005-02-04 07:05:59 +08:00
|
|
|
AC_CHECK_FUNC(getmntinfo, AC_DEFINE(HAVE_GETMNTINFO, 1, [Define as 1 if you have getmntinfo() (Mac OS X)]), [
|
|
|
|
AC_CHECK_FUNC(getmntinfo_r, AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)]), [
|
|
|
|
AC_CHECK_LIB(c_r, getmntinfo_r, [LIBS="$LIBS -lc_r";
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)])], [
|
2001-02-28 05:30:27 +08:00
|
|
|
AC_DEFINE([USE_GETMNTENT], 1, [Defined if getmntent replacement is used])
|
2005-02-04 07:05:59 +08:00
|
|
|
AC_LIBOBJ(getmntent)])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
1997-05-20 23:28:25 +08:00
|
|
|
|
2000-03-10 02:13:02 +08:00
|
|
|
AC_CHECK_FUNC(lchown,
|
|
|
|
[__CHOWN_RHF="%{__chown} -Rhf"
|
|
|
|
__CHGRP_RHF="%{__chgrp} -Rhf"
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_LCHOWN, 1, [Define as 1 if you have lchown()])],
|
2000-03-10 02:13:02 +08:00
|
|
|
[__CHOWN_RHF="%{__chown} -Rf"
|
|
|
|
__CHGRP_RHF="%{__chgrp} -Rf"
|
1997-05-20 23:28:25 +08:00
|
|
|
dnl Does chown() follow symlinks? This should be a good enough test.
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(whether chown() follows symlinks)
|
1997-05-20 23:28:25 +08:00
|
|
|
AC_ARG_ENABLE([broken-chown],
|
1999-01-23 02:42:31 +08:00
|
|
|
[ --enable-broken-chown this system's chown follows symbolic links],
|
1998-04-09 10:41:13 +08:00
|
|
|
result=$enableval, result=unknown)
|
2007-11-22 16:43:40 +08:00
|
|
|
if echo "$build" | ${EGREP} "(aix)|(hpux)|(linux)" > /dev/null ; then
|
1997-05-22 03:39:54 +08:00
|
|
|
result=yes
|
2007-11-22 16:43:40 +08:00
|
|
|
elif echo "$build" | ${EGREP} "(nextstep)" > /dev/null ; then
|
1997-08-27 02:22:16 +08:00
|
|
|
result=no
|
1997-05-22 03:39:54 +08:00
|
|
|
fi
|
|
|
|
if test $result = unknown; then
|
2000-03-10 02:13:02 +08:00
|
|
|
if test `${__ID} | cut -f2 -d\= | cut -f1 -d\(` = 0; then
|
1997-05-20 23:28:25 +08:00
|
|
|
rm -f foo bar
|
|
|
|
touch foo
|
|
|
|
ln -s foo bar
|
2000-03-10 02:13:02 +08:00
|
|
|
${__CHOWN} 10 bar
|
1997-05-20 23:28:25 +08:00
|
|
|
if test `ls -l foo | awk '{print $3}'` != "root"; then
|
|
|
|
result=yes
|
|
|
|
else
|
|
|
|
result=no
|
|
|
|
fi
|
2000-03-10 02:13:02 +08:00
|
|
|
${__RM} -f foo bar
|
1997-05-20 23:28:25 +08:00
|
|
|
else
|
|
|
|
AC_MSG_CHECKING((cannot check by non-root user))
|
|
|
|
result=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_RESULT($result)
|
|
|
|
if test $result = yes; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(CHOWN_FOLLOWS_SYMLINK, 1, [Define as 1 if chown() follows symlinks and you don't have lchown()])
|
2000-03-10 02:13:02 +08:00
|
|
|
fi])
|
|
|
|
AC_SUBST(__CHOWN_RHF)
|
|
|
|
AC_SUBST(__CHGRP_RHF)
|
1998-03-05 00:53:54 +08:00
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl figure out what root's primary group is
|
|
|
|
dnl
|
|
|
|
AC_MSG_CHECKING(root's primary group)
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
|
1998-03-05 00:53:54 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
#include <grp.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
struct passwd *root = NULL;
|
|
|
|
struct group *roots_group = NULL;
|
|
|
|
FILE * tempfile = NULL;
|
|
|
|
|
|
|
|
root = getpwuid( (uid_t) 0 );
|
|
|
|
if (root != NULL) {
|
|
|
|
roots_group = getgrgid(root->pw_gid);
|
|
|
|
if (roots_group != NULL) {
|
|
|
|
tempfile = fopen("conftest_rootg", "w");
|
|
|
|
if (tempfile != NULL) {
|
|
|
|
fprintf(tempfile, "%s\n", roots_group->gr_name);
|
|
|
|
fclose(tempfile);
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
exit(1);
|
2004-01-05 22:09:47 +08:00
|
|
|
}]])],[ROOT_GROUP=`cat conftest_rootg`],[ROOT_GROUP="root"],[ROOT_GROUP="root"
|
|
|
|
])
|
1998-03-05 00:53:54 +08:00
|
|
|
AC_MSG_RESULT($ROOT_GROUP)
|
|
|
|
AC_SUBST(ROOT_GROUP)
|
|
|
|
|
1998-04-09 10:41:13 +08:00
|
|
|
if echo "$build_os" | grep sco > /dev/null; then
|
1997-05-15 02:42:47 +08:00
|
|
|
echo "hacking things up for sco"
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include <strings.h> (along with <string.h>)])
|
|
|
|
AC_DEFINE(HAVE_STRUCT_MNTTAB, 1,
|
|
|
|
[Define as 1 if you have "struct mnttab" (only sco?)])
|
1997-05-15 02:42:47 +08:00
|
|
|
elif echo "$build_os" | grep sunos > /dev/null; then
|
|
|
|
echo "hacking things up for sunos"
|
|
|
|
CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__"
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include <strings.h> (along with <string.h>)])
|
|
|
|
AC_DEFINE(NEED_MYREALLOC, 1, [Define as 1 if we need myrealloc])
|
|
|
|
AC_LIBOBJ(myrealloc)
|
1996-09-29 10:27:07 +08:00
|
|
|
fi
|
|
|
|
|
1998-04-04 00:33:19 +08:00
|
|
|
#
|
|
|
|
# get rid of the 4-th tuple, if config.guess returned "linux-gnu" for build_os
|
|
|
|
#
|
2007-08-06 19:47:10 +08:00
|
|
|
build_os_gnu=-gnu
|
1999-04-21 03:17:23 +08:00
|
|
|
if echo "$build_os" | grep '.*-gnulibc1' > /dev/null ; then
|
|
|
|
build_os=`echo "${build_os}" | sed 's/-gnulibc1$//'`
|
|
|
|
fi
|
2007-06-21 20:13:04 +08:00
|
|
|
if echo "$build_os" | grep '.*-gnueabi' > /dev/null ; then
|
|
|
|
build_os=`echo "${build_os}" | sed 's/-gnueabi$//'`
|
2007-08-06 19:47:10 +08:00
|
|
|
build_os_gnu=-gnueabi
|
2007-06-21 20:13:04 +08:00
|
|
|
fi
|
1998-04-04 00:33:19 +08:00
|
|
|
if echo "$build_os" | grep '.*-gnu' > /dev/null ; then
|
|
|
|
build_os=`echo "${build_os}" | sed 's/-gnu$//'`
|
|
|
|
fi
|
|
|
|
|
1998-04-09 10:41:13 +08:00
|
|
|
changequote(<, >)
|
1998-04-04 00:33:19 +08:00
|
|
|
build_os_exact="${build_os}"
|
|
|
|
build_os_major=`echo "${build_os}" | sed 's/\..*$//'`
|
|
|
|
build_os_noversion=`echo "${build_os}" | sed 's/[0-9]*\..*$//'`
|
1998-04-09 10:41:13 +08:00
|
|
|
changequote([, ])
|
1998-04-04 00:33:19 +08:00
|
|
|
|
1999-01-27 02:08:14 +08:00
|
|
|
rm -f ./find-provides
|
2007-11-21 18:34:30 +08:00
|
|
|
if test -f ${srcdir}/autodeps/${host_cpu}-${build_os_exact}.prov ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${host_cpu}-${build_os_exact}.prov for automatic provides generation"
|
|
|
|
ln -s ${srcdir}/autodeps/${host_cpu}-${build_os_exact}.prov ./find-provides
|
1998-12-18 00:45:22 +08:00
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_exact}.prov ; then
|
1998-04-04 00:33:19 +08:00
|
|
|
echo "using ${srcdir}/autodeps/${build_os_exact}.prov for automatic provides generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_exact}.prov ./find-provides
|
1998-04-04 00:33:19 +08:00
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_major}.prov ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_major}.prov for automatic provides generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_major}.prov ./find-provides
|
1998-04-04 00:33:19 +08:00
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_noversion}.prov ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_noversion}.prov for automatic provides generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_noversion}.prov ./find-provides
|
1996-11-16 05:04:09 +08:00
|
|
|
else
|
1998-04-04 00:33:19 +08:00
|
|
|
echo "*** no default provides information is available for ${build_os_noversion}"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/none ./find-provides
|
1996-11-22 06:00:02 +08:00
|
|
|
fi
|
|
|
|
|
1999-01-27 02:08:14 +08:00
|
|
|
rm -f ./find-requires
|
2007-11-21 18:34:30 +08:00
|
|
|
if test -f ${srcdir}/autodeps/${host_cpu}-${build_os_exact}.req ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${host_cpu}-${build_os_exact}.req for automatic requires generation"
|
|
|
|
ln -s ${srcdir}/autodeps/${host_cpu}-${build_os_exact}.req ./find-requires
|
1998-12-18 00:45:22 +08:00
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_exact}.req ; then
|
1998-04-04 00:33:19 +08:00
|
|
|
echo "using ${srcdir}/autodeps/${build_os_exact}.req for automatic requires generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_exact}.req ./find-requires
|
1998-04-04 00:33:19 +08:00
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_major}.req ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_major}.req for automatic requires generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_major}.req ./find-requires
|
1998-04-04 00:33:19 +08:00
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_noversion}.req ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_noversion}.req for automatic requires generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_noversion}.req ./find-requires
|
1996-11-22 06:00:02 +08:00
|
|
|
else
|
1998-04-04 00:33:19 +08:00
|
|
|
echo "*** no default requires information is available for ${build_os_noversion}"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/none ./find-requires
|
1996-11-16 05:04:09 +08:00
|
|
|
fi
|
|
|
|
|
1999-03-14 06:37:47 +08:00
|
|
|
dnl Determine the canonical arch-vendor-os for the build machine
|
2003-07-03 03:26:04 +08:00
|
|
|
autorelocate_path='%{nil}'
|
2004-07-06 03:21:18 +08:00
|
|
|
autorelocate_dcolor='0'
|
2007-11-21 18:34:30 +08:00
|
|
|
case "${host_cpu}" in
|
2003-01-02 04:33:21 +08:00
|
|
|
*86) RPMCANONCOLOR=0; RPMCANONARCH=i386 ;;
|
2004-03-11 07:01:46 +08:00
|
|
|
ia32e*) RPMCANONCOLOR=3; RPMCANONARCH=ia32e ;;
|
|
|
|
amd64*) RPMCANONCOLOR=3; RPMCANONARCH=amd64 ;;
|
2003-01-02 04:33:21 +08:00
|
|
|
x86_64*) RPMCANONCOLOR=3; RPMCANONARCH=x86_64 ;;
|
|
|
|
alpha*) RPMCANONCOLOR=0; RPMCANONARCH=alpha ;;
|
2004-05-27 05:10:07 +08:00
|
|
|
sparc64*) RPMCANONCOLOR=3; RPMCANONARCH=sparc64 ;;
|
|
|
|
sparc*) RPMCANONCOLOR=3; RPMCANONARCH=sparc ;;
|
2003-07-03 03:26:04 +08:00
|
|
|
ia64*) RPMCANONCOLOR=2; RPMCANONARCH=ia64;
|
2004-07-06 03:21:18 +08:00
|
|
|
autorelocate_path='/emul/%%{ARCH}-%%{OS}'
|
|
|
|
autorelocate_dcolor='1' ;;
|
2003-02-15 07:03:35 +08:00
|
|
|
s390x*) RPMCANONCOLOR=3; RPMCANONARCH=s390x ;;
|
2003-01-02 04:33:21 +08:00
|
|
|
s390*) RPMCANONCOLOR=0; RPMCANONARCH=s390 ;;
|
2003-02-15 07:03:35 +08:00
|
|
|
powerpc64*|ppc64*) RPMCANONCOLOR=3; RPMCANONARCH=ppc64 ;;
|
2003-01-02 04:33:21 +08:00
|
|
|
powerpc*|ppc*) RPMCANONCOLOR=0; RPMCANONARCH=ppc ;;
|
2007-06-21 20:13:04 +08:00
|
|
|
arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm ;;
|
2003-01-02 04:33:21 +08:00
|
|
|
mipsel*) RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
|
|
|
|
mips*) RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
|
|
|
|
m68k*) RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
|
|
|
|
*) RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
|
1999-03-14 06:37:47 +08:00
|
|
|
esac
|
1999-06-18 05:35:34 +08:00
|
|
|
case "${build_os_noversion}" in
|
|
|
|
mint) RPMCANONARCH=m68kmint ;;
|
|
|
|
esac
|
1999-03-14 06:37:47 +08:00
|
|
|
RPMCANONVENDOR="$build_vendor"
|
|
|
|
case "${build_vendor}" in
|
2004-05-29 21:47:39 +08:00
|
|
|
unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos)
|
2001-01-11 04:42:32 +08:00
|
|
|
test -f /etc/redhat-release && RPMCANONVENDOR=redhat
|
|
|
|
test -f /etc/pld-release && RPMCANONVENDOR=pld
|
|
|
|
test -f /etc/mandrake-release && RPMCANONVENDOR=mandrake
|
|
|
|
test -f /etc/conectiva-release && RPMCANONVENDOR=conectiva
|
2002-02-25 01:14:33 +08:00
|
|
|
test -f /etc/lvr-release && RPMCANONVENDOR=lvr
|
2002-07-25 08:13:25 +08:00
|
|
|
test -f /etc/yellowdog-release && RPMCANONVENDOR=yellowdog
|
2004-05-29 21:47:39 +08:00
|
|
|
test -f /etc/caos-release && RPMCANONVENDOR=caos
|
2000-02-14 03:24:19 +08:00
|
|
|
;;
|
1999-03-14 06:37:47 +08:00
|
|
|
esac
|
|
|
|
RPMCANONOS="$build_os_noversion"
|
2007-08-06 19:47:10 +08:00
|
|
|
RPMCANONGNU="$build_os_gnu"
|
2003-01-02 04:33:21 +08:00
|
|
|
AC_SUBST(RPMCANONCOLOR)
|
2003-07-03 03:26:04 +08:00
|
|
|
AC_SUBST(autorelocate_path)
|
2004-07-06 03:21:18 +08:00
|
|
|
AC_SUBST(autorelocate_dcolor)
|
1999-03-14 06:37:47 +08:00
|
|
|
AC_SUBST(RPMCANONARCH)
|
|
|
|
AC_SUBST(RPMCANONVENDOR)
|
|
|
|
AC_SUBST(RPMCANONOS)
|
2007-08-06 19:47:10 +08:00
|
|
|
AC_SUBST(RPMCANONGNU)
|
2007-09-04 21:19:29 +08:00
|
|
|
AC_DEFINE_UNQUOTED([RPMCANONVENDOR],["${RPMCANONVENDOR}"],[canonical vendor])
|
1999-03-14 06:37:47 +08:00
|
|
|
|
1999-08-26 04:00:26 +08:00
|
|
|
if test X"$prefix" = XNONE ; then
|
|
|
|
usrprefix="$ac_default_prefix"
|
|
|
|
else
|
|
|
|
usrprefix=$prefix
|
|
|
|
fi
|
2007-07-25 22:10:57 +08:00
|
|
|
|
1999-08-26 04:00:26 +08:00
|
|
|
RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
|
1998-10-16 00:34:51 +08:00
|
|
|
AC_SUBST(RPMCONFIGDIR)
|
2000-08-28 03:43:51 +08:00
|
|
|
|
2000-12-04 08:55:17 +08:00
|
|
|
AC_SUBST(OBJDUMP)
|
|
|
|
|
2007-07-24 14:59:33 +08:00
|
|
|
AC_CONFIG_SUBDIRS(db3)
|
2001-05-08 03:21:16 +08:00
|
|
|
|
2007-09-19 11:32:03 +08:00
|
|
|
AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no])
|
2007-10-18 22:04:00 +08:00
|
|
|
AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
|
|
|
|
AM_CONDITIONAL([APIDOCS],[test "$with_apidocs" == yes])
|
2007-09-17 17:33:18 +08:00
|
|
|
|
2007-08-20 18:31:28 +08:00
|
|
|
AC_PATH_PROG(AUTOM4TE,autom4te,:)
|
|
|
|
|
2007-10-25 00:38:18 +08:00
|
|
|
AS_IF([test "$ac_cv_header_stdint_h" = "yes"],[
|
|
|
|
AC_DEFINE([__RPM_USES_STDINT_H__],[1],[if rpm uses stdint.h])
|
|
|
|
])
|
|
|
|
|
2007-10-27 11:48:53 +08:00
|
|
|
AC_CONFIG_HEADERS([rpmdb/rpmints.h])
|
2007-10-25 00:38:18 +08:00
|
|
|
|
2007-10-18 22:04:00 +08:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2001-05-08 08:03:14 +08:00
|
|
|
rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
|
2007-08-31 15:25:11 +08:00
|
|
|
po/Makefile.in scripts/Makefile
|
2007-07-24 19:21:32 +08:00
|
|
|
misc/Makefile
|
2002-06-21 01:17:23 +08:00
|
|
|
doc/Makefile
|
|
|
|
python/Makefile
|
2004-03-17 05:58:25 +08:00
|
|
|
lua/Makefile
|
2007-08-21 22:29:51 +08:00
|
|
|
tests/Makefile
|
2004-01-05 22:09:47 +08:00
|
|
|
])
|
|
|
|
AC_OUTPUT
|