| 1 | #! /bin/sh |
|---|
| 2 | |
|---|
| 3 | rel=yes |
|---|
| 4 | if test x"$1" = x-t ; then |
|---|
| 5 | rel= |
|---|
| 6 | shift |
|---|
| 7 | fi |
|---|
| 8 | mk=${@-src rpm deb doc alien djgpp mingw} |
|---|
| 9 | if test x"$rel" = xyes ; then |
|---|
| 10 | # Update debian changelog entry if necessary |
|---|
| 11 | # If it does get updated, then the next check will fail... |
|---|
| 12 | ./update-debcl.pl |
|---|
| 13 | # Check everything is checked into CVS |
|---|
| 14 | if ! cvs diff > /dev/null 2> /dev/null ; then |
|---|
| 15 | echo There are changes not checked into CVS - please rectify |
|---|
| 16 | exit 1 |
|---|
| 17 | fi |
|---|
| 18 | # Update ChangeLog |
|---|
| 19 | CVS2CL=./cvs2cl.pl |
|---|
| 20 | if ! test -x $CVS2CL ; then |
|---|
| 21 | CVS2CL=../cvs2cl/cvs2cl.pl |
|---|
| 22 | fi |
|---|
| 23 | if ! $CVS2CL 2> /dev/null ; then |
|---|
| 24 | echo Failed to update ChangeLog from CVS |
|---|
| 25 | exit 1 |
|---|
| 26 | fi |
|---|
| 27 | fi |
|---|
| 28 | if test -f Makefile ; then |
|---|
| 29 | if ! make distclean ; then |
|---|
| 30 | echo make distclean failed |
|---|
| 31 | exit 1 |
|---|
| 32 | fi |
|---|
| 33 | fi |
|---|
| 34 | if test x"$rel" = xyes ; then |
|---|
| 35 | rm -f config.guess.new config.sub.new |
|---|
| 36 | perl -e '-M "config.guess" && -M "config.sub" && exit 1' &&\ |
|---|
| 37 | wget ftp://ftp.gnu.org/gnu/config/config.guess -O config.guess.new &&\ |
|---|
| 38 | wget ftp://ftp.gnu.org/gnu/config/config.sub -O config.sub.new &&\ |
|---|
| 39 | mv config.guess.new config.guess && mv config.sub.new config.sub |
|---|
| 40 | fi |
|---|
| 41 | aclocal |
|---|
| 42 | autoheader |
|---|
| 43 | automake -a |
|---|
| 44 | autoconf |
|---|
| 45 | if ! ./configure ; then |
|---|
| 46 | echo configure failed |
|---|
| 47 | exit 1 |
|---|
| 48 | fi |
|---|
| 49 | if test x"$rel" = xyes ; then |
|---|
| 50 | if ! make distcheck ; then |
|---|
| 51 | echo make distcheck failed |
|---|
| 52 | exit 1 |
|---|
| 53 | fi |
|---|
| 54 | else |
|---|
| 55 | if ! make dist ; then |
|---|
| 56 | echo make dist failed |
|---|
| 57 | exit 1 |
|---|
| 58 | fi |
|---|
| 59 | fi |
|---|
| 60 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
|---|
| 61 | if rpm --version > /dev/null 2> /dev/null ; then |
|---|
| 62 | if ! make rpm ; then |
|---|
| 63 | echo make rpm failed |
|---|
| 64 | exit 1 |
|---|
| 65 | fi |
|---|
| 66 | else |
|---|
| 67 | echo rpm not installed - skipping rpm generation |
|---|
| 68 | fi |
|---|
| 69 | fi |
|---|
| 70 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then |
|---|
| 71 | if ! make debian ; then |
|---|
| 72 | echo make debian failed |
|---|
| 73 | exit 1 |
|---|
| 74 | fi |
|---|
| 75 | fi |
|---|
| 76 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
|---|
| 77 | if ! make dos_doc_exe ; then |
|---|
| 78 | echo make dos_doc_exe failed |
|---|
| 79 | exit 1 |
|---|
| 80 | fi |
|---|
| 81 | if ! make riscos_doc_zip ; then |
|---|
| 82 | echo make riscos_doc_zip failed |
|---|
| 83 | exit 1 |
|---|
| 84 | fi |
|---|
| 85 | fi |
|---|
| 86 | if expr "$mk" : '.*\<alien\>'; then |
|---|
| 87 | if ! make alien_src_zip ; then |
|---|
| 88 | echo make alien_src_zip failed |
|---|
| 89 | exit 1 |
|---|
| 90 | fi |
|---|
| 91 | fi |
|---|
| 92 | if ! make distclean ; then |
|---|
| 93 | echo make distclean failed |
|---|
| 94 | exit 1 |
|---|
| 95 | fi |
|---|
| 96 | if expr "$mk" : '.*\<djgpp\>'; then |
|---|
| 97 | SAVE_PATH="$PATH" |
|---|
| 98 | # for building on mrs30 |
|---|
| 99 | if test -d /opt/crosstools/i386-pc-msdosdjgpp ; then |
|---|
| 100 | PATH=/opt/crosstools/i386-pc-msdosdjgpp/bin:/opt/crosstools/bin:$PATH |
|---|
| 101 | fi |
|---|
| 102 | if ! ./configure --host=linux --with-x=no --disable-aven LDFLAGS=-s STRIP=echo CAVEROT=caverot.exe CRLIB=-lalleg CROBJX=dosrot.o ; then |
|---|
| 103 | echo djgpp configure failed |
|---|
| 104 | exit 1 |
|---|
| 105 | fi |
|---|
| 106 | if ! make ; then |
|---|
| 107 | echo djgpp make failed |
|---|
| 108 | exit 1 |
|---|
| 109 | fi |
|---|
| 110 | if ! make djgpp_exe ; then |
|---|
| 111 | echo djgpp make djgpp_exe failed |
|---|
| 112 | exit 1 |
|---|
| 113 | fi |
|---|
| 114 | if ! make distclean ; then |
|---|
| 115 | echo make distclean failed |
|---|
| 116 | exit 1 |
|---|
| 117 | fi |
|---|
| 118 | PATH="$SAVE_PATH" |
|---|
| 119 | fi |
|---|
| 120 | if expr "$mk" : '.*\<mingw\>'; then |
|---|
| 121 | SAVE_PATH="$PATH" |
|---|
| 122 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
|---|
| 123 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
|---|
| 124 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
|---|
| 125 | else |
|---|
| 126 | if test -d /usr/i586-mingw32msvc/bin ; then |
|---|
| 127 | # debian mingw32 package |
|---|
| 128 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
|---|
| 129 | CC=/usr/bin/i586-mingw32msvc-gcc |
|---|
| 130 | export CC |
|---|
| 131 | CXX=/usr/bin/i586-mingw32msvc-g++ |
|---|
| 132 | export CXX |
|---|
| 133 | else |
|---|
| 134 | # variant of debian mingw32 package? |
|---|
| 135 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
|---|
| 136 | CC=/usr/bin/i386-mingw32msvc-gcc |
|---|
| 137 | export CC |
|---|
| 138 | CXX=/usr/bin/i386-mingw32msvc-g++ |
|---|
| 139 | export CXX |
|---|
| 140 | fi |
|---|
| 141 | fi |
|---|
| 142 | if ! ./configure --host=linux --with-x=no WXCONFIG=`pwd`/mingw_extras/wxmsw-config LDFLAGS="-s -L/opt/rx-win32/lib" CPPFLAGS=-I/opt/rx-win32/include CAVEROT= ; then |
|---|
| 143 | echo mingw configure failed |
|---|
| 144 | exit 1 |
|---|
| 145 | fi |
|---|
| 146 | if ! make ; then |
|---|
| 147 | echo mingw make failed |
|---|
| 148 | exit 1 |
|---|
| 149 | fi |
|---|
| 150 | if ! make mingw_iss ; then |
|---|
| 151 | echo mingw make mingw_iss failed |
|---|
| 152 | exit 1 |
|---|
| 153 | fi |
|---|
| 154 | if ! make distclean ; then |
|---|
| 155 | echo make distclean failed |
|---|
| 156 | exit 1 |
|---|
| 157 | fi |
|---|
| 158 | PATH="$SAVE_PATH" |
|---|
| 159 | CC= |
|---|
| 160 | CXX= |
|---|
| 161 | fi |
|---|