diff --git a/test_utils/test_common.h b/test_utils/test_common.h
index 8e1ec824..ee04ac78 100644
--- a/test_utils/test_common.h
+++ b/test_utils/test_common.h
@@ -30,7 +30,10 @@
  * The goal of this file (and the matching test.c) is to
  * simplify the very repetitive test-*.c test programs.
  */
-#if defined(HAVE_CONFIG_H)
+#if defined(PLATFORM_CONFIG_H)
+/* Use hand-built config.h in environments that need it. */
+#include PLATFORM_CONFIG_H
+#elif defined(HAVE_CONFIG_H)
 /* Most POSIX platforms use the 'configure' script to build config.h */
 #include "config.h"
 #elif defined(__FreeBSD__)
