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])
|
|
|
|
AM_CONFIG_HEADER([config.h])
|
|
|
|
|
2007-08-21 22:29:51 +08:00
|
|
|
AM_INIT_AUTOMAKE([1.10 foreign tar-ustar dist-bzip2])
|
2004-01-05 22:09:47 +08:00
|
|
|
|
2007-08-20 18:31:28 +08:00
|
|
|
AC_CONFIG_TESTDIR(tests)
|
|
|
|
|
2007-06-06 19:42:19 +08:00
|
|
|
AC_AIX
|
|
|
|
AC_MINIX
|
|
|
|
|
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
|
2004-01-22 22:28:08 +08:00
|
|
|
CFLAGS="$CFLAGS -fPIC -DPIC -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts"
|
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"
|
|
|
|
AC_TRY_COMPILE(, [return 0;], [
|
|
|
|
echo " $flag"
|
|
|
|
RPMCFLAGS="$RPMCFLAGS $flag"
|
|
|
|
])
|
|
|
|
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
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
AC_PROG_GCC_TRADITIONAL
|
2002-11-20 02:40:21 +08:00
|
|
|
AC_SYS_LARGEFILE
|
2001-05-10 06:58:56 +08:00
|
|
|
|
2001-08-15 22:03:03 +08:00
|
|
|
dnl Does this platform require array notation to assign to a va_list?
|
|
|
|
dnl If cross-compiling, we assume va_list is "normal". If this breaks
|
|
|
|
dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY
|
|
|
|
dnl also just to be sure.
|
|
|
|
AC_MSG_CHECKING(whether va_list assignments need array notation)
|
|
|
|
AC_CACHE_VAL(ac_cv_valistisarray,
|
2004-01-05 22:09:47 +08:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
|
2001-08-15 22:03:03 +08:00
|
|
|
#include <stdarg.h>
|
|
|
|
void foo(int i, ...) {
|
|
|
|
va_list ap1, ap2;
|
|
|
|
va_start(ap1, i);
|
|
|
|
ap2 = ap1;
|
|
|
|
if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123)
|
|
|
|
{ exit(1); }
|
|
|
|
va_end(ap1); va_end(ap2);
|
|
|
|
}
|
2004-01-05 22:09:47 +08:00
|
|
|
int main() { foo(0, 123); return(0); }]])],[ac_cv_valistisarray=false],[ac_cv_valistisarray=true],[ac_cv_valistisarray=false])])
|
2001-08-15 22:03:03 +08:00
|
|
|
|
|
|
|
if test "$ac_cv_valistisarray" = true ; then
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY, 1,
|
|
|
|
[Define as 1 if your va_list type is an array])
|
2001-08-15 22:03:03 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
2002-12-20 07:41:52 +08:00
|
|
|
dnl
|
2002-12-20 23:03:18 +08:00
|
|
|
dnl XXX Test for libpthread.a that is NPTL aware (static link only).
|
2002-12-20 07:41:52 +08:00
|
|
|
dnl
|
|
|
|
LDFLAGS_NPTL=
|
2003-01-14 04:58:21 +08:00
|
|
|
if test -f /usr/lib/nptl/libpthread.a ; then
|
|
|
|
LDFLAGS_NPTL="-L/usr/lib/nptl"
|
2002-12-20 23:03:18 +08:00
|
|
|
# INCPATH="$INCPATH -I/usr/include/nptl"
|
2003-01-14 04:58:21 +08:00
|
|
|
fi
|
2002-12-20 07:41:52 +08:00
|
|
|
AC_SUBST(LDFLAGS_NPTL)
|
|
|
|
|
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
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
AC_ISC_POSIX
|
|
|
|
|
1998-10-08 18:40:27 +08:00
|
|
|
dnl This test must precede tests of compiler characteristics like
|
|
|
|
dnl that for the inline keyword, since it may change the degree to
|
|
|
|
dnl which the compiler supports such features.
|
|
|
|
AM_C_PROTOTYPES
|
|
|
|
|
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
|
2002-05-17 00:55:21 +08:00
|
|
|
AC_PATH_PROG(BZIP2BIN, bzip2, /usr/bin/bzip2, $MYPATH)
|
|
|
|
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)
|
|
|
|
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)
|
|
|
|
AC_PATH_PROG(GZIPBIN, gzip, /bin/gzip, $MYPATH)
|
|
|
|
AC_PATH_PROG(UNZIPBIN, unzip, /usr/bin/unzip, $MYPATH)
|
|
|
|
|
|
|
|
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)
|
|
|
|
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)
|
|
|
|
AC_PATH_PROG(PGPBIN, pgp, /usr/bin/pgp, $MYPATH)
|
|
|
|
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
|
|
|
|
1998-04-09 10:41:13 +08:00
|
|
|
addlib() {
|
|
|
|
l=$1
|
|
|
|
shift
|
2007-08-06 20:46:11 +08:00
|
|
|
case "$host" in
|
1998-09-13 04:46:24 +08:00
|
|
|
*-*-solaris*) LIBS="$LIBS -L$l -R$l $*";;
|
1998-04-09 10:45:39 +08:00
|
|
|
*) LIBS="$LIBS -L$l $*";;
|
1998-04-09 10:41:13 +08:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
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=
|
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
if test -z "${WITH_ZLIB_LIB}" ; then
|
|
|
|
for zlib in z gz ; do
|
|
|
|
AC_CHECK_LIB(${zlib}, gzread,
|
2007-06-06 18:37:18 +08:00
|
|
|
[WITH_ZLIB_LIB="-l${zlib}"; break],
|
2005-02-17 10:36:37 +08:00
|
|
|
[if test ${zlib} = gz; then
|
|
|
|
AC_MSG_ERROR([sorry rpm requires libz.a or libgz.a (from the zlib package)])
|
|
|
|
fi]
|
|
|
|
)
|
|
|
|
done
|
|
|
|
|
|
|
|
dnl zlib-1.0.4 has not gzseek
|
|
|
|
AC_CHECK_LIB(${zlib}, gzseek, [AC_DEFINE(HAVE_GZSEEK, 1, [Define as 1 if your zlib has gzseek()])])
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
|
|
|
AC_CHECK_LIB(bz2, bzread, [LIBS="$LIBS -lbz2"],
|
|
|
|
AC_CHECK_LIB(bz2, BZ2_bzread, [
|
|
|
|
WITH_BZIP2=1
|
|
|
|
LIBS="$LIBS -lbz2"
|
|
|
|
AC_DEFINE(HAVE_BZ2_1_0, 1, [Define as 1 if you bzip2 1.0]) ],
|
|
|
|
WITH_BZIP2=0))
|
|
|
|
AC_SUBST(WITH_BZIP2)
|
|
|
|
|
2007-08-15 15:03:35 +08:00
|
|
|
#=================
|
|
|
|
# Check for libxml2.
|
|
|
|
|
2007-08-15 15:11:25 +08:00
|
|
|
PKG_CHECK_MODULES(libxml2,libxml-2.0,
|
2007-08-15 15:03:35 +08:00
|
|
|
[WITH_LIBXML2=yes],
|
|
|
|
[WITH_LIBXML2=no])
|
|
|
|
AM_CONDITIONAL(LIBXML2,[test "$WITH_LIBXML2" = yes])
|
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
#=================
|
|
|
|
|
2001-08-01 02:13:22 +08:00
|
|
|
dirs=$prefix
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(for /usr/ucblib in LIBS)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test -d /usr/ucblib ; then
|
1997-11-05 22:39:20 +08:00
|
|
|
if test "$build" = "mips-sni-sysv4" ; then
|
1998-04-09 10:41:13 +08:00
|
|
|
addlib /usr/ccs/lib -lc
|
1997-11-05 22:39:20 +08:00
|
|
|
fi
|
|
|
|
|
1998-04-09 10:41:13 +08:00
|
|
|
addlib /usr/ucblib
|
1997-05-01 02:03:27 +08:00
|
|
|
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h)
|
|
|
|
|
|
|
|
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_CHECK_HEADERS(aio.h)
|
|
|
|
AC_SEARCH_LIBS(aio_read, [c rt aio posix4])
|
|
|
|
|
|
|
|
dnl Better not use fchmod at all.
|
|
|
|
AC_CHECK_FUNC(fchmod)
|
|
|
|
|
|
|
|
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-08-10 16:02:25 +08:00
|
|
|
# Check for beecrypt library.
|
2003-05-23 05:21:43 +08:00
|
|
|
WITH_BEECRYPT_INCLUDE=
|
|
|
|
WITH_BEECRYPT_LIB=
|
2007-08-10 20:40:02 +08:00
|
|
|
AC_CHECK_HEADERS([beecrypt/beecrypt.h], [
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_CHECK_LIB(beecrypt, mpfprintln, [
|
2007-08-10 20:40:02 +08:00
|
|
|
AC_CHECK_HEADERS([beecrypt/api.h])
|
2007-07-24 15:07:23 +08:00
|
|
|
WITH_BEECRYPT_INCLUDE=
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_BEECRYPT_LIB="-lbeecrypt"
|
2007-08-10 16:02:25 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required library beecrypt])
|
2005-02-17 10:36:37 +08:00
|
|
|
])
|
|
|
|
],[
|
2007-08-10 16:02:25 +08:00
|
|
|
AC_MSG_ERROR([missing required header beecrypt/beecrypt.h])
|
2003-05-31 00:58:13 +08:00
|
|
|
])
|
2003-05-23 05:21:43 +08:00
|
|
|
AC_SUBST(WITH_BEECRYPT_INCLUDE)
|
|
|
|
AC_SUBST(WITH_BEECRYPT_LIB)
|
|
|
|
|
2005-01-10 01:48:19 +08:00
|
|
|
#=================
|
2007-08-10 21:48:19 +08:00
|
|
|
# Check for neon library. Prefer external, otherwise none.
|
2005-01-10 01:48:19 +08:00
|
|
|
WITH_NEON_INCLUDE=
|
|
|
|
WITH_NEON_LIB=
|
|
|
|
AC_CHECK_HEADER([neon/ne_session.h], [
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_CHECK_LIB(neon, ne_session_create, [
|
|
|
|
AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the 'neon' library (-lneon).])
|
|
|
|
AC_CHECK_LIB(neon, ne_get_response_header, [
|
|
|
|
AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
|
|
|
|
])
|
|
|
|
AC_CHECK_LIB(neon, ne_send_request_chunk, [
|
|
|
|
AC_DEFINE(HAVE_NEON_NE_SEND_REQUEST_CHUNK, 1, [Define to 1 if you have ne_send_request_chunk() in libneon.])
|
|
|
|
])
|
2007-07-24 15:13:28 +08:00
|
|
|
WITH_NEON_INCLUDE=
|
2005-02-17 10:36:37 +08:00
|
|
|
WITH_NEON_LIB="-lneon"
|
|
|
|
])
|
2005-01-10 01:48:19 +08:00
|
|
|
])
|
|
|
|
AC_SUBST(WITH_NEON_INCLUDE)
|
|
|
|
AC_SUBST(WITH_NEON_LIB)
|
|
|
|
|
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
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([missing required libary '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
|
|
|
WITH_POPT=yes
|
|
|
|
],[
|
|
|
|
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
|
|
|
#=================
|
1999-06-18 05:35:34 +08:00
|
|
|
|
2001-05-08 03:21:16 +08:00
|
|
|
dnl ------------------ with internal db
|
2003-12-12 03:09:58 +08:00
|
|
|
AC_DEFINE(HAVE_DB3_DB_H, 1, [Define if you have the <db3/db.h> header file])
|
|
|
|
WITH_DB_SUBDIR=db3
|
2005-02-14 09:34:12 +08:00
|
|
|
|
2005-02-17 10:36:37 +08:00
|
|
|
AC_SUBST(WITH_DB_SUBDIR)
|
|
|
|
|
|
|
|
#=================
|
2007-08-15 00:29:54 +08:00
|
|
|
# Check for sqlite3 library.
|
|
|
|
AC_ARG_ENABLE(sqlite3, [ --enable-sqlite3 build in sqlite3 support],
|
|
|
|
[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
|
|
|
|
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(machine/types.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)
|
1998-11-23 03:48:48 +08:00
|
|
|
AC_CHECK_HEADERS(bzlib.h libio.h zlib.h)
|
1999-09-21 11:22:53 +08:00
|
|
|
AC_CHECK_HEADERS(err.h mcheck.h)
|
2002-02-25 23:29:22 +08:00
|
|
|
AC_CHECK_HEADERS(pthread.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
|
|
|
|
# include <sys/mouht.h>
|
|
|
|
# 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
|
|
|
|
2007-06-25 15:40:14 +08:00
|
|
|
AC_CHECK_FUNCS(basename getaddrinfo getcwd getnameinfo getwd inet_aton)
|
|
|
|
AC_CHECK_FUNCS(mtrace putenv realpath setenv)
|
2001-01-04 04:19:27 +08:00
|
|
|
AC_CHECK_FUNCS(stpcpy stpncpy strcspn)
|
2005-01-05 01:46:10 +08:00
|
|
|
AC_CHECK_FUNCS(strdup strndup strerror 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)
|
|
|
|
|
2000-12-04 08:55:17 +08:00
|
|
|
dnl
|
2002-01-08 04:01:00 +08:00
|
|
|
dnl Auto-detect which python bindings should be built.
|
2000-12-04 08:55:17 +08:00
|
|
|
dnl
|
2000-12-13 04:03:45 +08:00
|
|
|
AC_ARG_WITH(python, [ --with-python build rpm python bindings ])
|
2000-12-04 08:55:17 +08:00
|
|
|
|
2007-08-24 12:04:43 +08:00
|
|
|
if test "{$with_python}" = "no"; then
|
2007-07-24 16:55:37 +08:00
|
|
|
pythonbin=""
|
2007-08-24 12:04:43 +08:00
|
|
|
elif test "${with_python}" = "yes"; then
|
2007-07-24 16:55:37 +08:00
|
|
|
pythonbin="python"
|
|
|
|
else
|
2007-08-24 12:04:43 +08:00
|
|
|
pythonbin="python$with_python"
|
2000-12-04 08:55:17 +08:00
|
|
|
fi
|
2007-07-24 16:55:37 +08:00
|
|
|
AC_PATH_PROG(__PYTHON, "${pythonbin}")
|
2000-12-04 08:55:17 +08:00
|
|
|
|
2007-07-24 16:55:37 +08:00
|
|
|
if test -z "${__PYTHON}"; then
|
|
|
|
WITH_PYTHON_INCLUDE=
|
|
|
|
WITH_PYTHON_LIB=
|
2000-12-04 08:55:17 +08:00
|
|
|
WITH_PYTHON_SUBPACKAGE=0
|
2007-07-24 16:55:37 +08:00
|
|
|
else
|
|
|
|
WITH_PYTHON_INCLUDE=`${__PYTHON} -c 'from distutils.sysconfig import *; print get_python_inc()'`
|
|
|
|
WITH_PYTHON_LIB=`${__PYTHON} -c 'from distutils.sysconfig import *; print get_python_lib(1)'`
|
|
|
|
WITH_PYTHON_SUBPACKAGE=1
|
2007-08-06 17:04:05 +08:00
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
|
|
|
|
AC_CHECK_HEADER([Python.h],
|
|
|
|
[WITH_PYTHON_SUBPACKAGE=1],
|
|
|
|
[WITH_PYTHON_SUBPACKAGE=0])
|
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
2000-12-04 08:55:17 +08:00
|
|
|
fi
|
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-08-06 17:04:05 +08:00
|
|
|
AM_CONDITIONAL(PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = "1"])
|
|
|
|
|
2000-12-04 08:55:17 +08:00
|
|
|
AC_PATH_PROG(__DOXYGEN, doxygen, no, $PATH)
|
|
|
|
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)
|
|
|
|
AS_IF([test "$__DOXYGEN" = no],[with_apidocs=no],[with_apidocs=yes])
|
|
|
|
;;
|
|
|
|
yes)
|
|
|
|
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
|
2000-12-13 04:03:45 +08:00
|
|
|
|
2004-01-05 22:09:47 +08:00
|
|
|
WITH_SELINUX_LIB=
|
2007-08-13 15:35:48 +08:00
|
|
|
AC_ARG_WITH(selinux, [ --with-selinux build with selinux support ],,[with_selinux=auto])
|
|
|
|
|
|
|
|
case "$with_selinux" in
|
|
|
|
yes)
|
|
|
|
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])
|
|
|
|
])
|
|
|
|
;;
|
|
|
|
auto)
|
|
|
|
AC_CHECK_HEADER([selinux/selinux.h],[
|
2007-08-13 15:48:56 +08:00
|
|
|
AC_CHECK_LIB(selinux,[is_selinux_enabled],[with_selinux=yes],
|
|
|
|
[with_selinux=no])
|
2007-08-13 15:35:48 +08:00
|
|
|
],[
|
2007-08-13 15:48:56 +08:00
|
|
|
with_selinux=no
|
2007-08-13 15:35:48 +08:00
|
|
|
])
|
|
|
|
;;
|
|
|
|
*) with_selinux=no
|
|
|
|
;;
|
2007-06-20 15:26:14 +08:00
|
|
|
esac
|
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-13 12:42:49 +08:00
|
|
|
AS_IF([test "$with_apidocs" = yes],[
|
2000-12-04 08:55:17 +08:00
|
|
|
WITH_APIDOCS_TARGET=apidocs
|
|
|
|
WITH_APIDOCS=1
|
2007-08-13 12:42:49 +08:00
|
|
|
],[
|
2000-12-04 08:55:17 +08:00
|
|
|
WITH_APIDOCS=0
|
2007-08-13 12:42:49 +08:00
|
|
|
])
|
2000-12-04 08:55:17 +08:00
|
|
|
AC_SUBST(WITH_APIDOCS_TARGET)
|
|
|
|
AC_SUBST(WITH_APIDOCS)
|
|
|
|
|
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)
|
1997-11-01 03:24:48 +08:00
|
|
|
if echo "$build" | egrep "(aix)|(hpux)|(linux)" > /dev/null ; then
|
1997-05-22 03:39:54 +08:00
|
|
|
result=yes
|
1997-08-27 02:22:16 +08:00
|
|
|
elif echo "$build" | egrep "(nextstep)" > /dev/null ; then
|
|
|
|
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
|
1998-12-18 00:45:22 +08:00
|
|
|
if test -f ${srcdir}/autodeps/${build_cpu}-${build_os_exact}.prov ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_cpu}-${build_os_exact}.prov for automatic provides generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_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
|
1998-12-18 00:45:22 +08:00
|
|
|
if test -f ${srcdir}/autodeps/${build_cpu}-${build_os_exact}.req ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_cpu}-${build_os_exact}.req for automatic requires generation"
|
1999-01-27 02:08:14 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_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'
|
1999-03-14 06:37:47 +08:00
|
|
|
case "${build_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)
|
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`"
|
2002-05-02 06:13:00 +08:00
|
|
|
AC_DEFINE_UNQUOTED(RPMCONFIGDIR, "$RPMCONFIGDIR",
|
|
|
|
[Full path to rpm global configuration directory (usually /usr/lib/rpm)])
|
1998-10-16 00:34:51 +08:00
|
|
|
AC_SUBST(RPMCONFIGDIR)
|
2000-08-28 03:43:51 +08:00
|
|
|
|
2002-06-10 06:15:16 +08:00
|
|
|
VENDORRPMRC_FILENAME="${RPMCONFIGDIR}/${RPMCANONVENDOR}/rpmrc"
|
|
|
|
AC_DEFINE_UNQUOTED(VENDORRPMRC_FILENAME, "$VENDORRPMRC_FILENAME",
|
|
|
|
[Full path to vendor rpmrc configuration file (usually /usr/lib/rpm/vendor/rpmrc)])
|
|
|
|
AC_SUBST(VENDORRPMRC_FILENAME)
|
|
|
|
|
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-08-20 18:31:28 +08:00
|
|
|
AC_PATH_PROG(AUTOM4TE,autom4te,:)
|
|
|
|
|
2007-08-31 11:58:04 +08:00
|
|
|
AC_CONFIG_FILES([ Doxyfile Makefile platform rpm.pc
|
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
|
2002-07-31 23:13:46 +08:00
|
|
|
scripts/macros.perl scripts/macros.php scripts/macros.python
|
|
|
|
tools/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
|
|
|
])
|
2007-08-23 21:56:08 +08:00
|
|
|
AC_CONFIG_FILES([rpmpopt-${VERSION}:rpmpopt.in],,[VERSION=${VERSION}])
|
2004-01-05 22:09:47 +08:00
|
|
|
AC_OUTPUT
|