gh-115765: Don't use deprecated AC_EGREP_* macros in configure.ac (#116016)

Rewrite using AX_CHECK_DEFINE and AC_CHECK_TYPES.
4 files changed