From: <cn...@us...> - 2008-12-06 22:48:39
|
Revision: 56 http://hgengine.svn.sourceforge.net/hgengine/?rev=56&view=rev Author: cnlohr Date: 2008-12-06 21:58:06 +0000 (Sat, 06 Dec 2008) Log Message: ----------- fix auto build scripts Modified Paths: -------------- Mercury2/adv_set.c Mercury2/base_set.sh Mercury2/cnconfigure Modified: Mercury2/adv_set.c =================================================================== --- Mercury2/adv_set.c 2008-12-06 21:56:38 UTC (rev 55) +++ Mercury2/adv_set.c 2008-12-06 21:58:06 UTC (rev 56) @@ -8,18 +8,23 @@ src/MercuryThreads.cpp src/MercuryMath.cpp \ src/MercuryWindow.cpp src/RenderableNode.cpp \ src/TransformNode.cpp src/MercuryMatrix.cpp \ - src/Viewport.cpp src/Quad.cpp" + src/Viewport.cpp src/Quad.cpp src/MercuryUtil.cpp \ + src/Texture.cpp" +#ifdef USE_LIBXML +SOURCES="$SOURCES src/XMLParser.cpp" +#endif + #ifdef USE_X11 SOURCES="$SOURCES src/X11Window.cpp" #endif PROJ="mercury" -CFLAGS="-DHAVE_CONFIG -fno-exceptions -fPIC -Isrc" -LDFLAGS="-rdynamic -g -fPIC" +CFLAGS="$CFLAGS -DHAVE_CONFIG -fno-exceptions -fPIC -Isrc" +LDFLAGS="$LDFLAGS -rdynamic -g -fPIC" /* - * (c) 2007 Charles Lohr + * (c) 2007-2008 Charles Lohr * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a Modified: Mercury2/base_set.sh =================================================================== --- Mercury2/base_set.sh 2008-12-06 21:56:38 UTC (rev 55) +++ Mercury2/base_set.sh 2008-12-06 21:58:06 UTC (rev 56) @@ -8,9 +8,10 @@ ISMAC=1; fi -OPTIONS="X11" +OPTIONS="X11 libxml OGL" OPT_X11=1 OPT_OGL=1 +OPT_libxml=1 DEFINES="WAS_CONFIGURED USE_MSTRING" CC_BASE="-O2 -g" @@ -44,6 +45,14 @@ NEED_L="m c z pthread png pthread"; +if test $OPT_libxml = 1; then + CC_BASE="$CC_BASE -I/usr/include/libxml2" + NEED_H="$NEED_H libxml/parser.h" + NEED_L="$NEED_L xml2" + DEFINES="$DEFINES USE_LIBXML" +fi + + if test $OPT_X11 = 1; then NEED_L="$NEED_L X11" NEED_H="$NEED_H X11/Xlib.h" Modified: Mercury2/cnconfigure =================================================================== --- Mercury2/cnconfigure 2008-12-06 21:56:38 UTC (rev 55) +++ Mercury2/cnconfigure 2008-12-06 21:58:06 UTC (rev 56) @@ -1,5 +1,5 @@ -#!/bin/sh -echo "Mercury mini-configurator (C) 2007-2008 Charles Lohr under the MIT/x11 License" +#!/bin/bash +echo "Mercury mini-configurator (C) 2007 Charles Lohr under the MIT/x11 License" if source ./base_set.sh $*; then echo "Source Base Set Ok." @@ -11,7 +11,7 @@ { 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 # rm ./tmp.c rm ./foo @@ -29,6 +29,7 @@ { 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 rm ./tmp.c rm ./foo @@ -57,6 +58,35 @@ echo "#define $i" >> configuration.h done +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 + rm ./foo + echo "yes" +else + rm ./foo + echo "no" + exit -1 +fi + +echo "Link line used: g++ $CC_BASE $LD_BASE" +echo -n "Checking to make sure ldflags and linker are acceptable... " +echo -e "int main() { return 0; }" > tmp.c +if gcc $CC_BASE $LD_BASE -o bar tmp.c 1> foo 2> foo; then + rm ./tmp.c + rm ./foo + rm ./bar + echo "yes" +else + rm ./tmp.c + rm ./foo + echo "no" + exit -1; +fi + + for i in $NEED_H; do if CheckForInclude "$i"; then echo "#define _HAVE_$i" | sed "s/\./_/;s/\//_/g" >> configuration.h; else echo "Configure failed."; exit -1; fi done @@ -154,17 +184,25 @@ LDFLAGS="$LDFLAGS $LD_BASE" +echo "Final compile line: cc \$(CC_BASE) \$(CFLAGS) -c -o \$@ \$<" +echo "Final link line: g++ -o \$@ \$^ \$(LDFLAGS)" + echo "PROJ=$PROJ" >> Makefile echo "CFLAGS=$CC_BASE $CFLAGS" >> Makefile echo "LDFLAGS=$LDFLAGS" >> Makefile echo "">>Makefile -echo -e "all : \$(PROJ) Library" +echo -e "all : \$(PROJ) library" >> Makefile echo -e "\$(PROJ) : \$(OBJ)" >> Makefile -echo -e "\tg++ \$(LDFLAGS) -o \$@ \$^" >> Makefile +echo -e "\tg++ -o \$@ \$^ \$(LDFLAGS)" >> Makefile echo -e "help : " >> Makefile echo -e " echo \"Available: <\$(PROJ)> <clean> <library> <help>\"" >> Makefile -echo -e "library : \$(OBJ)" >> Makefile -echo -e "\tg++ \$(LDFLAGS) -shared -o \$(PROJ).so \$^" >> Makefile +if test `uname -s` == "Darwin" ; then + echo -e "library : \$(OBJ)" >> Makefile + echo -e "\tg++ -dynamiclib -o \$(PROJ).dylib \$^ \$(LDFLAGS)" >> Makefile +else + echo -e "library : \$(OBJ)" >> Makefile + echo -e "\tg++ -shared -o \$(PROJ).so \$^ \$(LDFLAGS)" >> Makefile +fi echo "" >> Makefile for i in $SOURCES; do echo "Processing: $i" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |