buildsys: Move -lnettle and -lgnutls to per object variables
cover buildsys: Move -lnettle and -lgnutls to per object variables
Not all targets need the flags and libs of nettle/gnutls, so move them out from global variables, as done with other libraries.
Fam Zheng (2):
buildsys: Move nettle cflags/libs to per object
buildsys: Move gnutls cflags/libs to per object
configure | 9 ++++----- crypto/Makefile.objs | 13 +++++++++++++ tests/Makefile.include | 10 +++++----- 3 files changed, 22 insertions(+), 10 deletions(-)
Signature · 1 line
2.13.5
PATCH 1/2 buildsys: Move nettle cflags/libs to per object
Signed-off-by Fam Zheng <[email protected]>
--- configure | 5 ++--- crypto/Makefile.objs | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-)
configure +2 -3
@@ -2616,9 +2616,6 @@ if test "$nettle" != "no"; then nettle_cflags=$($pkg_config --cflags nettle) nettle_libs=$($pkg_config --libs nettle) nettle_version=$($pkg_config --modversion nettle) - libs_softmmu="$nettle_libs $libs_softmmu" - libs_tools="$nettle_libs $libs_tools" - QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags" nettle="yes" cat > $TMPC << EOF
@@ -5732,6 +5729,8 @@ if test "$nettle" = "yes" ; then if test "$nettle_kdf" = "yes" ; then echo "CONFIG_NETTLE_KDF=y" >> $config_host_mak fi + echo "NETTLE_CFLAGS=$nettle_cflags" >> $config_host_mak + echo "NETTLE_LIBS=$nettle_libs" >> $config_host_mak fi if test "$tasn1" = "yes" ; then echo "CONFIG_TASN1=y" >> $config_host_mak
crypto/Makefile.objs +6 -0
@@ -34,6 +34,12 @@ crypto-obj-y += block.o crypto-obj-y += block-qcow.o crypto-obj-y += block-luks.o +$(if $(CONFIG_NETTLE), \ + $(foreach x, cipher hash-nettle hmac-nettle pbkdf-nettle, \ + $(eval $x.o-cflags := $(NETTLE_CFLAGS)) \ + $(eval $x.o-libs := $(NETTLE_LIBS))) \ +) + # Let the userspace emulators avoid linking gnutls/etc crypto-aes-obj-y = aes.o
Signature · 1 line
2.13.5
PATCH 2/2 buildsys: Move gnutls cflags/libs to per object
In reply to Fam ZhengSigned-off-by Fam Zheng <[email protected]>
--- configure | 4 ++-- crypto/Makefile.objs | 7 +++++++ tests/Makefile.include | 10 +++++----- 3 files changed, 14 insertions(+), 7 deletions(-)
configure +2 -2
@@ -2472,8 +2472,6 @@ if test "$gnutls" != "no"; then if gnutls_works; then gnutls_cflags=$($pkg_config --cflags gnutls) gnutls_libs=$($pkg_config --libs gnutls) - libs_softmmu="$gnutls_libs $libs_softmmu" - libs_tools="$gnutls_libs $libs_tools" QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags" gnutls="yes"
@@ -5710,6 +5708,8 @@ fi echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak if test "$gnutls" = "yes" ; then echo "CONFIG_GNUTLS=y" >> $config_host_mak + echo "GNUTLS_CFLAGS=$gnutls_cflags" >> $config_host_mak + echo "GNUTLS_LIBS=$gnutls_libs" >> $config_host_mak fi if test "$gnutls_rnd" = "yes" ; then echo "CONFIG_GNUTLS_RND=y" >> $config_host_mak
crypto/Makefile.objs +7 -0
@@ -40,6 +40,13 @@ $(if $(CONFIG_NETTLE), \ $(eval $x.o-libs := $(NETTLE_LIBS))) \ ) +$(if $(CONFIG_GNUTLS), \ + $(foreach x, init random-gnutls tlscreds tlscredsanon \ + tlscredsx509 tlssession, \ + $(eval $x.o-cflags := $(GNUTLS_CFLAGS)) \ + $(eval $x.o-libs := $(GNUTLS_LIBS))) \ +) + # Let the userspace emulators avoid linking gnutls/etc crypto-aes-obj-y = aes.o
tests/Makefile.include +5 -5
@@ -677,15 +677,15 @@ tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-c tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y) tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y) -tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS) -tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS) -tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS) +tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS) +tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS) $(GNUTLS_LIBS) +tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_LIBS) -tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS) +tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS) tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \ tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y) -tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS) +tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS) $(GNUTLS_CFLAGS) tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \ tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y) tests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y)
Signature · 1 line
2.13.5
Quoted 6 lines · Fam Zheng
Not all targets need the flags and libs of nettle/gnutls, so move them out from global variables, as done with other libraries.
Fam Zheng (2):
buildsys: Move nettle cflags/libs to per object
buildsys: Move gnutls cflags/libs to per object
The same change for 'gcrypt' is needed
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|