| [d7acd89] | 1 | #! /bin/sh
|
|---|
| [ae1309f] | 2 |
|
|---|
| [27b8b59] | 3 | # flags to consider:
|
|---|
| 4 | # CFLAGS="-O2 -fomit-frame-pointer"
|
|---|
| 5 | # CXXFLAGS="-O2 -fno-rtti -fomit-frame-pointer"
|
|---|
| [ae1309f] | 6 | rel=yes
|
|---|
| [e66be9a] | 7 | if test x"$1" = x-t ; then
|
|---|
| [ae1309f] | 8 | rel=
|
|---|
| [f30265a0] | 9 | shift
|
|---|
| [d7acd89] | 10 | fi
|
|---|
| [ae1309f] | 11 | mk=${@-src rpm deb doc alien djgpp mingw}
|
|---|
| 12 | if test x"$rel" = xyes ; then
|
|---|
| [f6a3719] | 13 | # Update debian changelog entry if necessary
|
|---|
| 14 | # If it does get updated, then the next check will fail...
|
|---|
| 15 | ./update-debcl.pl
|
|---|
| 16 | # Check everything is checked into CVS
|
|---|
| [e66be9a] | 17 | if ! cvs diff > /dev/null 2> /dev/null ; then
|
|---|
| 18 | echo There are changes not checked into CVS - please rectify
|
|---|
| 19 | exit 1
|
|---|
| 20 | fi
|
|---|
| 21 | # Update ChangeLog
|
|---|
| [bfa0e10] | 22 | CVS2CL=./cvs2cl.pl
|
|---|
| 23 | if ! test -x $CVS2CL ; then
|
|---|
| 24 | CVS2CL=../cvs2cl/cvs2cl.pl
|
|---|
| 25 | fi
|
|---|
| [a20b208] | 26 | TAG="`sed 's/^CHANGELOG_FROM_TAG=//p;d' configure.in`"
|
|---|
| [1cc0fa7] | 27 | if ! cvs log -r$TAG::|./fixchangelog.pl $TAG|$CVS2CL --stdin 2> /dev/null ; then
|
|---|
| [e66be9a] | 28 | echo Failed to update ChangeLog from CVS
|
|---|
| 29 | exit 1
|
|---|
| 30 | fi
|
|---|
| [fd51dc3] | 31 | fi
|
|---|
| 32 | if test -f Makefile ; then
|
|---|
| 33 | if ! make distclean ; then
|
|---|
| 34 | echo make distclean failed
|
|---|
| 35 | exit 1
|
|---|
| 36 | fi
|
|---|
| 37 | fi
|
|---|
| [27b8b59] | 38 | if test yes = "$rel" ; then
|
|---|
| [38226ad] | 39 | rm -f config.guess.new config.sub.new
|
|---|
| [70bfbfd] | 40 | perl -e '-M "config.guess" && -M "config.sub" && exit 1' &&\
|
|---|
| 41 | wget ftp://ftp.gnu.org/gnu/config/config.guess -O config.guess.new &&\
|
|---|
| [38226ad] | 42 | wget ftp://ftp.gnu.org/gnu/config/config.sub -O config.sub.new &&\
|
|---|
| [9b3648d] | 43 | chmod 755 config.guess.new config.sub.new &&\
|
|---|
| [38226ad] | 44 | mv config.guess.new config.guess && mv config.sub.new config.sub
|
|---|
| [bd7120b] | 45 | fi
|
|---|
| [dc459c9] | 46 | aclocal
|
|---|
| 47 | autoheader
|
|---|
| 48 | automake -a
|
|---|
| 49 | autoconf
|
|---|
| [27b8b59] | 50 | if ! ./configure ; then
|
|---|
| [eea518c] | 51 | echo configure failed
|
|---|
| 52 | exit 1
|
|---|
| 53 | fi
|
|---|
| [27b8b59] | 54 | if test yes = "$rel" ; then
|
|---|
| 55 | export CFLAGS
|
|---|
| 56 | export CXXFLAGS
|
|---|
| 57 | # tell the preproceesor to be C89 - this makes it reject // comments
|
|---|
| 58 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89"
|
|---|
| 59 | # FIXME CXXFLAGS="-Werror"
|
|---|
| 60 | CFLAGS="-Wp,-std=c89"
|
|---|
| 61 | CXXFLAGS=
|
|---|
| [f78ad72] | 62 | if ! make distcheck ; then
|
|---|
| 63 | echo make distcheck failed
|
|---|
| 64 | exit 1
|
|---|
| 65 | fi
|
|---|
| [27b8b59] | 66 | CFLAGS=
|
|---|
| 67 | CXXFLAGS=
|
|---|
| [f78ad72] | 68 | else
|
|---|
| 69 | if ! make dist ; then
|
|---|
| 70 | echo make dist failed
|
|---|
| 71 | exit 1
|
|---|
| 72 | fi
|
|---|
| [e719df1] | 73 | fi
|
|---|
| [ae1309f] | 74 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then
|
|---|
| [7eb8d4a] | 75 | if rpm --version > /dev/null 2> /dev/null ; then
|
|---|
| 76 | if ! make rpm ; then
|
|---|
| 77 | echo make rpm failed
|
|---|
| 78 | exit 1
|
|---|
| 79 | fi
|
|---|
| 80 | else
|
|---|
| 81 | echo rpm not installed - skipping rpm generation
|
|---|
| [e66be9a] | 82 | fi
|
|---|
| [f30265a0] | 83 | fi
|
|---|
| [ae1309f] | 84 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then
|
|---|
| [9cfb427] | 85 | if ! make debian ; then
|
|---|
| [7eb8d4a] | 86 | echo make debian failed
|
|---|
| [9cfb427] | 87 | exit 1
|
|---|
| 88 | fi
|
|---|
| [f30265a0] | 89 | fi
|
|---|
| [ae1309f] | 90 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then
|
|---|
| [e68fccf] | 91 | if ! make dos_doc_exe ; then
|
|---|
| 92 | echo make dos_doc_exe failed
|
|---|
| [e66be9a] | 93 | exit 1
|
|---|
| 94 | fi
|
|---|
| [21a0009] | 95 | if ! make riscos_doc_zip ; then
|
|---|
| 96 | echo make riscos_doc_zip failed
|
|---|
| 97 | exit 1
|
|---|
| 98 | fi
|
|---|
| [fd51dc3] | 99 | fi
|
|---|
| [ae1309f] | 100 | if expr "$mk" : '.*\<alien\>'; then
|
|---|
| [f30265a0] | 101 | if ! make alien_src_zip ; then
|
|---|
| 102 | echo make alien_src_zip failed
|
|---|
| 103 | exit 1
|
|---|
| 104 | fi
|
|---|
| [4208811] | 105 | fi
|
|---|
| [9324b2d] | 106 | if ! make distclean ; then
|
|---|
| 107 | echo make distclean failed
|
|---|
| 108 | exit 1
|
|---|
| 109 | fi
|
|---|
| [ae1309f] | 110 | if expr "$mk" : '.*\<djgpp\>'; then
|
|---|
| [6d316f1] | 111 | build_platform=`sh config.guess`
|
|---|
| [f30265a0] | 112 | SAVE_PATH="$PATH"
|
|---|
| 113 | # for building on mrs30
|
|---|
| 114 | if test -d /opt/crosstools/i386-pc-msdosdjgpp ; then
|
|---|
| 115 | PATH=/opt/crosstools/i386-pc-msdosdjgpp/bin:/opt/crosstools/bin:$PATH
|
|---|
| 116 | fi
|
|---|
| [6c0dc95] | 117 | 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 CFLAGS=-Werror CXXFLAGS=-Werror ; then
|
|---|
| [f30265a0] | 118 | echo djgpp configure failed
|
|---|
| 119 | exit 1
|
|---|
| 120 | fi
|
|---|
| 121 | if ! make ; then
|
|---|
| 122 | echo djgpp make failed
|
|---|
| 123 | exit 1
|
|---|
| 124 | fi
|
|---|
| [e68fccf] | 125 | if ! make djgpp_exe ; then
|
|---|
| 126 | echo djgpp make djgpp_exe failed
|
|---|
| [e66be9a] | 127 | exit 1
|
|---|
| 128 | fi
|
|---|
| [f30265a0] | 129 | if ! make distclean ; then
|
|---|
| 130 | echo make distclean failed
|
|---|
| 131 | exit 1
|
|---|
| 132 | fi
|
|---|
| 133 | PATH="$SAVE_PATH"
|
|---|
| [fd51dc3] | 134 | fi
|
|---|
| [ae1309f] | 135 | if expr "$mk" : '.*\<mingw\>'; then
|
|---|
| [6d316f1] | 136 | test -n "$build_platform" || build_platform=`sh config.guess`
|
|---|
| [f30265a0] | 137 | SAVE_PATH="$PATH"
|
|---|
| 138 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then
|
|---|
| 139 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/
|
|---|
| 140 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH
|
|---|
| [b0a751b4] | 141 | else
|
|---|
| [f30265a0] | 142 | if test -d /usr/i586-mingw32msvc/bin ; then
|
|---|
| 143 | # debian mingw32 package
|
|---|
| 144 | PATH=/usr/i586-mingw32msvc/bin:$PATH
|
|---|
| 145 | CC=/usr/bin/i586-mingw32msvc-gcc
|
|---|
| 146 | export CC
|
|---|
| 147 | CXX=/usr/bin/i586-mingw32msvc-g++
|
|---|
| 148 | export CXX
|
|---|
| 149 | else
|
|---|
| 150 | # variant of debian mingw32 package?
|
|---|
| 151 | PATH=/usr/i386-mingw32msvc/bin:$PATH
|
|---|
| 152 | CC=/usr/bin/i386-mingw32msvc-gcc
|
|---|
| 153 | export CC
|
|---|
| 154 | CXX=/usr/bin/i386-mingw32msvc-g++
|
|---|
| 155 | export CXX
|
|---|
| 156 | fi
|
|---|
| 157 | fi
|
|---|
| [6c0dc95] | 158 | if ! ./configure --host=mingw32 --build="$build_platform" --with-x=no WXCONFIG=`pwd`/mingw_extras/wxmsw-config LDFLAGS="-s -L/opt/rx-win32/lib" CPPFLAGS=-I/opt/rx-win32/include CAVEROT= CFLAGS=-Werror CXXFLAGS=-Werror ; then
|
|---|
| [f30265a0] | 159 | echo mingw configure failed
|
|---|
| 160 | exit 1
|
|---|
| 161 | fi
|
|---|
| 162 | if ! make ; then
|
|---|
| 163 | echo mingw make failed
|
|---|
| 164 | exit 1
|
|---|
| [b0a751b4] | 165 | fi
|
|---|
| [8f6f99b] | 166 | if ! make mingw_iss ; then
|
|---|
| 167 | echo mingw make mingw_iss failed
|
|---|
| [e66be9a] | 168 | exit 1
|
|---|
| 169 | fi
|
|---|
| [f30265a0] | 170 | if ! make distclean ; then
|
|---|
| 171 | echo make distclean failed
|
|---|
| 172 | exit 1
|
|---|
| 173 | fi
|
|---|
| 174 | PATH="$SAVE_PATH"
|
|---|
| 175 | CC=
|
|---|
| 176 | CXX=
|
|---|
| [e66be9a] | 177 | fi
|
|---|