diff --git a/CONFIG.md b/CONFIG.md index 2ca02935c..15b4ffa3c 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -135,10 +135,17 @@ The pre-defined configurations are: Most of the time, one of the pre-defined configuration is exactly what one needs. Sometimes, however, the pre-defined configuration cuts out features that might be desired in the library. Unfortunately there is no quick way to undo those -configurations from the command-line. But one can add a header file called -`config-override.h` to undefine certain `HB_NO_*` symbols as desired. Then -define `HAVE_CONFIG_OVERRIDE_H` to make `hb-config.hh` include your configuration -overrides at the end. +configurations from the command-line. + +However, configuration can still be overridden from a file. To do that, add your +override instructions (mostly `undef` instructions) to a header file and define +the macro `HB_CONFIG_OVERRIDE_H` to the string containing to that header file's +name. HarfBuzz will then include that file at appropriate right place during +configuration. + +Up until HarfBuzz 3.1.2 the the configuration override header file's name was +fixed and called `config-override.h`, and was activated by defining the macro +`HAVE_CONFIG_OVERRIDE_H`. That still works. ## Notes diff --git a/src/hb-config.hh b/src/hb-config.hh index ad800f0f7..7d00d9088 100644 --- a/src/hb-config.hh +++ b/src/hb-config.hh @@ -86,8 +86,11 @@ #define HB_NO_LEGACY #endif -#ifdef HAVE_CONFIG_OVERRIDE_H -#include "config-override.h" +#if defined(HAVE_CONFIG_OVERRIDE_H) || defined(HB_CONFIG_OVERRIDE_H) +#ifndef HB_CONFIG_OVERRIDE_H +#define HB_CONFIG_OVERRIDE_H "config-override.h" +#endif +#include HB_CONFIG_OVERRIDE_H #endif /* Closure of options. */