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 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 | fi |
---|
26 | if test -f Makefile ; then |
---|
27 | if ! make distclean ; then |
---|
28 | echo make distclean failed |
---|
29 | exit 1 |
---|
30 | fi |
---|
31 | fi |
---|
32 | if test yes = "$rel" ; then |
---|
33 | cp -u /usr/share/misc/config.guess . |
---|
34 | cp -u /usr/share/misc/config.sub . |
---|
35 | fi |
---|
36 | autoreconf --force -i |
---|
37 | export CC |
---|
38 | export CXX |
---|
39 | CC=gcc |
---|
40 | CXX=g++ |
---|
41 | if ! ./configure ; then |
---|
42 | echo configure failed |
---|
43 | exit 1 |
---|
44 | fi |
---|
45 | if test yes = "$rel" ; then |
---|
46 | export CFLAGS |
---|
47 | export CXXFLAGS |
---|
48 | # tell the preproceesor to be C89 - this makes it reject // comments |
---|
49 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
50 | # FIXME CXXFLAGS="-Werror" |
---|
51 | CFLAGS="-Wp,-std=c89" |
---|
52 | CXXFLAGS= |
---|
53 | if ! make dist ; then # distcheck fails extend.tst for some reason! |
---|
54 | echo make distcheck failed |
---|
55 | exit 1 |
---|
56 | fi |
---|
57 | CFLAGS= |
---|
58 | CXXFLAGS= |
---|
59 | else |
---|
60 | if ! make dist ; then |
---|
61 | echo make dist failed |
---|
62 | exit 1 |
---|
63 | fi |
---|
64 | fi |
---|
65 | if test x"$rel" = xyes && expr "$mk" : '.*\<rpm\>' || test x"$mk" = xrpm ; then |
---|
66 | if rpmbuild --version > /dev/null 2> /dev/null ; then |
---|
67 | if ! make rpm ; then |
---|
68 | echo make rpm failed |
---|
69 | exit 1 |
---|
70 | fi |
---|
71 | else |
---|
72 | echo rpmbuild not installed - skipping rpm generation |
---|
73 | fi |
---|
74 | fi |
---|
75 | if test x"$rel" = xyes && expr "$mk" : '.*\<deb\>' || test x"$mk" = xdeb ; then |
---|
76 | if ! make debian ; then |
---|
77 | echo make debian failed |
---|
78 | exit 1 |
---|
79 | fi |
---|
80 | fi |
---|
81 | if test x"$rel" = xyes && expr "$mk" : '.*\<doc\>' || test x"$mk" = xdoc ; then |
---|
82 | if ! make dos_doc_exe ; then |
---|
83 | echo make dos_doc_exe failed |
---|
84 | exit 1 |
---|
85 | fi |
---|
86 | fi |
---|
87 | if ! make distclean ; then |
---|
88 | echo make distclean failed |
---|
89 | exit 1 |
---|
90 | fi |
---|
91 | unset CC |
---|
92 | unset CXX |
---|
93 | if expr "$mk" : '.*\<mingw\>'; then |
---|
94 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
95 | SAVE_PATH="$PATH" |
---|
96 | if test -d /usr/local/cross-tools/i386-mingw32msvc/bin ; then |
---|
97 | # binaries from http://www.devolution.com/~slouken/SDL/Xmingw32/ |
---|
98 | PATH=/usr/local/cross-tools/bin:/usr/local/cross-tools/i386-mingw32msvc/bin:$PATH |
---|
99 | else |
---|
100 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
101 | # debian mingw32 package |
---|
102 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
103 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
104 | export CC |
---|
105 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
106 | export CXX |
---|
107 | else |
---|
108 | # variant of debian mingw32 package? |
---|
109 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
110 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
111 | export CC |
---|
112 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
113 | export CXX |
---|
114 | fi |
---|
115 | fi |
---|
116 | wxc=wxmsw-2.5-config |
---|
117 | for a in /usr/i586-mingw32msvc/bin/wx-config ; do |
---|
118 | test -x "$a" && wxc="$a" |
---|
119 | done |
---|
120 | LDFLAGS= |
---|
121 | CPPFLAGS= |
---|
122 | #if ! ./configure --host=mingw32 --build="$build_platform" WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" CFLAGS=-Werror CXXFLAGS=-Werror ; then |
---|
123 | if ! ./configure --host=mingw32 --build="$build_platform" WXCONFIG="$wxc" LDFLAGS="-s $LDFLAGS" CPPFLAGS="$CPPFLAGS" ; then |
---|
124 | echo mingw configure failed |
---|
125 | exit 1 |
---|
126 | fi |
---|
127 | if ! make ; then |
---|
128 | echo mingw make failed |
---|
129 | exit 1 |
---|
130 | fi |
---|
131 | if ! make mingw_iss ; then |
---|
132 | echo mingw make mingw_iss failed |
---|
133 | exit 1 |
---|
134 | fi |
---|
135 | if ! make distclean ; then |
---|
136 | echo make distclean failed |
---|
137 | exit 1 |
---|
138 | fi |
---|
139 | PATH="$SAVE_PATH" |
---|
140 | CC= |
---|
141 | CXX= |
---|
142 | fi |
---|