Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d72ef8

Browse files
committed
Miscellaneous Cygwin build fixes from Reini Urban.
1 parentede8f4e commit5d72ef8

File tree

5 files changed

+34
-12
lines changed

5 files changed

+34
-12
lines changed

‎contrib/spi/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/spi/Makefile,v 1.24 2004/08/20 20:13:08 momjian Exp $
1+
# $PostgreSQL: pgsql/contrib/spi/Makefile,v 1.25 2004/11/17 17:45:59 tgl Exp $
22

33
MODULES = autoinc insert_username moddatetime refint timetravel
44
DATA_built =$(addsuffix .sql,$(MODULES))
@@ -17,3 +17,5 @@ top_builddir = ../..
1717
include$(top_builddir)/src/Makefile.global
1818
include$(top_srcdir)/contrib/contrib-global.mk
1919
endif
20+
21+
SHLIB_LINK += -L$(top_builddir)/src/port -lpgport

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.46 2004/11/1716:34:42 tgl Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.47 2004/11/1717:46:12 tgl Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -22,6 +22,7 @@
2222
#include"getopt_long.h"
2323

2424
#if defined(__CYGWIN__)
25+
#include<sys/cygwin.h>
2526
#include<windows.h>
2627
/* Cygwin defines WIN32 in windows.h, but we don't want it. */
2728
#undef WIN32
@@ -820,6 +821,9 @@ pgwin32_CommandLine(bool registration)
820821
{
821822
staticcharcmdLine[MAXPGPATH];
822823
intret;
824+
#ifdef__CYGWIN__
825+
charbuf[MAXPGPATH];
826+
#endif
823827

824828
if (registration)
825829
{
@@ -840,6 +844,12 @@ pgwin32_CommandLine(bool registration)
840844
}
841845
}
842846

847+
#ifdef__CYGWIN__
848+
/* need to convert to windows path */
849+
cygwin_conv_to_full_win32_path(cmdLine,buf);
850+
strcpy(cmdLine,buf);
851+
#endif
852+
843853
if (registration)
844854
{
845855
if (strcasecmp(cmdLine+strlen(cmdLine)-4,".exe"))

‎src/include/port.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.66 2004/11/08 16:34:23 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.67 2004/11/17 17:46:15 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -73,9 +73,13 @@ extern int find_other_exec(const char *argv0, const char *target,
7373

7474
#if defined(WIN32)|| defined(__CYGWIN__)
7575
#defineEXE ".exe"
76-
#defineDEVNULL "nul"
7776
#else
7877
#defineEXE ""
78+
#endif
79+
80+
#if defined(WIN32)&& !defined(__CYGWIN__)
81+
#defineDEVNULL "nul"
82+
#else
7983
#defineDEVNULL "/dev/null"
8084
#endif
8185

@@ -88,13 +92,13 @@ extern int find_other_exec(const char *argv0, const char *target,
8892
*See the "Notes" section about quotes at:
8993
*http://home.earthlink.net/~rlively/MANUALS/COMMANDS/C/CMD.HTM
9094
*/
91-
#ifdefWIN32
95+
#if defined(WIN32)&& !defined(__CYGWIN__)
9296
#defineSYSTEMQUOTE "\""
9397
#else
9498
#defineSYSTEMQUOTE ""
9599
#endif
96100

97-
#ifdefWIN32
101+
#if defined(WIN32)&& !defined(__CYGWIN__)
98102
#defineHOMEDIR "USERPROFILE"
99103
#else
100104
#defineHOMEDIR "HOME"
@@ -163,8 +167,9 @@ extern intpgunlink(const char *path);
163167
*Cygwin has its own symlinks which work on Win95/98/ME where
164168
*junction points don't, so use it instead. We have no way of
165169
*knowing what type of system Cygwin binaries will be run on.
170+
* Note: Some CYGWIN includes might #define WIN32.
166171
*/
167-
#ifdefWIN32
172+
#if defined(WIN32)&& !defined(__CYGWIN__)
168173
externintpgsymlink(constchar*oldpath,constchar*newpath);
169174
#definesymlink(oldpath,newpath)pgsymlink(oldpath, newpath)
170175
#endif
@@ -173,7 +178,7 @@ extern intpgsymlink(const char *oldpath, const char *newpath);
173178

174179
externboolrmtree(char*path,boolrmtopdir);
175180

176-
#ifdefWIN32
181+
#if defined(WIN32)&& !defined(__CYGWIN__)
177182

178183
/* open() replacement to allow delete of held files */
179184
#ifndefWIN32_CLIENT_ONLY
@@ -266,7 +271,7 @@ extern void srandom(unsigned int seed);
266271
/* thread.h */
267272
externchar*pqStrerror(interrnum,char*strerrbuf,size_tbuflen);
268273

269-
#ifndefWIN32
274+
#if !defined(WIN32)|| defined(__CYGWIN__)
270275
externintpqGetpwuid(uid_tuid,structpasswd*resultbuf,char*buffer,
271276
size_tbuflen,structpasswd**result);
272277
#endif

‎src/interfaces/libpq/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.120 2004/10/16 22:52:49 tgl Exp $
8+
# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.121 2004/11/17 17:46:19 tgl Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -31,6 +31,10 @@ OBJS=fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
3131
md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o\
3232
$(filter crypt.o getaddrinfo.o inet_aton.o open.o snprintf.o strerror.o,$(LIBOBJS))
3333

34+
ifeq ($(PORTNAME), cygwin)
35+
overrideshlib = cyg$(NAME)$(DLSUFFIX)
36+
endif
37+
3438
ifeq ($(PORTNAME), win32)
3539
OBJS += win32.o libpqrc.o
3640
libpqrc.o : libpq.rc

‎src/template/cygwin

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ SRCH_LIB="/usr/local/lib"
22

33
# This is required to link pg_dump because it finds pg_toupper() in
44
# libpq and pgport
5-
LDFLAGS="-Wl,--allow-multiple-definition"
6-
5+
LDFLAGS="-Wl,--allow-multiple-definition -Wl,--enable-auto-import"
6+
# --enable-auto-import gets rid of a diagnostics linker message
7+
LDFLAGS_SL="-Wl,--enable-auto-import"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp