Commit 337da067 authored by Peter Eisentraut's avatar Peter Eisentraut

Assorted fixes for Cygwin:

Eliminate the mysterious games that the Cygwin build plays with the linker
flag variables.  DLLLIBS is gone, use SHLIB_LINK like everyone else.
Detect cygipc in configure, after the linker flags are set up, otherwise
configure might not work at all.

Make sure everything is covered by make clean.

Fix the build of the new conversion procedure modules.

Add new DLLIMPORT markers where required.

Finally, the compiler complains if we use an explicit
-I/usr/local/include, so don't do that.  Curiously, -L/usr/local/lib is
still necessary.
parent a11ea5e2
dnl Process this file with autoconf to produce a configure script.
dnl $Header: /cvsroot/pgsql/configure.in,v 1.205 2002/09/04 22:54:18 petere Exp $
dnl $Header: /cvsroot/pgsql/configure.in,v 1.206 2002/09/05 18:28:45 petere Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
......@@ -614,6 +614,8 @@ AC_SEARCH_LIBS(crypt, crypt)
AC_CHECK_LIB(bind, __inet_ntoa)
# Solaris:
AC_SEARCH_LIBS(fdatasync, [rt posix4])
# Cygwin:
AC_CHECK_LIB(cygipc, shmget)
if test "$with_readline" = yes; then
PGAC_CHECK_READLINE
......
# $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.2 2001/09/16 16:11:08 petere Exp $
# $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.3 2002/09/05 18:28:45 petere Exp $
# This file contains generic rules to build many kinds of simple
# contrib modules. You only need to set a few variables and include
......@@ -45,7 +45,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
ifdef MODULES
override CFLAGS += $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
SHLIB_LINK += $(BE_DLLLIBS)
endif
ifdef PG_CPPFLAGS
......@@ -61,7 +61,7 @@ SO_MAJOR_VERSION= 0
SO_MINOR_VERSION= 0
rpath =
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
SHLIB_LINK += $(BE_DLLLIBS)
include $(top_srcdir)/src/Makefile.shlib
......
......@@ -16,7 +16,7 @@ SCRIPTS = InitRservTest
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
override CFLAGS += $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
SHLIB_LINK = $(BE_DLLLIBS)
all: $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(SONAME)
......
......@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/Makefile,v 1.28 2002/09/04 15:45:50 tgl Exp $
# $Header: /cvsroot/pgsql/src/Makefile,v 1.29 2002/09/05 18:28:45 petere Exp $
#
#-------------------------------------------------------------------------
......@@ -34,6 +34,7 @@ clean:
$(MAKE) -C pl $@
$(MAKE) -C test $@
$(MAKE) -C tutorial $@
$(MAKE) -C utils $@
distclean maintainer-clean:
-$(MAKE) -C port $@
......@@ -44,4 +45,5 @@ distclean maintainer-clean:
-$(MAKE) -C pl $@
-$(MAKE) -C test $@
-$(MAKE) -C tutorial $@
-$(MAKE) -C utils $@
rm -f Makefile.port Makefile.global
......@@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.63 2002/09/04 22:54:18 petere Exp $
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.64 2002/09/05 18:28:46 petere Exp $
#
#-------------------------------------------------------------------------
......@@ -276,7 +276,7 @@ else # PORTNAME == win
# WIN case
$(shlib) lib$(NAME).a: $(OBJS) $(DLLINIT)
$(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS)
$(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(DLLINIT) $(DLLLIBS) $(SHLIB_LINK)
$(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(DLLINIT) $(SHLIB_LINK)
$(DLLTOOL) --dllname $(shlib) --def $(NAME).def --output-lib lib$(NAME).a
$(DLLINIT): $(DLLINIT:%.o=%.c)
......@@ -353,5 +353,5 @@ ifdef EXPSUFF
endif
endif
ifeq ($(PORTNAME), win)
rm -rf $(NAME).def
rm -f $(NAME).dll $(NAME).def
endif
......@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.86 2002/09/04 15:45:50 tgl Exp $
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.87 2002/09/05 18:28:46 petere Exp $
#
#-------------------------------------------------------------------------
......@@ -40,10 +40,16 @@ else # win
postgres: $(OBJS) $(DLLINIT) postgres.def libpostgres.a
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
$(CC) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(DLLLIBS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(LIBS)
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
$(CC) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(DLLLIBS)
rm $@.exp $@.base
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(LIBS)
rm -f $@.exp $@.base
postgres.def: $(OBJS)
$(DLLTOOL) --export-all --output-def $@ $^
libpostgres.a: postgres.def
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
endif # win
......@@ -57,17 +63,6 @@ $(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir
$(MAKE) -C $(subst -recursive,,$@) all
ifeq ($(MAKE_DLL), true)
postgres.def: $(OBJS)
$(DLLTOOL) --export-all --output-def $@ $(OBJS)
libpostgres.a: $(OBJS) $(DLLINIT) postgres.def
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
endif # MAKE_DLL
$(DLLINIT): $(DLLINIT:%.o=%.c)
$(MAKE) -C $(@D) $(@F)
......@@ -169,9 +164,7 @@ clean:
$(top_srcdir)/src/include/parser/parse.h \
$(top_builddir)/src/include/utils/fmgroids.h
ifeq ($(PORTNAME), win)
ifeq ($(MAKE_DLL), true)
rm -f postgres.dll postgres.def libpostgres.a
endif
endif
for i in $(DIRS); do $(MAKE) -C $$i clean || exit; done
......
SRCS += $(NAME).c
OBJS += $(NAME).o
PG_CPPFLAGS :=
SHLIB_LINK := $(BE_DLLLIBS)
SO_MAJOR_VERSION := 0
......@@ -18,4 +17,4 @@ install: all
uninstall: uninstall-lib
clean distclean maintainer-clean: clean-lib
$(RM) $(OBJS)
rm -f $(OBJS)
......@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.109 2002/09/04 20:31:36 momjian Exp $
* $Id: miscadmin.h,v 1.110 2002/09/05 18:28:46 petere Exp $
*
* NOTES
* some of the information in this file should be moved to
......@@ -62,7 +62,7 @@
/* in globals.c */
/* these are marked volatile because they are set by signal handlers: */
extern volatile bool InterruptPending;
extern DLLIMPORT volatile bool InterruptPending;
extern volatile bool QueryCancelPending;
extern volatile bool ProcDiePending;
......@@ -166,7 +166,7 @@ extern char DateFormat[];
extern bool enableFsync;
extern bool allowSystemTableMods;
extern int SortMem;
extern DLLIMPORT int SortMem;
extern int VacuumMem;
/*
......
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.17 2002/07/27 20:10:05 petere Exp $
LDFLAGS+= -g
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.18 2002/09/05 18:28:46 petere Exp $
DLLTOOL= dlltool
DLLWRAP= dllwrap
DLLLIBS= -lcygipc -lcrypt
BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
DLLINIT = $(top_builddir)/src/utils/dllinit.o
MK_NO_LORDER=true
MAKE_DLL=true
#MAKE_DLL=false
# 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))
......@@ -18,22 +14,21 @@ CFLAGS_SL =
%.dll: %.o
$(DLLTOOL) --export-all --output-def $*.def $<
$(DLLWRAP) -o $@ --def $*.def $< $(DLLINIT) $(DLLLIBS)
$(DLLWRAP) -o $@ --def $*.def $< $(DLLINIT) $(SHLIB_LINK)
rm -f $*.def
ifeq ($(findstring backend,$(subdir)), backend)
override CPPFLAGS+= -DBUILDING_DLL=1
ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir)))
override CPPFLAGS+= -DBUILDING_DLL
endif
ifeq ($(findstring ecpg/lib,$(subdir)), ecpg/lib)
override CPPFLAGS+= -DBUILDING_DLL=1
endif
ifeq ($(findstring interfaces/libpq++,$(subdir)), interfaces/libpq++)
override CPPFLAGS+= -DBUILDING_DLL=1
ifneq (,$(findstring ecpg/lib,$(subdir)))
override CPPFLAGS+= -DBUILDING_DLL
endif
ifeq ($(findstring src/pl/plpython,$(subdir)), src/pl/plpython)
# required by Python headers
ifneq (,$(findstring src/pl/plpython,$(subdir)))
override CPPFLAGS+= -DUSE_DL_IMPORT
endif
......
......@@ -2,7 +2,7 @@
#
# Makefile for the plpgsql shared object
#
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.21 2002/08/30 00:28:41 tgl Exp $
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.22 2002/09/05 18:28:46 petere Exp $
#
#-------------------------------------------------------------------------
......@@ -20,7 +20,7 @@ SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
SHLIB_LINK = $(BE_DLLLIBS)
rpath :=
OBJS = pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
......
# $Header: /cvsroot/pgsql/src/pl/plpython/Makefile,v 1.10 2001/09/16 16:11:11 petere Exp $
# $Header: /cvsroot/pgsql/src/pl/plpython/Makefile,v 1.11 2002/09/05 18:28:46 petere Exp $
subdir = src/pl/plpython
top_builddir = ../../..
......@@ -17,7 +17,6 @@ endif
ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib)))
override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
rpath :=
NAME = plpython
......@@ -25,7 +24,7 @@ SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
OBJS = plpython.o
SHLIB_LINK += $(python_libspec)
SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec)
include $(top_srcdir)/src/Makefile.shlib
......
CFLAGS=-O2
SRCH_INC=/usr/local/include
SRCH_LIB=/usr/local/lib
LIBS=-lcygipc
......@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.39 2002/09/03 21:45:44 petere Exp $
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.40 2002/09/05 18:28:46 petere Exp $
#
#-------------------------------------------------------------------------
......@@ -20,7 +20,7 @@ contribdir := $(top_builddir)/contrib
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
SHLIB_LINK = $(BE_DLLLIBS)
# default encoding
MULTIBYTE = SQL_ASCII
......
......@@ -4,7 +4,7 @@
# Makefile for tutorial
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.15 2002/07/30 17:47:58 tgl Exp $
# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.16 2002/09/05 18:28:46 petere Exp $
#
#-------------------------------------------------------------------------
......@@ -13,7 +13,7 @@ top_builddir = ../..
include $(top_builddir)/src/Makefile.global
override CFLAGS+= $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
SHLIB_LINK = $(BE_DLLLIBS)
#
# DLOBJS are the dynamically-loaded object files. The "funcs" queries
......
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