Previous:Directory Structure   Main Index   Next:Conclusion



Configuring POV-Ray Source

Every platform has a header file config.h that is generally in the platform specific directory but may be in the compiler specific directory. Some platforms have multiple versions of this file and you may need to copy or rename it as config.h. This file is included in every module of POV-Ray. It contains any prototypes, macros or other definitions that may be needed in the generic parts of POV-Ray but must be customized for a particular platform or compiler.

For example different operating systems use different characters as a separator between directories and file names. MS-Dos uses back slash, Unix a front slash or Mac a colon. The config.h file for MS-Dos and Windows contains the following:

  #define FILENAME_SEPARATOR '\'

which tells the generic part of POV-Ray to use a back slash.

Every customization that the generic part of the code needs has a default setting in the file source\frame.h which is also included in every module after config.h. The frame.h header contains many groups of defines such as this:

  #ifndef FILENAME_SEPARATOR

  #define FILENAME_SEPARATOR '/'

  #endif

which basically says "If we didn't define this previously in config.h then here's a default value". See frame.h to see what other values you might wish to configure.

If any definitions are used to specify platform specific functions you should also include a prototype for that function. The file source\msdos\config.h, for example, not only contains the macro:

  #define POV_DISPLAY_INIT(w,h) MSDOS_Display_Init ((w), (h));

to define the name of the graphics display initialization function, it contains the prototype:

  void MSDOS_Display_Init (int w, int h);

If you plan to port POV-Ray to an unsupported platform you should probably start with the simplest, non-display generic Unix version. Then add new custom pieces via the config.h file.



Previous:Directory Structure   Main Index   Next:Conclusion