| 1 | #! /bin/sh
|
|---|
| 2 |
|
|---|
| 3 | set -e
|
|---|
| 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 |
|
|---|
| 15 | if test x"$rel" = xyes ; then
|
|---|
| 16 | # Check everything is checked into SVN.
|
|---|
| 17 | if svn st | grep -v '^?' | grep . > /dev/null 2> /dev/null ; then
|
|---|
| 18 | echo There are changes not checked into SVN - please rectify
|
|---|
| 19 | exit 1
|
|---|
| 20 | fi
|
|---|
| 21 | fi
|
|---|
| 22 | if test -f Makefile ; then
|
|---|
| 23 | if ! make distclean ; then
|
|---|
| 24 | echo make distclean failed
|
|---|
| 25 | exit 1
|
|---|
| 26 | fi
|
|---|
| 27 | fi
|
|---|
| 28 |
|
|---|
| 29 | if test yes = "$rel" ; then
|
|---|
| 30 | cp -u /usr/share/misc/config.guess .
|
|---|
| 31 | cp -u /usr/share/misc/config.sub .
|
|---|
| 32 | fi
|
|---|
| 33 |
|
|---|
| 34 | autoreconf --force -i
|
|---|
| 35 | ./configure CC=gcc CXX=g++
|
|---|
| 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=
|
|---|
| 44 | make distcheck
|
|---|
| 45 | CFLAGS=
|
|---|
| 46 | CXXFLAGS=
|
|---|
| 47 | else
|
|---|
| 48 | make dist
|
|---|
| 49 | fi
|
|---|
| 50 |
|
|---|
| 51 | case $mk in
|
|---|
| 52 | *rpm*)
|
|---|
| 53 | if rpmbuild --version > /dev/null 2> /dev/null ; then
|
|---|
| 54 | make rpm
|
|---|
| 55 | else
|
|---|
| 56 | echo rpmbuild not installed - skipping rpm generation
|
|---|
| 57 | fi
|
|---|
| 58 | ;;
|
|---|
| 59 | esac
|
|---|
| 60 |
|
|---|
| 61 | case $mk in
|
|---|
| 62 | *doc*)
|
|---|
| 63 | make dos_doc_exe ;;
|
|---|
| 64 | esac
|
|---|
| 65 |
|
|---|
| 66 | make distclean
|
|---|
| 67 |
|
|---|
| 68 | case $mk in
|
|---|
| 69 | *mingw*)
|
|---|
| 70 | test -n "$build_platform" || build_platform=`sh config.guess`
|
|---|
| 71 | SAVE_PATH=$PATH
|
|---|
| 72 | if test -d /usr/i586-mingw32msvc/bin ; then
|
|---|
| 73 | # debian mingw32 package
|
|---|
| 74 | PATH=/usr/i586-mingw32msvc/bin:$PATH
|
|---|
| 75 | CC=/usr/bin/i586-mingw32msvc-gcc
|
|---|
| 76 | CXX=/usr/bin/i586-mingw32msvc-g++
|
|---|
| 77 | else
|
|---|
| 78 | # variant of debian mingw32 package?
|
|---|
| 79 | PATH=/usr/i386-mingw32msvc/bin:$PATH
|
|---|
| 80 | CC=/usr/bin/i386-mingw32msvc-gcc
|
|---|
| 81 | CXX=/usr/bin/i386-mingw32msvc-g++
|
|---|
| 82 | fi
|
|---|
| 83 | wxc=/usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8
|
|---|
| 84 | # -Werror here causes AC_CHECK_FUNCS to fail.
|
|---|
| 85 | CFLAGS=
|
|---|
| 86 | CXXFLAGS='-fno-strict-aliasing -Werror'
|
|---|
| 87 | ./configure --host=mingw32 --build="$build_platform" CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" WX_CONFIG="$wxc" LDFLAGS=-s
|
|---|
| 88 | make CFLAGS=-Werror
|
|---|
| 89 | make mingw_iss
|
|---|
| 90 | make distclean
|
|---|
| 91 | PATH=$SAVE_PATH
|
|---|
| 92 | ;;
|
|---|
| 93 | esac
|
|---|