Commit 11d9f695e710b406a487daf3fb83f82dea314063
1 parent
0c607d57
win32 cross compile fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@694 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
67 additions
and
40 deletions
Makefile
| ... | ... | @@ -16,14 +16,11 @@ all: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu.1 |
| 16 | 16 | make -C $$d $@ || exit 1 ; \ |
| 17 | 17 | done |
| 18 | 18 | |
| 19 | -qemu-mkcow: qemu-mkcow.o | |
| 20 | - $(HOST_CC) -o $@ $^ $(LIBS) | |
| 19 | +qemu-mkcow: qemu-mkcow.c | |
| 20 | + $(CC) $(CFLAGS) $(DEFINES) -o $@ $^ $(LIBS) | |
| 21 | 21 | |
| 22 | -dyngen$(EXESUF): dyngen.o | |
| 23 | - $(HOST_CC) -o $@ $^ $(LIBS) | |
| 24 | - | |
| 25 | -%.o: %.c | |
| 26 | - $(HOST_CC) $(CFLAGS) $(DEFINES) -c -o $@ $< | |
| 22 | +dyngen$(EXESUF): dyngen.c | |
| 23 | + $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ | |
| 27 | 24 | |
| 28 | 25 | clean: |
| 29 | 26 | # avoid old build problems by removing potentially incorrect old files |
| ... | ... | @@ -41,13 +38,17 @@ distclean: clean |
| 41 | 38 | done |
| 42 | 39 | |
| 43 | 40 | install: all |
| 44 | - mkdir -p $(prefix)/bin | |
| 45 | - install -m 755 -s $(TOOLS) $(prefix)/bin | |
| 46 | - mkdir -p $(sharedir) | |
| 41 | + mkdir -p "$(bindir)" | |
| 42 | +ifndef CONFIG_WIN32 | |
| 43 | + install -m 755 -s $(TOOLS) "$(bindir)" | |
| 44 | +endif | |
| 45 | + mkdir -p "$(sharedir)" | |
| 47 | 46 | install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \ |
| 48 | - pc-bios/linux_boot.bin $(sharedir) | |
| 49 | - mkdir -p $(mandir)/man1 | |
| 50 | - install qemu.1 qemu-mkcow.1 $(mandir)/man1 | |
| 47 | + pc-bios/linux_boot.bin "$(sharedir)" | |
| 48 | +ifndef CONFIG_WIN32 | |
| 49 | + mkdir -p "$(mandir)/man1" | |
| 50 | + install qemu.1 qemu-mkcow.1 "$(mandir)/man1" | |
| 51 | +endif | |
| 51 | 52 | for d in $(TARGET_DIRS); do \ |
| 52 | 53 | make -C $$d $@ || exit 1 ; \ |
| 53 | 54 | done | ... | ... |
Makefile.target
| ... | ... | @@ -246,9 +246,12 @@ endif |
| 246 | 246 | ifndef CONFIG_SOFTMMU |
| 247 | 247 | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld |
| 248 | 248 | endif |
| 249 | +ifndef CONFIG_WIN32 | |
| 250 | +VL_LIBS=-lutil | |
| 251 | +endif | |
| 249 | 252 | |
| 250 | 253 | $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
| 251 | - $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) -lutil | |
| 254 | + $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VL_LIBS) | |
| 252 | 255 | |
| 253 | 256 | sdl.o: sdl.c |
| 254 | 257 | $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< |
| ... | ... | @@ -309,7 +312,7 @@ clean: |
| 309 | 312 | |
| 310 | 313 | install: all |
| 311 | 314 | ifneq ($(PROGS),) |
| 312 | - install -m 755 -s $(PROGS) $(prefix)/bin | |
| 315 | + install -m 755 -s $(PROGS) "$(bindir)" | |
| 313 | 316 | endif |
| 314 | 317 | |
| 315 | 318 | ifneq ($(wildcard .depend),) | ... | ... |
configure
| ... | ... | @@ -17,7 +17,7 @@ TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}" |
| 17 | 17 | TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S" |
| 18 | 18 | |
| 19 | 19 | # default parameters |
| 20 | -prefix="/usr/local" | |
| 20 | +prefix="" | |
| 21 | 21 | interp_prefix="/usr/gnemul/qemu-%M" |
| 22 | 22 | static="no" |
| 23 | 23 | cross_prefix="" |
| ... | ... | @@ -81,26 +81,6 @@ mingw32="yes" |
| 81 | 81 | *) ;; |
| 82 | 82 | esac |
| 83 | 83 | |
| 84 | -########################################## | |
| 85 | -# SDL probe | |
| 86 | - | |
| 87 | -cat > $TMPC << EOF | |
| 88 | -#include <SDL.h> | |
| 89 | -#undef main /* We don't want SDL to override our main() */ | |
| 90 | -int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
| 91 | -EOF | |
| 92 | - | |
| 93 | -sdl_too_old=no | |
| 94 | -sdl=no | |
| 95 | -if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then | |
| 96 | -_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'` | |
| 97 | -if test "$_sdlversion" -lt 121 ; then | |
| 98 | -sdl_too_old=yes | |
| 99 | -else | |
| 100 | -sdl=yes | |
| 101 | -fi | |
| 102 | -fi | |
| 103 | - | |
| 104 | 84 | # find source path |
| 105 | 85 | # XXX: we assume an absolute path is given when launching configure, |
| 106 | 86 | # except in './configure' case. |
| ... | ... | @@ -157,9 +137,7 @@ ar="${cross_prefix}${ar}" |
| 157 | 137 | strip="${cross_prefix}${strip}" |
| 158 | 138 | |
| 159 | 139 | if test "$mingw32" = "yes" ; then |
| 160 | - host_cc="$cc" | |
| 161 | 140 | target_list="i386-softmmu" |
| 162 | - prefix="/c/Program Files/Qemu" | |
| 163 | 141 | EXESUF=".exe" |
| 164 | 142 | gdbstub="no" |
| 165 | 143 | fi |
| ... | ... | @@ -202,6 +180,31 @@ if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/nu |
| 202 | 180 | have_gcc3_options="yes" |
| 203 | 181 | fi |
| 204 | 182 | |
| 183 | +########################################## | |
| 184 | +# SDL probe | |
| 185 | + | |
| 186 | +sdl_too_old=no | |
| 187 | + | |
| 188 | +if test -z "$sdl" ; then | |
| 189 | + | |
| 190 | +cat > $TMPC << EOF | |
| 191 | +#include <SDL.h> | |
| 192 | +#undef main /* We don't want SDL to override our main() */ | |
| 193 | +int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
| 194 | +EOF | |
| 195 | + | |
| 196 | +sdl=no | |
| 197 | +if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then | |
| 198 | +_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'` | |
| 199 | +if test "$_sdlversion" -lt 121 ; then | |
| 200 | +sdl_too_old=yes | |
| 201 | +else | |
| 202 | +sdl=yes | |
| 203 | +fi | |
| 204 | +fi | |
| 205 | + | |
| 206 | +fi | |
| 207 | + | |
| 205 | 208 | if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
| 206 | 209 | cat << EOF |
| 207 | 210 | |
| ... | ... | @@ -228,13 +231,29 @@ echo "NOTE: The object files are build at the place where configure is launched" |
| 228 | 231 | exit 1 |
| 229 | 232 | fi |
| 230 | 233 | |
| 234 | +if test "$mingw32" = "yes" ; then | |
| 235 | +if test -z "$prefix" ; then | |
| 236 | + prefix="/c/Program Files/Qemu" | |
| 237 | +fi | |
| 238 | +mandir="$prefix" | |
| 239 | +sharedir="$prefix" | |
| 240 | +bindir="$prefix" | |
| 241 | +else | |
| 242 | +if test -z "$prefix" ; then | |
| 243 | + prefix="/usr/local" | |
| 244 | +fi | |
| 231 | 245 | mandir="$prefix/share/man" |
| 232 | 246 | sharedir="$prefix/share/qemu" |
| 247 | +bindir="$prefix/bin" | |
| 248 | +fi | |
| 233 | 249 | |
| 234 | 250 | echo "Install prefix $prefix" |
| 235 | -echo "Manual directory $mandir" | |
| 236 | 251 | echo "BIOS directory $sharedir" |
| 252 | +echo "binary directory $bindir" | |
| 253 | +if test "$mingw32" = "no" ; then | |
| 254 | +echo "Manual directory $mandir" | |
| 237 | 255 | echo "ELF interp prefix $interp_prefix" |
| 256 | +fi | |
| 238 | 257 | echo "Source path $source_path" |
| 239 | 258 | echo "C compiler $cc" |
| 240 | 259 | echo "make $make" |
| ... | ... | @@ -259,6 +278,7 @@ echo "# Automatically generated by configure - do not modify" > $config_mak |
| 259 | 278 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
| 260 | 279 | |
| 261 | 280 | echo "prefix=$prefix" >> $config_mak |
| 281 | +echo "bindir=$bindir" >> $config_mak | |
| 262 | 282 | echo "mandir=$mandir" >> $config_mak |
| 263 | 283 | echo "sharedir=$sharedir" >> $config_mak |
| 264 | 284 | echo "#define CONFIG_QEMU_SHAREDIR \"$sharedir\"" >> $config_h |
| ... | ... | @@ -316,6 +336,7 @@ if test "$bigendian" = "yes" ; then |
| 316 | 336 | fi |
| 317 | 337 | if test "$mingw32" = "yes" ; then |
| 318 | 338 | echo "CONFIG_WIN32=yes" >> $config_mak |
| 339 | + echo "#define CONFIG_WIN32 1" >> $config_h | |
| 319 | 340 | else |
| 320 | 341 | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
| 321 | 342 | fi | ... | ... |
dyngen.c