mirror of https://github.com/postgres/postgres
configure under native Windows (MinGW that is), but you won't get very far compiling yet. The dynaloader files are from Jan Wieck's patch set.WIN32_DEV
parent
93331d8318
commit
1a7f4ed525
@ -0,0 +1 @@ |
||||
/* Dummy file used for nothing at this point; see cygwin.h */ |
||||
@ -0,0 +1,36 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* Dynamic loader declarations for Cygwin |
||||
* |
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/cygwin.h,v 1.1 2003/03/21 17:18:34 petere Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef PORT_PROTOS_H |
||||
#define PORT_PROTOS_H |
||||
|
||||
#include <dlfcn.h> |
||||
#include "utils/dynamic_loader.h" |
||||
|
||||
/*
|
||||
* In some older systems, the RTLD_NOW flag isn't defined and the mode |
||||
* argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted |
||||
* if available, but it doesn't exist everywhere. |
||||
* If it doesn't exist, set it to 0 so it has no effect. |
||||
*/ |
||||
#ifndef RTLD_NOW |
||||
#define RTLD_NOW 1 |
||||
#endif |
||||
#ifndef RTLD_GLOBAL |
||||
#define RTLD_GLOBAL 0 |
||||
#endif |
||||
|
||||
#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL) |
||||
#define pg_dlsym dlsym |
||||
#define pg_dlclose dlclose |
||||
#define pg_dlerror dlerror |
||||
|
||||
#endif /* PORT_PROTOS_H */ |
||||
@ -1,4 +1,27 @@ |
||||
/* Dummy file used for nothing at this point
|
||||
* |
||||
* see win.h |
||||
*/ |
||||
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/win.c,v 1.2 2003/03/21 17:18:34 petere Exp $ */ |
||||
|
||||
#include <windows.h> |
||||
|
||||
char * |
||||
dlerror(void) |
||||
{ |
||||
return "error"; |
||||
} |
||||
|
||||
int |
||||
dlclose(void *handle) |
||||
{ |
||||
return FreeLibrary((HMODULE)handle) ? 0 : 1; |
||||
} |
||||
|
||||
void * |
||||
dlsym(void *handle, const char *symbol) |
||||
{ |
||||
return (void *)GetProcAddress((HMODULE)handle, symbol); |
||||
} |
||||
|
||||
void * |
||||
dlopen(const char *path, int mode) |
||||
{ |
||||
return (void *)LoadLibrary(path); |
||||
} |
||||
|
||||
@ -0,0 +1,26 @@ |
||||
/* $Header: /cvsroot/pgsql/src/include/port/cygwin.h,v 1.1 2003/03/21 17:18:34 petere Exp $ */ |
||||
|
||||
#define HAS_TEST_AND_SET |
||||
typedef unsigned char slock_t; |
||||
|
||||
#define tzname _tzname /* should be in time.h? */ |
||||
#define HAVE_INT_TIMEZONE /* has int _timezone */ |
||||
|
||||
#include <cygwin/version.h> |
||||
|
||||
/*
|
||||
* Check for b20.1 and disable AF_UNIX family socket support. |
||||
*/ |
||||
#if CYGWIN_VERSION_DLL_MAJOR < 1001 |
||||
#undef HAVE_UNIX_SOCKETS |
||||
#endif |
||||
|
||||
#if __GNUC__ && ! defined (__declspec) |
||||
#error You need egcs 1.1 or newer for compiling! |
||||
#endif |
||||
|
||||
#ifdef BUILDING_DLL |
||||
#define DLLIMPORT __declspec (dllexport) |
||||
#else |
||||
#define DLLIMPORT __declspec (dllimport) |
||||
#endif |
||||
@ -0,0 +1,37 @@ |
||||
# $Header: /cvsroot/pgsql/src/makefiles/Makefile.cygwin,v 1.1 2003/03/21 17:18:34 petere Exp $
|
||||
DLLTOOL= dlltool
|
||||
DLLWRAP= dllwrap
|
||||
BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
|
||||
DLLINIT = $(top_builddir)/src/utils/dllinit.o
|
||||
|
||||
# linking with -lm or -lc causes program to crash
|
||||
# (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110)
|
||||
LIBS:=$(filter-out -lm -lc, $(LIBS))
|
||||
|
||||
AROPT = crs
|
||||
DLSUFFIX = .dll
|
||||
CFLAGS_SL =
|
||||
|
||||
%.dll: %.o |
||||
$(DLLTOOL) --export-all --output-def $*.def $<
|
||||
$(DLLWRAP) -o $@ --def $*.def $< $(DLLINIT) $(SHLIB_LINK)
|
||||
rm -f $*.def
|
||||
|
||||
ifneq (,$(findstring backend,$(subdir))) |
||||
ifeq (,$(findstring conversion_procs,$(subdir))) |
||||
override CPPFLAGS+= -DBUILDING_DLL
|
||||
endif |
||||
endif |
||||
|
||||
ifneq (,$(findstring ecpg/lib,$(subdir))) |
||||
override CPPFLAGS+= -DBUILDING_DLL
|
||||
endif |
||||
|
||||
# required by Python headers
|
||||
ifneq (,$(findstring src/pl/plpython,$(subdir))) |
||||
override CPPFLAGS+= -DUSE_DL_IMPORT
|
||||
endif |
||||
|
||||
override javadir := '$(shell cygpath -w $(javadir))' |
||||
|
||||
sqlmansect = 7
|
||||
@ -0,0 +1,2 @@ |
||||
CFLAGS=-O2 |
||||
SRCH_LIB=/usr/local/lib |
||||
@ -1,2 +1,3 @@ |
||||
CFLAGS=-O2 |
||||
SRCH_LIB=/usr/local/lib |
||||
if test "$GCC" = yes; then |
||||
CFLAGS=-O2 |
||||
fi |
||||
|
||||
Loading…
Reference in new issue