Revision b7b8c618

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
345 345
trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
346 346
	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN trace-dtrace.o")
347 347

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

  
348 356
simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
349 357

  
350 358
ifeq ($(TRACE_BACKEND),dtrace)
b/configure
1279 1279
fi
1280 1280

  
1281 1281
##########################################
1282
# libtool probe
1283

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

  
1290
##########################################
1282 1291
# Sparse probe
1283 1292
if test "$sparse" != "no" ; then
1284 1293
  if has cgcc; then
......
3063 3072
echo "OBJCOPY=$objcopy" >> $config_host_mak
3064 3073
echo "LD=$ld" >> $config_host_mak
3065 3074
echo "WINDRES=$windres" >> $config_host_mak
3075
echo "LIBTOOL=$libtool" >> $config_host_mak
3066 3076
echo "CFLAGS=$CFLAGS" >> $config_host_mak
3067 3077
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
3068 3078
echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
......
3598 3608
    # out of tree build
3599 3609
    mkdir -p libcacard
3600 3610
    rm -f libcacard/Makefile
3601
    ln -s "$source_path/libcacard/Makefile" libcacard/Makefile
3611
    symlink "$source_path/libcacard/Makefile" libcacard/Makefile
3602 3612
fi
3603 3613

  
3604 3614
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