pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Samersoff <dms@wplus.net>
To: The Hermit Hacker <scrappy@HUB.ORG>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Off-topic: autoconf guru
Date: Thu, 29 Jul 1999 18:02:36 +0400 (MSD)
Message-ID: <XFMail.990729180236.dms@wplus.net> (raw)
In-Reply-To: <Pine.BSF.4.05.9907290950270.78452-100000@thelab.hub.org>


On 29-Jul-99 The Hermit Hacker wrote:
> 
> If you check configure.in with PostgreSQL, we use the --with-libs call in
> order to tell it where to look for 'libraries outside the system
> norm'...check the code for that, as I believe its what you are looking
> for, since, in general, the libpq would be outside that 'norm'..

Thanks, but I mention some other problem - 
sequence 
 CC=g++
 AC_CHECK_LIB(pq, PQexec)

is espanded by autoconf into
... main(){ PQexec(); } ...
that can't be compiled by g++, 
instead 
... main(){ PGconn *conn; const char *query; PQexec(conn,query); }   
 
is there a way to correct this problem or I need to rewrite 
autoconf macros?

configure:2672: checking for PQexec in -lpq
configure:2691: g++ -o conftest -g -O2   conftest.c -lpq 
-L/usr/local/pgsql/lib  1>&5
configure:2688: Undefined symbol `PQexec(void)' referenced from text segment
collect2: ld returned 1 exit status
configure: failed program was:
#line 2680 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQexec();

int main() {
PQexec()
; return 0; }


> 
> 
>  On Thu, 29 Jul 1999, Dmitry Samersoff wrote:
> 
>> Is there any autoconf guru?
>> 
>> I have lots problems Autoconf + C++ library.
>> 
>> if I make CC=CXX, configure can't find libpq,
>>  AC_CHECK_LIB(pq, PQexec)
>> 
>> because it try link PQexec() - and it is missing 
>> 
>> 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
>> 
>> Is there autoconf version modified for work with C++ or 
>> I have to patch it's macros by my self ?
>> 
>> 
>> ---
>> Dmitry Samersoff, dms@wplus.net, ICQ:3161705
>> http://devnull.wplus.net
>> * There will come soft rains ...
>> 
> 
> Marc G. Fournier                   ICQ#7615664               IRC Nick:
> Scrappy
> Systems Administrator @ hub.org 
> primary: scrappy@hub.org           secondary:
> scrappy@{freebsd|postgresql}.org 

---
Dmitry Samersoff, dms@wplus.net, ICQ:3161705
http://devnull.wplus.net
* There will come soft rains ...



view thread (7+ messages)  latest in thread

Message-ID: <XFMail.990729180236.dms@wplus.net>
Permalink:  ../XFMail.990729180236.dms@wplus.net/
Also on:    postgresql.org/message-id/XFMail.990729180236.dms@wplus.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: dms@wplus.net, scrappy@HUB.ORG
  Subject: Re: [HACKERS] Off-topic: autoconf guru
  In-Reply-To: <XFMail.990729180236.dms@wplus.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox