diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index 4dbb8ee2e37af40cce62f3e64b6aa5e2d5546880..a6bd98a7270e3d58c138acf6e6d3d31b7c43a4ec 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -84,7 +84,9 @@
 #define MICROPY_PY_SYS_STDFILES     (1)
 #define MICROPY_PY_SYS_EXC_INFO     (1)
 #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
+#ifndef MICROPY_PY_MATH_SPECIAL_FUNCTIONS
 #define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
+#endif
 #define MICROPY_PY_CMATH            (1)
 #define MICROPY_PY_IO_FILEIO        (1)
 #define MICROPY_PY_GC_COLLECT_RETVAL (1)