Commit 43ce4dfe9efd48694cc7e9312f4e845304b2e532

Authored by bellard
1 parent ebc06f87

added static build option


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@229 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 21 additions and 8 deletions
Makefile
... ... @@ -6,6 +6,10 @@ LIBS=
6 6 DEFINES=-DHAVE_BYTESWAP_H
7 7 HELPER_CFLAGS=$(CFLAGS)
8 8  
  9 +ifdef CONFIG_STATIC
  10 +LDFLAGS+=-static
  11 +endif
  12 +
9 13 ifeq ($(ARCH),i386)
10 14 CFLAGS+=-fomit-frame-pointer
11 15 OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
... ...
configure
... ... @@ -20,6 +20,7 @@ TMPH="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.h"
20 20 # default parameters
21 21 prefix="/usr/local"
22 22 interp_prefix="/usr/gnemul/qemu-i386"
  23 +static="no"
23 24 cross_prefix=""
24 25 cc="gcc"
25 26 host_cc="gcc"
... ... @@ -104,6 +105,8 @@ for opt do
104 105 ;;
105 106 --enable-gprof) gprof="yes"
106 107 ;;
  108 + --static) static="yes"
  109 + ;;
107 110 esac
108 111 done
109 112  
... ... @@ -176,19 +179,22 @@ echo " --source-path=PATH path of source code [$source_path]"
176 179 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
177 180 echo " --cc=CC use C compiler CC [$cc]"
178 181 echo " --make=MAKE use specified make [$make]"
  182 +echo " --static enable static build [$static]"
179 183 echo ""
180 184 echo "NOTE: The object files are build at the place where configure is launched"
181 185 exit 1
182 186 fi
183 187  
184   -echo "Install prefix $prefix"
185   -echo "Source path $source_path"
186   -echo "C compiler $cc"
187   -echo "make $make"
188   -echo "host CPU $cpu"
189   -echo "Big Endian $bigendian"
190   -echo "target CPU $target_cpu"
191   -echo "gprof enabled $gprof"
  188 +echo "Install prefix $prefix"
  189 +echo "Source path $source_path"
  190 +echo "ELF interp prefix $interp_prefix"
  191 +echo "C compiler $cc"
  192 +echo "make $make"
  193 +echo "host CPU $cpu"
  194 +echo "Big Endian $bigendian"
  195 +echo "target CPU $target_cpu"
  196 +echo "gprof enabled $gprof"
  197 +echo "static build $static"
192 198  
193 199 echo "Creating config.mak and config.h"
194 200  
... ... @@ -244,6 +250,9 @@ if test "$gprof" = "yes" ; then
244 250 echo "TARGET_GPROF=yes" >> config.mak
245 251 echo "#define HAVE_GPROF 1" >> $TMPH
246 252 fi
  253 +if test "$static" = "yes" ; then
  254 + echo "CONFIG_STATIC=yes" >> config.mak
  255 +fi
247 256 echo -n "VERSION=" >>config.mak
248 257 head $source_path/VERSION >>config.mak
249 258 echo "" >>config.mak
... ...