More gitignorance
Replace the homegrown autogen.sh with a call to autoreconf
Drop the HAVE_GETOPT_H guard

If this was really needed the other tools would be failing to compile.
And if they are, we should fix that at the cause for all of them.
Drop the inline PACKAGE/VERSION fallback

If this was really needed the other tools would need it too (and would be
failing to build wherever it was).  If the normal mechanism for setting
them isn't working somewhere we should fix that instead.
Tidy up some of the special CPPFLAGS

So that we can see what they are actually for, and only apply them to
the files that actually need them.
Fix the phoney spelling of PHONY
Fully automate version updating

This one meets or exceeds the following requirements:

 - Version is checked/updated for every build action when in the git repo.
   Does not require the user to re- ./configure to get the correct version.

 - Version is not updated automatically when using exported tarball source.
   Avoids accidentally getting a wrong version from some other git repo in
   a parent directory of the source, and allows setting the correct version
   for distro package exports.

 - Automatic updating can be manually suppressed.
   For developers doing lots of change/rebuild cycles they don't plan to
   release, when they don't want a full rebuild triggered for every commit,
   and again for every change made immediately after a commit.
   The version will still always be updated if they do a `make dist`.

 - Does not require any manual updating of versions in the mainline git
   repo for each release aside from normal tagging.  The version is
   recorded in one file only, that is automatically generated and will
   never need to be committed.

 - Does not require gnu-make features for the autoconf builds.

It does not currently:

 - Keep a checksum of every source file in tarball releases to mangle the
   version if people modify the tarball source.  Responsible people can
   manually update the version easily though in such cases.
Drop the stdint size tests that we never use anywhere

These were probably cribbed from libopus, where they aren't used either,
which was probably cribbed from libogg where they are.  We definitely
don't need them here since we get all our sized types from elsewhere.
More autoconf housekeeping

Fix the libm exp() test to not unconditionally add it to everything via
LIBS, and fix opus{enc,dec}_LDADD to actually use LIBM that it sets
rather than hardcoding it there as well.

Use AS_HELP_STRING to format all option descriptions.

Get rid of a bunch of shadow variables that aren't really needed.

Drop the x warts in tests, it really isn't needed, and there are lots
of places we don't use it, so if it was they'd already be exploding.

Let the pkg-config tests actually fail if they don't find the desired
package, rather than also running the manual test which will just fail
again in that case.

Don't overlink flac with -lm in the manual test.  That was fixed in
its .pc in commit 5da86630bee2336e251f0a140f33332af703c43e.

Change --disable-flac to --without-flac.  The normal autoconf idiom is
to use 'enable' for intrinsic features and 'with' for external software
support that is optional.

Change Opus_{CFLAGS,LIBS} to OPUS_{CFLAGS,LIBS}, since that what opus.m4
will try to set if pkg-config isn't available.

Drop the check for __malloc_hook, we don't use it anywhere here.
Indentation

It's not just for the weak.
Get rid of LIBM altogether

And the exp() check too.  Nothing in the code actually tests for that
and it's irrelevant whether it needs libm or not, since plenty of other
things definitely do need it.

So add the hardcoded -lm back where it is definitely needed (at the
very least for the speex resampler), and make sure it is in LIBS when
we test for lrint and f{min,max}f, since those tests do fail on Linux
if libm isn't linked.
Replace the last AC_TRY_COMPILE

It is declared to be obsolete and we already use AC_COMPILE_IFELSE
everywhere else, so finish the job to avoid confusion and people
pasting more instances of it in later.

Double quote all the parameters to AC_LANG_SOURCE and AC_LANG_PROGRAM.
This is actually required, even if you can get away with not doing it
sometimes, so again set a good example for future changes to follow,
to hopefully avoid people getting bitten harder than they need to be.
Drop the test for lrint too

Nothing uses it either.