1 | #! /bin/sh |
---|
2 | |
---|
3 | # Needed for wine to run on roadkill: |
---|
4 | LD_ASSUME_KERNEL=2.4.1 |
---|
5 | export LD_ASSUME_KERNEL |
---|
6 | |
---|
7 | # flags to consider: |
---|
8 | # CFLAGS="-O2 -fomit-frame-pointer" |
---|
9 | # CXXFLAGS="-O2 -fno-rtti -fomit-frame-pointer" |
---|
10 | rel=yes |
---|
11 | if test x"$1" = x-t ; then |
---|
12 | rel= |
---|
13 | shift |
---|
14 | fi |
---|
15 | mk=${@-src rpm deb doc alien djgpp mingw} |
---|
16 | if test x"$rel" = xyes ; then |
---|
17 | # Update debian changelog entry if necessary |
---|
18 | # If it does get updated, then the next check will fail... |
---|
19 | ./update-debcl.pl |
---|
20 | # Check everything is checked into CVS |
---|
21 | if ! cvs diff > /dev/null 2> /dev/null ; then |
---|
22 | echo There are changes not checked into CVS - please rectify |
---|
23 | exit 1 |
---|
24 | fi |
---|
25 | # Update ChangeLog |
---|
26 | CVS2CL=./cvs2cl.pl |
---|
27 | if ! test -x $CVS2CL ; then |
---|
28 | CVS2CL=../cvs2cl/cvs2cl.pl |
---|
29 | fi |
---|
30 | if ! test -x $CVS2CL ; then |
---|
31 | echo cvs2cl.pl not found |
---|
32 | exit 1 |
---|
33 | fi |
---|
34 | TAG=`sed 's/^CHANGELOG_FROM_TAG=//p;d' configure.in` |
---|
35 | # stderr | grep -v '^cvs server: warning: no revision .*/Attic/' |
---|
36 | if ! cvs log -r$TAG:: 2> /dev/null|./fixchangelog.pl $TAG|$CVS2CL --stdin 2> /dev/null ; then |
---|
37 | echo Failed to update ChangeLog from CVS |
---|
38 | exit 1 |
---|
39 | fi |
---|
40 | fi |
---|
41 | if test -f Makefile ; then |
---|
42 | if ! make distclean ; then |
---|
43 | echo make distclean failed |
---|
44 | exit 1 |
---|
45 | fi |
---|
46 | fi |
---|
47 | if test yes = "$rel" ; then |
---|
48 | rm -f config.guess.new config.sub.new |
---|
49 | # only check for new versions if the current ones are over a day old |
---|
50 | perl -e '-M "config.guess" && -M "config.sub" && exit 1' ||\ |
---|
51 | wget ftp://ftp.gnu.org/gnu/config/config.guess -O config.guess.new &&\ |
---|
52 | wget ftp://ftp.gnu.org/gnu/config/config.sub -O config.sub.new &&\ |
---|
53 | chmod 755 config.guess.new config.sub.new &&\ |
---|
54 | mv config.guess.new config.guess && mv config.sub.new config.sub |
---|
55 | fi |
---|
56 | autoreconf --force -i |
---|
57 | export CC |
---|
58 | export CXX |
---|
59 | CC=gcc |
---|
60 | CXX=g++ |
---|
61 | if ! ./configure ; then |
---|
62 | echo configure failed |
---|
63 | exit 1 |
---|
64 | fi |
---|
65 | if test yes = "$rel" ; then |
---|
66 | if ! make dist ; then # distcheck fails extend.tst for some reason! |
---|
67 | echo make distcheck failed |
---|
68 | exit 1 |
---|
69 | fi |
---|
70 | else |
---|
71 | if ! make dist ; then |
---|
72 | echo make dist failed |
---|
73 | exit 1 |
---|
74 | fi |
---|
75 | fi |
---|
76 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
---|
77 | if rpm --version > /dev/null 2> /dev/null ; then |
---|
78 | if ! make rpm ; then |
---|
79 | echo make rpm failed |
---|
80 | exit 1 |
---|
81 | fi |
---|
82 | else |
---|
83 | echo rpm not installed - skipping rpm generation |
---|
84 | fi |
---|
85 | fi |
---|
86 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then |
---|
87 | if ! make debian ; then |
---|
88 | echo make debian failed |
---|
89 | exit 1 |
---|
90 | fi |
---|
91 | fi |
---|
92 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
---|
93 | if ! make dos_doc_exe ; then |
---|
94 | echo make dos_doc_exe failed |
---|
95 | exit 1 |
---|
96 | fi |
---|
97 | if ! make riscos_doc_zip ; then |
---|
98 | echo make riscos_doc_zip failed |
---|
99 | exit 1 |
---|
100 | fi |
---|
101 | fi |
---|
102 | if expr "$mk" : '.*\<alien\>'; then |
---|
103 | if ! make alien_src_zip ; then |
---|
104 | echo make alien_src_zip failed |
---|
105 | exit 1 |
---|
106 | fi |
---|
107 | fi |
---|
108 | if ! make distclean ; then |
---|
109 | echo make distclean failed |
---|
110 | exit 1 |
---|
111 | fi |
---|
112 | unset CC |
---|
113 | unset CXX |
---|
114 | if expr "$mk" : '.*\<djgpp\>'; then |
---|
115 | build_platform=`sh config.guess` |
---|
116 | SAVE_PATH="$PATH" |
---|
117 | # for building on mrs30 |
---|
118 | if test -d /opt/crosstools/i386-pc-msdosdjgpp ; then |
---|
119 | PATH=/opt/crosstools/i386-pc-msdosdjgpp/bin:/opt/crosstools/bin:$PATH |
---|
120 | fi |
---|
121 | if ! ./configure --host=i386-pc-msdosdjgpp --build="$build_platform" --with-x=no --disable-aven LDFLAGS=-s STRIP=echo CAVEROT=caverot.exe CRLIB=-lalleg CROBJX=dosrot.o ; then |
---|
122 | echo djgpp configure failed |
---|
123 | exit 1 |
---|
124 | fi |
---|
125 | if ! make ; then |
---|
126 | echo djgpp make failed |
---|
127 | exit 1 |
---|
128 | fi |
---|
129 | if ! make djgpp_exe ; then |
---|
130 | echo djgpp make djgpp_exe failed |
---|
131 | exit 1 |
---|
132 | fi |
---|
133 | if ! make distclean ; then |
---|
134 | echo make distclean failed |
---|
135 | exit 1 |
---|
136 | fi |
---|
137 | PATH="$SAVE_PATH" |
---|
138 | fi |
---|
139 | if expr "$mk" : '.*\<mingw\>'; then |
---|
140 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
141 | SAVE_PATH="$PATH" |
---|
142 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
---|
143 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
---|
144 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
---|
145 | else |
---|
146 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
147 | # debian mingw32 package |
---|
148 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
149 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
150 | export CC |
---|
151 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
152 | export CXX |
---|
153 | else |
---|
154 | # variant of debian mingw32 package? |
---|
155 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
156 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
157 | export CC |
---|
158 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
159 | export CXX |
---|
160 | fi |
---|
161 | fi |
---|
162 | wxc=wxmsw-2.5-config |
---|
163 | for a in /usr/i586-mingw32msvc/bin/wx-config ; do |
---|
164 | test -x "$a" && wxc="$a" |
---|
165 | done |
---|
166 | LDFLAGS= |
---|
167 | CPPFLAGS= |
---|
168 | if ! ./configure --host=mingw32 --build="$build_platform" --with-x=no CAVEROT= WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" ; then |
---|
169 | echo mingw configure failed |
---|
170 | exit 1 |
---|
171 | fi |
---|
172 | if ! make ; then |
---|
173 | echo mingw make failed |
---|
174 | exit 1 |
---|
175 | fi |
---|
176 | if ! make mingw_iss ; then |
---|
177 | echo mingw make mingw_iss failed |
---|
178 | exit 1 |
---|
179 | fi |
---|
180 | if ! make distclean ; then |
---|
181 | echo make distclean failed |
---|
182 | exit 1 |
---|
183 | fi |
---|
184 | PATH="$SAVE_PATH" |
---|
185 | CC= |
---|
186 | CXX= |
---|
187 | fi |
---|