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

Поиск
Список
Период
Сортировка
От Taral
Тема RE: [HACKERS] PostgreSQL v6.4 BETA2 ...
Дата
Msg-id 000001bdf71e$43941660$3b291f0a@taral
обсуждение исходный текст
Ответ на Re: [HACKERS] PostgreSQL v6.4 BETA2 ...  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Список 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 :)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] PostgreSQL v6.4 BETA2 ...
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: [HACKERS] PostgreSQL v6.4 BETA2 ...