<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><head><title> Allegro BeOS-specific information </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" title="Default" type="text/css" href="../allegro.css"></head><body bgcolor=white text=black link="#0000ee" alink="#ff0000" vlink="#551a8b"> <pre> ______ ___ ___ /\ _ \ /\_ \ /\_ \ \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ <tt>`\/\`'</tt>__\/ __`\ \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ /\____/ \_/__/ BeOS-specific information. See <a href="../readme.html">readme.txt</a> for a more general overview. </pre> <p><br> <h1><a name="BeOS notes">BeOS notes</a></h1> <p> Status: It compiles for Intel R4 & R5. Port is complete. <p><br> <h1><a name="Required software">Required software</a></h1> <p> BeOS Intel R4 and R5 Pro Edition come with everything you need. If you have BeOS Intel R5 Personal Edition, you require the development tools; these can be found on the Be homepage at <a href="http://www.be.com">http://www.be.com</a>. You also need updated binutils, which can be found at <a href="http://bebits.com">http://bebits.com</a>. It might not be a bad idea to update gcc as well, but is not required. <p><br> <h1><a name="Installing Allegro">Installing Allegro</a></h1> <p> Allegro comes as a source distribuition: you'll have to compile it to get it to work. Unzip the library archive wherever you want, and cd into that directory with a Terminal. Due to the multi-platform nature of Allegro, you need to run: <blockquote class="text"><pre> fix.sh beos </pre></blockquote> This will set the library ready to be compiled on the Be platform. Now you must build it: <blockquote class="text"><pre> make </pre></blockquote> And then install it: <blockquote class="text"><pre> make install </pre></blockquote> With this last command the Allegro library will be installed into <tt>/boot/home/config/lib</tt> (the default location for BeOS shared libraries), while the headers will go into <tt>/boot/develop/headers</tt> (the default locations where Be looks for them). <p> You have now installed Allegro! See the rest of the documentation and examples to learn more about it. A simple example of a command line to compile an allegro program: <blockquote class="text"><pre> gcc foo.c -O2 -Wall -o foo `allegro-config --shared` </pre></blockquote> The `<tt>allegro-config --shared</tt>` is explained in the next section. <p> The dynamically linked version of Allegro gets built by default but if you want to build the statically linked version of Allegro write the following on the command line: <blockquote class="text"><pre> export STATICLINK=1 </pre></blockquote> In the same manner we can also enter one of the following lines to build either the debug or the profiling version of the library: <blockquote class="text"><pre> export DEBUGMODE=1 export PROFILEMODE=1 </pre></blockquote> Then we can start to actually make and install the Allegro library. <blockquote class="text"><pre> make make install </pre></blockquote> If you have compiled a static version of the library, it will be copied to <tt>/boot/develop/lib/x86</tt>. <p><br> <h1><a name="Using Allegro">Using Allegro</a></h1> <p> Linking Allegro to a program also requires you to link several other BeOS libraries and set the correct library search pathes. To simplify the linking process, the installation sets up a script, <tt>allegro-config</tt>, that will print out a suitable commandline. You can use this inside backtick command substitution, for example: <blockquote class="text"><pre> gcc myfile.c -o myprogram `allegro-config --static` </pre></blockquote> This will enable you to link against the static library. <p> The `<tt>allegro-config --shared</tt>` option mentioned above will output all the options and libraries needed to link dynamically against the shared version of the Allegro library. If you use <tt>--libs</tt> instead of <tt>--shared</tt> or <tt>--static</tt>, the script will generate the linking arguments according to the latest installed library version. You can also run these <tt>allegro-config</tt> commands on the commandline to see what exactly they do. <p> If you want to build a debug version of your program, assuming that you have installed the debug version of Allegro, use: <blockquote class="text"><pre> gcc myfile.c -o myprogram `allegro-config --libs debug` </pre></blockquote> Terminal newbies, take note that these are ` backticks, not normal ' quotes! <p> There are also other switches for printing out the Allegro version number, or to override the install paths. Run <tt>allegro-config</tt> without any arguments for a full list of options. <p> Don't forget that you need to use the <code>END_OF_MAIN()</code> macro right after your <code>main()</code> function! </body> </html>