How to disable ncurses build on python3.12

How can i disable certain building feature in Python3.12? Basically, i do not want to build ncurses.
I am seeing below error.

d64-pc-linux-gnu-gcc -shared Modules/_cursesmodule.o -lncursesw -ltinfo -o Modules/_curses.cpython-312-x86_64-linux-gnu.so

bin/ld-wrapped: cannot find -lncursesw
bin/ld-wrapped: cannot find -ltinfo