[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 |
---|
[fc4b814] | 26 | if ! test -x $CVS2CL ; then |
---|
| 27 | echo cvs2cl.pl not found |
---|
| 28 | exit 1 |
---|
| 29 | fi |
---|
[a20b208] | 30 | TAG="`sed 's/^CHANGELOG_FROM_TAG=//p;d' configure.in`" |
---|
[fc4b814] | 31 | # stderr | grep -v '^cvs server: warning: no revision .*/Attic/' |
---|
| 32 | if ! cvs log -r$TAG:: 2> /dev/null|./fixchangelog.pl $TAG|$CVS2CL --stdin 2> /dev/null ; then |
---|
[e66be9a] | 33 | echo Failed to update ChangeLog from CVS |
---|
| 34 | exit 1 |
---|
| 35 | fi |
---|
[fd51dc3] | 36 | fi |
---|
| 37 | if test -f Makefile ; then |
---|
| 38 | if ! make distclean ; then |
---|
| 39 | echo make distclean failed |
---|
| 40 | exit 1 |
---|
| 41 | fi |
---|
| 42 | fi |
---|
[27b8b59] | 43 | if test yes = "$rel" ; then |
---|
[38226ad] | 44 | rm -f config.guess.new config.sub.new |
---|
[b462168] | 45 | # only check for new versions if the current ones are over a day old |
---|
| 46 | perl -e '-M "config.guess" && -M "config.sub" && exit 1' ||\ |
---|
[70bfbfd] | 47 | wget ftp://ftp.gnu.org/gnu/config/config.guess -O config.guess.new &&\ |
---|
[38226ad] | 48 | wget ftp://ftp.gnu.org/gnu/config/config.sub -O config.sub.new &&\ |
---|
[9b3648d] | 49 | chmod 755 config.guess.new config.sub.new &&\ |
---|
[38226ad] | 50 | mv config.guess.new config.guess && mv config.sub.new config.sub |
---|
[bd7120b] | 51 | fi |
---|
[74dc997] | 52 | autoreconf --force -i |
---|
[b462168] | 53 | export CC |
---|
| 54 | export CXX |
---|
[fc4b814] | 55 | CC=gcc |
---|
| 56 | CXX=g++ |
---|
| 57 | if ! ./configure ; then |
---|
[eea518c] | 58 | echo configure failed |
---|
| 59 | exit 1 |
---|
| 60 | fi |
---|
[27b8b59] | 61 | if test yes = "$rel" ; then |
---|
| 62 | export CFLAGS |
---|
| 63 | export CXXFLAGS |
---|
| 64 | # tell the preproceesor to be C89 - this makes it reject // comments |
---|
| 65 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
| 66 | # FIXME CXXFLAGS="-Werror" |
---|
| 67 | CFLAGS="-Wp,-std=c89" |
---|
| 68 | CXXFLAGS= |
---|
[b462168] | 69 | if ! make dist ; then # distcheck fails extend.tst for some reason! |
---|
[f78ad72] | 70 | echo make distcheck failed |
---|
| 71 | exit 1 |
---|
| 72 | fi |
---|
[27b8b59] | 73 | CFLAGS= |
---|
| 74 | CXXFLAGS= |
---|
[f78ad72] | 75 | else |
---|
| 76 | if ! make dist ; then |
---|
| 77 | echo make dist failed |
---|
| 78 | exit 1 |
---|
| 79 | fi |
---|
[e719df1] | 80 | fi |
---|
[ae1309f] | 81 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
---|
[7eb8d4a] | 82 | if rpm --version > /dev/null 2> /dev/null ; then |
---|
| 83 | if ! make rpm ; then |
---|
| 84 | echo make rpm failed |
---|
| 85 | exit 1 |
---|
| 86 | fi |
---|
| 87 | else |
---|
| 88 | echo rpm not installed - skipping rpm generation |
---|
[e66be9a] | 89 | fi |
---|
[f30265a0] | 90 | fi |
---|
[ae1309f] | 91 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then |
---|
[9cfb427] | 92 | if ! make debian ; then |
---|
[7eb8d4a] | 93 | echo make debian failed |
---|
[9cfb427] | 94 | exit 1 |
---|
| 95 | fi |
---|
[f30265a0] | 96 | fi |
---|
[ae1309f] | 97 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
---|
[e68fccf] | 98 | if ! make dos_doc_exe ; then |
---|
| 99 | echo make dos_doc_exe failed |
---|
[e66be9a] | 100 | exit 1 |
---|
| 101 | fi |
---|
[4208811] | 102 | fi |
---|
[9324b2d] | 103 | if ! make distclean ; then |
---|
| 104 | echo make distclean failed |
---|
| 105 | exit 1 |
---|
| 106 | fi |
---|
[b462168] | 107 | unset CC |
---|
| 108 | unset CXX |
---|
[ae1309f] | 109 | if expr "$mk" : '.*\<mingw\>'; then |
---|
[6d316f1] | 110 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
[f30265a0] | 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 |
---|
[b0a751b4] | 115 | else |
---|
[f30265a0] | 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 |
---|
[fc4b814] | 132 | wxc=wxmsw-2.5-config |
---|
[c0f2af5] | 133 | for a in /usr/i586-mingw32msvc/bin/wxmsw-2.5-config ; do |
---|
[74dc997] | 134 | test -x "$a" && wxc="$a" |
---|
| 135 | done |
---|
[1809849] | 136 | LDFLAGS= |
---|
| 137 | CPPFLAGS= |
---|
| 138 | if test -d /opt/rx-win32 ; then |
---|
| 139 | LDFLAGS=-L/opt/rx-win32/lib |
---|
| 140 | CPPFLAGS=-I/opt/rx-win32/include |
---|
| 141 | fi |
---|
[fc4b814] | 142 | if ! ./configure --host=mingw32 --build="$build_platform" WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" CFLAGS=-Werror CXXFLAGS=-Werror ; then |
---|
[f30265a0] | 143 | echo mingw configure failed |
---|
| 144 | exit 1 |
---|
| 145 | fi |
---|
| 146 | if ! make ; then |
---|
| 147 | echo mingw make failed |
---|
| 148 | exit 1 |
---|
[b0a751b4] | 149 | fi |
---|
[8f6f99b] | 150 | if ! make mingw_iss ; then |
---|
| 151 | echo mingw make mingw_iss failed |
---|
[e66be9a] | 152 | exit 1 |
---|
| 153 | fi |
---|
[f30265a0] | 154 | if ! make distclean ; then |
---|
| 155 | echo make distclean failed |
---|
| 156 | exit 1 |
---|
| 157 | fi |
---|
| 158 | PATH="$SAVE_PATH" |
---|
| 159 | CC= |
---|
| 160 | CXX= |
---|
[e66be9a] | 161 | fi |
---|