[d7acd89] | 1 | #! /bin/sh |
---|
[ae1309f] | 2 | |
---|
[f542bda] | 3 | VERSION="@VERSION@" |
---|
| 4 | |
---|
[27b8b59] | 5 | # flags to consider: |
---|
| 6 | # CFLAGS="-O2 -fomit-frame-pointer" |
---|
| 7 | # CXXFLAGS="-O2 -fno-rtti -fomit-frame-pointer" |
---|
[ae1309f] | 8 | rel=yes |
---|
[e66be9a] | 9 | if test x"$1" = x-t ; then |
---|
[ae1309f] | 10 | rel= |
---|
[f30265a0] | 11 | shift |
---|
[d7acd89] | 12 | fi |
---|
[9fe15ea] | 13 | mk=${@-src rpm doc mingw} |
---|
[ae1309f] | 14 | if test x"$rel" = xyes ; then |
---|
[f542bda] | 15 | # Check everything is checked into SVN. |
---|
| 16 | if svn st | grep -v '^?' | grep . > /dev/null 2> /dev/null ; then |
---|
| 17 | echo There are changes not checked into SVN - please rectify |
---|
[e66be9a] | 18 | exit 1 |
---|
| 19 | fi |
---|
[fd51dc3] | 20 | fi |
---|
| 21 | if test -f Makefile ; then |
---|
| 22 | if ! make distclean ; then |
---|
| 23 | echo make distclean failed |
---|
| 24 | exit 1 |
---|
| 25 | fi |
---|
| 26 | fi |
---|
[27b8b59] | 27 | if test yes = "$rel" ; then |
---|
[c5eded8] | 28 | cp -u /usr/share/misc/config.guess . |
---|
| 29 | cp -u /usr/share/misc/config.sub . |
---|
[bd7120b] | 30 | fi |
---|
[74dc997] | 31 | autoreconf --force -i |
---|
[5a0eabd] | 32 | if ! ./configure CC=gcc CXX=g++ ; then |
---|
[eea518c] | 33 | echo configure failed |
---|
| 34 | exit 1 |
---|
| 35 | fi |
---|
[27b8b59] | 36 | if test yes = "$rel" ; then |
---|
| 37 | export CFLAGS |
---|
| 38 | export CXXFLAGS |
---|
| 39 | # tell the preproceesor to be C89 - this makes it reject // comments |
---|
| 40 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
| 41 | # FIXME CXXFLAGS="-Werror" |
---|
| 42 | CFLAGS="-Wp,-std=c89" |
---|
| 43 | CXXFLAGS= |
---|
[5a0eabd] | 44 | if ! make distcheck ; then |
---|
[f78ad72] | 45 | echo make distcheck failed |
---|
| 46 | exit 1 |
---|
| 47 | fi |
---|
[27b8b59] | 48 | CFLAGS= |
---|
| 49 | CXXFLAGS= |
---|
[f78ad72] | 50 | else |
---|
| 51 | if ! make dist ; then |
---|
| 52 | echo make dist failed |
---|
| 53 | exit 1 |
---|
| 54 | fi |
---|
[e719df1] | 55 | fi |
---|
[5a0eabd] | 56 | if test x"$rel" = xyes ; then |
---|
| 57 | case $mk in |
---|
| 58 | *rpm*) |
---|
| 59 | if rpmbuild --version > /dev/null 2> /dev/null ; then |
---|
[7eb8d4a] | 60 | if ! make rpm ; then |
---|
[5a0eabd] | 61 | echo make rpm failed |
---|
| 62 | exit 1 |
---|
| 63 | fi |
---|
| 64 | else |
---|
| 65 | echo rpmbuild not installed - skipping rpm generation |
---|
| 66 | fi |
---|
| 67 | ;; |
---|
| 68 | esac |
---|
| 69 | case $mk in |
---|
| 70 | *doc*) |
---|
| 71 | if ! make dos_doc_exe ; then |
---|
[e68fccf] | 72 | echo make dos_doc_exe failed |
---|
[e66be9a] | 73 | exit 1 |
---|
[5a0eabd] | 74 | fi |
---|
| 75 | ;; |
---|
| 76 | esac |
---|
[4208811] | 77 | fi |
---|
[9324b2d] | 78 | if ! make distclean ; then |
---|
| 79 | echo make distclean failed |
---|
| 80 | exit 1 |
---|
| 81 | fi |
---|
[5a0eabd] | 82 | case $mk in |
---|
| 83 | *mingw*) |
---|
| 84 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
| 85 | SAVE_PATH="$PATH" |
---|
| 86 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
[9fe15ea] | 87 | # debian mingw32 package |
---|
| 88 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
| 89 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
| 90 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
[5a0eabd] | 91 | else |
---|
[9fe15ea] | 92 | # variant of debian mingw32 package? |
---|
| 93 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
| 94 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
| 95 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
[5a0eabd] | 96 | fi |
---|
| 97 | wxc=/usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 |
---|
| 98 | # -Werror here causes AC_CHECK_FUNCS to fail. |
---|
| 99 | CFLAGS= |
---|
| 100 | CXXFLAGS='-fno-strict-aliasing -Werror' |
---|
| 101 | if ! ./configure --host=mingw32 --build="$build_platform" CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" WX_CONFIG="$wxc" LDFLAGS=-s ; then |
---|
[f30265a0] | 102 | echo mingw configure failed |
---|
| 103 | exit 1 |
---|
[5a0eabd] | 104 | fi |
---|
| 105 | if ! make CFLAGS=-Werror ; then |
---|
[f30265a0] | 106 | echo mingw make failed |
---|
| 107 | exit 1 |
---|
[5a0eabd] | 108 | fi |
---|
| 109 | if ! make mingw_iss ; then |
---|
[8f6f99b] | 110 | echo mingw make mingw_iss failed |
---|
[e66be9a] | 111 | exit 1 |
---|
[5a0eabd] | 112 | fi |
---|
| 113 | if ! make distclean ; then |
---|
[f30265a0] | 114 | echo make distclean failed |
---|
| 115 | exit 1 |
---|
[5a0eabd] | 116 | fi |
---|
| 117 | PATH="$SAVE_PATH" |
---|
| 118 | ;; |
---|
| 119 | esac |
---|