Skip to content

Commit

Permalink
libcacard: require libtool to build it
Browse files Browse the repository at this point in the history
Do not fail at build time, instead just disable the library if libtool
is not present.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Jan 12, 2013
1 parent e832341 commit b6fc675
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -160,12 +160,14 @@ libqemustub.a: $(stub-obj-y)
######################################################################
# Support building shared library libcacard

ifeq ($(CONFIG_SMARTCARD_NSS),y)
.PHONY: libcacard.la install-libcacard
libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(trace-obj-y)
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)

install-libcacard: libcacard.la
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
endif

######################################################################

Expand Down
3 changes: 2 additions & 1 deletion configure
Expand Up @@ -2824,7 +2824,8 @@ EOF
if test "$werror" = "yes"; then
test_cflags="-Werror $test_cflags"
fi
if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \
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"
Expand Down
8 changes: 0 additions & 8 deletions libcacard/Makefile
Expand Up @@ -31,13 +31,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 --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@")

Expand All @@ -63,4 +56,3 @@ install-libcacard: libcacard.pc libcacard.la vscclient
for inc in *.h; do \
$(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
done
endif
6 changes: 1 addition & 5 deletions rules.mak
Expand Up @@ -21,11 +21,7 @@ QEMU_CFLAGS += -I$(<D) -I$(@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
%.lo: %.dtrace
@echo "missing libtool. please install and rerun configure."; exit 1

LIBTOOL = /bin/false
LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
$(sort $(filter %.o, $1)) $(filter-out %.o, $1) \
$(LIBS)," LINK $(TARGET_DIR)$@")
Expand Down

0 comments on commit b6fc675

Please sign in to comment.