Experimental support for Symbian S60 3rd edition

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3064 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2008-08-31 00:34:29 +00:00
parent 7310148db6
commit 50664a6f71
24 changed files with 939 additions and 60 deletions
+150 -31
View File
@@ -72,7 +72,7 @@ uqm_prepare_config()
MENU_main_ITEMS="debug graphics sound mikmod ovcodec netplay joystick \
ioformat accel threadlib"
case "$HOST_SYSTEM" in
Darwin)
Darwin|WINSCW|ARMV5)
# Installation directory not modifiable
;;
MINGW32*|cegcc)
@@ -133,35 +133,53 @@ uqm_prepare_config()
CHOICE_debug_OPTION_strictdebug_TITLE="Debug + strict compile checks"
CHOICE_debug_OPTION_strictdebug_ACTION='strictdebug_action'
strictdebug_action() {
CFLAGS="$CFLAGS -O1" # This is needed for -Wunitialized
CFLAGS="$CFLAGS -W -Wall \
-Wbad-function-cast -Wcast-qual -Wmissing-prototypes \
-Wstrict-prototypes -Wmissing-declarations \
-Wwrite-strings -Wimplicit -Wreturn-type -Wformat \
-Wswitch -Wcomment -Wchar-subscripts \
-Wparentheses -Wcast-align \
-Winline -Wuninitialized"
# CFLAGS="$CFLAGS -Waggregate-return"
# It's not unreasonable to return structs at times.
# CFLAGS="$CFLAGS "-Wpointer-arith"
# Some standard header won't even compile with this on
# CFLAGS="$CFLAGS -Wshadow"
# This gives absurd conflicts with standard files,
# like from 'y0 and y1'
# CFLAGS="$CFLAGS -Werror"
# We shouldn't do this until we actually nail them
# all in the original code. Then we can enforce them
# on ourselves.
# CFLAGS="$CFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
# CFLAGS="$CFLAGS -Wnested-externs"
# We know they're in the code, and though we'd like to get
# rid of them, they're not bugs.
CFLAGS=`echo $CFLAGS`
# Remove all the unnecessary spaces from $CFLAGS,
# for more readable messages.
case "$HOST_SYSTEM" in
WINSCW)
CFLAGS="$CFLAGS -g -O0 -W all -d DEBUG -d _DEBUG"
;;
ARMV5)
CFLAGS="$CFLAGS -g -O0 -DDEBUG -D_DEBUG"
;;
*)
CFLAGS="$CFLAGS -O1" # This is needed for -Wunitialized
CFLAGS="$CFLAGS -W -Wall \
-Wbad-function-cast -Wcast-qual -Wmissing-prototypes \
-Wstrict-prototypes -Wmissing-declarations \
-Wwrite-strings -Wimplicit -Wreturn-type -Wformat \
-Wswitch -Wcomment -Wchar-subscripts \
-Wparentheses -Wcast-align \
-Winline -Wuninitialized"
# CFLAGS="$CFLAGS -Waggregate-return"
# It's not unreasonable to return structs at times.
# CFLAGS="$CFLAGS "-Wpointer-arith"
# Some standard header won't even compile with this on
# CFLAGS="$CFLAGS -Wshadow"
# This gives absurd conflicts with standard files,
# like from 'y0 and y1'
# CFLAGS="$CFLAGS -Werror"
# We shouldn't do this until we actually nail them
# all in the original code. Then we can enforce them
# on ourselves.
# CFLAGS="$CFLAGS -pedantic-errors -ansi -trigraphs" # ANSI
# CFLAGS="$CFLAGS -Wnested-externs"
# We know they're in the code, and though we'd like to get
# rid of them, they're not bugs.
CFLAGS=`echo $CFLAGS`
# Remove all the unnecessary spaces from $CFLAGS,
# for more readable messages.
;;
esac
DEBUG=1
}
CHOICE_debug_DEFAULT=debug
}
case "$HOST_SYSTEM" in
ARMV5|WINSCW)
CHOICE_debug_DEFAULT=nodebug
;;
*)
CHOICE_debug_DEFAULT=debug
;;
esac
CHOICE_graphics_OPTIONS="pure opengl"
CHOICE_graphics_TITLE="OpenGL graphics support"
@@ -253,7 +271,15 @@ uqm_prepare_config()
CFLAGS="$CFLAGS -DHAVE_JOYSTICK"
}
CHOICE_joystick_OPTION_disabled_TITLE="disabled"
CHOICE_joystick_DEFAULT=enabled
case "$HOST_SYSTEM" in
ARMV5|WINSCW)
CHOICE_joystick_DEFAULT=disabled
;;
*)
CHOICE_joystick_DEFAULT=enabled
;;
esac
CHOICE_netplay_OPTIONS="none full ipv4"
CHOICE_netplay_TITLE="Network Supermelee support"
@@ -438,7 +464,7 @@ uqm_post_build() {
RFORK="src/res/darwin/${BUILD_PROJECT}.r"
test -f "$TARGET_FILE" || return
# If run from the command-line on OSX, the Window Manager
# will refuse to recognize the window unless the program has
# a resource fork; so we give it a small one here. When
@@ -449,6 +475,20 @@ uqm_post_build() {
Darwin)
$REZ "$RFORK" -o "$TARGET_FILE"
;;
ARMV5)
cp "$TARGET_FILE" "$BUILD_EPOCROOT/epoc32/release/armv5/urel/"
cd src/symbian
cmd \\/C bldmake bldfiles armv5
cmd \\/C abld build armv5 urel
cd ../..
;;
WINSCW)
cp "$TARGET_FILE" "$BUILD_EPOCROOT/epoc32/release/winscw/udeb/"
cd src/symbian
cmd \\/C bldmake bldfiles winscw
cmd \\/C abld build winscw udeb
cd ../..
;;
esac
}
@@ -469,6 +509,12 @@ uqm_install() {
echo "No installation procedure available for Windows CE."
echo "Read the manual for more information."
;;
WINSCW)
uqm_install_winscw
;;
ARMV5)
uqm_install_armv5
;;
*)
generic_install
;;
@@ -543,11 +589,84 @@ uqm_install_osx() {
cp $uqm_NAME "$INSTROOT/MacOS/The Ur-Quan Masters"
}
uqm_install_winscw() {
local PRIVATE_DIR
PRIVATE_DIR="$BUILD_EPOCROOT/epoc32/winscw/c/private/A000A0C3"
uqm_create_symbian_content_package
echo "Creating directory structure to $PRIVATE_DIR ..."
mkdir "$PRIVATE_DIR"
mkdir "$PRIVATE_DIR/content"
mkdir "$PRIVATE_DIR/content/packages"
mkdir "$PRIVATE_DIR/userdata"
echo "Copying data to $PRIVATE_DIR ..."
cp content/version "$PRIVATE_DIR/content"
cp content.uqm "$PRIVATE_DIR/content/packages"
cp src/symbian/uqm.cfg "$PRIVATE_DIR/userdata"
}
uqm_install_armv5() {
uqm_create_symbian_content_package
cd src/symbian
cmd \\/C makekeys -cert -password asdfgh -len 2048 -dname "CN=UQM OR=Ur-Quan Masters CO=FI" uqm.key uqm.cer
cmd \\/C makesis uqm.pkg
cmd \\/C signsis -v uqm.sis uqm.sisx uqm.cer uqm.key asdfgh
mv uqm.sisx ../..
cd ../..
}
uqm_create_symbian_content_package() {
if [ -e "content.uqm" ]; then
echo "Content package already exists, skipping"
return
fi
echo "Creating content package..."
cd content
echo "Building file list..."
find . -type f -not -path '*/CVS*' -not -path '*/.svn*' -not -path './addons*' -not -name "version" >../content.lst
echo "Zipping..."
zip -q ../content.uqm -r . -i@../content.lst
cd ..
rm content.lst
}
uqm_clean() {
case "$HOST_SYSTEM" in
MINGW32*|CYGWIN*)
rm -f "$BUILD_WORK/config_win.h"
;;
ARMV5)
local TARGET_FILE
eval TARGET_FILE="\$BUILD_WORK/\${${BUILD_PROJECT}_NAME}"
rm -f "$BUILD_WORK/config_unix.h"
rm -f "$BUILD_EPOCROOT/epoc32/release/armv5/urel/$TARGET_FILE"
rm -f $TARGET_FILE uqm.sisx content.uqm
cd src/symbian
cmd \\/C abld reallyclean armv5
cmd \\/C bldmake clean
rm -f uqm.sis uqm.key uqm.cer
cd ../..
;;
WINSCW)
local TARGET_FILE
eval TARGET_FILE="\$BUILD_WORK/\${${BUILD_PROJECT}_NAME}"
rm -f "$BUILD_WORK/config_unix.h"
rm -f "$BUILD_EPOCROOT/epoc32/release/winscw/udeb/$TARGET_FILE"
rm -f $TARGET_FILE content.uqm
cd src/symbian
cmd \\/C abld reallyclean winscw
cmd \\/C bldmake clean
cd ../..
;;
*)
rm -f "$BUILD_WORK/config_unix.h"
;;
+1 -1
View File
@@ -68,7 +68,7 @@ case "$HOST_SYSTEM" in
useGccBuildTools
;;
WINSCW)
EXTRA_WINSCW_FLAGS_COMPILE='-msgstyle gcc -gccinc -wchar_t off -align 4 -warnings on -w nohidevirtual,nounusedexpr -enum int -str pool -exc ms -trigraphs on -nostdinc -d _UNICODE -d __SYMBIAN32__ -d __SERIES60_30__ -d __SERIES60_3X__ -d __CW32__ -d __WINS__ -d __WINSCW__ -d __EXE__ -d __SUPPORT_CPP_EXCEPTIONS__ -I$BUILD_EPOCROOT/epoc32/include -I$BUILD_EPOCROOT/epoc32/include/stdapis -I$BUILD_EPOCROOT/epoc32/include/variant -include Symbian_OS_v9.1.hrh'
EXTRA_WINSCW_FLAGS_COMPILE="-msgstyle gcc -gccinc -dialect c99 -relax_pointers -wchar_t off -align 4 -warnings on -w nohidevirtual,nounusedexpr -enum int -str pool -exc ms -trigraphs on -nostdinc -d _UNICODE -d __SYMBIAN32__ -d __SERIES60_30__ -d __SERIES60_3X__ -d __CW32__ -d __WINS__ -d __WINSCW__ -d __EXE__ -d __SUPPORT_CPP_EXCEPTIONS__ -I$BUILD_EPOCROOT/epoc32/include -I$BUILD_EPOCROOT/epoc32/include/stdapis -I$BUILD_EPOCROOT/epoc32/include/variant -include Symbian_OS_v9.1.hrh"
EXTRA_WINSCW_FLAGS_LINK='-library -msgstyle gcc -stdlib -noimplib -search'
BUILDTOOL_PREPROC_C_COMMAND="\$PROG_mwccsym2_FILE -E $EXTRA_WINSCW_FLAGS_COMPILE"
+61 -4
View File
@@ -67,6 +67,16 @@ case "$HOST_SYSTEM" in
gcc -E -include SDL/SDL_version.h $LIB_SDL_CFLAGS - | \
tail -1 | tr -d ' ')
;;
WINSCW)
LIB_SDL_CFLAGS='-I$BUILD_EPOCROOT/epoc32/include/SDL'
LIB_SDL_LDFLAGS=''
LIB_SDL_VERSION='1.2.13'
;;
ARMV5)
LIB_SDL_CFLAGS='-J$BUILD_EPOCROOT/epoc32/include/SDL'
LIB_SDL_LDFLAGS=''
LIB_SDL_VERSION='1.2.13'
;;
*)
LIB_SDL_CFLAGS='$(sdl-config --cflags)'
LIB_SDL_LDFLAGS='$(sdl-config --libs)'
@@ -89,6 +99,10 @@ case "$HOST_SYSTEM" in
LIB_SDL_image_CFLAGS=''
LIB_SDL_image_LDFLAGS="-framework SDL_image"
;;
ARMV5|WINSCW)
LIB_SDL_image_CFLAGS="$LIB_SDL_CFLAGS"
LIB_SDL_image_LDFLAGS="$LIB_SDL_LDFLAGS"
;;
*)
LIB_SDL_image_CFLAGS="$LIB_SDL_CFLAGS"
LIB_SDL_image_LDFLAGS="$LIB_SDL_LDFLAGS -lSDL_image"
@@ -135,6 +149,9 @@ case "$HOST_SYSTEM" in
LIB_opengl_CFLAGS=""
LIB_opengl_LDFLAGS="-framework OpenGL"
;;
ARMV5|WINSCW)
LIB_opengl_DETECT="false"
;;
*)
LIB_opengl_CFLAGS=""
LIB_opengl_LDFLAGS="-lGL"
@@ -148,6 +165,11 @@ LIB_vorbis_NAME="libvorbis"
LIB_vorbis_CFLAGS=""
LIB_vorbis_LDFLAGS="-lvorbis"
LIB_vorbis_VERSION=""
case "$HOST_SYSTEM" in
ARMV5|WINSCW)
LIB_vorbis_DETECT="false"
;;
esac
### Vorbisfile ###
@@ -175,8 +197,15 @@ case "$HOST_SYSTEM" in
;;
esac
LIB_vorbisfile_VERSION=""
LIB_vorbisfile_DETECT="try_pkgconfig_lib vorbisfile vorbisfile"
LIB_vorbisfile_DEPEND_DETECT_BIN="pkgconfig"
case "$HOST_SYSTEM" in
ARMV5|WINSCW)
LIB_vorbisfile_DETECT="false"
;;
*)
LIB_vorbisfile_DETECT="try_pkgconfig_lib vorbisfile vorbisfile"
LIB_vorbisfile_DEPEND_DETECT_BIN="pkgconfig"
;;
esac
### Tremor ###
@@ -190,6 +219,9 @@ case "$HOST_SYSTEM" in
# Assumed values - please let me know if you can verify this.
LIB_tremor_CFLAGS=""
LIB_tremor_LDFLAGS="-framework Tremor"
;;
ARMV5|WINSCW)
LIB_tremor_DETECT="false"
;;
*)
LIB_tremor_CFLAGS=""
@@ -204,6 +236,11 @@ LIB_libmikmod_NAME="libmikmod"
LIB_libmikmod_CFLAGS="$(libmikmod-config --cflags)"
LIB_libmikmod_LDFLAGS="$(libmikmod-config --libs)"
LIB_libmikmod_VERSION="$(libmikmod-config --version)"
case "$HOST_SYSTEM" in
ARMV5|WINSCW)
LIB_libmikmod_DETECT="false"
;;
esac
### zlib ###
@@ -213,13 +250,24 @@ case "$HOST_SYSTEM" in
MINGW32*|CYGWIN*|cegcc)
LIB_zlib_LDFLAGS="-lzdll"
;;
ARMV5|WINSCW)
LIB_zlib_LDFLAGS=""
;;
*)
LIB_zlib_LDFLAGS="-lz"
;;
esac
LIB_zlib_VERSION=""
LIB_zlib_DETECT="try_pkgconfig_lib zlib zlib"
LIB_zlib_DEPEND_DETECT_BIN="pkgconfig"
case "$HOST_SYSTEM" in
ARMV5|WINSCW)
LIB_zlib_DETECT="true"
;;
*)
LIB_zlib_DETECT="try_pkgconfig_lib zlib zlib"
LIB_zlib_DEPEND_DETECT_BIN="pkgconfig"
;;
esac
### pthread ###
@@ -235,6 +283,11 @@ case "$HOST_SYSTEM" in
LIB_pthread_LDFLAGS="$(pthread-config --ldflags)"
LIB_pthread_VERSION="$(pthread-config --version)"
;;
WINSCW|ARMV5)
LIB_pthread_CFLAGS=""
LIB_pthread_LDFLAGS=""
LIB_pthread_VERSION=""
;;
*)
LIB_pthread_CFLAGS=""
LIB_pthread_LDFLAGS="-lpthread"
@@ -251,6 +304,9 @@ case "$HOST_SYSTEM" in
LIB_netlibs_LDFLAGS="-lsocket"
LIB_netlibs_VERSION=""
;;
ARMV5|WINSCW)
LIB_netlibs_DETECT="false"
;;
esac
@@ -265,6 +321,7 @@ SYMBOL_readdir_r_EXTRA="#include <dirent.h>"
SYMBOL_setenv_EXTRA="#include <stdlib.h>"
SYMBOL_strcasecmp_EXTRA="#include <strings.h>"
SYMBOL_strcasecmp_DEFNAME="HAVE_STRCASECMP_UQM"
# HAVE_STRCASECMP would conflict with SDL (SDL_config.h).
+1 -1
View File
@@ -8,6 +8,6 @@ define act_mkdep_c
endef
define act_link
$(LINK) --create "$@".lib $^ $(LDFLAGS)
$(LINK) --create "$@" $^ $(LDFLAGS)
endef