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"
|
|
|
|
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_CHECKING(checking for 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
|
|
|
|
|
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, :)
|
|
|
|
|
|
|
|
if test "$cross_compiling" = "no"; then
|
|
|
|
dnl Don't bother checking these if we're cross compiling
|
|
|
|
|
|
|
|
dnl Hope for the best
|
|
|
|
CPIOBIN="cpio"
|
|
|
|
else
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_CHECKING(checking for GNU cpio...)
|
1996-12-12 11:32:40 +08:00
|
|
|
if test -z "$CPIOBIN"; then
|
|
|
|
oldifs="$IFS"
|
|
|
|
IFS=:
|
|
|
|
for n in $PATH:/opt/gnu/bin; do
|
|
|
|
if test -f $n/cpio; then
|
|
|
|
$n/cpio --quiet -o < /dev/null >/dev/null 2>/dev/null
|
|
|
|
if test "$?" = "0"; then
|
|
|
|
CPIOBIN="$n/cpio";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS="$oldifs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$CPIOBIN"; then
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_ERROR(RPM will not work without GNU cpio 2.4.2 or later.)
|
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
|
|
|
|
fi
|
|
|
|
|
1996-09-26 03:10:44 +08:00
|
|
|
topdir=`pwd`
|
|
|
|
|
1997-02-12 12:48:06 +08:00
|
|
|
if test $prefix != "/usr" -a $prefix != "/usr/local"; then
|
|
|
|
echo $ac_n "checking for $prefix/lib... $ac_c"
|
|
|
|
if test -d $prefix/lib ; then
|
1997-02-20 10:20:10 +08:00
|
|
|
LIBS="$LIBS -L$prefix/lib"
|
1997-02-12 12:48:06 +08:00
|
|
|
|
|
|
|
echo "yes"
|
|
|
|
else
|
|
|
|
echo "no"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $ac_n "checking for $prefix/include... $ac_c"
|
|
|
|
if test -d $prefix/include ; then
|
|
|
|
INCPATH="$INCPATH -I$prefix/include"
|
|
|
|
|
|
|
|
echo "yes"
|
|
|
|
else
|
|
|
|
echo "no"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_CHECKING(checking for /usr/local/lib...)
|
1996-09-29 10:27:07 +08:00
|
|
|
if test -d /usr/local/lib ; then
|
1997-02-20 10:20:10 +08:00
|
|
|
LIBS="$LIBS -L/usr/local/lib"
|
1996-09-29 10:27:07 +08:00
|
|
|
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1996-09-29 10:27:07 +08:00
|
|
|
else
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1996-09-29 10:27:07 +08:00
|
|
|
fi
|
|
|
|
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_CHECKING(checking for /usr/local/include...)
|
1996-09-29 10:27:07 +08:00
|
|
|
if test -d /usr/local/include ; then
|
|
|
|
INCPATH="$INCPATH -I/usr/local/include"
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1996-09-29 10:27:07 +08:00
|
|
|
else
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1996-10-15 10:13:16 +08:00
|
|
|
fi
|
|
|
|
|
1996-12-12 11:32:40 +08:00
|
|
|
dnl Checks for libraries.
|
1996-09-26 03:10:44 +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-03-12 01:09:34 +08:00
|
|
|
AC_CHECK_FUNC(gethostname, [], [
|
|
|
|
AC_CHECK_LIB(nsl, gethostname, [LIBS="-lnsl $LIBS"])
|
|
|
|
])
|
|
|
|
AC_CHECK_FUNC(socket, [], [
|
|
|
|
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"])
|
|
|
|
])
|
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-03-12 01:09:34 +08:00
|
|
|
[LIBS="-l${zlib} $LIBS"; 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
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_CHECK_HEADERS(netinet/in_systm.h)
|
1997-02-20 10:20:10 +08:00
|
|
|
AC_CHECK_HEADERS(alloca.h dirent.h)
|
1997-01-25 03:04:51 +08:00
|
|
|
AC_CHECK_HEADERS(machine/types.h string.h)
|
1997-01-17 03:44:24 +08:00
|
|
|
AC_CHECK_HEADERS(glob.h,,MISCOBJS="$MISCOBJS glob.o")
|
|
|
|
AC_CHECK_HEADERS(fnmatch.h,,MISCOBJS="$MISCOBJS fnmatch.o")
|
|
|
|
|
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
|
|
|
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_C_BIGENDIAN
|
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
|
1997-01-21 06:34:47 +08:00
|
|
|
AC_MSG_CHECKING(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-03-20 23:18:07 +08:00
|
|
|
dnl Some Unix's are missing S_ISLNK, S_ISSOCK
|
|
|
|
AC_MSG_CHECKING(checking if <sys/stat.h> defines S_ISLNK...)
|
|
|
|
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)
|
|
|
|
if test $HAS_S_ISLNK=yes; then
|
|
|
|
AC_DEFINE(HAVE_S_ISLNK)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(checking if <sys/stat.h> defines S_ISSOCK...)
|
|
|
|
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)
|
|
|
|
if test $HAS_S_ISSOCK=yes; then
|
|
|
|
AC_DEFINE(HAVE_S_ISSOCK)
|
|
|
|
fi
|
|
|
|
|
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")
|
1996-09-29 10:27:07 +08:00
|
|
|
|
|
|
|
if test -n "$MISCOBJS"; then
|
|
|
|
LIBMISC=-lmisc
|
|
|
|
fi
|
1996-08-20 01:15:47 +08:00
|
|
|
|
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
|
|
|
|
|
1996-09-29 10:27:07 +08:00
|
|
|
if echo "$build" | grep solaris >/dev/null ; then
|
|
|
|
# Solaris needs -ldl to use -lnsl, and it can't build static
|
|
|
|
# binaries if you use -ldl
|
|
|
|
echo "hacking things up for solaris"
|
|
|
|
LIBDL=-ldl
|
1996-12-12 11:56:30 +08:00
|
|
|
RPM=rpm.shared
|
1996-09-29 10:27:07 +08:00
|
|
|
else
|
1996-12-12 11:56:30 +08:00
|
|
|
RPM=rpm
|
1996-09-29 10:27:07 +08:00
|
|
|
fi
|
|
|
|
|
1996-11-16 05:04:09 +08:00
|
|
|
rm -f ./find-provides.sh
|
1996-11-22 06:00:02 +08:00
|
|
|
if test -f autodeps/${build_os}.prov ; then
|
|
|
|
echo "using autodeps/$build_os.prov for automatic provides generation"
|
|
|
|
ln -s autodeps/${build_os}.prov ./find-provides.sh
|
1996-11-16 05:04:09 +08:00
|
|
|
else
|
|
|
|
echo "*** no default provides information is available for $build_os"
|
1996-11-22 06:00:02 +08:00
|
|
|
ln -s autodeps/none ./find-provides.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f ./find-requires.sh
|
|
|
|
if test -f autodeps/${build_os}.req ; then
|
|
|
|
echo "using autodeps/$build_os.req for automatic requires generation"
|
|
|
|
ln -s autodeps/$build_os.req ./find-requires.sh
|
|
|
|
else
|
|
|
|
echo "*** no default requires information is available for $build_os"
|
|
|
|
ln -s autodeps/none ./find-requires.sh
|
1996-11-16 05:04:09 +08:00
|
|
|
fi
|
|
|
|
|
1996-09-29 10:27:07 +08:00
|
|
|
AC_SUBST(MISCOBJS)
|
|
|
|
AC_SUBST(INCPATH)
|
1996-08-20 01:15:47 +08:00
|
|
|
AC_SUBST(LIBMISC)
|
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)
|
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)
|
1996-10-15 10:13:16 +08:00
|
|
|
AC_SUBST(CPIOBIN)
|
1997-01-17 01:23:44 +08:00
|
|
|
AC_SUBST(FIXPERMS)
|
1996-08-20 01:15:47 +08:00
|
|
|
|
1996-09-26 03:10:44 +08:00
|
|
|
AC_OUTPUT(Makefile Makefile.inc lib-rpmrc lib/Makefile build/Makefile tools/Makefile po/Makefile misc/Makefile)
|