dbTalk Databases Forums  

[BUGS] Conflicts with autoconf macroses

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Conflicts with autoconf macroses in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Olleg
 
Posts: n/a

Default [BUGS] Conflicts with autoconf macroses - 12-03-2003 , 02:00 AM






SuSE Linux 8.2 (i586)
PostgreSQL REL7_4_STABLE (cvs), 7.4
compiled with:
gcc (GCC) 3.3 20030226 (prerelease) (SuSE Linux)
flex version 2.5.4
bison (GNU Bison) 1.875
PostgreSQL config.status 7.4
configured by ./configure, generated by GNU Autoconf 2.53,
with options "'--prefix=/opt/pgsql' '--enable-integer-datetimes'
'--enable-thread-safety' '--disable-largefile' '--with-java'
'--with-pam' '--with-openss' '--with-gnu-ld'"

I develop postgresql module and use autoconf to perform some check and
configure. When I try to compile with PostgreSQL 7.4 I get ugly messages
like:

.../config.h:56:1: warning: "PACKAGE_VERSION" redefined
In file included from /opt/pgsql/include/server/c.h:53,
from /opt/pgsql/include/server/postgres.h:48,
from pgat.h:8,
from pgat1.c:3:
/opt/pgsql/include/server/pg_config.h:571:1: warning: this is the
location of the previous definition

It's bug, autoconf headers may not be included in "library headers".

Workaround:

#include <postgres.h>

/* Undefine conflict macroses from pg_config.h included in postgres.h
and our config.h
*/
#undef PACKAGE_VERSION
#undef PACKAGE_TARNAME
#undef PACKAGE_STRING
#undef PACKAGE_NAME
#undef PACKAGE_BUGREPORT

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif


--
Olleg



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Conflicts with autoconf macroses - 12-03-2003 , 09:58 AM






Olleg <olleg (AT) jane (DOT) telecom.mipt.ru> writes:
Quote:
It's bug, autoconf headers may not be included in "library headers".
If you think it's a bug you'd better complain to the autoconf people.
pg_config.h is generated entirely by autoconf tools.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #3  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] Conflicts with autoconf macroses - 12-03-2003 , 05:26 PM



Tom Lane writes:

Quote:
Olleg <olleg (AT) jane (DOT) telecom.mipt.ru> writes:
It's bug, autoconf headers may not be included in "library headers".

If you think it's a bug you'd better complain to the autoconf people.
pg_config.h is generated entirely by autoconf tools.
Admittedly, you're not supposed to install the generated config.h files,
because of this kind of name conflict. There is a contributed macro that
automatically prefixes all macro names so they don't conflict. May be
worth checking out.

--
Peter Eisentraut peter_e (AT) gmx (DOT) net


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #4  
Old   
Olleg
 
Posts: n/a

Default Re: [BUGS] Conflicts with autoconf macroses - 12-04-2003 , 09:53 AM



Peter Eisentraut wrote:
Quote:
Tom Lane writes:


Olleg <olleg (AT) jane (DOT) telecom.mipt.ru> writes:

It's bug, autoconf headers may not be included in "library headers".

If you think it's a bug you'd better complain to the autoconf people.
pg_config.h is generated entirely by autoconf tools.

Admittedly, you're not supposed to install the generated config.h files,
I am working on a server module. I need postgresql.h. pg_config.h is
included in postgresql.h

Quote:
because of this kind of name conflict. There is a contributed macro that
automatically prefixes all macro names so they don't conflict. May be
worth checking out.
??? Please explain.

--
Olleg




---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
  #5  
Old   
Olleg
 
Posts: n/a

Default Re: [BUGS] Conflicts with autoconf macroses - 12-04-2003 , 01:38 PM



Tom Lane wrote:
Quote:
Olleg <olleg (AT) jane (DOT) telecom.mipt.ru> writes:

It's bug, autoconf headers may not be included in "library headers".


If you think it's a bug you'd better complain to the autoconf people.
pg_config.h is generated entirely by autoconf tools.
The most libraries use autoheader, but don't generate such error.
Generation of pg_config.h is ok. The only mistake is include such
autoconf header in headers designed to use with external programs, spi
modules in this case. Autoconf header must be included in source
directly or included in headers for internal use only. And don't be
installed along with other library headers.



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #6  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] Conflicts with autoconf macroses - 12-04-2003 , 03:31 PM



Olleg writes:

Quote:
because of this kind of name conflict. There is a contributed macro that
automatically prefixes all macro names so they don't conflict. May be
worth checking out.

??? Please explain.
http://ac-archive.sourceforge.net/gu..._config_h.html


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.