Codebase list bumprace / f284018
Import Upstream version 1.4.5 Christian T. Steigies 5 years ago
189 changed file(s) with 11896 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ----------------------------------< CREDITS >-----------------------------------
1
2 Graphics and code by KARL BARTEL:
3 E-mail: karlb@gmx.net
4 Homepage: http://members.linuxstart.com/~karlb/
5
6 Particle code, ideas and other support by LION KIMBRO:
7 E-mail: SnowLion@sprynet.com
8
9 The music was written by THE LIZARD KING
10 E-mail: gustaf.grefberg@pp.itv.se
11 Homepage: http://www.itv.se/~a1055/frames.html
12
13 Some levels by STEPHAN:
14 E-mail: emailme@enthralling.com
15
16 Backgounds grabbed from the "eterm-backgrounds_1.0-1.deb" the authors say about
17 it:
18 "NONE of these images are original work by either of the Eterm authors; they
19 have all been collected from various sites on the web. As far as I know, they
20 are all freely available for use.
21 However, should any person who can provide proof of ownership of any of these
22 pictures object to their inclusion, they will be IMMEDIATELY withdrawn. No
23 copyright infringement is intended. Inclusion here should be taken as a
24 compliment. :-)"
0 GNU GENERAL PUBLIC LICENSE
1 Version 2, June 1991
2
3 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
4 675 Mass Ave, Cambridge, MA 02139, USA
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The licenses for most software are designed to take away your
11 freedom to share and change it. By contrast, the GNU General Public
12 License is intended to guarantee your freedom to share and change free
13 software--to make sure the software is free for all its users. This
14 General Public License applies to most of the Free Software
15 Foundation's software and to any other program whose authors commit to
16 using it. (Some other Free Software Foundation software is covered by
17 the GNU Library General Public License instead.) You can apply it to
18 your programs, too.
19
20 When we speak of free software, we are referring to freedom, not
21 price. Our General Public Licenses are designed to make sure that you
22 have the freedom to distribute copies of free software (and charge for
23 this service if you wish), that you receive source code or can get it
24 if you want it, that you can change the software or use pieces of it
25 in new free programs; and that you know you can do these things.
26
27 To protect your rights, we need to make restrictions that forbid
28 anyone to deny you these rights or to ask you to surrender the rights.
29 These restrictions translate to certain responsibilities for you if you
30 distribute copies of the software, or if you modify it.
31
32 For example, if you distribute copies of such a program, whether
33 gratis or for a fee, you must give the recipients all the rights that
34 you have. You must make sure that they, too, receive or can get the
35 source code. And you must show them these terms so they know their
36 rights.
37
38 We protect your rights with two steps: (1) copyright the software, and
39 (2) offer you this license which gives you legal permission to copy,
40 distribute and/or modify the software.
41
42 Also, for each author's protection and ours, we want to make certain
43 that everyone understands that there is no warranty for this free
44 software. If the software is modified by someone else and passed on, we
45 want its recipients to know that what they have is not the original, so
46 that any problems introduced by others will not reflect on the original
47 authors' reputations.
48
49 Finally, any free program is threatened constantly by software
50 patents. We wish to avoid the danger that redistributors of a free
51 program will individually obtain patent licenses, in effect making the
52 program proprietary. To prevent this, we have made it clear that any
53 patent must be licensed for everyone's free use or not licensed at all.
54
55 The precise terms and conditions for copying, distribution and
56 modification follow.
57
58 GNU GENERAL PUBLIC LICENSE
59 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
60
61 0. This License applies to any program or other work which contains
62 a notice placed by the copyright holder saying it may be distributed
63 under the terms of this General Public License. The "Program", below,
64 refers to any such program or work, and a "work based on the Program"
65 means either the Program or any derivative work under copyright law:
66 that is to say, a work containing the Program or a portion of it,
67 either verbatim or with modifications and/or translated into another
68 language. (Hereinafter, translation is included without limitation in
69 the term "modification".) Each licensee is addressed as "you".
70
71 Activities other than copying, distribution and modification are not
72 covered by this License; they are outside its scope. The act of
73 running the Program is not restricted, and the output from the Program
74 is covered only if its contents constitute a work based on the
75 Program (independent of having been made by running the Program).
76 Whether that is true depends on what the Program does.
77
78 1. You may copy and distribute verbatim copies of the Program's
79 source code as you receive it, in any medium, provided that you
80 conspicuously and appropriately publish on each copy an appropriate
81 copyright notice and disclaimer of warranty; keep intact all the
82 notices that refer to this License and to the absence of any warranty;
83 and give any other recipients of the Program a copy of this License
84 along with the Program.
85
86 You may charge a fee for the physical act of transferring a copy, and
87 you may at your option offer warranty protection in exchange for a fee.
88
89 2. You may modify your copy or copies of the Program or any portion
90 of it, thus forming a work based on the Program, and copy and
91 distribute such modifications or work under the terms of Section 1
92 above, provided that you also meet all of these conditions:
93
94 a) You must cause the modified files to carry prominent notices
95 stating that you changed the files and the date of any change.
96
97 b) You must cause any work that you distribute or publish, that in
98 whole or in part contains or is derived from the Program or any
99 part thereof, to be licensed as a whole at no charge to all third
100 parties under the terms of this License.
101
102 c) If the modified program normally reads commands interactively
103 when run, you must cause it, when started running for such
104 interactive use in the most ordinary way, to print or display an
105 announcement including an appropriate copyright notice and a
106 notice that there is no warranty (or else, saying that you provide
107 a warranty) and that users may redistribute the program under
108 these conditions, and telling the user how to view a copy of this
109 License. (Exception: if the Program itself is interactive but
110 does not normally print such an announcement, your work based on
111 the Program is not required to print an announcement.)
112
113 These requirements apply to the modified work as a whole. If
114 identifiable sections of that work are not derived from the Program,
115 and can be reasonably considered independent and separate works in
116 themselves, then this License, and its terms, do not apply to those
117 sections when you distribute them as separate works. But when you
118 distribute the same sections as part of a whole which is a work based
119 on the Program, the distribution of the whole must be on the terms of
120 this License, whose permissions for other licensees extend to the
121 entire whole, and thus to each and every part regardless of who wrote it.
122
123 Thus, it is not the intent of this section to claim rights or contest
124 your rights to work written entirely by you; rather, the intent is to
125 exercise the right to control the distribution of derivative or
126 collective works based on the Program.
127
128 In addition, mere aggregation of another work not based on the Program
129 with the Program (or with a work based on the Program) on a volume of
130 a storage or distribution medium does not bring the other work under
131 the scope of this License.
132
133 3. You may copy and distribute the Program (or a work based on it,
134 under Section 2) in object code or executable form under the terms of
135 Sections 1 and 2 above provided that you also do one of the following:
136
137 a) Accompany it with the complete corresponding machine-readable
138 source code, which must be distributed under the terms of Sections
139 1 and 2 above on a medium customarily used for software interchange; or,
140
141 b) Accompany it with a written offer, valid for at least three
142 years, to give any third party, for a charge no more than your
143 cost of physically performing source distribution, a complete
144 machine-readable copy of the corresponding source code, to be
145 distributed under the terms of Sections 1 and 2 above on a medium
146 customarily used for software interchange; or,
147
148 c) Accompany it with the information you received as to the offer
149 to distribute corresponding source code. (This alternative is
150 allowed only for noncommercial distribution and only if you
151 received the program in object code or executable form with such
152 an offer, in accord with Subsection b above.)
153
154 The source code for a work means the preferred form of the work for
155 making modifications to it. For an executable work, complete source
156 code means all the source code for all modules it contains, plus any
157 associated interface definition files, plus the scripts used to
158 control compilation and installation of the executable. However, as a
159 special exception, the source code distributed need not include
160 anything that is normally distributed (in either source or binary
161 form) with the major components (compiler, kernel, and so on) of the
162 operating system on which the executable runs, unless that component
163 itself accompanies the executable.
164
165 If distribution of executable or object code is made by offering
166 access to copy from a designated place, then offering equivalent
167 access to copy the source code from the same place counts as
168 distribution of the source code, even though third parties are not
169 compelled to copy the source along with the object code.
170
171 4. You may not copy, modify, sublicense, or distribute the Program
172 except as expressly provided under this License. Any attempt
173 otherwise to copy, modify, sublicense or distribute the Program is
174 void, and will automatically terminate your rights under this License.
175 However, parties who have received copies, or rights, from you under
176 this License will not have their licenses terminated so long as such
177 parties remain in full compliance.
178
179 5. You are not required to accept this License, since you have not
180 signed it. However, nothing else grants you permission to modify or
181 distribute the Program or its derivative works. These actions are
182 prohibited by law if you do not accept this License. Therefore, by
183 modifying or distributing the Program (or any work based on the
184 Program), you indicate your acceptance of this License to do so, and
185 all its terms and conditions for copying, distributing or modifying
186 the Program or works based on it.
187
188 6. Each time you redistribute the Program (or any work based on the
189 Program), the recipient automatically receives a license from the
190 original licensor to copy, distribute or modify the Program subject to
191 these terms and conditions. You may not impose any further
192 restrictions on the recipients' exercise of the rights granted herein.
193 You are not responsible for enforcing compliance by third parties to
194 this License.
195
196 7. If, as a consequence of a court judgment or allegation of patent
197 infringement or for any other reason (not limited to patent issues),
198 conditions are imposed on you (whether by court order, agreement or
199 otherwise) that contradict the conditions of this License, they do not
200 excuse you from the conditions of this License. If you cannot
201 distribute so as to satisfy simultaneously your obligations under this
202 License and any other pertinent obligations, then as a consequence you
203 may not distribute the Program at all. For example, if a patent
204 license would not permit royalty-free redistribution of the Program by
205 all those who receive copies directly or indirectly through you, then
206 the only way you could satisfy both it and this License would be to
207 refrain entirely from distribution of the Program.
208
209 If any portion of this section is held invalid or unenforceable under
210 any particular circumstance, the balance of the section is intended to
211 apply and the section as a whole is intended to apply in other
212 circumstances.
213
214 It is not the purpose of this section to induce you to infringe any
215 patents or other property right claims or to contest validity of any
216 such claims; this section has the sole purpose of protecting the
217 integrity of the free software distribution system, which is
218 implemented by public license practices. Many people have made
219 generous contributions to the wide range of software distributed
220 through that system in reliance on consistent application of that
221 system; it is up to the author/donor to decide if he or she is willing
222 to distribute software through any other system and a licensee cannot
223 impose that choice.
224
225 This section is intended to make thoroughly clear what is believed to
226 be a consequence of the rest of this License.
227
228 8. If the distribution and/or use of the Program is restricted in
229 certain countries either by patents or by copyrighted interfaces, the
230 original copyright holder who places the Program under this License
231 may add an explicit geographical distribution limitation excluding
232 those countries, so that distribution is permitted only in or among
233 countries not thus excluded. In such case, this License incorporates
234 the limitation as if written in the body of this License.
235
236 9. The Free Software Foundation may publish revised and/or new versions
237 of the General Public License from time to time. Such new versions will
238 be similar in spirit to the present version, but may differ in detail to
239 address new problems or concerns.
240
241 Each version is given a distinguishing version number. If the Program
242 specifies a version number of this License which applies to it and "any
243 later version", you have the option of following the terms and conditions
244 either of that version or of any later version published by the Free
245 Software Foundation. If the Program does not specify a version number of
246 this License, you may choose any version ever published by the Free Software
247 Foundation.
248
249 10. If you wish to incorporate parts of the Program into other free
250 programs whose distribution conditions are different, write to the author
251 to ask for permission. For software which is copyrighted by the Free
252 Software Foundation, write to the Free Software Foundation; we sometimes
253 make exceptions for this. Our decision will be guided by the two goals
254 of preserving the free status of all derivatives of our free software and
255 of promoting the sharing and reuse of software generally.
256
257 NO WARRANTY
258
259 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
260 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
261 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
262 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
263 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
264 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
265 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
266 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
267 REPAIR OR CORRECTION.
268
269 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
270 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
271 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
272 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
273 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
274 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
275 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
276 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
277 POSSIBILITY OF SUCH DAMAGES.
278
279 END OF TERMS AND CONDITIONS
280
281 How to Apply These Terms to Your New Programs
282
283 If you develop a new program, and you want it to be of the greatest
284 possible use to the public, the best way to achieve this is to make it
285 free software which everyone can redistribute and change under these terms.
286
287 To do so, attach the following notices to the program. It is safest
288 to attach them to the start of each source file to most effectively
289 convey the exclusion of warranty; and each file should have at least
290 the "copyright" line and a pointer to where the full notice is found.
291
292 <one line to give the program's name and a brief idea of what it does.>
293 Copyright (C) 19yy <name of author>
294
295 This program is free software; you can redistribute it and/or modify
296 it under the terms of the GNU General Public License as published by
297 the Free Software Foundation; either version 2 of the License, or
298 (at your option) any later version.
299
300 This program is distributed in the hope that it will be useful,
301 but WITHOUT ANY WARRANTY; without even the implied warranty of
302 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
303 GNU General Public License for more details.
304
305 You should have received a copy of the GNU General Public License
306 along with this program; if not, write to the Free Software
307 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
308
309 Also add information on how to contact you by electronic and paper mail.
310
311 If the program is interactive, make it output a short notice like this
312 when it starts in an interactive mode:
313
314 Gnomovision version 69, Copyright (C) 19yy name of author
315 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
316 This is free software, and you are welcome to redistribute it
317 under certain conditions; type `show c' for details.
318
319 The hypothetical commands `show w' and `show c' should show the appropriate
320 parts of the General Public License. Of course, the commands you use may
321 be called something other than `show w' and `show c'; they could even be
322 mouse-clicks or menu items--whatever suits your program.
323
324 You should also get your employer (if you work as a programmer) or your
325 school, if any, to sign a "copyright disclaimer" for the program, if
326 necessary. Here is a sample; alter the names:
327
328 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
329 `Gnomovision' (which makes passes at compilers) written by James Hacker.
330
331 <signature of Ty Coon>, 1 April 1989
332 Ty Coon, President of Vice
333
334 This General Public License does not permit incorporating your program into
335 proprietary programs. If your program is a subroutine library, you may
336 consider it more useful to permit linking proprietary applications with the
337 library. If this is what you want to do, use the GNU Library General
338 Public License instead of this License.
0 Version 1.45
1 -fixed crash-after-racer-selection bug. I can't understand why this bug
2 didn't cause a crash on my computer...
3
4 Version 1.44
5 -2 new levels
6 -better balanced racers
7 -changed the URL on the help screen
8 -fixed "time boni are gone forever" bug
9
10 Version 1.??
11 -new aclocal file (fixes compilation on arm)
12
13 Version 1.43
14 -no SDL_mixer included
15 -command line help
16 -changed command line options
17 -new option: no fadeout for slow computers
18 -fixed a bug concerning wrong video flags
19
20 Version 1.42
21 -game now easier (some smaller changes)
22 -other changes?? (I deleted changelog... ooops!)
23 -now using SDL>=1.1.5 (including a bug workaround)
24 -hiscore bug finally fixed
25
26 Version 1.4
27 -the highscore list is shown properly after the name has been entered
28 -the lasers are now animated
29 -messages like "crashed" are displayed until all particles have disappeared
30 -the shot leave the cannon more precisely
31 -a new level
32 -the racer can move closer to the edges of the screen
33 -changed some tile graphics
34 -new timeout picture
35 -new scoring system
36 -changed collision code (I hope it's better...)
37 -fixed a small update bug (nothing serious)
38 -fixed a bug in the racer selection menu
39 -bumprace uses always 16 bpp again, cause there are some problems with 8bpp
40
41 Version 1.3
42 -now using input from sdl-config for configure
43 -configure now checks for mathlib (-lm), too, if it is needed
44 -bumprace can now be installed anywhere
45 -the version number, which is displayed at startup, changes automatically
46 -the last version installed an unneccessary header file -> fixed
47 -removed a timeout bug when playing two times without quitting
48 -music is faded out when quitting
49 -removed some other bugs when played two times
50 -added highscore list
51 -now using SFont for fonts output
52 -using the gfx.cpp of penguin-command which makes coding easier for me
53 and it has also better error checking.
54 -the particles are much better now.
55 -there's a frame limit now.
56 -a BumpRace Version without mixer is available
57 -changed the special key to left ctrl for player 2
58 -new images for "crashed" and "level completed"
59 -BumpRace can now run in any color depth, and uses the color depth of the
60 X-server
61 -some new tiles
62 -png support
63
64 Version 1.2
65 -fixed a bug in 2p team mode (the game didn't terminate after the timeout)
66 -reduced the time between crashing and the crash sound by decreasing the
67 chunk size.
68 -repaired wrong output when the sound is turned off due a used device
69 -fixed a bug in HandleShots() that could cause BumpRace to crash when
70 the free CPU time for BumpRace is very low.
71 -fixed a bug that caused the racer selction to be skipped on fast computers
72 -added a quit button to the main menu. The game now returns to the main
73 menu after the scoring.
74 -moved the menus to menu.c
75 -level numbers are displayed again (was a bug in 1.1)
76 -the cannon is now displayed correctly
77 -reduced cannon's turn speed
78 -added a fullscreen fade after the scoring. This is very slow under Linux,
79 but this will be better with XFree 4, when hardware acceleration is ready.
80 -added configure/automake/autoconf support. This is not prefect yet, but
81 I'm still working on it
82 -modified LoadImage() to search for the graphic files in different
83 directories
84 -modified the sound and font loading to use the path selected by LoadImage
85 -modified the README file, deleted README-SOURCE and created NEWS,AUTHORS
86 and INSTALL files
87 -better directory stucture
88 -fullscreen mode is default now, cause the new SDL fullscreen code works
89 perfect.
90 -configure now checks for the needed libs and allows "make install"
91 -the points hasn't been displayed correctly in competition mode. fixed.
92 -now using SDL_Mixer 1.0.4
93
94 Version 1.1
95 -moved some gfx functions into gfx.c
96 -added jpg support
97 -all loaded images are converted to the pixel format of the screen surface.
98 This should speed up bumprace and increase the image quality.
99 -added some startup output
100 -BumpRace is now using a backbuffer. This increases the memory usage but it
101 makes a lot of programming easier and faster.
102 -some pics are converted to jpg -> smaller download
103 -BumpRace doesn't quit when it can't find a sound device, now it just turns
104 the sound off
105 -The time display is now labelled with "TIME LEFT" and the time decreases
106 from the sides to the middle
107 -You can quit BumpRace now by pressing the close button of your window manager
108 -moved the particle code to particles.c
109 -added the most complex obstacle: the cannon! This makes the game much more
110 interesting IMO.
111 -Racer are now handled very similar to shots and particles. This allows
112 multiple racers, and eleminates some reasons for flickering.
113 -yet another background
114 -added two new game modes: 2player teamwork and 2player competition
115 -added a nice menu for selecting the game mode
116 -the startup message (This is free software...) is now faded in and out.
117 -added simple scoring
118
119 Version 1.00
120 -4 more levels (now 14).
121 -added output "You have completed ?? levels". Windows users won't be able to
122 see this, cause this appears in the shell after the game.
123 -added tree levels (now 17)that were done by Stephan. Thanks!
124 -added lasers (obstacles that switch on and off)
125 -other background
126 -encapsulated the particle routines into the "correct" functions.
127 -fixes a particle removing bug over transparent surfaces
128 -added email/web adresses to the credits
129 -added racer info to the menu
130 -the data is loaded while displaying the title screen -> faster startup
131 -added a new racer
132 -added the "sticky" ability
133 -improved collision
134 -time is only updated when the change is visible
135 -time can now show a wider range of time
136 -got timidity out of the sound system -> smaller package
137
138 Version 0.90
139 -fixed the "quickstart bug" again :-)
140 -now using SDL 0.10.0
141 -added short command line parameters. The old ones start with -- now.
142 -added particle effects ( thanks Lion! )
143 -added new sound effects
144 -fixed time display bug
145
146 Version 0.80
147 -fixed the "quick start" bug
148 -added help (and credits) screen
149 -added a fadeout after every crash and the timeout
150 -added fps counter (-fps , but it shows a very high value, so I'm not sure
151 if that's correct: On my Cyrix200 it does 170fps!)
152 -new 3D-Logo
153 -added the "real" auto-slowdown ablility
154 -added gravity
155 -put racer abilities into variables
156 -one new level with gravity
157 -rendered new racer graphics, now with 18 pics for a smoother rotation
158 Is anyone interested in the .blend files?
159 -now 3 racers are available
160 -added racer ability extra_time. This is the percentage of extra time at the
161 beginning of the game
162 -new graphic for the info board
163 -lifetime if now displayed as a colored bar decreasing from green to red
164
165 Version 0.70:
166 -fonts are now blitted correctly
167 -random level select
168 -more levels (now 11)
169 -bonus time for every completed level
170 -collision rewritten
171 -moved the levels to the file "levels.h"
172 -new background(s)
173 -added the output "This is free software..." like recommended.
174
175 Version 0.60:
176 -added timeout
177 -added (terrible) fonts
178 -better (but still flickering and buggy) fullscreen mode
179 -fixed some bugs
180 -added music: 22khz, 16bit, stereo!
181 -added sound effect(s)
182 -BumpRace is now available under the GNU General Public License version 2.
183 -added command line parameter
184 -added three levels
185
186 Version 0.45:
187 -one speed on all systems
188 -cleaned up the source
189 -title screen
190 -smaller background ( 144 KB )
191 -added one level
192
193 ------------------------------------< BUGS >------------------------------------
194
195 no known bugs -> please mail any bug reports to karlb@gmx.net
+14
-0
FAQ less more
0 BUMPRACE FAQ
1 --------------------------------------------------------------------------------
2 Q: Fullscreen mode does not work on my computer.
3 A: You probably have an old SDL version. SDL 1.0.3 is reccomended
4 for this release.
5 --------------------------------------------------------------------------------
6 Q: BumpRace runs too slow on my computer.
7 A: 1. turn off particles (-t / --noparticles)
8 2. turn off fadeouts (-o / --nofadeout)
9 3. Start your X server at 16 bpp color depth. (startx -- -bpp 16)
10 --------------------------------------------------------------------------------
11 Q: My question is not written here.
12 A: Then write a mail: karlb@gmx.net or get the newest version of BumpRace
13 from http://members.linuxstart.com/~karlb/
0 Basic Installation
1 ==================
2
3 These are generic installation instructions.
4
5 The `configure' shell script attempts to guess correct values for
6 various system-dependent variables used during compilation. It uses
7 those values to create a `Makefile' in each directory of the package.
8 It may also create one or more `.h' files containing system-dependent
9 definitions. Finally, it creates a shell script `config.status' that
10 you can run in the future to recreate the current configuration, a file
11 `config.cache' that saves the results of its tests to speed up
12 reconfiguring, and a file `config.log' containing compiler output
13 (useful mainly for debugging `configure').
14
15 If you need to do unusual things to compile the package, please try
16 to figure out how `configure' could check whether to do them, and mail
17 diffs or instructions to the address given in the `README' so they can
18 be considered for the next release. If at some point `config.cache'
19 contains results you don't want to keep, you may remove or edit it.
20
21 The file `configure.in' is used to create `configure' by a program
22 called `autoconf'. You only need `configure.in' if you want to change
23 it or regenerate `configure' using a newer version of `autoconf'.
24
25 The simplest way to compile this package is:
26
27 1. `cd' to the directory containing the package's source code and type
28 `./configure' to configure the package for your system. If you're
29 using `csh' on an old version of System V, you might need to type
30 `sh ./configure' instead to prevent `csh' from trying to execute
31 `configure' itself.
32
33 Running `configure' takes awhile. While running, it prints some
34 messages telling which features it is checking for.
35
36 2. Type `make' to compile the package.
37
38 3. Optionally, type `make check' to run any self-tests that come with
39 the package.
40
41 4. Type `make install' to install the programs and any data files and
42 documentation.
43
44 5. You can remove the program binaries and object files from the
45 source code directory by typing `make clean'. To also remove the
46 files that `configure' created (so you can compile the package for
47 a different kind of computer), type `make distclean'. There is
48 also a `make maintainer-clean' target, but that is intended mainly
49 for the package's developers. If you use it, you may have to get
50 all sorts of other programs in order to regenerate files that came
51 with the distribution.
52
53 Compilers and Options
54 =====================
55
56 Some systems require unusual options for compilation or linking that
57 the `configure' script does not know about. You can give `configure'
58 initial values for variables by setting them in the environment. Using
59 a Bourne-compatible shell, you can do that on the command line like
60 this:
61 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
62
63 Or on systems that have the `env' program, you can do it like this:
64 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
65
66 Compiling For Multiple Architectures
67 ====================================
68
69 You can compile the package for more than one kind of computer at the
70 same time, by placing the object files for each architecture in their
71 own directory. To do this, you must use a version of `make' that
72 supports the `VPATH' variable, such as GNU `make'. `cd' to the
73 directory where you want the object files and executables to go and run
74 the `configure' script. `configure' automatically checks for the
75 source code in the directory that `configure' is in and in `..'.
76
77 If you have to use a `make' that does not supports the `VPATH'
78 variable, you have to compile the package for one architecture at a time
79 in the source code directory. After you have installed the package for
80 one architecture, use `make distclean' before reconfiguring for another
81 architecture.
82
83 Installation Names
84 ==================
85
86 By default, `make install' will install the package's files in
87 `/usr/local/bin', `/usr/local/man', etc. You can specify an
88 installation prefix other than `/usr/local' by giving `configure' the
89 option `--prefix=PATH'.
90
91 You can specify separate installation prefixes for
92 architecture-specific files and architecture-independent files. If you
93 give `configure' the option `--exec-prefix=PATH', the package will use
94 PATH as the prefix for installing programs and libraries.
95 Documentation and other data files will still use the regular prefix.
96
97 In addition, if you use an unusual directory layout you can give
98 options like `--bindir=PATH' to specify different values for particular
99 kinds of files. Run `configure --help' for a list of the directories
100 you can set and what kinds of files go in them.
101
102 If the package supports it, you can cause programs to be installed
103 with an extra prefix or suffix on their names by giving `configure' the
104 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
105
106 Optional Features
107 =================
108
109 Some packages pay attention to `--enable-FEATURE' options to
110 `configure', where FEATURE indicates an optional part of the package.
111 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
112 is something like `gnu-as' or `x' (for the X Window System). The
113 `README' should mention any `--enable-' and `--with-' options that the
114 package recognizes.
115
116 For packages that use the X Window System, `configure' can usually
117 find the X include and library files automatically, but if it doesn't,
118 you can use the `configure' options `--x-includes=DIR' and
119 `--x-libraries=DIR' to specify their locations.
120
121 Specifying the System Type
122 ==========================
123
124 There may be some features `configure' can not figure out
125 automatically, but needs to determine by the type of host the package
126 will run on. Usually `configure' can figure that out, but if it prints
127 a message saying it can not guess the host type, give it the
128 `--host=TYPE' option. TYPE can either be a short name for the system
129 type, such as `sun4', or a canonical name with three fields:
130 CPU-COMPANY-SYSTEM
131
132 See the file `config.sub' for the possible values of each field. If
133 `config.sub' isn't included in this package, then this package doesn't
134 need to know the host type.
135
136 If you are building compiler tools for cross-compiling, you can also
137 use the `--target=TYPE' option to select the type of system they will
138 produce code for and the `--build=TYPE' option to select the type of
139 system on which you are compiling the package.
140
141 Sharing Defaults
142 ================
143
144 If you want to set default values for `configure' scripts to share,
145 you can create a site shell script called `config.site' that gives
146 default values for variables like `CC', `cache_file', and `prefix'.
147 `configure' looks for `PREFIX/share/config.site' if it exists, then
148 `PREFIX/etc/config.site' if it exists. Or, you can set the
149 `CONFIG_SITE' environment variable to the location of the site script.
150 A warning: not all `configure' scripts look for a site script.
151
152 Operation Controls
153 ==================
154
155 `configure' recognizes the following options to control how it
156 operates.
157
158 `--cache-file=FILE'
159 Use and save the results of the tests in FILE instead of
160 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
161 debugging `configure'.
162
163 `--help'
164 Print a summary of the options to `configure', and exit.
165
166 `--quiet'
167 `--silent'
168 `-q'
169 Do not print messages saying which checks are being made. To
170 suppress all normal output, redirect it to `/dev/null' (any error
171 messages will still be shown).
172
173 `--srcdir=DIR'
174 Look for the package's source code in directory DIR. Usually
175 `configure' can determine that directory automatically.
176
177 `--version'
178 Print the version of Autoconf used to generate the `configure'
179 script, and exit.
180
181 `configure' also accepts some other, not widely useful, options.
0
1 SUBDIRS = data src
2
3 EXTRA_DIST = FAQ
4
5 distdir = $(PACKAGE)-$(VERSION)
0 # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
1
2 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
3 # This Makefile.in is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 # PARTICULAR PURPOSE.
11
12
13 SHELL = @SHELL@
14
15 srcdir = @srcdir@
16 top_srcdir = @top_srcdir@
17 VPATH = @srcdir@
18 prefix = @prefix@
19 exec_prefix = @exec_prefix@
20
21 bindir = @bindir@
22 sbindir = @sbindir@
23 libexecdir = @libexecdir@
24 datadir = @datadir@
25 sysconfdir = @sysconfdir@
26 sharedstatedir = @sharedstatedir@
27 localstatedir = @localstatedir@
28 libdir = @libdir@
29 infodir = @infodir@
30 mandir = @mandir@
31 includedir = @includedir@
32 oldincludedir = /usr/include
33
34 DESTDIR =
35
36 pkgdatadir = $(datadir)/@PACKAGE@
37 pkglibdir = $(libdir)/@PACKAGE@
38 pkgincludedir = $(includedir)/@PACKAGE@
39
40 top_builddir = .
41
42 ACLOCAL = @ACLOCAL@
43 AUTOCONF = @AUTOCONF@
44 AUTOMAKE = @AUTOMAKE@
45 AUTOHEADER = @AUTOHEADER@
46
47 INSTALL = @INSTALL@
48 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
49 INSTALL_DATA = @INSTALL_DATA@
50 INSTALL_SCRIPT = @INSTALL_SCRIPT@
51 transform = @program_transform_name@
52
53 NORMAL_INSTALL = :
54 PRE_INSTALL = :
55 POST_INSTALL = :
56 NORMAL_UNINSTALL = :
57 PRE_UNINSTALL = :
58 POST_UNINSTALL = :
59 host_alias = @host_alias@
60 host_triplet = @host@
61 CC = @CC@
62 MAKEINFO = @MAKEINFO@
63 MATHLIB = @MATHLIB@
64 PACKAGE = @PACKAGE@
65 RANLIB = @RANLIB@
66 SDL_CFLAGS = @SDL_CFLAGS@
67 SDL_CONFIG = @SDL_CONFIG@
68 SDL_LIBS = @SDL_LIBS@
69 VERSION = @VERSION@
70
71 SUBDIRS = data src
72
73 EXTRA_DIST = FAQ
74
75 distdir = $(PACKAGE)-$(VERSION)
76 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
77 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
78 CONFIG_CLEAN_FILES =
79 DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
80 Makefile.in NEWS acinclude.m4 aclocal.m4 config.guess config.sub \
81 configure configure.in install-sh missing mkinstalldirs
82
83
84 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
85
86 TAR = tar
87 GZIP_ENV = --best
88 all: all-redirect
89 .SUFFIXES:
90 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
91 cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
92
93 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
94 cd $(top_builddir) \
95 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
96
97 $(ACLOCAL_M4): configure.in acinclude.m4
98 cd $(srcdir) && $(ACLOCAL)
99
100 config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
101 $(SHELL) ./config.status --recheck
102 $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
103 cd $(srcdir) && $(AUTOCONF)
104
105 # This directory's subdirectories are mostly independent; you can cd
106 # into them and run `make' without going through this Makefile.
107 # To change the values of `make' variables: instead of editing Makefiles,
108 # (1) if the variable is set in `config.status', edit `config.status'
109 # (which will cause the Makefiles to be regenerated when you run `make');
110 # (2) otherwise, pass the desired values on the `make' command line.
111
112 @SET_MAKE@
113
114 all-recursive install-data-recursive install-exec-recursive \
115 installdirs-recursive install-recursive uninstall-recursive \
116 check-recursive installcheck-recursive info-recursive dvi-recursive:
117 @set fnord $(MAKEFLAGS); amf=$$2; \
118 dot_seen=no; \
119 target=`echo $@ | sed s/-recursive//`; \
120 list='$(SUBDIRS)'; for subdir in $$list; do \
121 echo "Making $$target in $$subdir"; \
122 if test "$$subdir" = "."; then \
123 dot_seen=yes; \
124 local_target="$$target-am"; \
125 else \
126 local_target="$$target"; \
127 fi; \
128 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
129 || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
130 done; \
131 if test "$$dot_seen" = "no"; then \
132 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
133 fi; test -z "$$fail"
134
135 mostlyclean-recursive clean-recursive distclean-recursive \
136 maintainer-clean-recursive:
137 @set fnord $(MAKEFLAGS); amf=$$2; \
138 dot_seen=no; \
139 rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
140 rev="$$subdir $$rev"; \
141 test "$$subdir" = "." && dot_seen=yes; \
142 done; \
143 test "$$dot_seen" = "no" && rev=". $$rev"; \
144 target=`echo $@ | sed s/-recursive//`; \
145 for subdir in $$rev; do \
146 echo "Making $$target in $$subdir"; \
147 if test "$$subdir" = "."; then \
148 local_target="$$target-am"; \
149 else \
150 local_target="$$target"; \
151 fi; \
152 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
153 || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
154 done && test -z "$$fail"
155 tags-recursive:
156 list='$(SUBDIRS)'; for subdir in $$list; do \
157 test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
158 done
159
160 tags: TAGS
161
162 ID: $(HEADERS) $(SOURCES) $(LISP)
163 list='$(SOURCES) $(HEADERS)'; \
164 unique=`for i in $$list; do echo $$i; done | \
165 awk ' { files[$$0] = 1; } \
166 END { for (i in files) print i; }'`; \
167 here=`pwd` && cd $(srcdir) \
168 && mkid -f$$here/ID $$unique $(LISP)
169
170 TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
171 tags=; \
172 here=`pwd`; \
173 list='$(SUBDIRS)'; for subdir in $$list; do \
174 if test "$$subdir" = .; then :; else \
175 test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
176 fi; \
177 done; \
178 list='$(SOURCES) $(HEADERS)'; \
179 unique=`for i in $$list; do echo $$i; done | \
180 awk ' { files[$$0] = 1; } \
181 END { for (i in files) print i; }'`; \
182 test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
183 || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
184
185 mostlyclean-tags:
186
187 clean-tags:
188
189 distclean-tags:
190 -rm -f TAGS ID
191
192 maintainer-clean-tags:
193 top_distdir = $(distdir)
194
195 # This target untars the dist file and tries a VPATH configuration. Then
196 # it guarantees that the distribution is self-contained by making another
197 # tarfile.
198 distcheck: dist
199 -rm -rf $(distdir)
200 GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
201 mkdir $(distdir)/=build
202 mkdir $(distdir)/=inst
203 dc_install_base=`cd $(distdir)/=inst && pwd`; \
204 cd $(distdir)/=build \
205 && ../configure --srcdir=.. --prefix=$$dc_install_base \
206 && $(MAKE) $(AM_MAKEFLAGS) \
207 && $(MAKE) $(AM_MAKEFLAGS) dvi \
208 && $(MAKE) $(AM_MAKEFLAGS) check \
209 && $(MAKE) $(AM_MAKEFLAGS) install \
210 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
211 && $(MAKE) $(AM_MAKEFLAGS) dist
212 -rm -rf $(distdir)
213 @banner="$(distdir).tar.gz is ready for distribution"; \
214 dashes=`echo "$$banner" | sed s/./=/g`; \
215 echo "$$dashes"; \
216 echo "$$banner"; \
217 echo "$$dashes"
218 dist: distdir
219 -chmod -R a+r $(distdir)
220 GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
221 -rm -rf $(distdir)
222 dist-all: distdir
223 -chmod -R a+r $(distdir)
224 GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
225 -rm -rf $(distdir)
226 distdir: $(DISTFILES)
227 -rm -rf $(distdir)
228 mkdir $(distdir)
229 -chmod 777 $(distdir)
230 @for file in $(DISTFILES); do \
231 d=$(srcdir); \
232 if test -d $$d/$$file; then \
233 cp -pr $$d/$$file $(distdir)/$$file; \
234 else \
235 test -f $(distdir)/$$file \
236 || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
237 || cp -p $$d/$$file $(distdir)/$$file || :; \
238 fi; \
239 done
240 for subdir in $(SUBDIRS); do \
241 if test "$$subdir" = .; then :; else \
242 test -d $(distdir)/$$subdir \
243 || mkdir $(distdir)/$$subdir \
244 || exit 1; \
245 chmod 777 $(distdir)/$$subdir; \
246 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
247 || exit 1; \
248 fi; \
249 done
250 info-am:
251 info: info-recursive
252 dvi-am:
253 dvi: dvi-recursive
254 check-am: all-am
255 check: check-recursive
256 installcheck-am:
257 installcheck: installcheck-recursive
258 install-exec-am:
259 install-exec: install-exec-recursive
260
261 install-data-am:
262 install-data: install-data-recursive
263
264 install-am: all-am
265 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
266 install: install-recursive
267 uninstall-am:
268 uninstall: uninstall-recursive
269 all-am: Makefile
270 all-redirect: all-recursive
271 install-strip:
272 $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
273 installdirs: installdirs-recursive
274 installdirs-am:
275
276
277 mostlyclean-generic:
278
279 clean-generic:
280
281 distclean-generic:
282 -rm -f Makefile $(CONFIG_CLEAN_FILES)
283 -rm -f config.cache config.log stamp-h stamp-h[0-9]*
284
285 maintainer-clean-generic:
286 mostlyclean-am: mostlyclean-tags mostlyclean-generic
287
288 mostlyclean: mostlyclean-recursive
289
290 clean-am: clean-tags clean-generic mostlyclean-am
291
292 clean: clean-recursive
293
294 distclean-am: distclean-tags distclean-generic clean-am
295
296 distclean: distclean-recursive
297 -rm -f config.status
298
299 maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
300 distclean-am
301 @echo "This command is intended for maintainers to use;"
302 @echo "it deletes files that may require special tools to rebuild."
303
304 maintainer-clean: maintainer-clean-recursive
305 -rm -f config.status
306
307 .PHONY: install-data-recursive uninstall-data-recursive \
308 install-exec-recursive uninstall-exec-recursive installdirs-recursive \
309 uninstalldirs-recursive all-recursive check-recursive \
310 installcheck-recursive info-recursive dvi-recursive \
311 mostlyclean-recursive distclean-recursive clean-recursive \
312 maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
313 distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
314 dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
315 install-exec install-data-am install-data install-am install \
316 uninstall-am uninstall all-redirect all-am all installdirs-am \
317 installdirs mostlyclean-generic distclean-generic clean-generic \
318 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
319
320
321 # Tell versions [3.59,3.63) of GNU make to not export all variables.
322 # Otherwise a system limit (for SysV at least) may be exceeded.
323 .NOEXPORT:
+196
-0
NEWS less more
0 Version 1.45
1 -fixed crash-after-racer-selection bug. I can't understand why this bug
2 didn't cause a crash on my computer...
3
4 Version 1.44
5 -2 new levels
6 -better balanced racers
7 -changed the URL on the help screen
8 -fixed "time boni are gone forever" bug
9
10 Version 1.??
11 -new aclocal file (fixes compilation on arm)
12
13 Version 1.43
14 -no SDL_mixer included
15 -command line help
16 -changed command line options
17 -new option: no fadeout for slow computers
18 -fixed a bug concerning wrong video flags
19
20 Version 1.42
21 -game now easier (some smaller changes)
22 -other changes?? (I deleted changelog... ooops!)
23 -now using SDL>=1.1.5 (including a bug workaround)
24 -hiscore bug finally fixed
25
26 Version 1.4
27 -the highscore list is shown properly after the name has been entered
28 -the lasers are now animated
29 -messages like "crashed" are displayed until all particles have disappeared
30 -the shot leave the cannon more precisely
31 -a new level
32 -the racer can move closer to the edges of the screen
33 -changed some tile graphics
34 -new timeout picture
35 -new scoring system
36 -changed collision code (I hope it's better...)
37 -fixed a small update bug (nothing serious)
38 -fixed a bug in the racer selection menu
39 -bumprace uses always 16 bpp again, cause there are some problems with 8bpp
40
41 Version 1.3
42 -now using input from sdl-config for configure
43 -configure now checks for mathlib (-lm), too, if it is needed
44 -bumprace can now be installed anywhere
45 -the version number, which is displayed at startup, changes automatically
46 -the last version installed an unneccessary header file -> fixed
47 -removed a timeout bug when playing two times without quitting
48 -music is faded out when quitting
49 -removed some other bugs when played two times
50 -added highscore list
51 -now using SFont for fonts output
52 -using the gfx.cpp of penguin-command which makes coding easier for me
53 and it has also better error checking.
54 -the particles are much better now.
55 -there's a frame limit now.
56 -a BumpRace Version without mixer is available
57 -changed the special key to left ctrl for player 2
58 -new images for "crashed" and "level completed"
59 -BumpRace can now run in any color depth, and uses the color depth of the
60 X-server
61 -some new tiles
62 -png support
63
64 Version 1.2
65 -fixed a bug in 2p team mode (the game didn't terminate after the timeout)
66 -reduced the time between crashing and the crash sound by decreasing the
67 chunk size.
68 -repaired wrong output when the sound is turned off due a used device
69 -fixed a bug in HandleShots() that could cause BumpRace to crash when
70 the free CPU time for BumpRace is very low.
71 -fixed a bug that caused the racer selction to be skipped on fast computers
72 -added a quit button to the main menu. The game now returns to the main
73 menu after the scoring.
74 -moved the menus to menu.c
75 -level numbers are displayed again (was a bug in 1.1)
76 -the cannon is now displayed correctly
77 -reduced cannon's turn speed
78 -added a fullscreen fade after the scoring. This is very slow under Linux,
79 but this will be better with XFree 4, when hardware acceleration is ready.
80 -added configure/automake/autoconf support. This is not prefect yet, but
81 I'm still working on it
82 -modified LoadImage() to search for the graphic files in different
83 directories
84 -modified the sound and font loading to use the path selected by LoadImage
85 -modified the README file, deleted README-SOURCE and created NEWS,AUTHORS
86 and INSTALL files
87 -better directory stucture
88 -fullscreen mode is default now, cause the new SDL fullscreen code works
89 perfect.
90 -configure now checks for the needed libs and allows "make install"
91 -the points hasn't been displayed correctly in competition mode. fixed.
92 -now using SDL_Mixer 1.0.4
93
94 Version 1.1
95 -moved some gfx functions into gfx.c
96 -added jpg support
97 -all loaded images are converted to the pixel format of the screen surface.
98 This should speed up bumprace and increase the image quality.
99 -added some startup output
100 -BumpRace is now using a backbuffer. This increases the memory usage but it
101 makes a lot of programming easier and faster.
102 -some pics are converted to jpg -> smaller download
103 -BumpRace doesn't quit when it can't find a sound device, now it just turns
104 the sound off
105 -The time display is now labelled with "TIME LEFT" and the time decreases
106 from the sides to the middle
107 -You can quit BumpRace now by pressing the close button of your window manager
108 -moved the particle code to particles.c
109 -added the most complex obstacle: the cannon! This makes the game much more
110 interesting IMO.
111 -Racer are now handled very similar to shots and particles. This allows
112 multiple racers, and eleminates some reasons for flickering.
113 -yet another background
114 -added two new game modes: 2player teamwork and 2player competition
115 -added a nice menu for selecting the game mode
116 -the startup message (This is free software...) is now faded in and out.
117 -added simple scoring
118
119 Version 1.00
120 -4 more levels (now 14).
121 -added output "You have completed ?? levels". Windows users won't be able to
122 see this, cause this appears in the shell after the game.
123 -added tree levels (now 17)that were done by Stephan. Thanks!
124 -added lasers (obstacles that switch on and off)
125 -other background
126 -encapsulated the particle routines into the "correct" functions.
127 -fixes a particle removing bug over transparent surfaces
128 -added email/web adresses to the credits
129 -added racer info to the menu
130 -the data is loaded while displaying the title screen -> faster startup
131 -added a new racer
132 -added the "sticky" ability
133 -improved collision
134 -time is only updated when the change is visible
135 -time can now show a wider range of time
136 -got timidity out of the sound system -> smaller package
137
138 Version 0.90
139 -fixed the "quickstart bug" again :-)
140 -now using SDL 0.10.0
141 -added short command line parameters. The old ones start with -- now.
142 -added particle effects ( thanks Lion! )
143 -added new sound effects
144 -fixed time display bug
145
146 Version 0.80
147 -fixed the "quick start" bug
148 -added help (and credits) screen
149 -added a fadeout after every crash and the timeout
150 -added fps counter (-fps , but it shows a very high value, so I'm not sure
151 if that's correct: On my Cyrix200 it does 170fps!)
152 -new 3D-Logo
153 -added the "real" auto-slowdown ablility
154 -added gravity
155 -put racer abilities into variables
156 -one new level with gravity
157 -rendered new racer graphics, now with 18 pics for a smoother rotation
158 Is anyone interested in the .blend files?
159 -now 3 racers are available
160 -added racer ability extra_time. This is the percentage of extra time at the
161 beginning of the game
162 -new graphic for the info board
163 -lifetime if now displayed as a colored bar decreasing from green to red
164
165 Version 0.70:
166 -fonts are now blitted correctly
167 -random level select
168 -more levels (now 11)
169 -bonus time for every completed level
170 -collision rewritten
171 -moved the levels to the file "levels.h"
172 -new background(s)
173 -added the output "This is free software..." like recommended.
174
175 Version 0.60:
176 -added timeout
177 -added (terrible) fonts
178 -better (but still flickering and buggy) fullscreen mode
179 -fixed some bugs
180 -added music: 22khz, 16bit, stereo!
181 -added sound effect(s)
182 -BumpRace is now available under the GNU General Public License version 2.
183 -added command line parameter
184 -added three levels
185
186 Version 0.45:
187 -one speed on all systems
188 -cleaned up the source
189 -title screen
190 -smaller background ( 144 KB )
191 -added one level
192
193 ------------------------------------< BUGS >------------------------------------
194
195 no known bugs -> please mail any bug reports to karlb@gmx.net
0
1 --------------------------------< BumpRace >------------------------------------
2
3 BumpRace is a simple arcade game. I'd like to receive a lot of comments and
4 suggestions. You can get the newest version of BumpRace at:
5 http://members.linuxstart.com/~karlb/
6 And you can reach me via e-mail:
7 karlb@gmx.net
8
9 Keys:
10 PLAYER 1
11 <arrow keys> moving
12 <right control> special ability
13
14 PLAYER 2
15 <a> left
16 <d> right
17 <w> thrust
18 <left control> special ability
19
20 To run this, you need the SDL-library. If you don't have it, get it from:
21 http://www.devolution.com/~slouken/SDL/
22
23 -----------------------------< RACER ABILITIES >--------------------------------
24
25 UFO-Racer: slows down automatically
26 V-Shaped-Racer: has 10% extra time
27 Rocket-Racer: press control for extra speed
28 Last Racer: press control to stick to walls
29
30 --------------------------------< PARAMETER >-----------------------------------
31
32 "--nofullscreen" "-f" guess
33 "--nosound" "-s" guess again
34 "--notfinal" "-n" no title screen (nice for develolopers)
35 "--noparticles" "-t" turns of paticles. good for slow computers.
36 "--pageflip" "-p" flicker-free fullscreen, slow and extremly buggy
37 "--precision [value]" sets the precison of the collisions (default=10)
38 using this is not recommended
39
40 ---------------------------------< LICENSE >------------------------------------
41
42 This game is available under the GNU General Public License version 2.
43 See COPYING for details.
44
0 # Configure paths for SDL
1 # Sam Lantinga 9/21/99
2 # stolen from Manish Singh
3 # stolen back from Frank Belew
4 # stolen from Manish Singh
5 # Shamelessly stolen from Owen Taylor
6
7 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
8 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
9 dnl
10 AC_DEFUN(AM_PATH_SDL,
11 [dnl
12 dnl Get the cflags and libraries from the sdl-config script
13 dnl
14 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
15 sdl_prefix="$withval", sdl_prefix="")
16 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
17 sdl_exec_prefix="$withval", sdl_exec_prefix="")
18 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
19 , enable_sdltest=yes)
20
21 if test x$sdl_exec_prefix != x ; then
22 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
23 if test x${SDL_CONFIG+set} != xset ; then
24 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
25 fi
26 fi
27 if test x$sdl_prefix != x ; then
28 sdl_args="$sdl_args --prefix=$sdl_prefix"
29 if test x${SDL_CONFIG+set} != xset ; then
30 SDL_CONFIG=$sdl_prefix/bin/sdl-config
31 fi
32 fi
33
34 AC_REQUIRE([AC_CANONICAL_TARGET])
35 AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
36 min_sdl_version=ifelse([$1], ,0.11.0,$1)
37 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
38 no_sdl=""
39 if test "$SDL_CONFIG" = "no" ; then
40 no_sdl=yes
41 else
42 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
43 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
44
45 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
46 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
47 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
48 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
49 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
50 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
51 if test "x$enable_sdltest" = "xyes" ; then
52 ac_save_CFLAGS="$CFLAGS"
53 ac_save_LIBS="$LIBS"
54 CFLAGS="$CFLAGS $SDL_CFLAGS"
55 LIBS="$LIBS $SDL_LIBS"
56 dnl
57 dnl Now check if the installed SDL is sufficiently new. (Also sanity
58 dnl checks the results of sdl-config to some extent
59 dnl
60 rm -f conf.sdltest
61 AC_TRY_RUN([
62 #include <stdio.h>
63 #include <stdlib.h>
64 #include <string.h>
65 #include "SDL.h"
66
67 char*
68 my_strdup (char *str)
69 {
70 char *new_str;
71
72 if (str)
73 {
74 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
75 strcpy (new_str, str);
76 }
77 else
78 new_str = NULL;
79
80 return new_str;
81 }
82
83 int main (int argc, char *argv[])
84 {
85 int major, minor, micro;
86 char *tmp_version;
87
88 /* This hangs on some systems (?)
89 system ("touch conf.sdltest");
90 */
91 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
92
93 /* HP/UX 9 (%@#!) writes to sscanf strings */
94 tmp_version = my_strdup("$min_sdl_version");
95 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
96 printf("%s, bad version string\n", "$min_sdl_version");
97 exit(1);
98 }
99
100 if (($sdl_major_version > major) ||
101 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
102 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
103 {
104 return 0;
105 }
106 else
107 {
108 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
109 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
110 printf("*** best to upgrade to the required version.\n");
111 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
112 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
113 printf("*** config.cache before re-running configure\n");
114 return 1;
115 }
116 }
117
118 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
119 CFLAGS="$ac_save_CFLAGS"
120 LIBS="$ac_save_LIBS"
121 fi
122 fi
123 if test "x$no_sdl" = x ; then
124 AC_MSG_RESULT(yes)
125 ifelse([$2], , :, [$2])
126 else
127 AC_MSG_RESULT(no)
128 if test "$SDL_CONFIG" = "no" ; then
129 echo "*** The sdl-config script installed by SDL could not be found"
130 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
131 echo "*** your path, or set the SDL_CONFIG environment variable to the"
132 echo "*** full path to sdl-config."
133 else
134 if test -f conf.sdltest ; then
135 :
136 else
137 echo "*** Could not run SDL test program, checking why..."
138 CFLAGS="$CFLAGS $SDL_CFLAGS"
139 LIBS="$LIBS $SDL_LIBS"
140 AC_TRY_LINK([
141 #include <stdio.h>
142 #include "SDL.h"
143
144 int main(int argc, char *argv[])
145 { return 0; }
146 #undef main
147 #define main K_and_R_C_main
148 ], [ return 0; ],
149 [ echo "*** The test program compiled, but did not run. This usually means"
150 echo "*** that the run-time linker is not finding SDL or finding the wrong"
151 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
152 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
153 echo "*** to the installed location Also, make sure you have run ldconfig if that"
154 echo "*** is required on your system"
155 echo "***"
156 echo "*** If you have an old version installed, it is best to remove it, although"
157 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
158 [ echo "*** The test program failed to compile or link. See the file config.log for the"
159 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
160 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
161 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
162 CFLAGS="$ac_save_CFLAGS"
163 LIBS="$ac_save_LIBS"
164 fi
165 fi
166 SDL_CFLAGS=""
167 SDL_LIBS=""
168 ifelse([$3], , :, [$3])
169 fi
170 AC_SUBST(SDL_CFLAGS)
171 AC_SUBST(SDL_LIBS)
172 rm -f conf.sdltest
173 ])
0 dnl aclocal.m4 generated automatically by aclocal 1.4-p4
1
2 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl This program is distributed in the hope that it will be useful,
8 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 dnl PARTICULAR PURPOSE.
11
12 # Configure paths for SDL
13 # Sam Lantinga 9/21/99
14 # stolen from Manish Singh
15 # stolen back from Frank Belew
16 # stolen from Manish Singh
17 # Shamelessly stolen from Owen Taylor
18
19 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
20 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
21 dnl
22 AC_DEFUN(AM_PATH_SDL,
23 [dnl
24 dnl Get the cflags and libraries from the sdl-config script
25 dnl
26 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
27 sdl_prefix="$withval", sdl_prefix="")
28 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
29 sdl_exec_prefix="$withval", sdl_exec_prefix="")
30 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
31 , enable_sdltest=yes)
32
33 if test x$sdl_exec_prefix != x ; then
34 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
35 if test x${SDL_CONFIG+set} != xset ; then
36 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
37 fi
38 fi
39 if test x$sdl_prefix != x ; then
40 sdl_args="$sdl_args --prefix=$sdl_prefix"
41 if test x${SDL_CONFIG+set} != xset ; then
42 SDL_CONFIG=$sdl_prefix/bin/sdl-config
43 fi
44 fi
45
46 AC_REQUIRE([AC_CANONICAL_TARGET])
47 AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
48 min_sdl_version=ifelse([$1], ,0.11.0,$1)
49 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
50 no_sdl=""
51 if test "$SDL_CONFIG" = "no" ; then
52 no_sdl=yes
53 else
54 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
55 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
56
57 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
58 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
59 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
60 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
61 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
62 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
63 if test "x$enable_sdltest" = "xyes" ; then
64 ac_save_CFLAGS="$CFLAGS"
65 ac_save_LIBS="$LIBS"
66 CFLAGS="$CFLAGS $SDL_CFLAGS"
67 LIBS="$LIBS $SDL_LIBS"
68 dnl
69 dnl Now check if the installed SDL is sufficiently new. (Also sanity
70 dnl checks the results of sdl-config to some extent
71 dnl
72 rm -f conf.sdltest
73 AC_TRY_RUN([
74 #include <stdio.h>
75 #include <stdlib.h>
76 #include <string.h>
77 #include "SDL.h"
78
79 char*
80 my_strdup (char *str)
81 {
82 char *new_str;
83
84 if (str)
85 {
86 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
87 strcpy (new_str, str);
88 }
89 else
90 new_str = NULL;
91
92 return new_str;
93 }
94
95 int main (int argc, char *argv[])
96 {
97 int major, minor, micro;
98 char *tmp_version;
99
100 /* This hangs on some systems (?)
101 system ("touch conf.sdltest");
102 */
103 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
104
105 /* HP/UX 9 (%@#!) writes to sscanf strings */
106 tmp_version = my_strdup("$min_sdl_version");
107 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
108 printf("%s, bad version string\n", "$min_sdl_version");
109 exit(1);
110 }
111
112 if (($sdl_major_version > major) ||
113 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
114 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
115 {
116 return 0;
117 }
118 else
119 {
120 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
121 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
122 printf("*** best to upgrade to the required version.\n");
123 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
124 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
125 printf("*** config.cache before re-running configure\n");
126 return 1;
127 }
128 }
129
130 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
131 CFLAGS="$ac_save_CFLAGS"
132 LIBS="$ac_save_LIBS"
133 fi
134 fi
135 if test "x$no_sdl" = x ; then
136 AC_MSG_RESULT(yes)
137 ifelse([$2], , :, [$2])
138 else
139 AC_MSG_RESULT(no)
140 if test "$SDL_CONFIG" = "no" ; then
141 echo "*** The sdl-config script installed by SDL could not be found"
142 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
143 echo "*** your path, or set the SDL_CONFIG environment variable to the"
144 echo "*** full path to sdl-config."
145 else
146 if test -f conf.sdltest ; then
147 :
148 else
149 echo "*** Could not run SDL test program, checking why..."
150 CFLAGS="$CFLAGS $SDL_CFLAGS"
151 LIBS="$LIBS $SDL_LIBS"
152 AC_TRY_LINK([
153 #include <stdio.h>
154 #include "SDL.h"
155
156 int main(int argc, char *argv[])
157 { return 0; }
158 #undef main
159 #define main K_and_R_C_main
160 ], [ return 0; ],
161 [ echo "*** The test program compiled, but did not run. This usually means"
162 echo "*** that the run-time linker is not finding SDL or finding the wrong"
163 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
164 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
165 echo "*** to the installed location Also, make sure you have run ldconfig if that"
166 echo "*** is required on your system"
167 echo "***"
168 echo "*** If you have an old version installed, it is best to remove it, although"
169 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
170 [ echo "*** The test program failed to compile or link. See the file config.log for the"
171 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
172 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
173 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
174 CFLAGS="$ac_save_CFLAGS"
175 LIBS="$ac_save_LIBS"
176 fi
177 fi
178 SDL_CFLAGS=""
179 SDL_LIBS=""
180 ifelse([$3], , :, [$3])
181 fi
182 AC_SUBST(SDL_CFLAGS)
183 AC_SUBST(SDL_LIBS)
184 rm -f conf.sdltest
185 ])
186
187 # Define a conditional.
188
189 AC_DEFUN(AM_CONDITIONAL,
190 [AC_SUBST($1_TRUE)
191 AC_SUBST($1_FALSE)
192 if $2; then
193 $1_TRUE=
194 $1_FALSE='#'
195 else
196 $1_TRUE='#'
197 $1_FALSE=
198 fi])
199
200 # Do all the work for Automake. This macro actually does too much --
201 # some checks are only needed if your package does certain things.
202 # But this isn't really a big deal.
203
204 # serial 1
205
206 dnl Usage:
207 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
208
209 AC_DEFUN(AM_INIT_AUTOMAKE,
210 [AC_REQUIRE([AC_PROG_INSTALL])
211 PACKAGE=[$1]
212 AC_SUBST(PACKAGE)
213 VERSION=[$2]
214 AC_SUBST(VERSION)
215 dnl test to see if srcdir already configured
216 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
217 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
218 fi
219 ifelse([$3],,
220 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
221 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
222 AC_REQUIRE([AM_SANITY_CHECK])
223 AC_REQUIRE([AC_ARG_PROGRAM])
224 dnl FIXME This is truly gross.
225 missing_dir=`cd $ac_aux_dir && pwd`
226 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
227 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
228 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
229 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
230 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
231 AC_REQUIRE([AC_PROG_MAKE_SET])])
232
233 #
234 # Check to make sure that the build environment is sane.
235 #
236
237 AC_DEFUN(AM_SANITY_CHECK,
238 [AC_MSG_CHECKING([whether build environment is sane])
239 # Just in case
240 sleep 1
241 echo timestamp > conftestfile
242 # Do `set' in a subshell so we don't clobber the current shell's
243 # arguments. Must try -L first in case configure is actually a
244 # symlink; some systems play weird games with the mod time of symlinks
245 # (eg FreeBSD returns the mod time of the symlink's containing
246 # directory).
247 if (
248 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
249 if test "[$]*" = "X"; then
250 # -L didn't work.
251 set X `ls -t $srcdir/configure conftestfile`
252 fi
253 if test "[$]*" != "X $srcdir/configure conftestfile" \
254 && test "[$]*" != "X conftestfile $srcdir/configure"; then
255
256 # If neither matched, then we have a broken ls. This can happen
257 # if, for instance, CONFIG_SHELL is bash and it inherits a
258 # broken ls alias from the environment. This has actually
259 # happened. Such a system could not be considered "sane".
260 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
261 alias in your environment])
262 fi
263
264 test "[$]2" = conftestfile
265 )
266 then
267 # Ok.
268 :
269 else
270 AC_MSG_ERROR([newly created file is older than distributed files!
271 Check your system clock])
272 fi
273 rm -f conftest*
274 AC_MSG_RESULT(yes)])
275
276 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
277 dnl The program must properly implement --version.
278 AC_DEFUN(AM_MISSING_PROG,
279 [AC_MSG_CHECKING(for working $2)
280 # Run test in a subshell; some versions of sh will print an error if
281 # an executable is not found, even if stderr is redirected.
282 # Redirect stdin to placate older versions of autoconf. Sigh.
283 if ($2 --version) < /dev/null > /dev/null 2>&1; then
284 $1=$2
285 AC_MSG_RESULT(found)
286 else
287 $1="$3/missing $2"
288 AC_MSG_RESULT(missing)
289 fi
290 AC_SUBST($1)])
291
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
3 # Free Software Foundation, Inc.
4 #
5 # This file is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that program.
23
24 # Written by Per Bothner <bothner@cygnus.com>.
25 # The master version of this file is at the FSF in /home/gd/gnu/lib.
26 # Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
27 #
28 # This script attempts to guess a canonical system name similar to
29 # config.sub. If it succeeds, it prints the system name on stdout, and
30 # exits with 0. Otherwise, it exits with 1.
31 #
32 # The plan is that this can be called by configure scripts if you
33 # don't specify an explicit system type (host/target name).
34 #
35 # Only a few systems have been added to this list; please add others
36 # (but try to keep the structure clean).
37 #
38
39 # Use $HOST_CC if defined. $CC may point to a cross-compiler
40 if test x"$CC_FOR_BUILD" = x; then
41 if test x"$HOST_CC" != x; then
42 CC_FOR_BUILD="$HOST_CC"
43 else
44 if test x"$CC" != x; then
45 CC_FOR_BUILD="$CC"
46 else
47 CC_FOR_BUILD=cc
48 fi
49 fi
50 fi
51
52
53 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
54 # (ghazi@noc.rutgers.edu 8/24/94.)
55 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
56 PATH=$PATH:/.attbin ; export PATH
57 fi
58
59 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
60 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
61 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
62 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
63
64 dummy=dummy-$$
65 trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
66
67 # Note: order is significant - the case branches are not exclusive.
68
69 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
70 alpha:OSF1:*:*)
71 if test $UNAME_RELEASE = "V4.0"; then
72 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
73 fi
74 # A Vn.n version is a released version.
75 # A Tn.n version is a released field test version.
76 # A Xn.n version is an unreleased experimental baselevel.
77 # 1.2 uses "1.2" for uname -r.
78 cat <<EOF >$dummy.s
79 .globl main
80 .ent main
81 main:
82 .frame \$30,0,\$26,0
83 .prologue 0
84 .long 0x47e03d80 # implver $0
85 lda \$2,259
86 .long 0x47e20c21 # amask $2,$1
87 srl \$1,8,\$2
88 sll \$2,2,\$2
89 sll \$0,3,\$0
90 addl \$1,\$0,\$0
91 addl \$2,\$0,\$0
92 ret \$31,(\$26),1
93 .end main
94 EOF
95 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
96 if test "$?" = 0 ; then
97 ./$dummy
98 case "$?" in
99 7)
100 UNAME_MACHINE="alpha"
101 ;;
102 15)
103 UNAME_MACHINE="alphaev5"
104 ;;
105 14)
106 UNAME_MACHINE="alphaev56"
107 ;;
108 10)
109 UNAME_MACHINE="alphapca56"
110 ;;
111 16)
112 UNAME_MACHINE="alphaev6"
113 ;;
114 esac
115 fi
116 rm -f $dummy.s $dummy
117 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
118 exit 0 ;;
119 Alpha\ *:Windows_NT*:*)
120 # How do we know it's Interix rather than the generic POSIX subsystem?
121 # Should we change UNAME_MACHINE based on the output of uname instead
122 # of the specific Alpha model?
123 echo alpha-pc-interix
124 exit 0 ;;
125 21064:Windows_NT:50:3)
126 echo alpha-dec-winnt3.5
127 exit 0 ;;
128 Amiga*:UNIX_System_V:4.0:*)
129 echo m68k-cbm-sysv4
130 exit 0;;
131 amiga:NetBSD:*:*)
132 echo m68k-cbm-netbsd${UNAME_RELEASE}
133 exit 0 ;;
134 amiga:OpenBSD:*:*)
135 echo m68k-unknown-openbsd${UNAME_RELEASE}
136 exit 0 ;;
137 *:[Aa]miga[Oo][Ss]:*:*)
138 echo ${UNAME_MACHINE}-unknown-amigaos
139 exit 0 ;;
140 arc64:OpenBSD:*:*)
141 echo mips64el-unknown-openbsd${UNAME_RELEASE}
142 exit 0 ;;
143 arc:OpenBSD:*:*)
144 echo mipsel-unknown-openbsd${UNAME_RELEASE}
145 exit 0 ;;
146 hkmips:OpenBSD:*:*)
147 echo mips-unknown-openbsd${UNAME_RELEASE}
148 exit 0 ;;
149 pmax:OpenBSD:*:*)
150 echo mipsel-unknown-openbsd${UNAME_RELEASE}
151 exit 0 ;;
152 sgi:OpenBSD:*:*)
153 echo mips-unknown-openbsd${UNAME_RELEASE}
154 exit 0 ;;
155 wgrisc:OpenBSD:*:*)
156 echo mipsel-unknown-openbsd${UNAME_RELEASE}
157 exit 0 ;;
158 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
159 echo arm-acorn-riscix${UNAME_RELEASE}
160 exit 0;;
161 arm32:NetBSD:*:*)
162 echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
163 exit 0 ;;
164 SR2?01:HI-UX/MPP:*:*)
165 echo hppa1.1-hitachi-hiuxmpp
166 exit 0;;
167 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
168 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
169 if test "`(/bin/universe) 2>/dev/null`" = att ; then
170 echo pyramid-pyramid-sysv3
171 else
172 echo pyramid-pyramid-bsd
173 fi
174 exit 0 ;;
175 NILE*:*:*:dcosx)
176 echo pyramid-pyramid-svr4
177 exit 0 ;;
178 sun4H:SunOS:5.*:*)
179 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
180 exit 0 ;;
181 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
182 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
183 exit 0 ;;
184 i86pc:SunOS:5.*:*)
185 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
186 exit 0 ;;
187 sun4*:SunOS:6*:*)
188 # According to config.sub, this is the proper way to canonicalize
189 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
190 # it's likely to be more like Solaris than SunOS4.
191 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
192 exit 0 ;;
193 sun4*:SunOS:*:*)
194 case "`/usr/bin/arch -k`" in
195 Series*|S4*)
196 UNAME_RELEASE=`uname -v`
197 ;;
198 esac
199 # Japanese Language versions have a version number like `4.1.3-JL'.
200 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
201 exit 0 ;;
202 sun3*:SunOS:*:*)
203 echo m68k-sun-sunos${UNAME_RELEASE}
204 exit 0 ;;
205 sun*:*:4.2BSD:*)
206 UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
207 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
208 case "`/bin/arch`" in
209 sun3)
210 echo m68k-sun-sunos${UNAME_RELEASE}
211 ;;
212 sun4)
213 echo sparc-sun-sunos${UNAME_RELEASE}
214 ;;
215 esac
216 exit 0 ;;
217 aushp:SunOS:*:*)
218 echo sparc-auspex-sunos${UNAME_RELEASE}
219 exit 0 ;;
220 atari*:NetBSD:*:*)
221 echo m68k-atari-netbsd${UNAME_RELEASE}
222 exit 0 ;;
223 atari*:OpenBSD:*:*)
224 echo m68k-unknown-openbsd${UNAME_RELEASE}
225 exit 0 ;;
226 # The situation for MiNT is a little confusing. The machine name
227 # can be virtually everything (everything which is not
228 # "atarist" or "atariste" at least should have a processor
229 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
230 # to the lowercase version "mint" (or "freemint"). Finally
231 # the system name "TOS" denotes a system which is actually not
232 # MiNT. But MiNT is downward compatible to TOS, so this should
233 # be no problem.
234 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
235 echo m68k-atari-mint${UNAME_RELEASE}
236 exit 0 ;;
237 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
238 echo m68k-atari-mint${UNAME_RELEASE}
239 exit 0 ;;
240 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
241 echo m68k-atari-mint${UNAME_RELEASE}
242 exit 0 ;;
243 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
244 echo m68k-milan-mint${UNAME_RELEASE}
245 exit 0 ;;
246 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
247 echo m68k-hades-mint${UNAME_RELEASE}
248 exit 0 ;;
249 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
250 echo m68k-unknown-mint${UNAME_RELEASE}
251 exit 0 ;;
252 sun3*:NetBSD:*:*)
253 echo m68k-sun-netbsd${UNAME_RELEASE}
254 exit 0 ;;
255 sun3*:OpenBSD:*:*)
256 echo m68k-unknown-openbsd${UNAME_RELEASE}
257 exit 0 ;;
258 mac68k:NetBSD:*:*)
259 echo m68k-apple-netbsd${UNAME_RELEASE}
260 exit 0 ;;
261 mac68k:OpenBSD:*:*)
262 echo m68k-unknown-openbsd${UNAME_RELEASE}
263 exit 0 ;;
264 mvme68k:OpenBSD:*:*)
265 echo m68k-unknown-openbsd${UNAME_RELEASE}
266 exit 0 ;;
267 mvme88k:OpenBSD:*:*)
268 echo m88k-unknown-openbsd${UNAME_RELEASE}
269 exit 0 ;;
270 powerpc:machten:*:*)
271 echo powerpc-apple-machten${UNAME_RELEASE}
272 exit 0 ;;
273 macppc:NetBSD:*:*)
274 echo powerpc-apple-netbsd${UNAME_RELEASE}
275 exit 0 ;;
276 RISC*:Mach:*:*)
277 echo mips-dec-mach_bsd4.3
278 exit 0 ;;
279 RISC*:ULTRIX:*:*)
280 echo mips-dec-ultrix${UNAME_RELEASE}
281 exit 0 ;;
282 VAX*:ULTRIX*:*:*)
283 echo vax-dec-ultrix${UNAME_RELEASE}
284 exit 0 ;;
285 2020:CLIX:*:* | 2430:CLIX:*:*)
286 echo clipper-intergraph-clix${UNAME_RELEASE}
287 exit 0 ;;
288 mips:*:*:UMIPS | mips:*:*:RISCos)
289 sed 's/^ //' << EOF >$dummy.c
290 #ifdef __cplusplus
291 int main (int argc, char *argv[]) {
292 #else
293 int main (argc, argv) int argc; char *argv[]; {
294 #endif
295 #if defined (host_mips) && defined (MIPSEB)
296 #if defined (SYSTYPE_SYSV)
297 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
298 #endif
299 #if defined (SYSTYPE_SVR4)
300 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
301 #endif
302 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
303 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
304 #endif
305 #endif
306 exit (-1);
307 }
308 EOF
309 $CC_FOR_BUILD $dummy.c -o $dummy \
310 && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
311 && rm $dummy.c $dummy && exit 0
312 rm -f $dummy.c $dummy
313 echo mips-mips-riscos${UNAME_RELEASE}
314 exit 0 ;;
315 Night_Hawk:Power_UNIX:*:*)
316 echo powerpc-harris-powerunix
317 exit 0 ;;
318 m88k:CX/UX:7*:*)
319 echo m88k-harris-cxux7
320 exit 0 ;;
321 m88k:*:4*:R4*)
322 echo m88k-motorola-sysv4
323 exit 0 ;;
324 m88k:*:3*:R3*)
325 echo m88k-motorola-sysv3
326 exit 0 ;;
327 AViiON:dgux:*:*)
328 # DG/UX returns AViiON for all architectures
329 UNAME_PROCESSOR=`/usr/bin/uname -p`
330 if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
331 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
332 -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
333 echo m88k-dg-dgux${UNAME_RELEASE}
334 else
335 echo m88k-dg-dguxbcs${UNAME_RELEASE}
336 fi
337 else echo i586-dg-dgux${UNAME_RELEASE}
338 fi
339 exit 0 ;;
340 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
341 echo m88k-dolphin-sysv3
342 exit 0 ;;
343 M88*:*:R3*:*)
344 # Delta 88k system running SVR3
345 echo m88k-motorola-sysv3
346 exit 0 ;;
347 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
348 echo m88k-tektronix-sysv3
349 exit 0 ;;
350 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
351 echo m68k-tektronix-bsd
352 exit 0 ;;
353 *:IRIX*:*:*)
354 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
355 exit 0 ;;
356 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
357 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
358 exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
359 i?86:AIX:*:*)
360 echo i386-ibm-aix
361 exit 0 ;;
362 *:AIX:2:3)
363 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
364 sed 's/^ //' << EOF >$dummy.c
365 #include <sys/systemcfg.h>
366
367 main()
368 {
369 if (!__power_pc())
370 exit(1);
371 puts("powerpc-ibm-aix3.2.5");
372 exit(0);
373 }
374 EOF
375 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
376 rm -f $dummy.c $dummy
377 echo rs6000-ibm-aix3.2.5
378 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
379 echo rs6000-ibm-aix3.2.4
380 else
381 echo rs6000-ibm-aix3.2
382 fi
383 exit 0 ;;
384 *:AIX:*:4)
385 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
386 if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
387 IBM_ARCH=rs6000
388 else
389 IBM_ARCH=powerpc
390 fi
391 if [ -x /usr/bin/oslevel ] ; then
392 IBM_REV=`/usr/bin/oslevel`
393 else
394 IBM_REV=4.${UNAME_RELEASE}
395 fi
396 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
397 exit 0 ;;
398 *:AIX:*:*)
399 echo rs6000-ibm-aix
400 exit 0 ;;
401 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
402 echo romp-ibm-bsd4.4
403 exit 0 ;;
404 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
405 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
406 exit 0 ;; # report: romp-ibm BSD 4.3
407 *:BOSX:*:*)
408 echo rs6000-bull-bosx
409 exit 0 ;;
410 DPX/2?00:B.O.S.:*:*)
411 echo m68k-bull-sysv3
412 exit 0 ;;
413 9000/[34]??:4.3bsd:1.*:*)
414 echo m68k-hp-bsd
415 exit 0 ;;
416 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
417 echo m68k-hp-bsd4.4
418 exit 0 ;;
419 9000/[34678]??:HP-UX:*:*)
420 case "${UNAME_MACHINE}" in
421 9000/31? ) HP_ARCH=m68000 ;;
422 9000/[34]?? ) HP_ARCH=m68k ;;
423 9000/[678][0-9][0-9])
424 sed 's/^ //' << EOF >$dummy.c
425 #include <stdlib.h>
426 #include <unistd.h>
427
428 int main ()
429 {
430 #if defined(_SC_KERNEL_BITS)
431 long bits = sysconf(_SC_KERNEL_BITS);
432 #endif
433 long cpu = sysconf (_SC_CPU_VERSION);
434
435 switch (cpu)
436 {
437 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
438 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
439 case CPU_PA_RISC2_0:
440 #if defined(_SC_KERNEL_BITS)
441 switch (bits)
442 {
443 case 64: puts ("hppa2.0w"); break;
444 case 32: puts ("hppa2.0n"); break;
445 default: puts ("hppa2.0"); break;
446 } break;
447 #else /* !defined(_SC_KERNEL_BITS) */
448 puts ("hppa2.0"); break;
449 #endif
450 default: puts ("hppa1.0"); break;
451 }
452 exit (0);
453 }
454 EOF
455 ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
456 rm -f $dummy.c $dummy
457 esac
458 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
459 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
460 exit 0 ;;
461 3050*:HI-UX:*:*)
462 sed 's/^ //' << EOF >$dummy.c
463 #include <unistd.h>
464 int
465 main ()
466 {
467 long cpu = sysconf (_SC_CPU_VERSION);
468 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
469 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
470 results, however. */
471 if (CPU_IS_PA_RISC (cpu))
472 {
473 switch (cpu)
474 {
475 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
476 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
477 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
478 default: puts ("hppa-hitachi-hiuxwe2"); break;
479 }
480 }
481 else if (CPU_IS_HP_MC68K (cpu))
482 puts ("m68k-hitachi-hiuxwe2");
483 else puts ("unknown-hitachi-hiuxwe2");
484 exit (0);
485 }
486 EOF
487 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
488 rm -f $dummy.c $dummy
489 echo unknown-hitachi-hiuxwe2
490 exit 0 ;;
491 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
492 echo hppa1.1-hp-bsd
493 exit 0 ;;
494 9000/8??:4.3bsd:*:*)
495 echo hppa1.0-hp-bsd
496 exit 0 ;;
497 *9??*:MPE/iX:*:*)
498 echo hppa1.0-hp-mpeix
499 exit 0 ;;
500 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
501 echo hppa1.1-hp-osf
502 exit 0 ;;
503 hp8??:OSF1:*:*)
504 echo hppa1.0-hp-osf
505 exit 0 ;;
506 i?86:OSF1:*:*)
507 if [ -x /usr/sbin/sysversion ] ; then
508 echo ${UNAME_MACHINE}-unknown-osf1mk
509 else
510 echo ${UNAME_MACHINE}-unknown-osf1
511 fi
512 exit 0 ;;
513 parisc*:Lites*:*:*)
514 echo hppa1.1-hp-lites
515 exit 0 ;;
516 hppa*:OpenBSD:*:*)
517 echo hppa-unknown-openbsd
518 exit 0 ;;
519 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
520 echo c1-convex-bsd
521 exit 0 ;;
522 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
523 if getsysinfo -f scalar_acc
524 then echo c32-convex-bsd
525 else echo c2-convex-bsd
526 fi
527 exit 0 ;;
528 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
529 echo c34-convex-bsd
530 exit 0 ;;
531 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
532 echo c38-convex-bsd
533 exit 0 ;;
534 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
535 echo c4-convex-bsd
536 exit 0 ;;
537 CRAY*X-MP:*:*:*)
538 echo xmp-cray-unicos
539 exit 0 ;;
540 CRAY*Y-MP:*:*:*)
541 echo ymp-cray-unicos${UNAME_RELEASE}
542 exit 0 ;;
543 CRAY*[A-Z]90:*:*:*)
544 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
545 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
546 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
547 exit 0 ;;
548 CRAY*TS:*:*:*)
549 echo t90-cray-unicos${UNAME_RELEASE}
550 exit 0 ;;
551 CRAY*T3E:*:*:*)
552 echo t3e-cray-unicosmk${UNAME_RELEASE}
553 exit 0 ;;
554 CRAY-2:*:*:*)
555 echo cray2-cray-unicos
556 exit 0 ;;
557 F300:UNIX_System_V:*:*)
558 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
559 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
560 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
561 exit 0 ;;
562 F301:UNIX_System_V:*:*)
563 echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
564 exit 0 ;;
565 hp3[0-9][05]:NetBSD:*:*)
566 echo m68k-hp-netbsd${UNAME_RELEASE}
567 exit 0 ;;
568 hp300:OpenBSD:*:*)
569 echo m68k-unknown-openbsd${UNAME_RELEASE}
570 exit 0 ;;
571 i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
572 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
573 exit 0 ;;
574 sparc*:BSD/OS:*:*)
575 echo sparc-unknown-bsdi${UNAME_RELEASE}
576 exit 0 ;;
577 *:BSD/OS:*:*)
578 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
579 exit 0 ;;
580 *:FreeBSD:*:*)
581 if test -x /usr/bin/objformat; then
582 if test "elf" = "`/usr/bin/objformat`"; then
583 echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
584 exit 0
585 fi
586 fi
587 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
588 exit 0 ;;
589 *:NetBSD:*:*)
590 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
591 exit 0 ;;
592 *:OpenBSD:*:*)
593 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
594 exit 0 ;;
595 i*:CYGWIN*:*)
596 echo ${UNAME_MACHINE}-pc-cygwin
597 exit 0 ;;
598 i*:MINGW*:*)
599 echo ${UNAME_MACHINE}-pc-mingw32
600 exit 0 ;;
601 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
602 # How do we know it's Interix rather than the generic POSIX subsystem?
603 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
604 # UNAME_MACHINE based on the output of uname instead of i386?
605 echo i386-pc-interix
606 exit 0 ;;
607 i*:UWIN*:*)
608 echo ${UNAME_MACHINE}-pc-uwin
609 exit 0 ;;
610 p*:CYGWIN*:*)
611 echo powerpcle-unknown-cygwin
612 exit 0 ;;
613 prep*:SunOS:5.*:*)
614 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
615 exit 0 ;;
616 *:GNU:*:*)
617 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
618 exit 0 ;;
619 *:Linux:*:*)
620 # uname on the ARM produces all sorts of strangeness, and we need to
621 # filter it out.
622 case "$UNAME_MACHINE" in
623 armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
624 arm* | sa110*) UNAME_MACHINE="arm" ;;
625 esac
626
627 # The BFD linker knows what the default object file format is, so
628 # first see if it will tell us. cd to the root directory to prevent
629 # problems with other programs or directories called `ld' in the path.
630 ld_help_string=`cd /; ld --help 2>&1`
631 ld_supported_emulations=`echo $ld_help_string \
632 | sed -ne '/supported emulations:/!d
633 s/[ ][ ]*/ /g
634 s/.*supported emulations: *//
635 s/ .*//
636 p'`
637 case "$ld_supported_emulations" in
638 i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
639 i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
640 sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
641 armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
642 m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
643 elf32ppc)
644 # Determine Lib Version
645 cat >$dummy.c <<EOF
646 #include <features.h>
647 #if defined(__GLIBC__)
648 extern char __libc_version[];
649 extern char __libc_release[];
650 #endif
651 main(argc, argv)
652 int argc;
653 char *argv[];
654 {
655 #if defined(__GLIBC__)
656 printf("%s %s\n", __libc_version, __libc_release);
657 #else
658 printf("unkown\n");
659 #endif
660 return 0;
661 }
662 EOF
663 LIBC=""
664 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
665 if test "$?" = 0 ; then
666 ./$dummy | grep 1\.99 > /dev/null
667 if test "$?" = 0 ; then
668 LIBC="libc1"
669 fi
670 fi
671 rm -f $dummy.c $dummy
672 echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
673 esac
674
675 if test "${UNAME_MACHINE}" = "alpha" ; then
676 sed 's/^ //' <<EOF >$dummy.s
677 .globl main
678 .ent main
679 main:
680 .frame \$30,0,\$26,0
681 .prologue 0
682 .long 0x47e03d80 # implver $0
683 lda \$2,259
684 .long 0x47e20c21 # amask $2,$1
685 srl \$1,8,\$2
686 sll \$2,2,\$2
687 sll \$0,3,\$0
688 addl \$1,\$0,\$0
689 addl \$2,\$0,\$0
690 ret \$31,(\$26),1
691 .end main
692 EOF
693 LIBC=""
694 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
695 if test "$?" = 0 ; then
696 ./$dummy
697 case "$?" in
698 7)
699 UNAME_MACHINE="alpha"
700 ;;
701 15)
702 UNAME_MACHINE="alphaev5"
703 ;;
704 14)
705 UNAME_MACHINE="alphaev56"
706 ;;
707 10)
708 UNAME_MACHINE="alphapca56"
709 ;;
710 16)
711 UNAME_MACHINE="alphaev6"
712 ;;
713 esac
714
715 objdump --private-headers $dummy | \
716 grep ld.so.1 > /dev/null
717 if test "$?" = 0 ; then
718 LIBC="libc1"
719 fi
720 fi
721 rm -f $dummy.s $dummy
722 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
723 elif test "${UNAME_MACHINE}" = "mips" ; then
724 cat >$dummy.c <<EOF
725 #ifdef __cplusplus
726 int main (int argc, char *argv[]) {
727 #else
728 int main (argc, argv) int argc; char *argv[]; {
729 #endif
730 #ifdef __MIPSEB__
731 printf ("%s-unknown-linux-gnu\n", argv[1]);
732 #endif
733 #ifdef __MIPSEL__
734 printf ("%sel-unknown-linux-gnu\n", argv[1]);
735 #endif
736 return 0;
737 }
738 EOF
739 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
740 rm -f $dummy.c $dummy
741 else
742 # Either a pre-BFD a.out linker (linux-gnuoldld)
743 # or one that does not give us useful --help.
744 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
745 # If ld does not provide *any* "supported emulations:"
746 # that means it is gnuoldld.
747 echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
748 test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
749
750 case "${UNAME_MACHINE}" in
751 i?86)
752 VENDOR=pc;
753 ;;
754 *)
755 VENDOR=unknown;
756 ;;
757 esac
758 # Determine whether the default compiler is a.out or elf
759 cat >$dummy.c <<EOF
760 #include <features.h>
761 #ifdef __cplusplus
762 int main (int argc, char *argv[]) {
763 #else
764 int main (argc, argv) int argc; char *argv[]; {
765 #endif
766 #ifdef __ELF__
767 # ifdef __GLIBC__
768 # if __GLIBC__ >= 2
769 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
770 # else
771 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
772 # endif
773 # else
774 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
775 # endif
776 #else
777 printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
778 #endif
779 return 0;
780 }
781 EOF
782 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
783 rm -f $dummy.c $dummy
784 fi ;;
785 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
786 # are messed up and put the nodename in both sysname and nodename.
787 i?86:DYNIX/ptx:4*:*)
788 echo i386-sequent-sysv4
789 exit 0 ;;
790 i?86:UNIX_SV:4.2MP:2.*)
791 # Unixware is an offshoot of SVR4, but it has its own version
792 # number series starting with 2...
793 # I am not positive that other SVR4 systems won't match this,
794 # I just have to hope. -- rms.
795 # Use sysv4.2uw... so that sysv4* matches it.
796 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
797 exit 0 ;;
798 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
799 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
800 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
801 else
802 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
803 fi
804 exit 0 ;;
805 i?86:*:5:7*)
806 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
807 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
808 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
809 (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
810 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
811 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
812 exit 0 ;;
813 i?86:*:3.2:*)
814 if test -f /usr/options/cb.name; then
815 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
816 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
817 elif /bin/uname -X 2>/dev/null >/dev/null ; then
818 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
819 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
820 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
821 && UNAME_MACHINE=i586
822 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
823 && UNAME_MACHINE=i686
824 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
825 && UNAME_MACHINE=i686
826 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
827 else
828 echo ${UNAME_MACHINE}-pc-sysv32
829 fi
830 exit 0 ;;
831 pc:*:*:*)
832 # uname -m prints for DJGPP always 'pc', but it prints nothing about
833 # the processor, so we play safe by assuming i386.
834 echo i386-pc-msdosdjgpp
835 exit 0 ;;
836 Intel:Mach:3*:*)
837 echo i386-pc-mach3
838 exit 0 ;;
839 paragon:*:*:*)
840 echo i860-intel-osf1
841 exit 0 ;;
842 i860:*:4.*:*) # i860-SVR4
843 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
844 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
845 else # Add other i860-SVR4 vendors below as they are discovered.
846 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
847 fi
848 exit 0 ;;
849 mini*:CTIX:SYS*5:*)
850 # "miniframe"
851 echo m68010-convergent-sysv
852 exit 0 ;;
853 M68*:*:R3V[567]*:*)
854 test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
855 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
856 OS_REL=''
857 test -r /etc/.relid \
858 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
859 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
860 && echo i486-ncr-sysv4.3${OS_REL} && exit 0
861 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
862 && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
863 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
864 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
865 && echo i486-ncr-sysv4 && exit 0 ;;
866 m68*:LynxOS:2.*:*)
867 echo m68k-unknown-lynxos${UNAME_RELEASE}
868 exit 0 ;;
869 mc68030:UNIX_System_V:4.*:*)
870 echo m68k-atari-sysv4
871 exit 0 ;;
872 i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
873 echo i386-unknown-lynxos${UNAME_RELEASE}
874 exit 0 ;;
875 TSUNAMI:LynxOS:2.*:*)
876 echo sparc-unknown-lynxos${UNAME_RELEASE}
877 exit 0 ;;
878 rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
879 echo rs6000-unknown-lynxos${UNAME_RELEASE}
880 exit 0 ;;
881 SM[BE]S:UNIX_SV:*:*)
882 echo mips-dde-sysv${UNAME_RELEASE}
883 exit 0 ;;
884 RM*:ReliantUNIX-*:*:*)
885 echo mips-sni-sysv4
886 exit 0 ;;
887 RM*:SINIX-*:*:*)
888 echo mips-sni-sysv4
889 exit 0 ;;
890 *:SINIX-*:*:*)
891 if uname -p 2>/dev/null >/dev/null ; then
892 UNAME_MACHINE=`(uname -p) 2>/dev/null`
893 echo ${UNAME_MACHINE}-sni-sysv4
894 else
895 echo ns32k-sni-sysv
896 fi
897 exit 0 ;;
898 PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
899 # says <Richard.M.Bartel@ccMail.Census.GOV>
900 echo i586-unisys-sysv4
901 exit 0 ;;
902 *:UNIX_System_V:4*:FTX*)
903 # From Gerald Hewes <hewes@openmarket.com>.
904 # How about differentiating between stratus architectures? -djm
905 echo hppa1.1-stratus-sysv4
906 exit 0 ;;
907 *:*:*:FTX*)
908 # From seanf@swdc.stratus.com.
909 echo i860-stratus-sysv4
910 exit 0 ;;
911 mc68*:A/UX:*:*)
912 echo m68k-apple-aux${UNAME_RELEASE}
913 exit 0 ;;
914 news*:NEWS-OS:*:6*)
915 echo mips-sony-newsos6
916 exit 0 ;;
917 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
918 if [ -d /usr/nec ]; then
919 echo mips-nec-sysv${UNAME_RELEASE}
920 else
921 echo mips-unknown-sysv${UNAME_RELEASE}
922 fi
923 exit 0 ;;
924 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
925 echo powerpc-be-beos
926 exit 0 ;;
927 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
928 echo powerpc-apple-beos
929 exit 0 ;;
930 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
931 echo i586-pc-beos
932 exit 0 ;;
933 SX-4:SUPER-UX:*:*)
934 echo sx4-nec-superux${UNAME_RELEASE}
935 exit 0 ;;
936 SX-5:SUPER-UX:*:*)
937 echo sx5-nec-superux${UNAME_RELEASE}
938 exit 0 ;;
939 Power*:Rhapsody:*:*)
940 echo powerpc-apple-rhapsody${UNAME_RELEASE}
941 exit 0 ;;
942 *:Rhapsody:*:*)
943 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
944 exit 0 ;;
945 esac
946
947 #echo '(No uname command or uname output not recognized.)' 1>&2
948 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
949
950 cat >$dummy.c <<EOF
951 #ifdef _SEQUENT_
952 # include <sys/types.h>
953 # include <sys/utsname.h>
954 #endif
955 main ()
956 {
957 #if defined (sony)
958 #if defined (MIPSEB)
959 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
960 I don't know.... */
961 printf ("mips-sony-bsd\n"); exit (0);
962 #else
963 #include <sys/param.h>
964 printf ("m68k-sony-newsos%s\n",
965 #ifdef NEWSOS4
966 "4"
967 #else
968 ""
969 #endif
970 ); exit (0);
971 #endif
972 #endif
973
974 #if defined (__arm) && defined (__acorn) && defined (__unix)
975 printf ("arm-acorn-riscix"); exit (0);
976 #endif
977
978 #if defined (hp300) && !defined (hpux)
979 printf ("m68k-hp-bsd\n"); exit (0);
980 #endif
981
982 #if defined (NeXT)
983 #if !defined (__ARCHITECTURE__)
984 #define __ARCHITECTURE__ "m68k"
985 #endif
986 int version;
987 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
988 if (version < 4)
989 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
990 else
991 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
992 exit (0);
993 #endif
994
995 #if defined (MULTIMAX) || defined (n16)
996 #if defined (UMAXV)
997 printf ("ns32k-encore-sysv\n"); exit (0);
998 #else
999 #if defined (CMU)
1000 printf ("ns32k-encore-mach\n"); exit (0);
1001 #else
1002 printf ("ns32k-encore-bsd\n"); exit (0);
1003 #endif
1004 #endif
1005 #endif
1006
1007 #if defined (__386BSD__)
1008 printf ("i386-pc-bsd\n"); exit (0);
1009 #endif
1010
1011 #if defined (sequent)
1012 #if defined (i386)
1013 printf ("i386-sequent-dynix\n"); exit (0);
1014 #endif
1015 #if defined (ns32000)
1016 printf ("ns32k-sequent-dynix\n"); exit (0);
1017 #endif
1018 #endif
1019
1020 #if defined (_SEQUENT_)
1021 struct utsname un;
1022
1023 uname(&un);
1024
1025 if (strncmp(un.version, "V2", 2) == 0) {
1026 printf ("i386-sequent-ptx2\n"); exit (0);
1027 }
1028 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1029 printf ("i386-sequent-ptx1\n"); exit (0);
1030 }
1031 printf ("i386-sequent-ptx\n"); exit (0);
1032
1033 #endif
1034
1035 #if defined (vax)
1036 #if !defined (ultrix)
1037 printf ("vax-dec-bsd\n"); exit (0);
1038 #else
1039 printf ("vax-dec-ultrix\n"); exit (0);
1040 #endif
1041 #endif
1042
1043 #if defined (alliant) && defined (i860)
1044 printf ("i860-alliant-bsd\n"); exit (0);
1045 #endif
1046
1047 exit (1);
1048 }
1049 EOF
1050
1051 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
1052 rm -f $dummy.c $dummy
1053
1054 # Apollos put the system type in the environment.
1055
1056 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1057
1058 # Convex versions that predate uname can use getsysinfo(1)
1059
1060 if [ -x /usr/convex/getsysinfo ]
1061 then
1062 case `getsysinfo -f cpu_type` in
1063 c1*)
1064 echo c1-convex-bsd
1065 exit 0 ;;
1066 c2*)
1067 if getsysinfo -f scalar_acc
1068 then echo c32-convex-bsd
1069 else echo c2-convex-bsd
1070 fi
1071 exit 0 ;;
1072 c34*)
1073 echo c34-convex-bsd
1074 exit 0 ;;
1075 c38*)
1076 echo c38-convex-bsd
1077 exit 0 ;;
1078 c4*)
1079 echo c4-convex-bsd
1080 exit 0 ;;
1081 esac
1082 fi
1083
1084 #echo '(Unable to guess system type)' 1>&2
1085
1086 exit 1
0 #! /bin/sh
1 # Configuration validation subroutine script, version 1.1.
2 # Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
3 # This file is (in principle) common to ALL GNU software.
4 # The presence of a machine in this file suggests that SOME GNU software
5 # can handle that machine. It does not imply ALL GNU software can.
6 #
7 # This file is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330,
20 # Boston, MA 02111-1307, USA.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # Configuration subroutine to validate and canonicalize a configuration type.
28 # Supply the specified configuration type as an argument.
29 # If it is invalid, we print an error message on stderr and exit with code 1.
30 # Otherwise, we print the canonical config type on stdout and succeed.
31
32 # This file is supposed to be the same for all GNU packages
33 # and recognize all the CPU types, system types and aliases
34 # that are meaningful with *any* GNU software.
35 # Each package is responsible for reporting which valid configurations
36 # it does not support. The user should be able to distinguish
37 # a failure to support a valid configuration from a meaningless
38 # configuration.
39
40 # The goal of this file is to map all the various variations of a given
41 # machine specification into a single specification in the form:
42 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
43 # or in some cases, the newer four-part form:
44 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
45 # It is wrong to echo any other type of specification.
46
47 if [ x$1 = x ]
48 then
49 echo Configuration name missing. 1>&2
50 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
51 echo "or $0 ALIAS" 1>&2
52 echo where ALIAS is a recognized configuration type. 1>&2
53 exit 1
54 fi
55
56 # First pass through any local machine types.
57 case $1 in
58 *local*)
59 echo $1
60 exit 0
61 ;;
62 *)
63 ;;
64 esac
65
66 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
67 # Here we must recognize all the valid KERNEL-OS combinations.
68 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
69 case $maybe_os in
70 linux-gnu*)
71 os=-$maybe_os
72 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
73 ;;
74 *)
75 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
76 if [ $basic_machine != $1 ]
77 then os=`echo $1 | sed 's/.*-/-/'`
78 else os=; fi
79 ;;
80 esac
81
82 ### Let's recognize common machines as not being operating systems so
83 ### that things like config.sub decstation-3100 work. We also
84 ### recognize some manufacturers as not being operating systems, so we
85 ### can provide default operating systems below.
86 case $os in
87 -sun*os*)
88 # Prevent following clause from handling this invalid input.
89 ;;
90 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
91 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
92 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
93 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
94 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
95 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
96 -apple)
97 os=
98 basic_machine=$1
99 ;;
100 -sim | -cisco | -oki | -wec | -winbond)
101 os=
102 basic_machine=$1
103 ;;
104 -scout)
105 ;;
106 -wrs)
107 os=vxworks
108 basic_machine=$1
109 ;;
110 -hiux*)
111 os=-hiuxwe2
112 ;;
113 -sco5)
114 os=-sco3.2v5
115 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
116 ;;
117 -sco4)
118 os=-sco3.2v4
119 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
120 ;;
121 -sco3.2.[4-9]*)
122 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
123 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
124 ;;
125 -sco3.2v[4-9]*)
126 # Don't forget version if it is 3.2v4 or newer.
127 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
128 ;;
129 -sco*)
130 os=-sco3.2v2
131 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
132 ;;
133 -udk*)
134 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
135 ;;
136 -isc)
137 os=-isc2.2
138 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
139 ;;
140 -clix*)
141 basic_machine=clipper-intergraph
142 ;;
143 -isc*)
144 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
145 ;;
146 -lynx*)
147 os=-lynxos
148 ;;
149 -ptx*)
150 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
151 ;;
152 -windowsnt*)
153 os=`echo $os | sed -e 's/windowsnt/winnt/'`
154 ;;
155 -psos*)
156 os=-psos
157 ;;
158 esac
159
160 # Decode aliases for certain CPU-COMPANY combinations.
161 case $basic_machine in
162 # Recognize the basic CPU types without company name.
163 # Some are omitted here because they have special meanings below.
164 tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
165 | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
166 | 580 | i960 | h8300 \
167 | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
168 | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
169 | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
170 | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
171 | mips64orion | mips64orionel | mipstx39 | mipstx39el \
172 | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
173 | mips64vr5000 | miprs64vr5000el \
174 | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
175 | thumb | d10v)
176 basic_machine=$basic_machine-unknown
177 ;;
178 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
179 ;;
180
181 # We use `pc' rather than `unknown'
182 # because (1) that's what they normally are, and
183 # (2) the word "unknown" tends to confuse beginning users.
184 i[34567]86)
185 basic_machine=$basic_machine-pc
186 ;;
187 # Object if more than one company name word.
188 *-*-*)
189 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
190 exit 1
191 ;;
192 # Recognize the basic CPU types with company name.
193 vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
194 | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
195 | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
196 | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
197 | xmp-* | ymp-* \
198 | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
199 | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
200 | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
201 | clipper-* | orion-* \
202 | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
203 | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
204 | mips64el-* | mips64orion-* | mips64orionel-* \
205 | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
206 | mipstx39-* | mipstx39el-* \
207 | f301-* | armv*-* | t3e-* \
208 | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
209 | thumb-* | v850-* | d30v-* | tic30-* | c30-* )
210 ;;
211 # Recognize the various machine names and aliases which stand
212 # for a CPU type and a company and sometimes even an OS.
213 386bsd)
214 basic_machine=i386-unknown
215 os=-bsd
216 ;;
217 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
218 basic_machine=m68000-att
219 ;;
220 3b*)
221 basic_machine=we32k-att
222 ;;
223 a29khif)
224 basic_machine=a29k-amd
225 os=-udi
226 ;;
227 adobe68k)
228 basic_machine=m68010-adobe
229 os=-scout
230 ;;
231 alliant | fx80)
232 basic_machine=fx80-alliant
233 ;;
234 altos | altos3068)
235 basic_machine=m68k-altos
236 ;;
237 am29k)
238 basic_machine=a29k-none
239 os=-bsd
240 ;;
241 amdahl)
242 basic_machine=580-amdahl
243 os=-sysv
244 ;;
245 amiga | amiga-*)
246 basic_machine=m68k-cbm
247 ;;
248 amigaos | amigados)
249 basic_machine=m68k-cbm
250 os=-amigaos
251 ;;
252 amigaunix | amix)
253 basic_machine=m68k-cbm
254 os=-sysv4
255 ;;
256 apollo68)
257 basic_machine=m68k-apollo
258 os=-sysv
259 ;;
260 apollo68bsd)
261 basic_machine=m68k-apollo
262 os=-bsd
263 ;;
264 aux)
265 basic_machine=m68k-apple
266 os=-aux
267 ;;
268 balance)
269 basic_machine=ns32k-sequent
270 os=-dynix
271 ;;
272 convex-c1)
273 basic_machine=c1-convex
274 os=-bsd
275 ;;
276 convex-c2)
277 basic_machine=c2-convex
278 os=-bsd
279 ;;
280 convex-c32)
281 basic_machine=c32-convex
282 os=-bsd
283 ;;
284 convex-c34)
285 basic_machine=c34-convex
286 os=-bsd
287 ;;
288 convex-c38)
289 basic_machine=c38-convex
290 os=-bsd
291 ;;
292 cray | ymp)
293 basic_machine=ymp-cray
294 os=-unicos
295 ;;
296 cray2)
297 basic_machine=cray2-cray
298 os=-unicos
299 ;;
300 [ctj]90-cray)
301 basic_machine=c90-cray
302 os=-unicos
303 ;;
304 crds | unos)
305 basic_machine=m68k-crds
306 ;;
307 da30 | da30-*)
308 basic_machine=m68k-da30
309 ;;
310 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
311 basic_machine=mips-dec
312 ;;
313 delta | 3300 | motorola-3300 | motorola-delta \
314 | 3300-motorola | delta-motorola)
315 basic_machine=m68k-motorola
316 ;;
317 delta88)
318 basic_machine=m88k-motorola
319 os=-sysv3
320 ;;
321 dpx20 | dpx20-*)
322 basic_machine=rs6000-bull
323 os=-bosx
324 ;;
325 dpx2* | dpx2*-bull)
326 basic_machine=m68k-bull
327 os=-sysv3
328 ;;
329 ebmon29k)
330 basic_machine=a29k-amd
331 os=-ebmon
332 ;;
333 elxsi)
334 basic_machine=elxsi-elxsi
335 os=-bsd
336 ;;
337 encore | umax | mmax)
338 basic_machine=ns32k-encore
339 ;;
340 es1800 | OSE68k | ose68k | ose | OSE)
341 basic_machine=m68k-ericsson
342 os=-ose
343 ;;
344 fx2800)
345 basic_machine=i860-alliant
346 ;;
347 genix)
348 basic_machine=ns32k-ns
349 ;;
350 gmicro)
351 basic_machine=tron-gmicro
352 os=-sysv
353 ;;
354 h3050r* | hiux*)
355 basic_machine=hppa1.1-hitachi
356 os=-hiuxwe2
357 ;;
358 h8300hms)
359 basic_machine=h8300-hitachi
360 os=-hms
361 ;;
362 h8300xray)
363 basic_machine=h8300-hitachi
364 os=-xray
365 ;;
366 h8500hms)
367 basic_machine=h8500-hitachi
368 os=-hms
369 ;;
370 harris)
371 basic_machine=m88k-harris
372 os=-sysv3
373 ;;
374 hp300-*)
375 basic_machine=m68k-hp
376 ;;
377 hp300bsd)
378 basic_machine=m68k-hp
379 os=-bsd
380 ;;
381 hp300hpux)
382 basic_machine=m68k-hp
383 os=-hpux
384 ;;
385 hp3k9[0-9][0-9] | hp9[0-9][0-9])
386 basic_machine=hppa1.0-hp
387 ;;
388 hp9k2[0-9][0-9] | hp9k31[0-9])
389 basic_machine=m68000-hp
390 ;;
391 hp9k3[2-9][0-9])
392 basic_machine=m68k-hp
393 ;;
394 hp9k6[0-9][0-9] | hp6[0-9][0-9])
395 basic_machine=hppa1.0-hp
396 ;;
397 hp9k7[0-79][0-9] | hp7[0-79][0-9])
398 basic_machine=hppa1.1-hp
399 ;;
400 hp9k78[0-9] | hp78[0-9])
401 # FIXME: really hppa2.0-hp
402 basic_machine=hppa1.1-hp
403 ;;
404 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
405 # FIXME: really hppa2.0-hp
406 basic_machine=hppa1.1-hp
407 ;;
408 hp9k8[0-9][13679] | hp8[0-9][13679])
409 basic_machine=hppa1.1-hp
410 ;;
411 hp9k8[0-9][0-9] | hp8[0-9][0-9])
412 basic_machine=hppa1.0-hp
413 ;;
414 hppa-next)
415 os=-nextstep3
416 ;;
417 hppaosf)
418 basic_machine=hppa1.1-hp
419 os=-osf
420 ;;
421 hppro)
422 basic_machine=hppa1.1-hp
423 os=-proelf
424 ;;
425 i370-ibm* | ibm*)
426 basic_machine=i370-ibm
427 os=-mvs
428 ;;
429 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
430 i[34567]86v32)
431 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
432 os=-sysv32
433 ;;
434 i[34567]86v4*)
435 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
436 os=-sysv4
437 ;;
438 i[34567]86v)
439 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
440 os=-sysv
441 ;;
442 i[34567]86sol2)
443 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
444 os=-solaris2
445 ;;
446 i386mach)
447 basic_machine=i386-mach
448 os=-mach
449 ;;
450 i386-vsta | vsta)
451 basic_machine=i386-unknown
452 os=-vsta
453 ;;
454 i386-go32 | go32)
455 basic_machine=i386-unknown
456 os=-go32
457 ;;
458 i386-mingw32 | mingw32)
459 basic_machine=i386-unknown
460 os=-mingw32
461 ;;
462 iris | iris4d)
463 basic_machine=mips-sgi
464 case $os in
465 -irix*)
466 ;;
467 *)
468 os=-irix4
469 ;;
470 esac
471 ;;
472 isi68 | isi)
473 basic_machine=m68k-isi
474 os=-sysv
475 ;;
476 m88k-omron*)
477 basic_machine=m88k-omron
478 ;;
479 magnum | m3230)
480 basic_machine=mips-mips
481 os=-sysv
482 ;;
483 merlin)
484 basic_machine=ns32k-utek
485 os=-sysv
486 ;;
487 miniframe)
488 basic_machine=m68000-convergent
489 ;;
490 *mint | *MiNT)
491 basic_machine=m68k-atari
492 os=-mint
493 ;;
494 mipsel*-linux*)
495 basic_machine=mipsel-unknown
496 os=-linux-gnu
497 ;;
498 mips*-linux*)
499 basic_machine=mips-unknown
500 os=-linux-gnu
501 ;;
502 mips3*-*)
503 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
504 ;;
505 mips3*)
506 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
507 ;;
508 monitor)
509 basic_machine=m68k-rom68k
510 os=-coff
511 ;;
512 msdos)
513 basic_machine=i386-unknown
514 os=-msdos
515 ;;
516 ncr3000)
517 basic_machine=i486-ncr
518 os=-sysv4
519 ;;
520 netbsd386)
521 basic_machine=i386-unknown
522 os=-netbsd
523 ;;
524 netwinder)
525 basic_machine=armv4l-corel
526 os=-linux
527 ;;
528 news | news700 | news800 | news900)
529 basic_machine=m68k-sony
530 os=-newsos
531 ;;
532 news1000)
533 basic_machine=m68030-sony
534 os=-newsos
535 ;;
536 news-3600 | risc-news)
537 basic_machine=mips-sony
538 os=-newsos
539 ;;
540 necv70)
541 basic_machine=v70-nec
542 os=-sysv
543 ;;
544 next | m*-next )
545 basic_machine=m68k-next
546 case $os in
547 -nextstep* )
548 ;;
549 -ns2*)
550 os=-nextstep2
551 ;;
552 *)
553 os=-nextstep3
554 ;;
555 esac
556 ;;
557 nh3000)
558 basic_machine=m68k-harris
559 os=-cxux
560 ;;
561 nh[45]000)
562 basic_machine=m88k-harris
563 os=-cxux
564 ;;
565 nindy960)
566 basic_machine=i960-intel
567 os=-nindy
568 ;;
569 mon960)
570 basic_machine=i960-intel
571 os=-mon960
572 ;;
573 np1)
574 basic_machine=np1-gould
575 ;;
576 op50n-* | op60c-*)
577 basic_machine=hppa1.1-oki
578 os=-proelf
579 ;;
580 OSE68000 | ose68000)
581 basic_machine=m68000-ericsson
582 os=-ose
583 ;;
584 os68k)
585 basic_machine=m68k-none
586 os=-os68k
587 ;;
588 pa-hitachi)
589 basic_machine=hppa1.1-hitachi
590 os=-hiuxwe2
591 ;;
592 paragon)
593 basic_machine=i860-intel
594 os=-osf
595 ;;
596 pbd)
597 basic_machine=sparc-tti
598 ;;
599 pbb)
600 basic_machine=m68k-tti
601 ;;
602 pc532 | pc532-*)
603 basic_machine=ns32k-pc532
604 ;;
605 pentium | p5 | k5 | k6 | nexen)
606 basic_machine=i586-pc
607 ;;
608 pentiumpro | p6 | 6x86)
609 basic_machine=i686-pc
610 ;;
611 pentiumii | pentium2)
612 basic_machine=i786-pc
613 ;;
614 pentium-* | p5-* | k5-* | k6-* | nexen-*)
615 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
616 ;;
617 pentiumpro-* | p6-* | 6x86-*)
618 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
619 ;;
620 pentiumii-* | pentium2-*)
621 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
622 ;;
623 pn)
624 basic_machine=pn-gould
625 ;;
626 power) basic_machine=rs6000-ibm
627 ;;
628 ppc) basic_machine=powerpc-unknown
629 ;;
630 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
631 ;;
632 ppcle | powerpclittle | ppc-le | powerpc-little)
633 basic_machine=powerpcle-unknown
634 ;;
635 ppcle-* | powerpclittle-*)
636 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
637 ;;
638 ps2)
639 basic_machine=i386-ibm
640 ;;
641 rom68k)
642 basic_machine=m68k-rom68k
643 os=-coff
644 ;;
645 rm[46]00)
646 basic_machine=mips-siemens
647 ;;
648 rtpc | rtpc-*)
649 basic_machine=romp-ibm
650 ;;
651 sa29200)
652 basic_machine=a29k-amd
653 os=-udi
654 ;;
655 sequent)
656 basic_machine=i386-sequent
657 ;;
658 sh)
659 basic_machine=sh-hitachi
660 os=-hms
661 ;;
662 sparclite-wrs)
663 basic_machine=sparclite-wrs
664 os=-vxworks
665 ;;
666 sps7)
667 basic_machine=m68k-bull
668 os=-sysv2
669 ;;
670 spur)
671 basic_machine=spur-unknown
672 ;;
673 st2000)
674 basic_machine=m68k-tandem
675 ;;
676 stratus)
677 basic_machine=i860-stratus
678 os=-sysv4
679 ;;
680 sun2)
681 basic_machine=m68000-sun
682 ;;
683 sun2os3)
684 basic_machine=m68000-sun
685 os=-sunos3
686 ;;
687 sun2os4)
688 basic_machine=m68000-sun
689 os=-sunos4
690 ;;
691 sun3os3)
692 basic_machine=m68k-sun
693 os=-sunos3
694 ;;
695 sun3os4)
696 basic_machine=m68k-sun
697 os=-sunos4
698 ;;
699 sun4os3)
700 basic_machine=sparc-sun
701 os=-sunos3
702 ;;
703 sun4os4)
704 basic_machine=sparc-sun
705 os=-sunos4
706 ;;
707 sun4sol2)
708 basic_machine=sparc-sun
709 os=-solaris2
710 ;;
711 sun3 | sun3-*)
712 basic_machine=m68k-sun
713 ;;
714 sun4)
715 basic_machine=sparc-sun
716 ;;
717 sun386 | sun386i | roadrunner)
718 basic_machine=i386-sun
719 ;;
720 symmetry)
721 basic_machine=i386-sequent
722 os=-dynix
723 ;;
724 t3e)
725 basic_machine=t3e-cray
726 os=-unicos
727 ;;
728 tx39)
729 basic_machine=mipstx39-unknown
730 ;;
731 tx39el)
732 basic_machine=mipstx39el-unknown
733 ;;
734 tower | tower-32)
735 basic_machine=m68k-ncr
736 ;;
737 udi29k)
738 basic_machine=a29k-amd
739 os=-udi
740 ;;
741 ultra3)
742 basic_machine=a29k-nyu
743 os=-sym1
744 ;;
745 v810 | necv810)
746 basic_machine=v810-nec
747 os=-none
748 ;;
749 vaxv)
750 basic_machine=vax-dec
751 os=-sysv
752 ;;
753 vms)
754 basic_machine=vax-dec
755 os=-vms
756 ;;
757 vpp*|vx|vx-*)
758 basic_machine=f301-fujitsu
759 ;;
760 vxworks960)
761 basic_machine=i960-wrs
762 os=-vxworks
763 ;;
764 vxworks68)
765 basic_machine=m68k-wrs
766 os=-vxworks
767 ;;
768 vxworks29k)
769 basic_machine=a29k-wrs
770 os=-vxworks
771 ;;
772 w65*)
773 basic_machine=w65-wdc
774 os=-none
775 ;;
776 w89k-*)
777 basic_machine=hppa1.1-winbond
778 os=-proelf
779 ;;
780 xmp)
781 basic_machine=xmp-cray
782 os=-unicos
783 ;;
784 xps | xps100)
785 basic_machine=xps100-honeywell
786 ;;
787 z8k-*-coff)
788 basic_machine=z8k-unknown
789 os=-sim
790 ;;
791 none)
792 basic_machine=none-none
793 os=-none
794 ;;
795
796 # Here we handle the default manufacturer of certain CPU types. It is in
797 # some cases the only manufacturer, in others, it is the most popular.
798 w89k)
799 basic_machine=hppa1.1-winbond
800 ;;
801 op50n)
802 basic_machine=hppa1.1-oki
803 ;;
804 op60c)
805 basic_machine=hppa1.1-oki
806 ;;
807 mips)
808 if [ x$os = x-linux-gnu ]; then
809 basic_machine=mips-unknown
810 else
811 basic_machine=mips-mips
812 fi
813 ;;
814 romp)
815 basic_machine=romp-ibm
816 ;;
817 rs6000)
818 basic_machine=rs6000-ibm
819 ;;
820 vax)
821 basic_machine=vax-dec
822 ;;
823 pdp11)
824 basic_machine=pdp11-dec
825 ;;
826 we32k)
827 basic_machine=we32k-att
828 ;;
829 sparc | sparcv9)
830 basic_machine=sparc-sun
831 ;;
832 cydra)
833 basic_machine=cydra-cydrome
834 ;;
835 orion)
836 basic_machine=orion-highlevel
837 ;;
838 orion105)
839 basic_machine=clipper-highlevel
840 ;;
841 mac | mpw | mac-mpw)
842 basic_machine=m68k-apple
843 ;;
844 pmac | pmac-mpw)
845 basic_machine=powerpc-apple
846 ;;
847 c4x*)
848 basic_machine=c4x-none
849 os=-coff
850 ;;
851 *)
852 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
853 exit 1
854 ;;
855 esac
856
857 # Here we canonicalize certain aliases for manufacturers.
858 case $basic_machine in
859 *-digital*)
860 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
861 ;;
862 *-commodore*)
863 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
864 ;;
865 *)
866 ;;
867 esac
868
869 # Decode manufacturer-specific aliases for certain operating systems.
870
871 if [ x"$os" != x"" ]
872 then
873 case $os in
874 # First match some system type aliases
875 # that might get confused with valid system types.
876 # -solaris* is a basic system type, with this one exception.
877 -solaris1 | -solaris1.*)
878 os=`echo $os | sed -e 's|solaris1|sunos4|'`
879 ;;
880 -solaris)
881 os=-solaris2
882 ;;
883 -svr4*)
884 os=-sysv4
885 ;;
886 -unixware*)
887 os=-sysv4.2uw
888 ;;
889 -gnu/linux*)
890 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
891 ;;
892 # First accept the basic system types.
893 # The portable systems comes first.
894 # Each alternative MUST END IN A *, to match a version number.
895 # -sysv* is not here because it comes later, after sysvr4.
896 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
897 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
898 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
899 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
900 | -aos* \
901 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
902 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
903 | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
904 | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
905 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
906 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
907 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
908 | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
909 | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
910 # Remember, each alternative MUST END IN *, to match a version number.
911 ;;
912 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
913 | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
914 | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
915 ;;
916 -mac*)
917 os=`echo $os | sed -e 's|mac|macos|'`
918 ;;
919 -linux*)
920 os=`echo $os | sed -e 's|linux|linux-gnu|'`
921 ;;
922 -sunos5*)
923 os=`echo $os | sed -e 's|sunos5|solaris2|'`
924 ;;
925 -sunos6*)
926 os=`echo $os | sed -e 's|sunos6|solaris3|'`
927 ;;
928 -osfrose*)
929 os=-osfrose
930 ;;
931 -osf*)
932 os=-osf
933 ;;
934 -utek*)
935 os=-bsd
936 ;;
937 -dynix*)
938 os=-bsd
939 ;;
940 -acis*)
941 os=-aos
942 ;;
943 -386bsd)
944 os=-bsd
945 ;;
946 -ctix* | -uts*)
947 os=-sysv
948 ;;
949 -ns2 )
950 os=-nextstep2
951 ;;
952 # Preserve the version number of sinix5.
953 -sinix5.*)
954 os=`echo $os | sed -e 's|sinix|sysv|'`
955 ;;
956 -sinix*)
957 os=-sysv4
958 ;;
959 -triton*)
960 os=-sysv3
961 ;;
962 -oss*)
963 os=-sysv3
964 ;;
965 -svr4)
966 os=-sysv4
967 ;;
968 -svr3)
969 os=-sysv3
970 ;;
971 -sysvr4)
972 os=-sysv4
973 ;;
974 # This must come after -sysvr4.
975 -sysv*)
976 ;;
977 -ose*)
978 os=-ose
979 ;;
980 -es1800*)
981 os=-ose
982 ;;
983 -xenix)
984 os=-xenix
985 ;;
986 -*mint | -*MiNT)
987 os=-mint
988 ;;
989 -none)
990 ;;
991 *)
992 # Get rid of the `-' at the beginning of $os.
993 os=`echo $os | sed 's/[^-]*-//'`
994 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
995 exit 1
996 ;;
997 esac
998 else
999
1000 # Here we handle the default operating systems that come with various machines.
1001 # The value should be what the vendor currently ships out the door with their
1002 # machine or put another way, the most popular os provided with the machine.
1003
1004 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1005 # "-sun"), then you have to tell the case statement up towards the top
1006 # that MANUFACTURER isn't an operating system. Otherwise, code above
1007 # will signal an error saying that MANUFACTURER isn't an operating
1008 # system, and we'll never get to this point.
1009
1010 case $basic_machine in
1011 *-acorn)
1012 os=-riscix1.2
1013 ;;
1014 arm*-corel)
1015 os=-linux
1016 ;;
1017 arm*-semi)
1018 os=-aout
1019 ;;
1020 pdp11-*)
1021 os=-none
1022 ;;
1023 *-dec | vax-*)
1024 os=-ultrix4.2
1025 ;;
1026 m68*-apollo)
1027 os=-domain
1028 ;;
1029 i386-sun)
1030 os=-sunos4.0.2
1031 ;;
1032 m68000-sun)
1033 os=-sunos3
1034 # This also exists in the configure program, but was not the
1035 # default.
1036 # os=-sunos4
1037 ;;
1038 m68*-cisco)
1039 os=-aout
1040 ;;
1041 mips*-cisco)
1042 os=-elf
1043 ;;
1044 mips*-*)
1045 os=-elf
1046 ;;
1047 *-tti) # must be before sparc entry or we get the wrong os.
1048 os=-sysv3
1049 ;;
1050 sparc-* | *-sun)
1051 os=-sunos4.1.1
1052 ;;
1053 *-be)
1054 os=-beos
1055 ;;
1056 *-ibm)
1057 os=-aix
1058 ;;
1059 *-wec)
1060 os=-proelf
1061 ;;
1062 *-winbond)
1063 os=-proelf
1064 ;;
1065 *-oki)
1066 os=-proelf
1067 ;;
1068 *-hp)
1069 os=-hpux
1070 ;;
1071 *-hitachi)
1072 os=-hiux
1073 ;;
1074 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1075 os=-sysv
1076 ;;
1077 *-cbm)
1078 os=-amigaos
1079 ;;
1080 *-dg)
1081 os=-dgux
1082 ;;
1083 *-dolphin)
1084 os=-sysv3
1085 ;;
1086 m68k-ccur)
1087 os=-rtu
1088 ;;
1089 m88k-omron*)
1090 os=-luna
1091 ;;
1092 *-next )
1093 os=-nextstep
1094 ;;
1095 *-sequent)
1096 os=-ptx
1097 ;;
1098 *-crds)
1099 os=-unos
1100 ;;
1101 *-ns)
1102 os=-genix
1103 ;;
1104 i370-*)
1105 os=-mvs
1106 ;;
1107 *-next)
1108 os=-nextstep3
1109 ;;
1110 *-gould)
1111 os=-sysv
1112 ;;
1113 *-highlevel)
1114 os=-bsd
1115 ;;
1116 *-encore)
1117 os=-bsd
1118 ;;
1119 *-sgi)
1120 os=-irix
1121 ;;
1122 *-siemens)
1123 os=-sysv4
1124 ;;
1125 *-masscomp)
1126 os=-rtu
1127 ;;
1128 f301-fujitsu)
1129 os=-uxpv
1130 ;;
1131 *-rom68k)
1132 os=-coff
1133 ;;
1134 *-*bug)
1135 os=-coff
1136 ;;
1137 *-apple)
1138 os=-macos
1139 ;;
1140 *-atari*)
1141 os=-mint
1142 ;;
1143 *)
1144 os=-none
1145 ;;
1146 esac
1147 fi
1148
1149 # Here we handle the case where we know the os, and the CPU type, but not the
1150 # manufacturer. We pick the logical manufacturer.
1151 vendor=unknown
1152 case $basic_machine in
1153 *-unknown)
1154 case $os in
1155 -riscix*)
1156 vendor=acorn
1157 ;;
1158 -sunos*)
1159 vendor=sun
1160 ;;
1161 -aix*)
1162 vendor=ibm
1163 ;;
1164 -beos*)
1165 vendor=be
1166 ;;
1167 -hpux*)
1168 vendor=hp
1169 ;;
1170 -mpeix*)
1171 vendor=hp
1172 ;;
1173 -hiux*)
1174 vendor=hitachi
1175 ;;
1176 -unos*)
1177 vendor=crds
1178 ;;
1179 -dgux*)
1180 vendor=dg
1181 ;;
1182 -luna*)
1183 vendor=omron
1184 ;;
1185 -genix*)
1186 vendor=ns
1187 ;;
1188 -mvs*)
1189 vendor=ibm
1190 ;;
1191 -ptx*)
1192 vendor=sequent
1193 ;;
1194 -vxsim* | -vxworks*)
1195 vendor=wrs
1196 ;;
1197 -aux*)
1198 vendor=apple
1199 ;;
1200 -hms*)
1201 vendor=hitachi
1202 ;;
1203 -mpw* | -macos*)
1204 vendor=apple
1205 ;;
1206 -*mint | -*MiNT)
1207 vendor=atari
1208 ;;
1209 esac
1210 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1211 ;;
1212 esac
1213
1214 echo $basic_machine$os
0 #! /bin/sh
1
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated automatically using autoconf version 2.13
4 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
5 #
6 # This configure script is free software; the Free Software Foundation
7 # gives unlimited permission to copy, distribute and modify it.
8
9 # Defaults:
10 ac_help=
11 ac_default_prefix=/usr/local
12 # Any additions from configure.in:
13 ac_help="$ac_help
14 --with-sdl-prefix=PFX Prefix where SDL is installed (optional)"
15 ac_help="$ac_help
16 --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)"
17 ac_help="$ac_help
18 --disable-sdltest Do not try to compile and run a test SDL program"
19
20 # Initialize some variables set by options.
21 # The variables have the same names as the options, with
22 # dashes changed to underlines.
23 build=NONE
24 cache_file=./config.cache
25 exec_prefix=NONE
26 host=NONE
27 no_create=
28 nonopt=NONE
29 no_recursion=
30 prefix=NONE
31 program_prefix=NONE
32 program_suffix=NONE
33 program_transform_name=s,x,x,
34 silent=
35 site=
36 srcdir=
37 target=NONE
38 verbose=
39 x_includes=NONE
40 x_libraries=NONE
41 bindir='${exec_prefix}/bin'
42 sbindir='${exec_prefix}/sbin'
43 libexecdir='${exec_prefix}/libexec'
44 datadir='${prefix}/share'
45 sysconfdir='${prefix}/etc'
46 sharedstatedir='${prefix}/com'
47 localstatedir='${prefix}/var'
48 libdir='${exec_prefix}/lib'
49 includedir='${prefix}/include'
50 oldincludedir='/usr/include'
51 infodir='${prefix}/info'
52 mandir='${prefix}/man'
53
54 # Initialize some other variables.
55 subdirs=
56 MFLAGS= MAKEFLAGS=
57 SHELL=${CONFIG_SHELL-/bin/sh}
58 # Maximum number of lines to put in a shell here document.
59 ac_max_here_lines=12
60
61 ac_prev=
62 for ac_option
63 do
64
65 # If the previous option needs an argument, assign it.
66 if test -n "$ac_prev"; then
67 eval "$ac_prev=\$ac_option"
68 ac_prev=
69 continue
70 fi
71
72 case "$ac_option" in
73 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
74 *) ac_optarg= ;;
75 esac
76
77 # Accept the important Cygnus configure options, so we can diagnose typos.
78
79 case "$ac_option" in
80
81 -bindir | --bindir | --bindi | --bind | --bin | --bi)
82 ac_prev=bindir ;;
83 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
84 bindir="$ac_optarg" ;;
85
86 -build | --build | --buil | --bui | --bu)
87 ac_prev=build ;;
88 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
89 build="$ac_optarg" ;;
90
91 -cache-file | --cache-file | --cache-fil | --cache-fi \
92 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
93 ac_prev=cache_file ;;
94 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
95 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
96 cache_file="$ac_optarg" ;;
97
98 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
99 ac_prev=datadir ;;
100 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
101 | --da=*)
102 datadir="$ac_optarg" ;;
103
104 -disable-* | --disable-*)
105 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
106 # Reject names that are not valid shell variable names.
107 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
108 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
109 fi
110 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
111 eval "enable_${ac_feature}=no" ;;
112
113 -enable-* | --enable-*)
114 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
115 # Reject names that are not valid shell variable names.
116 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
117 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
118 fi
119 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
120 case "$ac_option" in
121 *=*) ;;
122 *) ac_optarg=yes ;;
123 esac
124 eval "enable_${ac_feature}='$ac_optarg'" ;;
125
126 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
127 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
128 | --exec | --exe | --ex)
129 ac_prev=exec_prefix ;;
130 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
131 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
132 | --exec=* | --exe=* | --ex=*)
133 exec_prefix="$ac_optarg" ;;
134
135 -gas | --gas | --ga | --g)
136 # Obsolete; use --with-gas.
137 with_gas=yes ;;
138
139 -help | --help | --hel | --he)
140 # Omit some internal or obsolete options to make the list less imposing.
141 # This message is too long to be a string in the A/UX 3.1 sh.
142 cat << EOF
143 Usage: configure [options] [host]
144 Options: [defaults in brackets after descriptions]
145 Configuration:
146 --cache-file=FILE cache test results in FILE
147 --help print this message
148 --no-create do not create output files
149 --quiet, --silent do not print \`checking...' messages
150 --version print the version of autoconf that created configure
151 Directory and file names:
152 --prefix=PREFIX install architecture-independent files in PREFIX
153 [$ac_default_prefix]
154 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
155 [same as prefix]
156 --bindir=DIR user executables in DIR [EPREFIX/bin]
157 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
158 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
159 --datadir=DIR read-only architecture-independent data in DIR
160 [PREFIX/share]
161 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
162 --sharedstatedir=DIR modifiable architecture-independent data in DIR
163 [PREFIX/com]
164 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
165 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
166 --includedir=DIR C header files in DIR [PREFIX/include]
167 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
168 --infodir=DIR info documentation in DIR [PREFIX/info]
169 --mandir=DIR man documentation in DIR [PREFIX/man]
170 --srcdir=DIR find the sources in DIR [configure dir or ..]
171 --program-prefix=PREFIX prepend PREFIX to installed program names
172 --program-suffix=SUFFIX append SUFFIX to installed program names
173 --program-transform-name=PROGRAM
174 run sed PROGRAM on installed program names
175 EOF
176 cat << EOF
177 Host type:
178 --build=BUILD configure for building on BUILD [BUILD=HOST]
179 --host=HOST configure for HOST [guessed]
180 --target=TARGET configure for TARGET [TARGET=HOST]
181 Features and packages:
182 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
183 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
184 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
185 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
186 --x-includes=DIR X include files are in DIR
187 --x-libraries=DIR X library files are in DIR
188 EOF
189 if test -n "$ac_help"; then
190 echo "--enable and --with options recognized:$ac_help"
191 fi
192 exit 0 ;;
193
194 -host | --host | --hos | --ho)
195 ac_prev=host ;;
196 -host=* | --host=* | --hos=* | --ho=*)
197 host="$ac_optarg" ;;
198
199 -includedir | --includedir | --includedi | --included | --include \
200 | --includ | --inclu | --incl | --inc)
201 ac_prev=includedir ;;
202 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
203 | --includ=* | --inclu=* | --incl=* | --inc=*)
204 includedir="$ac_optarg" ;;
205
206 -infodir | --infodir | --infodi | --infod | --info | --inf)
207 ac_prev=infodir ;;
208 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
209 infodir="$ac_optarg" ;;
210
211 -libdir | --libdir | --libdi | --libd)
212 ac_prev=libdir ;;
213 -libdir=* | --libdir=* | --libdi=* | --libd=*)
214 libdir="$ac_optarg" ;;
215
216 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
217 | --libexe | --libex | --libe)
218 ac_prev=libexecdir ;;
219 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
220 | --libexe=* | --libex=* | --libe=*)
221 libexecdir="$ac_optarg" ;;
222
223 -localstatedir | --localstatedir | --localstatedi | --localstated \
224 | --localstate | --localstat | --localsta | --localst \
225 | --locals | --local | --loca | --loc | --lo)
226 ac_prev=localstatedir ;;
227 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
228 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
229 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
230 localstatedir="$ac_optarg" ;;
231
232 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
233 ac_prev=mandir ;;
234 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
235 mandir="$ac_optarg" ;;
236
237 -nfp | --nfp | --nf)
238 # Obsolete; use --without-fp.
239 with_fp=no ;;
240
241 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
242 | --no-cr | --no-c)
243 no_create=yes ;;
244
245 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
246 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
247 no_recursion=yes ;;
248
249 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
250 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
251 | --oldin | --oldi | --old | --ol | --o)
252 ac_prev=oldincludedir ;;
253 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
254 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
255 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
256 oldincludedir="$ac_optarg" ;;
257
258 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
259 ac_prev=prefix ;;
260 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
261 prefix="$ac_optarg" ;;
262
263 -program-prefix | --program-prefix | --program-prefi | --program-pref \
264 | --program-pre | --program-pr | --program-p)
265 ac_prev=program_prefix ;;
266 -program-prefix=* | --program-prefix=* | --program-prefi=* \
267 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
268 program_prefix="$ac_optarg" ;;
269
270 -program-suffix | --program-suffix | --program-suffi | --program-suff \
271 | --program-suf | --program-su | --program-s)
272 ac_prev=program_suffix ;;
273 -program-suffix=* | --program-suffix=* | --program-suffi=* \
274 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
275 program_suffix="$ac_optarg" ;;
276
277 -program-transform-name | --program-transform-name \
278 | --program-transform-nam | --program-transform-na \
279 | --program-transform-n | --program-transform- \
280 | --program-transform | --program-transfor \
281 | --program-transfo | --program-transf \
282 | --program-trans | --program-tran \
283 | --progr-tra | --program-tr | --program-t)
284 ac_prev=program_transform_name ;;
285 -program-transform-name=* | --program-transform-name=* \
286 | --program-transform-nam=* | --program-transform-na=* \
287 | --program-transform-n=* | --program-transform-=* \
288 | --program-transform=* | --program-transfor=* \
289 | --program-transfo=* | --program-transf=* \
290 | --program-trans=* | --program-tran=* \
291 | --progr-tra=* | --program-tr=* | --program-t=*)
292 program_transform_name="$ac_optarg" ;;
293
294 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
295 | -silent | --silent | --silen | --sile | --sil)
296 silent=yes ;;
297
298 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
299 ac_prev=sbindir ;;
300 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
301 | --sbi=* | --sb=*)
302 sbindir="$ac_optarg" ;;
303
304 -sharedstatedir | --sharedstatedir | --sharedstatedi \
305 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
306 | --sharedst | --shareds | --shared | --share | --shar \
307 | --sha | --sh)
308 ac_prev=sharedstatedir ;;
309 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
310 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
311 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
312 | --sha=* | --sh=*)
313 sharedstatedir="$ac_optarg" ;;
314
315 -site | --site | --sit)
316 ac_prev=site ;;
317 -site=* | --site=* | --sit=*)
318 site="$ac_optarg" ;;
319
320 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
321 ac_prev=srcdir ;;
322 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
323 srcdir="$ac_optarg" ;;
324
325 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
326 | --syscon | --sysco | --sysc | --sys | --sy)
327 ac_prev=sysconfdir ;;
328 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
329 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
330 sysconfdir="$ac_optarg" ;;
331
332 -target | --target | --targe | --targ | --tar | --ta | --t)
333 ac_prev=target ;;
334 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
335 target="$ac_optarg" ;;
336
337 -v | -verbose | --verbose | --verbos | --verbo | --verb)
338 verbose=yes ;;
339
340 -version | --version | --versio | --versi | --vers)
341 echo "configure generated by autoconf version 2.13"
342 exit 0 ;;
343
344 -with-* | --with-*)
345 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
346 # Reject names that are not valid shell variable names.
347 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
348 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
349 fi
350 ac_package=`echo $ac_package| sed 's/-/_/g'`
351 case "$ac_option" in
352 *=*) ;;
353 *) ac_optarg=yes ;;
354 esac
355 eval "with_${ac_package}='$ac_optarg'" ;;
356
357 -without-* | --without-*)
358 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
359 # Reject names that are not valid shell variable names.
360 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
361 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
362 fi
363 ac_package=`echo $ac_package| sed 's/-/_/g'`
364 eval "with_${ac_package}=no" ;;
365
366 --x)
367 # Obsolete; use --with-x.
368 with_x=yes ;;
369
370 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
371 | --x-incl | --x-inc | --x-in | --x-i)
372 ac_prev=x_includes ;;
373 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
374 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
375 x_includes="$ac_optarg" ;;
376
377 -x-libraries | --x-libraries | --x-librarie | --x-librari \
378 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
379 ac_prev=x_libraries ;;
380 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
381 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
382 x_libraries="$ac_optarg" ;;
383
384 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
385 ;;
386
387 *)
388 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
389 echo "configure: warning: $ac_option: invalid host type" 1>&2
390 fi
391 if test "x$nonopt" != xNONE; then
392 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
393 fi
394 nonopt="$ac_option"
395 ;;
396
397 esac
398 done
399
400 if test -n "$ac_prev"; then
401 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
402 fi
403
404 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
405
406 # File descriptor usage:
407 # 0 standard input
408 # 1 file creation
409 # 2 errors and warnings
410 # 3 some systems may open it to /dev/tty
411 # 4 used on the Kubota Titan
412 # 6 checking for... messages and results
413 # 5 compiler messages saved in config.log
414 if test "$silent" = yes; then
415 exec 6>/dev/null
416 else
417 exec 6>&1
418 fi
419 exec 5>./config.log
420
421 echo "\
422 This file contains any messages produced by compilers while
423 running configure, to aid debugging if configure makes a mistake.
424 " 1>&5
425
426 # Strip out --no-create and --no-recursion so they do not pile up.
427 # Also quote any args containing shell metacharacters.
428 ac_configure_args=
429 for ac_arg
430 do
431 case "$ac_arg" in
432 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
433 | --no-cr | --no-c) ;;
434 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
435 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
436 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
437 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
438 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
439 esac
440 done
441
442 # NLS nuisances.
443 # Only set these to C if already set. These must not be set unconditionally
444 # because not all systems understand e.g. LANG=C (notably SCO).
445 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
446 # Non-C LC_CTYPE values break the ctype check.
447 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
448 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
449 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
450 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
451
452 # confdefs.h avoids OS command line length limits that DEFS can exceed.
453 rm -rf conftest* confdefs.h
454 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
455 echo > confdefs.h
456
457 # A filename unique to this package, relative to the directory that
458 # configure is in, which we can look for to find out if srcdir is correct.
459 ac_unique_file=README
460
461 # Find the source files, if location was not specified.
462 if test -z "$srcdir"; then
463 ac_srcdir_defaulted=yes
464 # Try the directory containing this script, then its parent.
465 ac_prog=$0
466 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
467 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
468 srcdir=$ac_confdir
469 if test ! -r $srcdir/$ac_unique_file; then
470 srcdir=..
471 fi
472 else
473 ac_srcdir_defaulted=no
474 fi
475 if test ! -r $srcdir/$ac_unique_file; then
476 if test "$ac_srcdir_defaulted" = yes; then
477 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
478 else
479 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
480 fi
481 fi
482 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
483
484 # Prefer explicitly selected file to automatically selected ones.
485 if test -z "$CONFIG_SITE"; then
486 if test "x$prefix" != xNONE; then
487 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
488 else
489 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
490 fi
491 fi
492 for ac_site_file in $CONFIG_SITE; do
493 if test -r "$ac_site_file"; then
494 echo "loading site script $ac_site_file"
495 . "$ac_site_file"
496 fi
497 done
498
499 if test -r "$cache_file"; then
500 echo "loading cache $cache_file"
501 . $cache_file
502 else
503 echo "creating cache $cache_file"
504 > $cache_file
505 fi
506
507 ac_ext=c
508 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
509 ac_cpp='$CPP $CPPFLAGS'
510 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
511 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
512 cross_compiling=$ac_cv_prog_cc_cross
513
514 ac_exeext=
515 ac_objext=o
516 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
517 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
518 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
519 ac_n= ac_c='
520 ' ac_t=' '
521 else
522 ac_n=-n ac_c= ac_t=
523 fi
524 else
525 ac_n= ac_c='\c' ac_t=
526 fi
527
528
529
530 ######## Setup for automake
531
532
533 if test -d ./src/mixer ; then
534 MIXER_INCLUDED_TRUE=
535 MIXER_INCLUDED_FALSE='#'
536 else
537 MIXER_INCLUDED_TRUE='#'
538 MIXER_INCLUDED_FALSE=
539 fi
540
541 NAME="bumprace"
542 SDL_VERSION=1.1.5
543 ac_aux_dir=
544 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
545 if test -f $ac_dir/install-sh; then
546 ac_aux_dir=$ac_dir
547 ac_install_sh="$ac_aux_dir/install-sh -c"
548 break
549 elif test -f $ac_dir/install.sh; then
550 ac_aux_dir=$ac_dir
551 ac_install_sh="$ac_aux_dir/install.sh -c"
552 break
553 fi
554 done
555 if test -z "$ac_aux_dir"; then
556 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
557 fi
558 ac_config_guess=$ac_aux_dir/config.guess
559 ac_config_sub=$ac_aux_dir/config.sub
560 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
561
562 # Find a good install program. We prefer a C program (faster),
563 # so one script is as good as another. But avoid the broken or
564 # incompatible versions:
565 # SysV /etc/install, /usr/sbin/install
566 # SunOS /usr/etc/install
567 # IRIX /sbin/install
568 # AIX /bin/install
569 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
570 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
571 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
572 # ./install, which can be erroneously created by make from ./install.sh.
573 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
574 echo "configure:576: checking for a BSD compatible install" >&5
575 if test -z "$INSTALL"; then
576 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
577 echo $ac_n "(cached) $ac_c" 1>&6
578 else
579 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
580 for ac_dir in $PATH; do
581 # Account for people who put trailing slashes in PATH elements.
582 case "$ac_dir/" in
583 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
584 *)
585 # OSF1 and SCO ODT 3.0 have their own names for install.
586 # Don't use installbsd from OSF since it installs stuff as root
587 # by default.
588 for ac_prog in ginstall scoinst install; do
589 if test -f $ac_dir/$ac_prog; then
590 if test $ac_prog = install &&
591 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
592 # AIX install. It has an incompatible calling convention.
593 :
594 else
595 ac_cv_path_install="$ac_dir/$ac_prog -c"
596 break 2
597 fi
598 fi
599 done
600 ;;
601 esac
602 done
603 IFS="$ac_save_IFS"
604
605 fi
606 if test "${ac_cv_path_install+set}" = set; then
607 INSTALL="$ac_cv_path_install"
608 else
609 # As a last resort, use the slow shell script. We don't cache a
610 # path for INSTALL within a source directory, because that will
611 # break other packages using the cache if that directory is
612 # removed, or if the path is relative.
613 INSTALL="$ac_install_sh"
614 fi
615 fi
616 echo "$ac_t""$INSTALL" 1>&6
617
618 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
619 # It thinks the first close brace ends the variable substitution.
620 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
621
622 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
623
624 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
625
626 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
627 echo "configure:629: checking whether build environment is sane" >&5
628 # Just in case
629 sleep 1
630 echo timestamp > conftestfile
631 # Do `set' in a subshell so we don't clobber the current shell's
632 # arguments. Must try -L first in case configure is actually a
633 # symlink; some systems play weird games with the mod time of symlinks
634 # (eg FreeBSD returns the mod time of the symlink's containing
635 # directory).
636 if (
637 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
638 if test "$*" = "X"; then
639 # -L didn't work.
640 set X `ls -t $srcdir/configure conftestfile`
641 fi
642 if test "$*" != "X $srcdir/configure conftestfile" \
643 && test "$*" != "X conftestfile $srcdir/configure"; then
644
645 # If neither matched, then we have a broken ls. This can happen
646 # if, for instance, CONFIG_SHELL is bash and it inherits a
647 # broken ls alias from the environment. This has actually
648 # happened. Such a system could not be considered "sane".
649 { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
650 alias in your environment" 1>&2; exit 1; }
651 fi
652
653 test "$2" = conftestfile
654 )
655 then
656 # Ok.
657 :
658 else
659 { echo "configure: error: newly created file is older than distributed files!
660 Check your system clock" 1>&2; exit 1; }
661 fi
662 rm -f conftest*
663 echo "$ac_t""yes" 1>&6
664 if test "$program_transform_name" = s,x,x,; then
665 program_transform_name=
666 else
667 # Double any \ or $. echo might interpret backslashes.
668 cat <<\EOF_SED > conftestsed
669 s,\\,\\\\,g; s,\$,$$,g
670 EOF_SED
671 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
672 rm -f conftestsed
673 fi
674 test "$program_prefix" != NONE &&
675 program_transform_name="s,^,${program_prefix},; $program_transform_name"
676 # Use a double $ so make ignores it.
677 test "$program_suffix" != NONE &&
678 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
679
680 # sed with no file args requires a program.
681 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
682
683 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
684 echo "configure:686: checking whether ${MAKE-make} sets \${MAKE}" >&5
685 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
686 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
687 echo $ac_n "(cached) $ac_c" 1>&6
688 else
689 cat > conftestmake <<\EOF
690 all:
691 @echo 'ac_maketemp="${MAKE}"'
692 EOF
693 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
694 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
695 if test -n "$ac_maketemp"; then
696 eval ac_cv_prog_make_${ac_make}_set=yes
697 else
698 eval ac_cv_prog_make_${ac_make}_set=no
699 fi
700 rm -f conftestmake
701 fi
702 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
703 echo "$ac_t""yes" 1>&6
704 SET_MAKE=
705 else
706 echo "$ac_t""no" 1>&6
707 SET_MAKE="MAKE=${MAKE-make}"
708 fi
709
710
711 PACKAGE=$NAME
712
713 VERSION=1.45
714
715 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
716 { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
717 fi
718 cat >> confdefs.h <<EOF
719 #define PACKAGE "$PACKAGE"
720 EOF
721
722 cat >> confdefs.h <<EOF
723 #define VERSION "$VERSION"
724 EOF
725
726
727
728 missing_dir=`cd $ac_aux_dir && pwd`
729 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
730 echo "configure:732: checking for working aclocal" >&5
731 # Run test in a subshell; some versions of sh will print an error if
732 # an executable is not found, even if stderr is redirected.
733 # Redirect stdin to placate older versions of autoconf. Sigh.
734 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
735 ACLOCAL=aclocal
736 echo "$ac_t""found" 1>&6
737 else
738 ACLOCAL="$missing_dir/missing aclocal"
739 echo "$ac_t""missing" 1>&6
740 fi
741
742 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
743 echo "configure:745: checking for working autoconf" >&5
744 # Run test in a subshell; some versions of sh will print an error if
745 # an executable is not found, even if stderr is redirected.
746 # Redirect stdin to placate older versions of autoconf. Sigh.
747 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
748 AUTOCONF=autoconf
749 echo "$ac_t""found" 1>&6
750 else
751 AUTOCONF="$missing_dir/missing autoconf"
752 echo "$ac_t""missing" 1>&6
753 fi
754
755 echo $ac_n "checking for working automake""... $ac_c" 1>&6
756 echo "configure:758: checking for working automake" >&5
757 # Run test in a subshell; some versions of sh will print an error if
758 # an executable is not found, even if stderr is redirected.
759 # Redirect stdin to placate older versions of autoconf. Sigh.
760 if (automake --version) < /dev/null > /dev/null 2>&1; then
761 AUTOMAKE=automake
762 echo "$ac_t""found" 1>&6
763 else
764 AUTOMAKE="$missing_dir/missing automake"
765 echo "$ac_t""missing" 1>&6
766 fi
767
768 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
769 echo "configure:771: checking for working autoheader" >&5
770 # Run test in a subshell; some versions of sh will print an error if
771 # an executable is not found, even if stderr is redirected.
772 # Redirect stdin to placate older versions of autoconf. Sigh.
773 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
774 AUTOHEADER=autoheader
775 echo "$ac_t""found" 1>&6
776 else
777 AUTOHEADER="$missing_dir/missing autoheader"
778 echo "$ac_t""missing" 1>&6
779 fi
780
781 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
782 echo "configure:784: checking for working makeinfo" >&5
783 # Run test in a subshell; some versions of sh will print an error if
784 # an executable is not found, even if stderr is redirected.
785 # Redirect stdin to placate older versions of autoconf. Sigh.
786 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
787 MAKEINFO=makeinfo
788 echo "$ac_t""found" 1>&6
789 else
790 MAKEINFO="$missing_dir/missing makeinfo"
791 echo "$ac_t""missing" 1>&6
792 fi
793
794
795
796 ######## Detect the canonical host and target build environment
797
798 # Make sure we can run config.sub.
799 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
800 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
801 fi
802
803 echo $ac_n "checking host system type""... $ac_c" 1>&6
804 echo "configure:806: checking host system type" >&5
805
806 host_alias=$host
807 case "$host_alias" in
808 NONE)
809 case $nonopt in
810 NONE)
811 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
812 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
813 fi ;;
814 *) host_alias=$nonopt ;;
815 esac ;;
816 esac
817
818 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
819 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
820 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
821 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
822 echo "$ac_t""$host" 1>&6
823
824 echo $ac_n "checking target system type""... $ac_c" 1>&6
825 echo "configure:827: checking target system type" >&5
826
827 target_alias=$target
828 case "$target_alias" in
829 NONE)
830 case $nonopt in
831 NONE) target_alias=$host_alias ;;
832 *) target_alias=$nonopt ;;
833 esac ;;
834 esac
835
836 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
837 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
838 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
839 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
840 echo "$ac_t""$target" 1>&6
841
842
843 ######## Check for tools
844 # Extract the first word of "gcc", so it can be a program name with args.
845 set dummy gcc; ac_word=$2
846 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
847 echo "configure:849: checking for $ac_word" >&5
848 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
849 echo $ac_n "(cached) $ac_c" 1>&6
850 else
851 if test -n "$CC"; then
852 ac_cv_prog_CC="$CC" # Let the user override the test.
853 else
854 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
855 ac_dummy="$PATH"
856 for ac_dir in $ac_dummy; do
857 test -z "$ac_dir" && ac_dir=.
858 if test -f $ac_dir/$ac_word; then
859 ac_cv_prog_CC="gcc"
860 break
861 fi
862 done
863 IFS="$ac_save_ifs"
864 fi
865 fi
866 CC="$ac_cv_prog_CC"
867 if test -n "$CC"; then
868 echo "$ac_t""$CC" 1>&6
869 else
870 echo "$ac_t""no" 1>&6
871 fi
872
873 if test -z "$CC"; then
874 # Extract the first word of "cc", so it can be a program name with args.
875 set dummy cc; ac_word=$2
876 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
877 echo "configure:879: checking for $ac_word" >&5
878 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
879 echo $ac_n "(cached) $ac_c" 1>&6
880 else
881 if test -n "$CC"; then
882 ac_cv_prog_CC="$CC" # Let the user override the test.
883 else
884 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
885 ac_prog_rejected=no
886 ac_dummy="$PATH"
887 for ac_dir in $ac_dummy; do
888 test -z "$ac_dir" && ac_dir=.
889 if test -f $ac_dir/$ac_word; then
890 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
891 ac_prog_rejected=yes
892 continue
893 fi
894 ac_cv_prog_CC="cc"
895 break
896 fi
897 done
898 IFS="$ac_save_ifs"
899 if test $ac_prog_rejected = yes; then
900 # We found a bogon in the path, so make sure we never use it.
901 set dummy $ac_cv_prog_CC
902 shift
903 if test $# -gt 0; then
904 # We chose a different compiler from the bogus one.
905 # However, it has the same basename, so the bogon will be chosen
906 # first if we set CC to just the basename; use the full file name.
907 shift
908 set dummy "$ac_dir/$ac_word" "$@"
909 shift
910 ac_cv_prog_CC="$@"
911 fi
912 fi
913 fi
914 fi
915 CC="$ac_cv_prog_CC"
916 if test -n "$CC"; then
917 echo "$ac_t""$CC" 1>&6
918 else
919 echo "$ac_t""no" 1>&6
920 fi
921
922 if test -z "$CC"; then
923 case "`uname -s`" in
924 *win32* | *WIN32*)
925 # Extract the first word of "cl", so it can be a program name with args.
926 set dummy cl; ac_word=$2
927 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
928 echo "configure:930: checking for $ac_word" >&5
929 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
930 echo $ac_n "(cached) $ac_c" 1>&6
931 else
932 if test -n "$CC"; then
933 ac_cv_prog_CC="$CC" # Let the user override the test.
934 else
935 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
936 ac_dummy="$PATH"
937 for ac_dir in $ac_dummy; do
938 test -z "$ac_dir" && ac_dir=.
939 if test -f $ac_dir/$ac_word; then
940 ac_cv_prog_CC="cl"
941 break
942 fi
943 done
944 IFS="$ac_save_ifs"
945 fi
946 fi
947 CC="$ac_cv_prog_CC"
948 if test -n "$CC"; then
949 echo "$ac_t""$CC" 1>&6
950 else
951 echo "$ac_t""no" 1>&6
952 fi
953 ;;
954 esac
955 fi
956 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
957 fi
958
959 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
960 echo "configure:962: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
961
962 ac_ext=c
963 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
964 ac_cpp='$CPP $CPPFLAGS'
965 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
966 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
967 cross_compiling=$ac_cv_prog_cc_cross
968
969 cat > conftest.$ac_ext << EOF
970
971 #line 973 "configure"
972 #include "confdefs.h"
973
974 main(){return(0);}
975 EOF
976 if { (eval echo configure:978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
977 ac_cv_prog_cc_works=yes
978 # If we can't run a trivial program, we are probably using a cross compiler.
979 if (./conftest; exit) 2>/dev/null; then
980 ac_cv_prog_cc_cross=no
981 else
982 ac_cv_prog_cc_cross=yes
983 fi
984 else
985 echo "configure: failed program was:" >&5
986 cat conftest.$ac_ext >&5
987 ac_cv_prog_cc_works=no
988 fi
989 rm -fr conftest*
990 ac_ext=c
991 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
992 ac_cpp='$CPP $CPPFLAGS'
993 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
994 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
995 cross_compiling=$ac_cv_prog_cc_cross
996
997 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
998 if test $ac_cv_prog_cc_works = no; then
999 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1000 fi
1001 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1002 echo "configure:1004: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1003 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1004 cross_compiling=$ac_cv_prog_cc_cross
1005
1006 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1007 echo "configure:1009: checking whether we are using GNU C" >&5
1008 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1009 echo $ac_n "(cached) $ac_c" 1>&6
1010 else
1011 cat > conftest.c <<EOF
1012 #ifdef __GNUC__
1013 yes;
1014 #endif
1015 EOF
1016 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1017 ac_cv_prog_gcc=yes
1018 else
1019 ac_cv_prog_gcc=no
1020 fi
1021 fi
1022
1023 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1024
1025 if test $ac_cv_prog_gcc = yes; then
1026 GCC=yes
1027 else
1028 GCC=
1029 fi
1030
1031 ac_test_CFLAGS="${CFLAGS+set}"
1032 ac_save_CFLAGS="$CFLAGS"
1033 CFLAGS=
1034 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1035 echo "configure:1037: checking whether ${CC-cc} accepts -g" >&5
1036 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1037 echo $ac_n "(cached) $ac_c" 1>&6
1038 else
1039 echo 'void f(){}' > conftest.c
1040 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1041 ac_cv_prog_cc_g=yes
1042 else
1043 ac_cv_prog_cc_g=no
1044 fi
1045 rm -f conftest*
1046
1047 fi
1048
1049 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1050 if test "$ac_test_CFLAGS" = set; then
1051 CFLAGS="$ac_save_CFLAGS"
1052 elif test $ac_cv_prog_cc_g = yes; then
1053 if test "$GCC" = yes; then
1054 CFLAGS="-g -O2"
1055 else
1056 CFLAGS="-g"
1057 fi
1058 else
1059 if test "$GCC" = yes; then
1060 CFLAGS="-O2"
1061 else
1062 CFLAGS=
1063 fi
1064 fi
1065
1066 # Find a good install program. We prefer a C program (faster),
1067 # so one script is as good as another. But avoid the broken or
1068 # incompatible versions:
1069 # SysV /etc/install, /usr/sbin/install
1070 # SunOS /usr/etc/install
1071 # IRIX /sbin/install
1072 # AIX /bin/install
1073 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1074 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1075 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1076 # ./install, which can be erroneously created by make from ./install.sh.
1077 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1078 echo "configure:1080: checking for a BSD compatible install" >&5
1079 if test -z "$INSTALL"; then
1080 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1081 echo $ac_n "(cached) $ac_c" 1>&6
1082 else
1083 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
1084 for ac_dir in $PATH; do
1085 # Account for people who put trailing slashes in PATH elements.
1086 case "$ac_dir/" in
1087 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1088 *)
1089 # OSF1 and SCO ODT 3.0 have their own names for install.
1090 # Don't use installbsd from OSF since it installs stuff as root
1091 # by default.
1092 for ac_prog in ginstall scoinst install; do
1093 if test -f $ac_dir/$ac_prog; then
1094 if test $ac_prog = install &&
1095 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1096 # AIX install. It has an incompatible calling convention.
1097 :
1098 else
1099 ac_cv_path_install="$ac_dir/$ac_prog -c"
1100 break 2
1101 fi
1102 fi
1103 done
1104 ;;
1105 esac
1106 done
1107 IFS="$ac_save_IFS"
1108
1109 fi
1110 if test "${ac_cv_path_install+set}" = set; then
1111 INSTALL="$ac_cv_path_install"
1112 else
1113 # As a last resort, use the slow shell script. We don't cache a
1114 # path for INSTALL within a source directory, because that will
1115 # break other packages using the cache if that directory is
1116 # removed, or if the path is relative.
1117 INSTALL="$ac_install_sh"
1118 fi
1119 fi
1120 echo "$ac_t""$INSTALL" 1>&6
1121
1122 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1123 # It thinks the first close brace ends the variable substitution.
1124 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1125
1126 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1127
1128 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1129
1130 # Extract the first word of "ranlib", so it can be a program name with args.
1131 set dummy ranlib; ac_word=$2
1132 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1133 echo "configure:1135: checking for $ac_word" >&5
1134 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1135 echo $ac_n "(cached) $ac_c" 1>&6
1136 else
1137 if test -n "$RANLIB"; then
1138 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1139 else
1140 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1141 ac_dummy="$PATH"
1142 for ac_dir in $ac_dummy; do
1143 test -z "$ac_dir" && ac_dir=.
1144 if test -f $ac_dir/$ac_word; then
1145 ac_cv_prog_RANLIB="ranlib"
1146 break
1147 fi
1148 done
1149 IFS="$ac_save_ifs"
1150 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1151 fi
1152 fi
1153 RANLIB="$ac_cv_prog_RANLIB"
1154 if test -n "$RANLIB"; then
1155 echo "$ac_t""$RANLIB" 1>&6
1156 else
1157 echo "$ac_t""no" 1>&6
1158 fi
1159
1160
1161 ######## Check for compiler environment
1162 echo $ac_n "checking for working const""... $ac_c" 1>&6
1163 echo "configure:1165: checking for working const" >&5
1164 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1165 echo $ac_n "(cached) $ac_c" 1>&6
1166 else
1167 cat > conftest.$ac_ext <<EOF
1168 #line 1170 "configure"
1169 #include "confdefs.h"
1170
1171 int main() {
1172
1173 /* Ultrix mips cc rejects this. */
1174 typedef int charset[2]; const charset x;
1175 /* SunOS 4.1.1 cc rejects this. */
1176 char const *const *ccp;
1177 char **p;
1178 /* NEC SVR4.0.2 mips cc rejects this. */
1179 struct point {int x, y;};
1180 static struct point const zero = {0,0};
1181 /* AIX XL C 1.02.0.0 rejects this.
1182 It does not let you subtract one const X* pointer from another in an arm
1183 of an if-expression whose if-part is not a constant expression */
1184 const char *g = "string";
1185 ccp = &g + (g ? g-g : 0);
1186 /* HPUX 7.0 cc rejects these. */
1187 ++ccp;
1188 p = (char**) ccp;
1189 ccp = (char const *const *) p;
1190 { /* SCO 3.2v4 cc rejects this. */
1191 char *t;
1192 char const *s = 0 ? (char *) 0 : (char const *) 0;
1193
1194 *t++ = 0;
1195 }
1196 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
1197 int x[] = {25, 17};
1198 const int *foo = &x[0];
1199 ++foo;
1200 }
1201 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1202 typedef const int *iptr;
1203 iptr p = 0;
1204 ++p;
1205 }
1206 { /* AIX XL C 1.02.0.0 rejects this saying
1207 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1208 struct s { int j; const int *ap[3]; };
1209 struct s *b; b->j = 5;
1210 }
1211 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1212 const int foo = 10;
1213 }
1214
1215 ; return 0; }
1216 EOF
1217 if { (eval echo configure:1219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1218 rm -rf conftest*
1219 ac_cv_c_const=yes
1220 else
1221 echo "configure: failed program was:" >&5
1222 cat conftest.$ac_ext >&5
1223 rm -rf conftest*
1224 ac_cv_c_const=no
1225 fi
1226 rm -f conftest*
1227 fi
1228
1229 echo "$ac_t""$ac_cv_c_const" 1>&6
1230 if test $ac_cv_c_const = no; then
1231 cat >> confdefs.h <<\EOF
1232 #define const
1233 EOF
1234
1235 fi
1236
1237
1238 ######## Figure out which math library to use
1239 case "$target" in
1240 *-*-mingw32*)
1241 MATHLIB=""
1242 ;;
1243 *-*-beos*)
1244 MATHLIB=""
1245 ;;
1246 *)
1247 MATHLIB="-lm"
1248 echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
1249 echo "configure:1251: checking for main in -lm" >&5
1250 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
1251 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1252 echo $ac_n "(cached) $ac_c" 1>&6
1253 else
1254 ac_save_LIBS="$LIBS"
1255 LIBS="-lm $LIBS"
1256 cat > conftest.$ac_ext <<EOF
1257 #line 1259 "configure"
1258 #include "confdefs.h"
1259
1260 int main() {
1261 main()
1262 ; return 0; }
1263 EOF
1264 if { (eval echo configure:1266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1265 rm -rf conftest*
1266 eval "ac_cv_lib_$ac_lib_var=yes"
1267 else
1268 echo "configure: failed program was:" >&5
1269 cat conftest.$ac_ext >&5
1270 rm -rf conftest*
1271 eval "ac_cv_lib_$ac_lib_var=no"
1272 fi
1273 rm -f conftest*
1274 LIBS="$ac_save_LIBS"
1275
1276 fi
1277 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1278 echo "$ac_t""yes" 1>&6
1279 ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1280 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1281 cat >> confdefs.h <<EOF
1282 #define $ac_tr_lib 1
1283 EOF
1284
1285 LIBS="-lm $LIBS"
1286
1287 else
1288 echo "$ac_t""no" 1>&6
1289 { echo "configure: error: Your system is missing libm (mathlib)!" 1>&2; exit 1; }
1290 fi
1291
1292 ;;
1293 esac
1294
1295
1296 ######## Check for SDL
1297 # Check whether --with-sdl-prefix or --without-sdl-prefix was given.
1298 if test "${with_sdl_prefix+set}" = set; then
1299 withval="$with_sdl_prefix"
1300 sdl_prefix="$withval"
1301 else
1302 sdl_prefix=""
1303 fi
1304
1305 # Check whether --with-sdl-exec-prefix or --without-sdl-exec-prefix was given.
1306 if test "${with_sdl_exec_prefix+set}" = set; then
1307 withval="$with_sdl_exec_prefix"
1308 sdl_exec_prefix="$withval"
1309 else
1310 sdl_exec_prefix=""
1311 fi
1312
1313 # Check whether --enable-sdltest or --disable-sdltest was given.
1314 if test "${enable_sdltest+set}" = set; then
1315 enableval="$enable_sdltest"
1316 :
1317 else
1318 enable_sdltest=yes
1319 fi
1320
1321
1322 if test x$sdl_exec_prefix != x ; then
1323 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
1324 if test x${SDL_CONFIG+set} != xset ; then
1325 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
1326 fi
1327 fi
1328 if test x$sdl_prefix != x ; then
1329 sdl_args="$sdl_args --prefix=$sdl_prefix"
1330 if test x${SDL_CONFIG+set} != xset ; then
1331 SDL_CONFIG=$sdl_prefix/bin/sdl-config
1332 fi
1333 fi
1334
1335
1336 # Extract the first word of "sdl-config", so it can be a program name with args.
1337 set dummy sdl-config; ac_word=$2
1338 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1339 echo "configure:1341: checking for $ac_word" >&5
1340 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
1341 echo $ac_n "(cached) $ac_c" 1>&6
1342 else
1343 case "$SDL_CONFIG" in
1344 /*)
1345 ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path.
1346 ;;
1347 ?:/*)
1348 ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a dos path.
1349 ;;
1350 *)
1351 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1352 ac_dummy="$PATH"
1353 for ac_dir in $ac_dummy; do
1354 test -z "$ac_dir" && ac_dir=.
1355 if test -f $ac_dir/$ac_word; then
1356 ac_cv_path_SDL_CONFIG="$ac_dir/$ac_word"
1357 break
1358 fi
1359 done
1360 IFS="$ac_save_ifs"
1361 test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no"
1362 ;;
1363 esac
1364 fi
1365 SDL_CONFIG="$ac_cv_path_SDL_CONFIG"
1366 if test -n "$SDL_CONFIG"; then
1367 echo "$ac_t""$SDL_CONFIG" 1>&6
1368 else
1369 echo "$ac_t""no" 1>&6
1370 fi
1371
1372 min_sdl_version=$SDL_VERSION
1373 echo $ac_n "checking for SDL - version >= $min_sdl_version""... $ac_c" 1>&6
1374 echo "configure:1376: checking for SDL - version >= $min_sdl_version" >&5
1375 no_sdl=""
1376 if test "$SDL_CONFIG" = "no" ; then
1377 no_sdl=yes
1378 else
1379 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
1380 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
1381
1382 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
1383 sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
1384 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
1385 sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
1386 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
1387 sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
1388 if test "x$enable_sdltest" = "xyes" ; then
1389 ac_save_CFLAGS="$CFLAGS"
1390 ac_save_LIBS="$LIBS"
1391 CFLAGS="$CFLAGS $SDL_CFLAGS"
1392 LIBS="$LIBS $SDL_LIBS"
1393 rm -f conf.sdltest
1394 if test "$cross_compiling" = yes; then
1395 echo $ac_n "cross compiling; assumed OK... $ac_c"
1396 else
1397 cat > conftest.$ac_ext <<EOF
1398 #line 1400 "configure"
1399 #include "confdefs.h"
1400
1401 #include <stdio.h>
1402 #include <stdlib.h>
1403 #include <string.h>
1404 #include "SDL.h"
1405
1406 char*
1407 my_strdup (char *str)
1408 {
1409 char *new_str;
1410
1411 if (str)
1412 {
1413 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
1414 strcpy (new_str, str);
1415 }
1416 else
1417 new_str = NULL;
1418
1419 return new_str;
1420 }
1421
1422 int main (int argc, char *argv[])
1423 {
1424 int major, minor, micro;
1425 char *tmp_version;
1426
1427 /* This hangs on some systems (?)
1428 system ("touch conf.sdltest");
1429 */
1430 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
1431
1432 /* HP/UX 9 (%@#!) writes to sscanf strings */
1433 tmp_version = my_strdup("$min_sdl_version");
1434 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1435 printf("%s, bad version string\n", "$min_sdl_version");
1436 exit(1);
1437 }
1438
1439 if (($sdl_major_version > major) ||
1440 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
1441 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
1442 {
1443 return 0;
1444 }
1445 else
1446 {
1447 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
1448 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
1449 printf("*** best to upgrade to the required version.\n");
1450 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
1451 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
1452 printf("*** config.cache before re-running configure\n");
1453 return 1;
1454 }
1455 }
1456
1457
1458 EOF
1459 if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1460 then
1461 :
1462 else
1463 echo "configure: failed program was:" >&5
1464 cat conftest.$ac_ext >&5
1465 rm -fr conftest*
1466 no_sdl=yes
1467 fi
1468 rm -fr conftest*
1469 fi
1470
1471 CFLAGS="$ac_save_CFLAGS"
1472 LIBS="$ac_save_LIBS"
1473 fi
1474 fi
1475 if test "x$no_sdl" = x ; then
1476 echo "$ac_t""yes" 1>&6
1477 :
1478 else
1479 echo "$ac_t""no" 1>&6
1480 if test "$SDL_CONFIG" = "no" ; then
1481 echo "*** The sdl-config script installed by SDL could not be found"
1482 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
1483 echo "*** your path, or set the SDL_CONFIG environment variable to the"
1484 echo "*** full path to sdl-config."
1485 else
1486 if test -f conf.sdltest ; then
1487 :
1488 else
1489 echo "*** Could not run SDL test program, checking why..."
1490 CFLAGS="$CFLAGS $SDL_CFLAGS"
1491 LIBS="$LIBS $SDL_LIBS"
1492 cat > conftest.$ac_ext <<EOF
1493 #line 1495 "configure"
1494 #include "confdefs.h"
1495
1496 #include <stdio.h>
1497 #include "SDL.h"
1498
1499 int main(int argc, char *argv[])
1500 { return 0; }
1501 #undef main
1502 #define main K_and_R_C_main
1503
1504 int main() {
1505 return 0;
1506 ; return 0; }
1507 EOF
1508 if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1509 rm -rf conftest*
1510 echo "*** The test program compiled, but did not run. This usually means"
1511 echo "*** that the run-time linker is not finding SDL or finding the wrong"
1512 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
1513 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1514 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1515 echo "*** is required on your system"
1516 echo "***"
1517 echo "*** If you have an old version installed, it is best to remove it, although"
1518 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1519 else
1520 echo "configure: failed program was:" >&5
1521 cat conftest.$ac_ext >&5
1522 rm -rf conftest*
1523 echo "*** The test program failed to compile or link. See the file config.log for the"
1524 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
1525 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
1526 echo "*** may want to edit the sdl-config script: $SDL_CONFIG"
1527 fi
1528 rm -f conftest*
1529 CFLAGS="$ac_save_CFLAGS"
1530 LIBS="$ac_save_LIBS"
1531 fi
1532 fi
1533 SDL_CFLAGS=""
1534 SDL_LIBS=""
1535 { echo "configure: error: *** SDL version $SDL_VERSION not found!" 1>&2; exit 1; }
1536
1537 fi
1538
1539
1540 rm -f conf.sdltest
1541
1542
1543 ######## Check for other libs
1544 echo $ac_n "checking for main in -ljpeg""... $ac_c" 1>&6
1545 echo "configure:1547: checking for main in -ljpeg" >&5
1546 ac_lib_var=`echo jpeg'_'main | sed 'y%./+-%__p_%'`
1547 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1548 echo $ac_n "(cached) $ac_c" 1>&6
1549 else
1550 ac_save_LIBS="$LIBS"
1551 LIBS="-ljpeg $LIBS"
1552 cat > conftest.$ac_ext <<EOF
1553 #line 1555 "configure"
1554 #include "confdefs.h"
1555
1556 int main() {
1557 main()
1558 ; return 0; }
1559 EOF
1560 if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1561 rm -rf conftest*
1562 eval "ac_cv_lib_$ac_lib_var=yes"
1563 else
1564 echo "configure: failed program was:" >&5
1565 cat conftest.$ac_ext >&5
1566 rm -rf conftest*
1567 eval "ac_cv_lib_$ac_lib_var=no"
1568 fi
1569 rm -f conftest*
1570 LIBS="$ac_save_LIBS"
1571
1572 fi
1573 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1574 echo "$ac_t""yes" 1>&6
1575 ac_tr_lib=HAVE_LIB`echo jpeg | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1576 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1577 cat >> confdefs.h <<EOF
1578 #define $ac_tr_lib 1
1579 EOF
1580
1581 LIBS="-ljpeg $LIBS"
1582
1583 else
1584 echo "$ac_t""no" 1>&6
1585 { echo "configure: error: Your system is missing libjpeg!" 1>&2; exit 1; }
1586 fi
1587
1588
1589 #Commented out because of a bug in the SuSE 6.2
1590 #AC_CHECK_LIB(png, main, , AC_MSG_ERROR(Your system is missing libpng!))
1591
1592 echo $ac_n "checking for main in -lSDL_mixer""... $ac_c" 1>&6
1593 echo "configure:1595: checking for main in -lSDL_mixer" >&5
1594 ac_lib_var=`echo SDL_mixer'_'main | sed 'y%./+-%__p_%'`
1595 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1596 echo $ac_n "(cached) $ac_c" 1>&6
1597 else
1598 ac_save_LIBS="$LIBS"
1599 LIBS="-lSDL_mixer $LIBS"
1600 cat > conftest.$ac_ext <<EOF
1601 #line 1603 "configure"
1602 #include "confdefs.h"
1603
1604 int main() {
1605 main()
1606 ; return 0; }
1607 EOF
1608 if { (eval echo configure:1610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1609 rm -rf conftest*
1610 eval "ac_cv_lib_$ac_lib_var=yes"
1611 else
1612 echo "configure: failed program was:" >&5
1613 cat conftest.$ac_ext >&5
1614 rm -rf conftest*
1615 eval "ac_cv_lib_$ac_lib_var=no"
1616 fi
1617 rm -f conftest*
1618 LIBS="$ac_save_LIBS"
1619
1620 fi
1621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1622 echo "$ac_t""yes" 1>&6
1623 SOUND="-lSDL_mixer";CFLAGS="$CFLAGS -DSOUND"
1624 else
1625 echo "$ac_t""no" 1>&6
1626 fi
1627
1628
1629 ######## Set compiler flags and libraries
1630 CFLAGS="$CFLAGS $SDL_CFLAGS -DDATADIR=\\\"$datadir/bumprace\\\""
1631 LIBS="$LIBS $SDL_LIBS -ljpeg -lpng $SOUND -lz -lSDL"
1632
1633 ######## Check for headers
1634 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1635 echo "configure:1637: checking how to run the C preprocessor" >&5
1636 # On Suns, sometimes $CPP names a directory.
1637 if test -n "$CPP" && test -d "$CPP"; then
1638 CPP=
1639 fi
1640 if test -z "$CPP"; then
1641 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1642 echo $ac_n "(cached) $ac_c" 1>&6
1643 else
1644 # This must be in double quotes, not single quotes, because CPP may get
1645 # substituted into the Makefile and "${CC-cc}" will confuse make.
1646 CPP="${CC-cc} -E"
1647 # On the NeXT, cc -E runs the code through the compiler's parser,
1648 # not just through cpp.
1649 cat > conftest.$ac_ext <<EOF
1650 #line 1652 "configure"
1651 #include "confdefs.h"
1652 #include <assert.h>
1653 Syntax Error
1654 EOF
1655 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1656 { (eval echo configure:1658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1657 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1658 if test -z "$ac_err"; then
1659 :
1660 else
1661 echo "$ac_err" >&5
1662 echo "configure: failed program was:" >&5
1663 cat conftest.$ac_ext >&5
1664 rm -rf conftest*
1665 CPP="${CC-cc} -E -traditional-cpp"
1666 cat > conftest.$ac_ext <<EOF
1667 #line 1669 "configure"
1668 #include "confdefs.h"
1669 #include <assert.h>
1670 Syntax Error
1671 EOF
1672 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1673 { (eval echo configure:1675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1674 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1675 if test -z "$ac_err"; then
1676 :
1677 else
1678 echo "$ac_err" >&5
1679 echo "configure: failed program was:" >&5
1680 cat conftest.$ac_ext >&5
1681 rm -rf conftest*
1682 CPP="${CC-cc} -nologo -E"
1683 cat > conftest.$ac_ext <<EOF
1684 #line 1686 "configure"
1685 #include "confdefs.h"
1686 #include <assert.h>
1687 Syntax Error
1688 EOF
1689 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1690 { (eval echo configure:1692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1691 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1692 if test -z "$ac_err"; then
1693 :
1694 else
1695 echo "$ac_err" >&5
1696 echo "configure: failed program was:" >&5
1697 cat conftest.$ac_ext >&5
1698 rm -rf conftest*
1699 CPP=/lib/cpp
1700 fi
1701 rm -f conftest*
1702 fi
1703 rm -f conftest*
1704 fi
1705 rm -f conftest*
1706 ac_cv_prog_CPP="$CPP"
1707 fi
1708 CPP="$ac_cv_prog_CPP"
1709 else
1710 ac_cv_prog_CPP="$CPP"
1711 fi
1712 echo "$ac_t""$CPP" 1>&6
1713
1714 for ac_hdr in png.h
1715 do
1716 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1717 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1718 echo "configure:1720: checking for $ac_hdr" >&5
1719 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1720 echo $ac_n "(cached) $ac_c" 1>&6
1721 else
1722 cat > conftest.$ac_ext <<EOF
1723 #line 1725 "configure"
1724 #include "confdefs.h"
1725 #include <$ac_hdr>
1726 EOF
1727 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1728 { (eval echo configure:1730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1729 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1730 if test -z "$ac_err"; then
1731 rm -rf conftest*
1732 eval "ac_cv_header_$ac_safe=yes"
1733 else
1734 echo "$ac_err" >&5
1735 echo "configure: failed program was:" >&5
1736 cat conftest.$ac_ext >&5
1737 rm -rf conftest*
1738 eval "ac_cv_header_$ac_safe=no"
1739 fi
1740 rm -f conftest*
1741 fi
1742 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1743 echo "$ac_t""yes" 1>&6
1744 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1745 cat >> confdefs.h <<EOF
1746 #define $ac_tr_hdr 1
1747 EOF
1748
1749 else
1750 echo "$ac_t""no" 1>&6
1751 { echo "configure: error: Your system is missing png.h ! You will probably have to install the png-devel package" 1>&2; exit 1; }
1752 fi
1753 done
1754
1755 for ac_hdr in jpeglib.h
1756 do
1757 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1758 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1759 echo "configure:1761: checking for $ac_hdr" >&5
1760 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1761 echo $ac_n "(cached) $ac_c" 1>&6
1762 else
1763 cat > conftest.$ac_ext <<EOF
1764 #line 1766 "configure"
1765 #include "confdefs.h"
1766 #include <$ac_hdr>
1767 EOF
1768 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1769 { (eval echo configure:1771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1770 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1771 if test -z "$ac_err"; then
1772 rm -rf conftest*
1773 eval "ac_cv_header_$ac_safe=yes"
1774 else
1775 echo "$ac_err" >&5
1776 echo "configure: failed program was:" >&5
1777 cat conftest.$ac_ext >&5
1778 rm -rf conftest*
1779 eval "ac_cv_header_$ac_safe=no"
1780 fi
1781 rm -f conftest*
1782 fi
1783 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1784 echo "$ac_t""yes" 1>&6
1785 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1786 cat >> confdefs.h <<EOF
1787 #define $ac_tr_hdr 1
1788 EOF
1789
1790 else
1791 echo "$ac_t""no" 1>&6
1792 { echo "configure: error: Your system is missing jpeglib.h ! You will probably have to install the jpeg-devel package" 1>&2; exit 1; }
1793 fi
1794 done
1795
1796
1797 ######## Finally create all the generated files
1798 trap '' 1 2 15
1799 cat > confcache <<\EOF
1800 # This file is a shell script that caches the results of configure
1801 # tests run on this system so they can be shared between configure
1802 # scripts and configure runs. It is not useful on other systems.
1803 # If it contains results you don't want to keep, you may remove or edit it.
1804 #
1805 # By default, configure uses ./config.cache as the cache file,
1806 # creating it if it does not exist already. You can give configure
1807 # the --cache-file=FILE option to use a different cache file; that is
1808 # what configure does when it calls configure scripts in
1809 # subdirectories, so they share the cache.
1810 # Giving --cache-file=/dev/null disables caching, for debugging configure.
1811 # config.status only pays attention to the cache file if you give it the
1812 # --recheck option to rerun configure.
1813 #
1814 EOF
1815 # The following way of writing the cache mishandles newlines in values,
1816 # but we know of no workaround that is simple, portable, and efficient.
1817 # So, don't put newlines in cache variables' values.
1818 # Ultrix sh set writes to stderr and can't be redirected directly,
1819 # and sets the high bit in the cache file unless we assign to the vars.
1820 (set) 2>&1 |
1821 case `(ac_space=' '; set | grep ac_space) 2>&1` in
1822 *ac_space=\ *)
1823 # `set' does not quote correctly, so add quotes (double-quote substitution
1824 # turns \\\\ into \\, and sed turns \\ into \).
1825 sed -n \
1826 -e "s/'/'\\\\''/g" \
1827 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
1828 ;;
1829 *)
1830 # `set' quotes correctly as required by POSIX, so do not add quotes.
1831 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
1832 ;;
1833 esac >> confcache
1834 if cmp -s $cache_file confcache; then
1835 :
1836 else
1837 if test -w $cache_file; then
1838 echo "updating cache $cache_file"
1839 cat confcache > $cache_file
1840 else
1841 echo "not updating unwritable cache $cache_file"
1842 fi
1843 fi
1844 rm -f confcache
1845
1846 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1847
1848 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1849 # Let make expand exec_prefix.
1850 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1851
1852 # Any assignment to VPATH causes Sun make to only execute
1853 # the first set of double-colon rules, so remove it if not needed.
1854 # If there is a colon in the path, we need to keep it.
1855 if test "x$srcdir" = x.; then
1856 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
1857 fi
1858
1859 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1860
1861 # Transform confdefs.h into DEFS.
1862 # Protect against shell expansion while executing Makefile rules.
1863 # Protect against Makefile macro expansion.
1864 cat > conftest.defs <<\EOF
1865 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
1866 s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
1867 s%\[%\\&%g
1868 s%\]%\\&%g
1869 s%\$%$$%g
1870 EOF
1871 DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
1872 rm -f conftest.defs
1873
1874
1875 # Without the "./", some shells look in PATH for config.status.
1876 : ${CONFIG_STATUS=./config.status}
1877
1878 echo creating $CONFIG_STATUS
1879 rm -f $CONFIG_STATUS
1880 cat > $CONFIG_STATUS <<EOF
1881 #! /bin/sh
1882 # Generated automatically by configure.
1883 # Run this file to recreate the current configuration.
1884 # This directory was configured as follows,
1885 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1886 #
1887 # $0 $ac_configure_args
1888 #
1889 # Compiler output produced by configure, useful for debugging
1890 # configure, is in ./config.log if it exists.
1891
1892 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1893 for ac_option
1894 do
1895 case "\$ac_option" in
1896 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1897 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1898 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1899 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1900 echo "$CONFIG_STATUS generated by autoconf version 2.13"
1901 exit 0 ;;
1902 -help | --help | --hel | --he | --h)
1903 echo "\$ac_cs_usage"; exit 0 ;;
1904 *) echo "\$ac_cs_usage"; exit 1 ;;
1905 esac
1906 done
1907
1908 ac_given_srcdir=$srcdir
1909 ac_given_INSTALL="$INSTALL"
1910
1911 trap 'rm -fr `echo "
1912 Makefile
1913 src/Makefile
1914 data/Makefile
1915 data/gfx/Makefile
1916 data/sound/Makefile
1917 " | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1918 EOF
1919 cat >> $CONFIG_STATUS <<EOF
1920
1921 # Protect against being on the right side of a sed subst in config.status.
1922 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
1923 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
1924 $ac_vpsub
1925 $extrasub
1926 s%@SHELL@%$SHELL%g
1927 s%@CFLAGS@%$CFLAGS%g
1928 s%@CPPFLAGS@%$CPPFLAGS%g
1929 s%@CXXFLAGS@%$CXXFLAGS%g
1930 s%@FFLAGS@%$FFLAGS%g
1931 s%@DEFS@%$DEFS%g
1932 s%@LDFLAGS@%$LDFLAGS%g
1933 s%@LIBS@%$LIBS%g
1934 s%@exec_prefix@%$exec_prefix%g
1935 s%@prefix@%$prefix%g
1936 s%@program_transform_name@%$program_transform_name%g
1937 s%@bindir@%$bindir%g
1938 s%@sbindir@%$sbindir%g
1939 s%@libexecdir@%$libexecdir%g
1940 s%@datadir@%$datadir%g
1941 s%@sysconfdir@%$sysconfdir%g
1942 s%@sharedstatedir@%$sharedstatedir%g
1943 s%@localstatedir@%$localstatedir%g
1944 s%@libdir@%$libdir%g
1945 s%@includedir@%$includedir%g
1946 s%@oldincludedir@%$oldincludedir%g
1947 s%@infodir@%$infodir%g
1948 s%@mandir@%$mandir%g
1949 s%@MIXER_INCLUDED_TRUE@%$MIXER_INCLUDED_TRUE%g
1950 s%@MIXER_INCLUDED_FALSE@%$MIXER_INCLUDED_FALSE%g
1951 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
1952 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
1953 s%@INSTALL_DATA@%$INSTALL_DATA%g
1954 s%@PACKAGE@%$PACKAGE%g
1955 s%@VERSION@%$VERSION%g
1956 s%@ACLOCAL@%$ACLOCAL%g
1957 s%@AUTOCONF@%$AUTOCONF%g
1958 s%@AUTOMAKE@%$AUTOMAKE%g
1959 s%@AUTOHEADER@%$AUTOHEADER%g
1960 s%@MAKEINFO@%$MAKEINFO%g
1961 s%@SET_MAKE@%$SET_MAKE%g
1962 s%@host@%$host%g
1963 s%@host_alias@%$host_alias%g
1964 s%@host_cpu@%$host_cpu%g
1965 s%@host_vendor@%$host_vendor%g
1966 s%@host_os@%$host_os%g
1967 s%@target@%$target%g
1968 s%@target_alias@%$target_alias%g
1969 s%@target_cpu@%$target_cpu%g
1970 s%@target_vendor@%$target_vendor%g
1971 s%@target_os@%$target_os%g
1972 s%@CC@%$CC%g
1973 s%@RANLIB@%$RANLIB%g
1974 s%@MATHLIB@%$MATHLIB%g
1975 s%@SDL_CONFIG@%$SDL_CONFIG%g
1976 s%@SDL_CFLAGS@%$SDL_CFLAGS%g
1977 s%@SDL_LIBS@%$SDL_LIBS%g
1978 s%@CPP@%$CPP%g
1979
1980 CEOF
1981 EOF
1982
1983 cat >> $CONFIG_STATUS <<\EOF
1984
1985 # Split the substitutions into bite-sized pieces for seds with
1986 # small command number limits, like on Digital OSF/1 and HP-UX.
1987 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
1988 ac_file=1 # Number of current file.
1989 ac_beg=1 # First line for current file.
1990 ac_end=$ac_max_sed_cmds # Line after last line for current file.
1991 ac_more_lines=:
1992 ac_sed_cmds=""
1993 while $ac_more_lines; do
1994 if test $ac_beg -gt 1; then
1995 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
1996 else
1997 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
1998 fi
1999 if test ! -s conftest.s$ac_file; then
2000 ac_more_lines=false
2001 rm -f conftest.s$ac_file
2002 else
2003 if test -z "$ac_sed_cmds"; then
2004 ac_sed_cmds="sed -f conftest.s$ac_file"
2005 else
2006 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2007 fi
2008 ac_file=`expr $ac_file + 1`
2009 ac_beg=$ac_end
2010 ac_end=`expr $ac_end + $ac_max_sed_cmds`
2011 fi
2012 done
2013 if test -z "$ac_sed_cmds"; then
2014 ac_sed_cmds=cat
2015 fi
2016 EOF
2017
2018 cat >> $CONFIG_STATUS <<EOF
2019
2020 CONFIG_FILES=\${CONFIG_FILES-"Makefile
2021 src/Makefile
2022 data/Makefile
2023 data/gfx/Makefile
2024 data/sound/Makefile
2025 "}
2026 EOF
2027 cat >> $CONFIG_STATUS <<\EOF
2028 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2029 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2030 case "$ac_file" in
2031 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2032 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2033 *) ac_file_in="${ac_file}.in" ;;
2034 esac
2035
2036 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2037
2038 # Remove last slash and all that follows it. Not all systems have dirname.
2039 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2040 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2041 # The file is in a subdirectory.
2042 test ! -d "$ac_dir" && mkdir "$ac_dir"
2043 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2044 # A "../" for each directory in $ac_dir_suffix.
2045 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2046 else
2047 ac_dir_suffix= ac_dots=
2048 fi
2049
2050 case "$ac_given_srcdir" in
2051 .) srcdir=.
2052 if test -z "$ac_dots"; then top_srcdir=.
2053 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2054 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2055 *) # Relative path.
2056 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2057 top_srcdir="$ac_dots$ac_given_srcdir" ;;
2058 esac
2059
2060 case "$ac_given_INSTALL" in
2061 [/$]*) INSTALL="$ac_given_INSTALL" ;;
2062 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2063 esac
2064
2065 echo creating "$ac_file"
2066 rm -f "$ac_file"
2067 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2068 case "$ac_file" in
2069 *Makefile*) ac_comsub="1i\\
2070 # $configure_input" ;;
2071 *) ac_comsub= ;;
2072 esac
2073
2074 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2075 sed -e "$ac_comsub
2076 s%@configure_input@%$configure_input%g
2077 s%@srcdir@%$srcdir%g
2078 s%@top_srcdir@%$top_srcdir%g
2079 s%@INSTALL@%$INSTALL%g
2080 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2081 fi; done
2082 rm -f conftest.s*
2083
2084 EOF
2085 cat >> $CONFIG_STATUS <<EOF
2086
2087 EOF
2088 cat >> $CONFIG_STATUS <<\EOF
2089
2090 exit 0
2091 EOF
2092 chmod +x $CONFIG_STATUS
2093 rm -fr confdefs* $ac_clean_files
2094 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2095
0 ######## Process this file with autoconf to produce a configure script.
1 AC_INIT(README)
2
3 ######## Setup for automake
4 AM_CONDITIONAL(MIXER_INCLUDED, test -d ./src/mixer )
5
6 NAME="bumprace"
7 SDL_VERSION=1.1.5
8 AM_INIT_AUTOMAKE($NAME, 1.45)
9
10 ######## Detect the canonical host and target build environment
11 AC_CANONICAL_HOST
12 AC_CANONICAL_TARGET
13
14 ######## Check for tools
15 AC_PROG_CC
16 AC_PROG_INSTALL
17 AC_PROG_RANLIB
18
19 ######## Check for compiler environment
20 AC_C_CONST
21
22 ######## Figure out which math library to use
23 case "$target" in
24 *-*-mingw32*)
25 MATHLIB=""
26 ;;
27 *-*-beos*)
28 MATHLIB=""
29 ;;
30 *)
31 MATHLIB="-lm"
32 AC_CHECK_LIB(m, main, , AC_MSG_ERROR(Your system is missing libm (mathlib)!))
33 ;;
34 esac
35 AC_SUBST(MATHLIB)
36
37 ######## Check for SDL
38 AM_PATH_SDL($SDL_VERSION,
39 :,
40 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
41 )
42
43 ######## Check for other libs
44 AC_CHECK_LIB(jpeg, main, , AC_MSG_ERROR(Your system is missing libjpeg!))
45
46 #Commented out because of a bug in the SuSE 6.2
47 #AC_CHECK_LIB(png, main, , AC_MSG_ERROR(Your system is missing libpng!))
48
49 AC_CHECK_LIB(SDL_mixer, main, SOUND="-lSDL_mixer";CFLAGS="$CFLAGS -DSOUND")
50
51 ######## Set compiler flags and libraries
52 CFLAGS="$CFLAGS $SDL_CFLAGS -DDATADIR=\\\"$datadir/bumprace\\\""
53 LIBS="$LIBS $SDL_LIBS -ljpeg -lpng $SOUND -lz -lSDL"
54
55 ######## Check for headers
56 AC_CHECK_HEADERS(png.h, , AC_MSG_ERROR(Your system is missing png.h ! You will probably have to install the png-devel package))
57 AC_CHECK_HEADERS(jpeglib.h, , AC_MSG_ERROR(Your system is missing jpeglib.h ! You will probably have to install the jpeg-devel package))
58
59 ######## Finally create all the generated files
60 AC_OUTPUT([
61 Makefile
62 src/Makefile
63 data/Makefile
64 data/gfx/Makefile
65 data/sound/Makefile
66 ])
0 SUBDIRS = gfx sound
1
2 generaldir = $(datadir)/@PACKAGE@
3
4 general_DATA =
0 # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
1
2 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
3 # This Makefile.in is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 # PARTICULAR PURPOSE.
11
12
13 SHELL = @SHELL@
14
15 srcdir = @srcdir@
16 top_srcdir = @top_srcdir@
17 VPATH = @srcdir@
18 prefix = @prefix@
19 exec_prefix = @exec_prefix@
20
21 bindir = @bindir@
22 sbindir = @sbindir@
23 libexecdir = @libexecdir@
24 datadir = @datadir@
25 sysconfdir = @sysconfdir@
26 sharedstatedir = @sharedstatedir@
27 localstatedir = @localstatedir@
28 libdir = @libdir@
29 infodir = @infodir@
30 mandir = @mandir@
31 includedir = @includedir@
32 oldincludedir = /usr/include
33
34 DESTDIR =
35
36 pkgdatadir = $(datadir)/@PACKAGE@
37 pkglibdir = $(libdir)/@PACKAGE@
38 pkgincludedir = $(includedir)/@PACKAGE@
39
40 top_builddir = ..
41
42 ACLOCAL = @ACLOCAL@
43 AUTOCONF = @AUTOCONF@
44 AUTOMAKE = @AUTOMAKE@
45 AUTOHEADER = @AUTOHEADER@
46
47 INSTALL = @INSTALL@
48 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
49 INSTALL_DATA = @INSTALL_DATA@
50 INSTALL_SCRIPT = @INSTALL_SCRIPT@
51 transform = @program_transform_name@
52
53 NORMAL_INSTALL = :
54 PRE_INSTALL = :
55 POST_INSTALL = :
56 NORMAL_UNINSTALL = :
57 PRE_UNINSTALL = :
58 POST_UNINSTALL = :
59 host_alias = @host_alias@
60 host_triplet = @host@
61 CC = @CC@
62 MAKEINFO = @MAKEINFO@
63 MATHLIB = @MATHLIB@
64 PACKAGE = @PACKAGE@
65 RANLIB = @RANLIB@
66 SDL_CFLAGS = @SDL_CFLAGS@
67 SDL_CONFIG = @SDL_CONFIG@
68 SDL_LIBS = @SDL_LIBS@
69 VERSION = @VERSION@
70
71 SUBDIRS = gfx sound
72
73 generaldir = $(datadir)/@PACKAGE@
74
75 general_DATA =
76 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
77 CONFIG_CLEAN_FILES =
78 DATA = $(general_DATA)
79
80 DIST_COMMON = Makefile.am Makefile.in
81
82
83 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
84
85 TAR = tar
86 GZIP_ENV = --best
87 all: all-redirect
88 .SUFFIXES:
89 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
90 cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/Makefile
91
92 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
93 cd $(top_builddir) \
94 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
95
96
97 install-generalDATA: $(general_DATA)
98 @$(NORMAL_INSTALL)
99 $(mkinstalldirs) $(DESTDIR)$(generaldir)
100 @list='$(general_DATA)'; for p in $$list; do \
101 if test -f $(srcdir)/$$p; then \
102 echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(generaldir)/$$p"; \
103 $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(generaldir)/$$p; \
104 else if test -f $$p; then \
105 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(generaldir)/$$p"; \
106 $(INSTALL_DATA) $$p $(DESTDIR)$(generaldir)/$$p; \
107 fi; fi; \
108 done
109
110 uninstall-generalDATA:
111 @$(NORMAL_UNINSTALL)
112 list='$(general_DATA)'; for p in $$list; do \
113 rm -f $(DESTDIR)$(generaldir)/$$p; \
114 done
115
116 # This directory's subdirectories are mostly independent; you can cd
117 # into them and run `make' without going through this Makefile.
118 # To change the values of `make' variables: instead of editing Makefiles,
119 # (1) if the variable is set in `config.status', edit `config.status'
120 # (which will cause the Makefiles to be regenerated when you run `make');
121 # (2) otherwise, pass the desired values on the `make' command line.
122
123 @SET_MAKE@
124
125 all-recursive install-data-recursive install-exec-recursive \
126 installdirs-recursive install-recursive uninstall-recursive \
127 check-recursive installcheck-recursive info-recursive dvi-recursive:
128 @set fnord $(MAKEFLAGS); amf=$$2; \
129 dot_seen=no; \
130 target=`echo $@ | sed s/-recursive//`; \
131 list='$(SUBDIRS)'; for subdir in $$list; do \
132 echo "Making $$target in $$subdir"; \
133 if test "$$subdir" = "."; then \
134 dot_seen=yes; \
135 local_target="$$target-am"; \
136 else \
137 local_target="$$target"; \
138 fi; \
139 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
140 || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
141 done; \
142 if test "$$dot_seen" = "no"; then \
143 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
144 fi; test -z "$$fail"
145
146 mostlyclean-recursive clean-recursive distclean-recursive \
147 maintainer-clean-recursive:
148 @set fnord $(MAKEFLAGS); amf=$$2; \
149 dot_seen=no; \
150 rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
151 rev="$$subdir $$rev"; \
152 test "$$subdir" = "." && dot_seen=yes; \
153 done; \
154 test "$$dot_seen" = "no" && rev=". $$rev"; \
155 target=`echo $@ | sed s/-recursive//`; \
156 for subdir in $$rev; do \
157 echo "Making $$target in $$subdir"; \
158 if test "$$subdir" = "."; then \
159 local_target="$$target-am"; \
160 else \
161 local_target="$$target"; \
162 fi; \
163 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
164 || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
165 done && test -z "$$fail"
166 tags-recursive:
167 list='$(SUBDIRS)'; for subdir in $$list; do \
168 test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
169 done
170
171 tags: TAGS
172
173 ID: $(HEADERS) $(SOURCES) $(LISP)
174 list='$(SOURCES) $(HEADERS)'; \
175 unique=`for i in $$list; do echo $$i; done | \
176 awk ' { files[$$0] = 1; } \
177 END { for (i in files) print i; }'`; \
178 here=`pwd` && cd $(srcdir) \
179 && mkid -f$$here/ID $$unique $(LISP)
180
181 TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
182 tags=; \
183 here=`pwd`; \
184 list='$(SUBDIRS)'; for subdir in $$list; do \
185 if test "$$subdir" = .; then :; else \
186 test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
187 fi; \
188 done; \
189 list='$(SOURCES) $(HEADERS)'; \
190 unique=`for i in $$list; do echo $$i; done | \
191 awk ' { files[$$0] = 1; } \
192 END { for (i in files) print i; }'`; \
193 test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
194 || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
195
196 mostlyclean-tags:
197
198 clean-tags:
199
200 distclean-tags:
201 -rm -f TAGS ID
202
203 maintainer-clean-tags:
204
205 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
206
207 subdir = data
208
209 distdir: $(DISTFILES)
210 @for file in $(DISTFILES); do \
211 d=$(srcdir); \
212 if test -d $$d/$$file; then \
213 cp -pr $$d/$$file $(distdir)/$$file; \
214 else \
215 test -f $(distdir)/$$file \
216 || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
217 || cp -p $$d/$$file $(distdir)/$$file || :; \
218 fi; \
219 done
220 for subdir in $(SUBDIRS); do \
221 if test "$$subdir" = .; then :; else \
222 test -d $(distdir)/$$subdir \
223 || mkdir $(distdir)/$$subdir \
224 || exit 1; \
225 chmod 777 $(distdir)/$$subdir; \
226 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
227 || exit 1; \
228 fi; \
229 done
230 info-am:
231 info: info-recursive
232 dvi-am:
233 dvi: dvi-recursive
234 check-am: all-am
235 check: check-recursive
236 installcheck-am:
237 installcheck: installcheck-recursive
238 install-exec-am:
239 install-exec: install-exec-recursive
240
241 install-data-am: install-generalDATA
242 install-data: install-data-recursive
243
244 install-am: all-am
245 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
246 install: install-recursive
247 uninstall-am: uninstall-generalDATA
248 uninstall: uninstall-recursive
249 all-am: Makefile $(DATA)
250 all-redirect: all-recursive
251 install-strip:
252 $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
253 installdirs: installdirs-recursive
254 installdirs-am:
255 $(mkinstalldirs) $(DESTDIR)$(generaldir)
256
257
258 mostlyclean-generic:
259
260 clean-generic:
261
262 distclean-generic:
263 -rm -f Makefile $(CONFIG_CLEAN_FILES)
264 -rm -f config.cache config.log stamp-h stamp-h[0-9]*
265
266 maintainer-clean-generic:
267 mostlyclean-am: mostlyclean-tags mostlyclean-generic
268
269 mostlyclean: mostlyclean-recursive
270
271 clean-am: clean-tags clean-generic mostlyclean-am
272
273 clean: clean-recursive
274
275 distclean-am: distclean-tags distclean-generic clean-am
276
277 distclean: distclean-recursive
278
279 maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
280 distclean-am
281 @echo "This command is intended for maintainers to use;"
282 @echo "it deletes files that may require special tools to rebuild."
283
284 maintainer-clean: maintainer-clean-recursive
285
286 .PHONY: uninstall-generalDATA install-generalDATA install-data-recursive \
287 uninstall-data-recursive install-exec-recursive \
288 uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
289 all-recursive check-recursive installcheck-recursive info-recursive \
290 dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
291 maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
292 distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
293 dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
294 install-exec install-data-am install-data install-am install \
295 uninstall-am uninstall all-redirect all-am all installdirs-am \
296 installdirs mostlyclean-generic distclean-generic clean-generic \
297 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
298
299
300 # Tell versions [3.59,3.63) of GNU make to not export all variables.
301 # Otherwise a system limit (for SysV at least) may be exceeded.
302 .NOEXPORT:
Binary diff not shown
Binary diff not shown
Binary diff not shown
0
1 gfxdir=$(datadir)/@PACKAGE@/gfx
2
3 gfx_DATA = \
4 1player.jpg completed.png racerc16.gif racerd7.gif racerf12.gif \
5 2playercomp.jpg crashed.png racerc17.gif racerd8.gif racerf13.gif \
6 2playerteam.jpg explosion1.gif racerc18.gif racerd9.gif racerf14.gif \
7 fore1.png racerc2.gif racerd_big.gif racerf15.gif \
8 back2.jpg fore11.gif racerc3.gif racere1.gif racerf16.gif \
9 cannon1.jpg fore12.gif racerc4.gif racere10.gif racerf17.gif \
10 cannon10.jpg fore13.gif racerc5.gif racere11.gif racerf18.gif \
11 cannon11.jpg fore14.gif racerc6.gif racere12.gif racerf2.gif \
12 cannon12.jpg fore15.gif racerc7.gif racere13.gif racerf3.gif \
13 cannon13.jpg fore16.gif racerc8.gif racere14.gif racerf4.gif \
14 cannon14.jpg fore2.png racerc9.gif racere15.gif racerf5.gif \
15 cannon15.jpg fore3.png racerd1.gif racere16.gif racerf6.gif \
16 cannon16.jpg fore4.png racerd10.gif racere17.gif racerf7.gif \
17 cannon17.jpg fore5.png racerd11.gif racere18.gif racerf8.gif \
18 cannon18.jpg fore6.png racerd12.gif racere2.gif racerf9.gif \
19 cannon19.jpg fore7.png racerd13.gif racere3.gif racerf_big.gif \
20 cannon2.jpg quit.jpg racerd14.gif racere4.gif select.gif \
21 cannon20.jpg racer_big.gif racerd15.gif racere5.gif selectp1.jpg \
22 cannon21.jpg racerb_big.gif racerd16.gif racere6.gif selectp2.jpg \
23 cannon3.jpg racerc1.gif racerd17.gif racere7.gif star1.gif \
24 cannon4.jpg racerc10.gif racerd18.gif racere8.gif star2.gif \
25 cannon5.jpg racerc11.gif racerd2.gif racere9.gif star3.gif \
26 cannon6.jpg racerc12.gif racerd3.gif racere_big.gif star4.gif \
27 cannon7.jpg racerc13.gif racerd4.gif racerf1.gif star5.gif \
28 cannon8.jpg racerc14.gif racerd5.gif racerf10.gif timeout.png \
29 cannon9.jpg racerc15.gif racerd6.gif racerf11.gif title.gif \
30 font.png highscore.png fore8.png\
31 laser1.png laser3.png laser5.png laser7.png laser9.png \
32 laser2.png laser4.png laser6.png laser8.png
33
34 EXTRA_DIST = $(gfx_DATA)
0 # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
1
2 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
3 # This Makefile.in is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 # PARTICULAR PURPOSE.
11
12
13 SHELL = @SHELL@
14
15 srcdir = @srcdir@
16 top_srcdir = @top_srcdir@
17 VPATH = @srcdir@
18 prefix = @prefix@
19 exec_prefix = @exec_prefix@
20
21 bindir = @bindir@
22 sbindir = @sbindir@
23 libexecdir = @libexecdir@
24 datadir = @datadir@
25 sysconfdir = @sysconfdir@
26 sharedstatedir = @sharedstatedir@
27 localstatedir = @localstatedir@
28 libdir = @libdir@
29 infodir = @infodir@
30 mandir = @mandir@
31 includedir = @includedir@
32 oldincludedir = /usr/include
33
34 DESTDIR =
35
36 pkgdatadir = $(datadir)/@PACKAGE@
37 pkglibdir = $(libdir)/@PACKAGE@
38 pkgincludedir = $(includedir)/@PACKAGE@
39
40 top_builddir = ../..
41
42 ACLOCAL = @ACLOCAL@
43 AUTOCONF = @AUTOCONF@
44 AUTOMAKE = @AUTOMAKE@
45 AUTOHEADER = @AUTOHEADER@
46
47 INSTALL = @INSTALL@
48 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
49 INSTALL_DATA = @INSTALL_DATA@
50 INSTALL_SCRIPT = @INSTALL_SCRIPT@
51 transform = @program_transform_name@
52
53 NORMAL_INSTALL = :
54 PRE_INSTALL = :
55 POST_INSTALL = :
56 NORMAL_UNINSTALL = :
57 PRE_UNINSTALL = :
58 POST_UNINSTALL = :
59 host_alias = @host_alias@
60 host_triplet = @host@
61 CC = @CC@
62 MAKEINFO = @MAKEINFO@
63 MATHLIB = @MATHLIB@
64 PACKAGE = @PACKAGE@
65 RANLIB = @RANLIB@
66 SDL_CFLAGS = @SDL_CFLAGS@
67 SDL_CONFIG = @SDL_CONFIG@
68 SDL_LIBS = @SDL_LIBS@
69 VERSION = @VERSION@
70
71 gfxdir = $(datadir)/@PACKAGE@/gfx
72
73 gfx_DATA = 1player.jpg completed.png racerc16.gif racerd7.gif racerf12.gif 2playercomp.jpg crashed.png racerc17.gif racerd8.gif racerf13.gif 2playerteam.jpg explosion1.gif racerc18.gif racerd9.gif racerf14.gif fore1.png racerc2.gif racerd_big.gif racerf15.gif back2.jpg fore11.gif racerc3.gif racere1.gif racerf16.gif cannon1.jpg fore12.gif racerc4.gif racere10.gif racerf17.gif cannon10.jpg fore13.gif racerc5.gif racere11.gif racerf18.gif cannon11.jpg fore14.gif racerc6.gif racere12.gif racerf2.gif cannon12.jpg fore15.gif racerc7.gif racere13.gif racerf3.gif cannon13.jpg fore16.gif racerc8.gif racere14.gif racerf4.gif cannon14.jpg fore2.png racerc9.gif racere15.gif racerf5.gif cannon15.jpg fore3.png racerd1.gif racere16.gif racerf6.gif cannon16.jpg fore4.png racerd10.gif racere17.gif racerf7.gif cannon17.jpg fore5.png racerd11.gif racere18.gif racerf8.gif cannon18.jpg fore6.png racerd12.gif racere2.gif racerf9.gif cannon19.jpg fore7.png racerd13.gif racere3.gif racerf_big.gif cannon2.jpg quit.jpg racerd14.gif racere4.gif select.gif cannon20.jpg racer_big.gif racerd15.gif racere5.gif selectp1.jpg cannon21.jpg racerb_big.gif racerd16.gif racere6.gif selectp2.jpg cannon3.jpg racerc1.gif racerd17.gif racere7.gif star1.gif cannon4.jpg racerc10.gif racerd18.gif racere8.gif star2.gif cannon5.jpg racerc11.gif racerd2.gif racere9.gif star3.gif cannon6.jpg racerc12.gif racerd3.gif racere_big.gif star4.gif cannon7.jpg racerc13.gif racerd4.gif racerf1.gif star5.gif cannon8.jpg racerc14.gif racerd5.gif racerf10.gif timeout.png cannon9.jpg racerc15.gif racerd6.gif racerf11.gif title.gif font.png highscore.png fore8.png laser1.png laser3.png laser5.png laser7.png laser9.png laser2.png laser4.png laser6.png laser8.png
74
75
76 EXTRA_DIST = $(gfx_DATA)
77 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
78 CONFIG_CLEAN_FILES =
79 DATA = $(gfx_DATA)
80
81 DIST_COMMON = Makefile.am Makefile.in
82
83
84 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
85
86 TAR = tar
87 GZIP_ENV = --best
88 all: all-redirect
89 .SUFFIXES:
90 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
91 cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/gfx/Makefile
92
93 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
94 cd $(top_builddir) \
95 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
96
97
98 install-gfxDATA: $(gfx_DATA)
99 @$(NORMAL_INSTALL)
100 $(mkinstalldirs) $(DESTDIR)$(gfxdir)
101 @list='$(gfx_DATA)'; for p in $$list; do \
102 if test -f $(srcdir)/$$p; then \
103 echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gfxdir)/$$p"; \
104 $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gfxdir)/$$p; \
105 else if test -f $$p; then \
106 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gfxdir)/$$p"; \
107 $(INSTALL_DATA) $$p $(DESTDIR)$(gfxdir)/$$p; \
108 fi; fi; \
109 done
110
111 uninstall-gfxDATA:
112 @$(NORMAL_UNINSTALL)
113 list='$(gfx_DATA)'; for p in $$list; do \
114 rm -f $(DESTDIR)$(gfxdir)/$$p; \
115 done
116 tags: TAGS
117 TAGS:
118
119
120 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
121
122 subdir = data/gfx
123
124 distdir: $(DISTFILES)
125 @for file in $(DISTFILES); do \
126 d=$(srcdir); \
127 if test -d $$d/$$file; then \
128 cp -pr $$d/$$file $(distdir)/$$file; \
129 else \
130 test -f $(distdir)/$$file \
131 || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
132 || cp -p $$d/$$file $(distdir)/$$file || :; \
133 fi; \
134 done
135 info-am:
136 info: info-am
137 dvi-am:
138 dvi: dvi-am
139 check-am: all-am
140 check: check-am
141 installcheck-am:
142 installcheck: installcheck-am
143 install-exec-am:
144 install-exec: install-exec-am
145
146 install-data-am: install-gfxDATA
147 install-data: install-data-am
148
149 install-am: all-am
150 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
151 install: install-am
152 uninstall-am: uninstall-gfxDATA
153 uninstall: uninstall-am
154 all-am: Makefile $(DATA)
155 all-redirect: all-am
156 install-strip:
157 $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
158 installdirs:
159 $(mkinstalldirs) $(DESTDIR)$(gfxdir)
160
161
162 mostlyclean-generic:
163
164 clean-generic:
165
166 distclean-generic:
167 -rm -f Makefile $(CONFIG_CLEAN_FILES)
168 -rm -f config.cache config.log stamp-h stamp-h[0-9]*
169
170 maintainer-clean-generic:
171 mostlyclean-am: mostlyclean-generic
172
173 mostlyclean: mostlyclean-am
174
175 clean-am: clean-generic mostlyclean-am
176
177 clean: clean-am
178
179 distclean-am: distclean-generic clean-am
180
181 distclean: distclean-am
182
183 maintainer-clean-am: maintainer-clean-generic distclean-am
184 @echo "This command is intended for maintainers to use;"
185 @echo "it deletes files that may require special tools to rebuild."
186
187 maintainer-clean: maintainer-clean-am
188
189 .PHONY: uninstall-gfxDATA install-gfxDATA tags distdir info-am info \
190 dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
191 install-exec install-data-am install-data install-am install \
192 uninstall-am uninstall all-redirect all-am all installdirs \
193 mostlyclean-generic distclean-generic clean-generic \
194 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
195
196
197 # Tell versions [3.59,3.63) of GNU make to not export all variables.
198 # Otherwise a system limit (for SysV at least) may be exceeded.
199 .NOEXPORT:
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0
1 sounddir=$(datadir)/@PACKAGE@/sound
2
3 sound_DATA = explode.wav lizard.mod whoosh.wav winlevel.wav
4
5 EXTRA_DIST = $(sound_DATA)
0 # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
1
2 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
3 # This Makefile.in is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 # PARTICULAR PURPOSE.
11
12
13 SHELL = @SHELL@
14
15 srcdir = @srcdir@
16 top_srcdir = @top_srcdir@
17 VPATH = @srcdir@
18 prefix = @prefix@
19 exec_prefix = @exec_prefix@
20
21 bindir = @bindir@
22 sbindir = @sbindir@
23 libexecdir = @libexecdir@
24 datadir = @datadir@
25 sysconfdir = @sysconfdir@
26 sharedstatedir = @sharedstatedir@
27 localstatedir = @localstatedir@
28 libdir = @libdir@
29 infodir = @infodir@
30 mandir = @mandir@
31 includedir = @includedir@
32 oldincludedir = /usr/include
33
34 DESTDIR =
35
36 pkgdatadir = $(datadir)/@PACKAGE@
37 pkglibdir = $(libdir)/@PACKAGE@
38 pkgincludedir = $(includedir)/@PACKAGE@
39
40 top_builddir = ../..
41
42 ACLOCAL = @ACLOCAL@
43 AUTOCONF = @AUTOCONF@
44 AUTOMAKE = @AUTOMAKE@
45 AUTOHEADER = @AUTOHEADER@
46
47 INSTALL = @INSTALL@
48 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
49 INSTALL_DATA = @INSTALL_DATA@
50 INSTALL_SCRIPT = @INSTALL_SCRIPT@
51 transform = @program_transform_name@
52
53 NORMAL_INSTALL = :
54 PRE_INSTALL = :
55 POST_INSTALL = :
56 NORMAL_UNINSTALL = :
57 PRE_UNINSTALL = :
58 POST_UNINSTALL = :
59 host_alias = @host_alias@
60 host_triplet = @host@
61 CC = @CC@
62 MAKEINFO = @MAKEINFO@
63 MATHLIB = @MATHLIB@
64 PACKAGE = @PACKAGE@
65 RANLIB = @RANLIB@
66 SDL_CFLAGS = @SDL_CFLAGS@
67 SDL_CONFIG = @SDL_CONFIG@
68 SDL_LIBS = @SDL_LIBS@
69 VERSION = @VERSION@
70
71 sounddir = $(datadir)/@PACKAGE@/sound
72
73 sound_DATA = explode.wav lizard.mod whoosh.wav winlevel.wav
74
75 EXTRA_DIST = $(sound_DATA)
76 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
77 CONFIG_CLEAN_FILES =
78 DATA = $(sound_DATA)
79
80 DIST_COMMON = Makefile.am Makefile.in
81
82
83 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
84
85 TAR = tar
86 GZIP_ENV = --best
87 all: all-redirect
88 .SUFFIXES:
89 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
90 cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/sound/Makefile
91
92 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
93 cd $(top_builddir) \
94 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
95
96
97 install-soundDATA: $(sound_DATA)
98 @$(NORMAL_INSTALL)
99 $(mkinstalldirs) $(DESTDIR)$(sounddir)
100 @list='$(sound_DATA)'; for p in $$list; do \
101 if test -f $(srcdir)/$$p; then \
102 echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sounddir)/$$p"; \
103 $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sounddir)/$$p; \
104 else if test -f $$p; then \
105 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sounddir)/$$p"; \
106 $(INSTALL_DATA) $$p $(DESTDIR)$(sounddir)/$$p; \
107 fi; fi; \
108 done
109
110 uninstall-soundDATA:
111 @$(NORMAL_UNINSTALL)
112 list='$(sound_DATA)'; for p in $$list; do \
113 rm -f $(DESTDIR)$(sounddir)/$$p; \
114 done
115 tags: TAGS
116 TAGS:
117
118
119 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
120
121 subdir = data/sound
122
123 distdir: $(DISTFILES)
124 @for file in $(DISTFILES); do \
125 d=$(srcdir); \
126 if test -d $$d/$$file; then \
127 cp -pr $$d/$$file $(distdir)/$$file; \
128 else \
129 test -f $(distdir)/$$file \
130 || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
131 || cp -p $$d/$$file $(distdir)/$$file || :; \
132 fi; \
133 done
134 info-am:
135 info: info-am
136 dvi-am:
137 dvi: dvi-am
138 check-am: all-am
139 check: check-am
140 installcheck-am:
141 installcheck: installcheck-am
142 install-exec-am:
143 install-exec: install-exec-am
144
145 install-data-am: install-soundDATA
146 install-data: install-data-am
147
148 install-am: all-am
149 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
150 install: install-am
151 uninstall-am: uninstall-soundDATA
152 uninstall: uninstall-am
153 all-am: Makefile $(DATA)
154 all-redirect: all-am
155 install-strip:
156 $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
157 installdirs:
158 $(mkinstalldirs) $(DESTDIR)$(sounddir)
159
160
161 mostlyclean-generic:
162
163 clean-generic:
164
165 distclean-generic:
166 -rm -f Makefile $(CONFIG_CLEAN_FILES)
167 -rm -f config.cache config.log stamp-h stamp-h[0-9]*
168
169 maintainer-clean-generic:
170 mostlyclean-am: mostlyclean-generic
171
172 mostlyclean: mostlyclean-am
173
174 clean-am: clean-generic mostlyclean-am
175
176 clean: clean-am
177
178 distclean-am: distclean-generic clean-am
179
180 distclean: distclean-am
181
182 maintainer-clean-am: maintainer-clean-generic distclean-am
183 @echo "This command is intended for maintainers to use;"
184 @echo "it deletes files that may require special tools to rebuild."
185
186 maintainer-clean: maintainer-clean-am
187
188 .PHONY: uninstall-soundDATA install-soundDATA tags distdir info-am info \
189 dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
190 install-exec install-data-am install-data install-am install \
191 uninstall-am uninstall all-redirect all-am all installdirs \
192 mostlyclean-generic distclean-generic clean-generic \
193 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
194
195
196 # Tell versions [3.59,3.63) of GNU make to not export all variables.
197 # Otherwise a system limit (for SysV at least) may be exceeded.
198 .NOEXPORT:
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 #!/bin/sh
1 #
2 # install - install a program, script, or datafile
3 # This comes from X11R5 (mit/util/scripts/install.sh).
4 #
5 # Copyright 1991 by the Massachusetts Institute of Technology
6 #
7 # Permission to use, copy, modify, distribute, and sell this software and its
8 # documentation for any purpose is hereby granted without fee, provided that
9 # the above copyright notice appear in all copies and that both that
10 # copyright notice and this permission notice appear in supporting
11 # documentation, and that the name of M.I.T. not be used in advertising or
12 # publicity pertaining to distribution of the software without specific,
13 # written prior permission. M.I.T. makes no representations about the
14 # suitability of this software for any purpose. It is provided "as is"
15 # without express or implied warranty.
16 #
17 # Calling this script install-sh is preferred over install.sh, to prevent
18 # `make' implicit rules from creating a file called install from it
19 # when there is no Makefile.
20 #
21 # This script is compatible with the BSD install script, but was written
22 # from scratch. It can only install one file at a time, a restriction
23 # shared with many OS's install programs.
24
25
26 # set DOITPROG to echo to test this script
27
28 # Don't use :- since 4.3BSD and earlier shells don't like it.
29 doit="${DOITPROG-}"
30
31
32 # put in absolute paths if you don't have them in your path; or use env. vars.
33
34 mvprog="${MVPROG-mv}"
35 cpprog="${CPPROG-cp}"
36 chmodprog="${CHMODPROG-chmod}"
37 chownprog="${CHOWNPROG-chown}"
38 chgrpprog="${CHGRPPROG-chgrp}"
39 stripprog="${STRIPPROG-strip}"
40 rmprog="${RMPROG-rm}"
41 mkdirprog="${MKDIRPROG-mkdir}"
42
43 transformbasename=""
44 transform_arg=""
45 instcmd="$mvprog"
46 chmodcmd="$chmodprog 0755"
47 chowncmd=""
48 chgrpcmd=""
49 stripcmd=""
50 rmcmd="$rmprog -f"
51 mvcmd="$mvprog"
52 src=""
53 dst=""
54 dir_arg=""
55
56 while [ x"$1" != x ]; do
57 case $1 in
58 -c) instcmd="$cpprog"
59 shift
60 continue;;
61
62 -d) dir_arg=true
63 shift
64 continue;;
65
66 -m) chmodcmd="$chmodprog $2"
67 shift
68 shift
69 continue;;
70
71 -o) chowncmd="$chownprog $2"
72 shift
73 shift
74 continue;;
75
76 -g) chgrpcmd="$chgrpprog $2"
77 shift
78 shift
79 continue;;
80
81 -s) stripcmd="$stripprog"
82 shift
83 continue;;
84
85 -t=*) transformarg=`echo $1 | sed 's/-t=//'`
86 shift
87 continue;;
88
89 -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
90 shift
91 continue;;
92
93 *) if [ x"$src" = x ]
94 then
95 src=$1
96 else
97 # this colon is to work around a 386BSD /bin/sh bug
98 :
99 dst=$1
100 fi
101 shift
102 continue;;
103 esac
104 done
105
106 if [ x"$src" = x ]
107 then
108 echo "install: no input file specified"
109 exit 1
110 else
111 true
112 fi
113
114 if [ x"$dir_arg" != x ]; then
115 dst=$src
116 src=""
117
118 if [ -d $dst ]; then
119 instcmd=:
120 chmodcmd=""
121 else
122 instcmd=mkdir
123 fi
124 else
125
126 # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
127 # might cause directories to be created, which would be especially bad
128 # if $src (and thus $dsttmp) contains '*'.
129
130 if [ -f $src -o -d $src ]
131 then
132 true
133 else
134 echo "install: $src does not exist"
135 exit 1
136 fi
137
138 if [ x"$dst" = x ]
139 then
140 echo "install: no destination specified"
141 exit 1
142 else
143 true
144 fi
145
146 # If destination is a directory, append the input filename; if your system
147 # does not like double slashes in filenames, you may need to add some logic
148
149 if [ -d $dst ]
150 then
151 dst="$dst"/`basename $src`
152 else
153 true
154 fi
155 fi
156
157 ## this sed command emulates the dirname command
158 dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
159
160 # Make sure that the destination directory exists.
161 # this part is taken from Noah Friedman's mkinstalldirs script
162
163 # Skip lots of stat calls in the usual case.
164 if [ ! -d "$dstdir" ]; then
165 defaultIFS='
166 '
167 IFS="${IFS-${defaultIFS}}"
168
169 oIFS="${IFS}"
170 # Some sh's can't handle IFS=/ for some reason.
171 IFS='%'
172 set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
173 IFS="${oIFS}"
174
175 pathcomp=''
176
177 while [ $# -ne 0 ] ; do
178 pathcomp="${pathcomp}${1}"
179 shift
180
181 if [ ! -d "${pathcomp}" ] ;
182 then
183 $mkdirprog "${pathcomp}"
184 else
185 true
186 fi
187
188 pathcomp="${pathcomp}/"
189 done
190 fi
191
192 if [ x"$dir_arg" != x ]
193 then
194 $doit $instcmd $dst &&
195
196 if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
197 if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
198 if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
199 if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
200 else
201
202 # If we're going to rename the final executable, determine the name now.
203
204 if [ x"$transformarg" = x ]
205 then
206 dstfile=`basename $dst`
207 else
208 dstfile=`basename $dst $transformbasename |
209 sed $transformarg`$transformbasename
210 fi
211
212 # don't allow the sed command to completely eliminate the filename
213
214 if [ x"$dstfile" = x ]
215 then
216 dstfile=`basename $dst`
217 else
218 true
219 fi
220
221 # Make a temp file name in the proper directory.
222
223 dsttmp=$dstdir/#inst.$$#
224
225 # Move or copy the file name to the temp name
226
227 $doit $instcmd $src $dsttmp &&
228
229 trap "rm -f ${dsttmp}" 0 &&
230
231 # and set any options; do chmod last to preserve setuid bits
232
233 # If any of these fail, we abort the whole thing. If we want to
234 # ignore errors from any of these, just make sure not to ignore
235 # errors from the above "$doit $instcmd $src $dsttmp" command.
236
237 if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
238 if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
239 if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
240 if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
241
242 # Now rename the file to the real destination.
243
244 $doit $rmcmd -f $dstdir/$dstfile &&
245 $doit $mvcmd $dsttmp $dstdir/$dstfile
246
247 fi &&
248
249
250 exit 0
0 #! /bin/sh
1 # Common stub for a few missing GNU programs while installing.
2 # Copyright (C) 1996, 1997 Free Software Foundation, Inc.
3 # Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 # 02111-1307, USA.
19
20 if test $# -eq 0; then
21 echo 1>&2 "Try \`$0 --help' for more information"
22 exit 1
23 fi
24
25 case "$1" in
26
27 -h|--h|--he|--hel|--help)
28 echo "\
29 $0 [OPTION]... PROGRAM [ARGUMENT]...
30
31 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
32 error status if there is no known handling for PROGRAM.
33
34 Options:
35 -h, --help display this help and exit
36 -v, --version output version information and exit
37
38 Supported PROGRAM values:
39 aclocal touch file \`aclocal.m4'
40 autoconf touch file \`configure'
41 autoheader touch file \`config.h.in'
42 automake touch all \`Makefile.in' files
43 bison create \`y.tab.[ch]', if possible, from existing .[ch]
44 flex create \`lex.yy.c', if possible, from existing .c
45 lex create \`lex.yy.c', if possible, from existing .c
46 makeinfo touch the output file
47 yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
48 ;;
49
50 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
51 echo "missing - GNU libit 0.0"
52 ;;
53
54 -*)
55 echo 1>&2 "$0: Unknown \`$1' option"
56 echo 1>&2 "Try \`$0 --help' for more information"
57 exit 1
58 ;;
59
60 aclocal)
61 echo 1>&2 "\
62 WARNING: \`$1' is missing on your system. You should only need it if
63 you modified \`acinclude.m4' or \`configure.in'. You might want
64 to install the \`Automake' and \`Perl' packages. Grab them from
65 any GNU archive site."
66 touch aclocal.m4
67 ;;
68
69 autoconf)
70 echo 1>&2 "\
71 WARNING: \`$1' is missing on your system. You should only need it if
72 you modified \`configure.in'. You might want to install the
73 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
74 archive site."
75 touch configure
76 ;;
77
78 autoheader)
79 echo 1>&2 "\
80 WARNING: \`$1' is missing on your system. You should only need it if
81 you modified \`acconfig.h' or \`configure.in'. You might want
82 to install the \`Autoconf' and \`GNU m4' packages. Grab them
83 from any GNU archive site."
84 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
85 test -z "$files" && files="config.h"
86 touch_files=
87 for f in $files; do
88 case "$f" in
89 *:*) touch_files="$touch_files "`echo "$f" |
90 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
91 *) touch_files="$touch_files $f.in";;
92 esac
93 done
94 touch $touch_files
95 ;;
96
97 automake)
98 echo 1>&2 "\
99 WARNING: \`$1' is missing on your system. You should only need it if
100 you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
101 You might want to install the \`Automake' and \`Perl' packages.
102 Grab them from any GNU archive site."
103 find . -type f -name Makefile.am -print |
104 sed 's/\.am$/.in/' |
105 while read f; do touch "$f"; done
106 ;;
107
108 bison|yacc)
109 echo 1>&2 "\
110 WARNING: \`$1' is missing on your system. You should only need it if
111 you modified a \`.y' file. You may need the \`Bison' package
112 in order for those modifications to take effect. You can get
113 \`Bison' from any GNU archive site."
114 rm -f y.tab.c y.tab.h
115 if [ $# -ne 1 ]; then
116 eval LASTARG="\${$#}"
117 case "$LASTARG" in
118 *.y)
119 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
120 if [ -f "$SRCFILE" ]; then
121 cp "$SRCFILE" y.tab.c
122 fi
123 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
124 if [ -f "$SRCFILE" ]; then
125 cp "$SRCFILE" y.tab.h
126 fi
127 ;;
128 esac
129 fi
130 if [ ! -f y.tab.h ]; then
131 echo >y.tab.h
132 fi
133 if [ ! -f y.tab.c ]; then
134 echo 'main() { return 0; }' >y.tab.c
135 fi
136 ;;
137
138 lex|flex)
139 echo 1>&2 "\
140 WARNING: \`$1' is missing on your system. You should only need it if
141 you modified a \`.l' file. You may need the \`Flex' package
142 in order for those modifications to take effect. You can get
143 \`Flex' from any GNU archive site."
144 rm -f lex.yy.c
145 if [ $# -ne 1 ]; then
146 eval LASTARG="\${$#}"
147 case "$LASTARG" in
148 *.l)
149 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
150 if [ -f "$SRCFILE" ]; then
151 cp "$SRCFILE" lex.yy.c
152 fi
153 ;;
154 esac
155 fi
156 if [ ! -f lex.yy.c ]; then
157 echo 'main() { return 0; }' >lex.yy.c
158 fi
159 ;;
160
161 makeinfo)
162 echo 1>&2 "\
163 WARNING: \`$1' is missing on your system. You should only need it if
164 you modified a \`.texi' or \`.texinfo' file, or any other file
165 indirectly affecting the aspect of the manual. The spurious
166 call might also be the consequence of using a buggy \`make' (AIX,
167 DU, IRIX). You might want to install the \`Texinfo' package or
168 the \`GNU make' package. Grab either from any GNU archive site."
169 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
170 if test -z "$file"; then
171 file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
172 file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
173 fi
174 touch $file
175 ;;
176
177 *)
178 echo 1>&2 "\
179 WARNING: \`$1' is needed, and you do not seem to have it handy on your
180 system. You might have modified some files without having the
181 proper tools for further handling them. Check the \`README' file,
182 it often tells you about the needed prerequirements for installing
183 this package. You may also peek at any GNU archive site, in case
184 some other package would contain this missing \`$1' program."
185 exit 1
186 ;;
187 esac
188
189 exit 0
0 #! /bin/sh
1 # mkinstalldirs --- make directory hierarchy
2 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
3 # Created: 1993-05-16
4 # Public domain
5
6 # $Id: mkinstalldirs,v 1.1 1999/11/18 18:23:17 hercules Exp $
7
8 errstatus=0
9
10 for file
11 do
12 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
13 shift
14
15 pathcomp=
16 for d
17 do
18 pathcomp="$pathcomp$d"
19 case "$pathcomp" in
20 -* ) pathcomp=./$pathcomp ;;
21 esac
22
23 if test ! -d "$pathcomp"; then
24 echo "mkdir $pathcomp"
25
26 mkdir "$pathcomp" || lasterr=$?
27
28 if test ! -d "$pathcomp"; then
29 errstatus=$lasterr
30 fi
31 fi
32
33 pathcomp="$pathcomp/"
34 done
35 done
36
37 exit $errstatus
38
39 # mkinstalldirs ends here
0 /*
1 IMGLIB: An example image loading library for use with SDL
2 Copyright (C) 1999 Sam Lantinga
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18 Sam Lantinga
19 5635-34 Springhouse Dr.
20 Pleasanton, CA 94588 (USA)
21 slouken@devolution.com
22 */
23
24 /* A simple library to load images of various formats as SDL surfaces */
25
26 #ifndef _IMG_h
27 #define _IMG_h
28
29 #include "SDL.h"
30 #include "begin_code.h"
31
32 /* Set up for C function definitions, even when using C++ */
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /* Load an image from an SDL data source.
38 The 'type' may be one of: "BMP", "GIF", "PNG", etc.
39
40 If the image format supports a transparent pixel, SDL will set the
41 colorkey for the surface. You can enable RLE acceleration on the
42 surface afterwards by calling:
43 SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
44 */
45 extern DECLSPEC SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc,
46 char *type);
47 /* Convenience functions */
48 extern DECLSPEC SDL_Surface *IMG_Load(const char *file);
49 extern DECLSPEC SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc);
50
51 /* Invert the alpha of a surface for use with OpenGL
52 This function is now a no-op, and only provided for backwards compatibility.
53 */
54 extern DECLSPEC int IMG_InvertAlpha(int on);
55
56 /* Functions to detect a file type, given a seekable source */
57 extern DECLSPEC int IMG_isGIF(SDL_RWops *src);
58 extern DECLSPEC int IMG_isJPG(SDL_RWops *src);
59 extern DECLSPEC int IMG_isPNG(SDL_RWops *src);
60
61 /* Individual loading functions */
62 extern DECLSPEC SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src);
63 extern DECLSPEC SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src);
64 extern DECLSPEC SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src);
65
66 /* We'll use SDL for reporting errors */
67 #define IMG_SetError SDL_SetError
68 #define IMG_GetError SDL_GetError
69
70 /* Ends C function definitions when using C++ */
71 #ifdef __cplusplus
72 };
73 #endif
74 #include "close_code.h"
75
76 #endif /* _IMG_h */
0 bin_PROGRAMS = bumprace
1
2 bumprace_SOURCES = bumprace.c img.c img_gif.c img_jpg.c \
3 gfx.c particles.c menu.c img_png.c \
4 IMG.h bumprace.h gfx.h \
5 levels.h menu.h particles.h \
6 options.h options.c font.h font.c
7
8
9 #SUBDIRS = mixer
0 # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
1
2 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
3 # This Makefile.in is free software; the Free Software Foundation
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
9 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 # PARTICULAR PURPOSE.
11
12
13 SHELL = @SHELL@
14
15 srcdir = @srcdir@
16 top_srcdir = @top_srcdir@
17 VPATH = @srcdir@
18 prefix = @prefix@
19 exec_prefix = @exec_prefix@
20
21 bindir = @bindir@
22 sbindir = @sbindir@
23 libexecdir = @libexecdir@
24 datadir = @datadir@
25 sysconfdir = @sysconfdir@
26 sharedstatedir = @sharedstatedir@
27 localstatedir = @localstatedir@
28 libdir = @libdir@
29 infodir = @infodir@
30 mandir = @mandir@
31 includedir = @includedir@
32 oldincludedir = /usr/include
33
34 DESTDIR =
35
36 pkgdatadir = $(datadir)/@PACKAGE@
37 pkglibdir = $(libdir)/@PACKAGE@
38 pkgincludedir = $(includedir)/@PACKAGE@
39
40 top_builddir = ..
41
42 ACLOCAL = @ACLOCAL@
43 AUTOCONF = @AUTOCONF@
44 AUTOMAKE = @AUTOMAKE@
45 AUTOHEADER = @AUTOHEADER@
46
47 INSTALL = @INSTALL@
48 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
49 INSTALL_DATA = @INSTALL_DATA@
50 INSTALL_SCRIPT = @INSTALL_SCRIPT@
51 transform = @program_transform_name@
52
53 NORMAL_INSTALL = :
54 PRE_INSTALL = :
55 POST_INSTALL = :
56 NORMAL_UNINSTALL = :
57 PRE_UNINSTALL = :
58 POST_UNINSTALL = :
59 host_alias = @host_alias@
60 host_triplet = @host@
61 CC = @CC@
62 MAKEINFO = @MAKEINFO@
63 MATHLIB = @MATHLIB@
64 PACKAGE = @PACKAGE@
65 RANLIB = @RANLIB@
66 SDL_CFLAGS = @SDL_CFLAGS@
67 SDL_CONFIG = @SDL_CONFIG@
68 SDL_LIBS = @SDL_LIBS@
69 VERSION = @VERSION@
70
71 bin_PROGRAMS = bumprace
72
73 bumprace_SOURCES = bumprace.c img.c img_gif.c img_jpg.c gfx.c particles.c menu.c img_png.c IMG.h bumprace.h gfx.h levels.h menu.h particles.h options.h options.c font.h font.c
74
75 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
76 CONFIG_CLEAN_FILES =
77 PROGRAMS = $(bin_PROGRAMS)
78
79
80 DEFS = @DEFS@ -I. -I$(srcdir)
81 CPPFLAGS = @CPPFLAGS@
82 LDFLAGS = @LDFLAGS@
83 LIBS = @LIBS@
84 bumprace_OBJECTS = bumprace.o img.o img_gif.o img_jpg.o gfx.o \
85 particles.o menu.o img_png.o options.o font.o
86 bumprace_LDADD = $(LDADD)
87 bumprace_DEPENDENCIES =
88 bumprace_LDFLAGS =
89 CFLAGS = @CFLAGS@
90 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
91 CCLD = $(CC)
92 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
93 DIST_COMMON = Makefile.am Makefile.in
94
95
96 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
97
98 TAR = tar
99 GZIP_ENV = --best
100 SOURCES = $(bumprace_SOURCES)
101 OBJECTS = $(bumprace_OBJECTS)
102
103 all: all-redirect
104 .SUFFIXES:
105 .SUFFIXES: .S .c .o .s
106 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
107 cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile
108
109 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
110 cd $(top_builddir) \
111 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
112
113
114 mostlyclean-binPROGRAMS:
115
116 clean-binPROGRAMS:
117 -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
118
119 distclean-binPROGRAMS:
120
121 maintainer-clean-binPROGRAMS:
122
123 install-binPROGRAMS: $(bin_PROGRAMS)
124 @$(NORMAL_INSTALL)
125 $(mkinstalldirs) $(DESTDIR)$(bindir)
126 @list='$(bin_PROGRAMS)'; for p in $$list; do \
127 if test -f $$p; then \
128 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
129 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
130 else :; fi; \
131 done
132
133 uninstall-binPROGRAMS:
134 @$(NORMAL_UNINSTALL)
135 list='$(bin_PROGRAMS)'; for p in $$list; do \
136 rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
137 done
138
139 .c.o:
140 $(COMPILE) -c $<
141
142 .s.o:
143 $(COMPILE) -c $<
144
145 .S.o:
146 $(COMPILE) -c $<
147
148 mostlyclean-compile:
149 -rm -f *.o core *.core
150
151 clean-compile:
152
153 distclean-compile:
154 -rm -f *.tab.c
155
156 maintainer-clean-compile:
157
158 bumprace: $(bumprace_OBJECTS) $(bumprace_DEPENDENCIES)
159 @rm -f bumprace
160 $(LINK) $(bumprace_LDFLAGS) $(bumprace_OBJECTS) $(bumprace_LDADD) $(LIBS)
161
162 tags: TAGS
163
164 ID: $(HEADERS) $(SOURCES) $(LISP)
165 list='$(SOURCES) $(HEADERS)'; \
166 unique=`for i in $$list; do echo $$i; done | \
167 awk ' { files[$$0] = 1; } \
168 END { for (i in files) print i; }'`; \
169 here=`pwd` && cd $(srcdir) \
170 && mkid -f$$here/ID $$unique $(LISP)
171
172 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
173 tags=; \
174 here=`pwd`; \
175 list='$(SOURCES) $(HEADERS)'; \
176 unique=`for i in $$list; do echo $$i; done | \
177 awk ' { files[$$0] = 1; } \
178 END { for (i in files) print i; }'`; \
179 test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
180 || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
181
182 mostlyclean-tags:
183
184 clean-tags:
185
186 distclean-tags:
187 -rm -f TAGS ID
188
189 maintainer-clean-tags:
190
191 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
192
193 subdir = src
194
195 distdir: $(DISTFILES)
196 @for file in $(DISTFILES); do \
197 d=$(srcdir); \
198 if test -d $$d/$$file; then \
199 cp -pr $$d/$$file $(distdir)/$$file; \
200 else \
201 test -f $(distdir)/$$file \
202 || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
203 || cp -p $$d/$$file $(distdir)/$$file || :; \
204 fi; \
205 done
206 bumprace.o: bumprace.c levels.h particles.h menu.h bumprace.h gfx.h \
207 font.h options.h
208 font.o: font.c
209 gfx.o: gfx.c bumprace.h gfx.h font.h IMG.h
210 img.o: img.c IMG.h
211 img_gif.o: img_gif.c IMG.h
212 img_jpg.o: img_jpg.c IMG.h
213 img_png.o: img_png.c IMG.h
214 menu.o: menu.c bumprace.h gfx.h font.h
215 options.o: options.c bumprace.h gfx.h font.h
216 particles.o: particles.c bumprace.h gfx.h font.h
217
218 info-am:
219 info: info-am
220 dvi-am:
221 dvi: dvi-am
222 check-am: all-am
223 check: check-am
224 installcheck-am:
225 installcheck: installcheck-am
226 install-exec-am: install-binPROGRAMS
227 install-exec: install-exec-am
228
229 install-data-am:
230 install-data: install-data-am
231
232 install-am: all-am
233 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
234 install: install-am
235 uninstall-am: uninstall-binPROGRAMS
236 uninstall: uninstall-am
237 all-am: Makefile $(PROGRAMS)
238 all-redirect: all-am
239 install-strip:
240 $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
241 installdirs:
242 $(mkinstalldirs) $(DESTDIR)$(bindir)
243
244
245 mostlyclean-generic:
246
247 clean-generic:
248
249 distclean-generic:
250 -rm -f Makefile $(CONFIG_CLEAN_FILES)
251 -rm -f config.cache config.log stamp-h stamp-h[0-9]*
252
253 maintainer-clean-generic:
254 mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
255 mostlyclean-tags mostlyclean-generic
256
257 mostlyclean: mostlyclean-am
258
259 clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \
260 mostlyclean-am
261
262 clean: clean-am
263
264 distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
265 distclean-generic clean-am
266
267 distclean: distclean-am
268
269 maintainer-clean-am: maintainer-clean-binPROGRAMS \
270 maintainer-clean-compile maintainer-clean-tags \
271 maintainer-clean-generic distclean-am
272 @echo "This command is intended for maintainers to use;"
273 @echo "it deletes files that may require special tools to rebuild."
274
275 maintainer-clean: maintainer-clean-am
276
277 .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
278 maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
279 mostlyclean-compile distclean-compile clean-compile \
280 maintainer-clean-compile tags mostlyclean-tags distclean-tags \
281 clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
282 check-am installcheck-am installcheck install-exec-am install-exec \
283 install-data-am install-data install-am install uninstall-am uninstall \
284 all-redirect all-am all installdirs mostlyclean-generic \
285 distclean-generic clean-generic maintainer-clean-generic clean \
286 mostlyclean distclean maintainer-clean
287
288
289 #SUBDIRS = mixer
290
291 # Tell versions [3.59,3.63) of GNU make to not export all variables.
292 # Otherwise a system limit (for SysV at least) may be exceeded.
293 .NOEXPORT:
0 /* BumpRace: an easy-to-learn arcade game for up to two players
1 Copyright (C) 2000 Karl Bartel
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
17 Karl Bartel
18 Cecilienstr. 14
19 12307 Berlin
20 GERMANY
21 karlb@gmx.net
22 */
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <SDL_timer.h>
26 #include <signal.h>
27 #include <math.h>
28 #ifdef SOUND
29 #include "SDL_mixer.h"
30 #endif
31 #include "levels.h"
32 #include "particles.h"
33 #include "menu.h"
34 #include "bumprace.h"
35 #include "font.h"
36 #include "options.h"
37
38 #define MAX_PLAYER_NUM 2
39 #define FOREGROUND_TILE_NUM 8
40 #define MAX_SHOTNUM 50
41 #define NUMBER_OF_LEVELS 21
42 #define BPP 0
43 #define RR 3 //this is a value of unprecision for the racer collision
44
45 //the players
46 player user[MAX_PLAYER_NUM]; int pl=0,playernum=2;
47 //general setting
48 int final=1,fullscreen=1,pageflip=0,sound=1,precision=10,fps=0,particle=1,mode,dofadeout=1;
49 //level settings
50 float gravity=0,turbo=5,laser_switch;
51 int startx,starty;
52 //sounds
53 #ifdef SOUND
54 char modname[20]="lizard.mod";
55 Mix_Chunk *explode_sound,*winlevel_sound,*teleport_sound;
56 Mix_Music *music;
57 #endif
58 //images
59 SDL_Surface *timeout_pic, *explosion_pic, *title_pic,
60 *back, *fore[16], *pic_completed,*pic_crashed,
61 *racer_pic[6], *cannon_pic[21], *shot_pic[5],
62 *mode_select_pic[4], *selector_pic, *selectp_pic[2],
63 *Font,*laser_pic[9];
64 //event handling
65 SDL_Event event; Uint8 *keys;
66 //game states
67 int endgame=0,dontshow=0,levelnum=0,quit=0,already=0,laser_state;
68 //level vars
69 char finished[28]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // is level number X finished (1 or 0)
70 int levels_completed=0,Stage;
71 //assorted
72 float game_speed=100,average_speed,time_since_start,accel_speed,turn_speed;
73 int frame_count=0,count_start=0,Score=0;
74 float frames_per_second,PARTICLES_OF_EXHAUST=150;
75 int stop=0,stop2=0,infox,infoy,shotnum=0,cannonnum;
76 Sint32 now,lifetime=800000,last_lifetime,NextParticle;
77 char text[200];
78 int i,y,x,time_bonus;
79 shot_type shot[MAX_SHOTNUM];
80
81 void ComplainAndExit(void);
82
83 void free_memory()
84 {
85 #ifdef SOUND
86 if (sound)
87 {
88 Mix_FreeMusic(music);
89 Mix_FreeChunk(explode_sound);
90 Mix_FreeChunk(winlevel_sound);
91 Mix_FreeChunk(teleport_sound);
92 Mix_CloseAudio();
93 }
94 #endif
95 }
96
97 void timing()
98 {
99 #ifdef SOUND
100 if ((!Mix_PlayingMusic())&&(sound)) {Mix_PlayMusic(music,1);}
101 #endif
102 time_since_start+=game_speed;
103 average_speed=time_since_start/frame_count;
104 //printf("gamespeed: %f average: %f \n",game_speed,average_speed);
105 lifetime-=game_speed;
106 if ( keys[SDLK_ESCAPE] == SDL_PRESSED )
107 {quit=1;endgame=1;}
108 frame_count++;
109 frames_per_second=frame_count*1000/((SDL_GetTicks()-count_start)+1);
110 game_speed=(SDL_GetTicks()-now)*7;
111 while (game_speed<140) {
112 SDL_Delay(1);
113 game_speed=(SDL_GetTicks()-now)*7;
114 }
115 // printf("x:%f y:%f delay:%d fps%f\n",user[pl].realx,user[pl].realy,(SDL_GetTicks()-now),frames_per_second);
116 now=SDL_GetTicks();
117 }
118
119 void corner_collision( Uint8 xblock, Uint8 yblock)
120 {
121 float hyp,alpha,xold,yold;
122 xold=user[pl].xspeed;
123 yold=user[pl].yspeed;
124 hyp=hypot(user[pl].realx+15-xblock*40,user[pl].realy+15-yblock*40);
125 if (hyp<15-RR)
126 {
127 alpha=atan(-(user[pl].realx+15-xblock*40)/(user[pl].realy+15-yblock*40));
128 user[pl].xspeed=2*(xold*cos(alpha)+yold*sin(alpha))*cos(alpha)-xold;
129 user[pl].yspeed=2*(xold*cos(alpha)+yold*sin(alpha))*sin(alpha)-yold;
130 already=1;
131 }
132 }
133
134 void kollision() //calcualtes all collisions
135 {
136 Uint8 x,y,x2,y2,xbig,ybig,sticky;
137 SDL_Rect reblit_back;
138 if (( keys[user[pl].extra] == SDL_PRESSED )&&(user[pl].sticky_possible)) sticky=1; else sticky=0;
139 if (already) {already=0;} else
140 for (y=0;y<=14;y++) {
141 for (x=0;x<=19;x++) {
142 //wall
143 if (((map[levelnum][y][x]==1)||(map[levelnum][y][x]>10)||(map[levelnum][y][x]==8))&&((user[pl].realx+30>x*40)&&(user[pl].realx<x*40+38)&&(user[pl].realy+30>y*40)&&(user[pl].realy<y*40+38))&&(!stop))
144 {
145 // edges
146 if ((user[pl].realy+15<y*40)&&(user[pl].realy+30-RR>y*40)&&(!already)&&
147 (user[pl].realx+15<(x+1)*40)&&(user[pl].realx+15>x*40)&&(map[levelnum][y-1][x]!=1))
148 if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].yspeed>0) {user[pl].yspeed=-user[pl].yspeed;already=1;}
149 if ((user[pl].realx+15>(x+1)*40)&&(user[pl].realx+RR<(x+1)*40)&&(!already)&&
150 (user[pl].realy+15<(y+1)*40)&&(user[pl].realy+15>y*40)&&(map[levelnum][y][x+1]!=1))
151 if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].xspeed<0) {user[pl].xspeed=-user[pl].xspeed;already=1;}
152 if ((user[pl].realy+15>(y+1)*40)&&(user[pl].realy+RR<(y+1)*40)&&(!already)&&
153 (user[pl].realx+15<(x+1)*40)&&(user[pl].realx+15>x*40)&&(map[levelnum][y+1][x]!=1))
154 if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].yspeed<0) {user[pl].yspeed=-user[pl].yspeed;already=1;}
155 if ((user[pl].realx+15<x*40)&&(user[pl].realx+30-RR>x*40)&&(!already)&&
156 (user[pl].realy+15<(y+1)*40)&&(user[pl].realy+15>y*40)&&(map[levelnum][y][x-1]!=1))
157 if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].xspeed>0) {user[pl].xspeed=-user[pl].xspeed;already=1;}
158 // corners
159 if ((user[pl].realx+15>(x+1)*40)&&(user[pl].realy+15<y*40)&&(!already)&&(map[levelnum][y][x+1]!=1)&&(map[levelnum][y-1][x]!=1))
160 /*if ((user[pl].xspeed<0)&&(user[pl].yspeed>0))*/ corner_collision(x+1,y);
161 if ((user[pl].realx+15<x*40)&&(user[pl].realy+15<y*40)&&(!already)&&(map[levelnum][y][x-1]!=1)&&(map[levelnum][y-1][x]!=1))
162 /*if ((user[pl].xspeed>0)&&(user[pl].yspeed>0))*/ corner_collision(x,y);
163 if ((user[pl].realx+15>(x+1)*40)&&(user[pl].realy+15>(y+1)*40)&&(!already)&&(map[levelnum][y][x+1]!=1)&&(map[levelnum][y+1][x]!=1))
164 /*if ((user[pl].xspeed<0)&&(user[pl].yspeed<0))*/ corner_collision(x+1,y+1);
165 if ((user[pl].realx+15<x*40)&&(user[pl].realy+15>(y+1)*40)&&(!already)&&(map[levelnum][y][x-1]!=1)&&(map[levelnum][y+1][x]!=1))
166 /*if ((user[pl].xspeed>0)&&(user[pl].yspeed<0))*/ corner_collision(x,y+1);
167 }
168 if (stop) {stop--;}
169 if (stop2) {stop2--;}
170 //lightning
171 if ((map[levelnum][y][x]==2)&&((user[pl].realx+24>x*40)&&(user[pl].realx<x*40+32)&&(user[pl].realy+24>y*40)&&(user[pl].realy<y*40+32)))
172 {
173 user[pl].crashed=1;
174 }
175 //stopper
176 if ((map[levelnum][y][x]==3)&&((user[pl].realx+24>x*40)&&(user[pl].realx<x*40+32)&&(user[pl].realy+24>y*40)&&(user[pl].realy<y*40+32))&&(!stop2))
177 {
178 user[pl].xspeed=0;
179 user[pl].yspeed=0;
180 stop2=30000;
181 }
182 //finish
183 if ((map[levelnum][y][x]==4)&&((user[pl].realx+14>x*40)&&(user[pl].realx<x*40+22)&&(user[pl].realy+14>y*40)&&(user[pl].realy<y*40+22))&&(!stop2))
184 {
185 user[pl].completed=1;
186 }
187 //teleporter
188 if ((map[levelnum][y][x]==5)&&((user[pl].realx+10>x*40)&&(user[pl].realx<x*40+18)&&(user[pl].realy+10>y*40)&&(user[pl].realy<y*40+18)))
189 {
190 for (y2=0;y2<=14;y2++) {
191 for (x2=0;x2<=19;x2++) {
192 if (((x2!=x)||(y2!=y))&&(map[levelnum][y2][x2]==5)&&(user[pl].teleported==0))
193 {user[pl].realx=x2*40+2;user[pl].realy=y2*40+2;user[pl].teleported=30000000;
194 #ifdef SOUND
195 if (sound) {Mix_PlayChannel(1,teleport_sound,0);}
196 #endif
197 }}
198 }
199 }
200 if (user[pl].teleported>0) {user[pl].teleported-=game_speed;}
201 if (user[pl].teleported<0) {user[pl].teleported=0;}
202 //time bonus
203 if ((map[levelnum][y][x]==6)&&((user[pl].realx+10>x*40)&&(user[pl].realx<x*40+18)&&(user[pl].realy+10>y*40)&&(user[pl].realy<y*40+18)))
204 {
205 map[levelnum][y][x]=0;lifetime+=160000;
206 reblit_back.x=x*40+20-fore[5]->w/2;
207 reblit_back.y=y*40+20-fore[5]->h/2;
208 reblit_back.w=fore[5]->w;
209 reblit_back.h=fore[5]->h;
210 BlitPart(0,0,back,reblit_back);
211 SDL_BlitSurface( back, &reblit_back, backbuffer, &reblit_back );
212 if (!fullscreen) {SDL_UpdateRects(Screen,1,&reblit_back);}
213 }
214 //laser
215 if ((map[levelnum][y][x]==7)&&((user[pl].realx+24>x*40)&&(user[pl].realx<x*40+32)&&(user[pl].realy+24>y*40)&&(user[pl].realy<y*40+32)))
216 {
217 if (laser_state) user[pl].crashed=1;
218 }
219 }
220 }
221 }
222
223 void thrust()
224 {
225 float deltaspeedx, deltaspeedy;
226
227 deltaspeedy = -cos(user[pl].turn*0.01745)*(game_speed/precision); // 0.01745=(2*PI)/360 thats RAD to DEG
228 deltaspeedx = sin(user[pl].turn*0.01745)*(game_speed/precision);
229 user[pl].yspeed+=deltaspeedy;
230 user[pl].xspeed+=deltaspeedx;
231 NextParticle-=game_speed;
232 while (NextParticle<0) {
233 NewParticles(user[pl].turn, user[pl].realx, user[pl].realy);
234 NextParticle+=350;
235 }
236 }
237
238 void HandleRacer() //reads keys and sets new coordinates
239 {
240 float alpha,hyp;
241 for(i=0;i<precision;i++) // multiple times for a more precise collision
242 {
243 turn_speed=0.05*(game_speed/precision);
244 accel_speed=400000/(game_speed/precision);
245
246 SDL_PollEvent(&event);
247 keys = SDL_GetKeyState(NULL);
248 if ( keys[user[pl].up] == SDL_PRESSED ) {
249 thrust();
250 }
251 if ( keys[user[pl].right] == SDL_PRESSED ) {
252 user[pl].turn+=turn_speed;
253 }
254 if ( keys[user[pl].left] == SDL_PRESSED ) {
255 user[pl].turn-=turn_speed;
256 }
257 if (( keys[user[pl].extra] == SDL_PRESSED )&&(user[pl].turbo_possible)) {
258 user[pl].yspeed-=cos(user[pl].turn*0.01745)*turbo*(game_speed/precision);
259 user[pl].xspeed+=sin(user[pl].turn*0.01745)*turbo*(game_speed/precision);
260 }
261 user[pl].realx=user[pl].realx+user[pl].xspeed/accel_speed;
262 user[pl].realy=user[pl].realy+user[pl].yspeed/accel_speed;
263 if (user[pl].realx<-6) {user[pl].realx=-6;user[pl].xspeed=-user[pl].xspeed;}
264 if (user[pl].realx>774) {user[pl].realx=774;user[pl].xspeed=-user[pl].xspeed;}
265 if (user[pl].realy<-6) {user[pl].realy=-6;user[pl].yspeed=-user[pl].yspeed;}
266 if (user[pl].realy>574) {user[pl].realy=574;user[pl].yspeed=-user[pl].yspeed;}
267 kollision();
268 }
269 //gravity
270 user[pl].yspeed+=(gravity)*game_speed;
271 //slowdown
272 if (user[pl].slowdown>0)
273 {
274 if (user[pl].xspeed!=0) {alpha=atan(user[pl].yspeed/user[pl].xspeed);} else alpha=1;
275 hyp=hypot(user[pl].xspeed,user[pl].yspeed);
276 if ((user[pl].xspeed<0))
277 {
278 if (!gravity) {user[pl].yspeed+=sin(alpha)*hyp*user[pl].slowdown*game_speed;}
279 {user[pl].xspeed+=cos(alpha)*hyp*user[pl].slowdown*game_speed;}
280 }else
281 {
282 if (!gravity) {user[pl].yspeed-=sin(alpha)*hyp*user[pl].slowdown*game_speed;}
283 {user[pl].xspeed-=cos(alpha)*hyp*user[pl].slowdown*game_speed;}
284 }
285 }
286 }
287
288 void DontReadKeys()
289 {
290 SDL_EventState(SDL_KEYUP, SDL_IGNORE);
291 SDL_EventState(SDL_KEYDOWN, SDL_IGNORE);
292 }
293
294 void UndrawLaser(int update)
295 {
296 SDL_Rect src_rect;
297
298 Uint8 x,y,xbig,ybig;
299 for (y=0;y<=14;y++) {
300 for (x=0;x<=19;x++) {
301 if (map[levelnum][y][x]==7){
302 src_rect.x=x*40;
303 src_rect.y=y*40;
304 src_rect.w=40;
305 src_rect.h=40;
306 BlitPart(x*40,y*40,backbuffer,src_rect);
307 // SDL_BlitSurface(back , &src_rect , backbuffer, &src_rect);
308 if (update) SDL_UpdateRect(Screen,x*40,y*40,40,40);
309 }
310 }
311 }
312 }
313
314 void DrawLaser()
315 {
316 SDL_Rect src_rect;
317
318 Uint8 x,y,xbig,ybig;
319 for (y=0;y<=14;y++) {
320 for (x=0;x<=19;x++) {
321 if (map[levelnum][y][x]==7){
322 src_rect.x=x*40;
323 src_rect.y=y*40;
324 src_rect.w=40;
325 src_rect.h=40;
326 Blit(x*40 ,y*40,laser_pic[abrand(0,8)]);
327 Blit(x*40+15,y*40,laser_pic[abrand(0,8)]);
328 Blit(x*40+30,y*40,laser_pic[abrand(0,8)]);
329 SDL_UpdateRect(Screen,x*40,y*40,40,40);
330 }
331 }
332 }
333 }
334
335 void draw_cannon()
336 {
337 int pic=0;
338
339 while (cannon.turn<0) cannon.turn+=360;
340 cannon.turn+=90; // bad fix -> should be changed!
341 pic=((cannon.turn)*21/360);
342 if (pic>20) pic-=21; // bad fix -> should be changed!
343 if (pic!=cannon.last_pic)
344 {
345 Blit(cannon.x*40,cannon.y*40,cannon_pic[pic]);
346 BlitToBB(cannon.x*40,cannon.y*40,cannon_pic[pic]);
347 }
348 cannon.last_pic=pic;
349 cannon.turn-=90; // bad fix -> should be changed!
350 while (cannon.turn>360) cannon.turn-=360;
351 }
352
353 void checks_common()
354 {
355 //laser
356 if ((laser_state==0)&&(div(SDL_GetTicks(),laser_switch)).rem<(int)(laser_switch/2))
357 laser_state=1;
358 if ((laser_state==1)&&(div(SDL_GetTicks(),laser_switch).rem>(int)(laser_switch/2))) {
359 laser_state=0;
360 UndrawLaser(1);
361 }
362 //cannon
363 if (cannonnum)
364 {
365 cannon.turn+=game_speed/(15+cannon.type*15);
366 if (cannon.turn>360) cannon.turn-=360;
367 if (cannon.turn<0) cannon.turn+=360;
368 cannon.time_to_shot-=game_speed*1;
369 if ((cannon.time_to_shot<0)&&(shotnum<MAX_SHOTNUM))
370 {
371 cannon.time_to_shot=cannon.shot_delay;
372 shot[shotnum].xspeed=cos((cannon.turn+900*(1/(float)(15+cannon.type*15)))*0.01745)*0.01;
373 shot[shotnum].yspeed=sin((cannon.turn+900*(1/(float)(15+cannon.type*15)))*0.01745)*0.01;
374 shot[shotnum].x=cannon.x*40+20-shot_pic[0]->w/2+1400*shot[shotnum].xspeed;
375 shot[shotnum].y=cannon.y*40+20-shot_pic[0]->h/2+1400*shot[shotnum].yspeed;
376 shotnum++;
377 //printf("%d\n",(int)cannon.turn);
378 }
379 }
380 }
381
382 void DisplayMsg(SDL_Surface *img, float speed)
383 {
384 Blit(400-img->w/2,250,img);
385 now=SDL_GetTicks();
386 for (i=255*speed;i>=0;i-=(float)(SDL_GetTicks()-now)/2)
387 {
388 timing();
389 SDL_SetAlpha(backbuffer,(SDL_SRCALPHA),255);
390 UndrawParticles();
391 HandleParticles();
392 DisplayParticles();
393 Blit(400-img->w/2,250,img);
394 SDL_SetAlpha(backbuffer,(SDL_SRCALPHA),(int)(i/speed));
395 SDL_BlitSurface(backbuffer,&blitrect,Screen,&blitrect);
396 Update();
397 }
398 BlitToBB(400-img->w/2,250,img);
399 SDL_SetAlpha(backbuffer,SDL_SRCALPHA,255);
400 while (NullParticle>0) {
401 timing();
402 UndrawParticles();
403 HandleParticles();
404 DisplayParticles();
405 Update();
406 }
407 SDL_SetAlpha(backbuffer,SDL_SRCALPHA,255);
408 }
409
410 void DrawExplosion()
411 {
412 int x,y;
413
414 x=abrand(-14,+8);y=abrand(-14,+8);
415 Blit(user[pl].realx+x,user[pl].realy+y,explosion_pic);
416 BlitToBB(user[pl].realx+x,user[pl].realy+y,explosion_pic);
417 }
418
419 void checks_1p()
420 {
421 int degree;
422
423 //level end
424 if ( user[pl].completed )
425 {
426 #ifdef SOUND
427 if (sound) {Mix_PlayChannel(-1,winlevel_sound,0);}
428 #endif
429 DontReadKeys();
430 DisplayMsg(pic_completed,1);
431 SDL_Delay(1000);
432 endgame=1;
433 lifetime+=(int)(150000*(1+(time_bonus)/100));
434 }
435 //crash
436 if ( user[pl].crashed )
437 {
438 DontReadKeys();
439 #ifdef SOUND
440 if (sound) {Mix_PlayChannel(-1,explode_sound,0);}
441 #endif
442 SDL_SetAlpha(explosion_pic,(SDL_SRCALPHA),255-80);
443 DrawExplosion();
444 DrawExplosion();
445 DrawExplosion();
446 DisplayMsg(pic_crashed,1);
447 SDL_Delay(1000);
448 endgame=1;
449 fadeout();
450 }
451 //timeout
452 if (lifetime<0)
453 {
454 DontReadKeys();
455 DisplayMsg(timeout_pic,1);
456 SDL_Delay(1000);
457 endgame=1;
458 quit=1;
459 fadeout();
460 }
461 }
462
463 void checks_2p()
464 {
465 for (pl=0;pl<playernum;pl++)
466 {
467 if ((mode==1)&&(!endgame))
468 {
469 if ( user[pl].completed )
470 {
471 #ifdef SOUND
472 if (sound) {Mix_PlayChannel(-1,winlevel_sound,0);}
473 #endif
474 DontReadKeys();
475 DisplayMsg(pic_completed,1);
476 user[pl].points+=1;
477 endgame=1;
478 }
479 if ( user[pl].crashed )
480 {
481 #ifdef SOUND
482 if (sound) {Mix_PlayChannel(-1,explode_sound,0);}
483 #endif
484 user[pl].realx=startx;user[pl].realy=starty;
485 user[pl].xspeed=0;user[pl].yspeed=0;user[pl].crashed=0;
486 }
487 }
488 if ((mode==2)&&(!endgame))
489 {
490 if ( user[pl].completed )
491 {
492 #ifdef SOUND
493 if (sound) {Mix_PlayChannel(-1,winlevel_sound,0);}
494 #endif
495 DontReadKeys();
496 DisplayMsg(pic_completed,1);
497 SDL_Delay(1000);
498 endgame=1;
499 lifetime+=(int)(150000*(1+(time_bonus)/100));
500 }
501 if (lifetime<0)
502 {
503 DontReadKeys();
504 DisplayMsg(timeout_pic,1);
505 endgame=1;
506 quit=1;
507 fadeout();
508 }
509 if ( user[pl].crashed )
510 {
511 #ifdef SOUND
512 if (sound) {Mix_PlayChannel(-1,explode_sound,0);}
513 #endif
514 user[pl].realx=startx;user[pl].realy=starty;
515 user[pl].xspeed=0;user[pl].yspeed=0;user[pl].crashed=0;
516 }
517 }
518 }
519 }
520
521 void blit_lifetime()
522 {
523 float x,y,xcol;
524 SDL_Rect timerect;
525
526 if (mode==1)
527 {
528 Blit(infox*40 ,infoy*40,fore[10]);
529 Blit(infox*40+40,infoy*40,fore[11]);
530 Blit(infox*40+80,infoy*40,fore[12]);
531 PutString(Screen, infox*40+29, infoy*40+14, "P1 P2");
532 sprintf(text,"%2d %2d",user[0].points,user[1].points);
533 PutString(Screen, infox*40+26, infoy*40+24, text );
534 last_lifetime=user[0].points + user[1].points;
535 timerect.x=infox*40+5;
536 timerect.y=infoy*40+24;
537 timerect.w=110;
538 timerect.h=10;
539 SDL_BlitSurface(Screen,&timerect,backbuffer,&timerect);
540 if (!fullscreen) {SDL_UpdateRects(Screen,1,&timerect);}
541 }
542 else
543 {
544 if ((int)(lifetime/10000)!=(int)(last_lifetime/10000))
545 {
546 Blit(infox*40 ,infoy*40,fore[10]);
547 Blit(infox*40+40,infoy*40,fore[11]);
548 Blit(infox*40+80,infoy*40,fore[12]);
549 PutString(Screen, infox*40+17, infoy*40+10, "Time Left");
550 last_lifetime=lifetime;
551 lock();
552 for (x=0;x<(lifetime/10000);x++) {
553 if (x*3<255) xcol=x*3; else xcol=255;
554 for (y=0;y<10;y++) {
555 PutPixel(Screen,x+infox*40+60-(lifetime/20000),y+infoy*40+28,SDL_MapRGB(Screen->format,255-xcol,xcol,y));
556 }
557 }
558 unlock();
559 timerect.x=infox*40+5;
560 timerect.y=infoy*40;
561 timerect.w=110;
562 timerect.h=38;
563 if (!fullscreen) {SDL_UpdateRects(Screen,1,&timerect);}
564 SDL_BlitSurface(Screen,&timerect,backbuffer,&timerect);
565 }
566 }
567 }
568
569 SDL_Rect SetShotRect(int i)
570 {
571 SDL_Rect rect;
572
573 rect.x=shot[i].x;
574 rect.y=shot[i].y;
575 rect.w=shot_pic[0]->w;
576 rect.h=shot_pic[0]->h;
577 if (rect.w+rect.x>800) rect.w=800-rect.x;
578 if (rect.h+rect.y>600) rect.h=600-rect.y;
579 if (rect.x<0) {rect.w=rect.w+rect.x;rect.x=0;}
580 if (rect.y<0) {rect.h=rect.h+rect.y;rect.y=0;}
581 return (rect);
582 }
583
584 void UndrawShots()
585 {
586 for (i=0;i<shotnum;i++)
587 {
588 shot[i].oldrect=SetShotRect(i);
589 BlitPart(0,0,backbuffer,shot[i].oldrect);
590 }
591 }
592
593 void HandleShots()
594 {
595 int i2;
596 for (i=0;i<shotnum;i++)
597 {
598 shot[i].anim+=game_speed*0.004;
599 while ((int)shot[i].anim>4) shot[i].anim-=5;
600 shot[i].x+=shot[i].xspeed*game_speed;
601 shot[i].y+=shot[i].yspeed*game_speed;
602 if ((shot[i].x<=-shot_pic[0]->w)||(shot[i].x>=800)
603 ||(shot[i].y<=-shot_pic[0]->h)||(shot[i].y>=600))
604 {
605 SDL_UpdateRects( Screen, 1, &shot[i].oldrect );
606 for (i2=i;i2<shotnum-1;i2++)
607 shot[i2]=shot[i2+1];
608 shotnum--;
609 }
610 for (pl=0;pl<playernum;pl++)
611 if (hypot(shot[i].x+10-(user[pl].realx+15),shot[i].y+10-(user[pl].realy+15))<16-RR)
612 {
613 user[pl].crashed=1;
614 }
615 }
616 }
617
618 void DisplayShots()
619 {
620 SDL_Rect update[2];
621
622 for (i=0;i<shotnum;i++)
623 Blit(shot[i].x,shot[i].y,shot_pic[(int)shot[i].anim]);
624 }
625
626 void UndrawRacer()
627 {
628 BlitPart(0,0,backbuffer,user[pl].oldrect);
629 }
630
631 void DisplayRacer()
632 {
633 int pic=0,i;
634
635 if (user[pl].turn<0) {user[pl].turn=user[pl].turn+360;}
636 if (user[pl].turn>360) {user[pl].turn=user[pl].turn-360;}
637 for (i=0;i<=17;i++) //selects the correct picture
638 if (user[pl].turn+10>i*20) {pic=i;}
639 Blit(user[pl].realx,user[pl].realy,user[pl].racer[pic]);
640 user[pl].oldrect=blitrect;
641 }
642
643 void HandleAndDraw_RacerParticlesAndShots()
644 {
645 if (laser_state) UndrawLaser(0);
646 UndrawShots();
647 UndrawParticles();
648 for (pl=0;pl<playernum;pl++)
649 UndrawRacer();
650 HandleShots();
651 HandleParticles();
652 for (pl=0;pl<playernum;pl++)
653 HandleRacer();
654 draw_cannon();
655 DisplayShots();
656 if (laser_state) DrawLaser();
657 DisplayParticles();
658 for (pl=0;pl<playernum;pl++)
659 DisplayRacer();
660 }
661
662 void blit_fore() //blits the leves foreground (used only one time per level)
663 {
664 Uint8 x,y;
665 for (y=0;y<=14;y++) {
666 for (x=0;x<=19;x++) {
667 if ((map[levelnum][y][x]!=0)&&(map[levelnum][y][x]!=7))
668 Blit(x*40-fore[map[levelnum][y][x]-1]->w/2+20,
669 y*40-fore[map[levelnum][y][x]-1]->h/2+20,
670 fore[map[levelnum][y][x]-1]);
671 }
672 }
673 }
674
675 void LookForInfo() //looks for the info box in this level
676 {
677 int i;
678
679 infox=-1;
680 infoy=-1;
681 cannon.x=-1;
682 for (y=0;y<=14;y++) {
683 for (x=0;x<=19;x++) {
684 if ((map[levelnum][y][x]==11)&&(infoy==-1))
685 {
686 infox=x;
687 infoy=y;
688 }
689 if (map[levelnum][y][x]==8)
690 {
691 cannon.y=y;
692 cannon.x=x;
693 }
694 }
695 }
696 if (cannon.x<0) cannonnum=0; else cannonnum=1;
697 }
698
699 void load_images()
700 {
701 Uint8 i;
702
703 racer_pic[0]=LoadImage("racer_big.gif",0);
704 racer_pic[1]=LoadImage("racerb_big.gif",0);
705 racer_pic[2]=LoadImage("racere_big.gif",0);
706 racer_pic[4]=LoadImage("racerd_big.gif",0);
707 racer_pic[3]=LoadImage("racerf_big.gif",0);
708 racer_pic[5]=LoadImage("highscore.png",0);
709 timeout_pic=LoadImage("timeout.png",3);
710 explosion_pic=LoadImage("explosion1.gif",1);
711 pic_completed=LoadImage("completed.png",3);
712 pic_crashed=LoadImage("crashed.png",3);
713 back=LoadImage("back2.jpg",0);
714 mode_select_pic[0]=LoadImage("1player.jpg",0);
715 mode_select_pic[1]=LoadImage("2playercomp.jpg",0);
716 mode_select_pic[2]=LoadImage("2playerteam.jpg",0);
717 mode_select_pic[3]=LoadImage("quit.jpg",0);
718 selectp_pic[0]=LoadImage("selectp1.jpg",0);
719 selectp_pic[1]=LoadImage("selectp2.jpg",0);
720 selector_pic=LoadImage("select.gif",1);
721 for (i=0;i<=FOREGROUND_TILE_NUM-1;i++)
722 {
723 sprintf(text,"fore%d.png",i+1);
724 fore[i]=LoadImage(text,3);
725 }
726 for (i=10;i<16;i++)
727 {
728 sprintf(text,"fore%d.gif",i+1);
729 fore[i]=LoadImage(text,0);
730 }
731 for (i=0;i<21;i++)
732 {
733 sprintf(text,"cannon%d.jpg",i+1);
734 cannon_pic[i]=LoadImage(text,0);
735 }
736 for (i=0;i<5;i++)
737 {
738 sprintf(text,"star%d.gif",i+1);
739 shot_pic[i]=LoadImage(text,1);
740 }
741 for (i=0;i<9;i++)
742 {
743 sprintf(text,"laser%d.png",i+1);
744 laser_pic[i]=LoadImage(text,3);
745 }
746 }
747
748 void TextHelp(char *argv[])
749 {
750 printf("\nBumpRace Version %s\n",VERSION);
751 puts("The newest version can be obtained at http://www.linux-games.com/\n");
752 printf("Usage: %s [options]\n",argv[0]);
753 puts(" [-f | --fullscreen] start in fullscreen mode (default)");
754 puts(" [-w,| --windowed] start in windowed mode");
755 puts(" [-s,| --nosound] start without sound");
756 puts(" [-n,| --notfinal] no title screen (nice for develolopers)");
757 puts(" [-t,| --noparticles] turns of paticles. good for slow computers.");
758 puts(" [-o,| --nofadeout] no fadeout after crash (for slow coputers)");
759 puts(" [ --precision] sets the precison of the collisions (default=10)");
760 puts(" [-h,| --help] this text\n");
761
762 exit(0);
763 }
764
765 void ReadCommandLine(char *argv[])
766 {
767 int i;
768 for ( i=1;argv[i];i++ )
769 {
770 if ((strcmp(argv[i],"--nosound")==0)||(strcmp(argv[i],"-s")==0)) {sound=0;} else
771 if ((strcmp(argv[i],"--fullscreen")==0)||(strcmp(argv[i],"-f")==0)) {fullscreen=1;} else
772 if ((strcmp(argv[i],"--windowed")==0)||(strcmp(argv[i],"-w")==0)) {fullscreen=0;} else
773 if ((strcmp(argv[i],"--pageflip")==0)||(strcmp(argv[i],"-p")==0)) {pageflip=1;fullscreen=1;} else
774 if ((strcmp(argv[i],"--notfinal")==0)||(strcmp(argv[i],"-n")==0)) {final=0;} else
775 if ((strcmp(argv[i],"--noparticles")==0)||(strcmp(argv[i],"-t")==0)) {particle=0;} else
776 if ((strcmp(argv[i],"--nofadeout")==0)||(strcmp(argv[i],"-o")==0)) {dofadeout=0;} else
777 if ((strcmp(argv[i],"--precision")==0)&&(argv[i+1]))
778 {i++;precision=atoi(argv[i]);printf("Precision is set to %d\n",precision);} else
779 if ((strcmp(argv[i],"--help")==0)||(strcmp(argv[i],"-h")==0)) TextHelp(argv);
780 else {
781 printf("Unknown parameter (-h for help): \"%s\" \n", argv[i]);
782 TextHelp(argv);
783 }
784 }
785 }
786
787 void BlitMenu() //blits menu for SelectRacer
788 {
789 SDL_Rect fillrect;
790
791 for (i=0;i<=5;i++)
792 {
793 if (i==user[pl].racernum) {
794 SDL_SetAlpha(racer_pic[i],(SDL_SRCALPHA),255);
795 } else {
796 SDL_SetAlpha(racer_pic[i],(SDL_SRCALPHA),75);
797 }
798 }
799 fillrect.x=0;
800 fillrect.y=160;
801 fillrect.w=800;
802 fillrect.h=440;
803 SDL_FillRect(Screen,&fillrect,0);
804 Blit(50,160,racer_pic[0]);
805 Blit(300,160,racer_pic[1]);
806 Blit(550,160,racer_pic[2]);
807 Blit(50,370,racer_pic[3]);
808 Blit(300,370,racer_pic[4]);
809 Blit(550,370,racer_pic[5]);
810 PutString(Screen, 100, 350, "Best steering");
811 PutString(Screen, 330, 350, "15% extra time");
812 PutString(Screen, 540, 350, "High velocity (ctrl key)");
813 PutString(Screen, 40, 560, "Sticks to walls (ctrl key)");
814 }
815
816 void NextStage()
817 {
818 Blit(0,0,back);
819 XCenteredString(Screen, 100, "Congratulations!");
820 XCenteredString(Screen, 130, "You have completed a stage!");
821 XCenteredString(Screen, 200, "You gain 200 points for completing this stage");
822 sprintf(text, "and %d points for the time that is left,", lifetime/3000);
823 XCenteredString(Screen, 230, text);
824 XCenteredString(Screen, 260, "but the game gets a bit harder.");
825 sprintf(text, "You are in Stage %d now", ++Stage);
826 XCenteredString(Screen, 360, text);
827 sprintf(text, "Your current score is %d", Score+=200+lifetime/3000);
828 XCenteredString(Screen, 390, text);
829 levels_completed=0;
830 lifetime=800000-(Stage-1)*70000;
831 SDL_UpdateRect(Screen,0,0,0,0);
832 SDL_EventState(SDL_KEYUP, SDL_ENABLE);
833 SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
834 SDL_WaitEvent(&event);
835 SDL_WaitEvent(&event);
836 }
837
838 void nextlevel() //selects the next level at random
839 {
840 int i;
841 finished[levelnum]=1;
842 quit=1;
843 for (i=0;i<NUMBER_OF_LEVELS;i++) {
844 if (finished[i]==0) {quit=0;}
845 }
846 if (!quit) {
847 while (finished[levelnum]==1)
848 {
849 levelnum=abrand(0,NUMBER_OF_LEVELS-1);
850 }
851 levels_completed++;
852 } else {
853 // reset all levels, if each level has been played one time
854 for (i=0;i<=NUMBER_OF_LEVELS;i++) {
855 int x,y;
856
857 finished[i]=0;
858 for (x=0; x<20; x++) {
859 for (y=0; y<15; y++) {
860 map[i][y][x] = origMap[i][y][x];
861 }
862 }
863 }
864 quit=0;
865 levelnum=abrand(0,NUMBER_OF_LEVELS-1);
866 }
867 if ((levels_completed==4)&&(mode!=1)) NextStage();
868 sprintf(text,"BumpRace: Level #%d",levelnum);
869 SDL_WM_SetCaption(text,"BumpRace");
870 Score+=20;
871 }
872
873 void InitLevel()
874 {
875 NullParticle = 0; // No Particles
876 endgame=0;
877 game_speed=1;count_start=SDL_GetTicks();
878 frame_count=0;now=SDL_GetTicks();time_since_start=0;cannon.turn=0;cannon.type=1;
879 shotnum=0;last_lifetime=-1;startx=5;starty=5;
880 cannon.shot_delay=11000-Stage*300-abrand(0,3000+Stage*1000); cannon.time_to_shot=1000;
881 laser_switch=6000+abrand(-Stage*500,200);
882 cannon.type=abrand(1,5);
883 if (levelnum==12) {gravity=1;starty=560;} else {gravity=0;}
884 if (levelnum==13) {starty=270;}
885 if (levelnum==14) {startx=370;starty=290;}
886 if (levelnum==15) {startx=750;starty=40;}
887 if (levelnum==16) {startx=370;starty=50;}
888 if (levelnum==17) {startx=370;starty=570;gravity=0.3;}
889 for (pl=0;pl<playernum;pl++)
890 {
891 user[pl].realx=startx+10*pl;user[pl].realy=starty;user[pl].xspeed=0;user[pl].yspeed=0;
892 user[pl].crashed=0;user[pl].completed=0;user[pl].teleported=0;
893 HandleRacer();
894 }
895 for (i=0;i<=1;i++)
896 {
897 Blit(0,0,back);
898 blit_fore();
899 LookForInfo();
900 last_lifetime=0;
901 blit_lifetime();
902 SDL_BlitSurface(Screen, NULL, backbuffer, NULL);
903 SDL_UpdateRect(Screen,0,0,0,0);
904 }
905 SDL_EventState(SDL_KEYUP, SDL_ENABLE);
906 SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
907 // printf(" successfully **\n");
908 }
909
910 void StartText() //bl means brightness loss
911 {
912 SDL_Rect rect;
913
914 sprintf(text,"BumpRace Version %s (C) 2000 Karl Bartel", VERSION);
915 PutString(Screen,170, 380, text);
916 PutString(Screen,170, 402, "BumpRace comes with ABSOLUTELY NO WARRANTY");
917 PutString(Screen,170, 424, "This is free software, and you are welcome to");
918 PutString(Screen,170, 446, "redistribute it under certain conditions;");
919 PutString(Screen,170, 468, "see COPYING for details.");
920 SDL_UpdateRect(Screen,50,380,700,90);
921 rect.x=50;
922 rect.y=380;
923 rect.w=700;
924 rect.h=90;
925 SDL_FillRect(Screen,&rect,0);
926 }
927
928 void ScoreText()
929 {
930 Uint32 x;
931
932 x=260;
933 PutString(Screen, 400-TextWidth("---- COMPETITION SCORE ----")/2, 100, "---- COMPETITION SCORE ----");
934 PutString(Screen, x, 200, "Player 1:");
935 PutString(Screen, x, 215, "Player 2:");
936 sprintf(text, "%d levels completed", user[0].points);
937 PutString(Screen, x+280-TextWidth(text), 200, text);
938 sprintf(text,"%d levels completed",user[1].points);
939 PutString(Screen, x+280-TextWidth(text), 215, text);
940 if (user[0].points>user[1].points) sprintf(text,"Player 1 has won!");
941 else if (user[0].points<user[1].points) sprintf(text,"Player 2 has won!");
942 else sprintf(text,"Draw Game!");
943 PutString(Screen, 400-TextWidth(text)/2, 240, text);
944 }
945
946 void score()
947 {
948 if (lifetime<0) lifetime=0;
949 if (mode==1) {
950 Blit(0,0,back);
951 ScoreText();
952 SDL_UpdateRect(Screen,0,0,0,0);
953 SDL_EventState(SDL_KEYUP, SDL_ENABLE);
954 SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
955 SDL_WaitEvent(&event);
956 SDL_WaitEvent(&event);
957 } else {
958 Score+=lifetime/3000;
959 FinalScore();
960 ShowHiscore();
961 }
962 }
963
964 #ifdef SOUND
965
966 void InitSound()
967 {
968 if ( Mix_OpenAudio(44100, AUDIO_S16, 2, 1024) < 0 )
969 {
970 fprintf(stderr,"Warning: Couldn't set 22025 Hz 16-bit audio\n- Reason: %s\n",SDL_GetError());
971 fprintf(stderr,"\t**\nSOUND TURNED OFF\n\t**\n");
972 sound=0;
973 }else{
974 sprintf(text,"%s/sound/lizard.mod",DATAPATH);
975 music = Mix_LoadMUS(text);
976 if (music==NULL) {printf("COULD NOT LOAD MUSIC\n");ComplainAndExit();}
977 sprintf(text,"%s/sound/%s",DATAPATH,"explode.wav");
978 explode_sound = Mix_LoadWAV_RW(SDL_RWFromFile(text, "rb"), 1);
979 sprintf(text,"%s/sound/%s",DATAPATH,"winlevel.wav");
980 winlevel_sound = Mix_LoadWAV_RW(SDL_RWFromFile(text, "rb"), 1);
981 sprintf(text,"%s/sound/%s",DATAPATH,"whoosh.wav");
982 teleport_sound = Mix_LoadWAV_RW(SDL_RWFromFile(text, "rb"), 1);
983 }
984 }
985 #endif
986
987 main(int argc, char *argv[])
988 {
989 //intialisation
990 ReadCommandLine(argv);
991 init_SDL();
992 SDL_ShowCursor(0);
993 SDL_WM_SetCaption("BumpRace","BumpRace");
994 printf("** Video mode set **\n");
995 srand( (unsigned) time(NULL) );
996 SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
997 fullscreen=0; //activate update_rects
998 SDL_EnableUNICODE(1);
999 user[0].up=SDLK_UP;user[0].down=SDLK_DOWN;user[0].left=SDLK_LEFT;user[0].right=SDLK_RIGHT;user[0].extra=SDLK_RCTRL;
1000 user[1].up=SDLK_w;user[1].down=SDLK_s;user[1].left=SDLK_a;user[1].right=SDLK_d;user[1].extra=SDLK_LCTRL;
1001 ReadOptions();
1002 ReadOptions();
1003 //show title screen
1004 title_pic=LoadImage("title.gif",0);
1005 Blit(0,0,title_pic);
1006 SDL_UpdateRect(Screen,0,0,0,0);
1007 sprintf(text,"%s/font.scl",DATAPATH);
1008 Font=LoadImage("font.png",3);
1009 InitFont(Font);
1010 if (final) StartText(i);
1011 //load data
1012 printf("** Loading Data **\n");
1013 #ifdef SOUND
1014 if (sound) {InitSound();}
1015 if ((!Mix_PlayingMusic())&&(sound)) {Mix_PlayMusic(music,1);}
1016 #endif
1017 load_images();
1018 printf("** Main data loaded **\n");
1019 if (final) {
1020 SDL_Delay(3000);
1021 SDL_UpdateRect(Screen,50,380,700,90);
1022 }
1023 for (i=0;i<=NUMBER_OF_LEVELS;i++) {
1024 int x,y;
1025
1026 finished[i]=0;
1027 for (x=0; x<20; x++) {
1028 for (y=0; y<15; y++) {
1029 map[i][y][x] = origMap[i][y][x];
1030 }
1031 }
1032 }
1033 // select game mode
1034 Menu();
1035 while (mode!=3)
1036 {
1037 levelnum=abrand(0,NUMBER_OF_LEVELS-1);
1038 sprintf(text,"BumpRace: Level #%d",levelnum);
1039 SDL_WM_SetCaption(text,"BumpRace");
1040 for (pl=0;pl<playernum;pl++) {user[pl].racernum=0;user[pl].points=0;}
1041 lifetime=800000;Score=0;levels_completed=0;Stage=1;
1042 for (i=0;i<=NUMBER_OF_LEVELS;i++)
1043 finished[i]=0;
1044 // select racer
1045 if (final)
1046 {
1047 clear_screen();
1048 for (pl=0;pl<playernum;pl++) while (1)
1049 {
1050 BlitMenu();
1051 Blit(100,0,selectp_pic[pl]);
1052 SDL_UpdateRect(Screen,0,0,0,0);
1053 SDL_PollEvent(&event);
1054 SelectRacer();
1055 if (user[pl].racernum==4) help();
1056 else if (user[pl].racernum==5) {ShowHiscore();SDL_WaitEvent(&event);}
1057 else break;
1058 }
1059 }
1060 printf("** Racer selcted **\n");
1061 for (pl=0;pl<playernum;pl++) load_racer();
1062 printf("** Racer data loaded **\n");
1063 // set racer abilities
1064 time_bonus=user[0].extra_time+user[1].extra_time;
1065 if (mode!=0) time_bonus-=20;
1066 lifetime+=lifetime*time_bonus/100;
1067 // start level
1068 while (!quit)
1069 {
1070 InitLevel();
1071 checks_common();
1072 // game loop
1073 while (!endgame)
1074 {
1075 HandleAndDraw_RacerParticlesAndShots();
1076 pl=0;
1077 if (playernum==1) checks_1p();
1078 if (playernum==2) checks_2p();
1079 checks_common();
1080 timing();
1081 blit_lifetime();
1082 Update();
1083 }
1084 //end of game loop
1085 if ((user[0].completed)||(user[playernum-1].completed))
1086 {
1087 nextlevel();
1088 }
1089 }
1090 if (final) {
1091 score();
1092 }
1093 quit=0;
1094 PrepareMenu();
1095 SDL_EventState(SDL_KEYUP, SDL_ENABLE);
1096 SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
1097 Menu();
1098 }
1099 //user wants to quit
1100 #ifdef SOUND
1101 Mix_FadeOutMusic(1000);
1102 #endif
1103 free_memory();
1104 printf("Awaiting SDL_Quit()\n");
1105 SDL_Quit();
1106 printf("SDL_Quit() finished.\n");
1107 }
0 #ifndef _BUMPRACE_H_
1 #define _BUMPRACE_H_
2
3 #include <SDL.h>
4 #include "gfx.h"
5 #include "font.h"
6
7 #define SDL_SetAlpha($1,$2,$3) SDL_SetAlpha($1,0,0);SDL_SetAlpha($1,$2,$3)
8
9 typedef struct{
10 float slowdown,turbo_possible,sticky_possible,extra_time;
11 float realx,realy,xspeed,yspeed,turn,teleported;
12 int crashed,completed,racernum,points;
13 SDL_Rect oldrect;
14 SDLKey up,down,left,right,extra;
15 SDL_Surface *racer[18];
16 }player;
17
18 typedef struct
19 {
20 int shot_delay; // delay between two shots
21 float time_to_shot; // time to the next shot
22 float turn; // current degree of rotation
23 int x,y; // coordinates
24 int last_pic; // last blitted picture
25 int type; // shooting method
26 } cannon_type;
27
28 cannon_type cannon;
29
30 typedef struct
31 {
32 float x,y; // coordinates
33 float xspeed,yspeed; // speed and direction
34 float anim; // # of shown picture
35 SDL_Rect oldrect; // the background has to be restored here
36 } shot_type;
37
38
39 #define MAX_PLAYER_NUM 2
40
41 extern player user[MAX_PLAYER_NUM];
42 extern SDL_Surface *screen, *back, *backbuffer, *fore[16],
43 *racer_pic[6], *selector_pic, *selectp_pic[2], *mode_select_pic[4],
44 *title_pic;
45 extern float game_speed, gravity;
46 extern int particle,which_racer,pl,i,mode,playernum,Score,fullscreen,precision,dofadeout;
47 extern Uint8 *keys;
48 extern SDL_Event event;
49 extern struct BitFont font;
50 extern Sint32 now;
51 extern char text[200];
52 //extern char *DATAPATH[200];
53
54 #endif
0 #include "SDL.h"
1
2 int CharPos[520];
3 SDL_Surface *Font;
4
5 #define SPACE_WIDTH CharPos[2]-CharPos[1]
6
7 void InitFont(SDL_Surface *FontToUse)
8 {
9 int x=0,i=0;
10
11 Font=FontToUse;
12 while (x<Font->w) {
13 if (GetPixel(Font,x,0)==SDL_MapRGB(Font->format,255,0,255)) {
14 CharPos[i++]=x;
15 // printf("%d ",x);
16 while (GetPixel(Font,x,0)==SDL_MapRGB(Font->format,255,0,255))
17 x++;
18 CharPos[i++]=x;
19 // printf("%d ",x);
20 }
21 x++;
22 // printf("%d-",GetPixel(Font,x,0));
23 }
24 }
25
26
27 void PutString(SDL_Surface *Surface, int x, int y, char *text)
28 {
29 unsigned char ofs;
30 int i=0;
31 SDL_Rect srcrect,dstrect;
32
33 while (text[i]!='\0') {
34 if (text[i]==' ') {
35 x+=SPACE_WIDTH;
36 i++;
37 } else {
38 ofs=(text[i]-33)*2+1;
39 // printf("printing %c %d\n",text[i],ofs);
40 srcrect.w=dstrect.w=(CharPos[ofs+2]+CharPos[ofs+1])/2-(CharPos[ofs]+CharPos[ofs-1])/2;
41 srcrect.h=dstrect.h=Font->h-1;
42 srcrect.x=(CharPos[ofs]+CharPos[ofs-1])/2;
43 srcrect.y=1;
44 dstrect.x=x;
45 dstrect.y=y;
46 SDL_BlitSurface( Font, &srcrect, Surface, &dstrect);
47 x+=CharPos[ofs+1]-CharPos[ofs];
48 i++;
49 }
50 }
51 }
52
53 int TextWidth(char *text)
54 {
55 int x=0,i=0;
56 unsigned char ofs;
57
58 while (text[i]!='\0') {
59 if (text[i]==' ') {
60 x+=SPACE_WIDTH;
61 i++;
62 } else {
63 ofs=(text[i]-33)*2+1;
64 x+=CharPos[ofs+1]-CharPos[ofs];
65 i++;
66 }
67 }
68 return x+CharPos[ofs+2]-CharPos[ofs+1];
69 }
70
71 void XCenteredString(SDL_Surface *Surface, int y, char *text)
72 {
73 PutString(Surface, Surface->w/2-TextWidth(text)/2, y, text);
74 }
0 // SFONT - SDL Font Library by Karl Bartel <karlb@gmx.net>
1
2 #include "SDL.h"
3
4 // Initializes the font
5 // Font: this is the surface which contains the font.
6 void InitFont(SDL_Surface *Font);
7
8 // Blits a string to a surface
9 // Destination: the suface you want to blit to
10 // text: a string containing the text you want to blit.
11 void PutString( SDL_Surface *Destination, int x, int y, char *text);
12
13 // Blits a string to with centered x position
14 void XCenteredString(SDL_Surface *Surface, int y, char *text);
15
16 // Returns the width of "text" in pixels
17 int TextWidth( char *text);
0 #include <bumprace.h>
1 #include "IMG.h"
2
3 #define PATHNUM 8
4 #define BPP 0
5 #define RECTS_NUM 40000
6 char DATAPATH[200]=DATADIR;
7 const char PATH[PATHNUM][200]={DATADIR,".","data","/usr/local/share/bumprace"
8 ,"/usr/lib/bumprace","../data","/usr/share/bumprace",DATADIR};
9 SDL_Surface *Screen,*BackBuffer,*fadebuffer;
10 SDL_Rect blitrect,blitrects[RECTS_NUM];
11 int blitrects_num=0;
12 #ifdef DATADIR
13 void ComplainAndExit(void)
14 {
15 fprintf(stderr, "Problem: %s\n", SDL_GetError());
16 exit(1);
17 }
18 #endif
19 int abrand(int a,int b) //random number between a and b (inclusive)
20 {
21 return(a+(rand() % (b-a+1)));
22 }
23
24 int (*_PutPixel)(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color);
25
26 int fast_putpixel1(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color)
27 {
28 if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h)
29 return -1;
30
31 *((Uint8 *)Surface->pixels + Y * Surface->pitch + X) = Color;
32
33 return 0;
34 }
35
36 int fast_putpixel2(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color)
37 {
38 if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h)
39 return -1;
40
41 *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X) = Color;
42
43 return 0;
44 }
45
46 int fast_putpixel3(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color)
47 {
48 Uint8 *pix;
49 int shift;
50
51 if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h)
52 return -1;
53
54 /* Gack - slow, but endian correct */
55 pix = (Uint8 *)Surface->pixels + Y * Surface->pitch + X*3;
56 shift = Surface->format->Rshift;
57 *(pix+shift/8) = Color>>shift;
58 shift = Surface->format->Gshift;
59 *(pix+shift/8) = Color>>shift;
60 shift = Surface->format->Bshift;
61 *(pix+shift/8) = Color>>shift;
62
63 return 0;
64 }
65
66 int fast_putpixel4(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color)
67 {
68 if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h)
69 return -1;
70
71 *((Uint32 *)Surface->pixels + Y * Surface->pitch/4 + X) = Color;
72
73 return 0;
74 }
75
76 void init_SDL() // sets the video mode
77 {
78 int bpp=BPP;
79 const SDL_VideoInfo *info;
80
81 if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_AUDIO) < 0 ) {ComplainAndExit();}
82 info = SDL_GetVideoInfo();
83 if (info->vfmt->BitsPerPixel==8) bpp=16;
84 atexit(SDL_Quit);
85 // Set the video mode (800x600 at 16-bit depth)
86 if (fullscreen)
87 Screen = SDL_SetVideoMode(800, 600, BPP, SDL_FULLSCREEN);
88 else
89 { Screen = SDL_SetVideoMode(800, 600, BPP, 0); }
90 if ( Screen == NULL ) {ComplainAndExit();}
91 // create BackBuffer
92 BackBuffer = SDL_AllocSurface(Screen->flags,
93 800,
94 600,
95 Screen->format->BitsPerPixel,
96 Screen->format->Rmask,
97 Screen->format->Gmask,
98 Screen->format->Bmask, 0);
99 if (BackBuffer == NULL)
100 printf("ERROR: Couldn't create BackBuffer: %s\n", SDL_GetError());
101 fadebuffer = SDL_AllocSurface(Screen->flags,
102 800,
103 600,
104 Screen->format->BitsPerPixel,
105 Screen->format->Rmask,
106 Screen->format->Gmask,
107 Screen->format->Bmask, 0);
108 if (fadebuffer == NULL)
109 printf("ERROR: Couldn't create fadebuffer: %s\n", SDL_GetError());
110 // Figure out what putpixel routine to use
111 switch (Screen->format->BytesPerPixel)
112 {
113 case 1:
114 _PutPixel = fast_putpixel1;
115 break;
116 case 2:
117 _PutPixel = fast_putpixel2;
118 break;
119 case 3:
120 _PutPixel = fast_putpixel3;
121 break;
122 case 4:
123 _PutPixel = fast_putpixel4;
124 break;
125 }
126 }
127
128 void lock()
129 {
130 if ( SDL_MUSTLOCK(Screen) ) {
131 if ( SDL_LockSurface(Screen) < 0 )
132 return; }
133 }
134
135 void unlock()
136 {
137 if ( SDL_MUSTLOCK(Screen) ) {
138 SDL_UnlockSurface(Screen); }
139 }
140
141 // Performs Callback at each line point. This came straight from the
142 // asphyxia vga trainers
143 int DoLine (SDL_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Uint32 Color, int Callback (SDL_Surface *Surf, Sint32 X, Sint32 Y, Uint32 Color))
144 {
145 Sint32 dx, dy, sdx, sdy, x, y, px, py;
146
147 dx = X2 - X1;
148 dy = Y2 - Y1;
149
150 sdx = (dx < 0) ? -1 : 1;
151 sdy = (dy < 0) ? -1 : 1;
152
153 dx = sdx * dx + 1;
154 dy = sdy * dy + 1;
155
156 x = y = 0;
157
158 px = X1;
159 py = Y1;
160
161 if (dx >= dy)
162 {
163 for (x = 0; x < dx; x++)
164 {
165 Callback(Surface, px, py, Color);
166
167 y += dy;
168 if (y >= dx)
169 {
170 y -= dx;
171 py += sdy;
172 }
173 px += sdx;
174 }
175 }
176 else
177 {
178 for (y = 0; y < dy; y++)
179 {
180
181 Callback(Surface, px, py, Color);
182
183 x += dx;
184 if (x >= dy)
185 {
186 x -= dy;
187 px += sdx;
188 }
189 py += sdy;
190 }
191 }
192 return 0;
193 }
194
195 // The user's line drawing function
196 void Line(Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Uint32 Color)
197 {
198 Sint32 temp;
199
200 /*
201
202 // Make sure X1 is before X2
203 if (X2 < X1){
204 temp = X2;
205 X2 = X1;
206 X1 = temp;
207 }
208 // Make sure Y1 is before Y2
209 if (Y2 < Y1){
210 temp = Y2;
211 Y2 = Y1;
212 Y1 = temp;
213 }
214 */
215 lock(Screen);
216
217 /* Draw the line */
218 DoLine(Screen, X1, Y1, X2, Y2, Color, &PutPixel);
219 unlock(Screen);
220 }
221
222 void fadeout()
223 {
224 int x,y;
225
226 if (dofadeout==0) return;
227
228 for (x=0;x<800;x++)
229 {
230 lock();
231 for (y=0;y<300;y++)
232 {
233 PutPixel(Screen,x,y*2,SDL_MapRGB(Screen->format,0,0,0));
234 }
235 unlock();
236 Update();
237 }
238 for (x=799;x>=0;x--)
239 {
240 lock();
241 for (y=299;y>0;y--)
242 {
243 PutPixel(Screen,x,y*2+1,SDL_MapRGB(Screen->format,0,0,0));
244 }
245 unlock();
246 Update();
247 }
248 }
249
250 void Update()
251 {
252 SDL_UpdateRects(Screen,blitrects_num,blitrects);
253 blitrects_num=0;
254 }
255
256 void AddRect(int x1, int y1, int x2, int y2)
257 {
258 int temp;
259
260 /* Make sure X1 is before X2 */
261 if (x2 < x1){
262 temp = x2;
263 x2 = x1;
264 x1 = temp;
265 }
266 /* Make sure Y1 is before Y2 */
267 if (y2 < y1){
268 temp = y2;
269 y2 = y1;
270 y1 = temp;
271 }
272 blitrect.x = x1;
273 blitrect.y = y1;
274 blitrect.w = x2-x1+1;
275 blitrect.h = y2-y1+1;
276 if (x1<0) printf("x is too small in function AddRect! - %d\n",x1);else
277 if (y1<0) printf("y is too small in function AddRect! - %d\n",y1);else
278 if (x2>=800) printf("x is too big in function AddRect! - %d\n",x2);else
279 if (y2>=600) printf("y is too big in function AddRect! - %d\n",y2);else {
280 blitrects[blitrects_num]=blitrect;
281 if (++blitrects_num>=RECTS_NUM-2)
282 {printf("Too many blits!\n");blitrects_num--;Update();}
283 }
284 }
285
286 void AddThisRect(SDL_Rect blitrect)
287 {
288 blitrects[blitrects_num]=blitrect;
289 if (++blitrects_num>=RECTS_NUM-2)
290 {printf("Too many blits!\n");blitrects_num--;Update();}
291 }
292
293 void Blit(int Xpos,int Ypos,SDL_Surface *image) //blits one GIF or BMP from the memory to the screen
294 {
295 blitrect.x = Xpos;
296 blitrect.y = Ypos;
297 blitrect.w = image->w;
298 blitrect.h = image->h;
299
300 if (Xpos<-image->w) printf("WRONG BLIT: Xpos is too small! - %d\n",Xpos); else
301 if (Xpos>=800) printf("WRONG BLIT: Xpos is too big! - %d\n",Xpos); else
302 if (Ypos<-image->h) printf("WRONG BLIT: Ypos is too small! - %d\n",Ypos); else
303 if (Ypos>=600) printf("WRONG BLIT: Ypos is too big! - %d\n",Ypos); else
304 if ( SDL_BlitSurface(image, NULL, Screen, &blitrect) < 0 )
305 {
306 SDL_FreeSurface(image);
307 ComplainAndExit();
308 }
309 blitrects[blitrects_num]=blitrect;
310 blitrects_num++;
311 }
312
313 SDL_Surface *LoadImage(char *datafile, int transparent) // reads one png into the memory
314 {
315 SDL_Surface *pic,*pic2;
316 char filename[200];
317 int i=0;
318
319 sprintf(filename,"%s/gfx/%s",DATAPATH,datafile);
320 pic=IMG_Load(filename);
321 while ( pic == NULL ) {
322 strcpy(DATAPATH,PATH[i]);
323 sprintf(filename,"%s/gfx/%s",DATAPATH,datafile);
324 pic=IMG_Load(filename);
325 i++;
326
327 if (i>=PATHNUM)
328 {
329 fprintf(stderr,"Couldn't load %s: %s\n", filename, SDL_GetError());
330 exit(2);
331 }
332 }
333 if (transparent==3) return(pic);
334 if (transparent==1)
335 SDL_SetColorKey(pic,SDL_SRCCOLORKEY|SDL_RLEACCEL,SDL_MapRGB(pic->format,0xFF,0xFF,0xFF));
336 if (transparent==2)
337 SDL_SetColorKey(pic,SDL_SRCCOLORKEY|SDL_RLEACCEL,SDL_MapRGB(pic->format,0x00,0x00,0x00));
338 pic2 = SDL_DisplayFormat(pic);
339 SDL_FreeSurface(pic);
340 // blit(0,0,pic2);
341 // SDL_UpdateRect(screen,0,0,0,0);
342 return (pic2);
343 }
344
345 void BlitToBB(int Xpos,int Ypos,SDL_Surface *image) //blits one GIF or BMP from the memory to the screen
346 {
347 blitrect.x = Xpos;
348 blitrect.y = Ypos;
349 blitrect.w = image->w;
350 blitrect.h = image->h;
351 if ( SDL_BlitSurface(image, NULL, BackBuffer, &blitrect) < 0 )
352 {
353 SDL_FreeSurface(image);
354 ComplainAndExit();
355 }
356 }
357
358 void BlitPart(int Xpos,int Ypos,SDL_Surface *image, SDL_Rect srcrect)
359 {
360 blitrect.x = srcrect.x;
361 blitrect.y = srcrect.y;
362 blitrect.w = srcrect.w;
363 blitrect.h = srcrect.h;
364 if ( SDL_BlitSurface(image, &srcrect , Screen, &blitrect) < 0 )
365 {
366 SDL_FreeSurface(image);
367 ComplainAndExit();
368 }
369 blitrects[blitrects_num]=blitrect;
370 blitrects_num++;
371 }
372
373 void FadeScreen(float speed)
374 {
375 Sint32 now,i;
376
377 SDL_BlitSurface(Screen,NULL,fadebuffer,NULL);
378 now=SDL_GetTicks();
379 for (i=255*speed;i>=0;i-=SDL_GetTicks()-now)
380 {
381 now=SDL_GetTicks();
382 SDL_BlitSurface(fadebuffer,&blitrect,Screen,&blitrect);
383 SDL_SetAlpha(BackBuffer,SDL_SRCALPHA,255-(int)(i/speed));
384 Blit(0,0,BackBuffer);
385 Update();
386 }
387 SDL_SetAlpha(BackBuffer,SDL_SRCALPHA,255);
388 Blit(0,0,BackBuffer);
389 Update();
390 }
391
392 int PutPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color)
393 {
394 if (X<0) printf("X < 0 in function PutPixel! - %d\n",X); else
395 if (X>=800) printf("X >= 800 in function PutPixel! - %d\n",X); else
396 if (Y<0) printf("Y < 0 in function PutPixel! - %d\n",Y); else
397 if (Y>=600) printf("Y >= 600 in function PutPixel! - %d\n",Y); else
398 {
399 _PutPixel(Surface,X,Y,Color);
400 AddRect(X,Y,X,Y);
401 }
402 return 0;
403 }
404
405 int PutPixelC(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color)
406 {
407 if (X<0) printf("X < 0 in function PutPixelC! - %d\n",X); else
408 if (X>=800) printf("X >= 800 in function PutPixelC! - %d\n",X); else
409 if (Y<0) printf("Y < 0 in function PutPixelC! - %d\n",Y); else
410 if (Y>=600) printf("Y >= 600 in function PutPixelC! - %d\n",Y); else
411 {
412 _PutPixel(Surface,X,Y,Color);
413 AddRect(X,Y,X,Y);
414 }
415 return 0;
416 }
417
418 int PutBackPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y)
419 {
420 SDL_Rect rect;
421
422 rect.w=1;
423 rect.h=1;
424 rect.x=X;
425 rect.y=Y;
426 SDL_BlitSurface(BackBuffer, &rect, Surface, &rect);
427 AddThisRect(rect);
428 }
429
430 Uint32 GetPixel (SDL_Surface *Surface, Sint32 X, Sint32 Y)
431 {
432
433 Uint8 *bits;
434 Uint32 Bpp;
435
436
437 Bpp = Surface->format->BytesPerPixel;
438
439 bits = ((Uint8 *)Surface->pixels)+Y*Surface->pitch+X*Bpp;
440
441 // Get the pixel
442 switch(Bpp) {
443 case 1:
444 return *((Uint8 *)Surface->pixels + Y * Surface->pitch + X);
445 break;
446 case 2:
447 return *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X);
448 break;
449 case 3: { // Format/endian independent
450 Uint8 r, g, b;
451 r = *((bits)+Surface->format->Rshift/8);
452 g = *((bits)+Surface->format->Gshift/8);
453 b = *((bits)+Surface->format->Bshift/8);
454 return SDL_MapRGB(Surface->format, r, g, b);
455 }
456 break;
457 case 4:
458 return *((Uint32 *)Surface->pixels + Y * Surface->pitch/4 + X);
459 break;
460 }
461
462 return -1;
463 }
0 #include <SDL.h>
1 #define backbuffer BackBuffer
2
3 extern SDL_Surface *Screen,*BackBuffer,*fadebuffer;
4 extern SDL_Rect blitrect;
5 extern char DATAPATH[200];
6
7 // inits a lot of SDL stuff
8 void init_SDL();
9
10 // fades screen to BackBuffer
11 void FadeScreen(float speed);
12
13 // prints error and quits
14 void ComplainAndExit(void);
15
16 // Updates all blitted rects;
17 void Update();
18
19 // Draw a line
20 void Line(Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Uint32 Color);
21
22 // Puts a pixel (lock and unlock needed!)
23 extern int PutPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color);
24
25 // Add rect to update queue
26 void AddRect(int x1, int y1, int x2, int y2);
27 void AddThisRect(SDL_Rect blitrect);
28
29 // random number between a and b (inclusive)
30 int abrand(int a,int b);
31
32 // Draws a circle
33 int Circle (SDL_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect, Uint32 Color);
34
35 // Draws the background (as a circle)
36 int UndoCircle (SDL_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect);
37
38 // returns the flipped surface
39 SDL_Surface *FlippedSurface(SDL_Surface *Surface);
40
41 // returns the color value of a pixel
42 Uint32 GetPixel (SDL_Surface *Surface, Sint32 X, Sint32 Y);
43
44 void lock();
45 void unlock();
46 void fadeout();
47 SDL_Surface *LoadImage(char *datafile, int transparent);
48 void Blit(int Xpos,int Ypos,SDL_Surface *image);
49 void BlitToBB(int Xpos,int Ypos,SDL_Surface *image); //blits to BackBuffer
50 void BlitPart(int Xpos,int Ypos,SDL_Surface *image, SDL_Rect srcrect);
51 int PutBackPixel(SDL_Surface *Surface, Sint32 x, Sint32 y);
0 /*
1 IMGLIB: An example image loading library for use with SDL
2 Copyright (C) 1999 Sam Lantinga
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with this library; if not, write to the Free
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18 Sam Lantinga
19 5635-34 Springhouse Dr.
20 Pleasanton, CA 94588 (USA)
21 slouken@devolution.com
22 */
23
24 /* A simple library to load images of various formats as SDL surfaces */
25
26 #include <stdio.h>
27 #include <string.h>
28 #include <ctype.h>
29
30 #include "IMG.h"
31
32 /* Table of image detection and loading functions */
33 static struct {
34 char *type;
35 int (*is)(SDL_RWops *src);
36 SDL_Surface *(*load)(SDL_RWops *src);
37 } supported[] = {
38 /* keep magicless formats first (denoted by is==NULL) */
39 { "GIF", IMG_isGIF, IMG_LoadGIF_RW },
40 { "JPG", IMG_isJPG, IMG_LoadJPG_RW },
41 { "PNG", IMG_isPNG, IMG_LoadPNG_RW },
42 };
43
44 /* Load an image from a file */
45 SDL_Surface *IMG_Load(const char *file)
46 {
47 SDL_RWops *src = SDL_RWFromFile(file, "rb");
48 char *ext = strrchr(file, '.');
49 if(ext)
50 ext++;
51 return IMG_LoadTyped_RW(src, 1, ext);
52 }
53
54 /* Load an image from an SDL datasource (for compatibility) */
55 SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc)
56 {
57 return IMG_LoadTyped_RW(src, freesrc, NULL);
58 }
59
60 /* Portable case-insensitive string compare function */
61 static int string_equals(const char *str1, const char *str2)
62 {
63 while ( *str1 && *str2 ) {
64 if ( toupper((unsigned char)*str1) !=
65 toupper((unsigned char)*str2) )
66 break;
67 ++str1;
68 ++str2;
69 }
70 return (!*str1 && !*str2);
71 }
72
73 /* Load an image from an SDL datasource, optionally specifying the type */
74 SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type)
75 {
76 int i, start;
77 SDL_Surface *image;
78
79 /* Make sure there is something to do.. */
80 if ( src == NULL ) {
81 return(NULL);
82 }
83
84 /* See whether or not this data source can handle seeking */
85 if ( SDL_RWseek(src, 0, SEEK_CUR) < 0 ) {
86 IMG_SetError("Can't seek in this data source");
87 return(NULL);
88 }
89
90 /* Detect the type of image being loaded */
91 start = SDL_RWtell(src);
92 image = NULL;
93 for ( i=0; supported[i].type && !image; ++i ) {
94 if( (supported[i].is
95 && (SDL_RWseek(src, start, SEEK_SET),
96 supported[i].is(src)))
97 || (type && string_equals(type, supported[i].type))) {
98 #ifdef DEBUG_IMGLIB
99 fprintf(stderr, "IMGLIB: Loading image as %s\n",
100 supported[i].type);
101 #endif
102 SDL_RWseek(src, start, SEEK_SET);
103 image = supported[i].load(src);
104 break;
105 }
106 }
107
108 /* Clean up, check for errors, and return */
109 if ( freesrc ) {
110 SDL_RWclose(src);
111 }
112 if ( image == NULL ) {
113 IMG_SetError("Unsupported image format");
114 }
115 return(image);
116 }
117
118 /* Invert the alpha of a surface for use with OpenGL
119 This function is a no-op and only kept for backwards compatibility.
120 */
121 int IMG_InvertAlpha(int on)
122 {
123 return 1;
124 }
0 /*
1 IMGLIB: An example image loading library for use with SDL
2 Copyright (C) 1999 Sam Lantinga
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with this library; if not, write to the Free
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18 Sam Lantinga
19 5635-34 Springhouse Dr.
20 Pleasanton, CA 94588 (USA)
21 slouken@devolution.com
22 */
23
24 /* This is a GIF image file loading framework */
25
26 #include <stdio.h>
27 #include <string.h>
28
29 #include "IMG.h"
30
31
32 /* See if an image is contained in a data source */
33 int IMG_isGIF(SDL_RWops *src)
34 {
35 int is_GIF;
36 char magic[6];
37
38 is_GIF = 0;
39 if ( SDL_RWread(src, magic, 6, 1) ) {
40 if ( (strncmp(magic, "GIF", 3) == 0) &&
41 ((memcmp(magic + 3, "87a", 3) == 0) ||
42 (memcmp(magic + 3, "89a", 3) == 0)) ) {
43 is_GIF = 1;
44 }
45 }
46 return(is_GIF);
47 }
48
49 /* Code from here to end of file has been adapted from XPaint: */
50 /* +-------------------------------------------------------------------+ */
51 /* | Copyright 1990, 1991, 1993 David Koblas. | */
52 /* | Copyright 1996 Torsten Martinsen. | */
53 /* | Permission to use, copy, modify, and distribute this software | */
54 /* | and its documentation for any purpose and without fee is hereby | */
55 /* | granted, provided that the above copyright notice appear in all | */
56 /* | copies and that both that copyright notice and this permission | */
57 /* | notice appear in supporting documentation. This software is | */
58 /* | provided "as is" without express or implied warranty. | */
59 /* +-------------------------------------------------------------------+ */
60
61 /* Adapted for use in SDL by Sam Lantinga -- 7/20/98 */
62 #define USED_BY_SDL
63
64 #include <stdio.h>
65 #include <string.h>
66
67 #ifdef USED_BY_SDL
68 /* Changes to work with SDL:
69
70 Include SDL header file
71 Use SDL_Surface rather than xpaint Image structure
72 Define SDL versions of RWSetMsg(), ImageNewCmap() and ImageSetCmap()
73 */
74 #include "SDL.h"
75
76 #define Image SDL_Surface
77 #define RWSetMsg IMG_SetError
78 #define ImageNewCmap(w, h, s) SDL_AllocSurface(SDL_SWSURFACE,w,h,8,0,0,0,0)
79 #define ImageSetCmap(s, i, R, G, B) do { \
80 s->format->palette->colors[i].r = R; \
81 s->format->palette->colors[i].g = G; \
82 s->format->palette->colors[i].b = B; \
83 } while (0)
84 /* * * * * */
85
86 #else
87
88 /* Original XPaint sources */
89
90 #include "image.h"
91 #include "rwTable.h"
92
93 #define SDL_RWops FILE
94 #define SDL_RWclose fclose
95
96 #endif /* USED_BY_SDL */
97
98
99 #define MAXCOLORMAPSIZE 256
100
101 #define TRUE 1
102 #define FALSE 0
103
104 #define CM_RED 0
105 #define CM_GREEN 1
106 #define CM_BLUE 2
107
108 #define MAX_LWZ_BITS 12
109
110 #define INTERLACE 0x40
111 #define LOCALCOLORMAP 0x80
112 #define BitSet(byte, bit) (((byte) & (bit)) == (bit))
113
114 #define ReadOK(file,buffer,len) SDL_RWread(file, buffer, len, 1)
115
116 #define LM_to_uint(a,b) (((b)<<8)|(a))
117
118 struct {
119 unsigned int Width;
120 unsigned int Height;
121 unsigned char ColorMap[3][MAXCOLORMAPSIZE];
122 unsigned int BitPixel;
123 unsigned int ColorResolution;
124 unsigned int Background;
125 unsigned int AspectRatio;
126 int GrayScale;
127 } GifScreen;
128
129 static struct {
130 int transparent;
131 int delayTime;
132 int inputFlag;
133 int disposal;
134 } Gif89;
135
136 static int ReadColorMap(SDL_RWops * src, int number,
137 unsigned char buffer[3][MAXCOLORMAPSIZE], int *flag);
138 static int DoExtension(SDL_RWops * src, int label);
139 static int GetDataBlock(SDL_RWops * src, unsigned char *buf);
140 static int GetCode(SDL_RWops * src, int code_size, int flag);
141 static int LWZReadByte(SDL_RWops * src, int flag, int input_code_size);
142 static Image *ReadImage(SDL_RWops * src, int len, int height, int,
143 unsigned char cmap[3][MAXCOLORMAPSIZE],
144 int gray, int interlace, int ignore);
145
146 Image *
147 IMG_LoadGIF_RW(SDL_RWops *src)
148 {
149 unsigned char buf[16];
150 unsigned char c;
151 unsigned char localColorMap[3][MAXCOLORMAPSIZE];
152 int grayScale;
153 int useGlobalColormap;
154 int bitPixel;
155 int imageCount = 0;
156 char version[4];
157 int imageNumber = 1;
158 Image *image = NULL;
159
160 if ( src == NULL ) {
161 goto done;
162 }
163 if (!ReadOK(src, buf, 6)) {
164 RWSetMsg("error reading magic number");
165 goto done;
166 }
167 if (strncmp((char *) buf, "GIF", 3) != 0) {
168 RWSetMsg("not a GIF file");
169 goto done;
170 }
171 strncpy(version, (char *) buf + 3, 3);
172 version[3] = '\0';
173
174 if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
175 RWSetMsg("bad version number, not '87a' or '89a'");
176 goto done;
177 }
178 Gif89.transparent = -1;
179 Gif89.delayTime = -1;
180 Gif89.inputFlag = -1;
181 Gif89.disposal = 0;
182
183 if (!ReadOK(src, buf, 7)) {
184 RWSetMsg("failed to read screen descriptor");
185 goto done;
186 }
187 GifScreen.Width = LM_to_uint(buf[0], buf[1]);
188 GifScreen.Height = LM_to_uint(buf[2], buf[3]);
189 GifScreen.BitPixel = 2 << (buf[4] & 0x07);
190 GifScreen.ColorResolution = (((buf[4] & 0x70) >> 3) + 1);
191 GifScreen.Background = buf[5];
192 GifScreen.AspectRatio = buf[6];
193
194 if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
195 if (ReadColorMap(src, GifScreen.BitPixel, GifScreen.ColorMap,
196 &GifScreen.GrayScale)) {
197 RWSetMsg("error reading global colormap");
198 goto done;
199 }
200 }
201 do {
202 if (!ReadOK(src, &c, 1)) {
203 RWSetMsg("EOF / read error on image data");
204 goto done;
205 }
206 if (c == ';') { /* GIF terminator */
207 if (imageCount < imageNumber) {
208 RWSetMsg("only %d image%s found in file",
209 imageCount, imageCount > 1 ? "s" : "");
210 goto done;
211 }
212 }
213 if (c == '!') { /* Extension */
214 if (!ReadOK(src, &c, 1)) {
215 RWSetMsg("EOF / read error on extention function code");
216 goto done;
217 }
218 DoExtension(src, c);
219 continue;
220 }
221 if (c != ',') { /* Not a valid start character */
222 continue;
223 }
224 ++imageCount;
225
226 if (!ReadOK(src, buf, 9)) {
227 RWSetMsg("couldn't read left/top/width/height");
228 goto done;
229 }
230 useGlobalColormap = !BitSet(buf[8], LOCALCOLORMAP);
231
232 bitPixel = 1 << ((buf[8] & 0x07) + 1);
233
234 if (!useGlobalColormap) {
235 if (ReadColorMap(src, bitPixel, localColorMap, &grayScale)) {
236 RWSetMsg("error reading local colormap");
237 goto done;
238 }
239 image = ReadImage(src, LM_to_uint(buf[4], buf[5]),
240 LM_to_uint(buf[6], buf[7]),
241 bitPixel, localColorMap, grayScale,
242 BitSet(buf[8], INTERLACE),
243 imageCount != imageNumber);
244 } else {
245 image = ReadImage(src, LM_to_uint(buf[4], buf[5]),
246 LM_to_uint(buf[6], buf[7]),
247 GifScreen.BitPixel, GifScreen.ColorMap,
248 GifScreen.GrayScale, BitSet(buf[8], INTERLACE),
249 imageCount != imageNumber);
250 }
251 } while (image == NULL);
252
253 #ifdef USED_BY_SDL
254 if ( Gif89.transparent > 0 ) {
255 SDL_SetColorKey(image, SDL_SRCCOLORKEY, Gif89. transparent);
256 }
257 #endif
258
259 done:
260 return image;
261 }
262
263 static int
264 ReadColorMap(SDL_RWops *src, int number,
265 unsigned char buffer[3][MAXCOLORMAPSIZE], int *gray)
266 {
267 int i;
268 unsigned char rgb[3];
269 int flag;
270
271 flag = TRUE;
272
273 for (i = 0; i < number; ++i) {
274 if (!ReadOK(src, rgb, sizeof(rgb))) {
275 RWSetMsg("bad colormap");
276 return 1;
277 }
278 buffer[CM_RED][i] = rgb[0];
279 buffer[CM_GREEN][i] = rgb[1];
280 buffer[CM_BLUE][i] = rgb[2];
281 flag &= (rgb[0] == rgb[1] && rgb[1] == rgb[2]);
282 }
283
284 #if 0
285 if (flag)
286 *gray = (number == 2) ? PBM_TYPE : PGM_TYPE;
287 else
288 *gray = PPM_TYPE;
289 #else
290 *gray = 0;
291 #endif
292
293 return FALSE;
294 }
295
296 static int
297 DoExtension(SDL_RWops *src, int label)
298 {
299 static unsigned char buf[256];
300 char *str;
301
302 switch (label) {
303 case 0x01: /* Plain Text Extension */
304 str = "Plain Text Extension";
305 break;
306 case 0xff: /* Application Extension */
307 str = "Application Extension";
308 break;
309 case 0xfe: /* Comment Extension */
310 str = "Comment Extension";
311 while (GetDataBlock(src, (unsigned char *) buf) != 0);
312 return FALSE;
313 case 0xf9: /* Graphic Control Extension */
314 str = "Graphic Control Extension";
315 (void) GetDataBlock(src, (unsigned char *) buf);
316 Gif89.disposal = (buf[0] >> 2) & 0x7;
317 Gif89.inputFlag = (buf[0] >> 1) & 0x1;
318 Gif89.delayTime = LM_to_uint(buf[1], buf[2]);
319 if ((buf[0] & 0x1) != 0)
320 Gif89.transparent = buf[3];
321
322 while (GetDataBlock(src, (unsigned char *) buf) != 0);
323 return FALSE;
324 default:
325 str = (char *)buf;
326 sprintf(str, "UNKNOWN (0x%02x)", label);
327 break;
328 }
329
330 while (GetDataBlock(src, (unsigned char *) buf) != 0);
331
332 return FALSE;
333 }
334
335 static int ZeroDataBlock = FALSE;
336
337 static int
338 GetDataBlock(SDL_RWops *src, unsigned char *buf)
339 {
340 unsigned char count;
341
342 if (!ReadOK(src, &count, 1)) {
343 /* pm_message("error in getting DataBlock size" ); */
344 return -1;
345 }
346 ZeroDataBlock = count == 0;
347
348 if ((count != 0) && (!ReadOK(src, buf, count))) {
349 /* pm_message("error in reading DataBlock" ); */
350 return -1;
351 }
352 return count;
353 }
354
355 static int
356 GetCode(SDL_RWops *src, int code_size, int flag)
357 {
358 static unsigned char buf[280];
359 static int curbit, lastbit, done, last_byte;
360 int i, j, ret;
361 unsigned char count;
362
363 if (flag) {
364 curbit = 0;
365 lastbit = 0;
366 done = FALSE;
367 return 0;
368 }
369 if ((curbit + code_size) >= lastbit) {
370 if (done) {
371 if (curbit >= lastbit)
372 RWSetMsg("ran off the end of my bits");
373 return -1;
374 }
375 buf[0] = buf[last_byte - 2];
376 buf[1] = buf[last_byte - 1];
377
378 if ((count = GetDataBlock(src, &buf[2])) == 0)
379 done = TRUE;
380
381 last_byte = 2 + count;
382 curbit = (curbit - lastbit) + 16;
383 lastbit = (2 + count) * 8;
384 }
385 ret = 0;
386 for (i = curbit, j = 0; j < code_size; ++i, ++j)
387 ret |= ((buf[i / 8] & (1 << (i % 8))) != 0) << j;
388
389 curbit += code_size;
390
391 return ret;
392 }
393
394 static int
395 LWZReadByte(SDL_RWops *src, int flag, int input_code_size)
396 {
397 static int fresh = FALSE;
398 int code, incode;
399 static int code_size, set_code_size;
400 static int max_code, max_code_size;
401 static int firstcode, oldcode;
402 static int clear_code, end_code;
403 static int table[2][(1 << MAX_LWZ_BITS)];
404 static int stack[(1 << (MAX_LWZ_BITS)) * 2], *sp;
405 register int i;
406
407 if (flag) {
408 set_code_size = input_code_size;
409 code_size = set_code_size + 1;
410 clear_code = 1 << set_code_size;
411 end_code = clear_code + 1;
412 max_code_size = 2 * clear_code;
413 max_code = clear_code + 2;
414
415 GetCode(src, 0, TRUE);
416
417 fresh = TRUE;
418
419 for (i = 0; i < clear_code; ++i) {
420 table[0][i] = 0;
421 table[1][i] = i;
422 }
423 for (; i < (1 << MAX_LWZ_BITS); ++i)
424 table[0][i] = table[1][0] = 0;
425
426 sp = stack;
427
428 return 0;
429 } else if (fresh) {
430 fresh = FALSE;
431 do {
432 firstcode = oldcode = GetCode(src, code_size, FALSE);
433 } while (firstcode == clear_code);
434 return firstcode;
435 }
436 if (sp > stack)
437 return *--sp;
438
439 while ((code = GetCode(src, code_size, FALSE)) >= 0) {
440 if (code == clear_code) {
441 for (i = 0; i < clear_code; ++i) {
442 table[0][i] = 0;
443 table[1][i] = i;
444 }
445 for (; i < (1 << MAX_LWZ_BITS); ++i)
446 table[0][i] = table[1][i] = 0;
447 code_size = set_code_size + 1;
448 max_code_size = 2 * clear_code;
449 max_code = clear_code + 2;
450 sp = stack;
451 firstcode = oldcode = GetCode(src, code_size, FALSE);
452 return firstcode;
453 } else if (code == end_code) {
454 int count;
455 unsigned char buf[260];
456
457 if (ZeroDataBlock)
458 return -2;
459
460 while ((count = GetDataBlock(src, buf)) > 0);
461
462 if (count != 0) {
463 /*
464 * pm_message("missing EOD in data stream (common occurence)");
465 */
466 }
467 return -2;
468 }
469 incode = code;
470
471 if (code >= max_code) {
472 *sp++ = firstcode;
473 code = oldcode;
474 }
475 while (code >= clear_code) {
476 *sp++ = table[1][code];
477 if (code == table[0][code])
478 RWSetMsg("circular table entry BIG ERROR");
479 code = table[0][code];
480 }
481
482 *sp++ = firstcode = table[1][code];
483
484 if ((code = max_code) < (1 << MAX_LWZ_BITS)) {
485 table[0][code] = oldcode;
486 table[1][code] = firstcode;
487 ++max_code;
488 if ((max_code >= max_code_size) &&
489 (max_code_size < (1 << MAX_LWZ_BITS))) {
490 max_code_size *= 2;
491 ++code_size;
492 }
493 }
494 oldcode = incode;
495
496 if (sp > stack)
497 return *--sp;
498 }
499 return code;
500 }
501
502 static Image *
503 ReadImage(SDL_RWops * src, int len, int height, int cmapSize,
504 unsigned char cmap[3][MAXCOLORMAPSIZE],
505 int gray, int interlace, int ignore)
506 {
507 Image *image;
508 unsigned char c;
509 int i, v;
510 int xpos = 0, ypos = 0, pass = 0;
511
512 /*
513 ** Initialize the compression routines
514 */
515 if (!ReadOK(src, &c, 1)) {
516 RWSetMsg("EOF / read error on image data");
517 return NULL;
518 }
519 if (LWZReadByte(src, TRUE, c) < 0) {
520 RWSetMsg("error reading image");
521 return NULL;
522 }
523 /*
524 ** If this is an "uninteresting picture" ignore it.
525 */
526 if (ignore) {
527 while (LWZReadByte(src, FALSE, c) >= 0);
528 return NULL;
529 }
530 image = ImageNewCmap(len, height, cmapSize);
531
532 for (i = 0; i < cmapSize; i++)
533 ImageSetCmap(image, i, cmap[CM_RED][i],
534 cmap[CM_GREEN][i], cmap[CM_BLUE][i]);
535
536 while ((v = LWZReadByte(src, FALSE, c)) >= 0) {
537 #ifdef USED_BY_SDL
538 ((Uint8 *)image->pixels)[xpos + ypos * image->pitch] = v;
539 #else
540 image->data[xpos + ypos * len] = v;
541 #endif
542 ++xpos;
543 if (xpos == len) {
544 xpos = 0;
545 if (interlace) {
546 switch (pass) {
547 case 0:
548 case 1:
549 ypos += 8;
550 break;
551 case 2:
552 ypos += 4;
553 break;
554 case 3:
555 ypos += 2;
556 break;
557 }
558
559 if (ypos >= height) {
560 ++pass;
561 switch (pass) {
562 case 1:
563 ypos = 4;
564 break;
565 case 2:
566 ypos = 2;
567 break;
568 case 3:
569 ypos = 1;
570 break;
571 default:
572 goto fini;
573 }
574 }
575 } else {
576 ++ypos;
577 }
578 }
579 if (ypos >= height)
580 break;
581 }
582
583 fini:
584
585 return image;
586 }
0 /*
1 IMGLIB: An example image loading library for use with SDL
2 Copyright (C) 1999 Sam Lantinga
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with this library; if not, write to the Free
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18 Sam Lantinga
19 5635-34 Springhouse Dr.
20 Pleasanton, CA 94588 (USA)
21 slouken@devolution.com
22 */
23
24 /* This is a JPEG image file loading framework */
25
26 #include <stdio.h>
27
28 #include "IMG.h"
29
30 #include <jpeglib.h>
31
32 /* Define this for fast loading and not as good image quality */
33 /*#define FAST_JPEG*/
34
35 /* See if an image is contained in a data source */
36 int IMG_isJPG(SDL_RWops *src)
37 {
38 int is_JPG;
39 Uint8 magic[4];
40
41 is_JPG = 0;
42 if ( SDL_RWread(src, magic, 2, 1) ) {
43 if ( (magic[0] == 0xFF) && (magic[1] == 0xD8) ) {
44 SDL_RWread(src, magic, 4, 1);
45 SDL_RWread(src, magic, 4, 1);
46 if ( strncmp(magic, "JFIF", 4) == 0 ) {
47 is_JPG = 1;
48 }
49 }
50 }
51 return(is_JPG);
52 }
53
54 #define INPUT_BUFFER_SIZE 4096
55 typedef struct {
56 struct jpeg_source_mgr pub;
57
58 SDL_RWops *ctx;
59 Uint8 buffer[INPUT_BUFFER_SIZE];
60 } my_source_mgr;
61
62 /*
63 * Initialize source --- called by jpeg_read_header
64 * before any data is actually read.
65 */
66 void _init_source (j_decompress_ptr cinfo)
67 {
68 /* We don't actually need to do anything */
69 return;
70 }
71
72 /*
73 * Fill the input buffer --- called whenever buffer is emptied.
74 */
75 int _fill_input_buffer (j_decompress_ptr cinfo)
76 {
77 my_source_mgr * src = (my_source_mgr *) cinfo->src;
78 int nbytes;
79
80 nbytes = SDL_RWread(src->ctx, src->buffer, 1, INPUT_BUFFER_SIZE);
81 if (nbytes <= 0) {
82 /* Insert a fake EOI marker */
83 src->buffer[0] = (Uint8) 0xFF;
84 src->buffer[1] = (Uint8) JPEG_EOI;
85 nbytes = 2;
86 }
87 src->pub.next_input_byte = src->buffer;
88 src->pub.bytes_in_buffer = nbytes;
89
90 return TRUE;
91 }
92
93
94 /*
95 * Skip data --- used to skip over a potentially large amount of
96 * uninteresting data (such as an APPn marker).
97 *
98 * Writers of suspendable-input applications must note that skip_input_data
99 * is not granted the right to give a suspension return. If the skip extends
100 * beyond the data currently in the buffer, the buffer can be marked empty so
101 * that the next read will cause a fill_input_buffer call that can suspend.
102 * Arranging for additional bytes to be discarded before reloading the input
103 * buffer is the application writer's problem.
104 */
105 void _skip_input_data (j_decompress_ptr cinfo, long num_bytes)
106 {
107 my_source_mgr * src = (my_source_mgr *) cinfo->src;
108
109 /* Just a dumb implementation for now. Could use fseek() except
110 * it doesn't work on pipes. Not clear that being smart is worth
111 * any trouble anyway --- large skips are infrequent.
112 */
113 if (num_bytes > 0) {
114 while (num_bytes > (long) src->pub.bytes_in_buffer) {
115 num_bytes -= (long) src->pub.bytes_in_buffer;
116 (void) src->pub.fill_input_buffer(cinfo);
117 /* note we assume that fill_input_buffer will never
118 * return FALSE, so suspension need not be handled.
119 */
120 }
121 src->pub.next_input_byte += (size_t) num_bytes;
122 src->pub.bytes_in_buffer -= (size_t) num_bytes;
123 }
124 }
125
126 /*
127 * Terminate source --- called by jpeg_finish_decompress
128 * after all data has been read.
129 */
130 void _term_source (j_decompress_ptr cinfo)
131 {
132 /* We don't actually need to do anything */
133 return;
134 }
135
136 /*
137 * Prepare for input from a stdio stream.
138 * The caller must have already opened the stream, and is responsible
139 * for closing it after finishing decompression.
140 */
141 void jpeg_SDL_RW_src (j_decompress_ptr cinfo, SDL_RWops *ctx)
142 {
143 my_source_mgr *src;
144
145 /* The source object and input buffer are made permanent so that a series
146 * of JPEG images can be read from the same file by calling jpeg_stdio_src
147 * only before the first one. (If we discarded the buffer at the end of
148 * one image, we'd likely lose the start of the next one.)
149 * This makes it unsafe to use this manager and a different source
150 * manager serially with the same JPEG object. Caveat programmer.
151 */
152 if (cinfo->src == NULL) { /* first time for this JPEG object? */
153 cinfo->src = (struct jpeg_source_mgr *)
154 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
155 sizeof(my_source_mgr));
156 src = (my_source_mgr *) cinfo->src;
157 }
158
159 src = (my_source_mgr *) cinfo->src;
160 src->pub.init_source = _init_source;
161 src->pub.fill_input_buffer = _fill_input_buffer;
162 src->pub.skip_input_data = _skip_input_data;
163 src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
164 src->pub.term_source = _term_source;
165 src->ctx = ctx;
166 src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
167 src->pub.next_input_byte = NULL; /* until buffer loaded */
168 }
169
170 /* Load a JPEG type image from an SDL datasource */
171 SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
172 {
173 struct jpeg_error_mgr errmgr;
174 struct jpeg_decompress_struct cinfo;
175 JSAMPROW rowptr[1];
176 SDL_Surface *surface;
177
178 /* Create a decompression structure and load the JPEG header */
179 cinfo.err = jpeg_std_error(&errmgr);
180 jpeg_create_decompress(&cinfo);
181 jpeg_SDL_RW_src(&cinfo, src);
182 jpeg_read_header(&cinfo, TRUE);
183
184 /* Set 24-bit RGB output */
185 cinfo.out_color_space = JCS_RGB;
186 cinfo.quantize_colors = FALSE;
187 #ifdef FAST_JPEG
188 cinfo.scale_num = 1;
189 cinfo.scale_denom = 1;
190 cinfo.dct_method = JDCT_FASTEST;
191 cinfo.do_fancy_upsampling = FALSE;
192 #endif
193 jpeg_calc_output_dimensions(&cinfo);
194
195 /* Allocate an output surface to hold the image */
196 surface = SDL_AllocSurface(SDL_SWSURFACE,
197 cinfo.output_width, cinfo.output_height, 24,
198 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
199 0x0000FF, 0x00FF00, 0xFF0000,
200 #else
201 0xFF0000, 0x00FF00, 0x0000FF,
202 #endif
203 0);
204 if ( surface == NULL ) {
205 IMG_SetError("Out of memory");
206 goto done;
207 }
208
209 /* Decompress the image */
210 jpeg_start_decompress(&cinfo);
211 while ( cinfo.output_scanline < cinfo.output_height ) {
212 rowptr[0] = (JSAMPROW)(Uint8 *)surface->pixels +
213 cinfo.output_scanline * surface->pitch;
214 jpeg_read_scanlines(&cinfo, rowptr, (JDIMENSION) 1);
215 }
216 jpeg_finish_decompress(&cinfo);
217
218 /* Clean up and return */
219 done:
220 jpeg_destroy_decompress(&cinfo);
221 return(surface);
222 }
0 /*
1 IMGLIB: An example image loading library for use with SDL
2 Copyright (C) 1999 Sam Lantinga
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with this library; if not, write to the Free
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18 Sam Lantinga
19 5635-34 Springhouse Dr.
20 Pleasanton, CA 94588 (USA)
21 slouken@devolution.com
22 */
23
24 /* This is a PNG image file loading framework */
25
26 #include <stdlib.h>
27 #include <stdio.h>
28
29 #include "IMG.h"
30
31
32 /*=============================================================================
33 File: SDL_png.c
34 Purpose: A PNG loader and saver for the SDL library
35 Revision:
36 Created by: Philippe Lavoie (2 November 1998)
37 lavoie@zeus.genie.uottawa.ca
38 Modified by:
39
40 Copyright notice:
41 Copyright (C) 1998 Philippe Lavoie
42
43 This library is free software; you can redistribute it and/or
44 modify it under the terms of the GNU Library General Public
45 License as published by the Free Software Foundation; either
46 version 2 of the License, or (at your option) any later version.
47
48 This library is distributed in the hope that it will be useful,
49 but WITHOUT ANY WARRANTY; without even the implied warranty of
50 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
51 Library General Public License for more details.
52
53 You should have received a copy of the GNU Library General Public
54 License along with this library; if not, write to the Free
55 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
56
57 Comments: The load and save routine are basically the ones you can find
58 in the example.c file from the libpng distribution.
59
60 Changes:
61 5/17/99 - Modified to use the new SDL data sources - Sam Lantinga
62
63 =============================================================================*/
64
65 #include "SDL_endian.h"
66
67 #include <png.h>
68
69 #define PNG_BYTES_TO_CHECK 4
70
71 /* See if an image is contained in a data source */
72 int IMG_isPNG(SDL_RWops *src)
73 {
74 char buf[PNG_BYTES_TO_CHECK];
75
76 /* Read in the signature bytes */
77 if (SDL_RWread(src, buf, 1, PNG_BYTES_TO_CHECK) != PNG_BYTES_TO_CHECK)
78 return 0;
79
80 /* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. */
81 return( !png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK));
82 }
83
84 /* Load a PNG type image from an SDL datasource */
85 static void png_read_data(png_structp ctx, png_bytep area, png_size_t size)
86 {
87 SDL_RWops *src;
88
89 src = (SDL_RWops *)png_get_io_ptr(ctx);
90 SDL_RWread(src, area, size, 1);
91 }
92 SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
93 {
94 SDL_Surface *surface;
95 png_structp png_ptr;
96 png_infop info_ptr;
97 png_uint_32 width, height;
98 int bit_depth, color_type, interlace_type;
99 Uint32 Rmask;
100 Uint32 Gmask;
101 Uint32 Bmask;
102 Uint32 Amask;
103 SDL_Palette *palette;
104 png_bytep *row_pointers;
105 int row, i;
106 int ckey = -1;
107 png_color_16 *transv;
108
109 /* Initialize the data we will clean up when we're done */
110 png_ptr = NULL; info_ptr = NULL; row_pointers = NULL; surface = NULL;
111
112 /* Check to make sure we have something to do */
113 if ( ! src ) {
114 goto done;
115 }
116
117 /* Create the PNG loading context structure */
118 png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
119 NULL,NULL,NULL);
120 if (png_ptr == NULL){
121 IMG_SetError("Couldn't allocate memory for PNG file");
122 goto done;
123 }
124
125 /* Allocate/initialize the memory for image information. REQUIRED. */
126 info_ptr = png_create_info_struct(png_ptr);
127 if (info_ptr == NULL) {
128 IMG_SetError("Couldn't create image information for PNG file");
129 goto done;
130 }
131
132 /* Set error handling if you are using setjmp/longjmp method (this is
133 * the normal method of doing things with libpng). REQUIRED unless you
134 * set up your own error handlers in png_create_read_struct() earlier.
135 */
136 if ( setjmp(png_ptr->jmpbuf) ) {
137 IMG_SetError("Error reading the PNG file.");
138 goto done;
139 }
140
141 /* Set up the input control */
142 png_set_read_fn(png_ptr, src, png_read_data);
143
144 /* Read PNG header info */
145 png_read_info(png_ptr, info_ptr);
146 png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
147 &color_type, &interlace_type, NULL, NULL);
148
149 /* tell libpng to strip 16 bit/color files down to 8 bits/color */
150 png_set_strip_16(png_ptr) ;
151
152 /* Extract multiple pixels with bit depths of 1, 2, and 4 from a single
153 * byte into separate bytes (useful for paletted and grayscale images).
154 */
155 png_set_packing(png_ptr);
156
157 /* scale greyscale values to the range 0..255 */
158 if(color_type == PNG_COLOR_TYPE_GRAY)
159 png_set_expand(png_ptr);
160
161 /* For images with a single "transparent colour", set colour key;
162 if more than one index has transparency, use full alpha channel */
163 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
164 int num_trans;
165 Uint8 *trans;
166 png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans,
167 &transv);
168 if(color_type == PNG_COLOR_TYPE_PALETTE) {
169 if(num_trans == 1) {
170 /* exactly one transparent value: set colour key */
171 ckey = trans[0];
172 } else
173 png_set_expand(png_ptr);
174 } else
175 ckey = 0; /* actual value will be set later */
176 }
177
178 if ( color_type == PNG_COLOR_TYPE_GRAY_ALPHA )
179 png_set_gray_to_rgb(png_ptr);
180
181 png_read_update_info(png_ptr, info_ptr);
182
183 png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
184 &color_type, &interlace_type, NULL, NULL);
185
186 /* Allocate the SDL surface to hold the image */
187 Rmask = Gmask = Bmask = Amask = 0 ;
188 if ( color_type != PNG_COLOR_TYPE_PALETTE ) {
189 if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) {
190 Rmask = 0x000000FF;
191 Gmask = 0x0000FF00;
192 Bmask = 0x00FF0000;
193 Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0;
194 } else {
195 int s = (info_ptr->channels == 4) ? 0 : 8;
196 Rmask = 0xFF000000 >> s;
197 Gmask = 0x00FF0000 >> s;
198 Bmask = 0x0000FF00 >> s;
199 Amask = 0x000000FF >> s;
200 }
201 }
202 surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
203 bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask);
204 if ( surface == NULL ) {
205 IMG_SetError("Out of memory");
206 goto done;
207 }
208
209 if(ckey != -1) {
210 if(color_type != PNG_COLOR_TYPE_PALETTE)
211 ckey = SDL_MapRGB(surface->format, transv->red,
212 transv->green, transv->blue);
213 SDL_SetColorKey(surface, SDL_SRCCOLORKEY, ckey);
214 }
215
216 /* Create the array of pointers to image data */
217 row_pointers = (png_bytep*) malloc(sizeof(png_bytep)*height);
218 if ( (row_pointers == NULL) ) {
219 IMG_SetError("Out of memory");
220 SDL_FreeSurface(surface);
221 surface = NULL;
222 goto done;
223 }
224 for (row = 0; row < height; row++) {
225 row_pointers[row] = (png_bytep)
226 (Uint8 *)surface->pixels + row*surface->pitch;
227 }
228
229 /* Read the entire image in one go */
230 png_read_image(png_ptr, row_pointers);
231
232 /* read rest of file, get additional chunks in info_ptr - REQUIRED */
233 png_read_end(png_ptr, info_ptr);
234
235 /* Load the palette, if any */
236 palette = surface->format->palette;
237 if ( palette ) {
238 if(color_type == PNG_COLOR_TYPE_GRAY) {
239 palette->ncolors = 256;
240 for(i = 0; i < 256; i++) {
241 palette->colors[i].r = i;
242 palette->colors[i].g = i;
243 palette->colors[i].b = i;
244 }
245 } else if (info_ptr->num_palette > 0 ) {
246 palette->ncolors = info_ptr->num_palette;
247 for( i=0; i<info_ptr->num_palette; ++i ) {
248 palette->colors[i].b = info_ptr->palette[i].blue;
249 palette->colors[i].g = info_ptr->palette[i].green;
250 palette->colors[i].r = info_ptr->palette[i].red;
251 }
252 }
253 }
254
255 done: /* Clean up and return */
256 png_destroy_read_struct(&png_ptr, info_ptr ? &info_ptr : (png_infopp)0,
257 (png_infopp)0);
258 if ( row_pointers ) {
259 free(row_pointers);
260 }
261 return(surface);
262 }
263
0 #include <SDL.h>
1
2 // ********************* These are the levels: **********************
3 // 1=normal 2=lightning 3=stopper 4=finish 5=teleporter 6=time bonus
4 // 7=vertical laser 8=cannon
5
6 Uint8 map[28][15][20];
7 Uint8 origMap[28][15][20] =
8 { { {0,0,0,0,1,1,1,3,3,3,3,1,0,0,0,0,0,0,0,0},
9 {0,0,0,0,1,1,1,3,3,0,0,1,0,0,0,0,0,0,0,0},
10 {0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0},
11 {0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0},
12 {0,0,1,1,1,0,0,0,1,0,0,1,1,1,1,1,0,0,0,0},
13 {0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,1},
14 {0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0},
15 {0,0,0,0,0,0,0,0,2,2,1,1,1,0,0,1,0,0,0,0},
16 {0,0,0,1,1,1,0,0,2,2,1,1,0,0,0,1,0,0,0,0},
17 {0,0,0,1,0,0,0,0,2,1,0,0,0,0,1,1,1,1,0,0},
18 {0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0},
19 {0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0},
20 {0,0,0,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,4},
21 {1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,11,12,13},
22 {1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,14,15,16} },
23
24 { {0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0},
25 {0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0},
26 {0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,4,0,0},
27 {1,1,1,1,0,0,0,0,1,0,2,0,1,0,1,0,0,0,0,0},
28 {0,0,0,1,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0},
29 {0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0},
30 {0,0,0,0,0,0,1,1,1,0,2,0,1,0,0,0,0,0,0,0},
31 {0,0,0,0,0,1,1,0,0,0,0,0,1,0,2,0,0,0,0,1},
32 {0,0,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,1,1},
33 {0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,1,1,1},
34 {0,0,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,1},
35 {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1},
36 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},
37 {0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,11,12,13},
38 {0,0,0,0,0,1,0,0,1,1,1,0,0,1,0,0,0,14,15,16} },
39
40 { {0,0,0,0,1,11,12,13,0,1,0,0,0,0,0,0,0,0,0,4},
41 {0,0,0,0,1,14,15,16,0,1,0,0,0,0,1,0,0,0,0,0},
42 {0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0},
43 {1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
44 {0,0,0,0,1,1,1,0,0,1,1,1,1,0,1,1,1,3,1,3},
45 {0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0},
46 {0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,0,0,1,0,0},
47 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0},
48 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0},
49 {1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,0},
50 {0,0,0,0,0,0,1,0,0,1,8,1,0,0,1,0,0,1,0,0},
51 {0,0,0,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,0,0},
52 {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
53 {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
54 {0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0} },
55
56 { {0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
57 {0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0},
58 {0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0},
59 {0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0},
60 {0,0,0,1,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,0},
61 {0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0},
62 {0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0},
63 {0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1},
64 {0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0},
65 {0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
66 {2,2,2,0,0,0,0,0,0,0,0,2,0,8,0,0,0,0,4,4},
67 {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,0,4,4},
68 {0,0,0,0,0,1,1,1,0,0,0,2,0,0,0,0,0,0,4,4},
69 {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,11,12,13},
70 {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,14,15,16} },
71
72 { {0,0,0,1,0,0,0,7,0,0,0,1,0,0,0,0,0,0,0,4},
73 {0,0,0,1,0,0,0,7,0,0,0,1,0,0,0,0,0,1,0,0},
74 {0,0,0,1,0,0,0,7,0,0,0,1,0,0,0,0,0,0,1,0},
75 {0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0},
76 {0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0},
77 {0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0},
78 {0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0},
79 {0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0},
80 {1,1,1,1,1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,0},
81 {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0},
82 {0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,1,0,0},
83 {0,0,3,1,1,1,1,1,1,1,1,1,0,0,2,1,0,0,0,0},
84 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,4},
85 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,11,12,13},
86 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,14,15,16} },
87
88 { {0,0,0,0,0,0,5,0,0,0,0,0,0,0,1,4,4,4,4,4},
89 {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0},
90 {0,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,1,0,0,0},
91 {5,0,0,0,0,0,1,0,0,3,0,1,0,0,1,0,0,1,0,0},
92 {1,1,1,1,1,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0},
93 {0,0,0,0,0,0,1,0,3,0,0,1,0,0,0,0,1,0,0,0},
94 {0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0},
95 {0,0,0,0,0,0,1,3,0,3,0,1,0,0,0,0,0,0,1,0},
96 {0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0},
97 {2,0,0,1,1,1,1,0,0,0,3,1,0,0,0,0,0,0,1,0},
98 {0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,1,0},
99 {0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1,0},
100 {0,0,0,0,0,0,1,0,0,3,0,1,0,0,0,0,0,0,0,0},
101 {0,0,0,0,0,0,1,0,0,3,0,1,2,0,2,0,2,11,12,13},
102 {0,0,0,0,0,0,1,0,0,3,0,1,2,0,4,0,2,14,15,16} },
103
104 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
105 {0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0},
106 {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0},
107 {0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,1,0,0},
108 {0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
109 {0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0},
110 {0,0,0,0,0,1,0,0,2,4,4,4,1,0,1,0,1,1,1,1},
111 {0,0,0,0,0,1,0,0,2,4,4,4,1,0,1,0,0,0,0,0},
112 {0,0,0,0,0,1,0,0,2,4,4,4,1,0,1,0,0,0,0,0},
113 {0,0,0,0,0,8,0,0,1,0,0,0,1,0,1,0,0,0,1,0},
114 {0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0},
115 {0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,1,6},
116 {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,6},
117 {0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,11,12,13},
118 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
119
120 { {0,0,0,0,0,0,0,0,0,0,0,0,1,5,5,1,4,4,4,4},
121 {0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0},
122 {0,0,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,5,5,0},
123 {0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,0,2,2,0},
124 {0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0},
125 {0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0},
126 {0,0,0,0,0,0,0,0,1,1,1,1,2,0,0,1,0,0,0,0},
127 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0},
128 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0},
129 {0,1,1,1,1,1,2,0,1,0,0,0,0,0,1,1,0,0,0,0},
130 {0,0,1,1,1,1,2,0,1,0,0,1,1,1,1,1,0,0,0,0},
131 {0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},
132 {0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0},
133 {2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,11,12,13},
134 {2,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,14,15,16} },
135
136 { {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
137 {0,1,0,2,2,2,2,2,0,0,0,0,0,0,1,0,0,0,0,0},
138 {0,0,0,2,0,0,0,2,0,0,0,0,1,0,0,0,0,0,1,3},
139 {1,0,0,2,0,2,4,2,0,0,0,0,0,0,0,0,1,0,0,0},
140 {0,0,0,2,0,2,2,2,0,0,0,0,0,0,1,0,0,0,3,4},
141 {0,0,1,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,1,3},
142 {0,0,1,0,1,1,1,1,0,1,0,1,0,0,0,0,1,0,0,0},
143 {0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0},
144 {0,0,0,0,0,1,1,8,0,0,1,0,1,0,0,0,0,0,1,0},
145 {0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,1,0,0,0},
146 {0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0},
147 {0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0},
148 {0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0},
149 {0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,11,12,13},
150 {0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,14,15,16} },
151
152 { {0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1},
153 {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1},
154 {0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,1},
155 {1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,1},
156 {0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,0,0},
157 {0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0},
158 {2,2,2,2,3,3,0,1,0,0,0,1,1,1,1,0,0,0,0,0},
159 {0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1,1,0},
160 {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,4,4,0},
161 {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0},
162 {0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0},
163 {0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0},
164 {0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,0,0,0,0},
165 {0,0,0,0,0,0,0,0,0,0,0,1,1,1,6,6,0,11,12,13},
166 {0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,14,15,16} },
167
168 { {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
169 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
170 {0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0},
171 {0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,5,1,0,0,0},
172 {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
173 {0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,0,1,0,0,0},
174 {0,0,0,1,0,0,4,1,1,1,0,0,0,1,1,1,1,0,0,0},
175 {0,0,0,1,0,0,4,1,1,1,0,0,0,0,0,1,1,1,1,0},
176 {1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,1,0,0,0},
177 {0,0,0,1,0,0,0,1,0,0,0,0,8,0,0,0,0,0,0,0},
178 {0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0},
179 {0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0},
180 {0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0},
181 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,11,12,13},
182 {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,14,15,16} },
183
184
185 { {0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},
186 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},
187 {0,0,1,0,0,0,1,0,1,0,0,0,0,1,1,1,1,1,0,0},
188 {0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,1},
189 {1,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0},
190 {0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0},
191 {0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,2,2,2,2,4},
192 {0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,3},
193 {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,2,2,2,2,4},
194 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0},
195 {0,1,1,1,1,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0},
196 {0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0},
197 {0,1,5,1,0,1,0,0,1,0,0,1,1,0,1,0,0,1,0,5},
198 {0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,11,12,13},
199 {0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,14,15,16} },
200
201 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
202 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
203 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
204 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0},
205 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0},
206 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,3,0},
207 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,2,0,0,3,0},
208 {0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,3,0},
209 {0,0,0,0,1,0,0,0,0,0,0,2,2,0,0,8,0,0,3,0},
210 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0},
211 {0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,3,0},
212 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0},
213 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4},
214 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
215 {0,0,0,0,0,0,0,2,2,2,0,0,0,0,0,0,0,14,15,16} },
216
217 { {0,0,0,0,0,0,0,0,0,0,0,1,6,6,4,0,0,0,0,0},
218 {0,0,0,0,1,1,1,0,0,0,0,0,1,0,0,0,4,0,0,0},
219 {0,0,0,0,0,0,0,1,0,1,0,0,1,1,4,0,0,0,4,0},
220 {0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,4,0,0,0},
221 {0,0,0,1,0,0,0,0,8,0,0,0,0,0,0,1,1,1,0,0},
222 {1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0},
223 {0,0,0,0,0,1,0,0,11,12,13,0,0,0,0,0,0,1,0,0},
224 {0,0,0,0,0,1,0,0,14,15,16,0,0,0,2,0,0,1,0,0},
225 {1,1,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0},
226 {0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0},
227 {0,0,0,0,1,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0},
228 {0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0},
229 {0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0},
230 {0,0,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0},
231 {0,0,0,0,0,0,0,0,0,0,0,1,3,3,0,0,0,0,0,0} },
232
233 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
234 {0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0},
235 {0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
236 {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
237 {0,0,1,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0},
238 {0,0,1,2,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0},
239 {0,0,1,6,0,0,1,0,1,1,1,1,0,1,0,0,1,0,0,0},
240 {0,0,1,2,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0},
241 {0,0,1,6,0,0,1,0,0,0,0,1,0,1,0,0,1,0,0,0},
242 {0,0,1,2,0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0},
243 {0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
244 {0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},
245 {0,0,0,1,4,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0},
246 {0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,11,12,13},
247 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
248
249 { {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0},
250 {0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
251 {0,0,3,2,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0},
252 {2,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0},
253 {0,2,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0},
254 {0,0,2,3,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1},
255 {0,0,0,2,0,0,3,2,0,0,1,0,0,1,0,0,0,0,1,0},
256 {0,0,0,0,2,0,0,0,2,0,0,0,0,1,0,0,0,1,0,0},
257 {0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0},
258 {0,0,0,0,0,0,1,3,0,0,2,0,0,0,0,0,0,0,0,0},
259 {0,0,0,0,0,0,0,1,0,0,3,2,0,0,0,0,0,0,0,0},
260 {0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,1,1},
261 {0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,4,1,1,1},
262 {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,4,11,12,13},
263 {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,4,14,15,16} },
264
265 { {0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
266 {0,0,7,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
267 {0,0,7,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
268 {0,0,7,0,0,1,1,1,2,2,1,1,1,0,0,0,0,0,0,0},
269 {0,0,7,0,0,0,1,6,2,2,6,1,0,0,0,0,0,0,0,0},
270 {0,0,7,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0},
271 {0,0,1,1,1,1,1,1,2,2,1,1,1,1,1,0,0,0,0,0},
272 {0,0,0,0,0,0,0,2,4,4,2,0,0,0,0,0,0,0,0,0},
273 {0,0,0,0,0,0,1,1,5,5,1,2,0,0,0,0,0,0,0,0},
274 {1,1,0,0,0,8,0,1,5,5,1,0,2,0,0,0,0,0,0,0},
275 {0,0,0,0,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0},
276 {0,0,0,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0},
277 {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0},
278 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
279 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
280
281 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
282 {0,0,0,0,2,0,2,0,2,0,2,0,2,0,2,0,0,0,0,0},
283 {0,0,0,0,2,0,2,0,2,0,2,0,2,0,2,0,0,0,0,0},
284 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
285 {0,0,0,0,1,0,4,4,0,0,0,4,4,0,1,0,0,0,0,0},
286 {0,0,0,0,1,0,4,4,0,0,0,4,4,0,1,0,0,0,0,0},
287 {0,0,0,0,1,0,0,0,0,8,0,0,0,0,1,0,0,0,0,0},
288 {0,0,0,0,1,0,0,0,3,3,3,0,0,0,1,0,0,0,0,0},
289 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
290 {0,0,0,0,1,0,4,4,4,4,4,4,4,0,1,0,0,0,0,0},
291 {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
292 {0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0},
293 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
294 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
295 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
296
297 { {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0},
298 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0},
299 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,2,0,0},
300 {1,1,1,1,1,1,0,0,1,0,0,1,1,0,0,0,0,2,0,0},
301 {0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0},
302 {0,0,0,0,0,0,0,0,1,4,4,0,1,0,0,1,1,1,0,0},
303 {0,0,0,0,1,0,0,0,1,1,1,1,1,1,0,7,0,0,0,0},
304 {0,0,0,0,1,0,0,0,2,0,0,8,1,1,1,7,0,0,0,0},
305 {0,0,0,0,1,0,0,0,7,0,0,0,1,1,1,1,0,0,0,0},
306 {0,0,0,0,1,0,0,0,2,0,0,0,1,1,1,0,0,0,0,0},
307 {0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,1},
308 {0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,1},
309 {1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},
310 {0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,11,12,13},
311 {6,7,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,14,15,16} },
312
313 { {0,0,1,0,0,7,0,0,0,1,0,0,0,7,0,0,1,1,1,1},
314 {0,0,1,0,0,7,0,1,0,0,0,1,0,7,0,0,1,1,1,1},
315 {0,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0},
316 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,4},
317 {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,4},
318 {1,1,1,1,1,1,0,0,1,0,0,1,1,0,0,1,0,0,0,4},
319 {0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,4},
320 {0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,4},
321 {0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0},
322 {0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1},
323 {0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0},
324 {0,1,0,0,0,1,1,1,1,0,0,0,2,0,0,0,0,0,0,0},
325 {0,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
326 {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,3,11,12,13},
327 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,14,15,16} },
328
329 { {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0},
330 {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
331 {0,0,0,7,1,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0},
332 {0,0,0,7,7,1,0,0,0,0,0,1,4,0,0,0,1,0,0,0},
333 {0,0,0,7,7,0,1,0,0,0,0,1,4,0,0,0,1,3,0,0},
334 {0,0,0,7,7,0,0,1,0,0,0,1,4,0,0,0,1,0,0,3},
335 {0,0,0,7,7,0,0,0,1,0,0,1,4,0,0,0,3,0,0,0},
336 {0,0,0,7,7,0,3,0,0,0,0,1,0,0,0,0,1,0,0,0},
337 {0,0,0,7,7,0,0,0,1,0,0,0,0,0,0,0,1,0,3,0},
338 {0,0,0,7,7,0,0,1,0,0,0,0,0,0,0,1,3,0,0,0},
339 {0,0,0,7,7,0,1,0,0,0,0,0,0,0,1,0,0,0,0,3},
340 {0,0,0,7,7,1,1,1,1,1,1,1,1,1,0,0,3,0,0,1},
341 {0,0,0,7,1,0,0,0,0,0,1,1,1,3,0,0,0,0,1,1},
342 {0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,11,12,13},
343 {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,3,0,14,15,16} },
344
345 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
346 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
347 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
348 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
349 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
350 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
351 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
352 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
353 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
354 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
355 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
356 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
357 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
358 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
359 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
360
361 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
362 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
363 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
364 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
365 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
366 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
367 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
368 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
369 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
370 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
371 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
372 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
373 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
374 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
375 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
376
377 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
378 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
379 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
380 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
381 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
382 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
383 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
384 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
385 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
386 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
387 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
388 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
389 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
390 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
391 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
392
393 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
394 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
395 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
396 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
397 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
398 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
399 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
400 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
401 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
402 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
403 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
404 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
405 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
406 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
407 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} },
408
409 { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
410 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
411 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
412 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
413 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
414 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
415 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
416 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
417 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
418 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
419 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
420 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
421 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
422 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13},
423 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }
424 };
0 #include "bumprace.h"
1
2 void clear_screen()
3 {
4 SDL_Rect fillrect;
5
6 fillrect.x=0;
7 fillrect.y=0;
8 fillrect.w=800;
9 fillrect.h=600;
10 SDL_FillRect(Screen,&fillrect,0);
11 }
12
13 void clear_bb()
14 {
15 SDL_Rect fillrect;
16
17 fillrect.x=0;
18 fillrect.y=0;
19 fillrect.w=800;
20 fillrect.h=600;
21 SDL_FillRect(backbuffer,&fillrect,0);
22 }
23
24 //************************ HELP MENU ***********************
25
26 void help() //prints the help & credits screeen
27 {
28 int i;
29
30 clear_screen();
31 for (i=0;i<=5;i++)
32 {
33 Blit(25,160+i*70,fore[i]);
34 }
35 Blit(300,-30,racer_pic[4]);
36 PutString(Screen, 80, 175, "Normal wall");
37 PutString(Screen, 80, 245, "Deadly wall");
38 PutString(Screen, 80, 315, "Stopper");
39 PutString(Screen, 80, 385, "Your goal is to arrive here");
40 PutString(Screen, 80, 455, "Teleporter");
41 PutString(Screen, 80, 525, "Time bonus");
42
43 PutString(Screen, 350, 165, "Code:");
44 PutString(Screen, 350, 180, "Karl Bartel (main code) <karlb@gmx.net>");
45 PutString(Screen, 350, 195, "Lion Kimbro (particles) <SnowLion@sprynet.com>");
46 PutString(Screen, 350, 220, "Graphics:");
47 PutString(Screen, 350, 235, "Karl Bartel");
48 PutString(Screen, 500, 220, "Backgrounds:");
49 PutString(Screen, 500, 235, "Unknown (see AUTHORS)");
50
51 PutString(Screen, 350, 265, "Packaging:");
52 PutString(Screen, 350, 280, "Christian T. Steigies (debian)"),
53
54 PutString(Screen, 350, 305, "Music:");
55 PutString(Screen, 350, 320, "The Lizard King (www.itv.se/~a1055/frames.html)");
56
57 PutString(Screen, 350, 365, "Sound Effects:");
58 PutString(Screen, 350, 380, "grabbed from ClanBomber");
59 PutString(Screen, 350, 405, "Levels:");
60 PutString(Screen, 350, 420, "Karl Bartel");
61 PutString(Screen, 350, 435, "Stephan <emailme@enthralling.com>");
62
63 PutString(Screen, 350, 465, "Libraries used:");
64 PutString(Screen, 350, 480, "SDL by Sam Lantinga");
65 PutString(Screen, 350, 495, "SFont by Karl Bartel");
66 PutString(Screen, 350, 510, "modified MikMod (for SDL)");
67
68 PutString(Screen, 40, 580, "You can find the BumpRace web page at: http://www.linux-games.com");
69 SDL_UpdateRect(Screen,0,0,0,0);
70 SDL_WaitEvent(&event);
71 SDL_WaitEvent(&event);
72 clear_screen();
73 BlitMenu();
74 Blit(100,0,selectp_pic[pl]);
75 SDL_UpdateRect(Screen,0,0,0,0);
76 }
77
78 // ******************************** Main Menu *****************
79
80 void PrepareMenu()
81 {
82 SDL_EventState(SDL_KEYUP, SDL_ENABLE);
83 SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
84 clear_bb();
85 BlitToBB(0,0,title_pic);
86 FadeScreen(7);
87 }
88
89 SDL_Rect DrawMode(int num, int y, SDL_Rect *rect) //for Menu only
90 {
91 if (y<600)
92 {
93 if (num<3) Blit(50+num*250,y,mode_select_pic[num]);
94 else Blit(300+(num-3)*250,y,mode_select_pic[num]);
95 }else
96 {
97 blitrect.x=1;
98 blitrect.y=1;
99 blitrect.w=1;
100 blitrect.h=1;
101 }
102 return blitrect;
103 }
104
105 void FadeSelectorOut(int y, int mode)
106 {
107 SDL_Rect dstrect;
108
109 now=SDL_GetTicks();
110 for (i=0;i<=255;i+=SDL_GetTicks()-now)
111 {
112 now=SDL_GetTicks();
113 dstrect.x=40+mode*250;dstrect.y=y-10;dstrect.w=220;dstrect.h=10;
114 SDL_FillRect(Screen,&dstrect,0);
115 dstrect.x=40+mode*250;dstrect.y=y+100;dstrect.w=220;dstrect.h=10;
116 SDL_FillRect(Screen,&dstrect,0);
117 dstrect.x=40+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100;
118 SDL_FillRect(Screen,&dstrect,0);
119 dstrect.x=250+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100;
120 SDL_FillRect(Screen,&dstrect,0);
121 SDL_SetAlpha(selector_pic,(SDL_SRCALPHA),255-i);
122 Blit (40+250*mode,y-10,selector_pic);
123 Update();
124 }
125 dstrect.x=40+mode*250;dstrect.y=y-10;dstrect.w=220;dstrect.h=10;
126 SDL_FillRect(Screen,&dstrect,0);
127 dstrect.x=40+mode*250;dstrect.y=y+100;dstrect.w=220;dstrect.h=10;
128 SDL_FillRect(Screen,&dstrect,0);
129 dstrect.x=40+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100;
130 SDL_FillRect(Screen,&dstrect,0);
131 dstrect.x=250+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100;
132 SDL_FillRect(Screen,&dstrect,0);
133 SDL_UpdateRect(Screen,40+mode*250,y-10,220,120);
134 }
135
136 void FadeSelectorIn(int y, int mode)
137 {
138 SDL_Rect dstrect;
139
140 now=SDL_GetTicks();
141 if (mode==3) {y+=120;mode=1;}
142 for (i=255;i>=0;i-=SDL_GetTicks()-now)
143 {
144 now=SDL_GetTicks();
145 dstrect.x=40+mode*250;dstrect.y=y-10;dstrect.w=220;dstrect.h=10;
146 SDL_FillRect(Screen,&dstrect,0);
147 dstrect.x=40+mode*250;dstrect.y=y+100;dstrect.w=220;dstrect.h=10;
148 SDL_FillRect(Screen,&dstrect,0);
149 dstrect.x=40+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100;
150 SDL_FillRect(Screen,&dstrect,0);
151 dstrect.x=250+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100;
152 SDL_FillRect(Screen,&dstrect,0);
153 SDL_SetAlpha(selector_pic,(SDL_SRCALPHA),255-i);
154 Blit (40+250*mode,y-10,selector_pic);
155 Update();
156 }
157 }
158
159 void Menu()
160 {
161 int v,y=599,update;
162 float time;
163 SDL_Rect oldrect[4];
164
165 // blit(0,0,title_pic);
166 for (i=0;i<4;i++)
167 {
168 oldrect[i].x=0;oldrect[i].y=0;oldrect[i].w=1;oldrect[i].h=1;
169 }
170 v=555;
171 now=SDL_GetTicks();
172 while (v>0)
173 {
174 for (i=0;i<4;i++) {
175 SDL_FillRect(Screen,&oldrect[i],0);
176 AddThisRect(oldrect[i]);
177 }
178 oldrect[0]=DrawMode(0, y, oldrect);
179 oldrect[1]=DrawMode(1, y, oldrect);
180 oldrect[2]=DrawMode(2, y, oldrect);
181 oldrect[3]=DrawMode(3, y+120, oldrect);
182 time=((float)(SDL_GetTicks()-now))/1000;
183 now=SDL_GetTicks();
184 y-=v*time;
185 v-=599*time;
186 Update();
187 }
188 mode=0;update=1;
189 SDL_PollEvent(&event);
190 keys = SDL_GetKeyState(NULL);
191 while ( keys[SDLK_RETURN]!=SDL_PRESSED)
192 {
193 if (update) FadeSelectorIn(y,mode);
194 SDL_PollEvent(&event);
195 keys = SDL_GetKeyState(NULL);
196 update=0;
197 if (( keys[SDLK_RIGHT] == SDL_PRESSED )&&(mode<2))
198 {FadeSelectorOut(y,mode);mode++;update=1;}
199 if (( keys[SDLK_LEFT] == SDL_PRESSED )&&(mode>0)&&(mode<3))
200 {FadeSelectorOut(y,mode);mode--;update=1;}
201 if (( keys[SDLK_DOWN] == SDL_PRESSED )&&(mode<3))
202 {FadeSelectorOut(y,mode);mode=3;update=1;}
203 if (( keys[SDLK_UP] == SDL_PRESSED )&&(mode==3))
204 {FadeSelectorOut(y+120,1);mode=1;update=1;}
205 SDL_WaitEvent(&event);
206 }
207 if (mode==0) playernum=1; else playernum=2;
208 }
209
210
211 // ************************** Racer Selection
212
213 void load_racer() //loads the racer data
214 {
215 if (user[pl].racernum==0) {
216 for (i=0;i<=17;i++)
217 {
218 sprintf(text,"racerc%d.gif",i+1);
219 user[pl].racer[i]=LoadImage(text,1);
220 }
221 }else
222 if (user[pl].racernum==1) {
223 for (i=0;i<=17;i++)
224 {
225 sprintf(text,"racerd%d.gif",i+1);
226 user[pl].racer[i]=LoadImage(text,1);
227 }
228 }else
229 if (user[pl].racernum==2) {
230 for (i=0;i<=17;i++)
231 {
232 sprintf(text,"racere%d.gif",i+1);
233 user[pl].racer[i]=LoadImage(text,1);
234 }
235 }else
236 {
237 for (i=0;i<=17;i++)
238 {
239 sprintf(text,"racerf%d.gif",i+1);
240 user[pl].racer[i]=LoadImage(text,1);
241 }
242 }
243 user[pl].slowdown=0;
244 user[pl].turbo_possible=0;
245 user[pl].sticky_possible=0;
246 user[pl].extra_time=0;
247 if (user[pl].racernum==0) {user[pl].slowdown=0.00012;}
248 if (user[pl].racernum==1) {user[pl].extra_time=15;}
249 if (user[pl].racernum==2) {user[pl].turbo_possible=1; user[pl].slowdown=0.00004;}
250 if (user[pl].racernum==3) {user[pl].sticky_possible=1; user[pl].slowdown=0.00003;}
251 }
252
253 void SelectRacer() //menu for racer selection
254 {
255 SDL_Rect fillrect;
256 int i;
257
258 fillrect.x=50;
259 fillrect.y=140;
260 fillrect.w=700;
261 fillrect.h=430;
262 SDL_PollEvent(&event);
263 keys = SDL_GetKeyState(NULL);
264 while (keys[SDLK_RETURN]==SDL_PRESSED)
265 {
266 SDL_PollEvent(&event);
267 keys = SDL_GetKeyState(NULL);
268 }
269 while (keys[SDLK_RETURN]!=SDL_PRESSED)
270 {
271 SDL_PollEvent(&event);
272 keys = SDL_GetKeyState(NULL);
273 while (!SDL_WaitEvent(&event))
274 {
275 SDL_PollEvent(&event);
276 keys = SDL_GetKeyState(NULL);
277 }
278 if (( keys[SDLK_RIGHT] == SDL_PRESSED )&&(user[pl].racernum<5))
279 {user[pl].racernum++;}
280 if (( keys[SDLK_LEFT] == SDL_PRESSED )&&(user[pl].racernum>0))
281 {user[pl].racernum--;}
282 if (( keys[SDLK_DOWN] == SDL_PRESSED )&&(user[pl].racernum<3))
283 {user[pl].racernum+=3;}
284 if (( keys[SDLK_UP] == SDL_PRESSED )&&(user[pl].racernum>2))
285 {user[pl].racernum-=3;}
286 if (user[pl].racernum>5) user[pl].racernum=5;
287 BlitMenu();
288 SDL_UpdateRects(Screen,1,&fillrect);
289 }
290 }
0 void Menu(); // Main Menu
1 void help(); // Help and Credits
2 void SelectRacer();
0 #include "bumprace.h"
1 #include "errno.h"
2
3 char Player[10][200];
4 int Hiscore[10],i;
5
6 FILE *OpenOptionsFile( char *mode )
7 {
8 char filename[200];
9 FILE *file;
10
11 if ((char *)getenv("HOME") != NULL)
12 sprintf( filename, "%s/.bumprace", getenv("HOME"));
13 else
14 sprintf( filename, "bumprace.dat");
15
16 file = fopen(filename, mode);
17
18 if (file==NULL) {
19 fprintf(stderr, "\nWarning: I could not open the options file ");
20 if (strcmp(mode, "r") == 0)
21 fprintf(stderr, "for read:");
22 else if (strcmp(mode, "w") == 0)
23 fprintf(stderr, "for write:");
24
25 fprintf(stderr, "\n%s\n"
26 "The error that occured was:\n"
27 "%s\n\n", filename, strerror(errno));
28 }
29
30 return file;
31 }
32
33 void ReadOptions()
34 {
35 FILE *file;
36
37 file=OpenOptionsFile("r");
38
39 if (file==NULL) {
40 file=OpenOptionsFile("w");
41 if (file==NULL) exit(1);
42
43 fprintf(file, "# BumpRace Options File\n\n");
44 fprintf(file, "Sam\nLion\nBill\nJohn\nAndreas\nAaron\nMichael\nPhoenix\nPierre\nRobert\n");
45 for (i=0;i<10;i++)
46 fprintf(file, "%d\n", 4000-i*400);
47
48 fclose(file);
49 file=OpenOptionsFile("r");
50 }
51
52 fscanf(file, "%*s%*s%*s%*s\n");
53 for (i=0;i<10;i++)
54 fscanf(file, "%[^\n]\n",&Player[i]);
55 for (i=0;i<10;i++)
56 fscanf(file, "%d\n",&Hiscore[i]);
57 // for (i=0;i<10;i++)
58 // printf("%s %d\n",Player[i],Hiscore[i]);
59
60 fclose(file);
61 }
62
63 void FinalScore()
64 {
65 char Name[200]="",text[200];
66 int ch,a;
67 SDL_Rect rect;
68 FILE *file;
69
70 if (Score>Hiscore[9]) {
71 Blit(0,0,back);
72 XCenteredString(Screen, 200, "< YOUR FINAL SCORE >");
73 sprintf(text,"%d", Score);
74 XCenteredString(Screen, 250, text);
75 XCenteredString(Screen, 300, "Enter Your Name:");
76 Update();
77 rect.x=0;
78 rect.y=350;
79 rect.w=800;
80 rect.h=100;
81 SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
82 while ((ch!=SDLK_RETURN)&&(SDL_WaitEvent(&event))) {
83 SDL_PollEvent(&event);
84 if (event.type==SDL_KEYDOWN) {
85 ch=event.key.keysym.unicode;
86 sprintf(Name,"%s%c",Name,ch);
87 if (ch=='\b') Name[strlen(Name)-2]='\0';
88 //printf("%s - %c\n",Name,ch);
89 SDL_BlitSurface( back, &rect, Screen, &rect);
90 PutString(Screen,400-TextWidth(Name)/2,350,Name);
91 AddThisRect(rect);
92 Update();
93 }
94 SDL_Delay(10);
95 }
96 Name[strlen(Name)-1]='\0';
97 if (strcmp(Name,"")==0) strcpy(Name,"Anonymous Coward");
98 for (i=0;i<10;i++) {
99 if (Score>Hiscore[i]) {
100 // Move other players down on the list
101 for (a=9;a>=i;a--) {
102 strcpy(Player[a],Player[a-1]);
103 Hiscore[a]=Hiscore[a-1];
104 }
105 // add the player
106 strcpy(Player[i],Name);
107 Hiscore[i]=Score;
108 break;
109 }
110 }
111 // for (i=0;i<10;i++)
112 // printf("%s %d\n",Player[i],Hiscore[i]);
113
114 // write everything into the options file
115 file=OpenOptionsFile("w");
116 if (file==NULL) exit(1);
117
118 fprintf(file, "# BumpRace Options File\n\n");
119 for (i=0;i<10;i++)
120 fprintf(file, "%s\n", Player[i]);
121 for (i=0;i<10;i++)
122 fprintf(file, "%d\n", Hiscore[i]);
123
124 fclose(file);
125
126 } else {
127
128 if (Score<0) Score=0;
129 Blit(0,0,back);
130 XCenteredString(Screen, 200, "< YOUR FINAL SCORE >");
131 sprintf(text,"%d", Score);
132 XCenteredString(Screen, 250, text);
133 XCenteredString(Screen, 300, "You didn't qualify for the highscore list...");
134 Update();
135 SDL_EventState(SDL_KEYUP, SDL_ENABLE);
136 SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
137 SDL_WaitEvent(&event);
138 SDL_WaitEvent(&event);
139 }}
140
141 void ShowHiscore()
142 {
143 SDL_Event WaitEvent;
144 char text[200];
145 int i;
146
147 Blit(0,0,back);
148 XCenteredString(Screen, 100, "< BUMPRACE HIGHSCORES >");
149 for (i=0;i<10;i++) {
150 sprintf(text,"%s", Player[i]);
151 PutString(Screen,200,150+i*30,text);
152 sprintf(text,"%d", Hiscore[i]);
153 PutString(Screen,600-TextWidth(text),150+i*30,text);
154 }
155 Update();
156 while ((WaitEvent.type!=SDL_KEYDOWN)&&(WaitEvent.type!=SDL_MOUSEBUTTONDOWN)) {
157 SDL_PollEvent(&WaitEvent);
158 SDL_WaitEvent(&WaitEvent);
159 }
160 }
0 void ReadOptions();
1 void FinalScore();
2 void ShowHiscore();
0 #include "bumprace.h"
1 #include "math.h"
2 #include "stdlib.h"
3
4 #define PARTICLE_LIFETIME 13
5 #define PARTICLES_OF_EXHAUST 300
6 typedef struct
7 {
8 float Lifetime; // Lifetime of the current Particle
9 float X; // X coordinate
10 float Y; // Y coordinate
11 float dX; // delta X for each Particle frame
12 float dY; // delta Y for each Particle frame
13 int R, G, B; // Red, Green, and Blue for Particle
14 } Particle;
15
16 Particle particles[ 300 ];
17
18 int NullParticle=0; // The NullParticle is the # of the last legal particle.
19 // Cannot reach PARTICLES_OF_EXHAUST!
20
21 #define PARTICLE_COLORS 5
22 int ParticleColorsR[] = { 255, 255, 200, 200, 80 };
23 int ParticleColorsG[] = { 255, 190, 90, 20, 0};
24 int ParticleColorsB[] = { 0, 0 , 0, 50, 255 };
25
26 void UndrawParticles()
27 {
28 int i;
29 for( i = 0; i < NullParticle; i++ )
30 {
31 Particle* ThisParticle = &particles[ i ];
32 if( (int)ThisParticle->X >= 0 )
33 if( (int)ThisParticle->X < 800 )
34 if( (int)ThisParticle->Y >= 0 )
35 if( (int)ThisParticle->Y < 600 )
36 PutBackPixel( Screen, (int)ThisParticle->X, (int)ThisParticle->Y );
37 }
38 }
39
40 void HandleParticles()
41 {
42 int i;
43
44 for( i = 0; i < NullParticle; i++ )
45 {
46 Particle* ThisParticle = &particles[ i ];
47
48 ThisParticle->Lifetime-=game_speed/(float)1000;
49 if( ThisParticle->Lifetime <= 0 )
50 {
51 // Delete this particle
52 if( i != NullParticle -1 )
53 {
54 // We aren't the end particle, so we have to preserve the end.
55 Particle* OtherParticle = &particles[ NullParticle - 1 ];
56 *ThisParticle = *OtherParticle; // Default: Memberwise Assignment
57 }
58 NullParticle--;
59 i--; // Do this cell once more...
60 }
61 else
62 {
63 int MorphColor;
64
65 // Move this particle
66 ThisParticle->X += ThisParticle->dX*game_speed;
67 ThisParticle->Y += ThisParticle->dY*game_speed;
68 ThisParticle->dY+= gravity/(float)2000;
69 // printf("%f\t%f\n",ThisParticle->dX*game_speed,ThisParticle->dY*game_speed);
70
71 MorphColor = 0;
72 switch( (int)ThisParticle->Lifetime )
73 {
74 case 25:
75 case 20: MorphColor = 1; break;
76 case 8:
77 case 2: MorphColor = -1; break;
78 }
79 ThisParticle->R += MorphColor;
80 ThisParticle->G += MorphColor;
81 ThisParticle->B += MorphColor;
82 // Strangely enough, it looks better *WITHOUT* the logical constraints!
83 // if (ThisParticle->R>255) ThisParticle->R=255;
84 // if (ThisParticle->R<0) ThisParticle->R=0;
85 // if (ThisParticle->G>255) ThisParticle->G=255;
86 // if (ThisParticle->G<0) ThisParticle->G=0;
87 // if (ThisParticle->B>255) ThisParticle->B=255;
88 // if (ThisParticle->B<0) ThisParticle->B=0;
89 }
90 }
91 }
92
93 void DisplayParticles()
94 {
95 int i;
96
97 lock();
98 for( i = 0; i < NullParticle; i++ ){
99 Particle* ThisParticle = &particles[ i ];
100 int X, Y;
101 X = ThisParticle->X;
102 Y = ThisParticle->Y;
103 if( ThisParticle->X >= 0 )
104 if( ThisParticle->X < 800 )
105 if( ThisParticle->Y >= 0 )
106 if( ThisParticle->Y < 600 ){
107 PutPixel( Screen, ThisParticle->X, ThisParticle->Y,
108 SDL_MapRGB(Screen->format,ThisParticle->R, ThisParticle->G, ThisParticle->B) );
109 }
110 }
111 unlock();
112 }
113
114 void NewParticles(float turn, int X, int Y)
115 {
116 if(( NullParticle < PARTICLES_OF_EXHAUST )&&(particle))
117 {
118 int ColorIndex;
119 int Percent; // Damn. C is really really finicky about declarations! Urusai!
120 float scalefactor;
121
122 Particle* ThisParticle = &particles[ NullParticle ];
123 ThisParticle->Lifetime = PARTICLE_LIFETIME + abrand( -5, 5 );
124 ThisParticle->X = X + 15;
125 ThisParticle->Y = Y + 15;
126
127 ColorIndex = abrand( 0, PARTICLE_COLORS-1 );
128 ThisParticle->R = ParticleColorsR[ ColorIndex ];
129 ThisParticle->G = ParticleColorsG[ ColorIndex ];
130 ThisParticle->B = ParticleColorsB[ ColorIndex ];
131 // Introduce Orthogonal (y, -x) Component
132 switch( user[pl].racernum ) {
133 case 0: // SlowPoke
134 Percent = abrand( -50, 50 );
135 break;
136 case 1: // Normal
137 Percent = abrand( -25, 25 );
138 break;
139 case 2: // Speedy
140 Percent = abrand( -5, 5 );
141 break;
142 case 3: // Spinny
143 Percent = abrand( -60, 60 );
144 break;
145 default: // OOPS!
146 Percent = 0;
147 }
148 turn+=190;
149 turn+=Percent;
150 if (turn>360) turn-=360;
151 ThisParticle->dX = sin(turn*0.01745)*(precision);
152 ThisParticle->dY = -cos(turn*0.01745)*(precision);
153
154 // scale particle speed
155 // (because I'm having such difficulty finding a good scaling value...)
156 ThisParticle->dX /= (float)2000;
157 ThisParticle->dY /= (float)2000;
158
159 NullParticle++;
160
161 }
162 }
0 /*
1 Thanks to Lion Kimbro for his great prticle code. You can reach him via email
2 at SnowLion@sprynet.com
3 */
4
5 extern int NullParticle;
6
7 void UndrawParticles();
8 void HandleParticles();
9 void DisplayParticles();
10 void NewParticles(float turn, int X, int Y);