[Tux4kids-commits] r53 - in tuxmath/trunk: . docs nsis src
dbruce at alioth.debian.org
dbruce at alioth.debian.org
Thu Mar 8 21:20:11 CET 2007
Author: dbruce
Date: 2006-10-17 19:23:37 +0000 (Tue, 17 Oct 2006)
New Revision: 53
Added:
tuxmath/trunk/cross-configure.sh
tuxmath/trunk/cross-make.sh
Removed:
tuxmath/trunk/nsis/nsis/
Modified:
tuxmath/trunk/Makefile.am
tuxmath/trunk/configure.in
tuxmath/trunk/docs/INSTALL.txt
tuxmath/trunk/docs/README.txt
tuxmath/trunk/src/fileops.c
tuxmath/trunk/src/tuxmath.h
Log:
Added scripts for cross-building Windows build on Linux
Modified: tuxmath/trunk/Makefile.am
===================================================================
--- tuxmath/trunk/Makefile.am 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/Makefile.am 2006-10-17 19:23:37 UTC (rev 53)
@@ -44,12 +44,12 @@
install-nsi-local: all
$(INSTALL) -d $(top_srcdir)/$(NSI_INSTALL_DIR)/$(PACKAGE_DATA_DIR);
(cd $(top_srcdir)/$(PACKAGE_DATA_DIR) ; tar cf - --exclude "Makefile.in" --exclude "*.in" --exclude "*~" --exclude \ "Makefile" --exclude "Makefile.am" --exclude CVS --exclude .xvpics --exclude "1[1-9].ogg" --exclude "2?.ogg" --exclude "*.svn*" * ) \
- | ( cd $(top_srcdir)/$(NSI_INSTALL_DIR)/$(PACKAGE_DATA_DIR) ; tar xf -) ; cd .. ; \
+ | ( cd $(top_srcdir)/$(NSI_INSTALL_DIR)/$(PACKAGE_DATA_DIR) ; tar xf -) ; \
cp $(NSI_DLL_DIR)/*.dll $(top_srcdir)/$(NSI_INSTALL_DIR)
install-nsi-am: install-nsi-local
-nsis: install-nsi
+nsis: install-nsi-local
$(MAKENSIS) -NOCD nsis/tuxmath.nsi
clean-local:
Modified: tuxmath/trunk/configure.in
===================================================================
--- tuxmath/trunk/configure.in 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/configure.in 2006-10-17 19:23:37 UTC (rev 53)
@@ -6,7 +6,7 @@
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE(tuxmath, 0.96)
+AM_INIT_AUTOMAKE(tuxmath, 0.98)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
@@ -28,6 +28,25 @@
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
+
+# Check platform - see if WinMain needed:
+AC_MSG_CHECKING([for native Win32])
+case "$host" in
+ *-*-mingw*)
+ native_win32=yes
+ ;;
+ *)
+ native_win32=no
+ ;;
+esac
+AC_MSG_RESULT([$native_win32])
+
+AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
+if test "$native_win32" = yes; then
+ LIBS="$LIBS -lmingw32 -lSDLmain"
+fi
+
+
LIBS="$LIBS $SDL_LIBS"
# Checks for libraries.
@@ -64,16 +83,7 @@
dnl Set PACKAGE_DATA_DIR
PACKAGE_DATA_DIR="data"
-AC_MSG_CHECKING([for native Win32])
-case "$host" in
- *-*-mingw*)
- native_win32=yes
- ;;
- *)
- native_win32=no
- ;;
-esac
-AC_MSG_RESULT([$native_win32])
+
AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes)
if test "$native_win32" = yes; then
Added: tuxmath/trunk/cross-configure.sh
===================================================================
--- tuxmath/trunk/cross-configure.sh 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/cross-configure.sh 2006-10-17 19:23:37 UTC (rev 53)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+CONFIG_SHELL=/bin/sh
+export CONFIG_SHELL
+PREFIX=/usr/local/cross-tools
+TARGET=i586-mingw32msvc
+PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
+export PATH
+if [ -f "$PREFIX/$TARGET/bin/$TARGET-sdl-config" ]; then
+ SDL_CONFIG="$PREFIX/$TARGET/bin/$TARGET-sdl-config"
+ export SDL_CONFIG
+fi
+cache=cross-config.cache
+CPPFLAGS=-I$PREFIX/$TARGET/include LDFLAGS=-L$PREFIX/$TARGET/lib sh configure --cache-file="$cache" \
+ --target=$TARGET --host=$TARGET --build=i386-linux --prefix="$PREFIX/$TARGET" \
+ $*
+status=$?
+rm -f "$cache"
+exit $status
Property changes on: tuxmath/trunk/cross-configure.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: tuxmath/trunk/cross-make.sh
===================================================================
--- tuxmath/trunk/cross-make.sh 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/cross-make.sh 2006-10-17 19:23:37 UTC (rev 53)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+PREFIX=/usr/local/cross-tools
+TARGET=i386-mingw32msvc
+PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
+export PATH
+exec make $*
Property changes on: tuxmath/trunk/cross-make.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: tuxmath/trunk/docs/INSTALL.txt
===================================================================
--- tuxmath/trunk/docs/INSTALL.txt 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/docs/INSTALL.txt 2006-10-17 19:23:37 UTC (rev 53)
@@ -1,6 +1,6 @@
INSTALL.txt for "Tux, Of Math Command" (aka "Tuxmath")
-October 07, 2006
+October 17, 2006
Requirements
@@ -130,7 +130,9 @@
./autogen.sh && ./configure && make && make install
By default, the build process will install tuxmath under /usr/local/share
- for the data and /usr/local/bin for the executable.
+ for the data and /usr/local/bin for the executable. To build tuxmath, you
+ will need the SDL dev files as noted above, as well as the GNU developer
+ tools, including automake-1.9 and autotools-dev.
If you are using a deb or rpm-based distribution, your distro may have
tuxmath in a prepared package, in which case your job is as simple as
@@ -138,5 +140,72 @@
Windows
-------
- (under construction)
-
+ Tuxmath can be cross-compiled for Windows under Linux. I have done this on
+ my Debian system. The build process is not completely automated as of yet.
+ To set up a crossbuild environment:
+
+ 1. Install mingw32 (apt-get install mingw32) and makensis (apt-get install nsis)
+
+ 2. Create directory structure:
+ - mkdir /usr/local/cross-tools
+ - mkdir /usr/local/cross-tools/i586-mingw32msvc
+ - mkdir /usr/local/cross-tools/i586-mingw32msvc/lib
+ - mkdir /usr/local/cross-tools/i586-mingw32msvc/include
+
+ 3. Install precompiled win32 dev files (lib and includes) for SDL, SDL-image
+ and SDL-mixer in the lib and include directories you just created.
+ You can get all of these from www.libsdl.org. I had some trouble with
+ this step as the SDL libs have varieties intended for both mingw32 and MSVC -
+ I was able to build successfully using the mingw32 ones. I also had to put
+ all the lib files directly under /usr/local/cross-tools/i586-mingw32msvc/lib
+ to get it to work. My /usr/local/cross-tools/i586-mingw32msvc/lib contains:
+
+ dbruce at debian:/usr/local/cross-tools/i586-mingw32msvc/lib$ ls
+ SDL_image.dll jpeg.dll libgw32c.a smpeg.dll
+ SDL_image.lib libSDL.dll.a libpng12.dll vorbis.dll
+ SDL_mixer.dll libSDL.la libtiff.dll vorbisfile.dll
+ SDL_mixer.lib libSDLmain.a ogg.dll zlib1.dll
+
+ The header files can be in their own folders as long as they are under
+ /usr/local/cross-tools/i586-mingw32msvc/include
+
+ 4. install libgw32c (the dev file):
+ http://gnuwin32.sourceforge.net/packages/libgw32c.htm in the same directory.
+ This gives you the file "libgw32c.a" that you need to have in the lib directory.
+
+ 5. From the trunk dir, run:
+ ./autogen.sh
+ ./cross-configure.sh --with-sdl-prefix
+ ./cross-make.sh
+
+ You should now have the tuxmath.exe executable - for reasons I do not yet quite
+ understand, it gets created in src rather than trunk. Before you can use makensis
+ to create the win32 installer, you need to copy it into the trunk/mingw32 directory,
+ which should have been created by cross-make.sh. Also, you need to have a directory
+ containing all of the dlls that will need to be packaged into the installer. The
+ Makefile expects them to be in NSI_DLL_DIR, which is set to ~/tuxmath_dll. On my
+ machine, this contains:
+
+ dbruce at debian:~/tuxmath_dll$ ls
+ SDL.dll jpeg.dll ogg.dll vorbisfile.dll
+ SDL_image.dll libpng12.dll smpeg.dll zlib1.dll
+ SDL_mixer.dll libtiff.dll vorbis.dll
+
+ (Note - this has mostly the same files as the cross-tools lib directory - it is most
+ likely possible to eliminate this redundancy in some way).
+
+ 6. From the trunk dir, run:
+ ./cross-make.sh nsis
+
+ This should create the windows installer file ("tuxmath-0.96-win32-installer.exe")
+ under trunk.
+
+ Installation on Windows:
+ ------------------------
+ To install, simply execute the installer file on the Windows machine. Depending on
+ the version of Windows and the computer's security settings, it may be necessary
+ to install with administrator privileges in order to use the default installation
+ location (C:\Program Files\Tuxmath). The program can be installed in any writable
+ location and should function correctly. It can be run with ordinary user privileges,
+ even if installed by the administrator.
+
Modified: tuxmath/trunk/docs/README.txt
===================================================================
--- tuxmath/trunk/docs/README.txt 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/docs/README.txt 2006-10-17 19:23:37 UTC (rev 53)
@@ -2,9 +2,9 @@
An educational math tutorial game starring Tux, the Linux Penguin
-----------------------------------------------------------------
-Sept 29, 2006
+Oct 17, 2006
-For tuxmath-0.97
+For tuxmath-0.98
Objective
---------
@@ -35,10 +35,12 @@
Windows
-------
- [ UNDER CONSTRUCTION ] Just double-click the "tuxmath.exe" icon. ???
- To be prompted for command line options (see below), invoke the game
- from the "Run" dialog, which you can get by selecting the "Run Program"
- item from Windows' "Start" menu. [ IS THIS CORRECT? ]
+ Just double-click the "tuxmath.exe" icon or select "Tuxmath" in the Start
+ Menu. The current installer creates menu items to run tuxmath either in
+ Fullscreen mode or within a 640 x 480 window.
+ To be prompted for command line options, run tuxmath from the "Run" dialog
+ or the "C:> Command Prompt" console. Type "tuxmath.exe" followed by any
+ desired options (see below).
MacOS
-----
@@ -50,7 +52,8 @@
Command Line Options
--------------------
NOTE: editing the config file is now a much better way to control the
- behavior of Tuxmath - SEE BELOW.
+ behavior of Tuxmath - SEE BELOW. There is also a simple GUI-based
+ config program packaged with the Windows build.
The following command-line options can be sent to the program.
--optionfile filename - play game based on settings in the named file (see
@@ -82,18 +85,21 @@
--fullscreen - Run the game in full screen, instead of in a window,
-f if possible.
- --nosound - Do not play any sounds or music.
+ --windowed - Run the game in a 640 x 480 window.
+ -w
+
+ --nosound - Do not play any sounds or music.
-s
- --quiet
+ --quiet
-q
- --nobackground - Do not display photographic backgrounds in game.
+ --nobackground - Do not display photographic backgrounds in game.
-b (Useful on slower systems.)
- --keypad - Display an on-screen numeric keypad. (Useful
+ --keypad - Display an on-screen numeric keypad. (Useful
-k for touch screens or in place of a physical keyboard.)
- --operator OP - Add an operator to the game (will cause the program
+ --operator OP - Add an operator to the game (will cause the program
-o OP to ignore saved option screen settings). You can
use this switch multiple times to run the game
with multiple operators.
@@ -105,12 +111,12 @@
multiply
divide
- --demo - Demo mode. The game will cycle back and forth
+ --demo - Demo mode. The game will cycle back and forth
-d between the title and the game, and it will
auto-play the game. The only user interaction
can be for quitting or pausing.
- --allownegatives Allows subtraction answers to be less than zero.
+ --allownegatives Allows subtraction answers to be less than zero.
-n When selected, the led numbers at the top of the
screen will include a fourth digit for the '-' sign.
Also, if --keypad is selected, the '-' and '+' may
@@ -120,16 +126,16 @@
These command-line options display useful information, but the program
does not attempt to start up in interactive mode.
- --help - Display a short help message, explaining how to
+ --help - Display a short help message, explaining how to
-h play the game.
- --usage - Display the available command-line options.
+ --usage - Display the available command-line options.
-u
- --version - Display the version of "tuxmath" you're running.
+ --version - Display the version of "tuxmath" you're running.
-v
- --copyright - Display copyright information
+ --copyright - Display copyright information
-c
@@ -250,7 +256,9 @@
Regaining Cities
----------------
- [ Rules will go here ]
+ [ Under construction ] Briefly, there will be special "bonus comets" at
+ certain intervals that will have the effect of either activating shields or
+ rebuilding cities if answered correctly.
Advancing Waves
Modified: tuxmath/trunk/src/fileops.c
===================================================================
--- tuxmath/trunk/src/fileops.c 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/src/fileops.c 2006-10-17 19:23:37 UTC (rev 53)
@@ -526,12 +526,10 @@
/* terminate string here: */
*value_end = 0;
- #define TUXMATH_DEBUG
#ifdef TUXMATH_DEBUG
printf("parameter = '%s'\t, length = %d\n", parameter, strlen(parameter));
printf("value = '%s'\t, length = %d\t, atoi() = %d\n", value, strlen(value), atoi(value));
#endif
- #undef TUXMATH_DEBUG
/* Now ready to handle each name/value pair! */
/* Set general game_options struct (see tuxmath.h): */
Modified: tuxmath/trunk/src/tuxmath.h
===================================================================
--- tuxmath/trunk/src/tuxmath.h 2006-10-17 15:01:07 UTC (rev 52)
+++ tuxmath/trunk/src/tuxmath.h 2006-10-17 19:23:37 UTC (rev 53)
@@ -32,7 +32,7 @@
//#define TUXMATH_DEBUG /* for conditional compilation of debugging output */
//#define FEEDBACK_DEBUG /* for Tim's feedback speed control code */
-#define TUXMATH_VERSION 0.97
+//#define TUXMATH_VERSION 0.98 This is now done by autoheader and configure.in
#define PATH_MAX 4096
More information about the Tux4kids-commits
mailing list