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