[d7acd89] | 1 | #! /bin/sh |
---|
[ae1309f] | 2 | |
---|
[3cbb5ff] | 3 | # Needed for wine to run on roadkill: |
---|
[0e558e5] | 4 | LD_ASSUME_KERNEL=2.4.1 |
---|
| 5 | export LD_ASSUME_KERNEL |
---|
[9f43f9d] | 6 | |
---|
[27b8b59] | 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 |
---|
[6134f54] | 15 | mk=${@-src rpm deb doc 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 |
---|
[fd51dc3] | 25 | fi |
---|
| 26 | if test -f Makefile ; then |
---|
| 27 | if ! make distclean ; then |
---|
| 28 | echo make distclean failed |
---|
| 29 | exit 1 |
---|
| 30 | fi |
---|
| 31 | fi |
---|
[27b8b59] | 32 | if test yes = "$rel" ; then |
---|
[c5eded8] | 33 | cp -u /usr/share/misc/config.guess . |
---|
| 34 | cp -u /usr/share/misc/config.sub . |
---|
[bd7120b] | 35 | fi |
---|
[74dc997] | 36 | autoreconf --force -i |
---|
[b462168] | 37 | export CC |
---|
| 38 | export CXX |
---|
[fc4b814] | 39 | CC=gcc |
---|
| 40 | CXX=g++ |
---|
| 41 | if ! ./configure ; then |
---|
[eea518c] | 42 | echo configure failed |
---|
| 43 | exit 1 |
---|
| 44 | fi |
---|
[27b8b59] | 45 | if test yes = "$rel" ; then |
---|
| 46 | export CFLAGS |
---|
| 47 | export CXXFLAGS |
---|
| 48 | # tell the preproceesor to be C89 - this makes it reject // comments |
---|
| 49 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
| 50 | # FIXME CXXFLAGS="-Werror" |
---|
| 51 | CFLAGS="-Wp,-std=c89" |
---|
| 52 | CXXFLAGS= |
---|
[b462168] | 53 | if ! make dist ; then # distcheck fails extend.tst for some reason! |
---|
[f78ad72] | 54 | echo make distcheck failed |
---|
| 55 | exit 1 |
---|
| 56 | fi |
---|
[27b8b59] | 57 | CFLAGS= |
---|
| 58 | CXXFLAGS= |
---|
[f78ad72] | 59 | else |
---|
| 60 | if ! make dist ; then |
---|
| 61 | echo make dist failed |
---|
| 62 | exit 1 |
---|
| 63 | fi |
---|
[e719df1] | 64 | fi |
---|
[ae1309f] | 65 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
---|
[1973548] | 66 | if rpmbuild --version > /dev/null 2> /dev/null ; then |
---|
[7eb8d4a] | 67 | if ! make rpm ; then |
---|
| 68 | echo make rpm failed |
---|
| 69 | exit 1 |
---|
| 70 | fi |
---|
| 71 | else |
---|
[1973548] | 72 | echo rpmbuild not installed - skipping rpm generation |
---|
[e66be9a] | 73 | fi |
---|
[f30265a0] | 74 | fi |
---|
[ae1309f] | 75 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then |
---|
[9cfb427] | 76 | if ! make debian ; then |
---|
[7eb8d4a] | 77 | echo make debian failed |
---|
[9cfb427] | 78 | exit 1 |
---|
| 79 | fi |
---|
[f30265a0] | 80 | fi |
---|
[ae1309f] | 81 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
---|
[e68fccf] | 82 | if ! make dos_doc_exe ; then |
---|
| 83 | echo make dos_doc_exe failed |
---|
[e66be9a] | 84 | exit 1 |
---|
| 85 | fi |
---|
[4208811] | 86 | fi |
---|
[9324b2d] | 87 | if ! make distclean ; then |
---|
| 88 | echo make distclean failed |
---|
| 89 | exit 1 |
---|
| 90 | fi |
---|
[b462168] | 91 | unset CC |
---|
| 92 | unset CXX |
---|
[ae1309f] | 93 | if expr "$mk" : '.*\<mingw\>'; then |
---|
[6d316f1] | 94 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
[f30265a0] | 95 | SAVE_PATH="$PATH" |
---|
| 96 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
---|
| 97 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
---|
| 98 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
---|
[b0a751b4] | 99 | else |
---|
[f30265a0] | 100 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
| 101 | # debian mingw32 package |
---|
| 102 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
| 103 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
| 104 | export CC |
---|
| 105 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
| 106 | export CXX |
---|
| 107 | else |
---|
| 108 | # variant of debian mingw32 package? |
---|
| 109 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
| 110 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
| 111 | export CC |
---|
| 112 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
| 113 | export CXX |
---|
| 114 | fi |
---|
| 115 | fi |
---|
[fc4b814] | 116 | wxc=wxmsw-2.5-config |
---|
[9f43f9d] | 117 | for a in /usr/i586-mingw32msvc/bin/wx-config ; do |
---|
[74dc997] | 118 | test -x "$a" && wxc="$a" |
---|
| 119 | done |
---|
[1809849] | 120 | LDFLAGS= |
---|
| 121 | CPPFLAGS= |
---|
[c37f076] | 122 | #if ! ./configure --host=mingw32 --build="$build_platform" WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" CFLAGS=-Werror CXXFLAGS=-Werror ; then |
---|
[3346ddd] | 123 | if ! ./configure --host=mingw32 --build="$build_platform" WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" ; then |
---|
[f30265a0] | 124 | echo mingw configure failed |
---|
| 125 | exit 1 |
---|
| 126 | fi |
---|
| 127 | if ! make ; then |
---|
| 128 | echo mingw make failed |
---|
| 129 | exit 1 |
---|
[b0a751b4] | 130 | fi |
---|
[8f6f99b] | 131 | if ! make mingw_iss ; then |
---|
| 132 | echo mingw make mingw_iss failed |
---|
[e66be9a] | 133 | exit 1 |
---|
| 134 | fi |
---|
[f30265a0] | 135 | if ! make distclean ; then |
---|
| 136 | echo make distclean failed |
---|
| 137 | exit 1 |
---|
| 138 | fi |
---|
| 139 | PATH="$SAVE_PATH" |
---|
| 140 | CC= |
---|
| 141 | CXX= |
---|
[e66be9a] | 142 | fi |
---|