First attempt to provide a dynloader backend implementation for Interix,

using libltdl.  (This could provide even more portability in the future.)
This commit is contained in:
tv 2005-01-25 05:21:53 +00:00
parent 6ba698c58f
commit f55888ad1b
2 changed files with 29 additions and 1 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile.common,v 1.17 2005/01/21 03:15:52 tv Exp $
# $NetBSD: Makefile.common,v 1.18 2005/01/25 05:21:53 tv Exp $
#
# This Makefile fragment is included by all PostgreSQL packages built from
# the main sources of the PostgreSQL distribution except jdbc-postgresql.
@ -99,6 +99,14 @@ post-extract:
${CP} -f ${COMMON_FILESDIR}/${platform}.template \
${WRKSRC}/src/template/${platform}; \
fi
.endfor
.for platform in interix3
if [ -d ${WRKSRC}/src/backend/port/dynloader ]; then \
${RM} -f ${WRKSRC}/src/backend/port/dynloader/${platform}.h; \
${CP} -f ${COMMON_FILESDIR}/dynloader-ltdl.h \
${WRKSRC}/src/backend/port/dynloader/${platform}.h; \
${TOUCH} ${WRKSRC}/src/backend/port/dynloader/${platform}.c; \
fi
.endfor
if [ -d ${WRKSRC}/src/interfaces/libpq ]; then \
${RM} -f ${WRKSRC}/src/interfaces/libpq/GNUmakefile; \
@ -116,5 +124,10 @@ post-extract:
${WRKSRC}/src/backend/port/dynloader/; \
fi
.if ${OPSYS} == "Interix"
. include "../../devel/libltdl/buildlink3.mk"
LIBS+= -lltdl
.endif
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"

View file

@ -0,0 +1,15 @@
/*
* dynamic loader based on libltdl
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <ltdl.h>
#include "utils/dynamic_loader.h"
#define pg_dlopen(a) ((void *)lt_dlopen(a))
#define pg_dlsym(a,b) lt_dlsym((lt_dlhandle)(a), (b))
#define pg_dlclose(a) lt_dlclose((lt_dlhandle)(a))
#define pg_dlerror lt_dlerror
#endif /* PORT_PROTOS_H */