depot/third_party/nixpkgs/pkgs/os-specific/linux/nvidia-x11/libxnvctrl-build-shared.patch
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

21 lines
562 B
Diff

--- a/src/libXNVCtrl/xnvctrl.mk
+++ b/src/libXNVCtrl/xnvctrl.mk
@@ -39,6 +39,8 @@
LIBXNVCTRL = $(OUTPUTDIR)/libXNVCtrl.a
+LIBXNVCTRL_SHARED = $(OUTPUTDIR)/libXNVCtrl.so
+
LIBXNVCTRL_SRC = $(XNVCTRL_DIR)/NVCtrl.c
LIBXNVCTRL_OBJ = $(call BUILD_OBJECT_LIST,$(LIBXNVCTRL_SRC))
@@ -47,3 +49,9 @@
$(LIBXNVCTRL) : $(LIBXNVCTRL_OBJ)
$(call quiet_cmd,AR) ru $@ $(LIBXNVCTRL_OBJ)
+
+$(LIBXNVCTRL_SHARED): $(LIBXNVCTRL_OBJ)
+ $(RM) $@ $@.*
+ $(CC) -shared -Wl,-soname=$(@F).0 -o $@.0.0.0 $(LDFLAGS) $^ -lXext -lX11
+ ln -s $(@F).0.0.0 $@.0
+ ln -s $(@F).0 $@