Re: timezone changes break windows and cygwin - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: timezone changes break windows and cygwin
Date
Msg-id 200507051724.j65HO2l02476@candle.pha.pa.us
Whole thread Raw
In response to timezone changes break windows and cygwin  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: timezone changes break windows and cygwin
List pgsql-hackers
Andrew Dunstan wrote:
>
> The latest timezone lib changes seem to have broken Windows and Cygwin
> builds comprehensively. I assume that this checkin caused the problem:
>
> http://archives.postgresql.org/pgsql-committers/2005-07/msg00155.php :
>
> Restructure zic #define fprintf checks to use a NO_PGPORT macro instead.

Actually, that patch was to fix my unix build.  The big change was that
zic no longer uses pgport routines, and that was done by someone else so
zic would be run on the target matchine for cross-platform builds.

I have applied the attached patch which should fix the problems you saw.
It basically extends NO_PGPORT, which I expected might be required when
I added it.

---------------------------------------------------------------------------
>
>
> Extracts from buildfarm logs:
>
> Windows:
>
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -fno-strict-aliasing -g zic.o ialloc.o scheck.o localtime-zic.o -o
zic.exe
> zic.o(.text+0xe99): In function `dolink':
> C:/msys/1.0/home/pgbf/pgbuildfarm/HEAD/pgsql.8032/src/timezone/zic.c:634: undefined reference to `pgsymlink'
> zic.o(.text+0xed5):C:/msys/1.0/home/pgbf/pgbuildfarm/HEAD/pgsql.8032/src/timezone/zic.c:613: undefined reference to
`pgunlink'
> zic.o(.text+0x36ed): In function `writezone':
> C:/msys/1.0/home/pgbf/pgbuildfarm/HEAD/pgsql.8032/src/timezone/zic.c:1580: undefined reference to `pgunlink'
> localtime-zic.o(.text+0x14c): In function `tzload':
> C:/msys/1.0/home/pgbf/pgbuildfarm/HEAD/pgsql.8032/src/timezone/localtime-zic.c:161: undefined reference to
`win32_open'
>
>
> Cygwin:
>
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -fno-strict-aliasing -g zic.o ialloc.o scheck.o
localtime-zic.o-o zic.exe 
> zic.o(.text+0x86c): In function `dolink':
> /home/jim/pgbuildfarm/HEAD/pgsql.7860/src/timezone/zic.c:613: undefined reference to `_pgunlink'
> zic.o(.text+0x261a): In function `writezone':
> /home/jim/pgbuildfarm/HEAD/pgsql.7860/src/timezone/zic.c:1562: undefined reference to `_pgunlink'
> collect2: ld returned 1 exit status
>
>
> cheers
>
> andrew
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
  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: src/include/port.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/port.h,v
retrieving revision 1.77
diff -c -c -r1.77 port.h
*** src/include/port.h    4 Jul 2005 19:54:51 -0000    1.77
--- src/include/port.h    5 Jul 2005 17:08:17 -0000
***************
*** 178,184 ****
  #define TZNAME_GLOBAL _tzname
  #endif

! #if defined(WIN32) || defined(__CYGWIN__)
  /*
   *    Win32 doesn't have reliable rename/unlink during concurrent access,
   *    and we need special code to do symlinks.
--- 178,184 ----
  #define TZNAME_GLOBAL _tzname
  #endif

! #if (defined(WIN32) || defined(__CYGWIN__)) && !defined(NO_PGPORT)
  /*
   *    Win32 doesn't have reliable rename/unlink during concurrent access,
   *    and we need special code to do symlinks.
***************
*** 204,214 ****
  #define symlink(oldpath, newpath)    pgsymlink(oldpath, newpath)
  #endif

! #endif /* defined(WIN32) || defined(__CYGWIN__) */

  extern bool rmtree(char *path, bool rmtopdir);

! #if defined(WIN32) && !defined(__CYGWIN__)

  /* open() replacement to allow delete of held files and passing
   * of special options. */
--- 204,214 ----
  #define symlink(oldpath, newpath)    pgsymlink(oldpath, newpath)
  #endif

! #endif /* defined(WIN32) || defined(__CYGWIN__) && !defined(NO_PGPORT) */

  extern bool rmtree(char *path, bool rmtopdir);

! #if defined(WIN32) && !defined(__CYGWIN__) && !defined(NO_PGPORT)

  /* open() replacement to allow delete of held files and passing
   * of special options. */

pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: pgcrypto 3des failure, OpenSSL 0.9.8, Solaris 9/sparc
Next
From: "Jim C. Nasby"
Date:
Subject: Re: [PATCHES] HEAD doesn't cope with libraries in non-default