mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
do not pass bogus $(SRC_PATH) include paths to cc during configure
Non-existent -I paths are dropped silently by the compiler, but still it is not polite to pass bogus options. Configure-time tests do not need any include files from the source path, so only include -I flags at make time (when they're properly expanded). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
8d05095cec
commit
f9728943ff
3 changed files with 16 additions and 12 deletions
19
configure
vendored
19
configure
vendored
|
@ -217,7 +217,7 @@ QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $
|
||||||
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
|
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
|
||||||
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
|
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
|
||||||
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
|
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
|
||||||
QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS"
|
QEMU_INCLUDES="-I. -I\$(SRC_PATH)"
|
||||||
LDFLAGS="-g $LDFLAGS"
|
LDFLAGS="-g $LDFLAGS"
|
||||||
|
|
||||||
check_define() {
|
check_define() {
|
||||||
|
@ -2545,7 +2545,7 @@ if test $profiler = "yes" ; then
|
||||||
fi
|
fi
|
||||||
if test "$slirp" = "yes" ; then
|
if test "$slirp" = "yes" ; then
|
||||||
echo "CONFIG_SLIRP=y" >> $config_host_mak
|
echo "CONFIG_SLIRP=y" >> $config_host_mak
|
||||||
QEMU_CFLAGS="-I\$(SRC_PATH)/slirp $QEMU_CFLAGS"
|
QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
|
||||||
fi
|
fi
|
||||||
if test "$vde" = "yes" ; then
|
if test "$vde" = "yes" ; then
|
||||||
echo "CONFIG_VDE=y" >> $config_host_mak
|
echo "CONFIG_VDE=y" >> $config_host_mak
|
||||||
|
@ -2781,6 +2781,7 @@ echo "LD=$ld" >> $config_host_mak
|
||||||
echo "WINDRES=$windres" >> $config_host_mak
|
echo "WINDRES=$windres" >> $config_host_mak
|
||||||
echo "CFLAGS=$CFLAGS" >> $config_host_mak
|
echo "CFLAGS=$CFLAGS" >> $config_host_mak
|
||||||
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
|
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
|
||||||
|
echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
|
||||||
if test "$sparse" = "yes" ; then
|
if test "$sparse" = "yes" ; then
|
||||||
echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
|
echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
|
||||||
echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
|
echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
|
||||||
|
@ -3089,19 +3090,20 @@ fi
|
||||||
# generate QEMU_CFLAGS/LDFLAGS for targets
|
# generate QEMU_CFLAGS/LDFLAGS for targets
|
||||||
|
|
||||||
cflags=""
|
cflags=""
|
||||||
|
includes=""
|
||||||
ldflags=""
|
ldflags=""
|
||||||
|
|
||||||
if test "$ARCH" = "sparc64" ; then
|
if test "$ARCH" = "sparc64" ; then
|
||||||
cflags="-I\$(SRC_PATH)/tcg/sparc $cflags"
|
includes="-I\$(SRC_PATH)/tcg/sparc $includes"
|
||||||
elif test "$ARCH" = "s390x" ; then
|
elif test "$ARCH" = "s390x" ; then
|
||||||
cflags="-I\$(SRC_PATH)/tcg/s390 $cflags"
|
includes="-I\$(SRC_PATH)/tcg/s390 $includes"
|
||||||
elif test "$ARCH" = "x86_64" ; then
|
elif test "$ARCH" = "x86_64" ; then
|
||||||
cflags="-I\$(SRC_PATH)/tcg/i386 $cflags"
|
includes="-I\$(SRC_PATH)/tcg/i386 $includes"
|
||||||
else
|
else
|
||||||
cflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags"
|
includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes"
|
||||||
fi
|
fi
|
||||||
cflags="-I\$(SRC_PATH)/tcg $cflags"
|
includes="-I\$(SRC_PATH)/tcg $includes"
|
||||||
cflags="-I\$(SRC_PATH)/fpu $cflags"
|
includes="-I\$(SRC_PATH)/fpu $includes"
|
||||||
|
|
||||||
if test "$target_user_only" = "yes" ; then
|
if test "$target_user_only" = "yes" ; then
|
||||||
libdis_config_mak=libdis-user/config.mak
|
libdis_config_mak=libdis-user/config.mak
|
||||||
|
@ -3226,6 +3228,7 @@ fi
|
||||||
|
|
||||||
echo "LDFLAGS+=$ldflags" >> $config_target_mak
|
echo "LDFLAGS+=$ldflags" >> $config_target_mak
|
||||||
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
|
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
|
||||||
|
echo "QEMU_INCLUDES+=$includes" >> $config_target_mak
|
||||||
|
|
||||||
done # for target in $targets
|
done # for target in $targets
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,13 @@ MAKEFLAGS += -rR
|
||||||
QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
|
QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
|
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
|
||||||
|
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@")
|
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@")
|
||||||
|
|
||||||
%.o: %.m
|
%.o: %.m
|
||||||
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
|
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
|
||||||
|
|
||||||
LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@")
|
LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@")
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ QEMU=../i386-linux-user/qemu-i386
|
||||||
QEMU_X86_64=../x86_64-linux-user/qemu-x86_64
|
QEMU_X86_64=../x86_64-linux-user/qemu-x86_64
|
||||||
CC_X86_64=$(CC_I386) -m64
|
CC_X86_64=$(CC_I386) -m64
|
||||||
|
|
||||||
CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I..
|
QEMU_INCLUDES += -I..
|
||||||
|
CFLAGS=-Wall -O2 -g -fno-strict-aliasing
|
||||||
#CFLAGS+=-msse2
|
#CFLAGS+=-msse2
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue