Advanced Control When You Add Own CodeAdvanced Control When You Add Own CodeYou keep common code for all your servers in the common/ directory. In addition, you can add specific code for a given server in the servername/ (or default/) directory. If you need even more detailed control, for example you want to keep code for a specific feature in the common/ directory, but have small server-variations, the config.m4 defines two macros you can use to selectively include code based on which server you are generating seri.cfg for: CFG_NAME and CFG_servername. CFG_NAME is set to the name of the server, i.e. default or servername, while the macro CFG_default is defined when you generate the default configuration, CFG_rocky4 is defined when you generate the configuration for the rocky4 server, and so on. These macros can be used like this: ifdef(`CFG_rocky4', and ifelse(`CFG_NAME',`rocky4', Both if and ifelse allows the last "when not" comma and text to be skipped if it is not needed. Finally, in config.m4 there is a macro called DEVELOPMENT. By uncommenting this (and thus defining it), you can add code in your files that is only for development and testing and all such code can quickly be removed by commenting the DEVELOPMENT define again. Example: ifdef(`DEVELOPMENT', |
Navigation |