2.3 Set Up the Euphoria Configuration File (eu.cfg)

Euphoria supports reading command line switches from configuration files. The default name for the configuration file is eu.cfg. However you can specify different ones by using the -C switch.

2.3.1 Configuration file format

The configuration file is a text file. Each line in the file is either a command line switch, a section header, an include path or a comment.

  • Comments are lines that begin with a double dash "--". Everything on the line is ignored.
  • A section header is a name enclosed in square brackets. eg. [interpret].
    • There are a number of predefined sections.
    • The lines in a section are only added to the command line switches if they apply to the mode that Euphoria is running in.
      • [windows] Applies to Windows platform only.
      • [unix] Applies to any Unix platform only.
      • [interpret] Applies to the interpreter running in any platform.
      • [translate] Applies to the translator running in any platform.
      • [bind] Applies to the binder running in any platform.
      • [interpret:windows] Applies to the interpreter when running under Windows only.
      • [interpret:unix] Applies to the interpreter when running under Unix only.
      • [translate:windows] Applies to the translator when running under Windows only.
      • [translate:unix] Applies to the translator when running under Unix only.
      • [bind:windows] Applies to the binder when running under Windows only.
      • [bind:unix] Applies to the binder when running under Unix only.
      • [all] Applies to all running modes.
    • All configuration lines before the first section header are assumed to be the [all] section.
    • You can have any number of section headers, but only the predefined ones are used. All lines in other sections are treated as comments.
  • A command line switch is a line that begins with a single dash. The entire line is added to the actual command line as if it was originally there.
  • An include path is any other line that is not one of the above. The string -I is prepended to the line and then it is added to the command line.

2.3.2 Config File Locations

When Euphoria starts up, it looks for configuration files in the following order:

  • For Windows systems
    1. %ALLUSERSPROFILE%\euphoria\eu.cfg
    2. %APPDATA%\euphoria\eu.cfg
    3. %EUDIR%\eu.cfg
    4. %HOMEDRIVE%\%HOMEPATH%\eu.cfg
    5. From where ever the executable is run from "<exepath>/eu.cfg"
    6. Current working directory - "./eu.cfg"
    7. Command line -C switches
  • For Unix systems
    1. /etc/euphoria/eu.cfg
    2. ${EUDIR}/eu.cfg
    3. ${HOME}/.eu.cfg
    4. From where ever the executable is run from "<exepath>/eu.cfg"
    5. Current working directory - "./eu.cfg"
    6. Command line -C switches

2.3.3 Config File Notes

  • Euphoria processes every configuration file found, and in the order described above. This means that settings specified in earlier configuration files may be overridden by subsequent configuration files. For example, a configuration file in the current directory will override the same settings in a configuration file in the executable's directory.
  • If a configuration file contains a -C switch, the new configuration file specified on that switch is processed before subsequent lines in the old file.
  • A configuration file is only ever processed once. Additional references to the same file are ignored.