1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

221 Commits

Author SHA1 Message Date
Sergei Nikulov
ec80b1f414 CMake: fix winsock2 detection on windows
Set CMAKE_REQUIRED_DEFINITIONS to include definitions needed to get
the winsock2 API from windows.h.  Simplify the order of checks to
avoid extra conditions.

Use check_include_file instead of check_include_file_concat to look
for OpenSSL headers.  They do not need to participate in a sequence
of dependent system headers.  Also they may cause winsock.h to be
included before ws2tcpip.h, causing the latter to not be detected
in the sequence.

Reviewed-by: Brad King <brad.king@kitware.com>
2015-02-19 20:11:04 +01:00
Steve Holme
2cc571f9e3 ldap: Renamed the CURL_LDAP_WIN definition to USE_WIN32_LDAP
For consistency with other USE_WIN32_ defines as well as the
USE_OPENLDAP define.
2015-01-18 20:52:43 +00:00
Steve Holme
1abe65d928 code/docs: Use Unix rather than UNIX to avoid use of the trademark
Use Unix when generically writing about Unix based systems as UNIX is
the trademark and should only be used in a particular product's name.
2014-12-26 21:42:44 +00:00
Peter Wu
970c22f970 libcurl: add UNIX domain sockets support
The ability to do HTTP requests over a UNIX domain socket has been
requested before, in Apr 2008 [0][1] and Sep 2010 [2]. While a
discussion happened, no patch seems to get through. I decided to give it
a go since I need to test a nginx HTTP server which listens on a UNIX
domain socket.

One patch [3] seems to make it possible to use the
CURLOPT_OPENSOCKETFUNCTION function to gain a UNIX domain socket.
Another person wrote a Go program which can do HTTP over a UNIX socket
for Docker[4] which uses a special URL scheme (though the name contains
cURL, it has no relation to the cURL library).

This patch considers support for UNIX domain sockets at the same level
as HTTP proxies / IPv6, it acts as an intermediate socket provider and
not as a separate protocol. Since this feature affects network
operations, a new feature flag was added ("unix-sockets") with a
corresponding CURL_VERSION_UNIX_SOCKETS macro.

A new CURLOPT_UNIX_SOCKET_PATH option is added and documented. This
option enables UNIX domain sockets support for all requests on the
handle (replacing IP sockets and skipping proxies).

A new configure option (--enable-unix-sockets) and CMake option
(ENABLE_UNIX_SOCKETS) can disable this optional feature. Note that I
deliberately did not mark this feature as advanced, this is a
feature/component that should easily be available.

 [0]: http://curl.haxx.se/mail/lib-2008-04/0279.html
 [1]: http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/
 [2]: http://sourceforge.net/p/curl/feature-requests/53/
 [3]: http://curl.haxx.se/mail/lib-2008-04/0361.html
 [4]: https://github.com/Soulou/curl-unix-socket

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:19 +01:00
Peter Wu
64291e989e cmake: add Kerberos to the supported features
Updated following commit eda919f and a4b7f71.

Acked-by: Brad King <brad.king@kitware.com>
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-19 19:51:22 +00:00
Peter Wu
c5b225c8ca cmake: fix NTLM detection when CURL_DISABLE_HTTP defined
Updated following changes in commit f0d860d.

Acked-by: Brad King <brad.king@kitware.com>
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-19 19:46:03 +00:00
Peter Wu
17d27805f9 cmake: add ENABLE_THREADED_RESOLVER, rename ARES
Fix detection of the AsynchDNS feature which not just depends on
pthreads support, but also on whether USE_POSIX_THREADS is set or not.
Caught by test 1014.

This patch adds a new ENABLE_THREADED_RESOLVER option (corresponding to
--enable-threaded-resolver of autotools) which also needs a check for
HAVE_PTHREAD_H.

For symmetry with autotools, CURL_USE_ARES is renamed to ENABLE_ARES
(--enable-ares). Checks that test for the availability actually use
USE_ARES instead as that is the result of whether a-res is available or
not (in practice this does not matter as CARES is marked as required
package, but nevertheless it is better to write the intent).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:09:25 +01:00
Peter Wu
10286f45e7 cmake: fix HAVE_GETHOSTNAME definition
Otherwise Curl_gethostname always fails. Windows has gethostname
since Vista according to
http://msdn.microsoft.com/en-us/library/ms738527%28VS.85%29.aspx, but
accordings to byte_bucket's VC 2005 documentation, it is available even
in Windows 95. (possibly after installing a Platform SDK, the
Windows Server 2003 SP1 Platform SDK should be sufficient).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:07:50 +01:00
K. R. Walker
dda59c5db5 cmake: fix ZLIB_INCLUDE_DIRS use
CMake 2.8's FindZLIB.cmake documents ZLIB_INCLUDE_DIRS, see
http://www.cmake.org/cmake/help/v2.8.0/cmake.html#module:FindZLIB

Bug: https://github.com/bagder/curl/pull/123
2014-11-04 11:51:53 +01:00
Peter Wu
b2bb51f339 cmake: drop _BSD_SOURCE macro usage
autotools does not use features.h nor _BSD_SOURCE. As this macro
triggers warnings since glibc 2.20, remove it. It should not have
functional differences.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-03 09:10:54 +01:00
Peter Wu
8ed66f98a9 cmake: generate pkg-config and curl-config
Initial work to generate a pkg-config and curl-config script. Static
linking (`curl-config --static-libs` and `pkg-config --shared --libs
libcurl`) is broken and therefore disabled.

CONFIGURE_OPTIONS does not make sense for CMake, use an empty string
for now.

At least `curl-config --features` and `curl-config --protocols` work
which is needed by runtests.pl.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-10-20 17:03:58 +02:00
Peter Wu
8478b4035e cmake: use LIBCURL_VERSION from curlver.h
This matches the behavior from autotools. The auxiliary major, minor
and patch components are not needed anymore and therefore removed.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-10-20 17:03:58 +02:00
Peter Wu
2a2bb78cce cmake: add SUPPORT_FEATURES and SUPPORT_PROTOCOLS
For compatibility with autoconf, it will be used later for curl-config
and pkg-config. Not all features and or protocols can be enabled as
these are missing additional checks (see new TODOs).

SUPPORT_PROTOCOLS is partially scripted (grep for SUPPORT_PROTOCOLS=)
and manually verified/modified. SUPPORT_FEATURES is manually added.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-10-20 17:03:58 +02:00
Peter Wu
aec7c5a87c cmake: enable IPv6 by default if available
ENABLE_IPV6 depends on HAVE_GETADDRINFO or you will get a
Curl_getaddrinfo_ex error. Enable IPv6 by default, disabling it if
struct sockaddr_in6 is not found in netinet/in.h.

Note that HAVE_GETADDRINFO_THREADSAFE is still not set as it needs more
platform checks even though POSIX requires a thread-safe getaddrinfo.

Verified on Arch Linux x86_64 with glibc 2.20-2 and Linux 3.16-rc7.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-10-13 11:21:03 +02:00
Peter Wu
b55502cdae cmake: build tool_hugehelp (ENABLE_MANUAL)
Rather than always outputting an empty manual page for the '-M' option,
generate a full manual page as done by autotools. For simplicity in
CMake, always generate the gzipped page as it will not be used anyway
when zlib is not available.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-10-12 14:11:42 +02:00
Jakub Zakrzewski
558814e16d Cmake: Build with GSSAPI (MIT or Heimdal)
It tries hard to recognise SDK's on different platforms. On windows MIT
Kerberos installs SDK with other things and puts path into registry.
Heimdal have separate zip archive. On linux pkg-config is tried, then
krb5-config script and finally old-style libs and headers detection.

Command line args:
* CMAKE_USE_GSSAPI - enables GSSAPI detection
* GSS_ROOT_DIR - if set, should point to the root of GSSAPI installation
                 (the one with include and lib directories)
2014-10-09 13:48:31 +02:00
Jakub Zakrzewski
a3154295c5 Cmake: Got rid of setup_curl_dependencies
There is no need for such function. Include_directories propagate by
themselves and having a function with one simple link statement makes
little sense.
2014-10-09 13:48:30 +02:00
Jakub Zakrzewski
fc61870a1c Cmake: Fix library list provided to cURL tests.
The list must be set after those nice CMake tests as we mess with
CMAKE_REQUIRED_LIBRARIES there.
2014-10-09 13:48:30 +02:00
Jakub Zakrzewski
cb2438ae52 Cmake: Check for OpenSSL before OpenLDAP.
OpenLDAP might have been build with OpenSSL. Checking for OpenLDAP first
may result in undefined symbols. Of course, the found OpenSSL libraries
must also be linked whenever OpenLDAP is.
2014-10-09 13:48:30 +02:00
Jakub Zakrzewski
f646e9075f Cmake: Possibility to use OpenLDAP, OpenSSL, LibSSH2 on windows
At this point I can build libcurl on windows. It provides at least the same
list of protocols as for linux build and works with our software.
2014-08-25 12:44:24 +02:00
Jakub Zakrzewski
febcfab23d Cmake: Removed useless comments from CMakeLists.txt
They look like some relics after changes.
2014-08-25 12:44:24 +02:00
Jakub Zakrzewski
dda86f386d Cmake: Append OpenSSL include directory to search path
At this point I can build libcurl with OpenSSL, OpenLDAP and LibSSH2.
Supported protocols are at least:
HTTP, HTTPS, FTP, SFTP, TFTP, LDAP, LDAPS, POP3, SMTP
(those are the ones we have regression tests for
in our product's testsuite)
2014-08-25 12:44:24 +02:00
Jakub Zakrzewski
7320e53d9e Cmake: Search for liblber, LDAP SSL headers, swith for using OpenLDAP code. 2014-08-25 12:44:24 +02:00
Jakub Zakrzewski
118977f19d Cmake: LibSSH2 detection and use. 2014-08-25 12:44:24 +02:00
Jakub Zakrzewski
88c17d5587 Cmake: Moved macros out of the main CMakeLists.txt 2014-08-25 12:44:24 +02:00
Jakub Zakrzewski
73a1a639a7 Cmake: Added missing protocol-disable switches
They already have their defines in config.h. This makes it possible to
disable the protocols from command line during configure step.
2014-08-25 12:44:24 +02:00
Jakub Zakrzewski
14aa8f0c11 Cmake: Require at least CMake 2.8.
CMake 2.6 is already a bit old. Many bugs have been fixed since
its release. We use 2.8 in our company and we have no intention
of polluting our environment with old software, so 2.6 would
not be tested. This shouldn't be a problem since all one need
to build CMake from source is C and C++ compiler.
2014-08-25 12:44:24 +02:00
Daniel Stenberg
030303fa99 CMakeLists.txt: add standard curl source code header 2014-01-01 22:35:59 +01:00
Daniel Stenberg
5f8f512719 CMakeLists.txt: add warning about the cmake build's state 2014-01-01 22:33:26 +01:00
Daniel Stenberg
0fdfe82c6a cmake: unbreak for non-Windows platforms
Patch-by: Oliver Kuckertz
Bug: http://curl.haxx.se/bug/view.cgi?id=1292
2013-10-20 17:12:56 +02:00
Matt Arsenault
a94a68a3c1 cmake: Fix mingw build 2013-02-04 22:35:09 +01:00
Sergei Nikulov
f850abf439 cmake: updated OpenSSL build 2013-02-04 22:32:18 +01:00
Yang Tse
4a5aa6682d Revert changes relative to lib/*.[ch] recent renaming
This reverts renaming and usage of lib/*.h header files done
28-12-2012, reverting 2 commits:

  f871de0... build: make use of 76 lib/*.h renamed files
  ffd8e12... build: rename 76 lib/*.h files

This also reverts removal of redundant include guard (redundant thanks
to changes in above commits) done 2-12-2013, reverting 1 commit:

  c087374... curl_setup.h: remove redundant include guard

This also reverts renaming and usage of lib/*.c source files done
3-12-2013, reverting 3 commits:

  13606bb... build: make use of 93 lib/*.c renamed files
  5b6e792... build: rename 93 lib/*.c files
  7d83dff... build: commit 13606bbfde follow-up 1

Start of related discussion thread:

  http://curl.haxx.se/mail/lib-2013-01/0012.html

Asking for confirmation on pushing this revertion commit:

  http://curl.haxx.se/mail/lib-2013-01/0048.html

Confirmation summary:

  http://curl.haxx.se/mail/lib-2013-01/0079.html

NOTICE: The list of 2 files that have been modified by other
intermixed commits, while renamed, and also by at least one
of the 6 commits this one reverts follows below. These 2 files
will exhibit a hole in history unless git's '--follow' option
is used when viewing logs.

  lib/curl_imap.h
  lib/curl_smtp.h
2013-01-06 18:20:27 +01:00
Yang Tse
13606bbfde build: make use of 93 lib/*.c renamed files
93 *.c source files renamed to use our standard naming scheme.

This change affects 77 files in libcurl's source tree.
2013-01-03 05:50:26 +01:00
Yang Tse
38ae6ec1a2 configure: NATIVE_WINDOWS no longer defined in config files 2012-04-12 13:08:48 +02:00
tetetest tetetest
66c0e26e28 CMakeLists.txt: fix Windows LDAP/LDAPS option handling
bug: http://curl.haxx.se/mail/lib-2012-03/0278.html
2012-03-30 19:03:12 +02:00
tetetest tetetest
7d1b715605 CMakeLists.txt: fix MS Visual Studio x64 unsigned long long literal suffix
bug: http://curl.haxx.se/mail/lib-2012-03/0255.html
2012-03-29 21:18:55 +02:00
Daniel Stenberg
ede9ad43fc cmake: list_spaces_append_once fails with spaces in filename
Windows standard libraries are located in C:/Program Files/Microsoft
SDKs/[...]. They are already included in the default MSVC
LIBPATH. Hence, find_library(WSOCK32_LIBRARY wsock32) and
find_library(WS2_32_LIBRARY ws2_32) are not needed. They return the full
path to the libraries including spaces. Of course,
list_spaces_append_once will mangle the result and the build fails.

Bug: http://curl.haxx.se/bug/view.cgi?id=3494968
2012-03-16 22:42:17 +01:00
Yang Tse
ed0364343d removed trailing whitespace 2011-12-30 03:36:18 +01:00
Daniel Stenberg
40afeea2fb cmake: find winsock when building on windows
When building on Windows, with CMake and mingw, curl fails to compile
because the CMake build system is not properly looking for the Winsock
libraries

Patch by: Pau Garcia i Quiles
Bug: http://curl.haxx.se/bug/view.cgi?id=3389231
2011-08-13 14:42:21 +02:00
Zmey Petroff
2cbe885c1a CMake: improve library search, implement install.
Improved library search by check_function_exists_concat() macro:
it does not revert the list of libraries any more.

Improved OpenSSL library search: first find zlib, then search for
openssl libraries that may depend on zlib.

For Unix: openssl libraries can now be detected in nonstandard
locations. Supply CMAKE_LIBRARY_PATH to CMake on command line.

Added installation capability (very basic one yet).
2011-04-28 10:12:33 +02:00
Brad King
651c0bcdf2 CMake: Use upstream CheckTypeSize module
The CheckTypeSize module that comes with CMake 2.6.2 and above does
everything we need and also supports cross-compiling.  Avoid duplicating
an older version of it here.  This also fixes a cross-compiling error
because the old line

  include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")

failed because CMAKE_MODULE_PATH is a search path and not a directory.

Signed-off-by: Brad King <brad.king@kitware.com>
2011-01-06 00:06:29 +01:00
Julien Chaffraix
ecd624b8e7 CMake: Build fix.
Do not match the trailing '\n' in the regular expression as this would
make us dump a ) parenthesis on a new line.

This fixes the following error:

would get transformed into:

)

Bug: http://curl.haxx.se/mail/lib-2010-10/0065.html
Reported by: Dimitre Dimitrov
2010-10-12 23:25:51 +02:00
Yang Tse
43d20d81a5 Enable OpenLDAP support for cygwin builds.
Enable OpenLDAP support for cygwin builds. This support was disabled back
in 2008 due to incompatibilities between OpenSSL and OpenLDAP headers.
cygwin's OpenSSL 0.9.8l and OpenLDAP 2.3.43 versions on cygwin 1.5.25
allow building an OpenLDAP enabled libcurl supporting back to Windows 95.

Remove non-functional CURL_LDAP_HYBRID code and references.
2010-06-04 15:14:31 +02:00
Bill Hoffman
ff438c994e Enable LDAP by default since it is now disabled when ldap.h is not found, 2010-03-24 14:16:41 -04:00
Bill Hoffman
5709a0dca2 CMake fixes for Linux.
Make sure <sys/socket.h> is included if around when testing/using
socklen_t.  Also, disable LDAP if LDAP_H is not found on the system.
2010-03-24 14:07:18 -04:00
Bill Hoffman
d42f9329dc Fix curl CMake build.
This commit fixes the cmake build of curl, and cleans up the
cmake code a little.  It removes some commented out code and
some trailing whitespace.  To get curl to build the binary
tree include/curl directory needed to be added to the include
path. Also, SIZEOF_SHORT needed to be added.  A check for the
lack of defines of SIZEOF_* for warnless.c was added.
2010-03-24 10:57:54 -04:00
Bill Hoffman
b4dcbbfabd ENH: fix build with ssl 2009-07-15 21:30:46 +00:00
Bill Hoffman
fb08218a04 BUG: curl did not build with cmake with VS 2005 for two reasons, ws2tcpip.h requires winsock2.h to be included before it with that compiler, and wldap32 is not available with the default install of the compiler, so disable ldap support if that is not found 2009-07-15 19:25:22 +00:00
Bill Hoffman
a8ea1e9ef4 ENH: add optional support for c-ares 2009-07-14 19:03:31 +00:00
Bill Hoffman
600460ffc6 ENH: do not report if zlib is not found as it still works 2009-07-14 13:34:37 +00:00
Bill Hoffman
5c4b6a8ef0 ENH: extract version from curlver.h 2009-06-10 14:08:00 +00:00
Bill Hoffman
744dceaffe ENH: lower case cmake functions and remove tabs and re-indent cmake code 2009-06-09 17:29:16 +00:00
Bill Hoffman
15be673054 ENH: add some cmake docs and fix build with socklen_t 2009-06-06 13:18:01 +00:00
Yang Tse
9137e717b0 Use build-time configured curl_socklen_t instead of socklen_t 2009-05-02 02:37:32 +00:00
Benoit Neil
c663494c69 (Minor change - From Piotr Dobrogost) Moved a line. 2009-04-14 09:44:09 +00:00
Benoit Neil
7e9f7659b3 (Minor update) Moved some utilities to a separate file. 2009-04-09 21:16:28 +00:00
Benoit Neil
4d396169c8 Cleaned up the custom definition I added (replaced by CURL_STATICLIB) 2009-04-09 19:59:38 +00:00
Benoit Neil
3733fa02ee Made the windows .lib addition cleaner. 2009-04-08 23:20:04 +00:00
Benoit Neil
7037e4a4b1 Renamed a variable 2009-04-08 22:21:25 +00:00
Benoit Neil
25f626cc52 Fixed compile defines in CMake scripts 2009-04-08 11:42:45 +00:00
Benoit Neil
702355da47 (Minor update) Modified a comment, before going to sleep :) 2009-04-07 22:49:02 +00:00
Benoit Neil
e9dd099870 Added missing tests in CMake, added Makefile.inc for tests (+ use in CMake scripts), and fixed a missing define under windows in a test source file. 2009-04-07 21:59:15 +00:00
Benoit Neil
070d89a561 Added CURL_HIDDEN_SYMBOLS option, and fixed missing SIZEOF_INT causing warnings. 2009-04-07 21:00:50 +00:00
Benoit Neil
7c1fecc94a (From Bill Hoffman & Sukender) Added Dashboard reports. 2009-04-07 11:23:23 +00:00
Benoit Neil
8cb8371011 Made the CMake scripts read Makefile.inc. Needs testing I guess. 2009-04-06 22:45:17 +00:00
Benoit Neil
b85154f13f Added tests (exes) targets, refactor a few things.
PS: Once again, sorry if the added files have executable perms on Linux.
2009-04-06 21:05:44 +00:00
Benoit Neil
06047d9103 Added curl (exe) target, fixed static/dynamic linking errors.
PS: Sorry if the added file has executable perms on Linux, I didn't found anything related to it...
2009-04-06 20:44:01 +00:00
Benoit Neil
edd02607e2 Fixed Win32 link error and disabled MSVC specific (=annoying) warnings (Reported by Bill Hoffman) 2009-04-06 19:22:31 +00:00
Benoit Neil
9a184e0bb1 Added basic OpenSSL support in CMake scripts (Thanks to Bill Hoffman) 2009-04-02 23:12:22 +00:00
Benoit Neil
4c5307b456 Initial CMake scripts (libcurl only), based on the merge of tetest scripts and mine. These are far to be functionnal yet.
PS: Hello world :)
2009-04-02 13:14:53 +00:00