Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-24 Thread Magnus Hagander
Peter Eisentraut wrote: > Magnus Hagander wrote: >> Anything that needs symlinks will need a set of workarounds on Windows, >> having us manually do a copy of the files. We already do this in a >> couple of cases, but relying more on it would make things even more >> kludgy I think... > > Autoconf

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-24 Thread Peter Eisentraut
Magnus Hagander wrote: Anything that needs symlinks will need a set of workarounds on Windows, having us manually do a copy of the files. We already do this in a couple of cases, but relying more on it would make things even more kludgy I think... Autoconf automatically uses cp if ln doesn't wo

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-24 Thread Magnus Hagander
Peter Eisentraut wrote: > Tom Lane wrote: >> I think the reason we've avoided putting such stuff into include/port/ >> is that right now that directory consists exclusively of OS-specific >> files. Maybe we need another include subdirectory? > > I think the idea is rather that you don't need to c

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-24 Thread Peter Eisentraut
Tom Lane wrote: Also, right now we have got src/include/getaddrinfo.h src/include/getopt_long.h which really make me itch now that I am contemplating the possibility that we try to use libc-supplied code for these functions along with our own header definitions. These particular header files

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-24 Thread Peter Eisentraut
Tom Lane wrote: I'd suggest making the callers do something like #ifdef HAVE_FNMATCH #include #else #include "port/pg_fnmatch.h" #endif The way Autoconf suggests to organize this is to provide a fake fnmatch.h (they call it fnmatch_.h) and link it to f

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-21 Thread Bruce Momjian
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: > > Or in the same directly, called something else. Like fnmatchstub.h. See > > attached, seems reasonable? > > Seems okay to me. Note: in future, don't bother posting configure > diffs; nobody wants to look at that, just the changes i

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-21 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > If you want people to stop posting configure diffs you should remove > the damn configure file from CVS where it doesn't belong. Well, that'd require everyone using CVS to have autoconf installed --- and not just any autoconf, but the specific version. S

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-21 Thread Greg Stark
If you want people to stop posting configure diffs you should remove the damn configure file from CVS where it doesn't belong. greg On 21 Nov 2008, at 06:49 PM, Tom Lane <[EMAIL PROTECTED]> wrote: Magnus Hagander <[EMAIL PROTECTED]> writes: Or in the same directly, called something else. Lik

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-21 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> Or in the same directly, called something else. Like fnmatchstub.h. See >> attached, seems reasonable? > > Seems okay to me. Note: in future, don't bother posting configure > diffs; nobody wants to look at that, just the changes in

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-21 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > Or in the same directly, called something else. Like fnmatchstub.h. See > attached, seems reasonable? Seems okay to me. Note: in future, don't bother posting configure diffs; nobody wants to look at that, just the changes in the autoconf input files.

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-21 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> AFAICS, we're not doing this for any other functions though - or am I >> too tired and just looking in the wrong place? Or is that because >> they're just function definitions and not #defines? >> (I want to be sure to stick whatever

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > AFAICS, we're not doing this for any other functions though - or am I > too tired and just looking in the wrong place? Or is that because > they're just function definitions and not #defines? > (I want to be sure to stick whatever new file there is in t

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> Tom Lane wrote: >>> Not really. I'd suggest making the callers do something like >>> >>> #ifdef HAVE_FNMATCH >>> #include >>> #else >>> #include "port/pg_fnmatch.h" >>> #endif > >> How's that actually different from the >> #ifdef H

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Not really. I'd suggest making the callers do something like >> >> #ifdef HAVE_FNMATCH >> #include >> #else >> #include "port/pg_fnmatch.h" >> #endif > How's that actually different from the > #ifdef HAVE_FNMATCH > #include

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> Tom Lane wrote: >>> Since fnmatch and the #define's are supposed to be provided by >>> , I think you should probably put the substitute definitions >>> in a substitute fnmatch.h, not port.h, to avoid that risk. > >> Do we have an exa

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Since fnmatch and the #define's are supposed to be provided by >> , I think you should probably put the substitute definitions >> in a substitute fnmatch.h, not port.h, to avoid that risk. > Do we have an example where we do that bef

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >>> Also, judging from the comments in the autoconf manual, you'd better >>> use AC_FUNC_FNMATCH not just test whether the function exists. > >> Ok, will look at switching to that. > > Hmm ... actually there's still possibly an issue t

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Surely we must *not* be providing our own definitions of these symbols >> when using a system version of fnmatch. > That's the define that I reversed in the second patch I sent. It's > supposed to be ifndef. Okay. >> Also, judging

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> *** a/src/include/port.h >> --- b/src/include/port.h >> *** >> *** 393,398 extern void unsetenv(const char *name); >> --- 393,409 >> extern void srandom(unsigned int seed); >> #endif > >> + #ifdef HAVE_FNM

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > *** a/src/include/port.h > --- b/src/include/port.h > *** > *** 393,398 extern void unsetenv(const char *name); > --- 393,409 > extern void srandom(unsigned int seed); > #endif > + #ifdef HAVE_FNMATCH > + extern int fnmatch(

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Magnus Hagander
Magnus Hagander wrote: > Peter Eisentraut wrote: >> Magnus Hagander wrote: >>> How do I make this work with the autoconf magic? I see there is an >>> AC_CHECK_FNMATCH and AC_REPLACE_FNMATCH and so, but I have a feeling I >>> need to do something different since it's libpq? >> AC_*_FNMATCH will figu

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Magnus Hagander
Peter Eisentraut wrote: > Magnus Hagander wrote: >> How do I make this work with the autoconf magic? I see there is an >> AC_CHECK_FNMATCH and AC_REPLACE_FNMATCH and so, but I have a feeling I >> need to do something different since it's libpq? > > AC_*_FNMATCH will figure out whether you need fnm

Re: [HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Peter Eisentraut
Magnus Hagander wrote: How do I make this work with the autoconf magic? I see there is an AC_CHECK_FNMATCH and AC_REPLACE_FNMATCH and so, but I have a feeling I need to do something different since it's libpq? AC_*_FNMATCH will figure out whether you need fnmatch(), so something involving thos

[HACKERS] Autoconf, libpq and replacement function

2008-11-20 Thread Magnus Hagander
Hi! I want to use the fnmatch() function in libpq, to support wildcard certificate matching. This function is part of the standard (http://www.opengroup.org/onlinepubs/95399/functions/fnmatch.html), but obviously not implemented on all platforms (naturally, it's missing on win32, because that