Re: [PATCH] Generate libvirt_qemu.def from libvirt_qemu.syms for MinGW builds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/8/13 Eric Blake <eblake@xxxxxxxxxx>:
> On 08/12/2010 05:23 PM, Matthias Bolte wrote:
>> @@ -1866,6 +1866,7 @@ case "$host" in
>>      # Also set the symbol file to .def, so src/Makefile generates libvirt.def
>>      # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker
>>      LIBVIRT_SYMBOL_FILE=libvirt.def
>> +    LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.def'
>
> The libvirt_qemu.syms file lives in $(srcdir) because it is
> version-controlled, but this line would make the .def file live there
> too even though it is generated.  Any reason you can't use just
> LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def, and still have things work in
> a VPATH build with it living in $(builddir)?
>
>> +++ b/src/Makefile.am
>> @@ -1010,7 +1010,7 @@ EXTRA_DIST += \
>>    libvirt_daemon.syms                \
>>    libvirt_nwfilter.syms
>>
>> -BUILT_SOURCES += libvirt.syms libvirt.def
>> +BUILT_SOURCES += libvirt.syms libvirt.def libvirt_qemu.def
>
> Particularly here, since you are treating it as a built source - in
> fact, I'm guessing that this won't work in a VPATH build without
> tweaking the configure.ac change to drop $(srcdir).
>
>>
>> +libvirt_qemu.def: libvirt_qemu.syms
>
> Which also means that for this line, you may have to make the dependency
> be on $(srcdir)/libvirt_qemu.syms, since the whole point of my question
> is reading input from $(srcdir) but generating output in $(builddir).
>

You've got me there. It was late and I didn't pay attention to the details :(

Okay, I attached v2 and this time I tested it in a VPATH build under
MinGW and it works.

Matthias
From 4d93cde0e37a66fc6e1bb1e6e945085dae66737d Mon Sep 17 00:00:00 2001
From: Matthias Bolte <matthias.bolte@xxxxxxxxxxxxxx>
Date: Thu, 12 Aug 2010 23:43:16 +0200
Subject: [PATCH] Generate libvirt_qemu.def from libvirt_qemu.syms for MinGW builds

---
 configure.ac    |    1 +
 src/.gitignore  |    1 +
 src/Makefile.am |    9 ++++++++-
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index a2dcfa3..3968617 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1873,6 +1873,7 @@ case "$host" in
     # Also set the symbol file to .def, so src/Makefile generates libvirt.def
     # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker
     LIBVIRT_SYMBOL_FILE=libvirt.def
+    LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def
     # mingw's ld has the --version-script parameter, but it requires a .def file
     # instead to work properly, therefore clear --version-script here and use
     # -Wl, to pass the .def file to the linker
diff --git a/src/.gitignore b/src/.gitignore
index 5d114c9..7ea8d89 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -11,6 +11,7 @@ libvirt_parthelper
 libvirt_lxc
 libvirt.def
 libvirt.syms
+libvirt_qemu.def
 *.i
 *.s
 virt-aa-helper
diff --git a/src/Makefile.am b/src/Makefile.am
index a66eb2a..b321657 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1010,7 +1010,7 @@ EXTRA_DIST += \
   libvirt_daemon.syms		\
   libvirt_nwfilter.syms
 
-BUILT_SOURCES += libvirt.syms libvirt.def
+BUILT_SOURCES += libvirt.syms libvirt.def libvirt_qemu.def
 
 libvirt.syms: libvirt_public.syms $(USED_SYM_FILES)
 	$(AM_V_GEN)rm -f $@-tmp $@ ; \
@@ -1033,6 +1033,13 @@ libvirt.def: libvirt.syms
 	chmod a-w $@-tmp && \
 	mv $@-tmp libvirt.def
 
+libvirt_qemu.def: $(srcdir)/libvirt_qemu.syms
+	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
+	printf 'EXPORTS\n' > $@-tmp && \
+	sed -e '/^$$/d; /#/d; /:/d; /\}/d; /\*/d; /LIBVIRT_/d; s/[ \t]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
+	chmod a-w $@-tmp && \
+	mv $@-tmp libvirt_qemu.def
+
 # Empty source list - it merely links a bunch of convenience libs together
 libvirt_la_SOURCES =
 libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]