[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 |
---|
[6134f54] | 11 | mk=${@-src rpm deb doc mingw} |
---|
[ae1309f] | 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 |
---|
[b462168] | 40 | # only check for new versions if the current ones are over a day old |
---|
| 41 | perl -e '-M "config.guess" && -M "config.sub" && exit 1' ||\ |
---|
[70bfbfd] | 42 | wget ftp://ftp.gnu.org/gnu/config/config.guess -O config.guess.new &&\ |
---|
[38226ad] | 43 | wget ftp://ftp.gnu.org/gnu/config/config.sub -O config.sub.new &&\ |
---|
[9b3648d] | 44 | chmod 755 config.guess.new config.sub.new &&\ |
---|
[38226ad] | 45 | mv config.guess.new config.guess && mv config.sub.new config.sub |
---|
[bd7120b] | 46 | fi |
---|
[dc459c9] | 47 | aclocal |
---|
| 48 | autoheader |
---|
| 49 | automake -a |
---|
| 50 | autoconf |
---|
[b462168] | 51 | export CC |
---|
| 52 | export CXX |
---|
| 53 | CC=gcc-3.2 |
---|
| 54 | CXX=g++-3.2 |
---|
[27b8b59] | 55 | if ! ./configure ; then |
---|
[eea518c] | 56 | echo configure failed |
---|
| 57 | exit 1 |
---|
| 58 | fi |
---|
[27b8b59] | 59 | if test yes = "$rel" ; then |
---|
| 60 | export CFLAGS |
---|
| 61 | export CXXFLAGS |
---|
| 62 | # tell the preproceesor to be C89 - this makes it reject // comments |
---|
| 63 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
| 64 | # FIXME CXXFLAGS="-Werror" |
---|
| 65 | CFLAGS="-Wp,-std=c89" |
---|
| 66 | CXXFLAGS= |
---|
[b462168] | 67 | if ! make dist ; then # distcheck fails extend.tst for some reason! |
---|
[f78ad72] | 68 | echo make distcheck failed |
---|
| 69 | exit 1 |
---|
| 70 | fi |
---|
[27b8b59] | 71 | CFLAGS= |
---|
| 72 | CXXFLAGS= |
---|
[f78ad72] | 73 | else |
---|
| 74 | if ! make dist ; then |
---|
| 75 | echo make dist failed |
---|
| 76 | exit 1 |
---|
| 77 | fi |
---|
[e719df1] | 78 | fi |
---|
[ae1309f] | 79 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
---|
[7eb8d4a] | 80 | if rpm --version > /dev/null 2> /dev/null ; then |
---|
| 81 | if ! make rpm ; then |
---|
| 82 | echo make rpm failed |
---|
| 83 | exit 1 |
---|
| 84 | fi |
---|
| 85 | else |
---|
| 86 | echo rpm not installed - skipping rpm generation |
---|
[e66be9a] | 87 | fi |
---|
[f30265a0] | 88 | fi |
---|
[ae1309f] | 89 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then |
---|
[9cfb427] | 90 | if ! make debian ; then |
---|
[7eb8d4a] | 91 | echo make debian failed |
---|
[9cfb427] | 92 | exit 1 |
---|
| 93 | fi |
---|
[f30265a0] | 94 | fi |
---|
[ae1309f] | 95 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
---|
[e68fccf] | 96 | if ! make dos_doc_exe ; then |
---|
| 97 | echo make dos_doc_exe failed |
---|
[e66be9a] | 98 | exit 1 |
---|
| 99 | fi |
---|
[4208811] | 100 | fi |
---|
[9324b2d] | 101 | if ! make distclean ; then |
---|
| 102 | echo make distclean failed |
---|
| 103 | exit 1 |
---|
| 104 | fi |
---|
[b462168] | 105 | unset CC |
---|
| 106 | unset CXX |
---|
[ae1309f] | 107 | if expr "$mk" : '.*\<mingw\>'; then |
---|
[6d316f1] | 108 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
[f30265a0] | 109 | SAVE_PATH="$PATH" |
---|
| 110 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
---|
| 111 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
---|
| 112 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
---|
[b0a751b4] | 113 | else |
---|
[f30265a0] | 114 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
| 115 | # debian mingw32 package |
---|
| 116 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
| 117 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
| 118 | export CC |
---|
| 119 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
| 120 | export CXX |
---|
| 121 | else |
---|
| 122 | # variant of debian mingw32 package? |
---|
| 123 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
| 124 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
| 125 | export CC |
---|
| 126 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
| 127 | export CXX |
---|
| 128 | fi |
---|
| 129 | fi |
---|
[b462168] | 130 | if ! ./configure --host=mingw32 --build="$build_platform" --with-x=no WXCONFIG=/opt/wxmsw-2.4.0/bin/wxmsw-2.4-i686-mingw32-config VLDFLAGS="-s -L/opt/rx-win32/lib" CPPFLAGS=-I/opt/rx-win32/include CAVEROT= CFLAGS=-Werror CXXFLAGS=-Werror ; then |
---|
[f30265a0] | 131 | echo mingw configure failed |
---|
| 132 | exit 1 |
---|
| 133 | fi |
---|
| 134 | if ! make ; then |
---|
| 135 | echo mingw make failed |
---|
| 136 | exit 1 |
---|
[b0a751b4] | 137 | fi |
---|
[8f6f99b] | 138 | if ! make mingw_iss ; then |
---|
| 139 | echo mingw make mingw_iss failed |
---|
[e66be9a] | 140 | exit 1 |
---|
| 141 | fi |
---|
[f30265a0] | 142 | if ! make distclean ; then |
---|
| 143 | echo make distclean failed |
---|
| 144 | exit 1 |
---|
| 145 | fi |
---|
| 146 | PATH="$SAVE_PATH" |
---|
| 147 | CC= |
---|
| 148 | CXX= |
---|
[e66be9a] | 149 | fi |
---|