Thread: mingw configure failure detection

mingw configure failure detection

From
Andrew Dunstan
Date:

Bruce Momjian wrote:

>Andrew Dunstan wrote:
>
>
>>>It's different because we know why we need that one: we understand the
>>>cause of the behavior and we therefore can have some confidence that the
>>>kluge will fix it (or not, as the case may be).  I have zero confidence
>>>in looping five times around an "ln" call.
>>>
>>>
>>>
>>>
>>>
>>Even if we don't do that can we *please* put in something that detects
>>the error, and tells the user what they will have to do to fix it?
>>Failing in a situation which we know we can detect and not telling the
>>user is intolerable, IMNSHO.
>>
>>
>
>Agreed.  At a minium we have to throw an error and tell them to run it
>again.
>
>


This patch for configure.in detects the link failures in MINGW that I
and others have seen and warns the user they have to fix it up.

cheers

andrew
Index: configure.in
===================================================================
RCS file: /projects/cvsroot/pgsql-server/configure.in,v
retrieving revision 1.345
diff -c -r1.345 configure.in
*** configure.in    7 May 2004 00:24:57 -0000    1.345
--- configure.in    8 May 2004 15:47:01 -0000
***************
*** 1237,1242 ****
--- 1237,1260 ----
    src/Makefile.port:src/makefiles/Makefile.${template}
  ])

+ # Links sometimes fail undetected on Mingw -
+ # so here we detect it and warn the user
+ case $host_os in mingw*)
+ AC_OUTPUT_COMMANDS([
+  for linktarget in \
+     src/backend/port/tas.s \
+     src/backend/port/dynloader.c \
+     src/backend/port/pg_sema.c \
+     src/backend/port/pg_shmem.c \
+     src/include/dynloader.h \
+     src/include/pg_config_os.h \
+     src/Makefile.port ; do
+            test -e $linktarget || echo " ***" link for $linktarget failed - please fix by hand
+  done
+ ])
+     ;;
+ esac
+
  AC_CONFIG_HEADERS([src/include/pg_config.h],
  [
  # Update timestamp for pg_config.h (see Makefile.global)

Re: mingw configure failure detection

From
Bruce Momjian
Date:
I have added to the Win32 TODO to remove this when we find the real
cause for the link failures.

Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Andrew Dunstan wrote:
>
>
> Bruce Momjian wrote:
>
> >Andrew Dunstan wrote:
> >
> >
> >>>It's different because we know why we need that one: we understand the
> >>>cause of the behavior and we therefore can have some confidence that the
> >>>kluge will fix it (or not, as the case may be).  I have zero confidence
> >>>in looping five times around an "ln" call.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>Even if we don't do that can we *please* put in something that detects
> >>the error, and tells the user what they will have to do to fix it?
> >>Failing in a situation which we know we can detect and not telling the
> >>user is intolerable, IMNSHO.
> >>
> >>
> >
> >Agreed.  At a minium we have to throw an error and tell them to run it
> >again.
> >
> >
>
>
> This patch for configure.in detects the link failures in MINGW that I
> and others have seen and warns the user they have to fix it up.
>
> cheers
>
> andrew

> Index: configure.in
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/configure.in,v
> retrieving revision 1.345
> diff -c -r1.345 configure.in
> *** configure.in    7 May 2004 00:24:57 -0000    1.345
> --- configure.in    8 May 2004 15:47:01 -0000
> ***************
> *** 1237,1242 ****
> --- 1237,1260 ----
>     src/Makefile.port:src/makefiles/Makefile.${template}
>   ])
>
> + # Links sometimes fail undetected on Mingw -
> + # so here we detect it and warn the user
> + case $host_os in mingw*)
> + AC_OUTPUT_COMMANDS([
> +  for linktarget in \
> +     src/backend/port/tas.s \
> +     src/backend/port/dynloader.c \
> +     src/backend/port/pg_sema.c \
> +     src/backend/port/pg_shmem.c \
> +     src/include/dynloader.h \
> +     src/include/pg_config_os.h \
> +     src/Makefile.port ; do
> +            test -e $linktarget || echo " ***" link for $linktarget failed - please fix by hand
> +  done
> + ])
> +     ;;
> + esac
> +
>   AC_CONFIG_HEADERS([src/include/pg_config.h],
>   [
>   # Update timestamp for pg_config.h (see Makefile.global)

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

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: mingw configure failure detection

From
Peter Eisentraut
Date:
Andrew Dunstan wrote:
> This patch for configure.in detects the link failures in MINGW that I
> and others have seen and warns the user they have to fix it up.

I continue to object to these sort of patches if no one wants to bother
to contact the mingw maintainers about this problem.  Maybe they have a
better fix available?

Btw. test -e is not portable.  And please use AC_MSG_WARN instead of
"echo".


Re: mingw configure failure detection

From
"Andrew Dunstan"
Date:
Peter Eisentraut said:
> Andrew Dunstan wrote:
>> This patch for configure.in detects the link failures in MINGW that I
>> and others have seen and warns the user they have to fix it up.
>
> I continue to object to these sort of patches if no one wants to bother
>  to contact the mingw maintainers about this problem.  Maybe they have
> a  better fix available?
>

I have already said I would follow it up. But the problem exists today and
shouldn't be left until we get an answer. Maybe it will take a week or a
month, or there will be no good answer at all.

All this does is issue a warning.

This problem has happened to a number of users. So far the reponse has
largely been 'fix it by hand and move on'. I think our reputation is and
ought to be better than that.

> Btw. test -e is not portable.

Since this would only be run under Mingw, where it does work, why does
that matter?

> And please use AC_MSG_WARN instead of
> "echo".
>

I guess Bruce can make this change.

cheers

andrew



Re: mingw configure failure detection

From
"Andrew Dunstan"
Date:
I said:
> Peter Eisentraut said:
>> Andrew Dunstan wrote:
>>> This patch for configure.in detects the link failures in MINGW that I
>>> and others have seen and warns the user they have to fix it up.
>>
>> I continue to object to these sort of patches if no one wants to
>> bother
>>  to contact the mingw maintainers about this problem.  Maybe they have
>> a  better fix available?
>>
>
> I have already said I would follow it up. But the problem exists today
> and shouldn't be left until we get an answer. Maybe it will take a week
> or a month, or there will be no good answer at all.
>

It appears that Dann Corbit has filed a MinGW bug on this, with accurate
problem description, but he received a less than stellar response. See

https://sourceforge.net/tracker/index.php?
func=detail&aid=931263&group_id=2435&atid=102435

(Despite previous speculation, he did indicate that the problem is
intermittent, not constant).

Cheers

andrew






Re: mingw configure failure detection

From
Bruce Momjian
Date:
Andrew Dunstan wrote:
> I said:
> > Peter Eisentraut said:
> >> Andrew Dunstan wrote:
> >>> This patch for configure.in detects the link failures in MINGW that I
> >>> and others have seen and warns the user they have to fix it up.
> >>
> >> I continue to object to these sort of patches if no one wants to
> >> bother
> >>  to contact the mingw maintainers about this problem.  Maybe they have
> >> a  better fix available?
> >>

Basically, we document the bug workaround on the Win32 TODO list, and
remove the item and the patch once we find a solution.

> > I have already said I would follow it up. But the problem exists today
> > and shouldn't be left until we get an answer. Maybe it will take a week
> > or a month, or there will be no good answer at all.
> >
>
> It appears that Dann Corbit has filed a MinGW bug on this, with accurate
> problem description, but he received a less than stellar response. See
>
> https://sourceforge.net/tracker/index.php?
> func=detail&aid=931263&group_id=2435&atid=102435
>
> (Despite previous speculation, he did indicate that the problem is
> intermittent, not constant).

I think we satisfy the specifications mentioned by the person replying.
Perhaps someone needs to follow up to state we are following the
specifications.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: mingw configure failure detection

From
Peter Eisentraut
Date:
Am Montag, 10. Mai 2004 09:17 schrieb Andrew Dunstan:
> It appears that Dann Corbit has filed a MinGW bug on this, with accurate
> problem description, but he received a less than stellar response. See
>
> https://sourceforge.net/tracker/index.php?
> func=detail&aid=931263&group_id=2435&atid=102435

I added a followup to this bug and he requests a minimal reproduceable
example.  Can someone provide one?

Re: mingw configure failure detection

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Am Montag, 10. Mai 2004 09:17 schrieb Andrew Dunstan:
>> It appears that Dann Corbit has filed a MinGW bug on this, with accurate
>> problem description, but he received a less than stellar response. See
>>
>> https://sourceforge.net/tracker/index.php?
>> func=detail&aid=931263&group_id=2435&atid=102435

> I added a followup to this bug and he requests a minimal reproduceable
> example.  Can someone provide one?

From what we've been hearing, all you have to do is download current
Postgres (snapshot tarball or CVS pull) and try "configure" a few times
(with "make distclean" to clean up).  That's perhaps not minimal but it
should at least convince him the bug exists ...

            regards, tom lane

Re: mingw configure failure detection

From
Bruce Momjian
Date:
Adjusted attached patch applied.  Thanks.

I didn't change 'test -e' because 'test -h' doesn't work (is symlink
test on my platform).  test -f actually works on symlinks too in MinGW,
strangely enough.  Anyway, the code is only run on MinGW so we don't
have to worry about other platforms.  I added a comment explaining it
works.

I got rid of the AC_CONFIG_COMMANDS and just do the for/test loop in the
shell code directly.  AC_CONFIG_COMMANDS wouldn't allow me to call
AC_MSG_WARN.

---------------------------------------------------------------------------


Peter Eisentraut wrote:
> Andrew Dunstan wrote:
> > This patch for configure.in detects the link failures in MINGW that I
> > and others have seen and warns the user they have to fix it up.
>
> I continue to object to these sort of patches if no one wants to bother
> to contact the mingw maintainers about this problem.  Maybe they have a
> better fix available?
>
> Btw. test -e is not portable.  And please use AC_MSG_WARN instead of
> "echo".
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: configure
===================================================================
RCS file: /cvsroot/pgsql-server/configure,v
retrieving revision 1.358
diff -c -c -r1.358 configure
*** configure    11 May 2004 21:57:13 -0000    1.358
--- configure    13 May 2004 01:26:20 -0000
***************
*** 17974,17979 ****
--- 17974,17998 ----
  ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c
src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}
src/include/dynloader.h:src/backend/port/dynloader/${template}.h
src/include/pg_config_os.h:src/include/port/${template}.hsrc/Makefile.port:src/makefiles/Makefile.${template}" 


+ # Links sometimes fail undetected on Mingw -
+ # so here we detect it and warn the user
+ case $host_os in mingw*)
+  for linktarget in \
+     src/backend/port/tas.s \
+     src/backend/port/dynloader.c \
+     src/backend/port/pg_sema.c \
+     src/backend/port/pg_shmem.c \
+     src/include/dynloader.h \
+     src/include/pg_config_os.h \
+     src/Makefile.port
+  do
+     # test -e works for symlinks in the MinGW console
+     test -e $linktarget || { echo "$as_me:$LINENO: WARNING: *** link for $linktarget failed - please fix by hand" >&5
+ echo "$as_me: WARNING: *** link for $linktarget failed - please fix by hand" >&2;}
+  done
+     ;;
+ esac
+
  ac_config_headers="$ac_config_headers src/include/pg_config.h"


Index: configure.in
===================================================================
RCS file: /cvsroot/pgsql-server/configure.in,v
retrieving revision 1.346
diff -c -c -r1.346 configure.in
*** configure.in    11 May 2004 21:57:13 -0000    1.346
--- configure.in    13 May 2004 01:26:22 -0000
***************
*** 1236,1241 ****
--- 1236,1259 ----
    src/Makefile.port:src/makefiles/Makefile.${template}
  ])

+ # Links sometimes fail undetected on Mingw -
+ # so here we detect it and warn the user
+ case $host_os in mingw*)
+  for linktarget in \
+     src/backend/port/tas.s \
+     src/backend/port/dynloader.c \
+     src/backend/port/pg_sema.c \
+     src/backend/port/pg_shmem.c \
+     src/include/dynloader.h \
+     src/include/pg_config_os.h \
+     src/Makefile.port
+  do
+     # test -e works for symlinks in the MinGW console
+     test -e $linktarget || AC_MSG_WARN([*** link for $linktarget failed - please fix by hand])
+  done
+     ;;
+ esac
+
  AC_CONFIG_HEADERS([src/include/pg_config.h],
  [
  # Update timestamp for pg_config.h (see Makefile.global)

Re: mingw configure failure detection

From
Bruce Momjian
Date:
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Am Montag, 10. Mai 2004 09:17 schrieb Andrew Dunstan:
> >> It appears that Dann Corbit has filed a MinGW bug on this, with accurate
> >> problem description, but he received a less than stellar response. See
> >>
> >> https://sourceforge.net/tracker/index.php?
> >> func=detail&aid=931263&group_id=2435&atid=102435
>
> > I added a followup to this bug and he requests a minimal reproduceable
> > example.  Can someone provide one?
>
> >From what we've been hearing, all you have to do is download current
> Postgres (snapshot tarball or CVS pull) and try "configure" a few times
> (with "make distclean" to clean up).  That's perhaps not minimal but it
> should at least convince him the bug exists ...

I just installed the configure symlink test code that throws a warning
if the symlinks don't work, so it is even easier to test now.  Just run
configure until it fails --- nothing to compile.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: mingw configure failure detection

From
Andrew Dunstan
Date:
The patch as applied is totally broken - the tests have to be run by
config.status after it has actually tried to make the links, which is
why I used AC_CONFIG_COMMANDS.

cheers

andrew


Bruce Momjian wrote:

>Adjusted attached patch applied.  Thanks.
>
>I didn't change 'test -e' because 'test -h' doesn't work (is symlink
>test on my platform).  test -f actually works on symlinks too in MinGW,
>strangely enough.  Anyway, the code is only run on MinGW so we don't
>have to worry about other platforms.  I added a comment explaining it
>works.
>
>I got rid of the AC_CONFIG_COMMANDS and just do the for/test loop in the
>shell code directly.  AC_CONFIG_COMMANDS wouldn't allow me to call
>AC_MSG_WARN.
>
>---------------------------------------------------------------------------
>
>
>Peter Eisentraut wrote:
>
>
>>Andrew Dunstan wrote:
>>
>>
>>>This patch for configure.in detects the link failures in MINGW that I
>>>and others have seen and warns the user they have to fix it up.
>>>
>>>
>>I continue to object to these sort of patches if no one wants to bother
>>to contact the mingw maintainers about this problem.  Maybe they have a
>>better fix available?
>>
>>Btw. test -e is not portable.  And please use AC_MSG_WARN instead of
>>"echo".
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>>
>>
>>
>
>
>
>------------------------------------------------------------------------
>
>Index: configure
>===================================================================
>RCS file: /cvsroot/pgsql-server/configure,v
>retrieving revision 1.358
>diff -c -c -r1.358 configure
>*** configure    11 May 2004 21:57:13 -0000    1.358
>--- configure    13 May 2004 01:26:20 -0000
>***************
>*** 17974,17979 ****
>--- 17974,17998 ----
>  ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c
src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}
src/include/dynloader.h:src/backend/port/dynloader/${template}.h
src/include/pg_config_os.h:src/include/port/${template}.hsrc/Makefile.port:src/makefiles/Makefile.${template}" 
>
>
>+ # Links sometimes fail undetected on Mingw -
>+ # so here we detect it and warn the user
>+ case $host_os in mingw*)
>+  for linktarget in \
>+     src/backend/port/tas.s \
>+     src/backend/port/dynloader.c \
>+     src/backend/port/pg_sema.c \
>+     src/backend/port/pg_shmem.c \
>+     src/include/dynloader.h \
>+     src/include/pg_config_os.h \
>+     src/Makefile.port
>+  do
>+     # test -e works for symlinks in the MinGW console
>+     test -e $linktarget || { echo "$as_me:$LINENO: WARNING: *** link for $linktarget failed - please fix by hand"
>&5
>+ echo "$as_me: WARNING: *** link for $linktarget failed - please fix by hand" >&2;}
>+  done
>+     ;;
>+ esac
>+
>  ac_config_headers="$ac_config_headers src/include/pg_config.h"
>
>
>Index: configure.in
>===================================================================
>RCS file: /cvsroot/pgsql-server/configure.in,v
>retrieving revision 1.346
>diff -c -c -r1.346 configure.in
>*** configure.in    11 May 2004 21:57:13 -0000    1.346
>--- configure.in    13 May 2004 01:26:22 -0000
>***************
>*** 1236,1241 ****
>--- 1236,1259 ----
>    src/Makefile.port:src/makefiles/Makefile.${template}
>  ])
>
>+ # Links sometimes fail undetected on Mingw -
>+ # so here we detect it and warn the user
>+ case $host_os in mingw*)
>+  for linktarget in \
>+     src/backend/port/tas.s \
>+     src/backend/port/dynloader.c \
>+     src/backend/port/pg_sema.c \
>+     src/backend/port/pg_shmem.c \
>+     src/include/dynloader.h \
>+     src/include/pg_config_os.h \
>+     src/Makefile.port
>+  do
>+     # test -e works for symlinks in the MinGW console
>+     test -e $linktarget || AC_MSG_WARN([*** link for $linktarget failed - please fix by hand])
>+  done
>+     ;;
>+ esac
>+
>  AC_CONFIG_HEADERS([src/include/pg_config.h],
>  [
>  # Update timestamp for pg_config.h (see Makefile.global)
>
>
>------------------------------------------------------------------------
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>               http://archives.postgresql.org
>
>


Re: mingw configure failure detection

From
Peter Eisentraut
Date:
Andrew Dunstan wrote:
> The patch as applied is totally broken - the tests have to be run by
> config.status after it has actually tried to make the links, which is
> why I used AC_CONFIG_COMMANDS.

Additional note: Instead of listing the files explicitly, just use
$CONFIG_LINKS, which contains the list of files.


Re: mingw configure failure detection

From
Andrew Dunstan
Date:
Peter Eisentraut wrote:

>Andrew Dunstan wrote:
>
>
>>The patch as applied is totally broken - the tests have to be run by
>>config.status after it has actually tried to make the links, which is
>>why I used AC_CONFIG_COMMANDS.
>>
>>
>
>Additional note: Instead of listing the files explicitly, just use
>$CONFIG_LINKS, which contains the list of files.
>
>
>
>

Well, yes, except that each entry there is in the form
linkname:targetname - we'd have to have extra code to split them up.
Something like:

for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
  linktry=`echo "$ac_file" | sed 's,:.*,,'`
  test ......
done


cheers

andrew


Re: mingw configure failure detection

From
Bruce Momjian
Date:
Andrew Dunstan wrote:
> Peter Eisentraut wrote:
>
> >Andrew Dunstan wrote:
> >
> >
> >>The patch as applied is totally broken - the tests have to be run by
> >>config.status after it has actually tried to make the links, which is
> >>why I used AC_CONFIG_COMMANDS.
> >>
> >>
> >
> >Additional note: Instead of listing the files explicitly, just use
> >$CONFIG_LINKS, which contains the list of files.
> >
> >
> >
> >
>
> Well, yes, except that each entry there is in the form
> linkname:targetname - we'd have to have extra code to split them up.
> Something like:
>
> for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
>   linktry=`echo "$ac_file" | sed 's,:.*,,'`
>   test ......
> done

OK, attached patch applied.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: configure
===================================================================
RCS file: /cvsroot/pgsql-server/configure,v
retrieving revision 1.359
diff -c -c -r1.359 configure
*** configure    13 May 2004 01:44:59 -0000    1.359
--- configure    13 May 2004 22:56:38 -0000
***************
*** 17974,17998 ****
  ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c
src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}
src/include/dynloader.h:src/backend/port/dynloader/${template}.h
src/include/pg_config_os.h:src/include/port/${template}.hsrc/Makefile.port:src/makefiles/Makefile.${template}" 


- # Links sometimes fail undetected on Mingw -
- # so here we detect it and warn the user
- case $host_os in mingw*)
-  for linktarget in \
-     src/backend/port/tas.s \
-     src/backend/port/dynloader.c \
-     src/backend/port/pg_sema.c \
-     src/backend/port/pg_shmem.c \
-     src/include/dynloader.h \
-     src/include/pg_config_os.h \
-     src/Makefile.port
-  do
-     # test -e works for symlinks in the MinGW console
-     test -e $linktarget || { echo "$as_me:$LINENO: WARNING: *** link for $linktarget failed - please fix by hand" >&5
- echo "$as_me: WARNING: *** link for $linktarget failed - please fix by hand" >&2;}
-  done
-     ;;
- esac
-
  ac_config_headers="$ac_config_headers src/include/pg_config.h"


--- 17974,17979 ----
***************
*** 19200,19203 ****
--- 19181,19197 ----
    # would make configure fail if this is the last instruction.
    $ac_cs_success || { (exit 1); exit 1; }
  fi
+
+
+ # Links sometimes fail undetected on Mingw -
+ # so here we detect it and warn the user
+ case $host_os in mingw*)
+ for FILE in "$CONFIG_LINKS"
+  do
+     # test -e works for symlinks in the MinGW console
+     test -e `expr "$FILE" : '\(^:*\)'` || { echo "$as_me:$LINENO: WARNING: *** link for $FILE - please fix by hand"
>&5
+ echo "$as_me: WARNING: *** link for $FILE - please fix by hand" >&2;}
+  done
+     ;;
+ esac

Index: configure.in
===================================================================
RCS file: /cvsroot/pgsql-server/configure.in,v
retrieving revision 1.347
diff -c -c -r1.347 configure.in
*** configure.in    13 May 2004 01:45:02 -0000    1.347
--- configure.in    13 May 2004 22:56:39 -0000
***************
*** 1236,1263 ****
    src/Makefile.port:src/makefiles/Makefile.${template}
  ])

  # Links sometimes fail undetected on Mingw -
  # so here we detect it and warn the user
  case $host_os in mingw*)
!  for linktarget in \
!     src/backend/port/tas.s \
!     src/backend/port/dynloader.c \
!     src/backend/port/pg_sema.c \
!     src/backend/port/pg_shmem.c \
!     src/include/dynloader.h \
!     src/include/pg_config_os.h \
!     src/Makefile.port
   do
      # test -e works for symlinks in the MinGW console
!     test -e $linktarget || AC_MSG_WARN([*** link for $linktarget failed - please fix by hand])
   done
      ;;
  esac

- AC_CONFIG_HEADERS([src/include/pg_config.h],
- [
- # Update timestamp for pg_config.h (see Makefile.global)
- echo >src/include/stamp-h
- ])
-
- AC_OUTPUT
--- 1236,1257 ----
    src/Makefile.port:src/makefiles/Makefile.${template}
  ])

+ AC_CONFIG_HEADERS([src/include/pg_config.h],
+ [
+ # Update timestamp for pg_config.h (see Makefile.global)
+ echo >src/include/stamp-h
+ ])
+
+ AC_OUTPUT
+
  # Links sometimes fail undetected on Mingw -
  # so here we detect it and warn the user
  case $host_os in mingw*)
! for FILE in "$CONFIG_LINKS"
   do
      # test -e works for symlinks in the MinGW console
!     test -e `expr "$FILE" : '\([^:]*\)'` || AC_MSG_WARN([*** link for $FILE - please fix by hand])
   done
      ;;
  esac


Re: mingw configure failure detection

From
Bruce Momjian
Date:
Andrew Dunstan wrote:
> following up our conversation last night, I have tested the following
> with autoconf 2.57 and it apparently does the right thing:
>
> # Links sometimes fail undetected on Mingw -
> # so here we detect it and warn the user
> case $host_os in mingw*)
> AC_CONFIG_COMMANDS([default],[
>   for linkspec in : $config_links; do test "x$linkspec" = x: && continue
>     linktry=`echo "$linkspec" | sed 's,:.*,,'`
>     test -e $linktry || AC_MSG_WARN([ link for $linktry failed - please
> fix by hand])
>   done
> ])
> ;;
> esac

OK, got it working nicely:

    case $host_os in mingw*)
    AC_CONFIG_COMMANDS([check_win32_symlinks],[
    # Links sometimes fail undetected on Mingw -
    # so here we detect it and warn the user
    for FILE in "$CONFIG_LINKS"
     do
            # test -e works for symlinks in the MinGW console
            test -e `expr "$FILE" : '\(^:*\)'` || AC_MSG_WARN([*** link for
    $FILE - please fix by hand])
     done
    ])
            ;;
    esac

Applied.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: mingw configure failure detection

From
Andrew Dunstan
Date:
Bruce Momjian wrote:

>Andrew Dunstan wrote:
>
>
>>following up our conversation last night, I have tested the following
>>with autoconf 2.57 and it apparently does the right thing:
>>
>># Links sometimes fail undetected on Mingw -
>># so here we detect it and warn the user
>>case $host_os in mingw*)
>>AC_CONFIG_COMMANDS([default],[
>>  for linkspec in : $config_links; do test "x$linkspec" = x: && continue
>>    linktry=`echo "$linkspec" | sed 's,:.*,,'`
>>    test -e $linktry || AC_MSG_WARN([ link for $linktry failed - please
>>fix by hand])
>>  done
>>])
>>;;
>>esac
>>
>>
>
>OK, got it working nicely:
>
>    case $host_os in mingw*)
>    AC_CONFIG_COMMANDS([check_win32_symlinks],[
>    # Links sometimes fail undetected on Mingw -
>    # so here we detect it and warn the user
>    for FILE in "$CONFIG_LINKS"
>
>

The quotes in the line above are spurious and need to be removed - they
inhibit expansion of the variable into words, which is needed. I have
checked that with the quotes removed the macro works correctly.

cheers

andrew

>     do
>            # test -e works for symlinks in the MinGW console
>            test -e `expr "$FILE" : '\(^:*\)'` || AC_MSG_WARN([*** link for
>    $FILE - please fix by hand])
>     done
>    ])
>            ;;
>    esac
>
>Applied.
>
>
>


Re: mingw configure failure detection

From
Bruce Momjian
Date:
OK, fixed.

---------------------------------------------------------------------------

Andrew Dunstan wrote:
> Bruce Momjian wrote:
>
> >Andrew Dunstan wrote:
> >
> >
> >>following up our conversation last night, I have tested the following
> >>with autoconf 2.57 and it apparently does the right thing:
> >>
> >># Links sometimes fail undetected on Mingw -
> >># so here we detect it and warn the user
> >>case $host_os in mingw*)
> >>AC_CONFIG_COMMANDS([default],[
> >>  for linkspec in : $config_links; do test "x$linkspec" = x: && continue
> >>    linktry=`echo "$linkspec" | sed 's,:.*,,'`
> >>    test -e $linktry || AC_MSG_WARN([ link for $linktry failed - please
> >>fix by hand])
> >>  done
> >>])
> >>;;
> >>esac
> >>
> >>
> >
> >OK, got it working nicely:
> >
> >    case $host_os in mingw*)
> >    AC_CONFIG_COMMANDS([check_win32_symlinks],[
> >    # Links sometimes fail undetected on Mingw -
> >    # so here we detect it and warn the user
> >    for FILE in "$CONFIG_LINKS"
> >
> >
>
> The quotes in the line above are spurious and need to be removed - they
> inhibit expansion of the variable into words, which is needed. I have
> checked that with the quotes removed the macro works correctly.
>
> cheers
>
> andrew
>
> >     do
> >            # test -e works for symlinks in the MinGW console
> >            test -e `expr "$FILE" : '\(^:*\)'` || AC_MSG_WARN([*** link for
> >    $FILE - please fix by hand])
> >     done
> >    ])
> >            ;;
> >    esac
> >
> >Applied.
> >
> >
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073