aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-09-27 15:17:57 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-09-27 15:17:57 +0000
commit664ce79dd84220afbf6c6b727c6280ec85148267 (patch)
treefbed3a54d787b20b3aafc79980ec0bc7807effbb /src
parentf5ab0169231ca69ff194fba191d98e0bcc3e8e72 (diff)
downloadpostgresql-664ce79dd84220afbf6c6b727c6280ec85148267.tar.gz
postgresql-664ce79dd84220afbf6c6b727c6280ec85148267.zip
Fixes for Cygwin, with help from Pete Forman <gsez020@kryten.bedford.waii.com>.
Update the installation instructions (formerly misnamed "FAQ"), add configure checks for some headers rather than having users copy stubs manually (ugh!). Use Autoconf check for exe extension. This also avoids inheriting the value of $(X) from the environment.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in3
-rw-r--r--src/backend/libpq/pqcomm.c10
-rw-r--r--src/include/config.h.in11
-rw-r--r--src/include/libpq/pqcomm.h25
-rw-r--r--src/interfaces/libpq/fe-connect.c9
-rw-r--r--src/makefiles/Makefile.win4
-rw-r--r--src/win32/README3
-rw-r--r--src/win32/endian.h8
-rw-r--r--src/win32/tcp.h6
-rw-r--r--src/win32/un.h12
10 files changed, 42 insertions, 49 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index c5c7f4e815a..a6298e6407e 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.95 2000/09/25 22:22:54 petere Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.96 2000/09/27 15:17:54 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -149,6 +149,7 @@ AWK = @AWK@
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@ @INCLUDES@
GCC = @GCC@
+X = @EXEEXT@
ifeq ($(GCC), yes)
CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index 0f3b3d4295b..d0b10414fde 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pqcomm.c,v 1.100 2000/07/08 03:04:40 tgl Exp $
+ * $Id: pqcomm.c,v 1.101 2000/09/27 15:17:54 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -58,6 +58,8 @@
*
*------------------------
*/
+#include "postgres.h"
+
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
@@ -67,12 +69,12 @@
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
-#include <netinet/tcp.h>
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
#include <arpa/inet.h>
#include <sys/file.h>
-#include "postgres.h"
-
#include "libpq/libpq.h"
#include "miscadmin.h"
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 21ebcaf2297..ad5dd91f04f 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure.
*
- * $Id: config.h.in,v 1.134 2000/08/29 09:36:49 petere Exp $
+ * $Id: config.h.in,v 1.135 2000/09/27 15:17:55 petere Exp $
*/
#ifndef CONFIG_H
@@ -330,6 +330,9 @@
/* Set to 1 if you have <ieeefp.h> */
#undef HAVE_IEEEFP_H
+/* Set to 1 if you have <netinet/tcp.h> */
+#undef HAVE_NETINET_TCP_H
+
/* Set to 1 if you have <readline.h> */
#undef HAVE_READLINE_H
@@ -342,6 +345,9 @@
/* Set to 1 if you have <sys/select.h> */
#undef HAVE_SYS_SELECT_H
+/* Set to 1 if you have <sys/un.h> */
+#undef HAVE_SYS_UN_H
+
/* Set to 1 if you have <termios.h> */
#undef HAVE_TERMIOS_H
@@ -535,6 +541,9 @@ extern void srandom(unsigned int seed);
/* Set to 1 if you have union semun */
#undef HAVE_UNION_SEMUN
+/* Set to 1 if you have struct sockaddr_un */
+#undef HAVE_STRUCT_SOCKADDR_UN
+
/* Set to 1 if you have F_SETLK option for fcntl() */
#undef HAVE_FCNTL_SETLK
diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h
index 1aa8444a9a5..dbe6761576e 100644
--- a/src/include/libpq/pqcomm.h
+++ b/src/include/libpq/pqcomm.h
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pqcomm.h,v 1.41 2000/01/26 05:58:12 momjian Exp $
+ * $Id: pqcomm.h,v 1.42 2000/09/27 15:17:56 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,11 +20,22 @@
#include <sys/types.h>
#ifdef WIN32
-#include "winsock.h"
-#else
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <netinet/in.h>
+# include "winsock.h"
+#else /* not WIN32 */
+# include <sys/socket.h>
+# ifdef HAVE_SYS_UN_H
+# include <sys/un.h>
+# endif
+# include <netinet/in.h>
+#endif /* not WIN32 */
+
+
+#ifndef HAVE_STRUCT_SOCKADDR_UN
+struct sockaddr_un
+{
+ short int sun_family; /* AF_UNIX */
+ char sun_path[108]; /* path name (gag) */
+};
#endif
/* Define a generic socket address type. */
@@ -33,9 +44,7 @@ typedef union SockAddr
{
struct sockaddr sa;
struct sockaddr_in in;
-#ifndef WIN32
struct sockaddr_un un;
-#endif
} SockAddr;
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 7349be66459..2296a2db6ce 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -8,17 +8,18 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.133 2000/08/30 14:54:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.134 2000/09/27 15:17:56 petere Exp $
*
*-------------------------------------------------------------------------
*/
+#include "postgres.h"
+
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
-#include "postgres.h"
#include "libpq-fe.h"
#include "libpq-int.h"
#include "fe-auth.h"
@@ -30,7 +31,9 @@
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
-#include <netinet/tcp.h>
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
#include <arpa/inet.h>
#endif
diff --git a/src/makefiles/Makefile.win b/src/makefiles/Makefile.win
index 45fab0e6e21..2f4d723edd6 100644
--- a/src/makefiles/Makefile.win
+++ b/src/makefiles/Makefile.win
@@ -1,9 +1,7 @@
-CFLAGS+= -I/usr/local/include
LDFLAGS+= -g
DLLTOOL= dlltool
DLLWRAP= dllwrap
DLLLIBS=-L/usr/local/lib -L$(libdir) -L$(top_builddir)/src/backend -lpostgres -lcygipc -lcygwin -lcrypt -lkernel32
-X=.exe
MK_NO_LORDER=true
MAKE_DLL=true
#MAKE_DLL=false
@@ -16,5 +14,5 @@ SHLIB_LINK=$(DLLLIBS)
curdir:=$(shell pwd)
ifeq ($(findstring backend,$(curdir)), backend)
-CFLAGS+= -DBUILDING_DLL=1
+CPPFLAGS+= -DBUILDING_DLL=1
endif
diff --git a/src/win32/README b/src/win32/README
deleted file mode 100644
index 0e1383f93dc..00000000000
--- a/src/win32/README
+++ /dev/null
@@ -1,3 +0,0 @@
-Add the included headers endian.h into Cygwin's include/, tcp.h into
-include/netinet, and un.h into include/sys.
-
diff --git a/src/win32/endian.h b/src/win32/endian.h
deleted file mode 100644
index 44007a10431..00000000000
--- a/src/win32/endian.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ENDIAN_H_
-#define _ENDIAN_H_
-
-/* JKR added file, all hacks will be in the files added, not in EGCS */
-
-#include <sys/param.h>
-
-#endif /* _ENDIAN_H_ */
diff --git a/src/win32/tcp.h b/src/win32/tcp.h
deleted file mode 100644
index 48de4ad556f..00000000000
--- a/src/win32/tcp.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _INET_TCP_
-#define _INET_TCP_
-
-/* JKR added file, all hacks will be in the files added, not in EGCS */
-
-#endif /* _INET_TCP_ */
diff --git a/src/win32/un.h b/src/win32/un.h
deleted file mode 100644
index 971a6fb2f54..00000000000
--- a/src/win32/un.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _SYS_UN_H
-#define _SYS_UN_H
-
-/* JKR added file, all hacks will be in the files added, not in EGCS */
-
-struct sockaddr_un
-{
- short sun_family; /* AF_UNIX */
- char sun_path[108]; /* path name (gag) */
-};
-
-#endif /* _SYS_UN_H */