RE: [HACKERS] PostgreSQL v6.4 BETA2 ...

From: "Taral" <taral(at)mail(dot)utexas(dot)edu>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>, "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] PostgreSQL v6.4 BETA2 ...
Date: 1998-10-14 02:56:39
Message-ID: 000001bdf71e$43941660$3b291f0a@taral
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> autoconf concludes that "gcc -E" is equivalent to cpp on my system. And
> it is, except that it needs an explicit bare "-" argument to try reading
> from a pipe, which is how cpp was being used. I can test for "gcc" being
> in the command, and add the argument, _or_ can change the scripts to
> write a temporary file instead (they already write some temp files).

Add the following to configure.in after AC_PROG_CPP and use the resultant
flag from CPPSTDIN: (either nothing or -)

--- cut here ---
AC_DEFUN(AC_TRY_CPPSTDIN,
[AC_REQUIRE_CPP()dnl
cat > conftest.$ac_ext <<EOF
[#]line __oline__ "configure"
#include "confdefs.h"
[$1]
EOF
ac_try="$ac_cpp $CPPSTDIN <conftest.$ac_ext >/dev/null 2>conftest.out"
AC_TRY_EVAL(ac_try)
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
ifelse([$2], , :, [rm -rf conftest*
$2])
else
echo "$ac_err" >&AC_FD_CC
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
ifelse([$3], , , [ rm -rf conftest*
$3
])dnl
fi
rm -f conftest*])

AC_MSG_CHECKING(how to use cpp with stdin)
if test -z "$CPPSTDIN"; then
AC_CACHE_VAL(ac_cv_cpp_stdin,
[ CPPSTDIN=""
AC_TRY_CPPSTDIN([#include <assert.h>
Syntax Error], , CPPSTDIN="-")
ac_cv_cpp_stdin="$CPPSTDIN"])
CPPSTDIN="$ac_cv_cpp_stdin"
else
ac_cv_cpp_stdin="$CPPSTDIN"
fi
AC_MSG_RESULT($CPP $CPPSTDIN)
AC_SUBST(CPPSTDIN)
--- cut here ---

Taral

P.S. Yes, do use the DEFUN just in case we want to add more broken variants
later :)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 1998-10-14 03:18:32 Re: [HACKERS] PostgreSQL v6.4 BETA2 ...
Previous Message Bruce Momjian 1998-10-14 02:43:43 Re: [HACKERS] PostgreSQL v6.4 BETA2 ...