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