Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>
>> Tom Lane wrote:
>>
>>> Hmm. So we need to figure out how to improve configure's check so that
>>> it rejects whatever broken version you've got ...
>>>
>
>
>> Yeah. Any ideas? I'd hate just to exclude the system erand48 on Cygwin
>> and then find out later it's broken on some other abstruse system.
>>
>
> Seems like it would be useful to figure out exactly why it's failing.
>
> I don't personally have a problem with just forcing use of our own
> erand48 on Cygwin; it's not a lot of code and it would make the behavior
> of that build more like the MSVC build. But it's curious that such a
> simple library function is seemingly broken on Cygwin ... especially
> when their random() and srandom() evidently work.
>
I'll work on it, but for now I propose to make the following change to
configure.in and the corresponding change in configure:
diff -u -r1.605 configure.in
--- configure.in 16 Jul 2009 17:43:52 -0000 1.605
+++ configure.in 23 Jul 2009 22:39:19 -0000
@@ -1249,7 +1249,7 @@pgac_save_LIBS="$LIBS"LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
-AC_REPLACE_FUNCS([crypt erand48 getopt getrusage inet_aton random rint
srandom strdup strerror strlcat strlcpy strtol strtoul])
+AC_REPLACE_FUNCS([crypt getopt getrusage inet_aton random rint srandom
strdup strerror strlcat strlcpy strtol strtoul])case $host_os in
@@ -1262,6 +1262,12 @@ ;;esac
+# Cygwin's erand48 sometimes hangs, so force use of ours
+if test "$PORTNAME" = "cygwin"; then
+ AC_LIBOBJ(erand48)
+else
+ AC_REPLACE_FUNCS([erand48])
+fiLIBS="$pgac_save_LIBS"
> regards, tom lane
>
>