1996-09-29 10:27:07 +08:00
|
|
|
dnl configure.in for RPM
|
|
|
|
dnl
|
|
|
|
dnl Don't add checks for things we can't work around, unless those checks
|
|
|
|
dnl failing causes the script to bomb out with a message. If we can't fix
|
|
|
|
dnl it, why check it?
|
|
|
|
|
1996-08-20 01:15:47 +08:00
|
|
|
AC_INIT(rpm.c)
|
1997-01-18 00:20:10 +08:00
|
|
|
AC_CONFIG_HEADER(config.h)
|
1996-08-20 01:15:47 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl default to not using NLS
|
|
|
|
XGETTEXT=""
|
|
|
|
LIBINTL=""
|
|
|
|
PO=""
|
|
|
|
GETTEXTSTUB="gettextstub.o"
|
|
|
|
|
1997-11-01 03:24:48 +08:00
|
|
|
MISCOBJS=
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
RPMCONFIGDIR='$(libdir)/rpm'
|
1998-03-05 00:53:54 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
1998-03-05 00:53:54 +08:00
|
|
|
dnl
|
|
|
|
dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
|
|
|
|
dnl requires gcc). If it's not, don't rebuild dependencies -- use what was
|
|
|
|
dnl shipped with RPM.
|
|
|
|
dnl
|
|
|
|
if test X"$GCC" = Xyes ; then
|
|
|
|
TARGET="depend everything"
|
|
|
|
else
|
|
|
|
TARGET="everything"
|
|
|
|
#
|
|
|
|
# let the top level Makefile know that we're done with `depend'
|
|
|
|
#
|
|
|
|
echo > .depend-done
|
|
|
|
fi
|
|
|
|
AC_SUBST(TARGET)
|
|
|
|
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl This is a quick hack, to make it so that we can statically link the
|
|
|
|
dnl rpm binary on as many platforms as possible.
|
|
|
|
dnl
|
|
|
|
dnl a *much* better solution would be to use libtool to determine the proper
|
|
|
|
dnl way to statically link on your platform.
|
|
|
|
dnl
|
|
|
|
AC_MSG_CHECKING(what additional CFLAGS are needed to link statically)
|
|
|
|
if test X"$GCC" = Xyes ; then
|
|
|
|
case "$target" in
|
1998-05-02 03:33:51 +08:00
|
|
|
*-*-hpux*) LDFLAGS_STATIC="-Wl,-a,archive_shared";; #works better
|
|
|
|
*-*-*) LDFLAGS_STATIC="-static";;
|
1998-03-05 00:53:54 +08:00
|
|
|
esac
|
|
|
|
elif test X"$CC" = Xcc ; then
|
|
|
|
case "$target" in
|
1998-05-02 03:33:51 +08:00
|
|
|
*-*-linux*) LDFLAGS_STATIC="-static";;
|
|
|
|
*-*-freebsd*) LDFLAGS_STATIC="-static";;
|
|
|
|
*-*-osf*) LDFLAGS_STATIC="-non_shared";;
|
|
|
|
*-*-aix*) LDFLAGS_STATIC="";; # -Wl,-bnso doesn't seem to work...
|
|
|
|
*-*-hpux*) LDFLAGS_STATIC="-Wl,-a,archive_shared";;
|
|
|
|
*-*-solaris*) LDFLAGS_STATIC="-B static";;
|
|
|
|
*-*-irix*) LDFLAGS_STATIC="";; #should be -non_shared, but can't
|
1998-03-05 00:53:54 +08:00
|
|
|
# link because of crt1.o then.
|
1998-05-02 03:33:51 +08:00
|
|
|
*-*-ultrix*) LDFLAGS_STATIC="";; #ultrix doesn't have shared libs.
|
|
|
|
*-*-*) 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
|
1998-05-02 03:33:51 +08:00
|
|
|
AC_MSG_RESULT($LDFLAGS_STATIC)
|
1998-03-05 00:53:54 +08:00
|
|
|
|
1998-09-10 05:19:59 +08:00
|
|
|
if test -n "$LDFLAGS_STATIC"
|
|
|
|
then
|
|
|
|
AC_CHECKING(if we can link dynamically and still access the services switch)
|
|
|
|
AC_CHECK_LIB(c,gethostbyname,
|
|
|
|
AC_MSG_RESULT(will build static executable)
|
|
|
|
RPM=rpm,
|
|
|
|
AC_MSG_RESULT(will have to link dynamically)
|
|
|
|
RPM=rpm.shared,
|
|
|
|
$LDFLAGS_STATIC)
|
1998-05-02 03:33:51 +08:00
|
|
|
fi
|
1998-03-05 00:53:54 +08:00
|
|
|
|
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)
|
1997-01-17 01:23:44 +08:00
|
|
|
FIXPERMS=a+rX,g-w,o-w
|
|
|
|
else
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(no (tell your OS vendor about GNU fileutils))
|
1997-01-17 01:23:44 +08:00
|
|
|
FIXPERMS=a+r,g-w,o-w
|
|
|
|
fi
|
|
|
|
|
1998-03-05 00:53:54 +08:00
|
|
|
dnl
|
|
|
|
dnl see if we have a mkdir that supports `-p'.
|
|
|
|
dnl
|
|
|
|
AC_PATH_PROGS(MKDIR, mkdir, mkdir)
|
|
|
|
AC_MSG_CHECKING(if $MKDIR supports -p)
|
|
|
|
rm -rf conftest
|
|
|
|
$MKDIR -p conftest/a 2>/dev/null
|
|
|
|
if test $? = 0 ; then
|
|
|
|
rmdir conftest/a 2>/dev/null
|
|
|
|
if test $? = 0 ; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
MKDIR_P=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
rmdir conftest 2>/dev/null
|
|
|
|
if test $? = 0 ; then
|
|
|
|
MKDIR_P="$MKDIR -p"
|
|
|
|
else
|
|
|
|
MKDIR_P=0
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
MKDIR_P=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test X"$MKDIR_P" = X0 ; then
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_PATH_PROGS(MKDIRHIER, mkdirhier, mkdirhier)
|
|
|
|
MKDIR_P="$MKDIRHIER"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
fi
|
|
|
|
dnl
|
|
|
|
dnl substitute this into config.h, so the C source picks it up.
|
|
|
|
dnl
|
|
|
|
AC_DEFINE_UNQUOTED(MKDIR_P, "${MKDIR_P}")
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
AC_AIX
|
|
|
|
AC_MINIX
|
|
|
|
AC_ISC_POSIX
|
|
|
|
|
|
|
|
AC_PROG_AWK
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
|
|
|
AC_CHECK_TOOL(AR, ar, :)
|
|
|
|
|
1997-05-02 03:07:43 +08:00
|
|
|
if test "$cross_compiling" != "yes"; then
|
1998-09-13 04:46:24 +08:00
|
|
|
MYPATH="/bin:/usr/bin:/usr/local/bin:$PATH:/opt/gnu/bin"
|
|
|
|
AC_MSG_CHECKING(for gzip location)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test -z "$GZIPBIN"; then
|
|
|
|
oldifs="$IFS"
|
|
|
|
IFS=:
|
1998-09-13 04:46:24 +08:00
|
|
|
for n in $MYPATH; do
|
1997-05-02 03:07:43 +08:00
|
|
|
if test -f $n/gzip; then
|
|
|
|
GZIPBIN="$n/gzip";
|
1997-07-24 02:14:51 +08:00
|
|
|
break
|
1997-05-02 03:07:43 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS="$oldifs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$GZIPBIN"; then
|
1998-09-13 04:46:24 +08:00
|
|
|
GZIPBIN="/bin/gzip"
|
1997-05-02 03:07:43 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1998-09-13 04:46:24 +08:00
|
|
|
AC_MSG_WARN(Can't find gzip, assuming $GZIPBIN)
|
1996-12-12 11:32:40 +08:00
|
|
|
else
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1996-12-12 11:32:40 +08:00
|
|
|
fi
|
1997-10-22 08:20:06 +08:00
|
|
|
|
1998-09-13 04:46:24 +08:00
|
|
|
AC_MSG_CHECKING(for bzip2 location)
|
1998-05-26 21:19:52 +08:00
|
|
|
if test -z "$BZIP2BIN"; then
|
|
|
|
oldifs="$IFS"
|
|
|
|
IFS=:
|
1998-09-13 04:46:24 +08:00
|
|
|
for n in $MYPATH; do
|
1998-05-26 21:19:52 +08:00
|
|
|
if test -f $n/bzip2; then
|
|
|
|
BZIP2BIN="$n/bzip2";
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS="$oldifs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$BZIP2BIN"; then
|
1998-09-13 04:46:24 +08:00
|
|
|
BZIP2BIN="/usr/bin/bzip2"
|
1998-05-26 21:19:52 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1998-09-13 04:46:24 +08:00
|
|
|
AC_MSG_WARN(Can't find bzip2, assuming $BZIP2BIN)
|
1998-05-26 21:19:52 +08:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
fi
|
|
|
|
|
1997-10-22 08:20:06 +08:00
|
|
|
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
|
1997-10-22 11:22:17 +08:00
|
|
|
AC_DEFINE(HAVE_OLDPATCH_21)
|
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
|
1996-12-12 11:32:40 +08:00
|
|
|
fi
|
|
|
|
|
1996-09-26 03:10:44 +08:00
|
|
|
topdir=`pwd`
|
1998-02-11 16:59:34 +08:00
|
|
|
topsrcdir=`cd ${srcdir}; pwd`
|
1996-09-26 03:10:44 +08:00
|
|
|
|
1998-04-09 10:41:13 +08:00
|
|
|
addlib() {
|
|
|
|
l=$1
|
|
|
|
shift
|
|
|
|
case "$target" 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
|
|
|
|
}
|
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
localdone=
|
|
|
|
for dir in $prefix /usr/local
|
|
|
|
do
|
|
|
|
case $dir in
|
|
|
|
NONE|/usr) continue;;
|
|
|
|
/usr/local)
|
|
|
|
if test X$localdone != X ; then continue; fi
|
|
|
|
localdone="$dir"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for $dir/lib in LIBS)
|
|
|
|
if test -d $dir/lib ; then
|
|
|
|
addlib $dir/lib
|
1997-06-26 22:35:37 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1997-02-12 12:48:06 +08:00
|
|
|
else
|
1997-06-26 22:35:37 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1997-02-12 12:48:06 +08:00
|
|
|
fi
|
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(for $dir/include in INCPATH)
|
|
|
|
if test -d $dir/include ; then
|
|
|
|
INCPATH="$INCPATH -I$dir/include"
|
1997-06-26 22:35:37 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1997-02-12 12:48:06 +08:00
|
|
|
else
|
1997-06-26 22:35:37 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1997-02-12 12:48:06 +08:00
|
|
|
fi
|
1998-07-09 01:30:37 +08:00
|
|
|
done
|
1996-10-15 10:13:16 +08:00
|
|
|
|
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
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl Checks for libraries.
|
1996-09-26 03:10:44 +08:00
|
|
|
|
1997-05-01 02:03:27 +08:00
|
|
|
AC_CHECK_FUNC(strcasecmp, [], [
|
1998-10-06 03:49:30 +08:00
|
|
|
AC_CHECK_LIB(ucb, strcasecmp, [LIBS="$LIBS -lc -lucb" USEUCB=y])
|
1997-05-01 02:03:27 +08:00
|
|
|
])
|
1998-09-25 00:49:51 +08:00
|
|
|
AC_CHECK_FUNC(setreuid, [], [
|
1998-10-06 03:49:30 +08:00
|
|
|
AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
|
1998-09-25 00:49:51 +08:00
|
|
|
])
|
1997-05-01 02:03:27 +08:00
|
|
|
|
1997-11-01 01:31:17 +08:00
|
|
|
AC_CHECK_FUNC(rand, [], [
|
|
|
|
AC_CHECK_LIB(rand, rand, [LIBS="$LIBS -lm"])
|
1997-07-24 02:36:55 +08:00
|
|
|
])
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl
|
|
|
|
dnl handle --disable-nls
|
|
|
|
dnl
|
|
|
|
AC_ARG_ENABLE([nls],
|
|
|
|
[ --disable-nls do not use National Language Support],
|
|
|
|
USE_NLS=$enableval, USE_NLS=yes)
|
1996-08-20 01:15:47 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
if test "$USE_NLS" != "no"; then
|
|
|
|
AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
|
|
|
|
AC_CHECK_LIB(intl, gettext, [LIBINTL="-lintl" HAVEGETTEXT="y"],
|
|
|
|
AC_MSG_WARN([sorry this package needs libintl.a (from the
|
|
|
|
gettext package)])
|
|
|
|
)
|
|
|
|
)
|
1996-09-26 03:10:44 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
|
1996-09-29 10:27:07 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
if test "$XGETTEXT" != ""; then
|
1996-09-29 10:27:07 +08:00
|
|
|
if xgettext --help 2>&1 | grep illegal >/dev/null ; then
|
1996-12-12 11:32:40 +08:00
|
|
|
echo "xgettext isn't GNU version"
|
|
|
|
XGETTEXT=""
|
1996-09-29 10:27:07 +08:00
|
|
|
fi
|
1996-12-12 11:32:40 +08:00
|
|
|
fi
|
1996-09-29 10:27:07 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
|
1996-10-16 04:51:57 +08:00
|
|
|
echo "xgettext and gettext() exist; will build i18n support"
|
1996-09-29 10:27:07 +08:00
|
|
|
PO=po
|
|
|
|
GETTEXTSTUB=""
|
1996-12-12 11:32:40 +08:00
|
|
|
else
|
1996-09-29 10:27:07 +08:00
|
|
|
echo "xgettext and libintl.a don't both exist; will not build i18n support"
|
1996-12-12 11:32:40 +08:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "user specificed no gettext; will not build i18n support"
|
1996-09-29 10:27:07 +08:00
|
|
|
fi
|
1996-09-26 03:10:44 +08:00
|
|
|
|
1997-05-02 03:07:43 +08:00
|
|
|
AC_CHECK_FUNC(getdomainname, [], [
|
1997-08-21 09:07:29 +08:00
|
|
|
AC_CHECK_LIB(nsl, getdomainname, [LIBS="$LIBS -lnsl"])
|
1997-03-12 01:09:34 +08:00
|
|
|
])
|
|
|
|
AC_CHECK_FUNC(socket, [], [
|
1997-08-21 09:07:29 +08:00
|
|
|
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])
|
1997-03-12 01:09:34 +08:00
|
|
|
])
|
1997-03-04 10:22:20 +08:00
|
|
|
|
1996-09-26 03:10:44 +08:00
|
|
|
AC_CHECK_FUNC(dbopen, [],
|
|
|
|
AC_CHECK_LIB(db, dbopen, [], AC_MSG_WARN([sorry this package needs libdb.a
|
1997-03-12 01:09:34 +08:00
|
|
|
(from the db package)]))
|
1996-09-26 03:10:44 +08:00
|
|
|
)
|
|
|
|
|
1996-10-15 10:13:16 +08:00
|
|
|
AC_CHECK_FUNC(fork, [], [echo "using vfork() instead of fork()";
|
1997-03-12 01:09:34 +08:00
|
|
|
MISCOBJS=fakefork.o])
|
1996-10-15 10:13:16 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl AmigaOS and IXEmul have a fork() dummy
|
|
|
|
case "$target" in
|
|
|
|
m68k-*-amigaos )
|
|
|
|
echo "Building for AmigaOS: using vfork() instead of fork()";
|
|
|
|
CFLAGS="$CFLAGS -Dfork=vfork"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
1996-08-20 01:15:47 +08:00
|
|
|
ZLIB=
|
|
|
|
for zlib in z gz ; do
|
|
|
|
AC_CHECK_LIB(${zlib}, gzread,
|
1997-08-21 09:07:29 +08:00
|
|
|
[LIBS="$LIBS -l${zlib}"; break],
|
1996-08-20 01:15:47 +08:00
|
|
|
[if test ${zlib} = gz; then
|
|
|
|
AC_MSG_WARN([sorry this package needs libz.a or libgz.a (from the zlib package)])
|
|
|
|
fi]
|
1997-03-12 01:09:34 +08:00
|
|
|
)
|
1996-08-20 01:15:47 +08:00
|
|
|
done
|
|
|
|
|
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
|
1997-05-07 23:15:42 +08:00
|
|
|
AC_CHECK_HEADERS(netinet/in_systm.h limits.h)
|
1997-05-16 23:32:57 +08:00
|
|
|
AC_CHECK_HEADERS(alloca.h dirent.h sys/socket.h sys/select.h)
|
1997-01-25 03:04:51 +08:00
|
|
|
AC_CHECK_HEADERS(machine/types.h string.h)
|
1998-03-05 00:53:54 +08:00
|
|
|
AC_CHECK_HEADERS(sys/types.h sys/stdtypes.h unistd.h)
|
1997-06-26 00:10:19 +08:00
|
|
|
AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
|
1998-03-05 00:53:54 +08:00
|
|
|
AC_CHECK_HEADERS(sys/mount.h sys/mntctl.h sys/vmount.h)
|
1998-07-31 06:09:42 +08:00
|
|
|
AC_CHECK_HEADERS(fcntl.h grp.h malloc.h memory.h netdb.h pwd.h utime.h)
|
|
|
|
AC_CHECK_HEADERS(sys/mman.h sys/param.h sys/resource.h sys/utsname.h sys/wait.h)
|
1998-10-06 02:31:48 +08:00
|
|
|
|
|
|
|
# solaris2.4 and sinix 5.42 have broken fnmatch. get glob also to be safe.
|
|
|
|
case $target in
|
|
|
|
*-*-solaris2.4|mips-sni-sysv4*)
|
|
|
|
MISCOBJS="$MISCOBJS glob.o fnmatch.o"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_CHECK_HEADERS(glob.h,,MISCOBJS="$MISCOBJS glob.o")
|
|
|
|
AC_CHECK_HEADERS(fnmatch.h,,MISCOBJS="$MISCOBJS fnmatch.o")
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
1998-05-26 21:22:39 +08:00
|
|
|
AC_CHECK_HEADERS(db_185.h)
|
1997-01-17 03:44:24 +08:00
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
if test "$PO" = po; then
|
|
|
|
AC_CHECK_HEADERS(libintl.h)
|
|
|
|
fi
|
1996-09-26 03:10:44 +08:00
|
|
|
|
1998-07-31 06:09:42 +08:00
|
|
|
AC_HEADER_TIME
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_C_BIGENDIAN
|
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)
|
1997-01-24 04:29:16 +08:00
|
|
|
AC_TRY_LINK([#include <netdb.h>],printf("%d",h_errno),PROVIDES_ERRNO=yes)
|
|
|
|
AC_MSG_RESULT($PROVIDES_ERRNO)
|
|
|
|
if test $PROVIDES_ERRNO = yes; then
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_DEFINE(HAVE_HERRNO)
|
|
|
|
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)
|
1997-04-30 23:32:40 +08:00
|
|
|
AC_TRY_LINK([#include <sys/stat.h>],printf("%d", S_IFSOCK),
|
|
|
|
HAS_S_IFSOCK=yes,HAS_S_IFSOCK=no)
|
|
|
|
AC_MSG_RESULT($HAS_S_IFSOCK)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test $HAS_S_IFSOCK = yes; then
|
1997-04-30 23:32:40 +08:00
|
|
|
AC_DEFINE(HAVE_S_IFSOCK)
|
|
|
|
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)
|
1997-03-20 23:18:07 +08:00
|
|
|
AC_TRY_LINK([#include <sys/stat.h>],printf("%d", S_ISLNK(0755)),
|
|
|
|
HAS_S_ISLNK=yes,HAS_S_ISLNK=no)
|
|
|
|
AC_MSG_RESULT($HAS_S_ISLNK)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test $HAS_S_ISLNK = yes; then
|
1997-03-20 23:18:07 +08:00
|
|
|
AC_DEFINE(HAVE_S_ISLNK)
|
|
|
|
fi
|
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(if <sys/stat.h> defines S_ISSOCK)
|
1997-03-20 23:18:07 +08:00
|
|
|
AC_TRY_LINK([#include <sys/stat.h>],printf("%d", S_ISSOCK(0755)),
|
|
|
|
HAS_S_ISSOCK=yes,HAS_S_ISSOCK=no)
|
|
|
|
AC_MSG_RESULT($HAS_S_ISSOCK)
|
1997-05-02 03:07:43 +08:00
|
|
|
if test $HAS_S_ISSOCK = yes; then
|
1997-03-20 23:18:07 +08:00
|
|
|
AC_DEFINE(HAVE_S_ISSOCK)
|
|
|
|
fi
|
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
AC_MSG_CHECKING(if timezone is defined)
|
1997-05-15 22:02:36 +08:00
|
|
|
AC_TRY_LINK([#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
|
|
|
|
1996-08-20 01:15:47 +08:00
|
|
|
dnl Checks for library functions.
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), MISCOBJS="$MISCOBJS inet_aton.o")
|
1997-01-25 03:04:51 +08:00
|
|
|
AC_CHECK_FUNC(realpath, AC_DEFINE(HAVE_REALPATH), MISCOBJS="$MISCOBJS realpath.o")
|
1997-06-20 06:18:02 +08:00
|
|
|
AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT), [
|
1997-06-26 00:10:19 +08:00
|
|
|
AC_CHECK_FUNC(mntctl, AC_DEFINE(HAVE_MNTCTL),[
|
|
|
|
AC_CHECK_FUNC(getmntinfo_r, AC_DEFINE(HAVE_GETMNTINFO_R), [
|
1997-08-21 09:07:29 +08:00
|
|
|
AC_CHECK_LIB(c_r, getmntinfo_r, [LIBS="$LIBS -lc_r";
|
1997-06-26 00:10:19 +08:00
|
|
|
AC_DEFINE(HAVE_GETMNTINFO_R)],
|
|
|
|
MISCOBJS="$MISCOBJS getmntent.o")])])])
|
1997-05-07 23:04:34 +08:00
|
|
|
AC_CHECK_FUNC(strerror, [], MISCOBJS="$MISCOBJS strerror.o")
|
|
|
|
AC_CHECK_FUNC(strtol, [], MISCOBJS="$MISCOBJS strtol.o")
|
|
|
|
AC_CHECK_FUNC(strtoul, [], MISCOBJS="$MISCOBJS strtoul.o")
|
1998-03-05 00:53:54 +08:00
|
|
|
AC_CHECK_FUNC(strdup, [], MISCOBJS="$MISCOBJS strdup.o")
|
1997-05-20 23:28:25 +08:00
|
|
|
LCHOWN=no
|
|
|
|
AC_CHECK_FUNC(lchown, [LCHOWN=yes; AC_DEFINE(HAVE_LCHOWN)])
|
|
|
|
|
|
|
|
if test "$LCHOWN" = no; then
|
|
|
|
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],
|
|
|
|
[ --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
|
1998-03-05 00:53:54 +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
|
|
|
|
chown 10 bar
|
|
|
|
if test `ls -l foo | awk '{print $3}'` != "root"; then
|
|
|
|
result=yes
|
|
|
|
else
|
|
|
|
result=no
|
|
|
|
fi
|
|
|
|
rm -f foo bar
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING((cannot check by non-root user))
|
|
|
|
result=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_RESULT($result)
|
|
|
|
if test $result = yes; then
|
|
|
|
AC_DEFINE(CHOWN_FOLLOWS_SYMLINK)
|
|
|
|
fi
|
|
|
|
fi
|
1996-09-29 10:27:07 +08:00
|
|
|
|
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)
|
|
|
|
AC_TRY_RUN([#include <stdio.h>
|
|
|
|
#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);
|
|
|
|
}], ROOT_GROUP=`cat conftest_rootg`,
|
|
|
|
ROOT_GROUP="root",ROOT_GROUP="root"
|
|
|
|
)
|
|
|
|
AC_DEFINE_UNQUOTED(ROOT_GROUP, "$ROOT_GROUP")
|
|
|
|
AC_MSG_RESULT($ROOT_GROUP)
|
|
|
|
AC_SUBST(ROOT_GROUP)
|
|
|
|
|
|
|
|
|
1996-08-21 00:24:37 +08:00
|
|
|
if test "x$varprefix" = "x"; then
|
|
|
|
varprefix=`echo $prefix | sed 's/usr/var/'`
|
|
|
|
test "x$prefix" = xNONE && varprefix=`echo $ac_default_prefix | sed 's/usr/var/'`
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$tmpdir" = "x"; then
|
|
|
|
if test -d $varprefix/tmp; then
|
|
|
|
tmpdir=$varprefix/tmp
|
|
|
|
else
|
|
|
|
if test -d /var/tmp; then
|
|
|
|
tmpdir=/var/tmp
|
|
|
|
else
|
|
|
|
tmpdir=/tmp
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
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"
|
|
|
|
AC_DEFINE(NEED_STRINGS_H)
|
1997-06-19 21:30:47 +08:00
|
|
|
AC_DEFINE(HAVE_STRUCT_MNTTAB)
|
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__"
|
|
|
|
AC_DEFINE(NEED_STRINGS_H)
|
1997-05-15 22:08:52 +08:00
|
|
|
AC_DEFINE(NEED_MYREALLOC)
|
|
|
|
MISCOBJS="$MISCOBJS myrealloc.o"
|
1997-05-15 02:42:47 +08:00
|
|
|
elif echo "$build_os" | grep hpux > /dev/null; then
|
1998-03-05 00:53:54 +08:00
|
|
|
LIBDL=-ldld
|
1997-05-15 02:42:47 +08:00
|
|
|
echo "hacking things up for hpux"
|
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
|
|
|
|
#
|
|
|
|
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
|
|
|
|
1996-11-16 05:04:09 +08:00
|
|
|
rm -f ./find-provides.sh
|
1998-04-04 00:33:19 +08:00
|
|
|
if test -f ${srcdir}/autodeps/${build_os_exact}.prov ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_exact}.prov for automatic provides generation"
|
|
|
|
ln -s ${srcdir}/autodeps/${build_os_exact}.prov ./find-provides.sh
|
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_major}.prov ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_major}.prov for automatic provides generation"
|
|
|
|
ln -s ${srcdir}/autodeps/${build_os_major}.prov ./find-provides.sh
|
|
|
|
elif test -f ${srcdir}/autodeps/${build_os_noversion}.prov ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_noversion}.prov for automatic provides generation"
|
|
|
|
ln -s ${srcdir}/autodeps/${build_os_noversion}.prov ./find-provides.sh
|
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}"
|
|
|
|
ln -s ${srcdir}/autodeps/none ./find-provides.sh
|
1996-11-22 06:00:02 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f ./find-requires.sh
|
1998-04-04 00:33:19 +08:00
|
|
|
if test -f ${srcdir}/autodeps/${build_os_exact}.req ; then
|
|
|
|
echo "using ${srcdir}/autodeps/${build_os_exact}.req for automatic requires generation"
|
1998-04-09 10:41:13 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_exact}.req ./find-requires.sh
|
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"
|
1998-04-09 10:41:13 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_major}.req ./find-requires.sh
|
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"
|
1998-04-09 10:41:13 +08:00
|
|
|
ln -s ${srcdir}/autodeps/${build_os_noversion}.req ./find-requires.sh
|
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}"
|
|
|
|
ln -s ${srcdir}/autodeps/none ./find-requires.sh
|
1996-11-16 05:04:09 +08:00
|
|
|
fi
|
|
|
|
|
1998-04-04 00:33:19 +08:00
|
|
|
|
1997-11-01 03:24:48 +08:00
|
|
|
if test -n "$MISCOBJS" ; then
|
|
|
|
MISCDIR=misc
|
1997-11-01 03:32:56 +08:00
|
|
|
LIBMISC=-lmisc
|
1997-11-01 03:24:48 +08:00
|
|
|
MISCPATH=misc/libmisc.a
|
|
|
|
fi
|
|
|
|
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_SUBST(MISCOBJS)
|
|
|
|
AC_SUBST(INCPATH)
|
1996-08-20 01:23:07 +08:00
|
|
|
AC_SUBST(LIBINTL)
|
1996-08-21 00:24:37 +08:00
|
|
|
AC_SUBST(varprefix)
|
|
|
|
AC_SUBST(tmpdir)
|
1996-09-26 03:10:44 +08:00
|
|
|
AC_SUBST(topdir)
|
1998-02-11 16:59:34 +08:00
|
|
|
AC_SUBST(topsrcdir)
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_SUBST(INTLDEF)
|
|
|
|
AC_SUBST(XGETTEXT)
|
|
|
|
AC_SUBST(LIBINTL)
|
1997-02-20 10:20:10 +08:00
|
|
|
AC_SUBST(LIBS)
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_SUBST(LIBDL)
|
|
|
|
AC_SUBST(PO)
|
|
|
|
AC_SUBST(GETTEXTSTUB)
|
1996-12-12 11:56:30 +08:00
|
|
|
AC_SUBST(RPM)
|
1997-05-02 03:07:43 +08:00
|
|
|
AC_SUBST(GZIPBIN)
|
1998-05-26 21:19:52 +08:00
|
|
|
AC_SUBST(BZIP2BIN)
|
1997-01-17 01:23:44 +08:00
|
|
|
AC_SUBST(FIXPERMS)
|
1997-11-01 03:24:48 +08:00
|
|
|
AC_SUBST(MISCDIR)
|
1997-11-01 03:32:56 +08:00
|
|
|
AC_SUBST(LIBMISC)
|
1997-11-01 03:24:48 +08:00
|
|
|
AC_SUBST(MISCPATH)
|
1998-03-05 00:53:54 +08:00
|
|
|
AC_SUBST(RPMCONFIGDIR)
|
1998-03-28 00:46:39 +08:00
|
|
|
AC_SUBST(MKDIR_P)
|
1998-05-02 03:33:51 +08:00
|
|
|
AC_SUBST(LDFLAGS_STATIC)
|
1996-08-20 01:15:47 +08:00
|
|
|
|
1997-11-01 03:24:48 +08:00
|
|
|
if test -d newbuild ; then
|
1997-11-01 01:31:17 +08:00
|
|
|
NBMAKEFILE=newbuild/Makefile
|
|
|
|
else
|
|
|
|
NBMAKEFILE=
|
|
|
|
fi
|
|
|
|
|
1998-10-06 01:26:46 +08:00
|
|
|
# XXX Propagate -lucb to popt ...
|
|
|
|
export LIBS INCPATH
|
|
|
|
|
1998-02-11 16:59:34 +08:00
|
|
|
AC_CONFIG_SUBDIRS(popt)
|
1998-08-02 23:14:38 +08:00
|
|
|
AC_OUTPUT(Makefile Makefile.inc lib-rpmrc macros lib/Makefile build/Makefile $NBMAKEFILE tools/Makefile po/Makefile misc/Makefile)
|