1 | #! /bin/sh |
---|
2 | |
---|
3 | # flags to consider: |
---|
4 | # CFLAGS="-O2 -fomit-frame-pointer" |
---|
5 | # CXXFLAGS="-O2 -fno-rtti -fomit-frame-pointer" |
---|
6 | rel=yes |
---|
7 | if test x"$1" = x-t ; then |
---|
8 | rel= |
---|
9 | shift |
---|
10 | fi |
---|
11 | mk=${@-src rpm doc mingw} |
---|
12 | if test x"$rel" = xyes ; then |
---|
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 |
---|
16 | exit 1 |
---|
17 | fi |
---|
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 |
---|
25 | if test yes = "$rel" ; then |
---|
26 | cp -u /usr/share/misc/config.guess . |
---|
27 | cp -u /usr/share/misc/config.sub . |
---|
28 | fi |
---|
29 | autoreconf --force -i |
---|
30 | if ! ./configure CC=gcc CXX=g++ ; then |
---|
31 | echo configure failed |
---|
32 | exit 1 |
---|
33 | fi |
---|
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= |
---|
42 | if ! make distcheck ; then |
---|
43 | echo make distcheck failed |
---|
44 | exit 1 |
---|
45 | fi |
---|
46 | CFLAGS= |
---|
47 | CXXFLAGS= |
---|
48 | else |
---|
49 | if ! make dist ; then |
---|
50 | echo make dist failed |
---|
51 | exit 1 |
---|
52 | fi |
---|
53 | fi |
---|
54 | if test x"$rel" = xyes ; then |
---|
55 | case $mk in |
---|
56 | *rpm*) |
---|
57 | if rpmbuild --version > /dev/null 2> /dev/null ; then |
---|
58 | if ! make rpm ; then |
---|
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 |
---|
70 | echo make dos_doc_exe failed |
---|
71 | exit 1 |
---|
72 | fi |
---|
73 | ;; |
---|
74 | esac |
---|
75 | fi |
---|
76 | if ! make distclean ; then |
---|
77 | echo make distclean failed |
---|
78 | exit 1 |
---|
79 | fi |
---|
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 |
---|
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++ |
---|
89 | else |
---|
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++ |
---|
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 |
---|
100 | echo mingw configure failed |
---|
101 | exit 1 |
---|
102 | fi |
---|
103 | if ! make CFLAGS=-Werror ; then |
---|
104 | echo mingw make failed |
---|
105 | exit 1 |
---|
106 | fi |
---|
107 | if ! make mingw_iss ; then |
---|
108 | echo mingw make mingw_iss failed |
---|
109 | exit 1 |
---|
110 | fi |
---|
111 | if ! make distclean ; then |
---|
112 | echo make distclean failed |
---|
113 | exit 1 |
---|
114 | fi |
---|
115 | PATH="$SAVE_PATH" |
---|
116 | ;; |
---|
117 | esac |
---|