From 576072fdaf653aff7d708a0d940f14727d3d6a25 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Dec 2012 20:40:35 +0100 Subject: [PATCH 2/2] libcacard: require libtool to build it Do not fail at build time, instead just disable the library if libtool is not present. Signed-off-by: Paolo Bonzini (cherry picked from commit b6fc675b25d32f018870e202eb4b2a6eb509f88b) Conflicts: configure rules.mak --- Makefile | 8 +------- configure | 45 +++++++++++++++++++++++---------------------- libcacard/Makefile | 8 -------- rules.mak | 6 ++---- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/Makefile b/Makefile index 9ecbcbb..c8a35a0 100644 --- a/Makefile +++ b/Makefile @@ -168,14 +168,8 @@ libqemustub.a: $(stub-obj-y) ###################################################################### # Support building shared library libcacard +ifeq ($(CONFIG_SMARTCARD_NSS),y) .PHONY: libcacard.la install-libcacard -ifeq ($(LIBTOOL),) -libcacard.la: - @echo "libtool is missing, please install and rerun configure"; exit 1 - -install-libcacard: - @echo "libtool is missing, please install and rerun configure"; exit 1 -else libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y))) $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,) diff --git a/configure b/configure index cc87f7b..4f0d0e0 100755 --- a/configure +++ b/configure @@ -2832,29 +2832,30 @@ if test "$smartcard" != "no" ; then #include int main(void) { PK11_FreeSlot(0); return 0; } EOF - smartcard_includes="-I\$(SRC_PATH)/libcacard" - libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" - libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" - test_cflags="$libcacard_cflags" - # The header files in nss < 3.13.3 have a bug which causes them to - # emit a warning. If we're going to compile QEMU with -Werror, then - # test that the headers don't have this bug. Otherwise we would pass - # the configure test but fail to compile QEMU later. - if test "$werror" = "yes"; then - test_cflags="-Werror $test_cflags" - fi - if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ - compile_prog "$test_cflags" "$libcacard_libs"; then - smartcard_nss="yes" - QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" - QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" - libs_softmmu="$libcacard_libs $libs_softmmu" - else - if test "$smartcard_nss" = "yes"; then - feature_not_found "nss" - fi - smartcard_nss="no" + smartcard_includes="-I\$(SRC_PATH)/libcacard" + libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" + libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" + test_cflags="$libcacard_cflags" + # The header files in nss < 3.13.3 have a bug which causes them to + # emit a warning. If we're going to compile QEMU with -Werror, then + # test that the headers don't have this bug. Otherwise we would pass + # the configure test but fail to compile QEMU later. + if test "$werror" = "yes"; then + test_cflags="-Werror $test_cflags" + fi + if test -n "$libtool" && + $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + compile_prog "$test_cflags" "$libcacard_libs"; then + smartcard_nss="yes" + QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" + QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" + libs_softmmu="$libcacard_libs $libs_softmmu" + else + if test "$smartcard_nss" = "yes"; then + feature_not_found "nss" fi + smartcard_nss="no" + fi fi fi if test "$smartcard" = "no" ; then diff --git a/libcacard/Makefile b/libcacard/Makefile index c26aac6..2bb5aea 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -28,13 +28,6 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library -ifeq ($(LIBTOOL),) -libcacard.la: - @echo "libtool is missing, please install and rerun configure"; exit 1 - -install-libcacard: - @echo "libtool is missing, please install and rerun configure"; exit 1 -else libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) $(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") @@ -60,4 +53,3 @@ install-libcacard: libcacard.pc libcacard.la vscclient for inc in *.h; do \ $(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ done -endif diff --git a/rules.mak b/rules.mak index d0b04e4..c41c08b 100644 --- a/rules.mak +++ b/rules.mak @@ -18,12 +18,10 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") ifeq ($(LIBTOOL),) -%.lo: %.c - @echo "missing libtool. please install and rerun configure"; exit 1 -else +LIBTOOL = /bin/false +endif %.lo: %.c $(call quiet-command,$(LIBTOOL) --mode=compile --quiet --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") -endif %.o: %.S $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@") -- 1.8.2.1