Honestly, what is the problem with gnulib-tool? Why do you find it hard to understand?
Personally, I think g-t is about as well written as anything of its size and purpose could be, but 6000 lines of anything is not prima facie obvious and easy to understand, regardless of language. not easily possible to determine the default value for a variable?! Ruben, I commend sh -vx to you :). k