pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/databases/postgresql74 Update the NetBSD dynloader wra...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/66fb27285641
branches:  trunk
changeset: 481698:66fb27285641
user:      jdolecek <jdolecek%pkgsrc.org@localhost>
date:      Sun Oct 10 16:44:39 2004 +0000

description:
Update the NetBSD dynloader wrapper code to use straigh dl*() calls on all
archs. This fixes support for dynamic loading on mips, and adresses
PR pkg/25473 by Byron Servies.

diffstat:

 databases/postgresql74/Makefile.common |   7 ++-
 databases/postgresql74/files/netbsd.c  |  73 ++++++++++++++++++++++++++++++++++
 databases/postgresql74/files/netbsd.h  |  45 ++++++++++++++++++++
 3 files changed, 124 insertions(+), 1 deletions(-)

diffs (147 lines):

diff -r dc182487ffc2 -r 66fb27285641 databases/postgresql74/Makefile.common
--- a/databases/postgresql74/Makefile.common    Sun Oct 10 16:19:18 2004 +0000
+++ b/databases/postgresql74/Makefile.common    Sun Oct 10 16:44:39 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.12 2004/10/10 07:30:22 jdolecek Exp $
+# $NetBSD: Makefile.common,v 1.13 2004/10/10 16:44:39 jdolecek Exp $
 #
 # This Makefile fragment is included by all PostgreSQL packages built from
 # the main sources of the PostgreSQL distribution except jdbc-postgresql.
@@ -103,6 +103,11 @@
                ${CP} -f ${COMMON_FILESDIR}/GNUmakefile.libpgtcl        \
                        ${WRKSRC}/src/interfaces/libpgtcl/GNUmakefile;  \
        fi
+       if [ -d ${WRKSRC}/src/backend/port/dynloader ]; then            \
+               ${RM} -f ${WRKSRC}/src/backend/port/dynloader/netbsd.[ch];\
+               ${CP} -f ${COMMON_FILESDIR}/netbsd.[ch] \
+                       ${WRKSRC}/src/backend/port/dynloader/;  \
+       fi
 
 .include "../../devel/gettext-lib/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
diff -r dc182487ffc2 -r 66fb27285641 databases/postgresql74/files/netbsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/postgresql74/files/netbsd.c     Sun Oct 10 16:44:39 2004 +0000
@@ -0,0 +1,73 @@
+/*-
+ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
+ * 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 "postgres.h"
+
+#include <nlist.h>
+#include <link.h>
+#include <dlfcn.h>
+
+#include "dynloader.h"
+
+#ifndef HAVE_DLOPEN
+
+char *
+pg_dlerror(void)
+{
+       return "dynaloader unsupported";
+}
+
+void *
+pg_dlopen(const char *file, int num)
+{
+       elog(ERROR, "dynamic load not supported");
+       return NULL;
+}
+
+void *
+pg_dlsym(void *handle, const char *name)
+{
+       return NULL;
+}
+
+void
+pg_dlclose(void *handle)
+{
+}
+
+#endif /* ! HAVE_DLOPEN */
diff -r dc182487ffc2 -r 66fb27285641 databases/postgresql74/files/netbsd.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/postgresql74/files/netbsd.h     Sun Oct 10 16:44:39 2004 +0000
@@ -0,0 +1,45 @@
+/*-------------------------------------------------------------------------
+ *
+ * netbsd.h
+ *       port-specific prototypes for NetBSD
+ *
+ *
+ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: netbsd.h,v 1.1 2004/10/10 16:44:39 jdolecek Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PORT_PROTOS_H
+#define PORT_PROTOS_H
+
+#include <sys/types.h>
+#include <nlist.h>
+#include <link.h>
+#include <dlfcn.h>
+
+#include "utils/dynamic_loader.h"
+
+#ifdef HAVE_DLOPEN
+/*
+ * 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 /* HAVE_DLOPEN */
+
+#endif   /* PORT_PROTOS_H */



Home | Main Index | Thread Index | Old Index