ac-archive-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AX_PROLOG


From: Frederik Fouvry
Subject: AX_PROLOG
Date: Thu, 26 Aug 2004 19:16:59 +0200 (CEST)

I needed this once, and thought I might share it:


Execute arbitrary Prolog code
$1 is the message
$2 is the code
$3 is show to the user or not


AC_DEFUN(AX_PROLOG, [
prologcode="$2"
if test -z "$3"; then
        AC_MSG_CHECKING(for $1)
fi
AC_CACHE_VAL(PROLOG_cv_SYS_$1,[
        INPUT=./conftest-$$-in
        OUTPUT=./conftest-$$
        echo "$prologcode" > ${INPUT}
        echo "echo \"tell('${OUTPUT}'), consult('${INPUT}'), told, halt.\" | 
${PROLOG} -f" >& AC_FD_CC 2>&1
        echo "tell('${OUTPUT}'), compile('${INPUT}'), told, halt." | ${PROLOG} 
-f >& AC_FD_CC 2>&1
        retval=`cat ${OUTPUT}`
        echo "=> ${retval}" >& AC_FD_CC 2>&1
        rm -f ${OUTPUT}
        PROLOG_cv_SYS_$1=$retval
])
$1=${PROLOG_cv_SYS_$1}
if test -z "$3"; then
        AC_MSG_RESULT($$1)
fi
])

Regards,

Frederik Fouvry




reply via email to

[Prev in Thread] Current Thread [Next in Thread]