1 | #! /bin/sh |
---|
2 | release=yes |
---|
3 | if test x"$1" = x-t ; then |
---|
4 | release= |
---|
5 | shift |
---|
6 | fi |
---|
7 | build=${@-src rpm deb doc alien djgpp mingw} |
---|
8 | if test x"$release" = xyes ; then |
---|
9 | if ! cvs diff > /dev/null 2> /dev/null ; then |
---|
10 | echo There are changes not checked into CVS - please rectify |
---|
11 | exit 1 |
---|
12 | fi |
---|
13 | # Update ChangeLog |
---|
14 | CVS2CL=./cvs2cl.pl |
---|
15 | if ! test -x $CVS2CL ; then |
---|
16 | CVS2CL=../cvs2cl/cvs2cl.pl |
---|
17 | fi |
---|
18 | if ! $CVS2CL 2> /dev/null ; then |
---|
19 | echo Failed to update ChangeLog from CVS |
---|
20 | exit 1 |
---|
21 | fi |
---|
22 | fi |
---|
23 | if test -f Makefile ; then |
---|
24 | if ! make distclean ; then |
---|
25 | echo make distclean failed |
---|
26 | exit 1 |
---|
27 | fi |
---|
28 | fi |
---|
29 | if test x"$release" = xyes ; then |
---|
30 | wget ftp://ftp.gnu.org/gnu/config/config.guess |
---|
31 | wget ftp://ftp.gnu.org/gnu/config/config.sub |
---|
32 | fi |
---|
33 | aclocal |
---|
34 | autoheader |
---|
35 | automake -a |
---|
36 | autoconf |
---|
37 | if ! ./configure ; then |
---|
38 | echo configure failed |
---|
39 | exit 1 |
---|
40 | fi |
---|
41 | # make distcheck fails - cvs version of automake doesn't clean up all the |
---|
42 | # files it creates... (FIXME: change to distcheck once automake fixed) |
---|
43 | if ! make dist ; then |
---|
44 | echo make dist failed |
---|
45 | exit 1 |
---|
46 | fi |
---|
47 | if test x"$release" = xyes && expr "$build" : '.*\<rpm\>'; then |
---|
48 | if rpm --version > /dev/null 2> /dev/null ; then |
---|
49 | if ! make rpm ; then |
---|
50 | echo make rpm failed |
---|
51 | exit 1 |
---|
52 | fi |
---|
53 | else |
---|
54 | echo rpm not installed - skipping rpm generation |
---|
55 | fi |
---|
56 | fi |
---|
57 | if test x"$release" = xyes && expr "$build" : '.*\<deb\>'; then |
---|
58 | if ! make debian ; then |
---|
59 | echo make debian failed |
---|
60 | exit 1 |
---|
61 | fi |
---|
62 | fi |
---|
63 | if test x"$release" = xyes && expr "$build" : '.*\<doc\>'; then |
---|
64 | if ! make dos_doc_zip ; then |
---|
65 | echo make dos_doc_zip failed |
---|
66 | exit 1 |
---|
67 | fi |
---|
68 | if ! make riscos_doc_zip ; then |
---|
69 | echo make riscos_doc_zip failed |
---|
70 | exit 1 |
---|
71 | fi |
---|
72 | fi |
---|
73 | if expr "$build" : '.*\<alien\>'; then |
---|
74 | if ! make alien_src_zip ; then |
---|
75 | echo make alien_src_zip failed |
---|
76 | exit 1 |
---|
77 | fi |
---|
78 | fi |
---|
79 | if ! make distclean ; then |
---|
80 | echo make distclean failed |
---|
81 | exit 1 |
---|
82 | fi |
---|
83 | if expr "$build" : '.*\<djgpp\>'; then |
---|
84 | SAVE_PATH="$PATH" |
---|
85 | # for building on mrs30 |
---|
86 | if test -d /opt/crosstools/i386-pc-msdosdjgpp ; then |
---|
87 | PATH=/opt/crosstools/i386-pc-msdosdjgpp/bin:/opt/crosstools/bin:$PATH |
---|
88 | fi |
---|
89 | if ! env LDFLAGS=-s STRIP=echo CAVEROT=caverot.exe \ |
---|
90 | CRLIB=-lalleg CROBJX=dosrot.o ./configure --with-x=no --disable-aven; then |
---|
91 | echo djgpp configure failed |
---|
92 | exit 1 |
---|
93 | fi |
---|
94 | if ! make ; then |
---|
95 | echo djgpp make failed |
---|
96 | exit 1 |
---|
97 | fi |
---|
98 | if ! make djgpp_zip ; then |
---|
99 | echo djgpp make djgpp_zip failed |
---|
100 | exit 1 |
---|
101 | fi |
---|
102 | if ! make distclean ; then |
---|
103 | echo make distclean failed |
---|
104 | exit 1 |
---|
105 | fi |
---|
106 | PATH="$SAVE_PATH" |
---|
107 | fi |
---|
108 | if expr "$build" : '.*\<mingw\>'; then |
---|
109 | SAVE_PATH="$PATH" |
---|
110 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
---|
111 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
---|
112 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
---|
113 | else |
---|
114 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
115 | # debian mingw32 package |
---|
116 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
117 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
118 | export CC |
---|
119 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
120 | export CXX |
---|
121 | else |
---|
122 | # variant of debian mingw32 package? |
---|
123 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
124 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
125 | export CC |
---|
126 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
127 | export CXX |
---|
128 | fi |
---|
129 | fi |
---|
130 | if ! env LDFLAGS=-s CAVEROT= ./configure --with-x=no --with-wxconfig=`pwd`/mingw_extras/wxmsw-config ; then |
---|
131 | echo mingw configure failed |
---|
132 | exit 1 |
---|
133 | fi |
---|
134 | if ! make ; then |
---|
135 | echo mingw make failed |
---|
136 | exit 1 |
---|
137 | fi |
---|
138 | if ! make mingw_iss ; then |
---|
139 | echo mingw make mingw_iss failed |
---|
140 | exit 1 |
---|
141 | fi |
---|
142 | if ! make distclean ; then |
---|
143 | echo make distclean failed |
---|
144 | exit 1 |
---|
145 | fi |
---|
146 | PATH="$SAVE_PATH" |
---|
147 | CC= |
---|
148 | CXX= |
---|
149 | fi |
---|