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