Added cross-compile support for Win32 from Linux using MinGW. This is

accessed using a new 'host' type in configure (mingw32-cross).  For
my system, the command would be as follows:

configure --host=mingw32-cross
          --with-sdl-prefix=/home/stephena/.mingw/usr/i386-mingw32msvc

This allows you to compile the Windows version in Linux, which is my
main development platform.  It will also allow me to get the automated
build page working again :)

Removed all NASM checking from the config scripts, since we're never
going to use it (it goes against the philosophy of Stella compiling
everywhere).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1421 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2008-03-09 14:17:03 +00:00
parent 157b723502
commit 8e76c31e4c
2 changed files with 14 additions and 77 deletions

View File

@ -13,7 +13,7 @@
## See the file "license" for information on usage and redistribution of ## See the file "license" for information on usage and redistribution of
## this file, and for a DISCLAIMER OF ALL WARRANTIES. ## this file, and for a DISCLAIMER OF ALL WARRANTIES.
## ##
## $Id: Makefile,v 1.32 2007-08-16 16:42:46 stephena Exp $ ## $Id: Makefile,v 1.33 2008-03-09 14:17:03 stephena Exp $
## ##
## Based on code from ScummVM - Scumm Interpreter ## Based on code from ScummVM - Scumm Interpreter
## Copyright (C) 2002-2004 The ScummVM project ## Copyright (C) 2002-2004 The ScummVM project
@ -196,7 +196,7 @@ uninstall:
# Special rule for Win32 icon stuff (there's probably a better way to do this ...) # Special rule for Win32 icon stuff (there's probably a better way to do this ...)
src/win32/stella_icon.o: src/win32/stella.ico src/win32/stella.rc src/win32/stella_icon.o: src/win32/stella.ico src/win32/stella.rc
windres --include-dir src/win32 src/win32/stella.rc src/win32/stella_icon.o $(WINDRES) --include-dir src/win32 src/win32/stella.rc src/win32/stella_icon.o
# Special target to create a Win32 snapshot package # Special target to create a Win32 snapshot package
win32dist: stella$(EXEEXT) win32dist: stella$(EXEEXT)

87
stella/configure vendored
View File

@ -42,11 +42,9 @@ _rm_rec="$_rm -r"
_zip="zip -q" _zip="zip -q"
_cp=cp _cp=cp
_win32path="" _win32path=""
_windres="windres"
_sdlconfig=sdl-config _sdlconfig=sdl-config
_sdlpath="$PATH" _sdlpath="$PATH"
_nasmpath="$PATH"
NASMFLAGS=""
NASM=""
_prefix=/usr/local _prefix=/usr/local
_have_x86="" _have_x86=""
X_LIBS="/usr/X11R6/lib" X_LIBS="/usr/X11R6/lib"
@ -187,42 +185,6 @@ rm -f tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp
echo $datatype echo $datatype
} }
CheckNASM()
{
echocheck "nasm"
if test "$_nasm" = no ; then
echo "disabled"
return;
fi
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
for path_dir in $_nasmpath; do
if test -x "$path_dir/nasm" ; then
NASM="$path_dir/nasm"
echo $NASM
break
fi
done
IFS="$ac_save_ifs"
if test x$NASM = x -o x$NASM = x'"$NASM"'; then
echo "not found"
_nasm=no
else
case $_host_os in
mingw* | cygwin*)
NASMFLAGS="-f win32"
;;
*)
NASMFLAGS="-f elf"
;;
esac
_nasm=yes
fi
}
# #
# Greet user # Greet user
# #
@ -280,9 +242,6 @@ Optional Libraries:
--with-sdl-prefix=DIR Prefix where the sdl-config script is installed (optional) --with-sdl-prefix=DIR Prefix where the sdl-config script is installed (optional)
--with-nasm-prefix=DIR Prefix where nasm executable is installed (optional)
--disable-nasm disable assembly language optimizations [autodetect]
--x-libraries Path to X11 libraries [${X_LIBS}] --x-libraries Path to X11 libraries [${X_LIBS}]
Some influential environment variables: Some influential environment variables:
@ -314,8 +273,6 @@ for ac_option in $@; do
--disable-cheats) _build_cheats=no ;; --disable-cheats) _build_cheats=no ;;
--enable-atarivox) _build_atarivox=yes ;; --enable-atarivox) _build_atarivox=yes ;;
--disable-atarivox) _build_atarivox=no ;; --disable-atarivox) _build_atarivox=no ;;
--enable-nasm) _nasm=yes ;;
--disable-nasm) _nasm=no ;;
--enable-shared) _build_static=no ;; --enable-shared) _build_static=no ;;
--enable-static) _build_static=yes ;; --enable-static) _build_static=yes ;;
--disable-static) _build_static=no ;; --disable-static) _build_static=no ;;
@ -330,10 +287,6 @@ for ac_option in $@; do
arg=`echo $ac_option | cut -d '=' -f 2` arg=`echo $ac_option | cut -d '=' -f 2`
_sdlpath="$arg:$arg/bin" _sdlpath="$arg:$arg/bin"
;; ;;
--with-nasm-prefix=*)
arg=`echo $ac_option | cut -d '=' -f 2`
_nasmpath="$arg:$arg/bin"
;;
--x-libraries=*) --x-libraries=*)
arg=`echo $ac_option | cut -d '=' -f 2` arg=`echo $ac_option | cut -d '=' -f 2`
X_LIBS="$arg" X_LIBS="$arg"
@ -386,6 +339,11 @@ gp2x)
_host_cpu=arm _host_cpu=arm
_alt_tools=arm-open2x-linux _alt_tools=arm-open2x-linux
;; ;;
mingw32-cross)
_host_os=mingw32msvc
_host_cpu=i386
_windres=i386-mingw32msvc-windres
;;
*) *)
guessed_host=`$_srcdir/config.guess` guessed_host=`$_srcdir/config.guess`
_host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` _host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@ -558,6 +516,11 @@ if test -n "$_host"; then
_build_gl=no _build_gl=no
_build_windowed=no _build_windowed=no
;; ;;
mingw32-cross)
echo "Cross-compiling for Win32 using MinGW."
DEFINES="$DEFINES -DWIN32"
_host_os=win32
;;
*) *)
echo "Cross-compiling to unknown target, please add your target to configure." echo "Cross-compiling to unknown target, please add your target to configure."
exit 1 exit 1
@ -667,22 +630,6 @@ EOF
fi fi
echo "$_opengl" echo "$_opengl"
#
# Check for nasm
#
if test "$_have_x86" = yes ; then
CheckNASM
fi
if test "$_nasm" = yes ; then
DEFINES="$DEFINES -DUSE_NASM"
_def_nasm='#define USE_NASM'
_make_def_HAVE_NASM='HAVE_NASM = 1'
else
_def_nasm='#undef USE_NASM'
_make_def_HAVE_NASM='# HAVE_NASM = 1'
fi
# #
# figure out installation directories # figure out installation directories
# #
@ -764,14 +711,6 @@ else
echo echo
fi fi
if test "$_nasm" = yes ; then
echo_n " NASM support enabled for x86 assembly code"
echo
else
echo_n " NASM support disabled"
echo
fi
if test "$_build_static" = yes ; then if test "$_build_static" = yes ; then
echo_n " Static binary enabled" echo_n " Static binary enabled"
echo echo
@ -937,12 +876,11 @@ RM_REC := $_rm_rec
ZIP := $_zip ZIP := $_zip
CP := $_cp CP := $_cp
WIN32PATH=$_win32path WIN32PATH=$_win32path
WINDRES=$_windres
MODULES += $MODULES MODULES += $MODULES
MODULE_DIRS += $MODULE_DIRS MODULE_DIRS += $MODULE_DIRS
EXEEXT := $EXEEXT EXEEXT := $EXEEXT
NASM := $NASM
NASMFLAGS := $NASMFLAGS
PREFIX := $_prefix PREFIX := $_prefix
BINDIR := $_bindir BINDIR := $_bindir
@ -951,7 +889,6 @@ DATADIR := $_datadir
PROFILE := $_build_profile PROFILE := $_build_profile
$_make_def_HAVE_GCC3 $_make_def_HAVE_GCC3
$_make_def_HAVE_NASM
INCLUDES += $INCLUDES INCLUDES += $INCLUDES
OBJS += $OBJS OBJS += $OBJS