Commit 664ce79d authored by Peter Eisentraut's avatar Peter Eisentraut

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.
parent f5ab0169
# Macros that test various C library quirks
# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.1 2000/06/11 11:39:46 petere Exp $
# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.2 2000/09/27 15:17:52 petere Exp $
# PGAC_VAR_INT_TIMEZONE
......@@ -49,10 +49,28 @@ AC_DEFUN([PGAC_UNION_SEMUN],
[pgac_cv_union_semun=yes],
[pgac_cv_union_semun=no])])
if test x"$pgac_cv_union_semun" = xyes ; then
AC_DEFINE(HAVE_UNION_SEMUN,, [Set to 1 if you have `union semun'])
AC_DEFINE(HAVE_UNION_SEMUN, 1, [Set to 1 if you have `union semun'])
fi])# PGAC_UNION_SEMUN
# PGAC_STRUCT_SOCKADDR_UN
# -----------------------
# If `struct sockaddr_un' exists, define HAVE_STRUCT_SOCKADDR_UN. If
# it is missing then one could define it as { short int sun_family;
# char sun_path[108]; }. (Requires test for <sys/un.h>!)
AC_DEFUN([PGAC_STRUCT_SOCKADDR_UN],
[AC_CACHE_CHECK([for struct sockaddr_un], pgac_cv_struct_sockaddr_un,
[AC_TRY_COMPILE([#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif],
[struct sockaddr_un un;],
[pgac_cv_struct_sockaddr_un=yes],
[pgac_cv_struct_sockaddr_un=no])])
if test x"$pgac_cv_struct_sockaddr_un" = xyes; then
AC_DEFINE(HAVE_STRUCT_SOCKADDR_UN, 1, [Set to 1 if you have `struct sockaddr_un'])
fi])# PGAC_STRUCT_SOCKADDR_UN
# PGAC_FUNC_POSIX_SIGNALS
# -----------------------
# Check to see if the machine has the POSIX signal interface. Define
......
This diff is collapsed.
......@@ -243,6 +243,7 @@ AC_PROG_CC
echo "using CFLAGS=$CFLAGS"
# Check if the compiler still works with the template settings
AC_PROG_CC_WORKS
AC_EXEEXT
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
......@@ -658,7 +659,7 @@ fi
## Header files
##
dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h sys/pstat.h sys/select.h sys/socket.h sys/types.h termios.h])
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h netinet/tcp.h pwd.h sys/pstat.h sys/select.h sys/socket.h sys/types.h sys/un.h termios.h])
AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
AC_CHECK_HEADERS([readline/history.h history.h], [break])
......@@ -688,7 +689,7 @@ PGAC_C_SIGNED
PGAC_C_VOLATILE
AC_STRUCT_TIMEZONE
PGAC_UNION_SEMUN
PGAC_STRUCT_SOCKADDR_UN
##
## Functions, global variables
......
This diff is collapsed.
Installing PostgreSQL on Windows NT or Windows 2000
===================================================
$Date: 2000/09/27 15:17:53 $
1. Install the Cygwin package.
The Cygwin package provides a UNIX-like API on top of the Win32
API. It is available at <http://sources.redhat.com/cygwin/>.
The 1.1.x series is recommended (1.1.4 was the latest at the time
of this writing); using 1.0 or B20 might require extra efforts.
For B20 you also need to download the separate crypt library at the
same location.
2. Install the cygipc package, available at
<http://cygutils.netpedia.net/V1.1/cygipc/>. Do not use versions
prior to 1.04, they will not work.
3. Optional: The "Andy Piper Tools" at <http://www.xemacs.freeserve.co.uk/>
are a collection of pre-compiled libraries and utilities that you
might find useful -- especially on Cygwin B20.
4. The Cygwin bin directory has to be placed in the path before the
Windows program directories, because the sort.exe has to be taken
from Cygwin, not Windows.
5. Start `ipc-daemon &' (background process) from the cygipc package.
This program needs to be running anytime you start the PostgreSQL
server (postmaster).
6. Proceed according to the INSTALL file. (./configure; make; etc.)
NOTE: By default, PostgreSQL clients like psql communicate using Unix
domain sockets, which do not work on Windows. Start the postmaster
with -i, and when connecting to the database from a client, set the
PGHOST environment variable to `localhost' or supply the hostname on
the command line.
Problem reports can be sent to <pgsql-ports@postgresql.org>.
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.19 2000/09/25 22:52:49 petere Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.20 2000/09/27 15:17:53 petere Exp $ -->
<chapter id="installation">
<title><![%flattext-install-include[<productname>PostgreSQL</> ]]>Installation Instructions</title>
......@@ -92,6 +92,15 @@ su - postgres
definitely not work.
</para>
</listitem>
<listitem>
<para>
To build on <productname>Windows NT</> or <productname>Windows
2000</> you need the <productname>Cygwin</> and
<productname>cygipc</> packages. See the file
<filename>doc/INSTALL_WIN</> for details.
</para>
</listitem>
</itemizedlist>
</para>
......@@ -100,7 +109,7 @@ su - postgres
it at your local <acronym>GNU</acronym> mirror site (see <ulink
url="http://www.gnu.org/order/ftp.html">http://www.gnu.org/order/ftp.html</>
for a list) or at <ulink
url="ftp://ftp.gnu.org/gnu/make">ftp://ftp.gnu.org/gnu/make</ulink>.
url="ftp://ftp.gnu.org/gnu/">ftp://ftp.gnu.org/gnu/</ulink>.
</para>
<para>
......
# $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
......
......@@ -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"
......
......@@ -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
......
......@@ -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;
......
......@@ -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
......
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
Add the included headers endian.h into Cygwin's include/, tcp.h into
include/netinet, and un.h into include/sys.
#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_ */
#ifndef _INET_TCP_
#define _INET_TCP_
/* JKR added file, all hacks will be in the files added, not in EGCS */
#endif /* _INET_TCP_ */
#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 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment