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