[d7acd89] | 1 | #! /bin/sh |
---|
[ae1309f] | 2 | |
---|
[ea03343] | 3 | # Needed for wine to run on roadkill: |
---|
| 4 | LD_ASSUME_KERNEL=2.4.1 |
---|
| 5 | export LD_ASSUME_KERNEL |
---|
| 6 | |
---|
[bbca0fd] | 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 |
---|
[851c965] | 15 | mk=${@-src rpm deb doc alien djgpp 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 |
---|
[bd25e7c] | 30 | if ! test -x $CVS2CL ; then |
---|
| 31 | echo cvs2cl.pl not found |
---|
| 32 | exit 1 |
---|
| 33 | fi |
---|
[de10f8d] | 34 | TAG=`sed 's/^CHANGELOG_FROM_TAG=//p;d' configure.in` |
---|
[f96f36b] | 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 |
---|
[1a924269] | 47 | if test yes = "$rel" ; then |
---|
[38226ad] | 48 | rm -f config.guess.new config.sub.new |
---|
[3bd0b64] | 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 |
---|
[b92fa73] | 56 | autoreconf --force -i |
---|
[93689ea] | 57 | export CC |
---|
| 58 | export CXX |
---|
[0a3b1f7] | 59 | CC=gcc |
---|
| 60 | CXX=g++ |
---|
[93689ea] | 61 | if ! ./configure ; then |
---|
[eea518c] | 62 | echo configure failed |
---|
| 63 | exit 1 |
---|
| 64 | fi |
---|
[1a924269] | 65 | if test yes = "$rel" ; then |
---|
[72302eb] | 66 | if ! make dist ; then # distcheck fails extend.tst for some reason! |
---|
[f78ad72] | 67 | echo make distcheck failed |
---|
| 68 | exit 1 |
---|
| 69 | fi |
---|
| 70 | else |
---|
| 71 | if ! make dist ; then |
---|
| 72 | echo make dist failed |
---|
| 73 | exit 1 |
---|
| 74 | fi |
---|
[e719df1] | 75 | fi |
---|
[851c965] | 76 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
---|
| 77 | if rpm --version > /dev/null 2> /dev/null ; then |
---|
| 78 | if ! make rpm ; then |
---|
| 79 | echo make rpm failed |
---|
| 80 | exit 1 |
---|
| 81 | fi |
---|
| 82 | else |
---|
| 83 | echo rpm not installed - skipping rpm generation |
---|
| 84 | fi |
---|
| 85 | fi |
---|
[ae1309f] | 86 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then |
---|
[9cfb427] | 87 | if ! make debian ; then |
---|
[7eb8d4a] | 88 | echo make debian failed |
---|
[9cfb427] | 89 | exit 1 |
---|
| 90 | fi |
---|
[f30265a0] | 91 | fi |
---|
[ae1309f] | 92 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
---|
[e68fccf] | 93 | if ! make dos_doc_exe ; then |
---|
| 94 | echo make dos_doc_exe failed |
---|
[e66be9a] | 95 | exit 1 |
---|
| 96 | fi |
---|
[21a0009] | 97 | if ! make riscos_doc_zip ; then |
---|
| 98 | echo make riscos_doc_zip failed |
---|
| 99 | exit 1 |
---|
| 100 | fi |
---|
[fd51dc3] | 101 | fi |
---|
[ae1309f] | 102 | if expr "$mk" : '.*\<alien\>'; then |
---|
[f30265a0] | 103 | if ! make alien_src_zip ; then |
---|
| 104 | echo make alien_src_zip failed |
---|
| 105 | exit 1 |
---|
| 106 | fi |
---|
[4208811] | 107 | fi |
---|
[9324b2d] | 108 | if ! make distclean ; then |
---|
| 109 | echo make distclean failed |
---|
| 110 | exit 1 |
---|
| 111 | fi |
---|
[93689ea] | 112 | unset CC |
---|
| 113 | unset CXX |
---|
[ae1309f] | 114 | if expr "$mk" : '.*\<djgpp\>'; then |
---|
[6d316f1] | 115 | build_platform=`sh config.guess` |
---|
[f30265a0] | 116 | SAVE_PATH="$PATH" |
---|
| 117 | # for building on mrs30 |
---|
| 118 | if test -d /opt/crosstools/i386-pc-msdosdjgpp ; then |
---|
| 119 | PATH=/opt/crosstools/i386-pc-msdosdjgpp/bin:/opt/crosstools/bin:$PATH |
---|
| 120 | fi |
---|
[bc610ce] | 121 | if ! ./configure --host=i386-pc-msdosdjgpp --build="$build_platform" --with-x=no --disable-aven LDFLAGS=-s STRIP=echo CAVEROT=caverot.exe CRLIB=-lalleg CROBJX=dosrot.o ; then |
---|
[f30265a0] | 122 | echo djgpp configure failed |
---|
| 123 | exit 1 |
---|
| 124 | fi |
---|
| 125 | if ! make ; then |
---|
| 126 | echo djgpp make failed |
---|
| 127 | exit 1 |
---|
| 128 | fi |
---|
[e68fccf] | 129 | if ! make djgpp_exe ; then |
---|
| 130 | echo djgpp make djgpp_exe failed |
---|
[e66be9a] | 131 | exit 1 |
---|
| 132 | fi |
---|
[f30265a0] | 133 | if ! make distclean ; then |
---|
| 134 | echo make distclean failed |
---|
| 135 | exit 1 |
---|
| 136 | fi |
---|
| 137 | PATH="$SAVE_PATH" |
---|
[fd51dc3] | 138 | fi |
---|
[ae1309f] | 139 | if expr "$mk" : '.*\<mingw\>'; then |
---|
[6d316f1] | 140 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
[f30265a0] | 141 | SAVE_PATH="$PATH" |
---|
| 142 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
---|
| 143 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
---|
| 144 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
---|
[b0a751b4] | 145 | else |
---|
[f30265a0] | 146 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
| 147 | # debian mingw32 package |
---|
| 148 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
| 149 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
| 150 | export CC |
---|
| 151 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
| 152 | export CXX |
---|
| 153 | else |
---|
| 154 | # variant of debian mingw32 package? |
---|
| 155 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
| 156 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
| 157 | export CC |
---|
| 158 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
| 159 | export CXX |
---|
| 160 | fi |
---|
| 161 | fi |
---|
[5ab82d4] | 162 | wxc=wxmsw-2.5-config |
---|
[7d29be9] | 163 | for a in /usr/i586-mingw32msvc/bin/wx-config ; do |
---|
[010878c] | 164 | test -x "$a" && wxc="$a" |
---|
[e15c435] | 165 | done |
---|
| 166 | LDFLAGS= |
---|
[010878c] | 167 | CPPFLAGS= |
---|
[e15c435] | 168 | if test -d /opt/rx-win32 ; then |
---|
[5803cfe] | 169 | LDFLAGS=-L/opt/rx-win32/lib |
---|
[e15c435] | 170 | CPPFLAGS=-I/opt/rx-win32/include |
---|
| 171 | fi |
---|
[bc610ce] | 172 | if ! ./configure --host=mingw32 --build="$build_platform" --with-x=no CAVEROT= WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" ; then |
---|
[f30265a0] | 173 | echo mingw configure failed |
---|
| 174 | exit 1 |
---|
| 175 | fi |
---|
| 176 | if ! make ; then |
---|
| 177 | echo mingw make failed |
---|
| 178 | exit 1 |
---|
[b0a751b4] | 179 | fi |
---|
[8f6f99b] | 180 | if ! make mingw_iss ; then |
---|
| 181 | echo mingw make mingw_iss failed |
---|
[e66be9a] | 182 | exit 1 |
---|
| 183 | fi |
---|
[f30265a0] | 184 | if ! make distclean ; then |
---|
| 185 | echo make distclean failed |
---|
| 186 | exit 1 |
---|
| 187 | fi |
---|
| 188 | PATH="$SAVE_PATH" |
---|
| 189 | CC= |
---|
| 190 | CXX= |
---|
[e66be9a] | 191 | fi |
---|