[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 |
---|
[b462168] | 32 | export CC |
---|
| 33 | export CXX |
---|
[fc4b814] | 34 | CC=gcc |
---|
| 35 | CXX=g++ |
---|
| 36 | if ! ./configure ; then |
---|
[eea518c] | 37 | echo configure failed |
---|
| 38 | exit 1 |
---|
| 39 | fi |
---|
[27b8b59] | 40 | if test yes = "$rel" ; then |
---|
| 41 | export CFLAGS |
---|
| 42 | export CXXFLAGS |
---|
| 43 | # tell the preproceesor to be C89 - this makes it reject // comments |
---|
| 44 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
| 45 | # FIXME CXXFLAGS="-Werror" |
---|
| 46 | CFLAGS="-Wp,-std=c89" |
---|
| 47 | CXXFLAGS= |
---|
[9fe15ea] | 48 | if ! make distcheck ; then # distcheck fails extend.tst for some reason! |
---|
[f78ad72] | 49 | echo make distcheck failed |
---|
| 50 | exit 1 |
---|
| 51 | fi |
---|
[27b8b59] | 52 | CFLAGS= |
---|
| 53 | CXXFLAGS= |
---|
[f78ad72] | 54 | else |
---|
| 55 | if ! make dist ; then |
---|
| 56 | echo make dist failed |
---|
| 57 | exit 1 |
---|
| 58 | fi |
---|
[e719df1] | 59 | fi |
---|
[ae1309f] | 60 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
---|
[1973548] | 61 | if rpmbuild --version > /dev/null 2> /dev/null ; then |
---|
[7eb8d4a] | 62 | if ! make rpm ; then |
---|
| 63 | echo make rpm failed |
---|
| 64 | exit 1 |
---|
| 65 | fi |
---|
| 66 | else |
---|
[1973548] | 67 | echo rpmbuild not installed - skipping rpm generation |
---|
[e66be9a] | 68 | fi |
---|
[f30265a0] | 69 | fi |
---|
[ae1309f] | 70 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
---|
[e68fccf] | 71 | if ! make dos_doc_exe ; then |
---|
| 72 | echo make dos_doc_exe failed |
---|
[e66be9a] | 73 | exit 1 |
---|
| 74 | fi |
---|
[4208811] | 75 | fi |
---|
[9324b2d] | 76 | if ! make distclean ; then |
---|
| 77 | echo make distclean failed |
---|
| 78 | exit 1 |
---|
| 79 | fi |
---|
[b462168] | 80 | unset CC |
---|
| 81 | unset CXX |
---|
[ae1309f] | 82 | if expr "$mk" : '.*\<mingw\>'; then |
---|
[6d316f1] | 83 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
[f30265a0] | 84 | SAVE_PATH="$PATH" |
---|
[9fe15ea] | 85 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
| 86 | # debian mingw32 package |
---|
| 87 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
| 88 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
| 89 | export CC |
---|
| 90 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
| 91 | export CXX |
---|
[b0a751b4] | 92 | else |
---|
[9fe15ea] | 93 | # variant of debian mingw32 package? |
---|
| 94 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
| 95 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
| 96 | export CC |
---|
| 97 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
| 98 | export CXX |
---|
[f30265a0] | 99 | fi |
---|
[9fe15ea] | 100 | wxc=/usr/lib/wx/config/i586-mingw32msvc-msw-ansi-release-static-2.8 |
---|
[1809849] | 101 | LDFLAGS= |
---|
| 102 | CPPFLAGS= |
---|
[9fe15ea] | 103 | # CFLAGS=-Werror CXXFLAGS=-Werror |
---|
| 104 | if ! ./configure --host=mingw32 --build="$build_platform" WX_CONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" ; then |
---|
[f30265a0] | 105 | echo mingw configure failed |
---|
| 106 | exit 1 |
---|
| 107 | fi |
---|
| 108 | if ! make ; then |
---|
| 109 | echo mingw make failed |
---|
| 110 | exit 1 |
---|
[b0a751b4] | 111 | fi |
---|
[8f6f99b] | 112 | if ! make mingw_iss ; then |
---|
| 113 | echo mingw make mingw_iss failed |
---|
[e66be9a] | 114 | exit 1 |
---|
| 115 | fi |
---|
[f30265a0] | 116 | if ! make distclean ; then |
---|
| 117 | echo make distclean failed |
---|
| 118 | exit 1 |
---|
| 119 | fi |
---|
| 120 | PATH="$SAVE_PATH" |
---|
| 121 | CC= |
---|
| 122 | CXX= |
---|
[e66be9a] | 123 | fi |
---|