/*
- * $Id: aix.h,v 1.5 2001/03/22 03:59:42 momjian Exp $
+ * $Id: aix.h,v 1.6 2001/05/14 21:45:53 petere Exp $
*
* @(#)dlfcn.h 1.4 revision of 95/04/25 09:36:52
* This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
#include "utils/dynamic_loader.h"
-#define pg_dlopen(f) dlopen(f, RTLD_LAZY)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
*
*-------------------------------------------------------------------------
*/
-#ifdef PRE_BSDI_2_1
+#ifndef HAVE_DLOPEN
#include "postgres.h"
extern char pg_pathname[];
return dld_strerror(dld_errno);
}
-#endif
+#endif /* not HAVE_DLOPEN */
/*-------------------------------------------------------------------------
*
- * port_protos.h
- * port-specific prototypes for SunOS 4
+ * Dynamic loader interface for BSD/OS
*
*
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
#include "utils/dynamic_loader.h"
-/* dynloader.c */
-#ifndef PRE_BSDI_2_1
+#ifdef HAVE_DLOPEN
+
#include <dlfcn.h>
-#define pg_dlopen(f) dlopen(f, RTLD_LAZY)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
-#else
+
+#else /* not HAVE_DLOPEN */
+
#define pg_dlsym(handle, funcname) ((PGFunction) dld_get_func((funcname)))
#define pg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
-#endif
-/* port.c */
+#endif /* not HAVE_DLOPEN */
#endif /* PORT_PROTOS_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: dgux.h,v 1.9 2001/02/10 02:31:26 tgl Exp $
+ * $Id: dgux.h,v 1.10 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f,1)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: freebsd.h,v 1.8 2001/02/10 02:31:26 tgl Exp $
+ * $Id: freebsd.h,v 1.9 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* 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_dlopen(f) BSD44_derived_dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym BSD44_derived_dlsym
#define pg_dlclose BSD44_derived_dlclose
#define pg_dlerror BSD44_derived_dlerror
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f,1)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
/*-------------------------------------------------------------------------
*
- * port_protos.h
- * port-specific prototypes for Linux
+ * Dynamic loader interface for Linux
*
*
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: linux.h,v 1.11 2001/02/10 02:31:26 tgl Exp $
+ * $Id: linux.h,v 1.12 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
#define PORT_PROTOS_H
#include "utils/dynamic_loader.h"
-#ifdef __ELF__
+#ifdef HAVE_DLOPEN
#include <dlfcn.h>
#endif
-/* dynloader.c */
-#ifndef __ELF__
+#ifndef HAVE_DLOPEN
+
#ifndef HAVE_DLD_H
#define pg_dlsym(handle, funcname) (NULL)
#define pg_dlclose(handle) ({})
#define pg_dlsym(handle, funcname) ((PGFunction) dld_get_func((funcname)))
#define pg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
#endif
-#else
-/* #define pg_dlopen(f) dlopen(f, 1) */
-#define pg_dlopen(f) dlopen(f, 2)
+
+#else /* HAVE_DLOPEN */
+
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
-#endif
-/* port.c */
+#endif /* HAVE_DLOPEN */
#endif /* PORT_PROTOS_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: netbsd.h,v 1.3 2001/02/10 02:31:26 tgl Exp $
+ * $Id: netbsd.h,v 1.4 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* 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_dlopen(f) BSD44_derived_dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym BSD44_derived_dlsym
#define pg_dlclose BSD44_derived_dlclose
#define pg_dlerror BSD44_derived_dlerror
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: openbsd.h,v 1.3 2001/02/10 02:31:26 tgl Exp $
+ * $Id: openbsd.h,v 1.4 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* 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_dlopen(f) BSD44_derived_dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym BSD44_derived_dlsym
#define pg_dlclose BSD44_derived_dlclose
#define pg_dlerror BSD44_derived_dlerror
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: osf.h,v 1.2 2001/01/24 19:43:04 momjian Exp $
+ * $Id: osf.h,v 1.3 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f, RTLD_LAZY)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym(h, f) ((PGFunction) dlsym(h, f))
#define pg_dlclose(h) dlclose(h)
#define pg_dlerror() dlerror()
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: sco.h,v 1.7 2001/02/10 02:31:26 tgl Exp $
+ * $Id: sco.h,v 1.8 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f,1)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
-/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/solaris.h,v 1.3 2001/03/22 03:59:43 momjian Exp $ */
+/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/solaris.h,v 1.4 2001/05/14 21:45:53 petere Exp $ */
#ifndef DYNLOADER_SOLARIS_H
#define DYNLOADER_SOLARIS_H
#include <dlfcn.h>
#include "utils/dynamic_loader.h"
-#define pg_dlopen(f) dlopen(f,1)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: sunos4.h,v 1.7 2001/02/10 02:31:26 tgl Exp $
+ * $Id: sunos4.h,v 1.8 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f, 1)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: svr4.h,v 1.7 2001/02/10 02:31:26 tgl Exp $
+ * $Id: svr4.h,v 1.8 2001/05/14 21:45:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f,RTLD_LAZY)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f,RTLD_LAZY)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f,RTLD_LAZY)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
* library as the file to be dynamically loaded.
*
*/
-#define pg_dlopen(f) dlopen(f,1)
+#define pg_dlopen(f) dlopen((f), RTLD_LAZY | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
i?86) CFLAGS="$CFLAGS -m486";;
esac
-case $host_os in
- bsdi2.0) CFLAGS="$CFLAGS -DPRE_BSDI_2_1";;
-esac
-
case $host_os in
bsdi2.0 | bsdi2.1 | bsdi3*)
CC=gcc2