summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorJuan Quintela2009-07-22 22:37:39 +0200
committerAnthony Liguori2009-07-27 21:10:56 +0200
commitfa282484b373f4c5751cb46fb2daa8ba0245fe5c (patch)
tree9f793afab13945c7faa3dacf978301ee779abdfe /configure
parentour build system don't support mips little endian linux-user or bsd-user (diff)
downloadqemu-fa282484b373f4c5751cb46fb2daa8ba0245fe5c.tar.gz
qemu-fa282484b373f4c5751cb46fb2daa8ba0245fe5c.tar.xz
qemu-fa282484b373f4c5751cb46fb2daa8ba0245fe5c.zip
generate LDFLAGS for *-linux-user and *-bsd-user in a single place in configure
Remove lots of duplicate code in the process Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure39
1 files changed, 39 insertions, 0 deletions
diff --git a/configure b/configure
index 8fb74a11e7..02cf9e7744 100755
--- a/configure
+++ b/configure
@@ -2042,6 +2042,45 @@ if test "$target_bsd_user" = "yes" ; then
echo "CONFIG_BSD_USER=y" >> $config_mak
fi
+# generate LDFLAGS for targets
+
+ldflags=""
+if test "$target_linux_user" = "yes" -o "$target_linux_user" = "yes" ; then
+ case "$ARCH" in
+ i386)
+ if test "$gprof" = "yes" -o "$static" = "yes" ; then
+ ldflags='-Wl,-T,$(SRC_PATH)/$(ARCH).ld'
+ else
+ # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
+ # that the kernel ELF loader considers as an executable. I think this
+ # is the simplest way to make it self virtualizable!
+ ldflags='-Wl,-shared'
+ fi
+ ;;
+ sparc)
+ # -static is used to avoid g1/g3 usage by the dynamic linker
+ ldflags='-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static'
+ ;;
+ ia64)
+ ldflags='-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld -static'
+ ;;
+ x86_64|ppc|ppc64|s390|sparc64|alpha|arm|m68k|mips|mips64)
+ ldflags='-Wl,-T,$(SRC_PATH)/$(ARCH).ld'
+ ;;
+ esac
+fi
+if test "$target_softmmu" = "yes" ; then
+ case "$ARCH" in
+ ia64)
+ ldflags='-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld -static'
+ ;;
+ esac
+fi
+
+if test "$ldflags" != "" ; then
+ echo "LDFLAGS+=$ldflags" >> $config_mak
+fi
+
echo "/* Automatically generated by configure - do not modify */" > $config_h
echo "#include \"../config-host.h\"" >> $config_h