Revision 44dc0ca3

b/Makefile
119 119

  
120 120
version-obj-$(CONFIG_WIN32) += version.o
121 121
######################################################################
122
# Support building shared library libcacard
123

  
124
.PHONY: libcacard.la install-libcacard
125
ifeq ($(LIBTOOL),)
126
libcacard.la:
127
	@echo "libtool is missing, please install and rerun configure"; exit 1
128

  
129
install-libcacard:
130
	@echo "libtool is missing, please install and rerun configure"; exit 1
131
else
132
libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
133
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
134

  
135
install-libcacard: libcacard.la
136
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
137
endif
138
######################################################################
122 139

  
123 140
qemu-img.o: qemu-img-cmds.h
124 141
qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o: $(GENERATED_HEADERS)
......
149 166
# avoid old build problems by removing potentially incorrect old files
150 167
	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
151 168
	rm -f qemu-options.def
152
	rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~
169
	rm -f *.o *.d *.a *.lo $(TOOLS) TAGS cscope.* *.pod *~ */*~
170
	rm -Rf .libs
153 171
	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d
154 172
	rm -f qemu-img-cmds.h
155 173
	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
b/Makefile.objs
347 347
trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
348 348
	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN trace-dtrace.o")
349 349

  
350
ifeq ($(LIBTOOL),)
351
trace-dtrace.lo: trace-dtrace.dtrace
352
	@echo "missing libtool. please install and rerun configure."; exit 1
353
else
354
trace-dtrace.lo: trace-dtrace.dtrace
355
	$(call quiet-command,libtool --mode=compile --tag=CC dtrace -o $@ -G -s $<, "  lt GEN trace-dtrace.o")
356
endif
357

  
350 358
simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
351 359

  
352 360
ifeq ($(TRACE_BACKEND),dtrace)
b/configure
1280 1280
fi
1281 1281

  
1282 1282
##########################################
1283
# libtool probe
1284

  
1285
if ! has libtool; then
1286
    libtool=
1287
else
1288
    libtool=libtool
1289
fi
1290

  
1291
##########################################
1283 1292
# Sparse probe
1284 1293
if test "$sparse" != "no" ; then
1285 1294
  if has cgcc; then
......
3047 3056
echo "OBJCOPY=$objcopy" >> $config_host_mak
3048 3057
echo "LD=$ld" >> $config_host_mak
3049 3058
echo "WINDRES=$windres" >> $config_host_mak
3059
echo "LIBTOOL=$libtool" >> $config_host_mak
3050 3060
echo "CFLAGS=$CFLAGS" >> $config_host_mak
3051 3061
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
3052 3062
echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
......
3580 3590
    # out of tree build
3581 3591
    mkdir -p libcacard
3582 3592
    rm -f libcacard/Makefile
3583
    ln -s "$source_path/libcacard/Makefile" libcacard/Makefile
3593
    symlink "$source_path/libcacard/Makefile" libcacard/Makefile
3584 3594
fi
3585 3595

  
3586 3596
d=libuser
b/libcacard/Makefile
4 4

  
5 5
$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/libcacard)
6 6

  
7
QEMU_OBJS=$(addprefix ../, $(oslib-obj-y) $(trace-obj-y) qemu-malloc.o qemu-timer-common.o)
7
# objects linked against normal qemu binaries, not compiled with libtool
8
QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(trace-obj-y))
9

  
10
# objects linked into a shared library, built with libtool with -fPIC if required
11
QEMU_OBJS_LIB=$(addsuffix .lo,$(basename $(QEMU_OBJS)))
8 12

  
9 13
QEMU_CFLAGS+=-I../
10 14

  
15
libcacard.lib-y=$(addsuffix .lo,$(basename $(libcacard-y)))
16

  
11 17
vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o
12
	$(call quiet-command,$(CC) $(libcacard_libs) -lrt -o $@ $^,"  LINK  $(TARGET_DIR)$@")
18
	$(call quiet-command,$(CC) $(libcacard_libs) -lrt -o $@ $^,"  LINK  $@")
19

  
20
clean:
21
	rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la
22
	rm -Rf .libs
13 23

  
14 24
all: vscclient
15 25

  
16
clean:
17
	rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient
26
#########################################################################
27
# Rules for building libcacard standalone library
28

  
29
ifeq ($(LIBTOOL),)
30
libcacard.la:
31
	@echo "libtool is missing, please install and rerun configure"; exit 1
32

  
33
install-libcacard:
34
	@echo "libtool is missing, please install and rerun configure"; exit 1
35
else
36
libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
37
	$(call quiet-command,libtool --mode=link --quiet --tag=CC $(CC) $(libcacard_libs) -lrt -rpath $(libdir) -o $@ $^,"  lt LINK $@")
18 38

  
39
install-libcacard: libcacard.la
40
	$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
41
	libtool --mode=install $(INSTALL_PROG) libcacard.la "$(DESTDIR)$(libdir)"
42
endif
b/rules.mak
17 17
%.o: %.c
18 18
	$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  CC    $(TARGET_DIR)$@")
19 19

  
20
ifeq ($(LIBTOOL),)
21
%.lo: %.c
22
	@echo "missing libtool. please install and rerun configure"; exit 1
23
else
24
%.lo: %.c
25
	$(call quiet-command,libtool --mode=compile --quiet --tag=CC $(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  lt CC $@")
26
endif
27

  
20 28
%.o: %.S
21 29
	$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  AS    $(TARGET_DIR)$@")
22 30

  

Also available in: Unified diff