| 1 | #! /bin/sh |
|---|
| 2 | |
|---|
| 3 | VERSION="@VERSION@" |
|---|
| 4 | |
|---|
| 5 | # flags to consider: |
|---|
| 6 | # CFLAGS="-O2 -fomit-frame-pointer" |
|---|
| 7 | # CXXFLAGS="-O2 -fno-rtti -fomit-frame-pointer" |
|---|
| 8 | rel=yes |
|---|
| 9 | if test x"$1" = x-t ; then |
|---|
| 10 | rel= |
|---|
| 11 | shift |
|---|
| 12 | fi |
|---|
| 13 | mk=${@-src rpm doc mingw} |
|---|
| 14 | if test x"$rel" = xyes ; then |
|---|
| 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 |
|---|
| 18 | exit 1 |
|---|
| 19 | fi |
|---|
| 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 |
|---|
| 27 | if test yes = "$rel" ; then |
|---|
| 28 | cp -u /usr/share/misc/config.guess . |
|---|
| 29 | cp -u /usr/share/misc/config.sub . |
|---|
| 30 | fi |
|---|
| 31 | autoreconf --force -i |
|---|
| 32 | export CC |
|---|
| 33 | export CXX |
|---|
| 34 | CC=gcc |
|---|
| 35 | CXX=g++ |
|---|
| 36 | if ! ./configure ; then |
|---|
| 37 | echo configure failed |
|---|
| 38 | exit 1 |
|---|
| 39 | fi |
|---|
| 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= |
|---|
| 48 | if ! make distcheck ; then # distcheck fails extend.tst for some reason! |
|---|
| 49 | echo make distcheck failed |
|---|
| 50 | exit 1 |
|---|
| 51 | fi |
|---|
| 52 | CFLAGS= |
|---|
| 53 | CXXFLAGS= |
|---|
| 54 | else |
|---|
| 55 | if ! make dist ; then |
|---|
| 56 | echo make dist failed |
|---|
| 57 | exit 1 |
|---|
| 58 | fi |
|---|
| 59 | fi |
|---|
| 60 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
|---|
| 61 | if rpmbuild --version > /dev/null 2> /dev/null ; then |
|---|
| 62 | if ! make rpm ; then |
|---|
| 63 | echo make rpm failed |
|---|
| 64 | exit 1 |
|---|
| 65 | fi |
|---|
| 66 | else |
|---|
| 67 | echo rpmbuild not installed - skipping rpm generation |
|---|
| 68 | fi |
|---|
| 69 | fi |
|---|
| 70 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
|---|
| 71 | if ! make dos_doc_exe ; then |
|---|
| 72 | echo make dos_doc_exe failed |
|---|
| 73 | exit 1 |
|---|
| 74 | fi |
|---|
| 75 | fi |
|---|
| 76 | if ! make distclean ; then |
|---|
| 77 | echo make distclean failed |
|---|
| 78 | exit 1 |
|---|
| 79 | fi |
|---|
| 80 | unset CC |
|---|
| 81 | unset CXX |
|---|
| 82 | if expr "$mk" : '.*\<mingw\>'; then |
|---|
| 83 | test -n "$build_platform" || build_platform=`sh config.guess` |
|---|
| 84 | SAVE_PATH="$PATH" |
|---|
| 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 |
|---|
| 92 | else |
|---|
| 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 |
|---|
| 99 | fi |
|---|
| 100 | wxc=/usr/lib/wx/config/i586-mingw32msvc-msw-ansi-release-static-2.8 |
|---|
| 101 | LDFLAGS= |
|---|
| 102 | CPPFLAGS= |
|---|
| 103 | # CFLAGS=-Werror CXXFLAGS=-Werror |
|---|
| 104 | if ! ./configure --host=mingw32 --build="$build_platform" WX_CONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" ; then |
|---|
| 105 | echo mingw configure failed |
|---|
| 106 | exit 1 |
|---|
| 107 | fi |
|---|
| 108 | if ! make ; then |
|---|
| 109 | echo mingw make failed |
|---|
| 110 | exit 1 |
|---|
| 111 | fi |
|---|
| 112 | if ! make mingw_iss ; then |
|---|
| 113 | echo mingw make mingw_iss failed |
|---|
| 114 | exit 1 |
|---|
| 115 | fi |
|---|
| 116 | if ! make distclean ; then |
|---|
| 117 | echo make distclean failed |
|---|
| 118 | exit 1 |
|---|
| 119 | fi |
|---|
| 120 | PATH="$SAVE_PATH" |
|---|
| 121 | CC= |
|---|
| 122 | CXX= |
|---|
| 123 | fi |
|---|