| [d7acd89] | 1 | #! /bin/sh | 
|---|
| [ae1309f] | 2 |  | 
|---|
| [3cbb5ff] | 3 | # Needed for wine to run on roadkill: | 
|---|
| [0e558e5] | 4 | LD_ASSUME_KERNEL=2.4.1 | 
|---|
 | 5 | export LD_ASSUME_KERNEL | 
|---|
| [9f43f9d] | 6 |  | 
|---|
| [27b8b59] | 7 | # flags to consider: | 
|---|
 | 8 | # CFLAGS="-O2 -fomit-frame-pointer" | 
|---|
 | 9 | # CXXFLAGS="-O2 -fno-rtti -fomit-frame-pointer" | 
|---|
| [ae1309f] | 10 | rel=yes | 
|---|
| [e66be9a] | 11 | if test x"$1" = x-t ; then | 
|---|
| [ae1309f] | 12 |    rel= | 
|---|
| [f30265a0] | 13 |    shift | 
|---|
| [d7acd89] | 14 | fi | 
|---|
| [6134f54] | 15 | mk=${@-src rpm deb doc mingw} | 
|---|
| [ae1309f] | 16 | if test x"$rel" = xyes ; then | 
|---|
| [f6a3719] | 17 |    # Update debian changelog entry if necessary | 
|---|
 | 18 |    # If it does get updated, then the next check will fail... | 
|---|
 | 19 |    ./update-debcl.pl | 
|---|
 | 20 |    # Check everything is checked into CVS | 
|---|
| [e66be9a] | 21 |    if ! cvs diff > /dev/null 2> /dev/null ; then | 
|---|
 | 22 |       echo There are changes not checked into CVS - please rectify | 
|---|
 | 23 |       exit 1 | 
|---|
 | 24 |    fi | 
|---|
 | 25 |    # Update ChangeLog | 
|---|
| [bfa0e10] | 26 |    CVS2CL=./cvs2cl.pl | 
|---|
 | 27 |    if ! test -x $CVS2CL ; then | 
|---|
 | 28 |       CVS2CL=../cvs2cl/cvs2cl.pl | 
|---|
 | 29 |    fi | 
|---|
| [fc4b814] | 30 |    if ! test -x $CVS2CL ; then | 
|---|
 | 31 |       echo cvs2cl.pl not found | 
|---|
 | 32 |       exit 1 | 
|---|
 | 33 |    fi | 
|---|
| [9f43f9d] | 34 |    TAG=`sed 's/^CHANGELOG_FROM_TAG=//p;d' configure.in` | 
|---|
| [fc4b814] | 35 |    # stderr | grep -v '^cvs server: warning: no revision .*/Attic/' | 
|---|
 | 36 |    if ! cvs log -r$TAG:: 2> /dev/null|./fixchangelog.pl $TAG|$CVS2CL --stdin 2> /dev/null ; then | 
|---|
| [e66be9a] | 37 |       echo Failed to update ChangeLog from CVS | 
|---|
 | 38 |       exit 1 | 
|---|
 | 39 |    fi | 
|---|
| [fd51dc3] | 40 | fi | 
|---|
 | 41 | if test -f Makefile ; then | 
|---|
 | 42 |    if ! make distclean ; then | 
|---|
 | 43 |       echo make distclean failed | 
|---|
 | 44 |       exit 1 | 
|---|
 | 45 |    fi | 
|---|
 | 46 | fi | 
|---|
| [27b8b59] | 47 | if test yes = "$rel" ; then | 
|---|
| [38226ad] | 48 |    rm -f config.guess.new config.sub.new | 
|---|
| [b462168] | 49 |    # only check for new versions if the current ones are over a day old | 
|---|
 | 50 |    perl -e '-M "config.guess" && -M "config.sub" && exit 1' ||\ | 
|---|
| [70bfbfd] | 51 |       wget ftp://ftp.gnu.org/gnu/config/config.guess -O config.guess.new &&\ | 
|---|
| [38226ad] | 52 |       wget ftp://ftp.gnu.org/gnu/config/config.sub -O config.sub.new &&\ | 
|---|
| [9b3648d] | 53 |       chmod 755 config.guess.new config.sub.new &&\ | 
|---|
| [38226ad] | 54 |       mv config.guess.new config.guess && mv config.sub.new config.sub | 
|---|
| [bd7120b] | 55 | fi | 
|---|
| [74dc997] | 56 | autoreconf --force -i | 
|---|
| [b462168] | 57 | export CC | 
|---|
 | 58 | export CXX | 
|---|
| [fc4b814] | 59 | CC=gcc | 
|---|
 | 60 | CXX=g++ | 
|---|
 | 61 | if ! ./configure ; then | 
|---|
| [eea518c] | 62 |    echo configure failed | 
|---|
 | 63 |    exit 1 | 
|---|
 | 64 | fi | 
|---|
| [27b8b59] | 65 | if test yes = "$rel" ; then | 
|---|
 | 66 |    export CFLAGS | 
|---|
 | 67 |    export CXXFLAGS | 
|---|
 | 68 |    # tell the preproceesor to be C89 - this makes it reject // comments | 
|---|
 | 69 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" | 
|---|
 | 70 | # FIXME   CXXFLAGS="-Werror" | 
|---|
 | 71 |    CFLAGS="-Wp,-std=c89" | 
|---|
 | 72 |    CXXFLAGS= | 
|---|
| [b462168] | 73 |    if ! make dist ; then # distcheck fails extend.tst for some reason! | 
|---|
| [f78ad72] | 74 |       echo make distcheck failed | 
|---|
 | 75 |       exit 1 | 
|---|
 | 76 |    fi | 
|---|
| [27b8b59] | 77 |    CFLAGS= | 
|---|
 | 78 |    CXXFLAGS= | 
|---|
| [f78ad72] | 79 | else | 
|---|
 | 80 |    if ! make dist ; then | 
|---|
 | 81 |       echo make dist failed | 
|---|
 | 82 |       exit 1 | 
|---|
 | 83 |    fi | 
|---|
| [e719df1] | 84 | fi | 
|---|
| [ae1309f] | 85 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then | 
|---|
| [1973548] | 86 |    if rpmbuild --version > /dev/null 2> /dev/null ; then | 
|---|
| [7eb8d4a] | 87 |       if ! make rpm ; then | 
|---|
 | 88 |          echo make rpm failed | 
|---|
 | 89 |          exit 1 | 
|---|
 | 90 |        fi | 
|---|
 | 91 |    else | 
|---|
| [1973548] | 92 |        echo rpmbuild not installed - skipping rpm generation | 
|---|
| [e66be9a] | 93 |    fi | 
|---|
| [f30265a0] | 94 | fi | 
|---|
| [ae1309f] | 95 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then | 
|---|
| [9cfb427] | 96 |    if ! make debian ; then | 
|---|
| [7eb8d4a] | 97 |       echo make debian failed | 
|---|
| [9cfb427] | 98 |       exit 1 | 
|---|
 | 99 |    fi | 
|---|
| [f30265a0] | 100 | fi | 
|---|
| [ae1309f] | 101 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then | 
|---|
| [e68fccf] | 102 |    if ! make dos_doc_exe ; then | 
|---|
 | 103 |       echo make dos_doc_exe failed | 
|---|
| [e66be9a] | 104 |       exit 1 | 
|---|
 | 105 |    fi | 
|---|
| [4208811] | 106 | fi | 
|---|
| [9324b2d] | 107 | if ! make distclean ; then | 
|---|
 | 108 |    echo make distclean failed | 
|---|
 | 109 |    exit 1 | 
|---|
 | 110 | fi | 
|---|
| [b462168] | 111 | unset CC | 
|---|
 | 112 | unset CXX | 
|---|
| [ae1309f] | 113 | if expr "$mk" : '.*\<mingw\>'; then | 
|---|
| [6d316f1] | 114 |    test -n "$build_platform" || build_platform=`sh config.guess` | 
|---|
| [f30265a0] | 115 |    SAVE_PATH="$PATH" | 
|---|
 | 116 |    if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then | 
|---|
 | 117 |       # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ | 
|---|
 | 118 |       PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH | 
|---|
| [b0a751b4] | 119 |    else | 
|---|
| [f30265a0] | 120 |       if test -d /usr/i586-mingw32msvc/bin ; then | 
|---|
 | 121 |          # debian mingw32 package | 
|---|
 | 122 |          PATH=/usr/i586-mingw32msvc/bin:$PATH | 
|---|
 | 123 |          CC=/usr/bin/i586-mingw32msvc-gcc | 
|---|
 | 124 |          export CC | 
|---|
 | 125 |          CXX=/usr/bin/i586-mingw32msvc-g++ | 
|---|
 | 126 |          export CXX | 
|---|
 | 127 |       else | 
|---|
 | 128 |          # variant of debian mingw32 package? | 
|---|
 | 129 |          PATH=/usr/i386-mingw32msvc/bin:$PATH | 
|---|
 | 130 |          CC=/usr/bin/i386-mingw32msvc-gcc | 
|---|
 | 131 |          export CC | 
|---|
 | 132 |          CXX=/usr/bin/i386-mingw32msvc-g++ | 
|---|
 | 133 |          export CXX | 
|---|
 | 134 |       fi | 
|---|
 | 135 |    fi | 
|---|
| [fc4b814] | 136 |    wxc=wxmsw-2.5-config | 
|---|
| [9f43f9d] | 137 |    for a in /usr/i586-mingw32msvc/bin/wx-config ; do | 
|---|
| [74dc997] | 138 |       test -x "$a" && wxc="$a" | 
|---|
 | 139 |    done | 
|---|
| [1809849] | 140 |    LDFLAGS= | 
|---|
 | 141 |    CPPFLAGS= | 
|---|
| [c37f076] | 142 | #if ! ./configure --host=mingw32 --build="$build_platform" WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" CFLAGS=-Werror CXXFLAGS=-Werror ; then | 
|---|
| [3346ddd] | 143 |    if ! ./configure --host=mingw32 --build="$build_platform" WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" ; then | 
|---|
| [f30265a0] | 144 |       echo mingw configure failed | 
|---|
 | 145 |       exit 1 | 
|---|
 | 146 |    fi | 
|---|
 | 147 |    if ! make ; then | 
|---|
 | 148 |       echo mingw make failed | 
|---|
 | 149 |       exit 1 | 
|---|
| [b0a751b4] | 150 |    fi | 
|---|
| [8f6f99b] | 151 |    if ! make mingw_iss ; then | 
|---|
 | 152 |       echo mingw make mingw_iss failed | 
|---|
| [e66be9a] | 153 |       exit 1 | 
|---|
 | 154 |    fi | 
|---|
| [f30265a0] | 155 |    if ! make distclean ; then | 
|---|
 | 156 |       echo make distclean failed | 
|---|
 | 157 |       exit 1 | 
|---|
 | 158 |    fi | 
|---|
 | 159 |    PATH="$SAVE_PATH" | 
|---|
 | 160 |    CC= | 
|---|
 | 161 |    CXX= | 
|---|
| [e66be9a] | 162 | fi | 
|---|