]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: fix up some compiler flags
authorEric Blake <eblake@redhat.com>
Fri, 14 May 2010 22:45:52 +0000 (16:45 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 17 May 2010 15:12:42 +0000 (09:12 -0600)
Matthias noted that the line:
virt_aa_helper_LDFLAGS = $(WARN_CFLAGS)
looks inconsistent, so I did an audit.

Currently, the set of compiler warning flags passed to gcc as $CC are
equally permitted as the set of linker flags passed to gcc as $LD, so
there was no problem with that usage.  But if we ever get in a
situation where $CC and $LD treat particular flags differently, using
the right variable form will make it easier.

In the process, I spotted a couple of typos that were omitting useful
flags, as well as specifying a -l under the wrong variable.

* acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Define WARN_LDFLAGS as
an alias for WARN_CFLAGS.
* tools/Makefile.am (virsh_LDFLAGS): Use more canonical spelling.
* proxy/Makefile.am (libvirt_proxy_LDFLAGS): Likewise. Move
library...
(libvirt_proxy_LDADD): ...here.
* src/Makefile.am (virt_aa_helper_LDFLAGS): Use more canonical
spelling of WARN_LDFLAGS.
(libvirt_parthelper_LDFLAGS, libvirt_lxc_LDFLAGS): Likewise.  Use
correct spelling of COVERAGE_LDFLAGS.
Reported by Matthias Bolte.

acinclude.m4
proxy/Makefile.am
src/Makefile.am
tools/Makefile.am

index 7fa2d679a2843023625b4cccaa994b5ae93c0599..8c97184505d0868a58035a385992b0441b48a733 100644 (file)
@@ -78,7 +78,9 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
     AC_MSG_RESULT($complCFLAGS)
 
     WARN_CFLAGS="$COMPILER_FLAGS $complCFLAGS"
-    AC_SUBST(WARN_CFLAGS)
+    WARN_LDFLAGS=$WARN_CFLAGS
+    AC_SUBST([WARN_CFLAGS])
+    AC_SUBST([WARN_LDFLAGS])
 
     dnl Needed to keep compile quiet on python 2.4
     COMPILER_FLAGS=
index bee47d077543c882b1db14a908e4f1510f52a37e..471668348b2dd7f63e032d8e7a3cc7d6552747e7 100644 (file)
@@ -32,9 +32,9 @@ libvirt_proxy_SOURCES = libvirt_proxy.c \
            @top_srcdir@/src/xen/xen_hypervisor.c \
            @top_srcdir@/src/xen/sexpr.c  \
             @top_srcdir@/src/xen/xs_internal.c
-libvirt_proxy_LDFLAGS = $(WARN_CFLAGS) $(XEN_LIBS)
+libvirt_proxy_LDFLAGS = $(WARN_LDFLAGS)
 libvirt_proxy_DEPENDENCIES =
-libvirt_proxy_LDADD = ../gnulib/lib/libgnu.la $(LIB_PTHREAD)
+libvirt_proxy_LDADD = ../gnulib/lib/libgnu.la $(XEN_LIBS) $(LIB_PTHREAD)
 
 install-exec-hook:
        chmod u+s $(DESTDIR)$(libexecdir)/libvirt_proxy
index 15bc8fcb2be0ab2d65a0b460b71544f6c932c9d6..1c7d3e87cb4fbd9d88a4b25ab795dce95d04fb60 100644 (file)
@@ -1004,7 +1004,7 @@ if WITH_LIBVIRTD
 libexec_PROGRAMS += libvirt_parthelper
 
 libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
-libvirt_parthelper_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS)
+libvirt_parthelper_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
 libvirt_parthelper_LDADD = $(LIBPARTED_LIBS)
 libvirt_parthelper_CFLAGS =  $(LIBPARTED_CFLAGS)
 endif
@@ -1024,7 +1024,7 @@ libvirt_lxc_SOURCES =                                             \
                $(DOMAIN_CONF_SOURCES)                          \
                $(CPU_CONF_SOURCES)                             \
                $(NWFILTER_PARAM_CONF_SOURCES)
-libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS)
+libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
 libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \
                $(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \
                ../gnulib/lib/libgnu.la
@@ -1044,7 +1044,7 @@ libexec_PROGRAMS += virt-aa-helper
 
 virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
 
-virt_aa_helper_LDFLAGS = $(WARN_CFLAGS)
+virt_aa_helper_LDFLAGS = $(WARN_LDFLAGS)
 virt_aa_helper_LDADD =                                         \
                $(LIBXML_LIBS)                                  \
                libvirt_conf.la                                 \
index 33a3216c05c6ee69bff6fe4234d32d48c1f0fa85..fd05e8bd26ca827260b99777d115e0118878645c 100644 (file)
@@ -34,14 +34,14 @@ virsh_SOURCES =                                                     \
                console.c console.h                             \
                virsh.c
 
-virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
+virsh_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
 virsh_LDADD =                                                  \
                $(STATIC_BINARIES)                              \
                $(WARN_CFLAGS)                                  \
                ../src/libvirt.la                               \
                ../gnulib/lib/libgnu.la                         \
                $(VIRSH_LIBS)
-virsh_CFLAGS =                                                         \
+virsh_CFLAGS =                                                 \
                -I$(top_srcdir)/gnulib/lib -I../gnulib/lib      \
                -I../include -I$(top_srcdir)/include            \
                -I$(top_srcdir)/src                             \