(split out from #30371)
This helps with the modularization effort.
CC: @isuruf @kiwifb @antonio-rojas @collares @tobihan @infinity0
Component: build: configure
Author: Tobias Diez, Matthias Koeppe
Branch/Commit: 3cb8f90
Reviewer: Matthias Koeppe, Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/31384