From: <cn...@us...> - 2010-04-25 02:50:19
|
Revision: 694 http://hgengine.svn.sourceforge.net/hgengine/?rev=694&view=rev Author: cnlohr Date: 2010-04-25 02:50:12 +0000 (Sun, 25 Apr 2010) Log Message: ----------- commit dabbling with Wii... it may go somewhere... Modified Paths: -------------- Mercury2/base_set.sh Mercury2/cnconfigure Mercury2/src/Mercury2.cpp Mercury2/src/MercuryCrash.c Added Paths: ----------- Mercury2/tools/wii_libs/ Mercury2/tools/wii_libs/Makefile Mercury2/tools/wii_libs/Makefile.png Mercury2/tools/wii_libs/Makefile.zlib Modified: Mercury2/base_set.sh =================================================================== --- Mercury2/base_set.sh 2010-04-22 00:01:37 UTC (rev 693) +++ Mercury2/base_set.sh 2010-04-25 02:50:12 UTC (rev 694) @@ -8,7 +8,7 @@ ISMAC=1; fi -OPTIONS="X11 libxml OGL sse gprof glprofile instancewatch alsa ogg" +OPTIONS="X11 libxml OGL sse gprof glprofile instancewatch alsa ogg wii" OPT_X11=1 OPT_OGL=1 OPT_libxml=1 @@ -18,6 +18,7 @@ OPT_instancewatch=1 OPT_alsa=1 OPT_ogg=1 +OPT_wii=0 DEFINES="WAS_CONFIGURED USE_MSTRING" @@ -52,9 +53,17 @@ WANT_L="iberty" CC_BASE="$CC_BASE -I." -NEED_L="m c z pthread png pthread"; +if test $OPT_wii = 1; then + CC="$DEVKITPPC/bin/powerpc-eabi-g++" + EXTRA_BEGIN="include $DEVKITPPC/wii_rules" + LD_BASE="$LD_BASE -g $MACHDEP -Ltools/wii_png -Wl,-Map,mercury.map $DEVKITPRO/libogc/lib/wii/libwiiuse.a $DEVKITPRO/libogc/lib/wii/libbte.a $DEVKITPRO/libogc/lib/wii/libogc.a" + NEED_L="m c png" + CC_BASE="$CC_BASE -I$DEVKITPRO/libogc/include" +else + NEED_L="m c z pthread png pthread"; + CC="cc" +fi - if test $OPT_libxml = 1; then CC_BASE="$CC_BASE -I/usr/include/libxml2" NEED_H="$NEED_H libxml/parser.h" @@ -110,10 +119,14 @@ ARCH=`uname -m` -if test $ARCH = "i686" || test $ARCH = "i586"; then - if test $OPT_sse = 1; then - CC_BASE="$CC_BASE -march=pentium3" - else - CC_BASE="$CC_BASE -march=pentium" +if test $OPT_wii = 1; then + CC_BASE="$CC_BASE -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float" +else + if test $ARCH = "i686" || test $ARCH = "i586"; then + if test $OPT_sse = 1; then + CC_BASE="$CC_BASE -march=pentium3" + else + CC_BASE="$CC_BASE -march=pentium" + fi fi fi Modified: Mercury2/cnconfigure =================================================================== --- Mercury2/cnconfigure 2010-04-22 00:01:37 UTC (rev 693) +++ Mercury2/cnconfigure 2010-04-25 02:50:12 UTC (rev 694) @@ -11,8 +11,8 @@ { echo -n "Checking for <$1>... " echo -e "#include <$1>\n" > tmp.c -#echo gcc $CC_BASE -E tmp.c -if gcc $CC_BASE -E tmp.c 1> foo 2> foo; then +#echo ${CC} $CC_BASE -E tmp.c +if $CC $CC_BASE -E tmp.c 1> foo 2> foo; then # rm ./tmp.c rm ./foo echo "yes" @@ -29,8 +29,8 @@ { echo -n "Checking for -l$1... " echo -e "int main() { return 0; }" > tmp.c -#echo gcc $CC_BASE $LD_BASE -o bar tmp.c -l$1 -if gcc $CC_BASE $LD_BASE -o bar tmp.c -l$1 1> foo 2> foo; then +#echo $CC $CC_BASE $LD_BASE -o bar tmp.c -l$1 +if $CC $CC_BASE $LD_BASE -o bar tmp.c -l$1 1> foo 2> foo; then rm ./tmp.c rm ./foo rm ./bar @@ -58,11 +58,11 @@ echo "#define $i" >> configuration.h done -echo "Compile line used: cc $CC_BASE" +echo "Compile line used: $CC $CC_BASE" echo -n "Checking to make sure standard cflags and compile are acceptable... " echo -e "\n" > tmp.c -if cc $CC_BASE -E tmp.c 1> foo 2> foo; then +if $CC $CC_BASE -E tmp.c 1> foo 2> foo; then rm ./foo echo "yes" else @@ -71,10 +71,10 @@ exit -1 fi -echo "Link line used: g++ $CC_BASE $LD_BASE" +echo "Link line used: $CC $CC_BASE $LD_BASE" echo -n "Checking to make sure ldflags and cflags are acceptable... " echo -e "int main() { return 0; }" > tmp.c -if g++ $CC_BASE $LD_BASE -o bar tmp.c 1> foo 2> foo; then +if $CC $CC_BASE $LD_BASE -o bar tmp.c 1> foo 2> foo; then rm ./tmp.c rm ./foo rm ./bar @@ -128,7 +128,7 @@ return 0; }\n" > tmp.c -if gcc -o tmp.o tmp.c; then +if cc -o tmp.o tmp.c; then echo -n "Compile OK. " rm ./tmp.c else @@ -170,6 +170,9 @@ echo "" > Makefile +#if we need extra beginning parameters, tack them in here +echo $EXTRA_BEGIN >> Makefile + echo -n "SOURCES=" >> Makefile for i in $SOURCES; do echo -n "$i " >> Makefile @@ -184,16 +187,17 @@ LDFLAGS="$LDFLAGS $LD_BASE" -echo "Final compile line: cc ${CC_BASE} ${CFLAGS} -c -o \$@ \$<" +echo "Final compile line: ${CC} ${CC_BASE} ${CFLAGS} -c -o \$@ \$<" echo "Final link line: g++ -o \$@ \$^ ${LDFLAGS}" echo "PROJ=$PROJ" >> Makefile +echo "CC=$CC" >> Makefile echo "CFLAGS=$CC_BASE $CFLAGS" >> Makefile echo "LDFLAGS=$LDFLAGS" >> Makefile echo "">>Makefile echo -e "all : \$(PROJ) library allmodules" >> Makefile echo -e "\$(PROJ) : \$(OBJ)" >> Makefile -echo -e "\tg++ -o \$@ \$^ \$(LDFLAGS)" >> Makefile +echo -e "\t${cc} -o \$@ \$^ \$(LDFLAGS)" >> Makefile echo -e "help : " >> Makefile echo -e " echo \"Available: <\$(PROJ)> <clean> <library> <help>\"" >> Makefile if test `uname -s` == "Darwin" ; then @@ -208,7 +212,7 @@ echo "" >> Makefile for i in $SOURCES; do echo "Processing: $i" - cc $CC_BASE $CFLAGS -MM "$i" -MT $( echo "$i" | sed "s/\.S/\.o/g;s/\.cpp/\.o/g;s/\.c/\.o/g" ) >> Makefile + ${CC} $CC_BASE $CFLAGS -MM "$i" -MT $( echo "$i" | sed "s/\.S/\.o/g;s/\.cpp/\.o/g;s/\.c/\.o/g" ) >> Makefile #FIX THIS!!!! It should be don at make time, not here. echo -e "\t\$(CC) \$(CC_BASE) \$(CFLAGS) -c -o \$@ \$<" >> Makefile echo "" >> Makefile Modified: Mercury2/src/Mercury2.cpp =================================================================== --- Mercury2/src/Mercury2.cpp 2010-04-22 00:01:37 UTC (rev 693) +++ Mercury2/src/Mercury2.cpp 2010-04-25 02:50:12 UTC (rev 694) @@ -15,7 +15,9 @@ #include <MercuryTimer.h> #include <RenderGraph.h> #include <Texture.h> +#ifdef _HAVE_LIB_GL #include <GLHeaders.h> +#endif #include <ModuleManager.h> #include <MercuryFile.h> @@ -200,8 +202,10 @@ //uncomment the next 2 lines to use threads // UpdateLoopGo.Increment(); // updateThread.Wait(); - + +#ifdef _HAVE_LIB_GL PrintGLFunctionCalls(); +#endif SAFE_DELETE(root); SAFE_DELETE(w); Modified: Mercury2/src/MercuryCrash.c =================================================================== --- Mercury2/src/MercuryCrash.c 2010-04-22 00:01:37 UTC (rev 693) +++ Mercury2/src/MercuryCrash.c 2010-04-25 02:50:12 UTC (rev 694) @@ -21,7 +21,7 @@ #ifndef __USE_POSIX #define __USE_POSIX #include <signal.h> -#undef__USE_POSIX +#undef __USE_POSIX #else #include <signal.h> #endif Added: Mercury2/tools/wii_libs/Makefile =================================================================== --- Mercury2/tools/wii_libs/Makefile (rev 0) +++ Mercury2/tools/wii_libs/Makefile 2010-04-25 02:50:12 UTC (rev 694) @@ -0,0 +1,38 @@ +include $(DEVKITPPC)/wii_rules + +all : libpng.a libz.a + +PNG_TGZ:=libpng-1.4.1.tar.gz +PNG_FOLDER:=libpng-1.4.1 + +Z_TGZ:=zlib-1.2.4.tar.gz +Z_FOLDER:=zlib-1.2.4 + +$(PNG_TGZ) : + wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.1.tar.gz + +$(PNG_FOLDER) : $(PNG_TGZ) + tar xzvf $(PNG_TGZ) + +libpng.a : $(PNG_FOLDER) libz.a + (cd $(PNG_FOLDER)&&make -f../Makefile.png&&cd ..) + cp $(PNG_FOLDER)/libpng.a . + +$(Z_TGZ) : + wget http://zlib.net/zlib-1.2.4.tar.gz + +$(Z_FOLDER) : $(Z_TGZ) + tar xzvf $(Z_TGZ) + +libz.a : $(Z_FOLDER) + (cd $(Z_FOLDER)&&make -f../Makefile.zlib&&cd ..) + cp $(Z_FOLDER)/libz.a . + +clobber : clean + rm -rf $(PNG_TGZ) $(PNG_FOLDER) $(Z_TGZ) $(Z_FOLDER) + +clean : + rm -rf *~ libz.a libpng.a + (cd $(Z_FOLDER)&&make -f../Makefile.zlib clean&&cd ..) + (cd $(PNG_FOLDER)&&make -f../Makefile.png clean&&cd ..) + Added: Mercury2/tools/wii_libs/Makefile.png =================================================================== --- Mercury2/tools/wii_libs/Makefile.png (rev 0) +++ Mercury2/tools/wii_libs/Makefile.png 2010-04-25 02:50:12 UTC (rev 694) @@ -0,0 +1,17 @@ +all : libpng.a minitest + +OBJS:=png.o pngerror.o pngget.o pngpread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o +SRCS:=png.c pngerror.c pngget.c pngpread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c + +libpng.a : $(OBJS) + $(DEVKITPPC)/bin/powerpc-eabi-ar rcs $@ $^ + +%.o : %.c + $(DEVKITPPC)/bin/powerpc-eabi-gcc -I../zlib-1.2.4 -O2 -c -o $@ $^ + +minitest : libpng.a + $(DEVKITPPC)/bin/powerpc-eabi-gcc -I../zlib-1.2.4 -O2 -c example.c -c -o example.o + $(DEVKITPPC)/bin/powerpc-eabi-gcc example.o -L. -L.. -lz -lpng + +clean : + rm -rf *~ *.o libz.a Added: Mercury2/tools/wii_libs/Makefile.zlib =================================================================== --- Mercury2/tools/wii_libs/Makefile.zlib (rev 0) +++ Mercury2/tools/wii_libs/Makefile.zlib 2010-04-25 02:50:12 UTC (rev 694) @@ -0,0 +1,17 @@ +all : libz.a minitest + +OBJS:=adler32.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inftrees.o inffast.o inflate.o trees.o uncompr.o zutil.o +SRCS:=adler32.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inftrees.c inffast.c inflate.c trees.c uncompr.c zutil.c + +libz.a : $(OBJS) + $(DEVKITPPC)/bin/powerpc-eabi-ar rcs $@ $^ + +%.o : %.c + $(DEVKITPPC)/bin/powerpc-eabi-gcc -O2 -c -o $@ $^ + +minitest : libz.a + $(DEVKITPPC)/bin/powerpc-eabi-gcc -O2 -c minigzip.c -c -o minigzip.o + $(DEVKITPPC)/bin/powerpc-eabi-gcc minigzip.o -L. -lz + +clean : + rm -rf *~ *.o libz.a This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |