btrfs-progs: add ./configure script

Add ./autogen.sh script, you have to use it after "git clone/clean" to
generate ./configure from configure.ac.

Modify version.sh to be usable from the configure script.

The patch also renames Makefile to Makefile.in, but does NOT change
anything in the file.

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: use config.h

- the header file is generated by ./configure, the standard autotools
  way is to use -include config.h on compiler command line rather than
  include the file directly from code

- remove _GNU_SOURCE from code, the macros is already defined in config.h
  by AC_USE_SYSTEM_EXTENSIONS autoconf macro

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: use standard PACKAGE_* macros

- use standard PACKAGE_{NAME,VERSION,STRING,URL,...} autoconf macros
  rather than homemade BTRFS_BUILD_VERSION

- don't #include version.h, now the file is necessary for library API only

Note that "btrfs version" returns "btrfs-progs <version>" instead of
the original confusing "btrfs <version>".

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: use ./configure to generate version.h

The original homemade solution is unnecessary, autotools provides better
infrastructure to generate files.

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: check for build programs in ./configure

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: use paths and $*_LIBS from ./configure

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: cleanup compilation flags usage

- define basic default CFLAGS in configure.ac, because:

   * autoconf default is -g -O2, but btrfs uses -g -O1

   * it's better to follow autoconf; standard way to modify
     CFLAGS is to call:  CFLAGS="foo bar" ./configure

- move all flags to one place in Makefile.in

- don't use AM_CFLAGS, the CFLAGS and STATIC_CFLAGS are enough

- don't mix objects and flags in $LIBS, it's more readable to
  add $(libs) to make rules

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: clean generated files, make version.h stuff more robust

- add rule to generated version.h when any relevant stuff changed
- add rule to clean generated files on "make clean-all"

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: add --disable-backtrace

It's better to use ./configure than manually edit Makefile.

Signed-off-by: Karel Zak <kzak@redhat.com>
btrfs-progs: add --disable-documentation

Signed-off-by: Karel Zak <kzak@redhat.com>