Unix Technical Forum

Need help with autoconf

This is a discussion on Need help with autoconf within the pgsql Hackers forums, part of the PostgreSQL category; --> Hi! I'm trying to write an autoconf macro to figure out if the function krb5_free_unparsed_name exists (because it exists ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 08:55 PM
Magnus Hagander
 
Posts: n/a
Default Need help with autoconf

Hi!

I'm trying to write an autoconf macro to figure out if the function
krb5_free_unparsed_name exists (because it exists in MIT but not Heimdal),
to fix a rather nasty bug in our Kerberos implementation.

However, I'm failing

I'm simply using
AC_CHECK_FUNC([krb5_free_unparsed_name])

which works fine on unix, but breaks on win32. Because autoconf tries the
function with no parameters, which doesn't work due to win32 decorations.
The function is declared in krb5.h - is there some way to make autoconf
load that header file and use the declaration from there?

(If I manually set HAVE_KRB5_FREE_UNPARSED_NAME, I can perfectly well *use*
the function as long as I put the correct number of arguments in there)

//Magnus


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 08:55 PM
Tom Lane
 
Posts: n/a
Default Re: Need help with autoconf

Magnus Hagander <magnus@hagander.net> writes:
> I'm simply using
> AC_CHECK_FUNC([krb5_free_unparsed_name])
> which works fine on unix, but breaks on win32. Because autoconf tries the
> function with no parameters, which doesn't work due to win32 decorations.


Doesn't work why? We have dozens of other functions we check for
without needing any special windoze hacks. Is it a macro?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-15-2008, 08:55 PM
Magnus Hagander
 
Posts: n/a
Default Re: Need help with autoconf

Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> I'm simply using
>> AC_CHECK_FUNC([krb5_free_unparsed_name])
>> which works fine on unix, but breaks on win32. Because autoconf tries the
>> function with no parameters, which doesn't work due to win32 decorations.

>
> Doesn't work why? We have dozens of other functions we check for
> without needing any special windoze hacks. Is it a macro?


No, it actually depends on how the library is compiled. Functions can
either be exported decorated or not. This one is exported decorated.
Also, if it just checks for a function with zero arguments, decorated
and non-decorated look the same.

//magnus

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-15-2008, 08:55 PM
Tom Lane
 
Posts: n/a
Default Re: Need help with autoconf

Magnus Hagander <magnus@hagander.net> writes:
> Tom Lane wrote:
>> Magnus Hagander <magnus@hagander.net> writes:
>>> I'm simply using
>>> AC_CHECK_FUNC([krb5_free_unparsed_name])
>>> which works fine on unix, but breaks on win32. Because autoconf tries the
>>> function with no parameters, which doesn't work due to win32 decorations.

>>
>> Doesn't work why? We have dozens of other functions we check for
>> without needing any special windoze hacks. Is it a macro?


> No, it actually depends on how the library is compiled. Functions can
> either be exported decorated or not. This one is exported decorated.


It's still not apparent to me how this function is different from every
other one we check for; but I'd suggest you write a check that looks
like the ones we use for functions that might be macros, eg sigsetjmp.

regards, tom lane

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-15-2008, 08:58 PM
Magnus Hagander
 
Posts: n/a
Default Re: Need help with autoconf

On Wed, Jul 11, 2007 at 01:41:56PM -0400, Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
> > Tom Lane wrote:
> >> Magnus Hagander <magnus@hagander.net> writes:
> >>> I'm simply using
> >>> AC_CHECK_FUNC([krb5_free_unparsed_name])
> >>> which works fine on unix, but breaks on win32. Because autoconf tries the
> >>> function with no parameters, which doesn't work due to win32 decorations.
> >>
> >> Doesn't work why? We have dozens of other functions we check for
> >> without needing any special windoze hacks. Is it a macro?

>
> > No, it actually depends on how the library is compiled. Functions can
> > either be exported decorated or not. This one is exported decorated.

>
> It's still not apparent to me how this function is different from every
> other one we check for; but I'd suggest you write a check that looks
> like the ones we use for functions that might be macros, eg sigsetjmp.


Thanks for the pointer. Attached is what I came up with. If someone
autoconfy can sign off on that it seems correct, I'll apply that.

(It passes my tests on both linux and win32 now..)

//Magnus


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-15-2008, 08:58 PM
Tom Lane
 
Posts: n/a
Default Re: Need help with autoconf

Magnus Hagander <magnus@hagander.net> writes:
> Thanks for the pointer. Attached is what I came up with. If someone
> autoconfy can sign off on that it seems correct, I'll apply that.


Looks reasonable to me.

regards, tom lane

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-15-2008, 08:58 PM
Magnus Hagander
 
Posts: n/a
Default Re: Need help with autoconf

On Thu, Jul 12, 2007 at 09:54:28AM -0400, Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
> > Thanks for the pointer. Attached is what I came up with. If someone
> > autoconfy can sign off on that it seems correct, I'll apply that.

>
> Looks reasonable to me.


Thanks, applied and backpatched to 8.2.

I didn't backpatch past 8.2, since I've only seen the bug affecting Windows
systems. Though it's actually incorrect code in 8.1 and earlier as well, I
figured we'd better leave it alone for now.

//Magnus

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:16 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com