]> granicus.if.org Git - postgresql/commitdiff
Assorted fixes for Cygwin:
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 5 Sep 2002 18:28:46 +0000 (18:28 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 5 Sep 2002 18:28:46 +0000 (18:28 +0000)
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.

14 files changed:
configure.in
contrib/contrib-global.mk
contrib/rserv/Makefile
src/Makefile
src/Makefile.shlib
src/backend/Makefile
src/backend/utils/mb/conversion_procs/proc.mk
src/include/miscadmin.h
src/makefiles/Makefile.win
src/pl/plpgsql/src/Makefile
src/pl/plpython/Makefile
src/template/win
src/test/regress/GNUmakefile
src/tutorial/Makefile

index 3729459d546a8a13fc9f801264d0f2bb049e16f4..fbaae6a5411cd9b3e2de79311630987677df9583 100644 (file)
@@ -1,5 +1,5 @@
 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
index 415cc273e777432f2ec45716e11033a6dd1c45d8..61025aad428f0a4a8180f19a16353145c9f620db 100644 (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
 # 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
 
index 272511974665631937de647035a9c0f393056adf..984a839415daa440e975bb2a437a5feb104f3e4a 100644 (file)
@@ -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)
index e0fef6aed7ca0a0e28d44366fb1fb3637f4a9d0f..cd6e5e630dd88d9afc2e98d3d87cbd7505774628 100644 (file)
@@ -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
index 7140b451d2c08993ffd97f9f67c52e96f02c08dd..bf746a463388379c07fc0f3e9d111bfabc7b8e25 100644 (file)
@@ -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
index 38198eb1a0b5cc2e78c3c9e96b1cdb4c02ac8abc..df445615ae0fe39ddada66c70203f19d7c28c046 100644 (file)
@@ -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
 
index 8c9279e9aaf7343b8de78066fc1f07a09146c2ee..76fb55688afb21f1f046993221f535798304585f 100644 (file)
@@ -1,7 +1,6 @@
 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)
index dbce60d81de24e22dc702800effd903c94381856..0402a690c5f52e3e8220502b061d7f3bad3cdc65 100644 (file)
@@ -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;
 
 /*
index bcf1165f01425b241600f024eff16fe2920e9577..9bbabdecc78b7ad2b5ca0cceed30fbb75747421b 100644 (file)
@@ -1,13 +1,9 @@
-# $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
 
index cb5b6c21fa5845219d881cedafcd95e1421e731b..2ab565a806dd4d601c46b763cd2ae249812a8ad0 100644 (file)
@@ -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
index dd92986304e1651c4e43794b605338e45c1cdf03..f2830866d34b4300f7dd9325aa9e72b89855ab83 100644 (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
 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
 
index fb2f10ea92f6fcbd7641cd872fb602c46b14bafe..e6c4ac67e18e4eec1c60b315510ca5d5a6d9ce84 100644 (file)
@@ -1,4 +1,2 @@
 CFLAGS=-O2
-SRCH_INC=/usr/local/include
 SRCH_LIB=/usr/local/lib
-LIBS=-lcygipc
index 009fb35efa4a5a2daa5536b380f0d6f4c4ecc8df..dc42e20ae836bb3d4451b2196e2ebae2ea6aa61c 100644 (file)
@@ -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
index 2e85fbc38a346058ca060427cc35e211826b6b33..0aa3cf6a497cd58ee2aa6025073f5c4ae4880a54 100644 (file)
@@ -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