build: fix up some compiler flags

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.
This commit is contained in:
Eric Blake 2010-05-14 16:45:52 -06:00
parent 0641f0f72c
commit 6e5b5bbc0a
4 changed files with 10 additions and 8 deletions

View File

@ -78,7 +78,9 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
AC_MSG_RESULT($complCFLAGS) AC_MSG_RESULT($complCFLAGS)
WARN_CFLAGS="$COMPILER_FLAGS $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 dnl Needed to keep compile quiet on python 2.4
COMPILER_FLAGS= COMPILER_FLAGS=

View File

@ -32,9 +32,9 @@ libvirt_proxy_SOURCES = libvirt_proxy.c \
@top_srcdir@/src/xen/xen_hypervisor.c \ @top_srcdir@/src/xen/xen_hypervisor.c \
@top_srcdir@/src/xen/sexpr.c \ @top_srcdir@/src/xen/sexpr.c \
@top_srcdir@/src/xen/xs_internal.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_DEPENDENCIES =
libvirt_proxy_LDADD = ../gnulib/lib/libgnu.la $(LIB_PTHREAD) libvirt_proxy_LDADD = ../gnulib/lib/libgnu.la $(XEN_LIBS) $(LIB_PTHREAD)
install-exec-hook: install-exec-hook:
chmod u+s $(DESTDIR)$(libexecdir)/libvirt_proxy chmod u+s $(DESTDIR)$(libexecdir)/libvirt_proxy

View File

@ -1004,7 +1004,7 @@ if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_parthelper libexec_PROGRAMS += libvirt_parthelper
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES) 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_LDADD = $(LIBPARTED_LIBS)
libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS) libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS)
endif endif
@ -1024,7 +1024,7 @@ libvirt_lxc_SOURCES = \
$(DOMAIN_CONF_SOURCES) \ $(DOMAIN_CONF_SOURCES) \
$(CPU_CONF_SOURCES) \ $(CPU_CONF_SOURCES) \
$(NWFILTER_PARAM_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) \ libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \
$(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \ $(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \
../gnulib/lib/libgnu.la ../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_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
virt_aa_helper_LDFLAGS = $(WARN_CFLAGS) virt_aa_helper_LDFLAGS = $(WARN_LDFLAGS)
virt_aa_helper_LDADD = \ virt_aa_helper_LDADD = \
$(LIBXML_LIBS) \ $(LIBXML_LIBS) \
libvirt_conf.la \ libvirt_conf.la \

View File

@ -34,14 +34,14 @@ virsh_SOURCES = \
console.c console.h \ console.c console.h \
virsh.c virsh.c
virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) virsh_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
virsh_LDADD = \ virsh_LDADD = \
$(STATIC_BINARIES) \ $(STATIC_BINARIES) \
$(WARN_CFLAGS) \ $(WARN_CFLAGS) \
../src/libvirt.la \ ../src/libvirt.la \
../gnulib/lib/libgnu.la \ ../gnulib/lib/libgnu.la \
$(VIRSH_LIBS) $(VIRSH_LIBS)
virsh_CFLAGS = \ virsh_CFLAGS = \
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \ -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
-I../include -I$(top_srcdir)/include \ -I../include -I$(top_srcdir)/include \
-I$(top_srcdir)/src \ -I$(top_srcdir)/src \