]> git.proxmox.com Git - mirror_qemu.git/commitdiff
contrib/plugins: add Darwin support
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Sep 2023 10:38:39 +0000 (12:38 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Sep 2023 11:32:14 +0000 (13:32 +0200)
Under Darwin, using -shared makes it impossible to have undefined symbols
and -bundle has to be used instead; so detect the OS and use
different options.

Based-on: <20230907101811.469236-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
contrib/plugins/Makefile

index db1bd04dfa65b2e9ad38fcd89ba1370346a812b5..c26fa08441e40a78bac006725800c96785320200 100644 (file)
@@ -37,7 +37,11 @@ all: $(SONAMES)
        $(CC) $(CFLAGS) -c -o $@ $<
 
 lib%.so: %.o
+ifeq ($(CONFIG_DARWIN),y)
+       $(CC) -bundle -Wl,-undefined,dynamic_lookup -o $@ $^ $(LDLIBS)
+else
        $(CC) -shared -o $@ $^ $(LDLIBS)
+endif
 
 clean:
        rm -f *.o *.so *.d