Remove carriage return characters in version file

When created on Windows, .rbenv-version or .ruby-version files may have CR characters that will prevent rbenv from correctly parsing the Ruby version. Discard those characters when reading the file.
Add test for carriage return in ruby-version file
Simplify bash expression
Move carriage return test to version-file-read
Add \r to IFS instead of removing it manually
Merge pull request #567 from genezys/patch-1

Remove carriage return characters in version file

Fixes #566
Prefer gawk over awk if both are available.
Merge pull request #581 from LawnGnome/solaris-gawk

Prefer gawk over awk if both are available.

Fixes rbenv-help on Solaris 11.1
Get rid of explicit exit in fish branch of `rbenv-init`

Allows for code to be added to the end of the script which will not
mysteriously fail to run for fish shell.
Speed up `realpath()` with dynamically loaded C extension

On systems that support both C compiling and dynamic loading, we can
speed up `realpath()` (where most time in rbenv is spent) by replacing
it with a dynamically loaded bash builtin.

When `make -C src` is called in the project's root,
`libexec/rbenv-realpath.dylib` will be created. If it exists, rbenv will
attempt to load it as a builtin command. If it fails, execution will
fall back to the old `realpath()` shell function.
Fix hooks tests on OS X by expanding BATS_TMPDIR

With `realpath` extension, hooks tests on OS X will output
`/private/tmp` instead of `/tmp` because the latter is an actual symlink
to the former.

Avoid this mistmach in output assertions by expanding BATS_TMPDIR if
`realpath` extension is compiled.
Avoid slow `abs_dirname()` by loading `realpath` extension

This speeds up every `rbenv` invocation significantly.
Stop using `abs_dirname()` in rbenv-init

It's slow and not necessary since we expect `$0` to already be expanded.

In tests this change forces us to deal with some relative paths, but
it's not a big deal. The `rbenv init -` output in the most common case
will be the same as before:

    source '/home/myuser/.rbenv/libexec/../completions/rbenv.bash'
Test compiled native extensions on Travis CI
Fail hard if RBENV_NATIVE_EXT is set but extensions failed to load
Try without `-current_version`

Seems to only work on OS X; fails on Travis
https://travis-ci.org/sstephenson/rbenv/jobs/16384866
Import `shobj-conf` script from bash

Given the `-o <HOST-OS>` parameter, the script generates environment
variables with information how to compile dynamically loadable libraries
for that system.

Imported from bash-3.2.48
Fix `shobj-conf` on Darwin

The `shobj-conf` script imported from bash seems to not support the
latest OS X. This makes sure that `SHOBJ_LDFLAG=-dynamiclib` is output
for Darwin10+ (latest version is Darwin 13.0).
Create `configure` script to generate a cross-platform Makefile

The previous Makefile only worked on OS X. The dynamically generated
Makefile (from `Makefile.in`) should now work on multiple platforms
(tested on OS X and Ubuntu).
Fall back to `cc` as default compiler when `gcc` is not available