[OpenAFS-devel] not sure what to do about rlim --- also on other 64 bit machines?
chas williams - CONTRACTOR
chas@cmf.nrl.navy.mil
Fri, 30 Jun 2006 09:23:50 -0400
In message <99CF0450362A26FDB2823951@sirius.fac.cs.cmu.edu>,Jeffrey Hutzelman w
rites:
>Basically, we need AC_TRY_KBUILD or some such thing. It's a little messy,
>but doable.
is this round enough? see bug #34561 for the complete rewrite.
# AC_TRY_KBUILD26([INCLUDES], [FUNCTION-BODY],
# [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
#
AC_DEFUN([AC_TRY_KBUILD26], [
rm -fr conftest.dir
if mkdir conftest.dir; then
cd conftest.dir
cat >Makefile <<_ACEOF
CFLAGS += $CPPFLAGS
_ACEOF
cat >conftest.c <<\_ACEOF
$1
void conftest(void)
{
$2
}
_ACEOF
cd ..
fi
AS_IF(AC_RUN_LOG([make -C $LINUX_KERNEL_PATH M=`pwd`/conftest.dir conftest.o > /dev/null]),
[$3], [$4])
rm -fr conftest.dir])
# AC_TRY_KBUILD24([INCLUDES], [FUNCTION-BODY],
# [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
#
AC_DEFUN([AC_TRY_KBUILD24], [
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-I$LINUX_KERNEL_PATH/include -D__KERNEL__ $CPPFLAGS"
AC_TRY_COMPILE([$1], [$2], [$3], [$4])
CPPFLAGS="$ac_save_CPPFLAGS"])
# AC_TRY_KBUILD([INCLUDES], [FUNCTION-BODY],
# [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
#
AC_DEFUN([AC_TRY_KBUILD], [
if test -f $LINUX_KERNEL_PATH/scripts/Makefile.build; then
AC_TRY_KBUILD26([$1], [$2], [$3], [$4])
else
AC_TRY_KBUILD24([$1], [$2], [$3], [$4])
fi])