curl 7.16.1 (reduced)

Extract upstream curl using the following shell code.

url=git://github.com/bagder/curl.git &&
v=7.16.1 &&
r=ef442d58 &&
paths="
  COPYING
  include/curl/*.h
  lib/*.c
  lib/*.h
" &&
mkdir curl-$v-g$r-reduced &&
git clone $url curl-git &&
date=$(cd curl-git && git log -n 1 --format='%cd' $r) &&
(cd curl-git && git checkout $r &&
 git archive --format=tar $r -- $paths) |
(cd curl-$v-g$r-reduced && tar xv &&
 rm lib/config-*.h) &&
echo "g$r date: $date"
curl 7.38.0 (reduced)

Extract upstream curl using the following shell code.

url=git://github.com/bagder/curl.git &&
v=7.38.0 &&
r=202aa9f7 &&
paths="
  CMake/*
  CMakeLists.txt
  COPYING
  include/curl/*.h
  include/curl/curlbuild.h.cmake
  lib/*.c
  lib/*.h
  lib/CMakeLists.txt
  lib/Makefile.inc
  lib/curl_config.h.cmake
  lib/libcurl.rc
  lib/vtls/*.c
  lib/vtls/*.h
" &&
mkdir curl-$v-g$r-reduced &&
git clone $url curl-git &&
date=$(cd curl-git && git log -n 1 --format='%cd' $r) &&
(cd curl-git && git checkout $r &&
 git archive --format=tar $r -- $paths) |
(cd curl-$v-g$r-reduced && tar xv &&
 rm lib/config-*.h) &&
echo "g$r date: $date"
curl: Disable all whitespace checks in third-party code

Add a .gitattributes file to tell Git to skip whitespace checks
in the curl source code.
curl: Move sources back into upstream layout

Update our build files as needed to compensate.
curl: Drop unused testing code

Remove our "Testing/" directory renames of the upstream examples.
Merge branch 'curl-upstream' into update-curl

Use the '-s ours' merge strategy to keep our side unchanged.
This merge brings in the upstream snapshot as of the version
of curl on which our source is based.  This will allow new
snapshots to be merged with our changes.
curl: Drop our CMake infrastructure to make room for the upstream

Remove our curl CMake build files since upstream now provides some.
After merging the upstream versions we may then port them to build
inside CMake and take code from our old build files as needed.
Merge branch 'curl-upstream' into update-curl

Resolve all conflicts in favor of the upstream side.
We can re-apply specific changes later.
curl: Remove unused SIZEOF_LONG_DOUBLE

Re-apply change from commit v2.8.2~537 (cmcurl: Remove unused
SIZEOF_LONG_DOUBLE, 2009-12-17) on updated upstream curl.
curl: Fix warnings on 64-bit Mac OS X build

Re-apply change from commit v2.6.0~921 (Fix warnings on 64-bit Mac OS X
build, 2007-11-05) on updated upstream curl.
curl: Fix spelling errors reported by Lintian

Re-apply change from commit v2.8.3~265^2~1 (Fix spelling errors
reported by Lintian, 2010-07-02) on updated upstream curl.
curl: Drop '-DEV' from version since this is a curl release

We imported curl from an upstream release, so report the corresponding
release version to servers.  This is consistent with the version we
presented when our builtin curl was 7.16.1.
curl: Port to Haiku again

Re-apply change from commit v2.8.0~1683 (add initial support for HAIKU
OS, 2008-09-15) on updated upstream curl.  However, leave out the part
that was reverted by commit v3.0.0-rc1~541^2~1 (Haiku: Remove outdated
preprocessor checks, 2013-10-05).
curl: Remove outdated Haiku preprocessor checks

Re-apply change from commit v3.0.0-rc1~541^2~1 (Haiku: Remove outdated
preprocessor checks, 2013-10-05) on updated upstream curl.
curl: Simplify if() conditions on check result variables

Remove use of an old hack that takes advantage of the auto-dereference
behavior of the if() command to detect if a variable is defined.  The
hack has the form:

 if("${VAR} MATCHES "^${VAR}$")

where "${VAR}" is a macro argument reference.  Use if(DEFINED) instead.
This also avoids warnings for CMake Policy CMP0054.
curl: Fix curl.h inclusion of curlbuild.h from CMake sources

Use a CMake-specific path to this configured header so that it works
when included from a CMake source file in addition to curl sources.
We do not install the Curl headers with CMake, so this hack is okay.
curl: Configure build to work within CMake

Set curl build options as needed for CMake rather than presenting them
to the user in the cache.  Drop the CMAKE_BUILD_CURL_SHARED option for
now.

Change the curl library name to 'cmcurl'.  Disable blocks of code within
curl CMakeLists.txt files that we do not need for CMake, but leave the
code in place to make merging with curl updates easier.
curl: Restore CMake-specific test and install code

Restore the LIBCURL test used previously within CMake.  Restore
installation of the 'COPYING' file with the CMake documentation.
curl: Restore CMake-specific zlib selection code
curl: Select file APIs on Windows

Choose small or large file support based on capabilities of compiler
and target platform.