提交 de3a354a 编写于 作者: M Michael Walle 提交者: Aurelien Jarno

configure: support target dependent linking

This patch is the first attempt to make configure more intelligent with
regard to how it links to libraries. It divides the softmmu libraries into
two lists, a general one and a list which depends on the target
architecture.
Signed-off-by: NMichael Walle <michael@walle.cc>
Reviewed-by: NAurelien Jarno <aurelien@aurel32.net>
Acked-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 1a924df6
...@@ -1946,11 +1946,11 @@ int main(void) { return 0; } ...@@ -1946,11 +1946,11 @@ int main(void) { return 0; }
EOF EOF
if compile_prog "" "$fdt_libs" ; then if compile_prog "" "$fdt_libs" ; then
fdt=yes fdt=yes
libs_softmmu="$fdt_libs $libs_softmmu"
else else
if test "$fdt" = "yes" ; then if test "$fdt" = "yes" ; then
feature_not_found "fdt" feature_not_found "fdt"
fi fi
fdt_libs=
fdt=no fdt=no
fi fi
fi fi
...@@ -1967,11 +1967,11 @@ int main(void) { GL_VERSION; return 0; } ...@@ -1967,11 +1967,11 @@ int main(void) { GL_VERSION; return 0; }
EOF EOF
if compile_prog "" "-lGL" ; then if compile_prog "" "-lGL" ; then
opengl=yes opengl=yes
libs_softmmu="$opengl_libs $libs_softmmu"
else else
if test "$opengl" = "yes" ; then if test "$opengl" = "yes" ; then
feature_not_found "opengl" feature_not_found "opengl"
fi fi
opengl_libs=
opengl=no opengl=no
fi fi
fi fi
...@@ -3079,6 +3079,7 @@ target_short_alignment=2 ...@@ -3079,6 +3079,7 @@ target_short_alignment=2
target_int_alignment=4 target_int_alignment=4
target_long_alignment=4 target_long_alignment=4
target_llong_alignment=8 target_llong_alignment=8
target_libs_softmmu=
TARGET_ARCH="$target_arch2" TARGET_ARCH="$target_arch2"
TARGET_BASE_ARCH="" TARGET_BASE_ARCH=""
...@@ -3112,6 +3113,7 @@ case "$target_arch2" in ...@@ -3112,6 +3113,7 @@ case "$target_arch2" in
;; ;;
lm32) lm32)
target_phys_bits=32 target_phys_bits=32
target_libs_softmmu="$opengl_libs"
;; ;;
m68k) m68k)
bflt="yes" bflt="yes"
...@@ -3126,6 +3128,7 @@ case "$target_arch2" in ...@@ -3126,6 +3128,7 @@ case "$target_arch2" in
bflt="yes" bflt="yes"
target_nptl="yes" target_nptl="yes"
target_phys_bits=32 target_phys_bits=32
target_libs_softmmu="$fdt_libs"
;; ;;
mips|mipsel) mips|mipsel)
TARGET_ARCH=mips TARGET_ARCH=mips
...@@ -3150,6 +3153,7 @@ case "$target_arch2" in ...@@ -3150,6 +3153,7 @@ case "$target_arch2" in
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
target_phys_bits=32 target_phys_bits=32
target_nptl="yes" target_nptl="yes"
target_libs_softmmu="$fdt_libs"
;; ;;
ppcemb) ppcemb)
TARGET_BASE_ARCH=ppc TARGET_BASE_ARCH=ppc
...@@ -3157,6 +3161,7 @@ case "$target_arch2" in ...@@ -3157,6 +3161,7 @@ case "$target_arch2" in
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
target_phys_bits=64 target_phys_bits=64
target_nptl="yes" target_nptl="yes"
target_libs_softmmu="$fdt_libs"
;; ;;
ppc64) ppc64)
TARGET_BASE_ARCH=ppc TARGET_BASE_ARCH=ppc
...@@ -3164,6 +3169,7 @@ case "$target_arch2" in ...@@ -3164,6 +3169,7 @@ case "$target_arch2" in
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
target_phys_bits=64 target_phys_bits=64
target_long_alignment=8 target_long_alignment=8
target_libs_softmmu="$fdt_libs"
;; ;;
ppc64abi32) ppc64abi32)
TARGET_ARCH=ppc64 TARGET_ARCH=ppc64
...@@ -3172,6 +3178,7 @@ case "$target_arch2" in ...@@ -3172,6 +3178,7 @@ case "$target_arch2" in
echo "TARGET_ABI32=y" >> $config_target_mak echo "TARGET_ABI32=y" >> $config_target_mak
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
target_phys_bits=64 target_phys_bits=64
target_libs_softmmu="$fdt_libs"
;; ;;
sh4|sh4eb) sh4|sh4eb)
TARGET_ARCH=sh4 TARGET_ARCH=sh4
...@@ -3257,7 +3264,7 @@ fi ...@@ -3257,7 +3264,7 @@ fi
if test "$target_softmmu" = "yes" ; then if test "$target_softmmu" = "yes" ; then
echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak
echo "CONFIG_SOFTMMU=y" >> $config_target_mak echo "CONFIG_SOFTMMU=y" >> $config_target_mak
echo "LIBS+=$libs_softmmu" >> $config_target_mak echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak
echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak
echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册