From: Simon 'corecode' Schubert Date: Sun, 18 May 2008 16:25:22 +0000 (+0200) Subject: Build a wrapper lib with weak symbols. X-Git-Url: https://gitweb.dragonflybsd.org/~corecode/nvidia.git/commitdiff_plain/d2e01e7a670a4955311100fcebc85994f0f2c00e Build a wrapper lib with weak symbols. --- diff --git a/obj/wraplib/Makefile b/obj/wraplib/Makefile new file mode 100644 index 0000000..612d14f --- /dev/null +++ b/obj/wraplib/Makefile @@ -0,0 +1,26 @@ +SHLIB_NAME= libGL.so.1 +SRCS= dummyGL.c ${.CURDIR}/../wrapmodule/exportsyms.c +NOMAN= + +LDADD= libGL.so.wrapped + +all: libGL.so.wrapped + +CLEANFILES+= dummyGL.c null.c libGL.so.wrapped + +dummyGL.c: ../libGL.so.1 + objdump -T $> | awk '\ + BEGIN { \ + print "#include "; \ + print "#include "; \ + print "static __used void dummy(void) { abort(); }"; \ + }; \ + $$2 == "g" && $$6 !~ /^_/ { \ + print "__weak_reference(dummy, "$$6");"; \ + }' > $@ + +libGL.so.wrapped: + > null.c + cc -shared -o $@ null.c + +.include diff --git a/obj/wrap/Makefile b/obj/wrapmodule/Makefile similarity index 100% rename from obj/wrap/Makefile rename to obj/wrapmodule/Makefile diff --git a/obj/wrap/exportsyms.c b/obj/wrapmodule/exportsyms.c similarity index 100% rename from obj/wrap/exportsyms.c rename to obj/wrapmodule/exportsyms.c diff --git a/obj/wrap/wrapmodule.c b/obj/wrapmodule/wrapmodule.c similarity index 100% rename from obj/wrap/wrapmodule.c rename to obj/wrapmodule/wrapmodule.c