--- build.sh +++ build.sh @@ -15,6 +15,10 @@ WITHUNICODE="--unicode=no" #WXDEV="" +if [ -z "$WX_CONFIG" ] +then + WX_CONFIG="wx-config" +fi ######################################################################## VERSION="1.2.6-RELEASE_2007.12.12" @@ -154,7 +158,7 @@ WITHBLITS="-DUSE_RAW_BITMAP_ACCESS" else WXVER=0 -case "`wx-config --version`" in +case "`$WX_CONFIG --version`" in 2.9*|3*) echo WARNING: wxWidgets versions higher than 2.8 have not been tested. echo It might work if they are compiled with backwards compatibility. @@ -190,8 +194,8 @@ fi # purpose of this is to avoid errors on systems that have only unicode. if [ -z "$CYGWIN" ] then - WXREL="`wx-config --release`" - if [ -n "`wx-config --list | grep $WXREL | grep unicode`" ] + WXREL="`$WX_CONFIG --release`" + if [ -n "`$WX_CONFIG --list | grep $WXREL | grep unicode`" ] then WITHUNICODE="--unicode=yes" fi @@ -293,7 +297,6 @@ do ;; build*) echo ;; #default - nothing to do here, this is the default. install) - [ -z "$CYGWIN" ] && [ "`whoami`" != "root" ] && echo "Need to be root to install. try sudo ./build.sh $@" && exit 1 INSTALL=1; ;; @@ -462,7 +465,7 @@ if [ -z "$CYGWIN" ] then # many thanks to David Cecchin for finding the unicode issues fixed below. - WXCONFIGFLAGS=`wx-config --cppflags $WITHUNICODE ` + WXCONFIGFLAGS=`$WX_CONFIG --cppflags $WITHUNICODE ` if [ -z "$WXCONFIGFLAGS" ] then echo wx-config has failed, or returned an error. Ensure that it exists in your path. @@ -471,7 +474,7 @@ then fi CFLAGS="-I. -I../include -I../cpu68k -I../wxui $WXCONFIGFLAGS $WITHOPTIMIZE $WITHDEBUG" CXXFLAGS="-I. -I../include -I../cpu68k -I../wxui $WXCONFIGFLAGS $WITHOPTIMIZE $WITHDEBUG" - LINKOPTS="`wx-config $STATIC $WITHUNICODE --libs --linkdeps --cppflags`" + LINKOPTS="`$WX_CONFIG $STATIC $WITHUNICODE --libs --linkdeps --cppflags`" if [ -z "$LINKOPTS" ] then echo wx-config has failed, or returned an error. Ensure that it exists in your path. @@ -849,15 +852,6 @@ then cd ../bin echo -n " " -# Report size and hashes #### - -if [ -z "$DARWIN" ] -then - SIZE="`du -sh lisaem 2>/dev/null`" -else - SIZE="`du -sh LisaEm.app 2>/dev/null`" -fi - if [ -n "$DARWIN" ] then @@ -895,15 +889,25 @@ then then cd ../bin/ echo Installing LisaEm.app - tar cf - ./LisaEm.app | (cd $PREFIX; tar xf -) - mkdir -pm755 /usr/local/bin - echo Installing lisafsh-tool and lisadiskinfo to /usr/local/bin + tar cf - ./LisaEm.app | (cd $PREFIXAPP; tar xf -) + mkdir -pm755 $PREFIXBIN + echo Installing lisafsh-tool and lisadiskinfo to $PREFIXBIN chmod 755 lisafsh-tool lisadiskinfo - cp lisafsh-tool lisadiskinfo /usr/local/bin + cp lisafsh-tool lisadiskinfo $PREFIXBIN echo Done Installing. fi fi + +# Report size and hashes #### + +if [ -z "$DARWIN" ] +then + SIZE="`du -sh lisaem 2>/dev/null`" +else + SIZE="`du -sh LisaEm.app 2>/dev/null`" +fi + # some older OS's don't support du -sh, so fall back to du -sk and convert to MB's if [ -z "$SIZE" ] then