Borland.html
changeset 465 25f475cd4981
child 642 de622b7108bf
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Borland.html	Sat Aug 24 16:15:37 2002 +0000
     1.3 @@ -0,0 +1,137 @@
     1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Building SDL with Borland's C++ compilers</title>
     1.8 +                    
     1.9 +  <meta name="author"
    1.10 + content="David Snopek and updated by Dominique Louis.">
    1.11 +</head>
    1.12 +  <body>
    1.13 +   <xevol @newtonave.net="">      </xevol>   
    1.14 +<h1>Building SDL with Borland's C++ compilers. </h1>
    1.15 +    <b> by <a href="mailto:xevol@users.sourceforge.net"> David Snopek</a></b> 
    1.16 +   and updated by <b><a href="mailto:Dominique@SavageSoftware.com.au">Dominique 
    1.17 + Louis</a></b>.<br>
    1.18 +    <br>
    1.19 +     These instructions cover how to compile SDL and its included test programs 
    1.20 + using either  Borland <a href="#bcbwin">C++ Builder 5, 6 for Windows</a>, 
    1.21 +<a href="#k3">C++ Builder for Linux  ( AKA Kylix 3 )</a> or the free <a
    1.22 + href="#bccc">Borland C++ command-line compiler</a>. <br>
    1.23 +        
    1.24 +<h3> <b> Extract the files </b> </h3>
    1.25 +        
    1.26 +<p> Unzip the Borland.zip archive into <b>this</b> directory.  Do not unzip 
    1.27 + it into any  other directory because the makefiles ( *.mak ) and project 
    1.28 +files ( *.bpr ) use relative paths to refer to the SDL sources.  This  should 
    1.29 +create a directory named "Borland" inside of the top level SDL source directory. 
    1.30 +  </p>
    1.31 +        
    1.32 +<h3> <b><a name="bcbwin"></a> Using Borland C++ Builder 5, 6 for Windows </b>
    1.33 +</h3>
    1.34 +        
    1.35 +<p> Inside of the "Borland" directory there is a "bcb6" directory that contains 
    1.36 + a number  of Builder project files.  Double-click on the "libSDL.bpg" file 
    1.37 + icon.  Once Builder has  started click on the "<u>P</u>rojects" menu on the
    1.38 + menu-bar and go down to  "B<u>u</u>ild All Projects" option.  <br>
    1.39 + This will proceed  to build SDL ( with Borland's calling convention ), SDLmain, 
    1.40 +and all  the <a href="#tests">test programs</a>. Currently, all the <a
    1.41 + href="#tests">test programs</a> 
    1.42 +are dynamically linked to Sam Lantinga's SDL.dll.</p>
    1.43 + 
    1.44 +<p><b>NOTE :</b> Borland's "lib" format and Microsoft's "lib" format are incompatible.
    1.45 +&nbsp;<br>
    1.46 + If you wish to dynamically link to the SDL library supplied by Sam Lantinga 
    1.47 +in each release, I have created the correct *.libs for SDL 1.2.4 and they 
    1.48 +exist in the "/lib" directory.<br>
    1.49 + If you would like to create the *.lib files yourself, you will need to make 
    1.50 +use of Borland's "implib.exe" utility.<br>
    1.51 + </p>
    1.52 + 
    1.53 +<p><tt>IMPLIB</tt> works like this: </p>
    1.54 +   
    1.55 +<pre>    IMPLIB (destination lib name) (source dll)<br></pre>
    1.56 +   
    1.57 +<p> For example,</p>
    1.58 +   
    1.59 +<pre>    IMPLIB SDL.lib SDL.dll<br></pre>
    1.60 + 
    1.61 +<p>This assumes that SDL.dll was compiled with Visual C++ or similar.<br>
    1.62 + </p>
    1.63 + 
    1.64 +<p>To learn more about the difference between Borland's and Microsoft's *.lib 
    1.65 +format please read the article <a
    1.66 + href="http://www.bcbdev.com/articles/vcdll.htm">here</a>.<br>
    1.67 + </p>
    1.68 + 
    1.69 +<p>  <b><br>
    1.70 + NOTE :</b> The C++ Builder for Windows project format, is not compatible
    1.71 +with the Kylix  3 project format, hence the reason why they are in separate
    1.72 +directories.</p>
    1.73 +        
    1.74 +<h3> <b><a name="bccc"></a> Using the free Borland C++ command-line compiler 
    1.75 +</b> </h3>
    1.76 +        
    1.77 +<p> The free Borland compiler can be downloaded at no charge from <a
    1.78 + href="http://www.borland.com/bcppbuilder/freecompiler/"> the  Borland website 
    1.79 + </a>.  Make sure that it is installed and properly configured. </p>
    1.80 +        
    1.81 +<p> Open an MS-DOS Prompt.  Change to the "Borland\freebcc" directory under 
    1.82 + the  SDL source directory.  Type "make -f SDL.mak" to build SDL and "make 
    1.83 + -f  SDLmain.mak".  There are also makefiles for all of the <a
    1.84 + href="#tests">test  programs</a>, if you wish to build them. </p>
    1.85 +        
    1.86 +<h3> <b> Output files </b> </h3>
    1.87 +     No matter which compiler you used, three important files should have 
    1.88 +been  produced:      
    1.89 +<ul>
    1.90 +    	<li> SDL.dll ( Borland format ) </li>
    1.91 +    	<li> SDL.lib&nbsp;( Borland format ) </li>
    1.92 +    	<li> SDLmain.lib&nbsp;( Borland format ) </li>
    1.93 +       
    1.94 +</ul>
    1.95 +     Both of the *.lib files will need to be added to all the projects that 
    1.96 + use SDL and SDL.dll  must be placed some where the Windows dynamic linker 
    1.97 + can find it (either in your  project directory or on the system path, C:\WINDOWS\SYSTEM). 
    1.98 +   
    1.99 +<h3> <b><a name="k3"></a> Using Borland C++ Builder for Linux ( AKA Kylix 
   1.100 +3 ) </b> </h3>
   1.101 +          
   1.102 +<p> Inside of the "Borland" directory there is a "k3" directory that contains 
   1.103 + a number  of Builder project files.  Double-click on the "libSDL.bpg" file 
   1.104 + icon.  Once Builder has  started click on the "<u>P</u>rojects" menu on the
   1.105 + menu-bar and go down to  "B<u>u</u>ild All Projects" option.  This will proceed
   1.106 + to build all  the <a
   1.107 + href="#tests">test programs</a>.&nbsp;<br>
   1.108 + Linux  users do not need *.lib files as the Shared Object is linked right 
   1.109 +into the  project ( very neat actually, Windows should do this sort of thing 
   1.110 +as it is a lot easier for the developer ).  <br>
   1.111 +    <b>NOTE :</b>&nbsp;The C++ Builder for Windows project format, is not
   1.112 +compatible with the Kylix  3 project format, hence the reason why they are
   1.113 +in separate directories.</p>
   1.114 +       
   1.115 +<p> On Mandrake 8.1 the shared objects for SDL are located in the /usr/lib 
   1.116 + directory as libSDL_*.so and the Mesa OpenGL shared objects are located in
   1.117 + /usr/X11R6/lib as libGL*.so<br>
   1.118 +     <br>
   1.119 +     So if your setup is different you may need to change the project file
   1.120 + so that they re-link to the ones on your system.<br>
   1.121 +     <br>
   1.122 +     On Mandrake 8.1 the headers files are located at /usr/include/SDL/.
   1.123 +So  if you you have not installed the development RPMs ( usually named libSDL-devel*
   1.124 +  ) for SDL ( not included ) you may have to change the include directory
   1.125 +within  some of the projects.<br>
   1.126 + </p>
   1.127 + 
   1.128 +<h3> Known Problems</h3>
   1.129 +   The only known problem is that I ( Dominique Louis ), was unable to create 
   1.130 +the projects that rebuilt the SDL shared objects under Linux, due to time 
   1.131 +constraints and my lack of intimate knowledge of Linux.   
   1.132 +<h3><a name="tests"><b> Test programs </b> </a></h3>
   1.133 + Some of the test programs require included media files ( *.wav; *.bmp etc 
   1.134 + ).  Before trying to run any of the  test programs, copy these media files 
   1.135 + from the "tests/" directory into the Borland build directory that you extracted 
   1.136 + the project files to.  <br>
   1.137 +   <br>
   1.138 +</body>
   1.139 +</html>
   1.140 +