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.
This commit is contained in:
Peter Eisentraut 2002-09-05 18:28:46 +00:00
parent a11ea5e2a3
commit 337da0678a
14 changed files with 46 additions and 58 deletions

View File

@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script. 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
dnl Developers, please strive to achieve this order: dnl Developers, please strive to achieve this order:
dnl dnl
@ -614,6 +614,8 @@ AC_SEARCH_LIBS(crypt, crypt)
AC_CHECK_LIB(bind, __inet_ntoa) AC_CHECK_LIB(bind, __inet_ntoa)
# Solaris: # Solaris:
AC_SEARCH_LIBS(fdatasync, [rt posix4]) AC_SEARCH_LIBS(fdatasync, [rt posix4])
# Cygwin:
AC_CHECK_LIB(cygipc, shmget)
if test "$with_readline" = yes; then if test "$with_readline" = yes; then
PGAC_CHECK_READLINE PGAC_CHECK_READLINE

View File

@ -1,4 +1,4 @@
# $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 # This file contains generic rules to build many kinds of simple
# contrib modules. You only need to set a few variables and include # contrib modules. You only need to set a few variables and include
@ -45,7 +45,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
ifdef MODULES ifdef MODULES
override CFLAGS += $(CFLAGS_SL) override CFLAGS += $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) SHLIB_LINK += $(BE_DLLLIBS)
endif endif
ifdef PG_CPPFLAGS ifdef PG_CPPFLAGS
@ -61,7 +61,7 @@ SO_MAJOR_VERSION= 0
SO_MINOR_VERSION= 0 SO_MINOR_VERSION= 0
rpath = rpath =
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) SHLIB_LINK += $(BE_DLLLIBS)
include $(top_srcdir)/src/Makefile.shlib include $(top_srcdir)/src/Makefile.shlib

View File

@ -16,7 +16,7 @@ SCRIPTS = InitRservTest
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
override CFLAGS += $(CFLAGS_SL) override CFLAGS += $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) SHLIB_LINK = $(BE_DLLLIBS)
all: $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(SONAME) all: $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(SONAME)

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # 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 pl $@
$(MAKE) -C test $@ $(MAKE) -C test $@
$(MAKE) -C tutorial $@ $(MAKE) -C tutorial $@
$(MAKE) -C utils $@
distclean maintainer-clean: distclean maintainer-clean:
-$(MAKE) -C port $@ -$(MAKE) -C port $@
@ -44,4 +45,5 @@ distclean maintainer-clean:
-$(MAKE) -C pl $@ -$(MAKE) -C pl $@
-$(MAKE) -C test $@ -$(MAKE) -C test $@
-$(MAKE) -C tutorial $@ -$(MAKE) -C tutorial $@
-$(MAKE) -C utils $@
rm -f Makefile.port Makefile.global rm -f Makefile.port Makefile.global

View File

@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California # Copyright (c) 1998, Regents of the University of California
# #
# IDENTIFICATION # 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 # WIN case
$(shlib) lib$(NAME).a: $(OBJS) $(DLLINIT) $(shlib) lib$(NAME).a: $(OBJS) $(DLLINIT)
$(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS) $(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 $(DLLTOOL) --dllname $(shlib) --def $(NAME).def --output-lib lib$(NAME).a
$(DLLINIT): $(DLLINIT:%.o=%.c) $(DLLINIT): $(DLLINIT:%.o=%.c)
@ -353,5 +353,5 @@ ifdef EXPSUFF
endif endif
endif endif
ifeq ($(PORTNAME), win) ifeq ($(PORTNAME), win)
rm -rf $(NAME).def rm -f $(NAME).dll $(NAME).def
endif endif

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # 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 postgres: $(OBJS) $(DLLINIT) postgres.def libpostgres.a
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def $(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 $(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
$(CC) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(DLLLIBS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) $@.exp $(OBJS) $(LIBS)
rm $@.exp $@.base 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 endif # win
@ -57,17 +63,6 @@ $(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir
$(MAKE) -C $(subst -recursive,,$@) all $(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) $(DLLINIT): $(DLLINIT:%.o=%.c)
$(MAKE) -C $(@D) $(@F) $(MAKE) -C $(@D) $(@F)
@ -169,9 +164,7 @@ clean:
$(top_srcdir)/src/include/parser/parse.h \ $(top_srcdir)/src/include/parser/parse.h \
$(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/fmgroids.h
ifeq ($(PORTNAME), win) ifeq ($(PORTNAME), win)
ifeq ($(MAKE_DLL), true)
rm -f postgres.dll postgres.def libpostgres.a rm -f postgres.dll postgres.def libpostgres.a
endif
endif endif
for i in $(DIRS); do $(MAKE) -C $$i clean || exit; done for i in $(DIRS); do $(MAKE) -C $$i clean || exit; done

View File

@ -1,7 +1,6 @@
SRCS += $(NAME).c SRCS += $(NAME).c
OBJS += $(NAME).o OBJS += $(NAME).o
PG_CPPFLAGS :=
SHLIB_LINK := $(BE_DLLLIBS) SHLIB_LINK := $(BE_DLLLIBS)
SO_MAJOR_VERSION := 0 SO_MAJOR_VERSION := 0
@ -18,4 +17,4 @@ install: all
uninstall: uninstall-lib uninstall: uninstall-lib
clean distclean maintainer-clean: clean-lib clean distclean maintainer-clean: clean-lib
$(RM) $(OBJS) rm -f $(OBJS)

View File

@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * NOTES
* some of the information in this file should be moved to * some of the information in this file should be moved to
@ -62,7 +62,7 @@
/* in globals.c */ /* in globals.c */
/* these are marked volatile because they are set by signal handlers: */ /* 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 QueryCancelPending;
extern volatile bool ProcDiePending; extern volatile bool ProcDiePending;
@ -166,7 +166,7 @@ extern char DateFormat[];
extern bool enableFsync; extern bool enableFsync;
extern bool allowSystemTableMods; extern bool allowSystemTableMods;
extern int SortMem; extern DLLIMPORT int SortMem;
extern int VacuumMem; extern int VacuumMem;
/* /*

View File

@ -1,13 +1,9 @@
# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.17 2002/07/27 20:10:05 petere Exp $ # $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.18 2002/09/05 18:28:46 petere Exp $
LDFLAGS+= -g
DLLTOOL= dlltool DLLTOOL= dlltool
DLLWRAP= dllwrap DLLWRAP= dllwrap
DLLLIBS= -lcygipc -lcrypt
BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
DLLINIT = $(top_builddir)/src/utils/dllinit.o 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 # linking with -lm or -lc causes program to crash
# (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110) # (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110)
LIBS:=$(filter-out -lm -lc, $(LIBS)) LIBS:=$(filter-out -lm -lc, $(LIBS))
@ -18,22 +14,21 @@ CFLAGS_SL =
%.dll: %.o %.dll: %.o
$(DLLTOOL) --export-all --output-def $*.def $< $(DLLTOOL) --export-all --output-def $*.def $<
$(DLLWRAP) -o $@ --def $*.def $< $(DLLINIT) $(DLLLIBS) $(DLLWRAP) -o $@ --def $*.def $< $(DLLINIT) $(SHLIB_LINK)
rm -f $*.def rm -f $*.def
ifeq ($(findstring backend,$(subdir)), backend) ifneq (,$(findstring backend,$(subdir)))
override CPPFLAGS+= -DBUILDING_DLL=1 ifeq (,$(findstring conversion_procs,$(subdir)))
override CPPFLAGS+= -DBUILDING_DLL
endif
endif endif
ifeq ($(findstring ecpg/lib,$(subdir)), ecpg/lib) ifneq (,$(findstring ecpg/lib,$(subdir)))
override CPPFLAGS+= -DBUILDING_DLL=1 override CPPFLAGS+= -DBUILDING_DLL
endif endif
ifeq ($(findstring interfaces/libpq++,$(subdir)), interfaces/libpq++) # required by Python headers
override CPPFLAGS+= -DBUILDING_DLL=1 ifneq (,$(findstring src/pl/plpython,$(subdir)))
endif
ifeq ($(findstring src/pl/plpython,$(subdir)), src/pl/plpython)
override CPPFLAGS+= -DUSE_DL_IMPORT override CPPFLAGS+= -DUSE_DL_IMPORT
endif endif

View File

@ -2,7 +2,7 @@
# #
# Makefile for the plpgsql shared object # 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 SO_MINOR_VERSION= 0
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) SHLIB_LINK = $(BE_DLLLIBS)
rpath := rpath :=
OBJS = pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o OBJS = pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o

View File

@ -1,4 +1,4 @@
# $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 subdir = src/pl/plpython
top_builddir = ../../.. top_builddir = ../../..
@ -17,7 +17,6 @@ endif
ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib))) ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib)))
override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS) override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
rpath := rpath :=
NAME = plpython NAME = plpython
@ -25,7 +24,7 @@ SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0 SO_MINOR_VERSION = 0
OBJS = plpython.o OBJS = plpython.o
SHLIB_LINK += $(python_libspec) SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec)
include $(top_srcdir)/src/Makefile.shlib include $(top_srcdir)/src/Makefile.shlib

View File

@ -1,4 +1,2 @@
CFLAGS=-O2 CFLAGS=-O2
SRCH_INC=/usr/local/include
SRCH_LIB=/usr/local/lib SRCH_LIB=/usr/local/lib
LIBS=-lcygipc

View File

@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # 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 CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(CFLAGS_SL) override CFLAGS += $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) SHLIB_LINK = $(BE_DLLLIBS)
# default encoding # default encoding
MULTIBYTE = SQL_ASCII MULTIBYTE = SQL_ASCII

View File

@ -4,7 +4,7 @@
# Makefile for tutorial # Makefile for tutorial
# #
# IDENTIFICATION # 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 include $(top_builddir)/src/Makefile.global
override CFLAGS+= $(CFLAGS_SL) override CFLAGS+= $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS) SHLIB_LINK = $(BE_DLLLIBS)
# #
# DLOBJS are the dynamically-loaded object files. The "funcs" queries # DLOBJS are the dynamically-loaded object files. The "funcs" queries