Changeset 265

Show
Ignore:
Timestamp:
07/06/07 12:23:53 (1 year ago)
Author:
aldacron
Message:

[General]
* incorporated larsivi's patch to buildme.d so that it now works in a Tango environment
[Docs]
* updated build.html to give reflect the build script changes and to clarify the different ways to build Derelict as well as the rationale
[DerelictGL]
* several of the function pointer declarations in arb/multitexture.d had the wrong signature
[DerelictILUT]
* was not compatible with Tango
[DerelictODE]
* was not compatible with Tango
* import statements now all have an explicit 'private' to be consistent with the rest of Derelict

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/DerelictGL/derelict/opengl/extension/arb/multitexture.d

    r264 r265  
    197197typedef void function(GLenum, GLshort) pfglMultiTexCoord1sARB; 
    198198typedef void function(GLenum, GLshort*) pfglMultiTexCoord1svARB; 
    199 typedef void function(GLenum, GLdouble) pfglMultiTexCoord2dARB; 
     199typedef void function(GLenum, GLdouble, GLdouble) pfglMultiTexCoord2dARB; 
    200200typedef void function(GLenum, GLdouble*) pfglMultiTexCoord2dvARB; 
    201 typedef void function(GLenum, GLfloat) pfglMultiTexCoord2fARB; 
     201typedef void function(GLenum, GLfloat, GLfloat) pfglMultiTexCoord2fARB; 
    202202typedef void function(GLenum, GLfloat*) pfglMultiTexCoord2fvARB; 
    203 typedef void function(GLenum, GLint) pfglMultiTexCoord2iARB; 
     203typedef void function(GLenum, GLint, GLint) pfglMultiTexCoord2iARB; 
    204204typedef void function(GLenum, GLint*) pfglMultiTexCoord2ivARB; 
    205 typedef void function(GLenum, GLshort) pfglMultiTexCoord2sARB; 
     205typedef void function(GLenum, GLshort, GLshort) pfglMultiTexCoord2sARB; 
    206206typedef void function(GLenum, GLshort*) pfglMultiTexCoord2svARB; 
    207 typedef void function(GLenum, GLdouble) pfglMultiTexCoord3dARB; 
     207typedef void function(GLenum, GLdouble, GLdouble, GLdouble) pfglMultiTexCoord3dARB; 
    208208typedef void function(GLenum, GLdouble*) pfglMultiTexCoord3dvARB; 
    209 typedef void function(GLenum, GLfloat) pfglMultiTexCoord3fARB; 
     209typedef void function(GLenum, GLfloat, GLfloat, GLfloat) pfglMultiTexCoord3fARB; 
    210210typedef void function(GLenum, GLfloat*) pfglMultiTexCoord3fvARB; 
    211 typedef void function(GLenum, GLint) pfglMultiTexCoord3iARB; 
     211typedef void function(GLenum, GLint, GLint, GLint) pfglMultiTexCoord3iARB; 
    212212typedef void function(GLenum, GLint*) pfglMultiTexCoord3ivARB; 
    213 typedef void function(GLenum, GLshort) pfglMultiTexCoord3sARB; 
     213typedef void function(GLenum, GLshort, GLshort, GLshort) pfglMultiTexCoord3sARB; 
    214214typedef void function(GLenum, GLshort*) pfglMultiTexCoord3svARB; 
    215 typedef void function(GLenum, GLdouble) pfglMultiTexCoord4dARB; 
     215typedef void function(GLenum, GLdouble, GLdouble, GLdouble, GLdouble) pfglMultiTexCoord4dARB; 
    216216typedef void function(GLenum, GLdouble*) pfglMultiTexCoord4dvARB; 
    217 typedef void function(GLenum, GLfloat) pfglMultiTexCoord4fARB; 
     217typedef void function(GLenum, GLfloat, GLfloat, GLfloat, GLfloat) pfglMultiTexCoord4fARB; 
    218218typedef void function(GLenum, GLfloat*) pfglMultiTexCoord4fvARB; 
    219 typedef void function(GLenum, GLint) pfglMultiTexCoord4iARB; 
     219typedef void function(GLenum, GLint, GLint, GLint, GLint) pfglMultiTexCoord4iARB; 
    220220typedef void function(GLenum, GLint*) pfglMultiTexCoord4ivARB; 
    221 typedef void function(GLenum, GLshort) pfglMultiTexCoord4sARB; 
     221typedef void function(GLenum, GLshort, GLshort, GLshort, GLshort) pfglMultiTexCoord4sARB; 
    222222typedef void function(GLenum, GLshort*) pfglMultiTexCoord4svARB; 
    223223pfglActiveTextureARB            glActiveTextureARB; 
  • trunk/DerelictILUT/derelict/devil/ilutfuncs.d

    r264 r265  
    177177version(Windows) 
    178178{ 
    179     private import std.c.windows.windows; 
     179    version(Tango) 
     180    { 
     181        private import tango.sys.Common; 
     182    } 
     183    else 
     184    { 
     185        private import std.c.windows.windows; 
     186    } 
     187 
    180188 
    181189    typedef HBITMAP function(HDC hDC) pfilutConvertToHBitmap; 
  • trunk/DerelictODE/derelict/ode/collision.d

    r259 r265  
    3232module derelict.ode.collision; 
    3333 
    34 import derelict.ode.common; 
    35 import derelict.ode.collision_space; 
    36 import derelict.ode.contact; 
     34private 
     35
     36    import derelict.ode.common; 
     37    import derelict.ode.collision_space; 
     38    import derelict.ode.contact; 
     39
    3740 
    3841/* 
  • trunk/DerelictODE/derelict/ode/collision_space.d

    r259 r265  
    3232module derelict.ode.collision_space; 
    3333 
    34 import derelict.ode.common; 
     34private import derelict.ode.common; 
    3535 
    3636/* 
  • trunk/DerelictODE/derelict/ode/collision_trimesh.d

    r259 r265  
    3232module derelict.ode.collision_trimesh; 
    3333 
    34 import derelict.ode.common; 
     34private import derelict.ode.common; 
    3535 
    3636/* 
  • trunk/DerelictODE/derelict/ode/common.d

    r259 r265  
    3232module derelict.ode.common; 
    3333 
    34 import std.math; 
     34private 
     35
     36    version(Tango) 
     37    { 
     38        import tango.stdc.math; 
     39    } 
     40    else 
     41    { 
     42        import std.math; 
     43    } 
     44
    3545 
    3646/* 
     
    8797dReal dFMod(dReal a, dReal b) 
    8898{ 
    89     real c = b; 
    90     return modf(a,c);         /* modulo */ 
     99    version(Tango) 
     100    { 
     101        return modf(a,&b); 
     102    } 
     103    else 
     104    { 
     105        real c; 
     106        return modf(a,c); 
     107    } 
     108 
    91109} 
    92110 
  • trunk/DerelictODE/derelict/ode/compatibility.d

    r259 r265  
    3232module derelict.ode.compatibility; 
    3333 
    34 import derelict.ode.common; 
    35 import derelict.ode.rotation; 
     34private 
     35
     36    import derelict.ode.common; 
     37    import derelict.ode.rotation; 
     38
    3639 
    3740/* 
  • trunk/DerelictODE/derelict/ode/contact.d

    r259 r265  
    3232module derelict.ode.contact; 
    3333 
    34 import derelict.ode.common; 
     34private import derelict.ode.common; 
    3535 
    3636/* 
  • trunk/DerelictODE/derelict/ode/error.d

    r259 r265  
    3232module derelict.ode.error; 
    3333 
    34 import std.stdarg; 
     34private 
     35
     36    version(Tango) 
     37    { 
     38        import tango.stdc.stdarg; 
     39    } 
     40    else 
     41    { 
     42        import std.stdarg; 
     43    } 
     44
    3545 
    3646/* 
  • trunk/DerelictODE/derelict/ode/export_dif.d

    r259 r265  
    3232module derelict.ode.export_dif; 
    3333 
    34 import std.c.stdio; 
    35 import derelict.ode.common; 
     34private 
     35
     36    import derelict.ode.common; 
     37 
     38    version(Tango) 
     39    { 
     40        import tango.stdc.stdio; 
     41    } 
     42    else 
     43    { 
     44        import std.c.stdio; 
     45    } 
     46
    3647 
    3748/* 
  • trunk/DerelictODE/derelict/ode/mass.d

    r259 r265  
    3232module derelict.ode.mass; 
    3333 
    34 import derelict.ode.common; 
    35 import std.stdio; 
     34private 
     35
     36    import derelict.ode.common; 
     37 
     38    version(Tango) 
     39    { 
     40        import tango.stdc.stdio; 
     41    } 
     42    else 
     43    { 
     44        import std.c.stdio; 
     45    } 
     46
    3647/* 
    3748 * ODE contribution by William DeVore, 2007 
  • trunk/DerelictODE/derelict/ode/matrix.d

    r259 r265  
    3232module derelict.ode.matrix; 
    3333 
    34 import derelict.ode.common; 
     34private import derelict.ode.common; 
    3535 
    3636/* 
  • trunk/DerelictODE/derelict/ode/misc.d

    r259 r265  
    3232module derelict.ode.misc; 
    3333 
    34 import std.c.stdio; 
    35 import derelict.ode.common; 
     34private 
     35
     36    import derelict.ode.common; 
     37 
     38    version(Tango) 
     39    { 
     40        import tango.stdc.stdio; 
     41    } 
     42    else 
     43    { 
     44        import std.c.stdio; 
     45    } 
     46
    3647 
    3748/* 
  • trunk/DerelictODE/derelict/ode/objects.d

    r259 r265  
    3232module derelict.ode.objects; 
    3333 
    34 import derelict.ode.common; 
    35 import derelict.ode.mass; 
    36 import derelict.ode.contact; 
     34private 
     35
     36    import derelict.ode.common; 
     37    import derelict.ode.mass; 
     38    import derelict.ode.contact; 
     39
    3740 
    3841/* 
  • trunk/DerelictODE/derelict/ode/odemath.d

    r259 r265  
    3232module derelict.ode.odemath; 
    3333 
    34 import derelict.ode.common; 
     34private import derelict.ode.common; 
    3535 
    3636/* 
  • trunk/DerelictODE/derelict/ode/rotation.d

    r259 r265  
    3232module derelict.ode.rotation; 
    3333 
    34 import derelict.ode.common; 
     34private import derelict.ode.common; 
    3535 
    3636/* 
  • trunk/DerelictODE/derelict/ode/timer.d

    r259 r265  
    3232module derelict.ode.timer; 
    3333 
    34 import std.c.stdio; 
     34private 
     35
     36    version(Tango) 
     37    { 
     38        import tango.stdc.stdio; 
     39    } 
     40    else 
     41    { 
     42        import std.c.stdio; 
     43    } 
     44
    3545 
    3646/* 
  • trunk/buildme.d

    r261 r265  
    3333// Imports 
    3434//============================================================================== 
     35module buildme; 
     36 
    3537version(Tango) 
    3638{ 
    37     static assert(0, "Tango support for the build script is currently incomplete."); 
     39//    static assert(0, "Tango support for the build script is currently incomplete."); 
    3840    private 
    3941    { 
     
    4648        import tango.stdc.stringz; 
    4749        import tango.stdc.stdio; 
     50        import tango.io.FilePath; 
     51        import tango.io.Stdout; 
     52        import tango.sys.Environment; 
    4853    } 
    4954} 
     
    6469version(Windows) 
    6570{ 
    66     private static const char[] delCmd      = "@del "; 
     71    private static const char[] delCmd  = "cmd /c del "; 
    6772    private static const char[] pathSep     = "\\"; 
    6873    private static const char[] libPre      = ""; 
     
    198203        version(Tango) 
    199204        { 
     205            scope dir = new FilePath("."); 
     206            foreach(c; dir.toList) 
     207            { 
     208                scope path = new FilePath(c); 
     209                if(path.isFolder && c[0] != '.') 
     210                    processPackage(c); 
     211            } 
    200212        } 
    201213        else 
     
    370382    version(Tango) 
    371383    { 
    372         return toLower(str); 
     384        return toLower(str.dup); 
    373385    } 
    374386    else 
     
    382394    version(Tango) 
    383395    { 
    384         auto s = new String!(char)(a); 
     396        scope s = new String!(char)(a); 
    385397        return s.compare(b); 
    386398    } 
     
    425437    version(Tango) 
    426438    { 
    427         auto p = new Process(cmd, null); 
     439        auto p = new Process(cmd, Environment.get); 
    428440        p.execute(); 
     441//        Stdout.stream.copy(p.stdout); 
    429442        auto r = p.wait(); 
    430443        return r.status; 
     
    440453    version(Tango) 
    441454    { 
    442         auto f = new File(name); 
     455        scope f = new File(name); 
    443456        return cast(char[])f.read(); 
    444457    } 
     
    456469    version(Tango) 
    457470    { 
    458         auto f = new File(name); 
     471        scope f = new File(name); 
    459472        f.write(cast(void[])contents); 
    460473    } 
  • trunk/docs/build.html

    r254 r265  
    1111<hr> 
    1212<h3>Introduction</h3> 
    13 While it is possible to compile any or all of the Derelict packages into static 
    14 libraries, it is not recommended that you do so. The provided build script exists 
    15 solely as a convenience for those who absolutely need it. The recommended way of 
    16 using Derelict in your applications is to make use of a build tool, such as 
    17 <a href="http://www.dsource.org/projects/build">Bud</a> or 
     13There are some wonderful build tools created by D users, such as 
     14<a href="http://www.dsource.org/projects/build">Bud</a> and 
    1815<a href="http://www.dsource.org/projects/dsss/wiki/Rebuild">Rebuild</a>. Given 
    19 a single D source module, these tools can automatically compile and link all 
    20 imported modules to create an executable. So unless you absolutely must use the 
    21 static libraries, please consider using the recommended approach instead. 
     16a single source module, these tools are able to parse all of the modules imported 
     17by your application and cause them to be compiled and linked into the final 
     18executable. This is the recommended way to use Derelict. Unfortunately, it is not 
     19always possible. 
    2220<p> 
    23 For those who do need the libraries, in the top-level Derelict directory 
    24 ($DERELICT_HOME) you will find a D module named <tt>buildme.d</tt>. It can be, 
    25 and is intended to be, run as a script. Executing this file will create one or 
    26 more libraries from the Derelict packages. At the end of execution, all of the 
    27 libraries that were created will be found in the $DERELICT_HOME/lib directory. 
    28 </p> 
     21There are times when you may need to compile the Derelict packages into static 
     22libraries. An example is when using an IDE that has a two-step compile and link 
     23process. In such cases, D support is usually an extension and the IDE is not 
     24aware of tools like Bud and Rebuild. One such IDE is 
     25<a href="http://www.codeblocks.org/">Code::Blocks</a>. If you find yourself 
     26needing to use Derelict in library form, a build script is included in the 
     27top-level Derelict directory ($DERELICT_HOME). <tt>buildme.d</tt> can be used 
     28to compile all of the Derelict packages or only those you specify. How to do 
     29so is detailed below. 
     30</p><p> 
    2931 
    3032<h3>Setting Up An Import Directory</h3> 
     
    6567to bug reports, I make no promises about enhancing its functionality. 
    6668 
    67 <div class="important">Derelict has built-in support for 
     69<div class="important">Derelict packages have built-in support for 
    6870<a href="http://www.dsource.org/projects/tango">Tango</a>. However, currently the 
    69 neither the install script nor the build script (described below) can be executed 
    70 in a Tango-enabled environment. If you need to use Derelict with Tango, you must 
    71 do so using the method recommended above (with Bud or Rebuild).</div> 
    72  
    73 <h3>TheBuild Script</h3> 
     71the install script is not configured for Tango and will not execute in a Tango 
     72environment. When you execute the script, make sure you do so in a Phobos environment.</div> 
     73 
     74<h3>The Build Script</h3> 
     75 
    7476Currently, the build script requires that <a href="http://www.dsource.org/projects/build"> 
    75 Bud</a> be on your PATH. If it is not, the script will fail. To execute the 
    76 build script, cd to $DERELICT_HOME and use one of the following command lines: 
     77Bud</a> be on your PATH. If it is not, the script will fail execution. In the future, support 
     78for Rebuild will be added. How you execute the build script depends upon the environment 
     79you have configured (Phobos or Tango) and which tools you decide to use. Following are 
     80descriptions for different ways to use the build script, two of which require 
     81compilation and only one of which will currently work in a Tango environment. 
     82 
     83<h4>Execution as a Script</h4> 
     84 
     85In a Phobos environment you can execute <tt>buildme.d</tt> as a script, without 
     86compiling it first, using one of the following command lines: 
    7787 
    7888<pre> 
     
    8292 
    8393The first is the command line to use with DMD. The second is for GDC. In the rest 
    84 of this document, 'dmd' will be used for all example command lines. Anytime you 
    85 see 'dmd', you can replace it with 'gdmd' to use the same command line with GDC. 
     94of this document, anytime you see 'dmd' in a command line, you can replace it with 
     95'gdmd' to use the same command line with GDC. You can also compile the script with 
     96DMD or GDC, but then you'll need to clean up the output files. 
     97 
     98<h4>Compiling with Bud</h4> 
     99 
     100The build script uses Bud to compile Derelict packages into static libraries. You can 
     101also use Bud to compile the build script into an executable. This is not really 
     102necessary, nor is it really recommended. But, the option exists as long as you are 
     103in a Phobos environment. For some reason, Bud can compile the Derelict packages 
     104just fine in a Tango environment, but fails to compile <tt>buildme.d</tt>. The 
     105following is the recommended command line: 
     106 
     107<pre> 
     108    bud -clean buildme.d 
     109</pre> 
     110 
     111Passing the <tt>-clean</tt> option to Bud will cause all temporary output files to be 
     112deleted once the process completes. You can then execute <tt>buildme</tt> like any other 
     113executable. 
     114 
     115<h4>Compiling with Rebuild</h4> 
     116 
     117This option is the only one of the three listed here that works in a Tango environment, 
     118but it also works in a Phobos environment. The command line is very similar to that 
     119for Bud above: 
     120 
     121<pre> 
     122    rebuild -clean buildme.d 
     123</pre> 
     124 
     125The <tt>-clean</tt> option will cause most of the temporary output files to be deleted. 
     126But Rebuild currently does not delete MAP files generated by DMD on Windows, so you will 
     127have a buildme.map lying around in the directory after execution. 
    86128 
    87129<h4>Options</h4> 
    88 Before executing the build script, you need to decide which libraries you want 
    89 to build and how you want to build them. There are a few command line options 
    90 you can pass along. With the exception of the 'cleanlib' option, all options 
    91 may be passed in any order. 
    92  
     130Whether you run <tt>buildme.d</tt> as a script or compile it into an executable, 
     131you first need to decide which libraries you want to build and how you want to build them. 
     132There are a few command line options you can pass along. With the exception of the 
     133'cleanlib' option, all options may be passed in any order. 
     134<p> 
    93135By default, each package will be built in Release mode. You can specify debug 
    94136mode by passing 'debug' on the command line: 
     
    98140</pre> 
    99141 
     142Or, for the compiled form: 
     143 
     144<pre> 
     145    buildme debug 
     146</pre> 
     147 
    100148The script also accepts 'release' as a command line argument. 
    101  
    102 The build script generates a temporary Bud Response File that is deleted at the 
     149</p><p> 
     150The build script generates a temporary build response file that is deleted at the 
    103151end of execution. Sometimes, when debugging problems with the build script, it 
    104152is necessary to see the contents of this file. You can prevent the script from 
     
    109157</pre> 
    110158 
     159Or for the compiled form: 
     160 
     161<pre> 
     162    buildme nodelbrf 
     163</pre> 
     164 
    111165You can also pass options to both Bud and the compiler, though not via the command 
    112166line. This is done through the following three options files: 
     
    120174Options in <tt>bud_common.txt</tt> are used in both Debug and Release builds. The other 
    121175two are self-explanatory. 
    122 <p> 
     176</p><p> 
    123177The rules for editing these files are the same as those for editing 
    124178<a href="http://build.dsource.org/response_file.html">Bud Response Files</a>, 
     
    143197</pre> 
    144198 
     199Or for the compiled form: 
     200 
     201<pre> 
     202    cd $DERELICT_HOME 
     203    buildme DerelictAL DerelictUtil 
     204</pre> 
     205 
    145206The above will build only the DerelictAL and DerelictUtil libraries. 
    146207 
     
    154215</pre> 
    155216 
     217Or for the compiled form: 
     218 
     219<pre> 
     220    cd $DERELICT_HOME 
     221    buildme cleanlib 
     222</pre> 
     223 
    156224This will delete the libraries in $(DERELICT_HOME/lib). Unlike the other command 
    157 line options, this option must be specified first. Any options following it will 
    158 be ignored. If it is not first, it will be ignored. 
     225line options, this option is exclusive to other options. If any options precede it, 
     226it will be ignored. Likewise, any options following it will be ignored. 
    159227 
    160228<h4>Troubleshooting</h4>