Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 4.5 MiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 337 KiB |
After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 357 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 22 KiB |
@ -1 +0,0 @@
|
|||||||
C:\Users\87334\AppData\Local\Temp\pdg1r02b.ncv.designtime.props
|
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"enableCMake": false
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"CurrentProjectSetting": "无配置"
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ExpandedNodes": [
|
||||||
|
"",
|
||||||
|
"\\curl-8.1.2\\include",
|
||||||
|
"\\curl-8.1.2\\include\\curl",
|
||||||
|
"\\fire"
|
||||||
|
],
|
||||||
|
"PreviewInSolutionExplorer": false
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.1",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"taskLabel": "任务-fire",
|
||||||
|
"appliesTo": "fire/fire.cpp",
|
||||||
|
"type": "launch"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
@CMAKE_CONFIGURABLE_FILE_CONTENT@
|
@ -0,0 +1,78 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
|
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
|
||||||
|
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
|
||||||
|
|
||||||
|
if(CURL_HIDDEN_SYMBOLS)
|
||||||
|
set(SUPPORTS_SYMBOL_HIDING FALSE)
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
|
||||||
|
set(SUPPORTS_SYMBOL_HIDING TRUE)
|
||||||
|
set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))")
|
||||||
|
set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
|
||||||
|
elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
|
||||||
|
# note: this is considered buggy prior to 4.0 but the autotools don't care, so let's ignore that fact
|
||||||
|
set(SUPPORTS_SYMBOL_HIDING TRUE)
|
||||||
|
set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))")
|
||||||
|
set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
|
||||||
|
set(SUPPORTS_SYMBOL_HIDING TRUE)
|
||||||
|
set(_SYMBOL_EXTERN "__global")
|
||||||
|
set(_CFLAG_SYMBOLS_HIDE "-xldscope=hidden")
|
||||||
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
|
||||||
|
# note: this should probably just check for version 9.1.045 but I'm not 100% sure
|
||||||
|
# so let's do it the same way autotools do.
|
||||||
|
set(SUPPORTS_SYMBOL_HIDING TRUE)
|
||||||
|
set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))")
|
||||||
|
set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
|
||||||
|
check_c_source_compiles("#include <stdio.h>
|
||||||
|
int main (void) { printf(\"icc fvisibility bug test\"); return 0; }" _no_bug)
|
||||||
|
if(NOT _no_bug)
|
||||||
|
set(SUPPORTS_SYMBOL_HIDING FALSE)
|
||||||
|
set(_SYMBOL_EXTERN "")
|
||||||
|
set(_CFLAG_SYMBOLS_HIDE "")
|
||||||
|
endif()
|
||||||
|
elseif(MSVC)
|
||||||
|
set(SUPPORTS_SYMBOL_HIDING TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(HIDES_CURL_PRIVATE_SYMBOLS ${SUPPORTS_SYMBOL_HIDING})
|
||||||
|
elseif(MSVC)
|
||||||
|
if(NOT CMAKE_VERSION VERSION_LESS 3.7)
|
||||||
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) #present since 3.4.3 but broken
|
||||||
|
set(HIDES_CURL_PRIVATE_SYMBOLS FALSE)
|
||||||
|
else()
|
||||||
|
message(WARNING "Hiding private symbols regardless CURL_HIDDEN_SYMBOLS being disabled.")
|
||||||
|
set(HIDES_CURL_PRIVATE_SYMBOLS TRUE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(HIDES_CURL_PRIVATE_SYMBOLS FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CURL_CFLAG_SYMBOLS_HIDE ${_CFLAG_SYMBOLS_HIDE})
|
||||||
|
set(CURL_EXTERN_SYMBOL ${_SYMBOL_EXTERN})
|
@ -0,0 +1,532 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
*
|
||||||
|
* This software is licensed as described in the file COPYING, which
|
||||||
|
* you should have received as part of this distribution. The terms
|
||||||
|
* are also available at https://curl.se/docs/copyright.html.
|
||||||
|
*
|
||||||
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the COPYING file.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: curl
|
||||||
|
*
|
||||||
|
***************************************************************************/
|
||||||
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
|
/* Time with sys/time test */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if ((struct tm *) 0)
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_FCNTL_O_NONBLOCK
|
||||||
|
|
||||||
|
/* headers for FCNTL_O_NONBLOCK test */
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
/* */
|
||||||
|
#if defined(sun) || defined(__sun__) || \
|
||||||
|
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||||
|
# if defined(__SVR4) || defined(__srv4__)
|
||||||
|
# define PLATFORM_SOLARIS
|
||||||
|
# else
|
||||||
|
# define PLATFORM_SUNOS4
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
|
||||||
|
# define PLATFORM_AIX_V3
|
||||||
|
#endif
|
||||||
|
/* */
|
||||||
|
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
|
||||||
|
#error "O_NONBLOCK does not work on this platform"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
/* O_NONBLOCK source test */
|
||||||
|
int flags = 0;
|
||||||
|
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* tests for gethostbyname_r */
|
||||||
|
#if defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||||
|
# define _REENTRANT
|
||||||
|
/* no idea whether _REENTRANT is always set, just invent a new flag */
|
||||||
|
# define TEST_GETHOSTBYFOO_REENTRANT
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||||
|
defined(TEST_GETHOSTBYFOO_REENTRANT)
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
char *address = "example.com";
|
||||||
|
int length = 0;
|
||||||
|
int type = 0;
|
||||||
|
struct hostent h;
|
||||||
|
int rc = 0;
|
||||||
|
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
|
||||||
|
struct hostent_data hdata;
|
||||||
|
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||||
|
char buffer[8192];
|
||||||
|
int h_errnop;
|
||||||
|
struct hostent *hp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
|
||||||
|
rc = gethostbyname_r(address, &h, &hdata);
|
||||||
|
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
|
||||||
|
rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop);
|
||||||
|
(void)hp; /* not used for test */
|
||||||
|
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||||
|
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||||
|
rc = gethostbyname_r(address, &h, buffer, 8192, &hp, &h_errnop);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
(void)length;
|
||||||
|
(void)type;
|
||||||
|
(void)rc;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SOCKLEN_T
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#else
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if ((socklen_t *) 0)
|
||||||
|
return 0;
|
||||||
|
if (sizeof (socklen_t))
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IN_ADDR_T
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if ((in_addr_t *) 0)
|
||||||
|
return 0;
|
||||||
|
if (sizeof (in_addr_t))
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_BOOL_T
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STDBOOL_H
|
||||||
|
#include <stdbool.h>
|
||||||
|
#endif
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if (sizeof (bool *) )
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef STDC_HEADERS
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <float.h>
|
||||||
|
int main() { return 0; }
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_FILE_OFFSET_BITS
|
||||||
|
#ifdef _FILE_OFFSET_BITS
|
||||||
|
#undef _FILE_OFFSET_BITS
|
||||||
|
#endif
|
||||||
|
#define _FILE_OFFSET_BITS 64
|
||||||
|
#include <sys/types.h>
|
||||||
|
/* Check that off_t can represent 2**63 - 1 correctly.
|
||||||
|
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||||
|
since some C++ compilers masquerading as C compilers
|
||||||
|
incorrectly reject 9223372036854775807. */
|
||||||
|
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||||
|
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||||
|
&& LARGE_OFF_T % 2147483647 == 1)
|
||||||
|
? 1 : -1];
|
||||||
|
int main () { ; return 0; }
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* ioctlsocket source code */
|
||||||
|
int socket;
|
||||||
|
unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET_CAMEL
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* IoctlSocket source code */
|
||||||
|
if(0 != IoctlSocket(0, 0, 0))
|
||||||
|
return 1;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* IoctlSocket source code */
|
||||||
|
long flags = 0;
|
||||||
|
if(0 != IoctlSocket(0, FIONBIO, &flags))
|
||||||
|
return 1;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET_FIONBIO
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
int flags = 0;
|
||||||
|
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTL_FIONBIO
|
||||||
|
/* headers for FIONBIO test */
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STROPTS_H
|
||||||
|
# include <stropts.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
int flags = 0;
|
||||||
|
if(0 != ioctl(0, FIONBIO, &flags))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTL_SIOCGIFADDR
|
||||||
|
/* headers for FIONBIO test */
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STROPTS_H
|
||||||
|
# include <stropts.h>
|
||||||
|
#endif
|
||||||
|
#include <net/if.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
struct ifreq ifr;
|
||||||
|
if(0 != ioctl(0, SIOCGIFADDR, &ifr))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
/* includes end */
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
|
||||||
|
return 1;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GLIBC_STRERROR_R
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
void check(char c) {}
|
||||||
|
|
||||||
|
int
|
||||||
|
main () {
|
||||||
|
char buffer[1024];
|
||||||
|
/* This will not compile if strerror_r does not return a char* */
|
||||||
|
check(strerror_r(EACCES, buffer, sizeof(buffer))[0]);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_POSIX_STRERROR_R
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
/* float, because a pointer can't be implicitly cast to float */
|
||||||
|
void check(float f) {}
|
||||||
|
|
||||||
|
int
|
||||||
|
main () {
|
||||||
|
char buffer[1024];
|
||||||
|
/* This will not compile if strerror_r does not return an int */
|
||||||
|
check(strerror_r(EACCES, buffer, sizeof(buffer)));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_FSETXATTR_6
|
||||||
|
#include <sys/xattr.h> /* header from libc, not from libattr */
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
fsetxattr(0, 0, 0, 0, 0, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_FSETXATTR_5
|
||||||
|
#include <sys/xattr.h> /* header from libc, not from libattr */
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
fsetxattr(0, 0, 0, 0, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_CLOCK_GETTIME_MONOTONIC
|
||||||
|
#include <time.h>
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
struct timespec ts = {0, 0};
|
||||||
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_BUILTIN_AVAILABLE
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
if(__builtin_available(macOS 10.12, *)) {}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_VARIADIC_MACROS_C99
|
||||||
|
#define c99_vmacro3(first, ...) fun3(first, __VA_ARGS__)
|
||||||
|
#define c99_vmacro2(first, ...) fun2(first, __VA_ARGS__)
|
||||||
|
|
||||||
|
int fun3(int arg1, int arg2, int arg3);
|
||||||
|
int fun2(int arg1, int arg2);
|
||||||
|
|
||||||
|
int fun3(int arg1, int arg2, int arg3) {
|
||||||
|
return arg1 + arg2 + arg3;
|
||||||
|
}
|
||||||
|
int fun2(int arg1, int arg2) {
|
||||||
|
return arg1 + arg2;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
int res3 = c99_vmacro3(1, 2, 3);
|
||||||
|
int res2 = c99_vmacro2(1, 2);
|
||||||
|
(void)res3;
|
||||||
|
(void)res2;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_VARIADIC_MACROS_GCC
|
||||||
|
#define gcc_vmacro3(first, args...) fun3(first, args)
|
||||||
|
#define gcc_vmacro2(first, args...) fun2(first, args)
|
||||||
|
|
||||||
|
int fun3(int arg1, int arg2, int arg3);
|
||||||
|
int fun2(int arg1, int arg2);
|
||||||
|
|
||||||
|
int fun3(int arg1, int arg2, int arg3) {
|
||||||
|
return arg1 + arg2 + arg3;
|
||||||
|
}
|
||||||
|
int fun2(int arg1, int arg2) {
|
||||||
|
return arg1 + arg2;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
int res3 = gcc_vmacro3(1, 2, 3);
|
||||||
|
int res2 = gcc_vmacro2(1, 2);
|
||||||
|
(void)res3;
|
||||||
|
(void)res2;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ATOMIC
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STDATOMIC_H
|
||||||
|
# include <stdatomic.h>
|
||||||
|
#endif
|
||||||
|
/* includes end */
|
||||||
|
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
_Atomic int i = 1;
|
||||||
|
i = 0; // Force an atomic-write operation.
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_WIN32_WINNT
|
||||||
|
/* includes start */
|
||||||
|
#ifdef WIN32
|
||||||
|
# include "../lib/setup-win32.h"
|
||||||
|
#endif
|
||||||
|
/* includes end */
|
||||||
|
|
||||||
|
#define enquote(x) #x
|
||||||
|
#define expand(x) enquote(x)
|
||||||
|
#pragma message("_WIN32_WINNT=" expand(_WIN32_WINNT))
|
||||||
|
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
@ -0,0 +1,32 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
find_path(BEARSSL_INCLUDE_DIRS bearssl.h)
|
||||||
|
|
||||||
|
find_library(BEARSSL_LIBRARY bearssl)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(BEARSSL DEFAULT_MSG
|
||||||
|
BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY)
|
||||||
|
|
||||||
|
mark_as_advanced(BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY)
|
@ -0,0 +1,43 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
|
||||||
|
|
||||||
|
find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon)
|
||||||
|
find_library(BROTLIDEC_LIBRARY NAMES brotlidec)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(Brotli
|
||||||
|
FOUND_VAR
|
||||||
|
BROTLI_FOUND
|
||||||
|
REQUIRED_VARS
|
||||||
|
BROTLIDEC_LIBRARY
|
||||||
|
BROTLICOMMON_LIBRARY
|
||||||
|
BROTLI_INCLUDE_DIR
|
||||||
|
FAIL_MESSAGE
|
||||||
|
"Could NOT find Brotli"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
|
||||||
|
set(BROTLI_LIBRARIES ${BROTLICOMMON_LIBRARY} ${BROTLIDEC_LIBRARY})
|
@ -0,0 +1,47 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# - Find c-ares
|
||||||
|
# Find the c-ares includes and library
|
||||||
|
# This module defines
|
||||||
|
# CARES_INCLUDE_DIR, where to find ares.h, etc.
|
||||||
|
# CARES_LIBRARIES, the libraries needed to use c-ares.
|
||||||
|
# CARES_FOUND, If false, do not try to use c-ares.
|
||||||
|
# also defined, but not for general use are
|
||||||
|
# CARES_LIBRARY, where to find the c-ares library.
|
||||||
|
|
||||||
|
find_path(CARES_INCLUDE_DIR ares.h)
|
||||||
|
|
||||||
|
set(CARES_NAMES ${CARES_NAMES} cares)
|
||||||
|
find_library(CARES_LIBRARY
|
||||||
|
NAMES ${CARES_NAMES}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(CARES
|
||||||
|
REQUIRED_VARS CARES_LIBRARY CARES_INCLUDE_DIR)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
CARES_LIBRARY
|
||||||
|
CARES_INCLUDE_DIR
|
||||||
|
)
|
@ -0,0 +1,312 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# - Try to find the GSS Kerberos library
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# GSS_ROOT_DIR - Set this variable to the root installation of GSS
|
||||||
|
#
|
||||||
|
# Read-Only variables:
|
||||||
|
# GSS_FOUND - system has the Heimdal library
|
||||||
|
# GSS_FLAVOUR - "MIT" or "Heimdal" if anything found.
|
||||||
|
# GSS_INCLUDE_DIR - the Heimdal include directory
|
||||||
|
# GSS_LIBRARIES - The libraries needed to use GSS
|
||||||
|
# GSS_LINK_DIRECTORIES - Directories to add to linker search path
|
||||||
|
# GSS_LINKER_FLAGS - Additional linker flags
|
||||||
|
# GSS_COMPILER_FLAGS - Additional compiler flags
|
||||||
|
# GSS_VERSION - This is set to version advertised by pkg-config or read from manifest.
|
||||||
|
# In case the library is found but no version info available it'll be set to "unknown"
|
||||||
|
|
||||||
|
set(_MIT_MODNAME mit-krb5-gssapi)
|
||||||
|
set(_HEIMDAL_MODNAME heimdal-gssapi)
|
||||||
|
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
include(CheckIncludeFiles)
|
||||||
|
include(CheckTypeSize)
|
||||||
|
|
||||||
|
set(_GSS_ROOT_HINTS
|
||||||
|
"${GSS_ROOT_DIR}"
|
||||||
|
"$ENV{GSS_ROOT_DIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find library using system pkg-config if user didn't specify root dir
|
||||||
|
if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(_GSS_PKG ${_MIT_MODNAME} ${_HEIMDAL_MODNAME})
|
||||||
|
list(APPEND _GSS_ROOT_HINTS "${_GSS_PKG_PREFIX}")
|
||||||
|
elseif(WIN32)
|
||||||
|
list(APPEND _GSS_ROOT_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos;InstallDir]")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approach.
|
||||||
|
find_file(_GSS_CONFIGURE_SCRIPT
|
||||||
|
NAMES
|
||||||
|
"krb5-config"
|
||||||
|
HINTS
|
||||||
|
${_GSS_ROOT_HINTS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
bin
|
||||||
|
NO_CMAKE_PATH
|
||||||
|
NO_CMAKE_ENVIRONMENT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# if not found in user-supplied directories, maybe system knows better
|
||||||
|
find_file(_GSS_CONFIGURE_SCRIPT
|
||||||
|
NAMES
|
||||||
|
"krb5-config"
|
||||||
|
PATH_SUFFIXES
|
||||||
|
bin
|
||||||
|
)
|
||||||
|
|
||||||
|
if(_GSS_CONFIGURE_SCRIPT)
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--cflags" "gssapi"
|
||||||
|
OUTPUT_VARIABLE _GSS_CFLAGS
|
||||||
|
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
message(STATUS "CFLAGS: ${_GSS_CFLAGS}")
|
||||||
|
if(NOT _GSS_CONFIGURE_FAILED) # 0 means success
|
||||||
|
# should also work in an odd case when multiple directories are given
|
||||||
|
string(STRIP "${_GSS_CFLAGS}" _GSS_CFLAGS)
|
||||||
|
string(REGEX REPLACE " +-I" ";" _GSS_CFLAGS "${_GSS_CFLAGS}")
|
||||||
|
string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1" _GSS_CFLAGS "${_GSS_CFLAGS}")
|
||||||
|
|
||||||
|
foreach(_flag ${_GSS_CFLAGS})
|
||||||
|
if(_flag MATCHES "^-I.*")
|
||||||
|
string(REGEX REPLACE "^-I" "" _val "${_flag}")
|
||||||
|
list(APPEND _GSS_INCLUDE_DIR "${_val}")
|
||||||
|
else()
|
||||||
|
list(APPEND _GSS_COMPILER_FLAGS "${_flag}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--libs" "gssapi"
|
||||||
|
OUTPUT_VARIABLE _GSS_LIB_FLAGS
|
||||||
|
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
message(STATUS "LDFLAGS: ${_GSS_LIB_FLAGS}")
|
||||||
|
|
||||||
|
if(NOT _GSS_CONFIGURE_FAILED) # 0 means success
|
||||||
|
# this script gives us libraries and link directories. Blah. We have to deal with it.
|
||||||
|
string(STRIP "${_GSS_LIB_FLAGS}" _GSS_LIB_FLAGS)
|
||||||
|
string(REGEX REPLACE " +-(L|l)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
||||||
|
string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
||||||
|
|
||||||
|
foreach(_flag ${_GSS_LIB_FLAGS})
|
||||||
|
if(_flag MATCHES "^-l.*")
|
||||||
|
string(REGEX REPLACE "^-l" "" _val "${_flag}")
|
||||||
|
list(APPEND _GSS_LIBRARIES "${_val}")
|
||||||
|
elseif(_flag MATCHES "^-L.*")
|
||||||
|
string(REGEX REPLACE "^-L" "" _val "${_flag}")
|
||||||
|
list(APPEND _GSS_LINK_DIRECTORIES "${_val}")
|
||||||
|
else()
|
||||||
|
list(APPEND _GSS_LINKER_FLAGS "${_flag}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--version"
|
||||||
|
OUTPUT_VARIABLE _GSS_VERSION
|
||||||
|
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
|
# older versions may not have the "--version" parameter. In this case we just don't care.
|
||||||
|
if(_GSS_CONFIGURE_FAILED)
|
||||||
|
set(_GSS_VERSION 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--vendor"
|
||||||
|
OUTPUT_VARIABLE _GSS_VENDOR
|
||||||
|
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
|
# older versions may not have the "--vendor" parameter. In this case we just don't care.
|
||||||
|
if(_GSS_CONFIGURE_FAILED)
|
||||||
|
set(GSS_FLAVOUR "Heimdal") # most probably, shouldn't really matter
|
||||||
|
else()
|
||||||
|
if(_GSS_VENDOR MATCHES ".*H|heimdal.*")
|
||||||
|
set(GSS_FLAVOUR "Heimdal")
|
||||||
|
else()
|
||||||
|
set(GSS_FLAVOUR "MIT")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
else() # either there is no config script or we are on a platform that doesn't provide one (Windows?)
|
||||||
|
|
||||||
|
find_path(_GSS_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
"gssapi/gssapi.h"
|
||||||
|
HINTS
|
||||||
|
${_GSS_ROOT_HINTS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
include
|
||||||
|
inc
|
||||||
|
)
|
||||||
|
|
||||||
|
if(_GSS_INCLUDE_DIR) #jay, we've found something
|
||||||
|
set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIR}")
|
||||||
|
check_include_files( "gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _GSS_HAVE_MIT_HEADERS)
|
||||||
|
|
||||||
|
if(_GSS_HAVE_MIT_HEADERS)
|
||||||
|
set(GSS_FLAVOUR "MIT")
|
||||||
|
else()
|
||||||
|
# prevent compiling the header - just check if we can include it
|
||||||
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__ROKEN_H__)
|
||||||
|
check_include_file( "roken.h" _GSS_HAVE_ROKEN_H)
|
||||||
|
|
||||||
|
check_include_file( "heimdal/roken.h" _GSS_HAVE_HEIMDAL_ROKEN_H)
|
||||||
|
if(_GSS_HAVE_ROKEN_H OR _GSS_HAVE_HEIMDAL_ROKEN_H)
|
||||||
|
set(GSS_FLAVOUR "Heimdal")
|
||||||
|
endif()
|
||||||
|
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D__ROKEN_H__)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# I'm not convinced if this is the right way but this is what autotools do at the moment
|
||||||
|
find_path(_GSS_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
"gssapi.h"
|
||||||
|
HINTS
|
||||||
|
${_GSS_ROOT_HINTS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
include
|
||||||
|
inc
|
||||||
|
)
|
||||||
|
|
||||||
|
if(_GSS_INCLUDE_DIR)
|
||||||
|
set(GSS_FLAVOUR "Heimdal")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# if we have headers, check if we can link libraries
|
||||||
|
if(GSS_FLAVOUR)
|
||||||
|
set(_GSS_LIBDIR_SUFFIXES "")
|
||||||
|
set(_GSS_LIBDIR_HINTS ${_GSS_ROOT_HINTS})
|
||||||
|
get_filename_component(_GSS_CALCULATED_POTENTIAL_ROOT "${_GSS_INCLUDE_DIR}" PATH)
|
||||||
|
list(APPEND _GSS_LIBDIR_HINTS ${_GSS_CALCULATED_POTENTIAL_ROOT})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
list(APPEND _GSS_LIBDIR_SUFFIXES "lib/AMD64")
|
||||||
|
if(GSS_FLAVOUR STREQUAL "MIT")
|
||||||
|
set(_GSS_LIBNAME "gssapi64")
|
||||||
|
else()
|
||||||
|
set(_GSS_LIBNAME "libgssapi")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
list(APPEND _GSS_LIBDIR_SUFFIXES "lib/i386")
|
||||||
|
if(GSS_FLAVOUR STREQUAL "MIT")
|
||||||
|
set(_GSS_LIBNAME "gssapi32")
|
||||||
|
else()
|
||||||
|
set(_GSS_LIBNAME "libgssapi")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
list(APPEND _GSS_LIBDIR_SUFFIXES "lib;lib64") # those suffixes are not checked for HINTS
|
||||||
|
if(GSS_FLAVOUR STREQUAL "MIT")
|
||||||
|
set(_GSS_LIBNAME "gssapi_krb5")
|
||||||
|
else()
|
||||||
|
set(_GSS_LIBNAME "gssapi")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library(_GSS_LIBRARIES
|
||||||
|
NAMES
|
||||||
|
${_GSS_LIBNAME}
|
||||||
|
HINTS
|
||||||
|
${_GSS_LIBDIR_HINTS}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
${_GSS_LIBDIR_SUFFIXES}
|
||||||
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(_GSS_PKG_${_MIT_MODNAME}_VERSION)
|
||||||
|
set(GSS_FLAVOUR "MIT")
|
||||||
|
set(_GSS_VERSION _GSS_PKG_${_MIT_MODNAME}_VERSION)
|
||||||
|
else()
|
||||||
|
set(GSS_FLAVOUR "Heimdal")
|
||||||
|
set(_GSS_VERSION _GSS_PKG_${_MIT_HEIMDAL}_VERSION)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(GSS_INCLUDE_DIR ${_GSS_INCLUDE_DIR})
|
||||||
|
set(GSS_LIBRARIES ${_GSS_LIBRARIES})
|
||||||
|
set(GSS_LINK_DIRECTORIES ${_GSS_LINK_DIRECTORIES})
|
||||||
|
set(GSS_LINKER_FLAGS ${_GSS_LINKER_FLAGS})
|
||||||
|
set(GSS_COMPILER_FLAGS ${_GSS_COMPILER_FLAGS})
|
||||||
|
set(GSS_VERSION ${_GSS_VERSION})
|
||||||
|
|
||||||
|
if(GSS_FLAVOUR)
|
||||||
|
if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal")
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.amd64.manifest")
|
||||||
|
else()
|
||||||
|
set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.x86.manifest")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(EXISTS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}")
|
||||||
|
file(STRINGS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}" heimdal_version_str
|
||||||
|
REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$")
|
||||||
|
|
||||||
|
string(REGEX MATCH "[0-9]\\.[^\"]+"
|
||||||
|
GSS_VERSION "${heimdal_version_str}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT GSS_VERSION)
|
||||||
|
set(GSS_VERSION "Heimdal Unknown")
|
||||||
|
endif()
|
||||||
|
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT")
|
||||||
|
get_filename_component(_MIT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE)
|
||||||
|
if(WIN32 AND _MIT_VERSION)
|
||||||
|
set(GSS_VERSION "${_MIT_VERSION}")
|
||||||
|
else()
|
||||||
|
set(GSS_VERSION "MIT Unknown")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
set(_GSS_REQUIRED_VARS GSS_LIBRARIES GSS_FLAVOUR)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(GSS
|
||||||
|
REQUIRED_VARS
|
||||||
|
${_GSS_REQUIRED_VARS}
|
||||||
|
VERSION_VAR
|
||||||
|
GSS_VERSION
|
||||||
|
FAIL_MESSAGE
|
||||||
|
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
|
||||||
|
)
|
||||||
|
|
||||||
|
mark_as_advanced(GSS_INCLUDE_DIR GSS_LIBRARIES)
|
@ -0,0 +1,45 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# - Try to find the libpsl library
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# LIBPSL_FOUND - system has the libpsl library
|
||||||
|
# LIBPSL_INCLUDE_DIR - the libpsl include directory
|
||||||
|
# LIBPSL_LIBRARY - the libpsl library name
|
||||||
|
|
||||||
|
find_path(LIBPSL_INCLUDE_DIR libpsl.h)
|
||||||
|
|
||||||
|
find_library(LIBPSL_LIBRARY NAMES psl libpsl)
|
||||||
|
|
||||||
|
if(LIBPSL_INCLUDE_DIR)
|
||||||
|
file(STRINGS "${LIBPSL_INCLUDE_DIR}/libpsl.h" libpsl_version_str REGEX "^#define[\t ]+PSL_VERSION[\t ]+\"(.*)\"")
|
||||||
|
string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBPSL_VERSION "${libpsl_version_str}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(LibPSL
|
||||||
|
REQUIRED_VARS LIBPSL_LIBRARY LIBPSL_INCLUDE_DIR
|
||||||
|
VERSION_VAR LIBPSL_VERSION)
|
||||||
|
|
||||||
|
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
|
@ -0,0 +1,45 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# - Try to find the libssh2 library
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# LIBSSH2_FOUND - system has the libssh2 library
|
||||||
|
# LIBSSH2_INCLUDE_DIR - the libssh2 include directory
|
||||||
|
# LIBSSH2_LIBRARY - the libssh2 library name
|
||||||
|
|
||||||
|
find_path(LIBSSH2_INCLUDE_DIR libssh2.h)
|
||||||
|
|
||||||
|
find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2)
|
||||||
|
|
||||||
|
if(LIBSSH2_INCLUDE_DIR)
|
||||||
|
file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" libssh2_version_str REGEX "^#define[\t ]+LIBSSH2_VERSION[\t ]+\"(.*)\"")
|
||||||
|
string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBSSH2_VERSION "${libssh2_version_str}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(LibSSH2
|
||||||
|
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR
|
||||||
|
VERSION_VAR LIBSSH2_VERSION)
|
||||||
|
|
||||||
|
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
|
@ -0,0 +1,70 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#[=======================================================================[.rst:
|
||||||
|
FindMSH3
|
||||||
|
----------
|
||||||
|
|
||||||
|
Find the msh3 library
|
||||||
|
|
||||||
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
``MSH3_FOUND``
|
||||||
|
System has msh3
|
||||||
|
``MSH3_INCLUDE_DIRS``
|
||||||
|
The msh3 include directories.
|
||||||
|
``MSH3_LIBRARIES``
|
||||||
|
The libraries needed to use msh3
|
||||||
|
#]=======================================================================]
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(PC_MSH3 libmsh3)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(MSH3_INCLUDE_DIR msh3.h
|
||||||
|
HINTS
|
||||||
|
${PC_MSH3_INCLUDEDIR}
|
||||||
|
${PC_MSH3_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(MSH3_LIBRARY NAMES msh3
|
||||||
|
HINTS
|
||||||
|
${PC_MSH3_LIBDIR}
|
||||||
|
${PC_MSH3_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(MSH3
|
||||||
|
REQUIRED_VARS
|
||||||
|
MSH3_LIBRARY
|
||||||
|
MSH3_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(MSH3_FOUND)
|
||||||
|
set(MSH3_LIBRARIES ${MSH3_LIBRARY})
|
||||||
|
set(MSH3_INCLUDE_DIRS ${MSH3_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(MSH3_INCLUDE_DIRS MSH3_LIBRARIES)
|
@ -0,0 +1,36 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h)
|
||||||
|
|
||||||
|
find_library(MBEDTLS_LIBRARY mbedtls)
|
||||||
|
find_library(MBEDX509_LIBRARY mbedx509)
|
||||||
|
find_library(MBEDCRYPTO_LIBRARY mbedcrypto)
|
||||||
|
|
||||||
|
set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(MbedTLS DEFAULT_MSG
|
||||||
|
MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
|
||||||
|
|
||||||
|
mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
|
@ -0,0 +1,41 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h")
|
||||||
|
|
||||||
|
find_library(NGHTTP2_LIBRARY NAMES nghttp2)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(NGHTTP2
|
||||||
|
FOUND_VAR
|
||||||
|
NGHTTP2_FOUND
|
||||||
|
REQUIRED_VARS
|
||||||
|
NGHTTP2_LIBRARY
|
||||||
|
NGHTTP2_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
|
||||||
|
set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY})
|
||||||
|
|
||||||
|
mark_as_advanced(NGHTTP2_INCLUDE_DIRS NGHTTP2_LIBRARIES)
|
@ -0,0 +1,78 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#[=======================================================================[.rst:
|
||||||
|
FindNGHTTP3
|
||||||
|
----------
|
||||||
|
|
||||||
|
Find the nghttp3 library
|
||||||
|
|
||||||
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
``NGHTTP3_FOUND``
|
||||||
|
System has nghttp3
|
||||||
|
``NGHTTP3_INCLUDE_DIRS``
|
||||||
|
The nghttp3 include directories.
|
||||||
|
``NGHTTP3_LIBRARIES``
|
||||||
|
The libraries needed to use nghttp3
|
||||||
|
``NGHTTP3_VERSION``
|
||||||
|
version of nghttp3.
|
||||||
|
#]=======================================================================]
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(PC_NGHTTP3 libnghttp3)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(NGHTTP3_INCLUDE_DIR nghttp3/nghttp3.h
|
||||||
|
HINTS
|
||||||
|
${PC_NGHTTP3_INCLUDEDIR}
|
||||||
|
${PC_NGHTTP3_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(NGHTTP3_LIBRARY NAMES nghttp3
|
||||||
|
HINTS
|
||||||
|
${PC_NGHTTP3_LIBDIR}
|
||||||
|
${PC_NGHTTP3_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PC_NGHTTP3_VERSION)
|
||||||
|
set(NGHTTP3_VERSION ${PC_NGHTTP3_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(NGHTTP3
|
||||||
|
REQUIRED_VARS
|
||||||
|
NGHTTP3_LIBRARY
|
||||||
|
NGHTTP3_INCLUDE_DIR
|
||||||
|
VERSION_VAR NGHTTP3_VERSION
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NGHTTP3_FOUND)
|
||||||
|
set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY})
|
||||||
|
set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(NGHTTP3_INCLUDE_DIRS NGHTTP3_LIBRARIES)
|
@ -0,0 +1,115 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#[=======================================================================[.rst:
|
||||||
|
FindNGTCP2
|
||||||
|
----------
|
||||||
|
|
||||||
|
Find the ngtcp2 library
|
||||||
|
|
||||||
|
This module accepts optional COMPONENTS to control the crypto library (these are
|
||||||
|
mutually exclusive)::
|
||||||
|
|
||||||
|
OpenSSL: Use libngtcp2_crypto_openssl
|
||||||
|
GnuTLS: Use libngtcp2_crypto_gnutls
|
||||||
|
|
||||||
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
``NGTCP2_FOUND``
|
||||||
|
System has ngtcp2
|
||||||
|
``NGTCP2_INCLUDE_DIRS``
|
||||||
|
The ngtcp2 include directories.
|
||||||
|
``NGTCP2_LIBRARIES``
|
||||||
|
The libraries needed to use ngtcp2
|
||||||
|
``NGTCP2_VERSION``
|
||||||
|
version of ngtcp2.
|
||||||
|
#]=======================================================================]
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(PC_NGTCP2 libngtcp2)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(NGTCP2_INCLUDE_DIR ngtcp2/ngtcp2.h
|
||||||
|
HINTS
|
||||||
|
${PC_NGTCP2_INCLUDEDIR}
|
||||||
|
${PC_NGTCP2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(NGTCP2_LIBRARY NAMES ngtcp2
|
||||||
|
HINTS
|
||||||
|
${PC_NGTCP2_LIBDIR}
|
||||||
|
${PC_NGTCP2_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PC_NGTCP2_VERSION)
|
||||||
|
set(NGTCP2_VERSION ${PC_NGTCP2_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NGTCP2_FIND_COMPONENTS)
|
||||||
|
set(NGTCP2_CRYPTO_BACKEND "")
|
||||||
|
foreach(component IN LISTS NGTCP2_FIND_COMPONENTS)
|
||||||
|
if(component MATCHES "^(BoringSSL|OpenSSL|wolfSSL|GnuTLS)")
|
||||||
|
if(NGTCP2_CRYPTO_BACKEND)
|
||||||
|
message(FATAL_ERROR "NGTCP2: Only one crypto library can be selected")
|
||||||
|
endif()
|
||||||
|
set(NGTCP2_CRYPTO_BACKEND ${component})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if(NGTCP2_CRYPTO_BACKEND)
|
||||||
|
string(TOLOWER "ngtcp2_crypto_${NGTCP2_CRYPTO_BACKEND}" _crypto_library)
|
||||||
|
if(UNIX)
|
||||||
|
pkg_search_module(PC_${_crypto_library} lib${_crypto_library})
|
||||||
|
endif()
|
||||||
|
find_library(${_crypto_library}_LIBRARY
|
||||||
|
NAMES
|
||||||
|
${_crypto_library}
|
||||||
|
HINTS
|
||||||
|
${PC_${_crypto_library}_LIBDIR}
|
||||||
|
${PC_${_crypto_library}_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
if(${_crypto_library}_LIBRARY)
|
||||||
|
set(NGTCP2_${NGTCP2_CRYPTO_BACKEND}_FOUND TRUE)
|
||||||
|
set(NGTCP2_CRYPTO_LIBRARY ${${_crypto_library}_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(NGTCP2
|
||||||
|
REQUIRED_VARS
|
||||||
|
NGTCP2_LIBRARY
|
||||||
|
NGTCP2_INCLUDE_DIR
|
||||||
|
VERSION_VAR NGTCP2_VERSION
|
||||||
|
HANDLE_COMPONENTS
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NGTCP2_FOUND)
|
||||||
|
set(NGTCP2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
|
||||||
|
set(NGTCP2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(NGTCP2_INCLUDE_DIRS NGTCP2_LIBRARIES)
|
@ -0,0 +1,40 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(PC_NSS nss)
|
||||||
|
endif()
|
||||||
|
if(NOT PC_NSS_FOUND)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(NSS_LIBRARIES ${PC_NSS_LINK_LIBRARIES})
|
||||||
|
set(NSS_INCLUDE_DIRS ${PC_NSS_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(NSS
|
||||||
|
REQUIRED_VARS NSS_LIBRARIES NSS_INCLUDE_DIRS
|
||||||
|
VERSION_VAR PC_NSS_VERSION)
|
||||||
|
|
||||||
|
mark_as_advanced(NSS_INCLUDE_DIRS NSS_LIBRARIES)
|
@ -0,0 +1,70 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#[=======================================================================[.rst:
|
||||||
|
FindQUICHE
|
||||||
|
----------
|
||||||
|
|
||||||
|
Find the quiche library
|
||||||
|
|
||||||
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
``QUICHE_FOUND``
|
||||||
|
System has quiche
|
||||||
|
``QUICHE_INCLUDE_DIRS``
|
||||||
|
The quiche include directories.
|
||||||
|
``QUICHE_LIBRARIES``
|
||||||
|
The libraries needed to use quiche
|
||||||
|
#]=======================================================================]
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(PC_QUICHE quiche)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(QUICHE_INCLUDE_DIR quiche.h
|
||||||
|
HINTS
|
||||||
|
${PC_QUICHE_INCLUDEDIR}
|
||||||
|
${PC_QUICHE_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(QUICHE_LIBRARY NAMES quiche
|
||||||
|
HINTS
|
||||||
|
${PC_QUICHE_LIBDIR}
|
||||||
|
${PC_QUICHE_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(QUICHE
|
||||||
|
REQUIRED_VARS
|
||||||
|
QUICHE_LIBRARY
|
||||||
|
QUICHE_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(QUICHE_FOUND)
|
||||||
|
set(QUICHE_LIBRARIES ${QUICHE_LIBRARY})
|
||||||
|
set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(QUICHE_INCLUDE_DIRS QUICHE_LIBRARIES)
|
@ -0,0 +1,36 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
find_path(WolfSSL_INCLUDE_DIR NAMES wolfssl/ssl.h)
|
||||||
|
find_library(WolfSSL_LIBRARY NAMES wolfssl)
|
||||||
|
mark_as_advanced(WolfSSL_INCLUDE_DIR WolfSSL_LIBRARY)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(WolfSSL
|
||||||
|
REQUIRED_VARS WolfSSL_INCLUDE_DIR WolfSSL_LIBRARY
|
||||||
|
)
|
||||||
|
|
||||||
|
if(WolfSSL_FOUND)
|
||||||
|
set(WolfSSL_INCLUDE_DIRS ${WolfSSL_INCLUDE_DIR})
|
||||||
|
set(WolfSSL_LIBRARIES ${WolfSSL_LIBRARY})
|
||||||
|
endif()
|
@ -0,0 +1,71 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#[=======================================================================[.rst:
|
||||||
|
FindZstd
|
||||||
|
----------
|
||||||
|
|
||||||
|
Find the zstd library
|
||||||
|
|
||||||
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
``Zstd_FOUND``
|
||||||
|
System has zstd
|
||||||
|
``Zstd_INCLUDE_DIRS``
|
||||||
|
The zstd include directories.
|
||||||
|
``Zstd_LIBRARIES``
|
||||||
|
The libraries needed to use zstd
|
||||||
|
#]=======================================================================]
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(PC_Zstd libzstd)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(Zstd_INCLUDE_DIR zstd.h
|
||||||
|
HINTS
|
||||||
|
${PC_Zstd_INCLUDEDIR}
|
||||||
|
${PC_Zstd_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(Zstd_LIBRARY NAMES zstd
|
||||||
|
HINTS
|
||||||
|
${PC_Zstd_LIBDIR}
|
||||||
|
${PC_Zstd_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Zstd
|
||||||
|
REQUIRED_VARS
|
||||||
|
Zstd_LIBRARY
|
||||||
|
Zstd_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(Zstd_FOUND)
|
||||||
|
set(Zstd_LIBRARIES ${Zstd_LIBRARY})
|
||||||
|
set(Zstd_INCLUDE_DIRS ${Zstd_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(Zstd_INCLUDE_DIRS Zstd_LIBRARIES)
|
@ -0,0 +1,122 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
#File defines convenience macros for available feature testing
|
||||||
|
|
||||||
|
# This macro checks if the symbol exists in the library and if it
|
||||||
|
# does, it prepends library to the list. It is intended to be called
|
||||||
|
# multiple times with a sequence of possibly dependent libraries in
|
||||||
|
# order of least-to-most-dependent. Some libraries depend on others
|
||||||
|
# to link correctly.
|
||||||
|
macro(check_library_exists_concat LIBRARY SYMBOL VARIABLE)
|
||||||
|
check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}"
|
||||||
|
${VARIABLE})
|
||||||
|
if(${VARIABLE})
|
||||||
|
set(CURL_LIBS ${LIBRARY} ${CURL_LIBS})
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Check if header file exists and add it to the list.
|
||||||
|
# This macro is intended to be called multiple times with a sequence of
|
||||||
|
# possibly dependent header files. Some headers depend on others to be
|
||||||
|
# compiled correctly.
|
||||||
|
macro(check_include_file_concat FILE VARIABLE)
|
||||||
|
check_include_files("${CURL_INCLUDES};${FILE}" ${VARIABLE})
|
||||||
|
if(${VARIABLE})
|
||||||
|
set(CURL_INCLUDES ${CURL_INCLUDES} ${FILE})
|
||||||
|
set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# For other curl specific tests, use this macro.
|
||||||
|
macro(curl_internal_test CURL_TEST)
|
||||||
|
if(NOT DEFINED "${CURL_TEST}")
|
||||||
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
|
"-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CURL_TEST_ADD_LIBRARIES
|
||||||
|
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST}")
|
||||||
|
try_compile(${CURL_TEST}
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
|
||||||
|
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||||
|
"${CURL_TEST_ADD_LIBRARIES}"
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
if(${CURL_TEST})
|
||||||
|
set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST} - Success")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
"Performing Curl Test ${CURL_TEST} passed with the following output:\n"
|
||||||
|
"${OUTPUT}\n")
|
||||||
|
else()
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
|
||||||
|
set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
|
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||||
|
"${OUTPUT}\n")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(curl_nroff_check)
|
||||||
|
find_program(NROFF NAMES gnroff nroff)
|
||||||
|
if(NROFF)
|
||||||
|
# Need a way to write to stdin, this will do
|
||||||
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt" "test")
|
||||||
|
# Tests for a valid nroff option to generate a manpage
|
||||||
|
foreach(_MANOPT "-man" "-mandoc")
|
||||||
|
execute_process(COMMAND "${NROFF}" ${_MANOPT}
|
||||||
|
OUTPUT_VARIABLE NROFF_MANOPT_OUTPUT
|
||||||
|
INPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt"
|
||||||
|
ERROR_QUIET)
|
||||||
|
# Save the option if it was valid
|
||||||
|
if(NROFF_MANOPT_OUTPUT)
|
||||||
|
message("Found *nroff option: -- ${_MANOPT}")
|
||||||
|
set(NROFF_MANOPT ${_MANOPT})
|
||||||
|
set(NROFF_USEFUL ON)
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
# No need for the temporary file
|
||||||
|
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt")
|
||||||
|
if(NOT NROFF_USEFUL)
|
||||||
|
message(WARNING "Found no *nroff option to get plaintext from man pages")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(WARNING "Found no *nroff program")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(optional_dependency DEPENDENCY)
|
||||||
|
set(CURL_${DEPENDENCY} AUTO CACHE STRING "Build curl with ${DEPENDENCY} support (AUTO, ON or OFF)")
|
||||||
|
set_property(CACHE CURL_${DEPENDENCY} PROPERTY STRINGS AUTO ON OFF)
|
||||||
|
|
||||||
|
if(CURL_${DEPENDENCY} STREQUAL AUTO)
|
||||||
|
find_package(${DEPENDENCY})
|
||||||
|
elseif(CURL_${DEPENDENCY})
|
||||||
|
find_package(${DEPENDENCY} REQUIRED)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
@ -0,0 +1,136 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
# The begin of the sources (macros and includes)
|
||||||
|
set(_source_epilogue "#undef inline")
|
||||||
|
|
||||||
|
macro(add_header_include check header)
|
||||||
|
if(${check})
|
||||||
|
set(_source_epilogue "${_source_epilogue}\n#include <${header}>")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
set(signature_call_conv)
|
||||||
|
if(HAVE_WINDOWS_H)
|
||||||
|
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||||
|
add_header_include(HAVE_WINDOWS_H "windows.h")
|
||||||
|
set(_source_epilogue
|
||||||
|
"${_source_epilogue}\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif")
|
||||||
|
set(signature_call_conv "PASCAL")
|
||||||
|
if(HAVE_LIBWS2_32)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||||
|
add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
|
|
||||||
|
check_c_source_compiles("${_source_epilogue}
|
||||||
|
int main(void) {
|
||||||
|
int flag = MSG_NOSIGNAL;
|
||||||
|
(void)flag;
|
||||||
|
return 0;
|
||||||
|
}" HAVE_MSG_NOSIGNAL)
|
||||||
|
|
||||||
|
if(NOT HAVE_WINDOWS_H)
|
||||||
|
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
|
||||||
|
add_header_include(TIME_WITH_SYS_TIME "time.h")
|
||||||
|
add_header_include(HAVE_TIME_H "time.h")
|
||||||
|
endif()
|
||||||
|
check_c_source_compiles("${_source_epilogue}
|
||||||
|
int main(void) {
|
||||||
|
struct timeval ts;
|
||||||
|
ts.tv_sec = 0;
|
||||||
|
ts.tv_usec = 0;
|
||||||
|
(void)ts;
|
||||||
|
return 0;
|
||||||
|
}" HAVE_STRUCT_TIMEVAL)
|
||||||
|
|
||||||
|
if(HAVE_WINDOWS_H)
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h)
|
||||||
|
else()
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES)
|
||||||
|
if(HAVE_SYS_SOCKET_H)
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||||
|
if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||||
|
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
|
||||||
|
|
||||||
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "iOS")
|
||||||
|
# only try this on non-apple platforms
|
||||||
|
|
||||||
|
# if not cross-compilation...
|
||||||
|
include(CheckCSourceRuns)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "")
|
||||||
|
if(HAVE_SYS_POLL_H)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "-DHAVE_SYS_POLL_H")
|
||||||
|
elseif(HAVE_POLL_H)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "-DHAVE_POLL_H")
|
||||||
|
endif()
|
||||||
|
check_c_source_runs("
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_POLL_H
|
||||||
|
# include <sys/poll.h>
|
||||||
|
#elif HAVE_POLL_H
|
||||||
|
# include <poll.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
if(0 != poll(0, 0, 10)) {
|
||||||
|
return 1; /* fail */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* detect the 10.12 poll() breakage */
|
||||||
|
struct timeval before, after;
|
||||||
|
int rc;
|
||||||
|
size_t us;
|
||||||
|
|
||||||
|
gettimeofday(&before, NULL);
|
||||||
|
rc = poll(NULL, 0, 500);
|
||||||
|
gettimeofday(&after, NULL);
|
||||||
|
|
||||||
|
us = (after.tv_sec - before.tv_sec) * 1000000 +
|
||||||
|
(after.tv_usec - before.tv_usec);
|
||||||
|
|
||||||
|
if(us < 400000) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}" HAVE_POLL_FINE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
@ -0,0 +1,197 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
include(CheckCCompilerFlag)
|
||||||
|
|
||||||
|
if(PICKY_COMPILER)
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
|
||||||
|
# https://clang.llvm.org/docs/DiagnosticsReference.html
|
||||||
|
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||||
|
|
||||||
|
# WPICKY_ENABLE = Options we want to enable as-is.
|
||||||
|
# WPICKY_DETECT = Options we want to test first and enable if available.
|
||||||
|
|
||||||
|
# Prefer the -Wextra alias with clang.
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
set(WPICKY_ENABLE "-Wextra")
|
||||||
|
else()
|
||||||
|
set(WPICKY_ENABLE "-W")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Wall -pedantic
|
||||||
|
)
|
||||||
|
|
||||||
|
# ----------------------------------
|
||||||
|
# Add new options here, if in doubt:
|
||||||
|
# ----------------------------------
|
||||||
|
set(WPICKY_DETECT
|
||||||
|
)
|
||||||
|
|
||||||
|
# Assume these options always exist with both clang and gcc.
|
||||||
|
# Require clang 3.0 / gcc 2.95 or later.
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Wbad-function-cast # clang 3.0 gcc 2.95
|
||||||
|
-Wconversion # clang 3.0 gcc 2.95
|
||||||
|
-Winline # clang 1.0 gcc 1.0
|
||||||
|
-Wmissing-declarations # clang 1.0 gcc 2.7
|
||||||
|
-Wmissing-prototypes # clang 1.0 gcc 1.0
|
||||||
|
-Wnested-externs # clang 1.0 gcc 2.7
|
||||||
|
-Wno-long-long # clang 1.0 gcc 2.95
|
||||||
|
-Wno-multichar # clang 1.0 gcc 2.95
|
||||||
|
-Wpointer-arith # clang 1.0 gcc 1.4
|
||||||
|
-Wshadow # clang 1.0 gcc 2.95
|
||||||
|
-Wsign-compare # clang 1.0 gcc 2.95
|
||||||
|
-Wundef # clang 1.0 gcc 2.95
|
||||||
|
-Wunused # clang 1.1 gcc 2.95
|
||||||
|
-Wwrite-strings # clang 1.0 gcc 1.4
|
||||||
|
)
|
||||||
|
|
||||||
|
# Always enable with clang, version dependent with gcc
|
||||||
|
set(WPICKY_COMMON_OLD
|
||||||
|
-Wcast-align # clang 1.0 gcc 4.2
|
||||||
|
-Wdeclaration-after-statement # clang 1.0 gcc 3.4
|
||||||
|
-Wempty-body # clang 3.0 gcc 4.3
|
||||||
|
-Wendif-labels # clang 1.0 gcc 3.3
|
||||||
|
-Wfloat-equal # clang 1.0 gcc 2.96 (3.0)
|
||||||
|
-Wignored-qualifiers # clang 3.0 gcc 4.3
|
||||||
|
-Wno-format-nonliteral # clang 1.0 gcc 2.96 (3.0)
|
||||||
|
-Wno-sign-conversion # clang 3.0 gcc 4.3
|
||||||
|
-Wno-system-headers # clang 1.0 gcc 3.0
|
||||||
|
-Wstrict-prototypes # clang 1.0 gcc 3.3
|
||||||
|
-Wtype-limits # clang 3.0 gcc 4.3
|
||||||
|
-Wvla # clang 2.8 gcc 4.3
|
||||||
|
)
|
||||||
|
|
||||||
|
set(WPICKY_COMMON
|
||||||
|
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3
|
||||||
|
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0
|
||||||
|
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
${WPICKY_COMMON_OLD}
|
||||||
|
-Wshift-sign-overflow # clang 2.9
|
||||||
|
-Wshorten-64-to-32 # clang 1.0
|
||||||
|
)
|
||||||
|
# Enable based on compiler version
|
||||||
|
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6) OR
|
||||||
|
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.3))
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
${WPICKY_COMMON}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.9) OR
|
||||||
|
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.3))
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Wcomma # clang 3.9 appleclang 8.3
|
||||||
|
-Wmissing-variable-declarations # clang 3.2 appleclang 4.6
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) OR
|
||||||
|
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.3))
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Wassign-enum # clang 7.0 appleclang 10.3
|
||||||
|
-Wextra-semi-stmt # clang 7.0 appleclang 10.3
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
else() # gcc
|
||||||
|
list(APPEND WPICKY_DETECT
|
||||||
|
${WPICKY_COMMON}
|
||||||
|
)
|
||||||
|
# Enable based on compiler version
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3)
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
${WPICKY_COMMON_OLD}
|
||||||
|
-Wmissing-parameter-type # gcc 4.3
|
||||||
|
-Wold-style-declaration # gcc 4.3
|
||||||
|
-Wstrict-aliasing=3 # gcc 4.0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND MINGW)
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Wno-pedantic-ms-format # gcc 4.5 (mingw-only)
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Wformat=2 # clang 3.0 gcc 4.8 (clang part-default, enabling it fully causes -Wformat-nonliteral warnings)
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Warray-bounds=2 -ftree-vrp # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Wduplicated-cond # gcc 6.0
|
||||||
|
-Wnull-dereference # clang 3.0 gcc 6.0 (clang default)
|
||||||
|
-fdelete-null-pointer-checks
|
||||||
|
-Wshift-negative-value # clang 3.7 gcc 6.0 (clang default)
|
||||||
|
-Wshift-overflow=2 # clang 3.0 gcc 6.0 (clang default: -Wshift-overflow)
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Walloc-zero # gcc 7.0
|
||||||
|
-Wduplicated-branches # gcc 7.0
|
||||||
|
-Wformat-overflow=2 # gcc 7.0
|
||||||
|
-Wformat-truncation=1 # gcc 7.0
|
||||||
|
-Wrestrict # gcc 7.0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0)
|
||||||
|
list(APPEND WPICKY_ENABLE
|
||||||
|
-Warith-conversion # gcc 10.0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
unset(WPICKY)
|
||||||
|
|
||||||
|
foreach(_CCOPT ${WPICKY_ENABLE})
|
||||||
|
set(WPICKY "${WPICKY} ${_CCOPT}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
foreach(_CCOPT ${WPICKY_DETECT})
|
||||||
|
# surprisingly, CHECK_C_COMPILER_FLAG needs a new variable to store each new
|
||||||
|
# test result in.
|
||||||
|
string(MAKE_C_IDENTIFIER "OPT${_CCOPT}" _optvarname)
|
||||||
|
# GCC only warns about unknown -Wno- options if there are also other diagnostic messages,
|
||||||
|
# so test for the positive form instead
|
||||||
|
string(REPLACE "-Wno-" "-W" _CCOPT_ON "${_CCOPT}")
|
||||||
|
check_c_compiler_flag(${_CCOPT_ON} ${_optvarname})
|
||||||
|
if(${_optvarname})
|
||||||
|
set(WPICKY "${WPICKY} ${_CCOPT}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
message(STATUS "Picky compiler options:${WPICKY}")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WPICKY}")
|
||||||
|
endif()
|
||||||
|
endif()
|
@ -0,0 +1,91 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
if(NOT UNIX)
|
||||||
|
if(WIN32)
|
||||||
|
set(HAVE_LIBSOCKET 0)
|
||||||
|
set(HAVE_GETHOSTNAME 1)
|
||||||
|
set(HAVE_LIBZ 0)
|
||||||
|
|
||||||
|
set(HAVE_ARPA_INET_H 0)
|
||||||
|
set(HAVE_FCNTL_H 1)
|
||||||
|
set(HAVE_IO_H 1)
|
||||||
|
set(HAVE_NETDB_H 0)
|
||||||
|
set(HAVE_NETINET_IN_H 0)
|
||||||
|
set(HAVE_NET_IF_H 0)
|
||||||
|
set(HAVE_PWD_H 0)
|
||||||
|
set(HAVE_SETJMP_H 1)
|
||||||
|
set(HAVE_SIGNAL_H 1)
|
||||||
|
set(HAVE_STDLIB_H 1)
|
||||||
|
set(HAVE_STRINGS_H 0)
|
||||||
|
set(HAVE_STRING_H 1)
|
||||||
|
set(HAVE_SYS_PARAM_H 0)
|
||||||
|
set(HAVE_SYS_POLL_H 0)
|
||||||
|
set(HAVE_SYS_SELECT_H 0)
|
||||||
|
set(HAVE_SYS_SOCKET_H 0)
|
||||||
|
set(HAVE_SYS_SOCKIO_H 0)
|
||||||
|
set(HAVE_SYS_STAT_H 1)
|
||||||
|
set(HAVE_SYS_TIME_H 0)
|
||||||
|
set(HAVE_SYS_TYPES_H 1)
|
||||||
|
set(HAVE_SYS_UTIME_H 1)
|
||||||
|
set(HAVE_TERMIOS_H 0)
|
||||||
|
set(HAVE_TERMIO_H 0)
|
||||||
|
set(HAVE_TIME_H 1)
|
||||||
|
set(HAVE_UTIME_H 0)
|
||||||
|
|
||||||
|
set(HAVE_SOCKET 1)
|
||||||
|
set(HAVE_SELECT 1)
|
||||||
|
set(HAVE_STRDUP 1)
|
||||||
|
set(HAVE_STRICMP 1)
|
||||||
|
set(HAVE_STRCMPI 1)
|
||||||
|
set(HAVE_GETTIMEOFDAY 0)
|
||||||
|
set(HAVE_CLOSESOCKET 1)
|
||||||
|
set(HAVE_SIGSETJMP 0)
|
||||||
|
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
|
||||||
|
set(HAVE_GETPASS_R 0)
|
||||||
|
set(HAVE_GETPWUID 0)
|
||||||
|
set(HAVE_GETEUID 0)
|
||||||
|
set(HAVE_UTIME 1)
|
||||||
|
set(HAVE_RAND_EGD 0)
|
||||||
|
set(HAVE_GMTIME_R 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R 0)
|
||||||
|
set(HAVE_SIGNAL 1)
|
||||||
|
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_3 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_5 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_6 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
|
||||||
|
|
||||||
|
set(TIME_WITH_SYS_TIME 0)
|
||||||
|
set(HAVE_O_NONBLOCK 0)
|
||||||
|
set(HAVE_IN_ADDR_T 0)
|
||||||
|
set(STDC_HEADERS 1)
|
||||||
|
|
||||||
|
set(HAVE_SIGACTION 0)
|
||||||
|
set(HAVE_MACRO_SIGSETJMP 0)
|
||||||
|
else()
|
||||||
|
message("This file should be included on Windows platform only")
|
||||||
|
endif()
|
||||||
|
endif()
|
@ -0,0 +1,35 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# File containing various utilities
|
||||||
|
|
||||||
|
# Returns a list of arguments that evaluate to true
|
||||||
|
function(count_true output_count_var)
|
||||||
|
set(lst_len 0)
|
||||||
|
foreach(option_var IN LISTS ARGN)
|
||||||
|
if(${option_var})
|
||||||
|
math(EXPR lst_len "${lst_len} + 1")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${output_count_var} ${lst_len} PARENT_SCOPE)
|
||||||
|
endfunction()
|
@ -0,0 +1,49 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||||
|
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
|
||||||
|
endif()
|
||||||
|
message(${CMAKE_INSTALL_PREFIX})
|
||||||
|
|
||||||
|
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||||
|
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||||
|
foreach(file ${files})
|
||||||
|
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||||
|
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||||
|
exec_program(
|
||||||
|
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||||
|
OUTPUT_VARIABLE rm_out
|
||||||
|
RETURN_VALUE rm_retval
|
||||||
|
)
|
||||||
|
if(NOT "${rm_retval}" STREQUAL 0)
|
||||||
|
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
@ -0,0 +1,35 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include(CMakeFindDependencyMacro)
|
||||||
|
if(@USE_OPENSSL@)
|
||||||
|
find_dependency(OpenSSL @OPENSSL_VERSION_MAJOR@)
|
||||||
|
endif()
|
||||||
|
if(@USE_ZLIB@)
|
||||||
|
find_dependency(ZLIB @ZLIB_VERSION_MAJOR@)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||||
|
check_required_components("@PROJECT_NAME@")
|
@ -0,0 +1,22 @@
|
|||||||
|
COPYRIGHT AND PERMISSION NOTICE
|
||||||
|
|
||||||
|
Copyright (c) 1996 - 2023, Daniel Stenberg, <daniel@haxx.se>, and many
|
||||||
|
contributors, see the THANKS file.
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and distribute this software for any purpose
|
||||||
|
with or without fee is hereby granted, provided that the above copyright
|
||||||
|
notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
|
||||||
|
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
||||||
|
OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of a copyright holder shall not
|
||||||
|
be used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
|
in this Software without prior written authorization of the copyright holder.
|
@ -0,0 +1,160 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# This script performs all of the steps needed to build a
|
||||||
|
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
|
||||||
|
#
|
||||||
|
# Hendrik Visage:
|
||||||
|
# Generalizations added since Snowleopard (10.6) do not include
|
||||||
|
# the 10.4u SDK.
|
||||||
|
#
|
||||||
|
# Also note:
|
||||||
|
# 10.5 is the *ONLY* SDK that support PPC64 :( -- 10.6 do not have ppc64 support
|
||||||
|
#If you need to have PPC64 support then change below to 1
|
||||||
|
PPC64_NEEDED=0
|
||||||
|
# Apple does not support building for PPC anymore in Xcode 4 and later.
|
||||||
|
# If you're using Xcode 3 or earlier and need PPC support, then change
|
||||||
|
# the setting below to 1
|
||||||
|
PPC_NEEDED=0
|
||||||
|
|
||||||
|
# For me the default is to develop for the platform I am on, and if you
|
||||||
|
#desire compatibility with older versions then change USE_OLD to 1 :)
|
||||||
|
USE_OLD=0
|
||||||
|
|
||||||
|
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
|
||||||
|
FRAMEWORK_VERSION=Versions/Release-$VERSION
|
||||||
|
|
||||||
|
#I also wanted to "copy over" the system, and thus the reason I added the
|
||||||
|
# version to Versions/Release-7.20.1 etc.
|
||||||
|
# now a simple rsync -vaP libcurl.framework /Library/Frameworks will install it
|
||||||
|
# and setup the right paths to this version, leaving the system version
|
||||||
|
# "intact", so you can "fix" it later with the links to Versions/A/...
|
||||||
|
|
||||||
|
DEVELOPER_PATH=`xcode-select --print-path`
|
||||||
|
# Around Xcode 4.3, SDKs were moved from the Developer folder into the
|
||||||
|
# MacOSX.platform folder
|
||||||
|
if test -d "$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs"; then
|
||||||
|
SDK_PATH="$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs"
|
||||||
|
else
|
||||||
|
SDK_PATH="$DEVELOPER_PATH/SDKs"
|
||||||
|
fi
|
||||||
|
OLD_SDK=`ls $SDK_PATH|head -1`
|
||||||
|
NEW_SDK=`ls -r $SDK_PATH|head -1`
|
||||||
|
|
||||||
|
if test "0"$USE_OLD -gt 0
|
||||||
|
then
|
||||||
|
SDK32=$OLD_SDK
|
||||||
|
else
|
||||||
|
SDK32=$NEW_SDK
|
||||||
|
fi
|
||||||
|
|
||||||
|
MACVER=`echo $SDK32|sed -e s/[a-zA-Z]//g -e s/.\$//`
|
||||||
|
|
||||||
|
SDK32_DIR=$SDK_PATH/$SDK32
|
||||||
|
MINVER32='-mmacosx-version-min='$MACVER
|
||||||
|
if test $PPC_NEEDED -gt 0; then
|
||||||
|
ARCHES32='-arch i386 -arch ppc'
|
||||||
|
else
|
||||||
|
ARCHES32='-arch i386'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $PPC64_NEEDED -gt 0
|
||||||
|
then
|
||||||
|
SDK64=10.5
|
||||||
|
ARCHES64='-arch x86_64 -arch ppc64'
|
||||||
|
SDK64=`ls $SDK_PATH | grep "10\.5" | head -1`
|
||||||
|
else
|
||||||
|
ARCHES64='-arch x86_64'
|
||||||
|
#We "know" that 10.4 and earlier do not support 64bit
|
||||||
|
OLD_SDK64=`ls $SDK_PATH | grep -v "10\.[0-4]" | head -1`
|
||||||
|
NEW_SDK64=`ls -r $SDK_PATH | grep -v "10\.[0-4][^0-9]" | head -1`
|
||||||
|
if test $USE_OLD -gt 0
|
||||||
|
then
|
||||||
|
SDK64=$OLD_SDK64
|
||||||
|
else
|
||||||
|
SDK64=$NEW_SDK64
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
SDK64_DIR=$SDK_PATH/$SDK64
|
||||||
|
MACVER64=`echo $SDK64|sed -e s/[a-zA-Z]//g -e s/.\$//`
|
||||||
|
|
||||||
|
MINVER64='-mmacosx-version-min='$MACVER64
|
||||||
|
|
||||||
|
if test ! -z $SDK32; then
|
||||||
|
echo "----Configuring libcurl for 32 bit universal framework..."
|
||||||
|
make clean
|
||||||
|
./configure --disable-dependency-tracking --disable-static --with-gssapi --with-secure-transport \
|
||||||
|
CFLAGS="-Os -isysroot $SDK32_DIR $ARCHES32" \
|
||||||
|
LDFLAGS="-Wl,-syslibroot,$SDK32_DIR $ARCHES32 -Wl,-headerpad_max_install_names" \
|
||||||
|
CC=$CC
|
||||||
|
|
||||||
|
echo "----Building 32 bit libcurl..."
|
||||||
|
make -j `sysctl -n hw.logicalcpu_max`
|
||||||
|
|
||||||
|
echo "----Creating 32 bit framework..."
|
||||||
|
rm -r libcurl.framework
|
||||||
|
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources
|
||||||
|
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
|
install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
|
cp lib/libcurl.plist libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist
|
||||||
|
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||||
|
cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||||
|
pushd libcurl.framework
|
||||||
|
ln -fs ${FRAMEWORK_VERSION}/libcurl libcurl
|
||||||
|
ln -fs ${FRAMEWORK_VERSION}/Resources Resources
|
||||||
|
ln -fs ${FRAMEWORK_VERSION}/Headers Headers
|
||||||
|
cd Versions
|
||||||
|
ln -fs $(basename "${FRAMEWORK_VERSION}") Current
|
||||||
|
|
||||||
|
echo Testing for SDK64
|
||||||
|
if test -d $SDK64_DIR; then
|
||||||
|
echo entering...
|
||||||
|
popd
|
||||||
|
make clean
|
||||||
|
echo "----Configuring libcurl for 64 bit universal framework..."
|
||||||
|
./configure --disable-dependency-tracking --disable-static --with-gssapi --with-secure-transport \
|
||||||
|
CFLAGS="-Os -isysroot $SDK64_DIR $ARCHES64" \
|
||||||
|
LDFLAGS="-Wl,-syslibroot,$SDK64_DIR $ARCHES64 -Wl,-headerpad_max_install_names" \
|
||||||
|
CC=$CC
|
||||||
|
|
||||||
|
echo "----Building 64 bit libcurl..."
|
||||||
|
make -j `sysctl -n hw.logicalcpu_max`
|
||||||
|
|
||||||
|
echo "----Appending 64 bit framework to 32 bit framework..."
|
||||||
|
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||||
|
install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||||
|
cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32
|
||||||
|
pwd
|
||||||
|
lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
|
rm libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||||
|
fi
|
||||||
|
|
||||||
|
pwd
|
||||||
|
lipo -info libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
|
echo "libcurl.framework is built and can now be included in other projects."
|
||||||
|
echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
|
||||||
|
else
|
||||||
|
echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4/5/6 SDK installed."
|
||||||
|
fi
|
@ -0,0 +1,92 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
all:
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
|
||||||
|
ssl:
|
||||||
|
./configure --with-openssl
|
||||||
|
make
|
||||||
|
|
||||||
|
mingw32:
|
||||||
|
$(MAKE) -C lib -f Makefile.mk
|
||||||
|
$(MAKE) -C src -f Makefile.mk
|
||||||
|
|
||||||
|
mingw32-clean:
|
||||||
|
$(MAKE) -C lib -f Makefile.mk clean
|
||||||
|
$(MAKE) -C src -f Makefile.mk clean
|
||||||
|
$(MAKE) -C docs/examples -f Makefile.mk clean
|
||||||
|
|
||||||
|
mingw32-vclean mingw32-distclean:
|
||||||
|
$(MAKE) -C lib -f Makefile.mk vclean
|
||||||
|
$(MAKE) -C src -f Makefile.mk vclean
|
||||||
|
$(MAKE) -C docs/examples -f Makefile.mk vclean
|
||||||
|
|
||||||
|
mingw32-examples%:
|
||||||
|
$(MAKE) -C docs/examples -f Makefile.mk CFG=$@
|
||||||
|
|
||||||
|
mingw32%:
|
||||||
|
$(MAKE) -C lib -f Makefile.mk CFG=$@
|
||||||
|
$(MAKE) -C src -f Makefile.mk CFG=$@
|
||||||
|
|
||||||
|
vc:
|
||||||
|
cd winbuild
|
||||||
|
nmake /f Makefile.vc MACHINE=x86
|
||||||
|
|
||||||
|
vc-x64:
|
||||||
|
cd winbuild
|
||||||
|
nmake /f Makefile.vc MACHINE=x64
|
||||||
|
|
||||||
|
djgpp%:
|
||||||
|
$(MAKE) -C lib -f Makefile.mk CFG=$@ CROSSPREFIX=i586-pc-msdosdjgpp-
|
||||||
|
$(MAKE) -C src -f Makefile.mk CFG=$@ CROSSPREFIX=i586-pc-msdosdjgpp-
|
||||||
|
|
||||||
|
cygwin:
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
|
||||||
|
cygwin-ssl:
|
||||||
|
./configure --with-openssl
|
||||||
|
make
|
||||||
|
|
||||||
|
amiga%:
|
||||||
|
$(MAKE) -C lib -f Makefile.mk CFG=$@ CROSSPREFIX=m68k-amigaos-
|
||||||
|
$(MAKE) -C src -f Makefile.mk CFG=$@ CROSSPREFIX=m68k-amigaos-
|
||||||
|
|
||||||
|
unix: all
|
||||||
|
|
||||||
|
unix-ssl: ssl
|
||||||
|
|
||||||
|
linux: all
|
||||||
|
|
||||||
|
linux-ssl: ssl
|
||||||
|
|
||||||
|
ca-bundle: scripts/mk-ca-bundle.pl
|
||||||
|
@echo "generate a fresh ca-bundle.crt"
|
||||||
|
@perl $< -b -l -u lib/ca-bundle.crt
|
||||||
|
|
||||||
|
ca-firefox: lib/firefox-db2pem.sh
|
||||||
|
@echo "generate a fresh ca-bundle.crt"
|
||||||
|
./lib/firefox-db2pem.sh lib/ca-bundle.crt
|
@ -0,0 +1,614 @@
|
|||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = foreign
|
||||||
|
|
||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
|
CMAKE_DIST = \
|
||||||
|
CMake/cmake_uninstall.cmake.in \
|
||||||
|
CMake/CMakeConfigurableFile.in \
|
||||||
|
CMake/curl-config.cmake.in \
|
||||||
|
CMake/CurlSymbolHiding.cmake \
|
||||||
|
CMake/CurlTests.c \
|
||||||
|
CMake/FindBearSSL.cmake \
|
||||||
|
CMake/FindBrotli.cmake \
|
||||||
|
CMake/FindCARES.cmake \
|
||||||
|
CMake/FindGSS.cmake \
|
||||||
|
CMake/FindLibPSL.cmake \
|
||||||
|
CMake/FindLibSSH2.cmake \
|
||||||
|
CMake/FindMbedTLS.cmake \
|
||||||
|
CMake/FindMSH3.cmake \
|
||||||
|
CMake/FindNGHTTP2.cmake \
|
||||||
|
CMake/FindNGHTTP3.cmake \
|
||||||
|
CMake/FindNGTCP2.cmake \
|
||||||
|
CMake/FindNSS.cmake \
|
||||||
|
CMake/FindQUICHE.cmake \
|
||||||
|
CMake/FindWolfSSL.cmake \
|
||||||
|
CMake/FindZstd.cmake \
|
||||||
|
CMake/Macros.cmake \
|
||||||
|
CMake/OtherTests.cmake \
|
||||||
|
CMake/PickyWarnings.cmake \
|
||||||
|
CMake/Platforms/WindowsCache.cmake \
|
||||||
|
CMake/Utilities.cmake \
|
||||||
|
CMakeLists.txt
|
||||||
|
|
||||||
|
VC10_LIBTMPL = projects/Windows/VC10/lib/libcurl.tmpl
|
||||||
|
VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj.dist
|
||||||
|
VC10_LIBVCXPROJ_DEPS = $(VC10_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||||
|
VC10_SRCTMPL = projects/Windows/VC10/src/curl.tmpl
|
||||||
|
VC10_SRCVCXPROJ = projects/Windows/VC10/src/curl.vcxproj.dist
|
||||||
|
VC10_SRCVCXPROJ_DEPS = $(VC10_SRCTMPL) Makefile.am src/Makefile.inc
|
||||||
|
|
||||||
|
VC11_LIBTMPL = projects/Windows/VC11/lib/libcurl.tmpl
|
||||||
|
VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj.dist
|
||||||
|
VC11_LIBVCXPROJ_DEPS = $(VC11_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||||
|
VC11_SRCTMPL = projects/Windows/VC11/src/curl.tmpl
|
||||||
|
VC11_SRCVCXPROJ = projects/Windows/VC11/src/curl.vcxproj.dist
|
||||||
|
VC11_SRCVCXPROJ_DEPS = $(VC11_SRCTMPL) Makefile.am src/Makefile.inc
|
||||||
|
|
||||||
|
VC12_LIBTMPL = projects/Windows/VC12/lib/libcurl.tmpl
|
||||||
|
VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj.dist
|
||||||
|
VC12_LIBVCXPROJ_DEPS = $(VC12_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||||
|
VC12_SRCTMPL = projects/Windows/VC12/src/curl.tmpl
|
||||||
|
VC12_SRCVCXPROJ = projects/Windows/VC12/src/curl.vcxproj.dist
|
||||||
|
VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc
|
||||||
|
|
||||||
|
VC14_LIBTMPL = projects/Windows/VC14/lib/libcurl.tmpl
|
||||||
|
VC14_LIBVCXPROJ = projects/Windows/VC14/lib/libcurl.vcxproj.dist
|
||||||
|
VC14_LIBVCXPROJ_DEPS = $(VC14_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||||
|
VC14_SRCTMPL = projects/Windows/VC14/src/curl.tmpl
|
||||||
|
VC14_SRCVCXPROJ = projects/Windows/VC14/src/curl.vcxproj.dist
|
||||||
|
VC14_SRCVCXPROJ_DEPS = $(VC14_SRCTMPL) Makefile.am src/Makefile.inc
|
||||||
|
|
||||||
|
VC14_10_LIBTMPL = projects/Windows/VC14.10/lib/libcurl.tmpl
|
||||||
|
VC14_10_LIBVCXPROJ = projects/Windows/VC14.10/lib/libcurl.vcxproj.dist
|
||||||
|
VC14_10_LIBVCXPROJ_DEPS = $(VC14_10_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||||
|
VC14_10_SRCTMPL = projects/Windows/VC14.10/src/curl.tmpl
|
||||||
|
VC14_10_SRCVCXPROJ = projects/Windows/VC14.10/src/curl.vcxproj.dist
|
||||||
|
VC14_10_SRCVCXPROJ_DEPS = $(VC14_10_SRCTMPL) Makefile.am src/Makefile.inc
|
||||||
|
|
||||||
|
VC14_30_LIBTMPL = projects/Windows/VC14.30/lib/libcurl.tmpl
|
||||||
|
VC14_30_LIBVCXPROJ = projects/Windows/VC14.30/lib/libcurl.vcxproj.dist
|
||||||
|
VC14_30_LIBVCXPROJ_DEPS = $(VC14_30_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||||
|
VC14_30_SRCTMPL = projects/Windows/VC14.30/src/curl.tmpl
|
||||||
|
VC14_30_SRCVCXPROJ = projects/Windows/VC14.30/src/curl.vcxproj.dist
|
||||||
|
VC14_30_SRCVCXPROJ_DEPS = $(VC14_30_SRCTMPL) Makefile.am src/Makefile.inc
|
||||||
|
|
||||||
|
VC_DIST = projects/README.md \
|
||||||
|
projects/build-openssl.bat \
|
||||||
|
projects/build-wolfssl.bat \
|
||||||
|
projects/checksrc.bat \
|
||||||
|
projects/Windows/VC10/curl-all.sln \
|
||||||
|
projects/Windows/VC10/lib/libcurl.sln \
|
||||||
|
projects/Windows/VC10/lib/libcurl.vcxproj.filters \
|
||||||
|
projects/Windows/VC10/src/curl.sln \
|
||||||
|
projects/Windows/VC10/src/curl.vcxproj.filters \
|
||||||
|
projects/Windows/VC11/curl-all.sln \
|
||||||
|
projects/Windows/VC11/lib/libcurl.sln \
|
||||||
|
projects/Windows/VC11/lib/libcurl.vcxproj.filters \
|
||||||
|
projects/Windows/VC11/src/curl.sln \
|
||||||
|
projects/Windows/VC11/src/curl.vcxproj.filters \
|
||||||
|
projects/Windows/VC12/curl-all.sln \
|
||||||
|
projects/Windows/VC12/lib/libcurl.sln \
|
||||||
|
projects/Windows/VC12/lib/libcurl.vcxproj.filters \
|
||||||
|
projects/Windows/VC12/src/curl.sln \
|
||||||
|
projects/Windows/VC12/src/curl.vcxproj.filters \
|
||||||
|
projects/Windows/VC14/curl-all.sln \
|
||||||
|
projects/Windows/VC14/lib/libcurl.sln \
|
||||||
|
projects/Windows/VC14/lib/libcurl.vcxproj.filters \
|
||||||
|
projects/Windows/VC14/src/curl.sln \
|
||||||
|
projects/Windows/VC14/src/curl.vcxproj.filters \
|
||||||
|
projects/Windows/VC14.10/curl-all.sln \
|
||||||
|
projects/Windows/VC14.10/lib/libcurl.sln \
|
||||||
|
projects/Windows/VC14.10/lib/libcurl.vcxproj.filters \
|
||||||
|
projects/Windows/VC14.10/src/curl.sln \
|
||||||
|
projects/Windows/VC14.10/src/curl.vcxproj.filters \
|
||||||
|
projects/Windows/VC14.30/curl-all.sln \
|
||||||
|
projects/Windows/VC14.30/lib/libcurl.sln \
|
||||||
|
projects/Windows/VC14.30/lib/libcurl.vcxproj.filters \
|
||||||
|
projects/Windows/VC14.30/src/curl.sln \
|
||||||
|
projects/Windows/VC14.30/src/curl.vcxproj.filters \
|
||||||
|
projects/generate.bat \
|
||||||
|
projects/wolfssl_options.h \
|
||||||
|
projects/wolfssl_override.props
|
||||||
|
|
||||||
|
WINBUILD_DIST = winbuild/README.md winbuild/gen_resp_file.bat \
|
||||||
|
winbuild/MakefileBuild.vc winbuild/Makefile.vc
|
||||||
|
|
||||||
|
PLAN9_DIST = plan9/include/mkfile \
|
||||||
|
plan9/include/mkfile \
|
||||||
|
plan9/mkfile.proto \
|
||||||
|
plan9/mkfile \
|
||||||
|
plan9/README \
|
||||||
|
plan9/lib/mkfile.inc \
|
||||||
|
plan9/lib/mkfile \
|
||||||
|
plan9/src/mkfile.inc \
|
||||||
|
plan9/src/mkfile
|
||||||
|
|
||||||
|
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
|
||||||
|
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework $(CMAKE_DIST) \
|
||||||
|
$(VC_DIST) $(WINBUILD_DIST) $(PLAN9_DIST) lib/libcurl.vers.in buildconf.bat
|
||||||
|
|
||||||
|
CLEANFILES = $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) $(VC11_LIBVCXPROJ) \
|
||||||
|
$(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) $(VC14_LIBVCXPROJ) \
|
||||||
|
$(VC14_SRCVCXPROJ) $(VC14_10_LIBVCXPROJ) $(VC14_10_SRCVCXPROJ) \
|
||||||
|
$(VC14_30_LIBVCXPROJ) $(VC14_30_SRCVCXPROJ)
|
||||||
|
|
||||||
|
bin_SCRIPTS = curl-config
|
||||||
|
|
||||||
|
SUBDIRS = lib src
|
||||||
|
DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs
|
||||||
|
|
||||||
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
pkgconfig_DATA = libcurl.pc
|
||||||
|
|
||||||
|
# List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files
|
||||||
|
include lib/Makefile.inc
|
||||||
|
include src/Makefile.inc
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
rm -rf $(top_builddir)/tests/log
|
||||||
|
find $(distdir) -name "*.dist" -exec rm {} \;
|
||||||
|
(distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
|
||||||
|
for file in $$distit; do \
|
||||||
|
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
|
||||||
|
cp -p $$file $(distdir)$$strip; \
|
||||||
|
done)
|
||||||
|
|
||||||
|
html:
|
||||||
|
cd docs && $(MAKE) html
|
||||||
|
|
||||||
|
pdf:
|
||||||
|
cd docs && $(MAKE) pdf
|
||||||
|
|
||||||
|
check: test examples check-docs
|
||||||
|
|
||||||
|
if CROSSCOMPILING
|
||||||
|
test-full: test
|
||||||
|
test-torture: test
|
||||||
|
|
||||||
|
test:
|
||||||
|
@echo "NOTICE: we can't run the tests when cross-compiling!"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
test:
|
||||||
|
@(cd tests; $(MAKE) all quiet-test)
|
||||||
|
|
||||||
|
test-full:
|
||||||
|
@(cd tests; $(MAKE) all full-test)
|
||||||
|
|
||||||
|
test-nonflaky:
|
||||||
|
@(cd tests; $(MAKE) all nonflaky-test)
|
||||||
|
|
||||||
|
test-torture:
|
||||||
|
@(cd tests; $(MAKE) all torture-test)
|
||||||
|
|
||||||
|
test-event:
|
||||||
|
@(cd tests; $(MAKE) all event-test)
|
||||||
|
|
||||||
|
test-am:
|
||||||
|
@(cd tests; $(MAKE) all am-test)
|
||||||
|
|
||||||
|
test-ci:
|
||||||
|
@(cd tests; $(MAKE) all ci-test)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
examples:
|
||||||
|
@(cd docs/examples; $(MAKE) check)
|
||||||
|
|
||||||
|
check-docs:
|
||||||
|
@(cd docs/libcurl; $(MAKE) check)
|
||||||
|
|
||||||
|
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||||
|
# must contain the following line:
|
||||||
|
# %_topdir /home/loic/local/rpm
|
||||||
|
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
|
||||||
|
#
|
||||||
|
# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
|
||||||
|
#
|
||||||
|
# If additional configure flags are needed to build the package, add the
|
||||||
|
# following in ~/.rpmmacros
|
||||||
|
# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
|
||||||
|
# and run make rpm in the following way:
|
||||||
|
# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
|
||||||
|
#
|
||||||
|
|
||||||
|
rpms:
|
||||||
|
$(MAKE) RPMDIST=curl rpm
|
||||||
|
$(MAKE) RPMDIST=curl-ssl rpm
|
||||||
|
|
||||||
|
rpm:
|
||||||
|
RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
|
||||||
|
cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
|
||||||
|
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
|
||||||
|
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
|
||||||
|
mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
|
||||||
|
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build a Solaris pkgadd format file
|
||||||
|
# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
|
||||||
|
# file (which ends up back in this directory).
|
||||||
|
# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
|
||||||
|
# pkgadd -d ./HAXXcurl-*
|
||||||
|
#
|
||||||
|
|
||||||
|
# gak - libtool requires an absolute directory, hence the pwd below...
|
||||||
|
pkgadd:
|
||||||
|
umask 022 ; \
|
||||||
|
$(MAKE) install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \
|
||||||
|
cat COPYING > $(srcdir)/packages/Solaris/copyright ; \
|
||||||
|
cd $(srcdir)/packages/Solaris && $(MAKE) package
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build a cygwin binary tarball installation file
|
||||||
|
# resulting .tar.bz2 file will end up at packages/Win32/cygwin
|
||||||
|
cygwinbin:
|
||||||
|
$(MAKE) -C packages/Win32/cygwin cygwinbin
|
||||||
|
|
||||||
|
# We extend the standard install with a custom hook:
|
||||||
|
install-data-hook:
|
||||||
|
(cd include && $(MAKE) install)
|
||||||
|
(cd docs && $(MAKE) install)
|
||||||
|
(cd docs/libcurl && $(MAKE) install)
|
||||||
|
|
||||||
|
# We extend the standard uninstall with a custom hook:
|
||||||
|
uninstall-hook:
|
||||||
|
(cd include && $(MAKE) uninstall)
|
||||||
|
(cd docs && $(MAKE) uninstall)
|
||||||
|
(cd docs/libcurl && $(MAKE) uninstall)
|
||||||
|
|
||||||
|
ca-bundle: $(srcdir)/scripts/mk-ca-bundle.pl
|
||||||
|
@echo "generating a fresh ca-bundle.crt"
|
||||||
|
@perl $(srcdir)/scripts/mk-ca-bundle.pl -b -l -u lib/ca-bundle.crt
|
||||||
|
|
||||||
|
ca-firefox: $(srcdir)/scripts/firefox-db2pem.sh
|
||||||
|
@echo "generating a fresh ca-bundle.crt"
|
||||||
|
$(srcdir)/scripts/firefox-db2pem.sh lib/ca-bundle.crt
|
||||||
|
|
||||||
|
checksrc:
|
||||||
|
(cd lib && $(MAKE) checksrc)
|
||||||
|
(cd src && $(MAKE) checksrc)
|
||||||
|
(cd tests && $(MAKE) checksrc)
|
||||||
|
(cd include/curl && $(MAKE) checksrc)
|
||||||
|
(cd docs/examples && $(MAKE) checksrc)
|
||||||
|
(cd packages && $(MAKE) checksrc)
|
||||||
|
|
||||||
|
.PHONY: vc-ide
|
||||||
|
|
||||||
|
vc-ide: $(VC10_LIBVCXPROJ_DEPS) $(VC10_SRCVCXPROJ_DEPS) \
|
||||||
|
$(VC11_LIBVCXPROJ_DEPS) $(VC11_SRCVCXPROJ_DEPS) $(VC12_LIBVCXPROJ_DEPS) \
|
||||||
|
$(VC12_SRCVCXPROJ_DEPS) $(VC14_LIBVCXPROJ_DEPS) $(VC14_SRCVCXPROJ_DEPS) \
|
||||||
|
$(VC14_10_LIBVCXPROJ_DEPS) $(VC14_10_SRCVCXPROJ_DEPS) \
|
||||||
|
$(VC14_30_LIBVCXPROJ_DEPS) $(VC14_30_SRCVCXPROJ_DEPS)
|
||||||
|
@(win32_lib_srcs='$(LIB_CFILES)'; \
|
||||||
|
win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \
|
||||||
|
win32_lib_rc='$(LIB_RCFILES)'; \
|
||||||
|
win32_lib_vauth_srcs='$(LIB_VAUTH_CFILES)'; \
|
||||||
|
win32_lib_vauth_hdrs='$(LIB_VAUTH_HFILES)'; \
|
||||||
|
win32_lib_vquic_srcs='$(LIB_VQUIC_CFILES)'; \
|
||||||
|
win32_lib_vquic_hdrs='$(LIB_VQUIC_HFILES)'; \
|
||||||
|
win32_lib_vssh_srcs='$(LIB_VSSH_CFILES)'; \
|
||||||
|
win32_lib_vssh_hdrs='$(LIB_VSSH_HFILES)'; \
|
||||||
|
win32_lib_vtls_srcs='$(LIB_VTLS_CFILES)'; \
|
||||||
|
win32_lib_vtls_hdrs='$(LIB_VTLS_HFILES)'; \
|
||||||
|
win32_src_srcs='$(CURL_CFILES)'; \
|
||||||
|
win32_src_hdrs='$(CURL_HFILES)'; \
|
||||||
|
win32_src_rc='$(CURL_RCFILES)'; \
|
||||||
|
win32_src_x_srcs='$(CURLX_CFILES)'; \
|
||||||
|
win32_src_x_hdrs='$(CURLX_HFILES) ../lib/config-win32.h'; \
|
||||||
|
\
|
||||||
|
sorted_lib_srcs=`for file in $$win32_lib_srcs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_hdrs=`for file in $$win32_lib_hdrs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vauth_srcs=`for file in $$win32_lib_vauth_srcs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vauth_hdrs=`for file in $$win32_lib_vauth_hdrs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vquic_srcs=`for file in $$win32_lib_vquic_srcs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vquic_hdrs=`for file in $$win32_lib_vquic_hdrs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vssh_srcs=`for file in $$win32_lib_vssh_srcs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vssh_hdrs=`for file in $$win32_lib_vssh_hdrs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vtls_srcs=`for file in $$win32_lib_vtls_srcs; do echo $$file; done | sort`; \
|
||||||
|
sorted_lib_vtls_hdrs=`for file in $$win32_lib_vtls_hdrs; do echo $$file; done | sort`; \
|
||||||
|
sorted_src_srcs=`for file in $$win32_src_srcs; do echo $$file; done | sort`; \
|
||||||
|
sorted_src_hdrs=`for file in $$win32_src_hdrs; do echo $$file; done | sort`; \
|
||||||
|
sorted_src_x_srcs=`for file in $$win32_src_x_srcs; do echo $$file; done | sort`; \
|
||||||
|
sorted_src_x_hdrs=`for file in $$win32_src_x_hdrs; do echo $$file; done | sort`; \
|
||||||
|
\
|
||||||
|
awk_code='\
|
||||||
|
function gen_element(type, dir, file)\
|
||||||
|
{\
|
||||||
|
sub(/vauth\//, "", file);\
|
||||||
|
sub(/vquic\//, "", file);\
|
||||||
|
sub(/vssh\//, "", file);\
|
||||||
|
sub(/vtls\//, "", file);\
|
||||||
|
\
|
||||||
|
spaces=" ";\
|
||||||
|
if(dir == "lib\\vauth" ||\
|
||||||
|
dir == "lib\\vquic" ||\
|
||||||
|
dir == "lib\\vssh" ||\
|
||||||
|
dir == "lib\\vtls")\
|
||||||
|
tabs=" ";\
|
||||||
|
else\
|
||||||
|
tabs=" ";\
|
||||||
|
\
|
||||||
|
if(type == "dsp") {\
|
||||||
|
printf("# Begin Source File\r\n");\
|
||||||
|
printf("\r\n");\
|
||||||
|
printf("SOURCE=..\\..\\..\\..\\%s\\%s\r\n", dir, file);\
|
||||||
|
printf("# End Source File\r\n");\
|
||||||
|
}\
|
||||||
|
else if(type == "vcproj1") {\
|
||||||
|
printf("%s<File\r\n", tabs);\
|
||||||
|
printf("%s RelativePath=\"..\\..\\..\\..\\%s\\%s\">\r\n",\
|
||||||
|
tabs, dir, file);\
|
||||||
|
printf("%s</File>\r\n", tabs);\
|
||||||
|
}\
|
||||||
|
else if(type == "vcproj2") {\
|
||||||
|
printf("%s<File\r\n", tabs);\
|
||||||
|
printf("%s RelativePath=\"..\\..\\..\\..\\%s\\%s\"\r\n",\
|
||||||
|
tabs, dir, file);\
|
||||||
|
printf("%s>\r\n", tabs);\
|
||||||
|
printf("%s</File>\r\n", tabs);\
|
||||||
|
}\
|
||||||
|
else if(type == "vcxproj") {\
|
||||||
|
i = index(file, ".");\
|
||||||
|
ext = substr(file, i == 0 ? 0 : i + 1);\
|
||||||
|
\
|
||||||
|
if(ext == "c")\
|
||||||
|
printf("%s<ClCompile Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
|
||||||
|
spaces, dir, file);\
|
||||||
|
else if(ext == "h")\
|
||||||
|
printf("%s<ClInclude Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
|
||||||
|
spaces, dir, file);\
|
||||||
|
else if(ext == "rc")\
|
||||||
|
printf("%s<ResourceCompile Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
|
||||||
|
spaces, dir, file);\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
\
|
||||||
|
{\
|
||||||
|
\
|
||||||
|
if($$0 == "CURL_LIB_C_FILES") {\
|
||||||
|
split(lib_srcs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_H_FILES") {\
|
||||||
|
split(lib_hdrs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_RC_FILES") {\
|
||||||
|
split(lib_rc, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VAUTH_C_FILES") {\
|
||||||
|
split(lib_vauth_srcs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VAUTH_H_FILES") {\
|
||||||
|
split(lib_vauth_hdrs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VQUIC_C_FILES") {\
|
||||||
|
split(lib_vquic_srcs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vquic", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VQUIC_H_FILES") {\
|
||||||
|
split(lib_vquic_hdrs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vquic", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VSSH_C_FILES") {\
|
||||||
|
split(lib_vssh_srcs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vssh", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VSSH_H_FILES") {\
|
||||||
|
split(lib_vssh_hdrs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vssh", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VTLS_C_FILES") {\
|
||||||
|
split(lib_vtls_srcs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_LIB_VTLS_H_FILES") {\
|
||||||
|
split(lib_vtls_hdrs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_SRC_C_FILES") {\
|
||||||
|
split(src_srcs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "src", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_SRC_H_FILES") {\
|
||||||
|
split(src_hdrs, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "src", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_SRC_RC_FILES") {\
|
||||||
|
split(src_rc, arr);\
|
||||||
|
for(val in arr) gen_element(proj_type, "src", arr[val]);\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_SRC_X_C_FILES") {\
|
||||||
|
split(src_x_srcs, arr);\
|
||||||
|
for(val in arr) {\
|
||||||
|
sub(/..\/lib\//, "", arr[val]);\
|
||||||
|
gen_element(proj_type, "lib", arr[val]);\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
else if($$0 == "CURL_SRC_X_H_FILES") {\
|
||||||
|
split(src_x_hdrs, arr);\
|
||||||
|
for(val in arr) {\
|
||||||
|
sub(/..\/lib\//, "", arr[val]);\
|
||||||
|
gen_element(proj_type, "lib", arr[val]);\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
else\
|
||||||
|
printf("%s\r\n", $$0);\
|
||||||
|
}';\
|
||||||
|
\
|
||||||
|
echo "generating '$(VC10_LIBVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v lib_srcs="$$sorted_lib_srcs" \
|
||||||
|
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||||
|
-v lib_rc="$$win32_lib_rc" \
|
||||||
|
-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
|
||||||
|
-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
|
||||||
|
-v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \
|
||||||
|
-v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \
|
||||||
|
-v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \
|
||||||
|
-v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \
|
||||||
|
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||||
|
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC10_LIBTMPL) > $(VC10_LIBVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC10_SRCVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v src_srcs="$$sorted_src_srcs" \
|
||||||
|
-v src_hdrs="$$sorted_src_hdrs" \
|
||||||
|
-v src_rc="$$win32_src_rc" \
|
||||||
|
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||||
|
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC10_SRCTMPL) > $(VC10_SRCVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC11_LIBVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v lib_srcs="$$sorted_lib_srcs" \
|
||||||
|
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||||
|
-v lib_rc="$$win32_lib_rc" \
|
||||||
|
-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
|
||||||
|
-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
|
||||||
|
-v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \
|
||||||
|
-v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \
|
||||||
|
-v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \
|
||||||
|
-v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \
|
||||||
|
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||||
|
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC11_LIBTMPL) > $(VC11_LIBVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC11_SRCVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v src_srcs="$$sorted_src_srcs" \
|
||||||
|
-v src_hdrs="$$sorted_src_hdrs" \
|
||||||
|
-v src_rc="$$win32_src_rc" \
|
||||||
|
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||||
|
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC11_SRCTMPL) > $(VC11_SRCVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC12_LIBVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v lib_srcs="$$sorted_lib_srcs" \
|
||||||
|
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||||
|
-v lib_rc="$$win32_lib_rc" \
|
||||||
|
-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
|
||||||
|
-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
|
||||||
|
-v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \
|
||||||
|
-v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \
|
||||||
|
-v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \
|
||||||
|
-v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \
|
||||||
|
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||||
|
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC12_LIBTMPL) > $(VC12_LIBVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC12_SRCVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v src_srcs="$$sorted_src_srcs" \
|
||||||
|
-v src_hdrs="$$sorted_src_hdrs" \
|
||||||
|
-v src_rc="$$win32_src_rc" \
|
||||||
|
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||||
|
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC14_LIBVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v lib_srcs="$$sorted_lib_srcs" \
|
||||||
|
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||||
|
-v lib_rc="$$win32_lib_rc" \
|
||||||
|
-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
|
||||||
|
-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
|
||||||
|
-v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \
|
||||||
|
-v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \
|
||||||
|
-v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \
|
||||||
|
-v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \
|
||||||
|
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||||
|
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC14_LIBTMPL) > $(VC14_LIBVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC14_SRCVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v src_srcs="$$sorted_src_srcs" \
|
||||||
|
-v src_hdrs="$$sorted_src_hdrs" \
|
||||||
|
-v src_rc="$$win32_src_rc" \
|
||||||
|
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||||
|
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC14_SRCTMPL) > $(VC14_SRCVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC14_10_LIBVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v lib_srcs="$$sorted_lib_srcs" \
|
||||||
|
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||||
|
-v lib_rc="$$win32_lib_rc" \
|
||||||
|
-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
|
||||||
|
-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
|
||||||
|
-v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \
|
||||||
|
-v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \
|
||||||
|
-v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \
|
||||||
|
-v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \
|
||||||
|
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||||
|
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC14_10_LIBTMPL) > $(VC14_10_LIBVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC14_10_SRCVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v src_srcs="$$sorted_src_srcs" \
|
||||||
|
-v src_hdrs="$$sorted_src_hdrs" \
|
||||||
|
-v src_rc="$$win32_src_rc" \
|
||||||
|
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||||
|
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC14_10_SRCTMPL) > $(VC14_10_SRCVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC14_30_LIBVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v lib_srcs="$$sorted_lib_srcs" \
|
||||||
|
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||||
|
-v lib_rc="$$win32_lib_rc" \
|
||||||
|
-v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \
|
||||||
|
-v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \
|
||||||
|
-v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \
|
||||||
|
-v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \
|
||||||
|
-v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \
|
||||||
|
-v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \
|
||||||
|
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||||
|
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC14_30_LIBTMPL) > $(VC14_30_LIBVCXPROJ) || { exit 1; }; \
|
||||||
|
\
|
||||||
|
echo "generating '$(VC14_30_SRCVCXPROJ)'"; \
|
||||||
|
awk -v proj_type=vcxproj \
|
||||||
|
-v src_srcs="$$sorted_src_srcs" \
|
||||||
|
-v src_hdrs="$$sorted_src_hdrs" \
|
||||||
|
-v src_rc="$$win32_src_rc" \
|
||||||
|
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||||
|
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||||
|
"$$awk_code" $(srcdir)/$(VC14_30_SRCTMPL) > $(VC14_30_SRCVCXPROJ) || { exit 1; };)
|
||||||
|
|
||||||
|
tidy:
|
||||||
|
(cd src && $(MAKE) tidy)
|
||||||
|
(cd lib && $(MAKE) tidy)
|
@ -0,0 +1,55 @@
|
|||||||
|
_ _ ____ _
|
||||||
|
___| | | | _ \| |
|
||||||
|
/ __| | | | |_) | |
|
||||||
|
| (__| |_| | _ <| |___
|
||||||
|
\___|\___/|_| \_\_____|
|
||||||
|
|
||||||
|
README
|
||||||
|
|
||||||
|
Curl is a command line tool for transferring data specified with URL
|
||||||
|
syntax. Find out how to use curl by reading the curl.1 man page or the
|
||||||
|
MANUAL document. Find out how to install Curl by reading the INSTALL
|
||||||
|
document.
|
||||||
|
|
||||||
|
libcurl is the library curl is using to do its job. It is readily
|
||||||
|
available to be used by your software. Read the libcurl.3 man page to
|
||||||
|
learn how.
|
||||||
|
|
||||||
|
You find answers to the most frequent questions we get in the FAQ document.
|
||||||
|
|
||||||
|
Study the COPYING file for distribution terms.
|
||||||
|
|
||||||
|
Those documents and more can be found in the docs/ directory.
|
||||||
|
|
||||||
|
CONTACT
|
||||||
|
|
||||||
|
If you have problems, questions, ideas or suggestions, please contact us
|
||||||
|
by posting to a suitable mailing list. See https://curl.se/mail/
|
||||||
|
|
||||||
|
All contributors to the project are listed in the THANKS document.
|
||||||
|
|
||||||
|
WEBSITE
|
||||||
|
|
||||||
|
Visit the curl website for the latest news and downloads:
|
||||||
|
|
||||||
|
https://curl.se/
|
||||||
|
|
||||||
|
GIT
|
||||||
|
|
||||||
|
To download the latest source code off the GIT server, do this:
|
||||||
|
|
||||||
|
git clone https://github.com/curl/curl.git
|
||||||
|
|
||||||
|
(you will get a directory named curl created, filled with the source code)
|
||||||
|
|
||||||
|
SECURITY PROBLEMS
|
||||||
|
|
||||||
|
Report suspected security problems via our HackerOne page and not in public.
|
||||||
|
|
||||||
|
https://hackerone.com/curl
|
||||||
|
|
||||||
|
NOTICE
|
||||||
|
|
||||||
|
Curl contains pieces of source code that is Copyright (c) 1998, 1999
|
||||||
|
Kungliga Tekniska Högskolan. This notice is included here to comply with the
|
||||||
|
distribution terms.
|
@ -0,0 +1,61 @@
|
|||||||
|
curl and libcurl 8.1.2
|
||||||
|
|
||||||
|
Public curl releases: 219
|
||||||
|
Command line options: 251
|
||||||
|
curl_easy_setopt() options: 302
|
||||||
|
Public functions in libcurl: 91
|
||||||
|
Contributors: 2888
|
||||||
|
|
||||||
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
|
o configure: quote the assignments for run-compiler [1]
|
||||||
|
o configure: without pkg-config and no custom path, use -lnghttp2 [8]
|
||||||
|
o curl: cache the --trace-time value for a second [9]
|
||||||
|
o http2: fix EOF handling on uploads with auth negotiation [7]
|
||||||
|
o http3: send EOF indicator early as possible [11]
|
||||||
|
o lib1560: verify more scheme guessing [5]
|
||||||
|
o lib: remove unused functions, make single-use static [3]
|
||||||
|
o libcurl.m4: remove trailing 'dnl' that causes this to break autoconf [10]
|
||||||
|
o libssh: when keyboard-interactive auth fails, try password [4]
|
||||||
|
o misc: fix spelling mistakes [2]
|
||||||
|
o page-header: mention curl version and how to figure out current release [13]
|
||||||
|
o page-header: minor wording polish in the URL segment [12]
|
||||||
|
o scripts/singleuse.pl: add more API calls
|
||||||
|
o urlapi: remove superfluous host name check [6]
|
||||||
|
|
||||||
|
This release includes the following known bugs:
|
||||||
|
|
||||||
|
o see docs/KNOWN_BUGS (https://curl.se/docs/knownbugs.html)
|
||||||
|
|
||||||
|
Planned upcoming removals include:
|
||||||
|
|
||||||
|
o gskit
|
||||||
|
o NSS
|
||||||
|
o support for space-separated NOPROXY patterns
|
||||||
|
o support for the original legacy mingw version 1
|
||||||
|
|
||||||
|
See https://curl.se/dev/deprecate.html for details
|
||||||
|
|
||||||
|
This release would not have looked like this without help, code, reports and
|
||||||
|
advice from friends like these:
|
||||||
|
|
||||||
|
Aleksander Mazur, Christian Hesse, correctmost on github, Dan Fandrich,
|
||||||
|
Daniel Stenberg, Emanuele Torre, Gisle Vanem, Kev Jackson,
|
||||||
|
musvaage on github, Sergey Fionov, Stefan Eissing, Viktor Szakats, 左潇峰
|
||||||
|
(13 contributors)
|
||||||
|
|
||||||
|
References to bug reports and discussions on issues:
|
||||||
|
|
||||||
|
[1] = https://curl.se/bug/?i=11179
|
||||||
|
[2] = https://curl.se/bug/?i=11171
|
||||||
|
[3] = https://curl.se/bug/?i=11174
|
||||||
|
[4] = https://curl.se/bug/?i=11196
|
||||||
|
[5] = https://curl.se/bug/?i=11219
|
||||||
|
[6] = https://curl.se/bug/?i=11195
|
||||||
|
[7] = https://curl.se/bug/?i=11194
|
||||||
|
[8] = https://curl.se/bug/?i=11186
|
||||||
|
[9] = https://curl.se/bug/?i=11211
|
||||||
|
[10] = https://curl.se/bug/?i=11212
|
||||||
|
[11] = https://curl.se/bug/?i=11205
|
||||||
|
[12] = https://curl.se/bug/?i=11217
|
||||||
|
[13] = https://curl.se/bug/?i=11216
|
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
|
||||||
|
echo "*** Do not use buildconf. Instead, just use: autoreconf -fi" >&2
|
||||||
|
exec ${AUTORECONF:-autoreconf} -fi "${@}"
|
@ -0,0 +1,319 @@
|
|||||||
|
@echo off
|
||||||
|
rem ***************************************************************************
|
||||||
|
rem * _ _ ____ _
|
||||||
|
rem * Project ___| | | | _ \| |
|
||||||
|
rem * / __| | | | |_) | |
|
||||||
|
rem * | (__| |_| | _ <| |___
|
||||||
|
rem * \___|\___/|_| \_\_____|
|
||||||
|
rem *
|
||||||
|
rem * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
rem *
|
||||||
|
rem * This software is licensed as described in the file COPYING, which
|
||||||
|
rem * you should have received as part of this distribution. The terms
|
||||||
|
rem * are also available at https://curl.se/docs/copyright.html.
|
||||||
|
rem *
|
||||||
|
rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
rem * copies of the Software, and permit persons to whom the Software is
|
||||||
|
rem * furnished to do so, under the terms of the COPYING file.
|
||||||
|
rem *
|
||||||
|
rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
rem * KIND, either express or implied.
|
||||||
|
rem *
|
||||||
|
rem * SPDX-License-Identifier: curl
|
||||||
|
rem *
|
||||||
|
rem ***************************************************************************
|
||||||
|
|
||||||
|
rem NOTES
|
||||||
|
rem
|
||||||
|
rem This batch file must be used to set up a git tree to build on systems where
|
||||||
|
rem there is no autotools support (i.e. DOS and Windows).
|
||||||
|
rem
|
||||||
|
|
||||||
|
:begin
|
||||||
|
rem Set our variables
|
||||||
|
if "%OS%" == "Windows_NT" setlocal
|
||||||
|
set MODE=GENERATE
|
||||||
|
|
||||||
|
rem Switch to this batch file's directory
|
||||||
|
cd /d "%~0\.." 1>NUL 2>&1
|
||||||
|
|
||||||
|
rem Check we are running from a curl git repository
|
||||||
|
if not exist GIT-INFO goto norepo
|
||||||
|
|
||||||
|
rem Detect programs. HAVE_<PROGNAME>
|
||||||
|
rem When not found the variable is set undefined. The undefined pattern
|
||||||
|
rem allows for statements like "if not defined HAVE_PERL (command)"
|
||||||
|
groff --version <NUL 1>NUL 2>&1
|
||||||
|
if errorlevel 1 (set HAVE_GROFF=) else (set HAVE_GROFF=Y)
|
||||||
|
nroff --version <NUL 1>NUL 2>&1
|
||||||
|
if errorlevel 1 (set HAVE_NROFF=) else (set HAVE_NROFF=Y)
|
||||||
|
perl --version <NUL 1>NUL 2>&1
|
||||||
|
if errorlevel 1 (set HAVE_PERL=) else (set HAVE_PERL=Y)
|
||||||
|
gzip --version <NUL 1>NUL 2>&1
|
||||||
|
if errorlevel 1 (set HAVE_GZIP=) else (set HAVE_GZIP=Y)
|
||||||
|
|
||||||
|
:parseArgs
|
||||||
|
if "%~1" == "" goto start
|
||||||
|
|
||||||
|
if /i "%~1" == "-clean" (
|
||||||
|
set MODE=CLEAN
|
||||||
|
) else if /i "%~1" == "-?" (
|
||||||
|
goto syntax
|
||||||
|
) else if /i "%~1" == "-h" (
|
||||||
|
goto syntax
|
||||||
|
) else if /i "%~1" == "-help" (
|
||||||
|
goto syntax
|
||||||
|
) else (
|
||||||
|
goto unknown
|
||||||
|
)
|
||||||
|
|
||||||
|
shift & goto parseArgs
|
||||||
|
|
||||||
|
:start
|
||||||
|
if "%MODE%" == "GENERATE" (
|
||||||
|
echo.
|
||||||
|
echo Generating prerequisite files
|
||||||
|
|
||||||
|
call :generate
|
||||||
|
if errorlevel 3 goto nogenhugehelp
|
||||||
|
if errorlevel 2 goto nogenmakefile
|
||||||
|
if errorlevel 1 goto warning
|
||||||
|
|
||||||
|
) else (
|
||||||
|
echo.
|
||||||
|
echo Removing prerequisite files
|
||||||
|
|
||||||
|
call :clean
|
||||||
|
if errorlevel 2 goto nocleanhugehelp
|
||||||
|
if errorlevel 1 goto nocleanmakefile
|
||||||
|
)
|
||||||
|
|
||||||
|
goto success
|
||||||
|
|
||||||
|
rem Main generate function.
|
||||||
|
rem
|
||||||
|
rem Returns:
|
||||||
|
rem
|
||||||
|
rem 0 - success
|
||||||
|
rem 1 - success with simplified tool_hugehelp.c
|
||||||
|
rem 2 - failed to generate Makefile
|
||||||
|
rem 3 - failed to generate tool_hugehelp.c
|
||||||
|
rem
|
||||||
|
:generate
|
||||||
|
if "%OS%" == "Windows_NT" setlocal
|
||||||
|
set BASIC_HUGEHELP=0
|
||||||
|
|
||||||
|
rem Create Makefile
|
||||||
|
echo * %CD%\Makefile
|
||||||
|
if exist Makefile.dist (
|
||||||
|
copy /Y Makefile.dist Makefile 1>NUL 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
|
exit /B 2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Create tool_hugehelp.c
|
||||||
|
echo * %CD%\src\tool_hugehelp.c
|
||||||
|
call :genHugeHelp
|
||||||
|
if errorlevel 2 (
|
||||||
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
|
exit /B 3
|
||||||
|
)
|
||||||
|
if errorlevel 1 (
|
||||||
|
set BASIC_HUGEHELP=1
|
||||||
|
)
|
||||||
|
cmd /c exit 0
|
||||||
|
|
||||||
|
rem Setup c-ares git tree
|
||||||
|
if exist ares\buildconf.bat (
|
||||||
|
echo.
|
||||||
|
echo Configuring c-ares build environment
|
||||||
|
cd ares
|
||||||
|
call buildconf.bat
|
||||||
|
cd ..
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%BASIC_HUGEHELP%" == "1" (
|
||||||
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
|
exit /B 0
|
||||||
|
|
||||||
|
rem Main clean function.
|
||||||
|
rem
|
||||||
|
rem Returns:
|
||||||
|
rem
|
||||||
|
rem 0 - success
|
||||||
|
rem 1 - failed to clean Makefile
|
||||||
|
rem 2 - failed to clean tool_hugehelp.c
|
||||||
|
rem
|
||||||
|
:clean
|
||||||
|
rem Remove Makefile
|
||||||
|
echo * %CD%\Makefile
|
||||||
|
if exist Makefile (
|
||||||
|
del Makefile 2>NUL
|
||||||
|
if exist Makefile (
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
rem Remove tool_hugehelp.c
|
||||||
|
echo * %CD%\src\tool_hugehelp.c
|
||||||
|
if exist src\tool_hugehelp.c (
|
||||||
|
del src\tool_hugehelp.c 2>NUL
|
||||||
|
if exist src\tool_hugehelp.c (
|
||||||
|
exit /B 2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
exit /B
|
||||||
|
|
||||||
|
rem Function to generate src\tool_hugehelp.c
|
||||||
|
rem
|
||||||
|
rem Returns:
|
||||||
|
rem
|
||||||
|
rem 0 - full tool_hugehelp.c generated
|
||||||
|
rem 1 - simplified tool_hugehelp.c
|
||||||
|
rem 2 - failure
|
||||||
|
rem
|
||||||
|
:genHugeHelp
|
||||||
|
if "%OS%" == "Windows_NT" setlocal
|
||||||
|
set LC_ALL=C
|
||||||
|
set ROFFCMD=
|
||||||
|
set BASIC=1
|
||||||
|
|
||||||
|
if defined HAVE_PERL (
|
||||||
|
if defined HAVE_GROFF (
|
||||||
|
set ROFFCMD=groff -mtty-char -Tascii -P-c -man
|
||||||
|
) else if defined HAVE_NROFF (
|
||||||
|
set ROFFCMD=nroff -c -Tascii -man
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if defined ROFFCMD (
|
||||||
|
echo #include "tool_setup.h"> src\tool_hugehelp.c
|
||||||
|
echo #include "tool_hugehelp.h">> src\tool_hugehelp.c
|
||||||
|
|
||||||
|
if defined HAVE_GZIP (
|
||||||
|
echo #ifndef HAVE_LIBZ>> src\tool_hugehelp.c
|
||||||
|
)
|
||||||
|
|
||||||
|
%ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl docs\MANUAL >> src\tool_hugehelp.c
|
||||||
|
if defined HAVE_GZIP (
|
||||||
|
echo #else>> src\tool_hugehelp.c
|
||||||
|
%ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl -c docs\MANUAL >> src\tool_hugehelp.c
|
||||||
|
echo #endif /^* HAVE_LIBZ ^*/>> src\tool_hugehelp.c
|
||||||
|
)
|
||||||
|
|
||||||
|
set BASIC=0
|
||||||
|
) else (
|
||||||
|
if exist src\tool_hugehelp.c.cvs (
|
||||||
|
copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c 1>NUL 2>&1
|
||||||
|
) else (
|
||||||
|
echo #include "tool_setup.h"> src\tool_hugehelp.c
|
||||||
|
echo #include "tool_hugehelp.h">> src\tool_hugehelp.c
|
||||||
|
echo.>> src\tool_hugehelp.c
|
||||||
|
echo void hugehelp(void^)>> src\tool_hugehelp.c
|
||||||
|
echo {>> src\tool_hugehelp.c
|
||||||
|
echo #ifdef USE_MANUAL>> src\tool_hugehelp.c
|
||||||
|
echo fputs("Built-in manual not included\n", stdout^);>> src\tool_hugehelp.c
|
||||||
|
echo #endif>> src\tool_hugehelp.c
|
||||||
|
echo }>> src\tool_hugehelp.c
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
findstr "/C:void hugehelp(void)" src\tool_hugehelp.c 1>NUL 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
|
exit /B 2
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%BASIC%" == "1" (
|
||||||
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%OS%" == "Windows_NT" endlocal
|
||||||
|
exit /B 0
|
||||||
|
|
||||||
|
rem Function to clean-up local variables under DOS, Windows 3.x and
|
||||||
|
rem Windows 9x as setlocal isn't available until Windows NT
|
||||||
|
rem
|
||||||
|
:dosCleanup
|
||||||
|
set MODE=
|
||||||
|
set HAVE_GROFF=
|
||||||
|
set HAVE_NROFF=
|
||||||
|
set HAVE_PERL=
|
||||||
|
set HAVE_GZIP=
|
||||||
|
set BASIC_HUGEHELP=
|
||||||
|
set LC_ALL
|
||||||
|
set ROFFCMD=
|
||||||
|
set BASIC=
|
||||||
|
|
||||||
|
exit /B
|
||||||
|
|
||||||
|
:syntax
|
||||||
|
rem Display the help
|
||||||
|
echo.
|
||||||
|
echo Usage: buildconf [-clean]
|
||||||
|
echo.
|
||||||
|
echo -clean - Removes the files
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:unknown
|
||||||
|
echo.
|
||||||
|
echo Error: Unknown argument '%1'
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:norepo
|
||||||
|
echo.
|
||||||
|
echo Error: This batch file should only be used with a curl git repository
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:nogenmakefile
|
||||||
|
echo.
|
||||||
|
echo Error: Unable to generate Makefile
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:nogenhugehelp
|
||||||
|
echo.
|
||||||
|
echo Error: Unable to generate src\tool_hugehelp.c
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:nocleanmakefile
|
||||||
|
echo.
|
||||||
|
echo Error: Unable to clean Makefile
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:nocleanhugehelp
|
||||||
|
echo.
|
||||||
|
echo Error: Unable to clean src\tool_hugehelp.c
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:warning
|
||||||
|
echo.
|
||||||
|
echo Warning: The curl manual could not be integrated in the source. This means when
|
||||||
|
echo you build curl the manual will not be available (curl --man^). Integration of
|
||||||
|
echo the manual is not required and a summary of the options will still be available
|
||||||
|
echo (curl --help^). To integrate the manual your PATH is required to have
|
||||||
|
echo groff/nroff, perl and optionally gzip for compression.
|
||||||
|
goto success
|
||||||
|
|
||||||
|
:error
|
||||||
|
if "%OS%" == "Windows_NT" (
|
||||||
|
endlocal
|
||||||
|
) else (
|
||||||
|
call :dosCleanup
|
||||||
|
)
|
||||||
|
exit /B 1
|
||||||
|
|
||||||
|
:success
|
||||||
|
if "%OS%" == "Windows_NT" (
|
||||||
|
endlocal
|
||||||
|
) else (
|
||||||
|
call :dosCleanup
|
||||||
|
)
|
||||||
|
exit /B 0
|
@ -0,0 +1,348 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Wrapper for compilers which do not understand '-c -o'.
|
||||||
|
|
||||||
|
scriptversion=2018-03-07.03; # UTC
|
||||||
|
|
||||||
|
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
|
||||||
|
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# This file is maintained in Automake, please report
|
||||||
|
# bugs to <bug-automake@gnu.org> or send patches to
|
||||||
|
# <automake-patches@gnu.org>.
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
|
||||||
|
# We need space, tab and new line, in precisely that order. Quoting is
|
||||||
|
# there to prevent tools from complaining about whitespace usage.
|
||||||
|
IFS=" "" $nl"
|
||||||
|
|
||||||
|
file_conv=
|
||||||
|
|
||||||
|
# func_file_conv build_file lazy
|
||||||
|
# Convert a $build file to $host form and store it in $file
|
||||||
|
# Currently only supports Windows hosts. If the determined conversion
|
||||||
|
# type is listed in (the comma separated) LAZY, no conversion will
|
||||||
|
# take place.
|
||||||
|
func_file_conv ()
|
||||||
|
{
|
||||||
|
file=$1
|
||||||
|
case $file in
|
||||||
|
/ | /[!/]*) # absolute file, and not a UNC file
|
||||||
|
if test -z "$file_conv"; then
|
||||||
|
# lazily determine how to convert abs files
|
||||||
|
case `uname -s` in
|
||||||
|
MINGW*)
|
||||||
|
file_conv=mingw
|
||||||
|
;;
|
||||||
|
CYGWIN* | MSYS*)
|
||||||
|
file_conv=cygwin
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
file_conv=wine
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
case $file_conv/,$2, in
|
||||||
|
*,$file_conv,*)
|
||||||
|
;;
|
||||||
|
mingw/*)
|
||||||
|
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||||
|
;;
|
||||||
|
cygwin/* | msys/*)
|
||||||
|
file=`cygpath -m "$file" || echo "$file"`
|
||||||
|
;;
|
||||||
|
wine/*)
|
||||||
|
file=`winepath -w "$file" || echo "$file"`
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# func_cl_dashL linkdir
|
||||||
|
# Make cl look for libraries in LINKDIR
|
||||||
|
func_cl_dashL ()
|
||||||
|
{
|
||||||
|
func_file_conv "$1"
|
||||||
|
if test -z "$lib_path"; then
|
||||||
|
lib_path=$file
|
||||||
|
else
|
||||||
|
lib_path="$lib_path;$file"
|
||||||
|
fi
|
||||||
|
linker_opts="$linker_opts -LIBPATH:$file"
|
||||||
|
}
|
||||||
|
|
||||||
|
# func_cl_dashl library
|
||||||
|
# Do a library search-path lookup for cl
|
||||||
|
func_cl_dashl ()
|
||||||
|
{
|
||||||
|
lib=$1
|
||||||
|
found=no
|
||||||
|
save_IFS=$IFS
|
||||||
|
IFS=';'
|
||||||
|
for dir in $lib_path $LIB
|
||||||
|
do
|
||||||
|
IFS=$save_IFS
|
||||||
|
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||||
|
found=yes
|
||||||
|
lib=$dir/$lib.dll.lib
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if test -f "$dir/$lib.lib"; then
|
||||||
|
found=yes
|
||||||
|
lib=$dir/$lib.lib
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if test -f "$dir/lib$lib.a"; then
|
||||||
|
found=yes
|
||||||
|
lib=$dir/lib$lib.a
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
IFS=$save_IFS
|
||||||
|
|
||||||
|
if test "$found" != yes; then
|
||||||
|
lib=$lib.lib
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# func_cl_wrapper cl arg...
|
||||||
|
# Adjust compile command to suit cl
|
||||||
|
func_cl_wrapper ()
|
||||||
|
{
|
||||||
|
# Assume a capable shell
|
||||||
|
lib_path=
|
||||||
|
shared=:
|
||||||
|
linker_opts=
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$eat"; then
|
||||||
|
eat=
|
||||||
|
else
|
||||||
|
case $1 in
|
||||||
|
-o)
|
||||||
|
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||||
|
eat=1
|
||||||
|
case $2 in
|
||||||
|
*.o | *.[oO][bB][jJ])
|
||||||
|
func_file_conv "$2"
|
||||||
|
set x "$@" -Fo"$file"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
func_file_conv "$2"
|
||||||
|
set x "$@" -Fe"$file"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
-I)
|
||||||
|
eat=1
|
||||||
|
func_file_conv "$2" mingw
|
||||||
|
set x "$@" -I"$file"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-I*)
|
||||||
|
func_file_conv "${1#-I}" mingw
|
||||||
|
set x "$@" -I"$file"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-l)
|
||||||
|
eat=1
|
||||||
|
func_cl_dashl "$2"
|
||||||
|
set x "$@" "$lib"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-l*)
|
||||||
|
func_cl_dashl "${1#-l}"
|
||||||
|
set x "$@" "$lib"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-L)
|
||||||
|
eat=1
|
||||||
|
func_cl_dashL "$2"
|
||||||
|
;;
|
||||||
|
-L*)
|
||||||
|
func_cl_dashL "${1#-L}"
|
||||||
|
;;
|
||||||
|
-static)
|
||||||
|
shared=false
|
||||||
|
;;
|
||||||
|
-Wl,*)
|
||||||
|
arg=${1#-Wl,}
|
||||||
|
save_ifs="$IFS"; IFS=','
|
||||||
|
for flag in $arg; do
|
||||||
|
IFS="$save_ifs"
|
||||||
|
linker_opts="$linker_opts $flag"
|
||||||
|
done
|
||||||
|
IFS="$save_ifs"
|
||||||
|
;;
|
||||||
|
-Xlinker)
|
||||||
|
eat=1
|
||||||
|
linker_opts="$linker_opts $2"
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
set x "$@" "$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||||
|
func_file_conv "$1"
|
||||||
|
set x "$@" -Tp"$file"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||||
|
func_file_conv "$1" mingw
|
||||||
|
set x "$@" "$file"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set x "$@" "$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
if test -n "$linker_opts"; then
|
||||||
|
linker_opts="-link$linker_opts"
|
||||||
|
fi
|
||||||
|
exec "$@" $linker_opts
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
eat=
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
'')
|
||||||
|
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
-h | --h*)
|
||||||
|
cat <<\EOF
|
||||||
|
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||||
|
|
||||||
|
Wrapper for compilers which do not understand '-c -o'.
|
||||||
|
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||||
|
arguments, and rename the output as expected.
|
||||||
|
|
||||||
|
If you are trying to build a whole package this is not the
|
||||||
|
right script to run: please start by reading the file 'INSTALL'.
|
||||||
|
|
||||||
|
Report bugs to <bug-automake@gnu.org>.
|
||||||
|
EOF
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-v | --v*)
|
||||||
|
echo "compile $scriptversion"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||||
|
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||||
|
func_cl_wrapper "$@" # Doesn't return...
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ofile=
|
||||||
|
cfile=
|
||||||
|
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$eat"; then
|
||||||
|
eat=
|
||||||
|
else
|
||||||
|
case $1 in
|
||||||
|
-o)
|
||||||
|
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||||
|
# So we strip '-o arg' only if arg is an object.
|
||||||
|
eat=1
|
||||||
|
case $2 in
|
||||||
|
*.o | *.obj)
|
||||||
|
ofile=$2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set x "$@" -o "$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*.c)
|
||||||
|
cfile=$1
|
||||||
|
set x "$@" "$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set x "$@" "$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -z "$ofile" || test -z "$cfile"; then
|
||||||
|
# If no '-o' option was seen then we might have been invoked from a
|
||||||
|
# pattern rule where we don't need one. That is ok -- this is a
|
||||||
|
# normal compilation that the losing compiler can handle. If no
|
||||||
|
# '.c' file was seen then we are probably linking. That is also
|
||||||
|
# ok.
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Name of file we expect compiler to create.
|
||||||
|
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||||
|
|
||||||
|
# Create the lock directory.
|
||||||
|
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||||
|
# that we are using for the .o file. Also, base the name on the expected
|
||||||
|
# object file name, since that is what matters with a parallel build.
|
||||||
|
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||||
|
while true; do
|
||||||
|
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
# FIXME: race condition here if user kills between mkdir and trap.
|
||||||
|
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||||
|
|
||||||
|
# Run the compile.
|
||||||
|
"$@"
|
||||||
|
ret=$?
|
||||||
|
|
||||||
|
if test -f "$cofile"; then
|
||||||
|
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||||
|
elif test -f "${cofile}bj"; then
|
||||||
|
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rmdir "$lockdir"
|
||||||
|
exit $ret
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
@ -0,0 +1,196 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
#
|
||||||
|
# This software is licensed as described in the file COPYING, which
|
||||||
|
# you should have received as part of this distribution. The terms
|
||||||
|
# are also available at https://curl.se/docs/copyright.html.
|
||||||
|
#
|
||||||
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the COPYING file.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: curl
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
prefix="@prefix@"
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
includedir=@includedir@
|
||||||
|
cppflag_curl_staticlib=@CPPFLAG_CURL_STATICLIB@
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
cat <<EOF
|
||||||
|
Usage: curl-config [OPTION]
|
||||||
|
|
||||||
|
Available values for OPTION include:
|
||||||
|
|
||||||
|
--built-shared says 'yes' if libcurl was built shared
|
||||||
|
--ca ca bundle install path
|
||||||
|
--cc compiler
|
||||||
|
--cflags pre-processor and compiler flags
|
||||||
|
--checkfor [version] check for (lib)curl of the specified version
|
||||||
|
--configure the arguments given to configure when building curl
|
||||||
|
--features newline separated list of enabled features
|
||||||
|
--help display this help and exit
|
||||||
|
--libs library linking information
|
||||||
|
--prefix curl install prefix
|
||||||
|
--protocols newline separated list of enabled protocols
|
||||||
|
--ssl-backends output the SSL backends libcurl was built to support
|
||||||
|
--static-libs static libcurl library linking information
|
||||||
|
--version output version information
|
||||||
|
--vernum output the version information as a number (hexadecimal)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
usage 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while test $# -gt 0; do
|
||||||
|
case "$1" in
|
||||||
|
# this deals with options in the style
|
||||||
|
# --option=value and extracts the value part
|
||||||
|
# [not currently used]
|
||||||
|
-*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||||
|
*) value= ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--built-shared)
|
||||||
|
echo @ENABLE_SHARED@
|
||||||
|
;;
|
||||||
|
|
||||||
|
--ca)
|
||||||
|
echo @CURL_CA_BUNDLE@
|
||||||
|
;;
|
||||||
|
|
||||||
|
--cc)
|
||||||
|
echo "@CC@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
--prefix)
|
||||||
|
echo "$prefix"
|
||||||
|
;;
|
||||||
|
|
||||||
|
--feature|--features)
|
||||||
|
for feature in @SUPPORT_FEATURES@ ""; do
|
||||||
|
test -n "$feature" && echo "$feature"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
|
--protocols)
|
||||||
|
for protocol in @SUPPORT_PROTOCOLS@; do
|
||||||
|
echo "$protocol"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
|
--version)
|
||||||
|
echo libcurl @CURLVERSION@
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
--checkfor)
|
||||||
|
checkfor=$2
|
||||||
|
cmajor=`echo $checkfor | cut -d. -f1`
|
||||||
|
cminor=`echo $checkfor | cut -d. -f2`
|
||||||
|
# when extracting the patch part we strip off everything after a
|
||||||
|
# dash as that's used for things like version 1.2.3-CVS
|
||||||
|
cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
|
||||||
|
|
||||||
|
vmajor=`echo @CURLVERSION@ | cut -d. -f1`
|
||||||
|
vminor=`echo @CURLVERSION@ | cut -d. -f2`
|
||||||
|
# when extracting the patch part we strip off everything after a
|
||||||
|
# dash as that's used for things like version 1.2.3-CVS
|
||||||
|
vpatch=`echo @CURLVERSION@ | cut -d. -f3 | cut -d- -f1`
|
||||||
|
|
||||||
|
if test "$vmajor" -gt "$cmajor"; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
if test "$vmajor" -eq "$cmajor"; then
|
||||||
|
if test "$vminor" -gt "$cminor"; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if test "$vminor" -eq "$cminor"; then
|
||||||
|
if test "$cpatch" -le "$vpatch"; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "requested version $checkfor is newer than existing @CURLVERSION@"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
--vernum)
|
||||||
|
echo @VERSIONNUM@
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
--help)
|
||||||
|
usage 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
--cflags)
|
||||||
|
if test "X$cppflag_curl_staticlib" = "X-DCURL_STATICLIB"; then
|
||||||
|
CPPFLAG_CURL_STATICLIB="-DCURL_STATICLIB "
|
||||||
|
else
|
||||||
|
CPPFLAG_CURL_STATICLIB=""
|
||||||
|
fi
|
||||||
|
if test "X@includedir@" = "X/usr/include"; then
|
||||||
|
echo "$CPPFLAG_CURL_STATICLIB"
|
||||||
|
else
|
||||||
|
echo "${CPPFLAG_CURL_STATICLIB}-I@includedir@"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
--libs)
|
||||||
|
if test "X@libdir@" != "X/usr/lib" -a "X@libdir@" != "X/usr/lib64"; then
|
||||||
|
CURLLIBDIR="-L@libdir@ "
|
||||||
|
else
|
||||||
|
CURLLIBDIR=""
|
||||||
|
fi
|
||||||
|
if test "X@ENABLE_SHARED@" = "Xno"; then
|
||||||
|
echo ${CURLLIBDIR}-lcurl @LIBCURL_LIBS@
|
||||||
|
else
|
||||||
|
echo ${CURLLIBDIR}-lcurl
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--ssl-backends)
|
||||||
|
echo "@SSL_BACKENDS@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
--static-libs)
|
||||||
|
if test "X@ENABLE_STATIC@" != "Xno" ; then
|
||||||
|
echo "@libdir@/libcurl.@libext@" @LDFLAGS@ @LIBCURL_LIBS@
|
||||||
|
else
|
||||||
|
echo "curl was built with static libraries disabled" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
--configure)
|
||||||
|
echo @CONFIGURE_OPTIONS@
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "unknown option: $1"
|
||||||
|
usage 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0
|