OSDN Git Service

I've made a diff against the 7.0beta1 tree that accomplishes several things:
authorBruce Momjian <bruce@momjian.us>
Wed, 8 Mar 2000 01:58:46 +0000 (01:58 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 8 Mar 2000 01:58:46 +0000 (01:58 +0000)
        1) adds NetBSD shared lib support on both ELF and a.out platforms

        2) replaces "-L$(LIBPQDIR) -lpq" with "$(LIBPQ)" defined in
           Makefile.global.  This makes it much easier to build stuff in
           the source tree after you've already installed the libraries.

        3) adds TEMPLATEDIR in Makefile.global that indicates where the
           database templates are stored.  This separates the template files
           from real libraries that are installed in $(LIBDIR).
        4) changes include order of <readline/readline.h> and <readline.h>.
           The latest GNU readline installs its headers under a readline
           subdirectory.

In addition to applying the patch below the following files need to be copied:

        backend/port/dynloader:
                bsd.h -> netbsd.h
                bsd.c -> netbsd.c
        include/port:
                bsd.h -> netbsd.h
        makefiles:
                Makefile.bsd -> Makefile.netbsd

It would be great to see this incorporated into the source tree before
the 7.0 release is cut.

        Thanks!

     -- Johnny C. Lam <lamj@stat.cmu.edu>

21 files changed:
src/Makefile.global.in
src/Makefile.shlib
src/backend/Makefile
src/backend/port/dynloader/netbsd.c [new file with mode: 0644]
src/backend/port/dynloader/netbsd.h [new file with mode: 0644]
src/bin/pg_ctl/Makefile
src/bin/pg_dump/Makefile.in
src/bin/pg_encoding/Makefile
src/bin/pgtclsh/Makefile
src/bin/psql/Makefile.in
src/bin/psql/input.h
src/configure.in
src/include/port/netbsd.h [new file with mode: 0644]
src/interfaces/ecpg/lib/Makefile.in
src/interfaces/jdbc/Makefile
src/interfaces/libpgeasy/Makefile.in
src/interfaces/libpgtcl/Makefile.in
src/interfaces/libpq++/Makefile.in
src/makefiles/Makefile.netbsd [new file with mode: 0644]
src/pl/plpgsql/src/Makefile.in
src/pl/tcl/Makefile

index 5027503..658a2b1 100644 (file)
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.66 2000/02/10 19:11:17 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.67 2000/03/08 01:58:15 momjian Exp $
 #
 # NOTES
 #    Essentially all Postgres make files include this file and use the
@@ -54,6 +54,10 @@ BSD_SHLIB= true
 ELF_SYSTEM= @ELF_SYS@
 
 LIBPQDIR:= $(SRCDIR)/interfaces/libpq
+LIBPGTCLDIR:= $(SRCDIR)/interfaces/libpgtcl
+
+LIBPQ:= -L$(LIBPQDIR) -lpq
+LIBPGTCL:= -L$(LIBPGTCLDIR) -lpgtcl
 
 # For convenience, POSTGRESDIR is where BINDIR, and LIBDIR
 # and other target destinations are rooted.  Of course, each of these is
@@ -70,6 +74,10 @@ BINDIR= $(POSTGRESDIR)/bin
 # command line.
 LIBDIR= $(POSTGRESDIR)/lib
 
+# Where the database templates are stored
+#
+TEMPLATEDIR= $(POSTGRESDIR)/lib
+
 # This is the directory where IPC utilities ipcs and ipcrm are located
 #
 IPCS=@ipcs@
index 169e593..441feec 100644 (file)
@@ -6,7 +6,7 @@
 # Copyright (c) 1998, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.17 1999/12/09 19:14:22 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.18 2000/03/08 01:58:15 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -109,6 +109,24 @@ ifeq ($(PORTNAME), freebsd)
   endif
 endif
 
+ifeq ($(PORTNAME), netbsd)
+  ifdef BSD_SHLIB
+    install-shlib-dep  := install-shlib
+    soname             := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+    shlib              := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+    ifdef ELF_SYSTEM
+      LD               := $(CC)
+      LDFLAGS_SL       := -shared -Wl,-soname -Wl,$(soname)
+      ifneq ($(SHLIB_LINK),)
+        LDFLAGS_SL     += -Wl,-R$(LIBDIR)
+      endif
+    else
+      LDFLAGS_SL       := -x -Bshareable -Bforcearchive
+    endif
+    CFLAGS             += $(CFLAGS_SL)
+  endif
+endif
+
 ifeq ($(PORTNAME), hpux)
   install-shlib-dep    := install-shlib
 # HPUX doesn't believe in version numbers for shlibs
index fe77dde..1033de1 100644 (file)
@@ -34,7 +34,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.43 2000/02/27 01:26:12 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.44 2000/03/08 01:58:16 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -165,10 +165,11 @@ endif
 # and (2) the parameters of a database system should be set at initdb time,
 # not at postgres build time.
 
-.PHONY: install install-bin install-lib install-headers
+.PHONY: install install-bin install-templates install-headers
 
-install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(POSTGRES_IMP) \
-         install-bin install-lib install-headers
+install: $(LIBDIR) $(BINDIR) $(HEADERDIR) $(TEMPLATEDIR) \
+         postgres $(POSTGRES_IMP) \
+         install-bin install-templates install-headers
 
 install-bin: $(BINDIR) postgres$(X) $(POSTGRES_IMP)
        $(INSTALL) $(INSTL_EXE_OPTS) postgres$(X) $(BINDIR)/postgres$(X)
@@ -184,22 +185,22 @@ ifeq ($(MAKE_DLL), true)
 endif
 endif
 
-install-lib: $(LIBDIR) \
+install-templates: $(TEMPLATEDIR) \
          global1.bki.source local1_template1.bki.source \
          global1.description local1_template1.description \
          libpq/pg_hba.conf.sample optimizer/geqo/pg_geqo.sample
        $(INSTALL) $(INSTLOPTS) global1.bki.source \
-         $(LIBDIR)/global1.bki.source
+         $(TEMPLATEDIR)/global1.bki.source
        $(INSTALL) $(INSTLOPTS) global1.description \
-         $(LIBDIR)/global1.description
+         $(TEMPLATEDIR)/global1.description
        $(INSTALL) $(INSTLOPTS) local1_template1.bki.source \
-         $(LIBDIR)/local1_template1.bki.source
+         $(TEMPLATEDIR)/local1_template1.bki.source
        $(INSTALL) $(INSTLOPTS) local1_template1.description \
-         $(LIBDIR)/local1_template1.description
+         $(TEMPLATEDIR)/local1_template1.description
        $(INSTALL) $(INSTLOPTS) libpq/pg_hba.conf.sample \
-         $(LIBDIR)/pg_hba.conf.sample
+         $(TEMPLATEDIR)/pg_hba.conf.sample
        $(INSTALL) $(INSTLOPTS) optimizer/geqo/pg_geqo.sample \
-         $(LIBDIR)/pg_geqo.sample
+         $(TEMPLATEDIR)/pg_geqo.sample
 
 install-headers: fmgr.h $(SRCDIR)/include/config.h
        -@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
@@ -263,6 +264,8 @@ $(LIBDIR):
        mkdir $@
 $(HEADERDIR):
        mkdir $@
+$(TEMPLATEDIR):
+       mkdir $@
 
 #############################################################################
 #
diff --git a/src/backend/port/dynloader/netbsd.c b/src/backend/port/dynloader/netbsd.c
new file mode 100644 (file)
index 0000000..b77dea1
--- /dev/null
@@ -0,0 +1,107 @@
+/*-
+ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
+ * Portions Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *       must display the following acknowledgement:
+ *             This product includes software developed by the University of
+ *             California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *       may be used to endorse or promote products derived from this software
+ *       without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.     IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)dl.c       5.4 (Berkeley) 2/23/91";
+
+#endif  /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <nlist.h>
+#include "link.h"
+#include <dlfcn.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "dynloader.h"
+
+static char error_message[BUFSIZ];
+
+char *
+BSD44_derived_dlerror(void)
+{
+       static char ret[BUFSIZ];
+
+       strcpy(ret, error_message);
+       error_message[0] = 0;
+       return (ret[0] == 0) ? (char *) NULL : ret;
+}
+
+void *
+BSD44_derived_dlopen(const char *file, int num)
+{
+#if defined(__mips__) || (defined(__NetBSD__) && defined(__vax__))
+       sprintf(error_message, "dlopen (%s) not supported", file);
+       return NULL;
+#else
+       void       *vp;
+
+       if ((vp = dlopen((char *) file, num)) == (void *) NULL)
+               sprintf(error_message, "dlopen (%s) failed", file);
+       return vp;
+#endif
+}
+
+void *
+BSD44_derived_dlsym(void *handle, const char *name)
+{
+#if defined(__mips__) || (defined(__NetBSD__) && defined(__vax__))
+       sprintf(error_message, "dlsym (%s) failed", name);
+       return NULL;
+#elif defined(__ELF__)
+       return dlsym(handle, name);
+#else
+       void       *vp;
+       char            buf[BUFSIZ];
+
+       if (*name != '_')
+       {
+               sprintf(buf, "_%s", name);
+               name = buf;
+       }
+       if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
+               sprintf(error_message, "dlsym (%s) failed", name);
+       return vp;
+#endif
+}
+
+void
+BSD44_derived_dlclose(void *handle)
+{
+#if defined(__mips__) || (defined(__NetBSD__) && defined(__vax__))
+#else
+       dlclose(handle);
+#endif
+}
diff --git a/src/backend/port/dynloader/netbsd.h b/src/backend/port/dynloader/netbsd.h
new file mode 100644 (file)
index 0000000..ad58324
--- /dev/null
@@ -0,0 +1,49 @@
+/*-------------------------------------------------------------------------
+ *
+ * port_protos.h
+ *       port-specific prototypes for NetBSD 1.0
+ *
+ *
+ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: netbsd.h,v 1.1 2000/03/08 01:58:17 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PORT_PROTOS_H
+#define PORT_PROTOS_H
+
+#include <sys/types.h>
+#include <nlist.h>
+#include "link.h"
+
+#include "postgres.h"
+
+#include "fmgr.h"
+#include "utils/dynamic_loader.h"
+
+/* dynloader.c */
+/*
+ * Dynamic Loader on NetBSD 1.0.
+ *
+ * this dynamic loader uses the system dynamic loading interface for shared
+ * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
+ * library as the file to be dynamically loaded.
+ *
+ * agc - I know this is all a bit crufty, but it does work, is fairly
+ * portable, and works (the stipulation that the d.l. function must
+ * begin with an underscore is fairly tricky, and some versions of
+ * NetBSD (like 1.0, and 1.0A pre June 1995) have no dlerror.)
+ */
+#define                   pg_dlopen(f)    BSD44_derived_dlopen(f, 1)
+#define                   pg_dlsym                BSD44_derived_dlsym
+#define                   pg_dlclose      BSD44_derived_dlclose
+#define                   pg_dlerror      BSD44_derived_dlerror
+
+char      *BSD44_derived_dlerror(void);
+void      *BSD44_derived_dlopen(const char *filename, int num);
+void      *BSD44_derived_dlsym(void *handle, const char *name);
+void           BSD44_derived_dlclose(void *handle);
+
+#endif  /* PORT_PROTOS_H */
index 6f57b86..c9315a1 100644 (file)
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.3 1999/12/22 04:12:55 ishii Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.4 2000/03/08 01:58:18 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -21,7 +21,7 @@ pg_ctl: pg_ctl.sh
 
 install: pg_ctl
        $(INSTALL) $(INSTL_EXE_OPTS) $+ $(BINDIR)
-       $(INSTALL) $(INSTLOPTS) postmaster.opts.default.sample $(LIBDIR)
+       $(INSTALL) $(INSTLOPTS) postmaster.opts.default.sample $(TEMPLATEDIR)
 
 clean:
        rm -f pg_ctl
index f387b72..752b4af 100644 (file)
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/Makefile.in,v 1.11 1999/01/17 06:19:05 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/Makefile.in,v 1.12 2000/03/08 01:58:19 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -29,7 +29,7 @@ endif
 all: submake pg_dump
 
 pg_dump: $(OBJS) $(LIBPQDIR)/libpq.a
-       $(CC) -o pg_dump -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
+       $(CC) -o pg_dump $(OBJS) $(LIBPQ) $(LDFLAGS)
 
 ../../utils/strdup.o:
        $(MAKE) -C ../../utils strdup.o
index ddad3ec..df4e9d7 100644 (file)
@@ -6,7 +6,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.4 2000/01/15 18:30:32 petere Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.5 2000/03/08 01:58:20 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -22,7 +22,7 @@ CFLAGS:= -I$(SRCDIR)/include $(CFLAGS)
 all: submake pg_encoding
 
 pg_encoding: $(OBJS)
-       $(CC) -o pg_encoding $(OBJS) -L$(LIBPQDIR) -lpq $(LDFLAGS) $(CFLAGS)
+       $(CC) -o pg_encoding $(OBJS) $(LIBPQ) $(LDFLAGS) $(CFLAGS)
 
 .PHONY: submake
 
index 459ed46..3589476 100644 (file)
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.24 1998/10/27 21:51:54 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.25 2000/03/08 01:58:21 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -22,16 +22,13 @@ ifeq ($(USE_TK), true)
 include Makefile.tkdefs
 endif
 
-CFLAGS+= $(X_CFLAGS) -I$(SRCDIR)/interfaces/libpgtcl 
+CFLAGS+= $(X_CFLAGS) -I$(LIBPGTCLDIR)
 
 ifdef KRBVERS
 LDFLAGS+= $(KRBLIBS)
 CFLAGS+= $(KRBFLAGS)
 endif
 
-LIBPGTCL= -L$(SRCDIR)/interfaces/libpgtcl -lpgtcl
-LIBPQ= -L$(LIBPQDIR) -lpq
-
 # If we are here then TCL is available
 PGMS = pgtclsh
 INSTPGMS = install_tcl
index 976f07c..6221d4c 100644 (file)
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.20 2000/01/19 02:59:00 petere Exp $
+#    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.21 2000/03/08 01:58:22 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -56,7 +56,7 @@ endif
 # End of hacks for picking up backend 'port' modules
 
 psql: $(OBJS) $(LIBPQDIR)/libpq.a
-       $(CC) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
+       $(CC) -o psql $(OBJS) $(LIBPQ) $(LDFLAGS)
 
 help.o: sql_help.h
 
index e539ba2..c141d16 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright 2000 by PostgreSQL Global Development Group
  *
- * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.8 2000/02/16 13:15:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.9 2000/03/08 01:58:22 momjian Exp $
  */
 #ifndef INPUT_H
 #define INPUT_H
  * USE_READLINE and USE_HISTORY are the definite pointers regarding existence or not.
  */
 #ifdef HAVE_LIBREADLINE
-# ifdef HAVE_READLINE_H
-#  include <readline.h>
-#  define USE_READLINE 1
-# elif defined(HAVE_READLINE_READLINE_H)
+# if defined(HAVE_READLINE_READLINE_H)
 #  include <readline/readline.h>
 #  define USE_READLINE 1
+# elif defined(HAVE_READLINE_H)
+#  include <readline.h>
+#  define USE_READLINE 1
 # endif
 #endif
 
 #if defined(HAVE_LIBHISTORY) || (defined(HAVE_LIBREADLINE) && defined(HAVE_HISTORY_IN_READLINE))
-# ifdef HAVE_HISTORY_H
-#  include <history.h>
-#  define USE_HISTORY 1
-# elif defined(HAVE_READLINE_HISTORY_H)
+# if defined(HAVE_READLINE_HISTORY_H)
 #  include <readline/history.h>
 #  define USE_HISTORY 1
+# elif defined(HAVE_HISTORY_H)
+#  include <history.h>
+#  define USE_HISTORY 1
 # endif
 #endif
 
index dd79e1a..45ecc91 100644 (file)
@@ -23,11 +23,7 @@ case "$host_os" in
     bsdi*) os=bsdi need_tas=no ;;
  freebsd1*|freebsd2*) os=freebsd need_tas=no ;;
  freebsd*) os=freebsd need_tas=no elf=yes ;;
-  netbsd*)
-       os=bsd need_tas=no
-       case "$host_cpu" in
-         powerpc) elf=yes ;;
-       esac ;;
+  netbsd*) os=netbsd need_tas=no ;;
   openbsd*) os=bsd need_tas=no ;;
     dgux*) os=dgux need_tas=no ;;
      aix*) os=aix need_tas=no ;;
diff --git a/src/include/port/netbsd.h b/src/include/port/netbsd.h
new file mode 100644 (file)
index 0000000..8406844
--- /dev/null
@@ -0,0 +1,43 @@
+#define USE_POSIX_TIME
+
+#if defined(__i386__)
+#define NEED_I386_TAS_ASM
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__sparc__)
+#define NEED_SPARC_TAS_ASM
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__vax__)
+#define NEED_VAX_TAS_ASM
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__ns32k__)
+#define NEED_NS32K_TAS_ASM
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__m68k__)
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__arm__)
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__mips__)
+/* #   undef HAS_TEST_AND_SET */
+#endif
+
+#if defined(__powerpc__)
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__powerpc__)
+typedef unsigned int slock_t;
+#else
+typedef unsigned char slock_t;
+#endif
index a462030..de846dd 100644 (file)
@@ -6,18 +6,18 @@
 # Copyright (c) 1994, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.62 2000/03/07 15:10:52 meskes Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.63 2000/03/08 01:58:24 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 NAME= ecpg
 SO_MAJOR_VERSION= 3
-SO_MINOR_VERSION= 1.0
+SO_MINOR_VERSION= 1
 
 SRCDIR= @top_srcdir@
 include $(SRCDIR)/Makefile.global
 
-CFLAGS+= -I../include -I$(SRCDIR)/interfaces/libpq
+CFLAGS+= -I../include -I$(LIBPQDIR)
 
 ifdef KRBVERS
 CFLAGS+= $(KRBFLAGS)
@@ -26,7 +26,7 @@ endif
 OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
        connect.o misc.o
 
-SHLIB_LINK= -L../../libpq -lpq
+SHLIB_LINK= $(LIBPQ)
 
 # Shared library stuff, also default 'all' target
 include $(SRCDIR)/Makefile.shlib
index faf2238..95789f7 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for Java JDBC interface
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.16 1999/09/15 21:56:16 peter Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.17 2000/03/08 01:58:25 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -34,11 +34,11 @@ all:
        @echo
        @echo If you are using JDK1.1.x, you will need the JDBC1.2 driver.
        @echo To compile, type:
-       @echo "  make jdbc1"
+       @echo "  $(MAKE) jdbc1"
        @echo
        @echo "If you are using JDK1.2 (aka Java2) you need the JDBC2."
        @echo To compile, type:
-       @echo "  make jdbc2"
+       @echo "  $(MAKE) jdbc2"
        @echo ------------------------------------------------------------
 
 msg:   
@@ -59,10 +59,10 @@ msg:
        @echo
        @echo ------------------------------------------------------------
        @echo To build the examples, type:
-       @echo "  make examples"
+       @echo "  $(MAKE) examples"
        @echo
        @echo "To build the CORBA example (requires Java2):"
-       @echo "  make corba"
+       @echo "  $(MAKE) corba"
        @echo ------------------------------------------------------------
        @echo
 
index 46adbd6..b7e0a52 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for pgeasy library
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile.in,v 1.5 2000/01/10 15:41:28 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile.in,v 1.6 2000/03/08 01:58:33 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -23,9 +23,7 @@ endif
 
 OBJS= libpgeasy.o halt.o
 
-SHLIB_LINK+= -L../libpq -lpq
-
-SHLIB_LINK+= -L../libpq -lpq
+SHLIB_LINK+= $(LIBPQ)
 
 # If crypt is a separate library, rather than part of libc, it may need
 # to be referenced separately to keep (broken) linkers happy.  (This is
index 3b5f15b..fa766ff 100644 (file)
@@ -6,7 +6,7 @@
 # Copyright (c) 1994, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.38 2000/01/10 15:41:29 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.39 2000/03/08 01:58:36 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -27,7 +27,7 @@ endif
 
 OBJS= pgtcl.o pgtclCmds.o pgtclId.o
 
-SHLIB_LINK+= -L../libpq -lpq
+SHLIB_LINK+= $(LIBPQ)
 
 # If crypt is a separate library, rather than part of libc, it may need
 # to be referenced separately to keep (broken) linkers happy.  (This is
index b6f57dc..d851254 100644 (file)
@@ -6,7 +6,7 @@
 # Copyright (c) 1994, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.20 2000/01/10 15:41:31 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.21 2000/03/08 01:58:37 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -43,9 +43,9 @@ endif
 OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o 
 
 ifeq ($(PORTNAME), win)
-SHLIB_LINK+= --driver-name g++ -L../libpq -lpq
+SHLIB_LINK+= --driver-name g++ $(LIBPQ)
 else
-SHLIB_LINK= -L../libpq -lpq
+SHLIB_LINK= $(LIBPQ)
 endif
 
 # For CC on IRIX, must use CC as linker/archiver of C++ libraries
diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd
new file mode 100644 (file)
index 0000000..14ebbfe
--- /dev/null
@@ -0,0 +1,16 @@
+ifdef ELF_SYSTEM
+LDFLAGS += -Wl,-E
+endif
+%.so: %.o
+ifdef ELF_SYSTEM
+       $(LD) -x -Bshareable -o $@ $<
+else
+       $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
+       @echo building shared object $@
+       @rm -f $@.pic
+       @${AR} cq $@.pic `lorder $<.obj | tsort`
+       ${RANLIB} $@.pic
+       @rm -f $@
+       $(LD) -x -Bshareable -Bforcearchive \
+         -o $@ $@.pic
+endif
index 781c483..049cbde 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for the plpgsql shared object
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.20 2000/02/23 22:24:45 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.21 2000/03/08 01:58:44 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -31,7 +31,7 @@ endif
 
 OBJS=  pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
 
-SHLIB_LINK+= -L$(LIBPQDIR) -lpq
+SHLIB_LINK+= $(LIBPQ)
 
 # If crypt is a separate library, rather than part of libc, it may need
 # to be referenced separately to keep (broken) linkers happy.  (This is
index 8e400e1..085baeb 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for the pltcl shared object
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.10 1998/12/13 23:46:49 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.11 2000/03/08 01:58:46 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -75,7 +75,7 @@ CFLAGS+= -I$(SRCDIR)/backend
 
 CFLAGS+= $(TCL_DEFS)
 
-LDADD+= -L$(LIBPQDIR) -lpq
+LDADD+= $(LIBPQ)
         
 #
 # DLOBJS is the dynamically-loaded object file.