configure - move the function definitions to m4/

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>