1) added --disable-nls

2) slight support for cross compiling
3) check for libintl.h

CVS patchset: 1228
CVS date: 1996/12/12 03:32:40
This commit is contained in:
ewt 1996-12-12 03:32:40 +00:00
parent 329e94d98e
commit 2e1c47a108
1 changed files with 97 additions and 61 deletions

View File

@ -6,6 +6,63 @@ dnl it, why check it?
AC_INIT(rpm.c)
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
AC_AIX
AC_MINIX
AC_ISC_POSIX
AC_PROG_AWK
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CHECK_TOOL(RANLIB, 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
echo $ac_n "checking for GNU cpio... $ac_c"
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
echo "no"
echo ""
echo "RPM will not work without GNU cpio 2.4.2 or later."
exit 1
else
echo "yes"
fi
fi
topdir=`pwd`
echo $ac_n "checking for /usr/local/lib... $ac_c"
@ -27,76 +84,42 @@ else
echo "no"
fi
echo $ac_n "checking for GNU cpio... $ac_c"
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
echo "no"
echo ""
echo "RPM will not work without GNU cpio 2.4.2 or later."
exit 1
else
echo "yes"
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_AIX
AC_MINIX
AC_ISC_POSIX
AC_PROG_AWK
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl Checks for libraries.
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)])
)
)
AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
dnl
dnl handle --disable-nls
dnl
AC_ARG_ENABLE([nls],
[ --disable-nls do not use National Language Support],
USE_NLS=$enableval, USE_NLS=yes)
if test "$XGETTEXT" != ""; then
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)])
)
)
AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
if test "$XGETTEXT" != ""; then
if xgettext --help 2>&1 | grep illegal >/dev/null ; then
echo "xgettext isn't GNU version"
XGETTEXT=""
echo "xgettext isn't GNU version"
XGETTEXT=""
fi
fi
fi
if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
echo "xgettext and gettext() exist; will build i18n support"
INTLDEF=-D_\\\(String\\\)=gettext\\\(String\\\)
PO=po
GETTEXTSTUB=""
else
else
echo "xgettext and libintl.a don't both exist; will not build i18n support"
INTLDEF=-D_\\\(a\\\)=a
XGETTEXT=""
LIBINTL=""
PO=""
GETTEXTSTUB="gettextstub.o"
fi
else
echo "user specificed no gettext; will not build i18n support"
fi
AC_CHECK_FUNC(dbopen, [],
AC_CHECK_LIB(db, dbopen, [], AC_MSG_WARN([sorry this package needs libdb.a
@ -106,6 +129,15 @@ AC_CHECK_FUNC(dbopen, [],
AC_CHECK_FUNC(fork, [], [echo "using vfork() instead of fork()";
MISCOBJS=fakefork.o], $LIBS)
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
AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lsocket -lnsl"])
@ -123,6 +155,12 @@ AC_SUBST(ZLIB)
dnl Checks for header files we can live without.
AC_CHECK_HEADERS(netinet/in_systm.h)
AC_CHECK_HEADERS(alloca.h)
AC_CHECK_HEADERS(machine/types.h)
if test "$PO" = po; then
AC_CHECK_HEADERS(libintl.h)
fi
AC_C_BIGENDIAN
@ -153,8 +191,6 @@ if test "x$tmpdir" = "x"; then
fi
fi
AC_CANONICAL_SYSTEM
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