[d7acd89] | 1 | #! /bin/sh |
---|
[e66be9a] | 2 | release=yes |
---|
| 3 | if test x"$1" = x-t ; then |
---|
| 4 | release= |
---|
[f30265a0] | 5 | shift |
---|
[d7acd89] | 6 | fi |
---|
[f30265a0] | 7 | build=${@-src rpm deb doc alien djgpp mingw} |
---|
[e66be9a] | 8 | if test x"$release" = xyes ; then |
---|
| 9 | if ! cvs diff > /dev/null 2> /dev/null ; then |
---|
| 10 | echo There are changes not checked into CVS - please rectify |
---|
| 11 | exit 1 |
---|
| 12 | fi |
---|
| 13 | # Update ChangeLog |
---|
[bfa0e10] | 14 | CVS2CL=./cvs2cl.pl |
---|
| 15 | if ! test -x $CVS2CL ; then |
---|
| 16 | CVS2CL=../cvs2cl/cvs2cl.pl |
---|
| 17 | fi |
---|
| 18 | if ! $CVS2CL 2> /dev/null ; then |
---|
[e66be9a] | 19 | echo Failed to update ChangeLog from CVS |
---|
| 20 | exit 1 |
---|
| 21 | fi |
---|
[fd51dc3] | 22 | fi |
---|
| 23 | if test -f Makefile ; then |
---|
| 24 | if ! make distclean ; then |
---|
| 25 | echo make distclean failed |
---|
| 26 | exit 1 |
---|
| 27 | fi |
---|
| 28 | fi |
---|
[bd7120b] | 29 | if test x"$release" = xyes ; then |
---|
| 30 | wget ftp://ftp.gnu.org/gnu/config/config.guess |
---|
| 31 | wget ftp://ftp.gnu.org/gnu/config/config.sub |
---|
| 32 | fi |
---|
[dc459c9] | 33 | aclocal |
---|
| 34 | autoheader |
---|
| 35 | automake -a |
---|
| 36 | autoconf |
---|
[eea518c] | 37 | if ! ./configure ; then |
---|
| 38 | echo configure failed |
---|
| 39 | exit 1 |
---|
| 40 | fi |
---|
[c693a3f] | 41 | # make distcheck fails - cvs version of automake doesn't clean up all the |
---|
[f30265a0] | 42 | # files it creates... (FIXME: change to distcheck once automake fixed) |
---|
[c693a3f] | 43 | if ! make dist ; then |
---|
| 44 | echo make dist failed |
---|
[e719df1] | 45 | exit 1 |
---|
| 46 | fi |
---|
[f30265a0] | 47 | if test x"$release" = xyes && expr "$build" : '.*\<rpm\>'; then |
---|
[7eb8d4a] | 48 | if rpm --version > /dev/null 2> /dev/null ; then |
---|
| 49 | if ! make rpm ; then |
---|
| 50 | echo make rpm failed |
---|
| 51 | exit 1 |
---|
| 52 | fi |
---|
| 53 | else |
---|
| 54 | echo rpm not installed - skipping rpm generation |
---|
[e66be9a] | 55 | fi |
---|
[f30265a0] | 56 | fi |
---|
| 57 | if test x"$release" = xyes && expr "$build" : '.*\<deb\>'; then |
---|
[9cfb427] | 58 | if ! make debian ; then |
---|
[7eb8d4a] | 59 | echo make debian failed |
---|
[9cfb427] | 60 | exit 1 |
---|
| 61 | fi |
---|
[f30265a0] | 62 | fi |
---|
| 63 | if test x"$release" = xyes && expr "$build" : '.*\<doc\>'; then |
---|
[e66be9a] | 64 | if ! make dos_doc_zip ; then |
---|
| 65 | echo make dos_doc_zip failed |
---|
| 66 | exit 1 |
---|
| 67 | fi |
---|
[21a0009] | 68 | if ! make riscos_doc_zip ; then |
---|
| 69 | echo make riscos_doc_zip failed |
---|
| 70 | exit 1 |
---|
| 71 | fi |
---|
[fd51dc3] | 72 | fi |
---|
[f30265a0] | 73 | if expr "$build" : '.*\<alien\>'; then |
---|
| 74 | if ! make alien_src_zip ; then |
---|
| 75 | echo make alien_src_zip failed |
---|
| 76 | exit 1 |
---|
| 77 | fi |
---|
[4208811] | 78 | fi |
---|
[9324b2d] | 79 | if ! make distclean ; then |
---|
| 80 | echo make distclean failed |
---|
| 81 | exit 1 |
---|
| 82 | fi |
---|
[f30265a0] | 83 | if expr "$build" : '.*\<djgpp\>'; then |
---|
| 84 | SAVE_PATH="$PATH" |
---|
| 85 | # for building on mrs30 |
---|
| 86 | if test -d /opt/crosstools/i386-pc-msdosdjgpp ; then |
---|
| 87 | PATH=/opt/crosstools/i386-pc-msdosdjgpp/bin:/opt/crosstools/bin:$PATH |
---|
| 88 | fi |
---|
| 89 | if ! env LDFLAGS=-s STRIP=echo CAVEROT=caverot.exe \ |
---|
| 90 | CRLIB=-lalleg CROBJX=dosrot.o ./configure --with-x=no --disable-aven; then |
---|
| 91 | echo djgpp configure failed |
---|
| 92 | exit 1 |
---|
| 93 | fi |
---|
| 94 | if ! make ; then |
---|
| 95 | echo djgpp make failed |
---|
| 96 | exit 1 |
---|
| 97 | fi |
---|
[e66be9a] | 98 | if ! make djgpp_zip ; then |
---|
| 99 | echo djgpp make djgpp_zip failed |
---|
| 100 | exit 1 |
---|
| 101 | fi |
---|
[f30265a0] | 102 | if ! make distclean ; then |
---|
| 103 | echo make distclean failed |
---|
| 104 | exit 1 |
---|
| 105 | fi |
---|
| 106 | PATH="$SAVE_PATH" |
---|
[fd51dc3] | 107 | fi |
---|
[f30265a0] | 108 | if expr "$build" : '.*\<mingw\>'; then |
---|
| 109 | SAVE_PATH="$PATH" |
---|
| 110 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
---|
| 111 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
---|
| 112 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
---|
[b0a751b4] | 113 | else |
---|
[f30265a0] | 114 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
| 115 | # debian mingw32 package |
---|
| 116 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
| 117 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
| 118 | export CC |
---|
| 119 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
| 120 | export CXX |
---|
| 121 | else |
---|
| 122 | # variant of debian mingw32 package? |
---|
| 123 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
| 124 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
| 125 | export CC |
---|
| 126 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
| 127 | export CXX |
---|
| 128 | fi |
---|
| 129 | fi |
---|
| 130 | if ! env LDFLAGS=-s CAVEROT= ./configure --with-x=no --with-wxconfig=`pwd`/mingw_extras/wxmsw-config ; then |
---|
| 131 | echo mingw configure failed |
---|
| 132 | exit 1 |
---|
| 133 | fi |
---|
| 134 | if ! make ; then |
---|
| 135 | echo mingw make failed |
---|
| 136 | exit 1 |
---|
[b0a751b4] | 137 | fi |
---|
[8f6f99b] | 138 | if ! make mingw_iss ; then |
---|
| 139 | echo mingw make mingw_iss failed |
---|
[e66be9a] | 140 | exit 1 |
---|
| 141 | fi |
---|
[f30265a0] | 142 | if ! make distclean ; then |
---|
| 143 | echo make distclean failed |
---|
| 144 | exit 1 |
---|
| 145 | fi |
---|
| 146 | PATH="$SAVE_PATH" |
---|
| 147 | CC= |
---|
| 148 | CXX= |
---|
[e66be9a] | 149 | fi |
---|