Dmitry Samersoff <dms@wplus.net> writes:
> if I make CC=CXX, configure can't find libpq,
You shouldn't do that. CC is supposed to be a C compiler not a C++
compiler.
We have enough cross-platform headaches with the code already ...
trying to make it all compile under C++ as well as C is a pushup
I don't care to undertake...
> if I keep CC as cc
> AC_TRY_COMPILE([#include <stdlib.h>
> #include <sys/types.h>
> #include <sys/socket.h>
> ],
> [int a = accept(1, (struct sockaddr *) 0, (int *) 0);],
> [AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)],
> [AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)])
> return wrong result because int always aceptable for C but
> can cause error for CXX
Huh? How can it be a problem for C++? The test snippet is C, and
so is the code that is going to be trying to call accept().
> Is there autoconf version modified for work with C++ or
> I have to patch it's macros by my self ?
I think you have a misconfigured C++ installation, and that you'd
be best off directing your attention to fixing that. I have
seen libpq++ fail in odd ways when I tried to build Postgres here
with a fresh egcs install whose C++ support wasn't right. (IIRC,
my problem was that /usr/local/lib/libg++ was an old version not
compatible with the new egcs --- but the error messages weren't
particularly helpful in diagnosing that...)
regards, tom lane