**/CMakeLists.txt,\
**/Makefile.am,\
**/Makefile.inc,\
- **/Makefile.mk,\
**/*.m4,\
**/*.mk,\
*.m4,\
'#define CURL_EXTERN_SYMBOL' => 1,
'#define CURL_OS "Linux"' => 1,
'#define CURL_OS "x86_64-pc-linux-gnu"' => 1,
- '#define CURL_SA_FAMILY_T ADDRESS_FAMILY' => 1,
- '#define CURL_SA_FAMILY_T sa_family_t' => 1,
'#define GETHOSTNAME_TYPE_ARG2 int' => 1,
'#define GETHOSTNAME_TYPE_ARG2 size_t' => 1,
- '#define HAVE_ADDRESS_FAMILY 1' => 1,
'#define HAVE_BROTLI 1' => 1,
'#define HAVE_BROTLI_DECODE_H 1' => 1,
'#define HAVE_DECL_GETPWUID_R 0' => 1,
'#define HAVE_OPENSSL_SSL_H 1' => 1,
'#define HAVE_OPENSSL_X509_H 1' => 1,
'#define HAVE_QUICHE_H 1' => 1,
- '#define HAVE_SA_FAMILY_T 1' => 1,
'#define HAVE_SETJMP_H 1' => 1,
'#define HAVE_SSL_ECH_SET1_ECHCONFIG 1' => 1,
'#define HAVE_SSL_SET1_ECH_CONFIG_LIST 1' => 1,
jobs:
netbsd:
- name: 'NetBSD (cmake, openssl, clang)'
+ name: 'NetBSD (CM, openssl, clang)'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
echo '::endgroup::'
openbsd:
- name: 'OpenBSD (cmake, libressl, clang)'
+ name: 'OpenBSD (CM, libressl, clang)'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
echo '::endgroup::'
freebsd:
- name: 'FreeBSD (${{ matrix.build }}, openssl, ${{ matrix.compiler }}, ${{ matrix.arch }})'
+ name: "FreeBSD (${{ matrix.build && 'CM' || 'AM' }}, openssl, ${{ matrix.compiler }}, ${{ matrix.arch }})"
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
echo '::endgroup::'
omnios:
- name: 'OmniOS (autotools, openssl, gcc, amd64)'
+ name: 'OmniOS (AM, openssl, gcc, amd64)'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
echo '::group::build examples'
gmake -j3 examples
echo '::endgroup::'
+
+ amiga:
+ name: "AmigaOS (${{ matrix.build == 'cmake' && 'CM' || 'AM' }}, AmiSSL, gcc, m68k)"
+ runs-on: 'ubuntu-24.04'
+ timeout-minutes: 30
+ env:
+ amissl-version: 5.18
+ strategy:
+ matrix:
+ build: [autotools, cmake]
+ fail-fast: false
+ steps:
+ - name: 'install compiler'
+ if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
+ run: |
+ cd "${HOME}" || exit 1
+ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 \
+ --location https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz | tar -xz
+ cd opt/appveyor || exit 1
+ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 \
+ --location https://github.com/jens-maus/amissl/releases/download/${{ env.amissl-version }}/AmiSSL-${{ env.amissl-version }}-SDK.lha --output bin.lha
+ 7z x -bd -y bin.lha
+ rm -f bin.lha
+ mv "$HOME/opt/appveyor" /opt
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
+
+ - name: 'configure'
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake -B bld \
+ -DAMIGA=1 \
+ -DCMAKE_SYSTEM_NAME=Generic \
+ -DCMAKE_SYSTEM_PROCESSOR=m68k \
+ -DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \
+ -DCMAKE_C_COMPILER=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-gcc \
+ -DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
+ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
+ -DCURL_WERROR=ON \
+ -DCURL_USE_LIBPSL=OFF \
+ -DAMISSL_INCLUDE_DIR=/opt/appveyor/AmiSSL/Developer/include \
+ -DAMISSL_STUBS_LIBRARY=/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \
+ -DAMISSL_AUTO_LIBRARY=/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a
+ else
+ autoreconf -fi
+ mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
+ CC=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-gcc \
+ AR=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-ar \
+ RANLIB=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-ranlib \
+ --host=m68k-amigaos \
+ --disable-shared \
+ --without-libpsl \
+ --with-amissl \
+ LDFLAGS=-L/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3 \
+ CPPFLAGS=-I/opt/appveyor/AmiSSL/Developer/include \
+ CFLAGS='-O0 -msoft-float -mcrt=clib2' \
+ LIBS='-lnet -lm -latomic'
+ fi
+
+ - name: 'configure log'
+ if: ${{ !cancelled() }}
+ run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
+
+ - name: 'curl_config.h'
+ run: |
+ echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
+ grep -F '#define' bld/lib/curl_config.h | sort || true
+
+ - name: 'build'
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake --build bld --parallel 5
+ else
+ make -j5 -C bld
+ fi
+
+ - name: 'build tests'
+ if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake --build bld --parallel 5 --target testdeps
+ else
+ make -j5 -C bld -C tests
+ fi
+
+ - name: 'build examples'
+ if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake --build bld --parallel 5 --target curl-examples
+ else
+ make -j5 -C bld examples
+ fi
+
+ msdos:
+ name: "MS-DOS (${{ matrix.build == 'cmake' && 'CM' || 'AM' }}, openssl, djgpp, i586)"
+ runs-on: 'ubuntu-24.04'
+ timeout-minutes: 30
+ env:
+ toolchain-version: '3.4'
+ strategy:
+ matrix:
+ build: [autotools, cmake]
+ fail-fast: false
+ steps:
+ - name: 'install packages'
+ run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install libfl2 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
+
+ - name: 'cache compiler (djgpp)'
+ uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
+ id: cache-compiler
+ with:
+ path: ~/djgpp
+ key: ${{ runner.os }}-djgpp-${{ env.toolchain-version }}-amd64
+
+ - name: 'install compiler (djgpp)'
+ if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
+ run: |
+ cd "${HOME}" || exit 1
+ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 \
+ --location 'https://github.com/andrewwutw/build-djgpp/releases/download/v${{ env.toolchain-version }}/djgpp-linux64-gcc1220.tar.bz2' | tar -xj
+ cd djgpp || exit 1
+ for f in wat3211b.zip zlb13b.zip ssl102ub.zip; do
+ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 \
+ "https://www.delorie.com/pub/djgpp/current/v2tk/$f" --output bin.zip
+ unzip -q bin.zip
+ rm -f bin.zip
+ done
+
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
+
+ - name: 'configure'
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake -B bld -G Ninja \
+ -DCMAKE_SYSTEM_NAME=DOS \
+ -DCMAKE_SYSTEM_PROCESSOR=x86 \
+ -DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
+ -DCMAKE_C_COMPILER=$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc \
+ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
+ -DCURL_WERROR=ON \
+ -DCURL_USE_LIBPSL=OFF \
+ -DOPENSSL_INCLUDE_DIR=$HOME/djgpp/include \
+ -DOPENSSL_SSL_LIBRARY=$HOME/djgpp/lib/libssl.a \
+ -DOPENSSL_CRYPTO_LIBRARY=$HOME/djgpp/lib/libcrypto.a \
+ -DZLIB_INCLUDE_DIR=$HOME/djgpp/include" \
+ -DZLIB_LIBRARY=$HOME/djgpp/lib/libz.a" \
+ -DWATT_ROOT=$HOME/djgpp/net/watt
+ else
+ autoreconf -fi
+ mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
+ CC=$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc \
+ AR=$HOME/djgpp/bin/i586-pc-msdosdjgpp-ar \
+ RANLIB=$HOME/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
+ WATT_ROOT=$HOME/djgpp/net/watt \
+ --host=i586-pc-msdosdjgpp \
+ --with-openssl=$HOME/djgpp \
+ --with-zlib=$HOME/djgpp \
+ --without-libpsl \
+ --disable-shared
+ fi
+
+ - name: 'configure log'
+ if: ${{ !cancelled() }}
+ run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
+
+ - name: 'curl_config.h'
+ run: |
+ echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
+ grep -F '#define' bld/lib/curl_config.h | sort || true
+
+ - name: 'build'
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake --build bld
+ else
+ make -j5 -C bld
+ fi
+
+ - name: 'build tests'
+ if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake --build bld --target testdeps
+ else
+ make -j5 -C bld -C tests
+ fi
+
+ - name: 'build examples'
+ if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
+ run: |
+ if [ '${{ matrix.build }}' = 'cmake' ]; then
+ cmake --build bld --target curl-examples
+ else
+ make -j5 -C bld examples
+ fi
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
# so disable symbol hiding for debug builds and for memory tracking.
set(CURL_HIDDEN_SYMBOLS OFF)
+elseif(DOS OR AMIGA)
+ set(CURL_HIDDEN_SYMBOLS OFF)
endif()
set(CURL_HIDES_PRIVATE_SYMBOLS FALSE)
#ifdef HAVE_IOCTLSOCKET_CAMEL
/* includes start */
-#ifdef _WIN32
-# include <winsock2.h>
-#endif
+#include <proto/bsdsocket.h>
int main(void)
{
/* IoctlSocket source code */
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
/* includes start */
-#ifdef _WIN32
-# include <winsock2.h>
+#include <proto/bsdsocket.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
#endif
int main(void)
{
if(_GSS_INCLUDE_DIRS) # jay, we have found something
cmake_push_check_state()
- set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIRS}")
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIRS}")
check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)
if(_gss_have_mit_headers)
set(CMAKE_EXTRA_INCLUDE_FILES "")
if(WIN32)
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
- set(CMAKE_REQUIRED_LIBRARIES "ws2_32")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32")
elseif(HAVE_SYS_SOCKET_H)
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
endif()
if(CURL_WERROR AND
((CMAKE_COMPILER_IS_GNUCC AND
+ NOT DOS AND # Watt-32 headers use the '#include_next' GCC extension
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND
NOT CMAKE_VERSION VERSION_LESS 3.23.0) OR # to avoid check_symbol_exists() conflicting with GCC -pedantic-errors
CMAKE_C_COMPILER_ID MATCHES "Clang"))
if(MSYS)
set(_target_flags "${_target_flags} MSYS")
endif()
+if(DOS)
+ set(_target_flags "${_target_flags} DOS")
+endif()
+if(AMIGA)
+ set(_target_flags "${_target_flags} AMIGA")
+endif()
if(CMAKE_COMPILER_IS_GNUCC)
set(_target_flags "${_target_flags} GCC")
endif()
endif()
# Avoid storing HAVE_WIN32_WINNT in CMake cache
unset(HAVE_WIN32_WINNT CACHE)
+elseif(DOS OR AMIGA)
+ set(BUILD_SHARED_LIBS OFF)
+ set(BUILD_STATIC_LIBS ON)
+ if(DOS AND CMAKE_COMPILER_IS_GNUCC)
+ set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+ set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+ set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ endif()
endif()
option(CURL_LTO "Enable compiler Link Time Optimizations" OFF)
cmake_dependent_option(ENABLE_THREADED_RESOLVER "Enable threaded DNS lookup"
- ON "NOT ENABLE_ARES"
+ ON "NOT ENABLE_ARES;NOT DOS;NOT AMIGA"
OFF)
include(PickyWarnings)
check_struct_has_member("struct sockaddr_in6" "sin6_addr" "netinet/in.h" HAVE_SOCKADDR_IN6_SIN6_ADDR)
check_struct_has_member("struct sockaddr_in6" "sin6_scope_id" "netinet/in.h" HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
if(NOT HAVE_SOCKADDR_IN6_SIN6_ADDR)
- message(WARNING "struct sockaddr_in6 not available, disabling IPv6 support")
+ if(NOT DOS AND NOT AMIGA)
+ message(WARNING "struct sockaddr_in6 not available, disabling IPv6 support")
+ endif()
# Force the feature off as this name is used as guard macro...
set(ENABLE_IPV6 OFF CACHE BOOL "Enable IPv6 support" FORCE)
endif()
# If we are on Haiku, make sure that the network library is brought in.
if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
list(APPEND CURL_LIBS "network")
+elseif(AMIGA)
+ list(APPEND CURL_LIBS "net" "m" "atomic")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "net" "m" "atomic")
endif()
# Include all the necessary files for macros
set(HAVE_EVENTFD 0)
set(HAVE_GETPASS_R 0)
set(HAVE_SENDMMSG 0)
+elseif(AMIGA)
+ set(HAVE_GETADDRINFO 0) # Breaks the build when detected and used.
endif()
if(ENABLE_THREADED_RESOLVER)
endif()
# Check for all needed libraries
-if(NOT WIN32 AND NOT APPLE)
+if(DOS)
+ if(WATT_ROOT)
+ set(USE_WATT32 ON)
+ # FIXME upstream: must specify the full path to avoid CMake converting "watt" to "watt.lib"
+ list(APPEND CURL_LIBS "${WATT_ROOT}/lib/libwatt.a")
+ include_directories(SYSTEM "${WATT_ROOT}/inc")
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${WATT_ROOT}/inc")
+ else()
+ message(FATAL_ERROR "Set WATT_ROOT variable to the root installation of Watt-32.")
+ endif()
+elseif(AMIGA)
+ if(AMISSL_INCLUDE_DIR AND AMISSL_STUBS_LIBRARY AND AMISSL_AUTO_LIBRARY)
+ set(USE_AMISSL ON)
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${AMISSL_INCLUDE_DIR}")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${AMISSL_STUBS_LIBRARY}" "${AMISSL_AUTO_LIBRARY}")
+ set(OPENSSL_INCLUDE_DIR "${AMISSL_INCLUDE_DIR}")
+ set(OPENSSL_SSL_LIBRARY "${AMISSL_STUBS_LIBRARY}")
+ set(OPENSSL_CRYPTO_LIBRARY "${AMISSL_AUTO_LIBRARY}")
+ set(CURL_USE_OPENSSL ON)
+ set(CURL_CA_FALLBACK ON CACHE BOOL "")
+ endif()
+elseif(NOT WIN32 AND NOT APPLE)
check_library_exists("socket" "connect" "" HAVE_LIBSOCKET)
if(HAVE_LIBSOCKET)
set(CURL_LIBS "socket;${CURL_LIBS}")
endif()
endif()
-check_function_exists("gethostname" HAVE_GETHOSTNAME)
-
if(WIN32)
list(APPEND CURL_LIBS "ws2_32" "bcrypt")
endif()
set(_curl_ca_bundle_supported TRUE)
cmake_push_check_state()
- set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
if(NOT DEFINED HAVE_BORINGSSL)
check_symbol_exists("OPENSSL_IS_BORINGSSL" "openssl/base.h" HAVE_BORINGSSL)
endif()
if(NOT DEFINED HAVE_AWSLC)
check_symbol_exists("OPENSSL_IS_AWSLC" "openssl/base.h" HAVE_AWSLC)
endif()
+ if(NOT DEFINED HAVE_LIBRESSL)
+ check_symbol_exists("LIBRESSL_VERSION_NUMBER" "openssl/opensslv.h" HAVE_LIBRESSL)
+ endif()
cmake_pop_check_state()
+
+ if(HAVE_BORINGSSL)
+ set(_openssl "BoringSSL")
+ elseif(HAVE_AWSLC)
+ set(_openssl "AWS-LC")
+ elseif(HAVE_LIBRESSL)
+ set(_openssl "LibreSSL")
+ elseif(USE_AMISSL)
+ set(_openssl "AmiSSL")
+ else()
+ set(_openssl "OpenSSL")
+ endif()
endif()
if(CURL_USE_MBEDTLS)
if(NOT DEFINED HAVE_GNUTLS_SRP AND NOT CURL_DISABLE_SRP)
cmake_push_check_state()
- set(CMAKE_REQUIRED_INCLUDES ${GNUTLS_INCLUDE_DIRS})
- set(CMAKE_REQUIRED_LIBRARIES ${GNUTLS_LIBRARIES})
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${GNUTLS_INCLUDE_DIRS})
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${GNUTLS_LIBRARIES})
check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP)
cmake_pop_check_state()
endif()
macro(curl_openssl_check_symbol_exists _symbol _files _variable _extra_libs)
cmake_push_check_state()
if(USE_OPENSSL)
- set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
- set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
if(HAVE_LIBZ)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${ZLIB_LIBRARIES}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt") # for OpenSSL/LibreSSL
endif()
elseif(USE_WOLFSSL)
- set(CMAKE_REQUIRED_INCLUDES "${WOLFSSL_INCLUDE_DIRS}")
- set(CMAKE_REQUIRED_LIBRARIES "${WOLFSSL_LIBRARIES}")
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${WOLFSSL_INCLUDE_DIRS}")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${WOLFSSL_LIBRARIES}")
curl_required_libpaths("${WOLFSSL_LIBRARY_DIRS}")
if(HAVE_LIBZ)
list(APPEND CMAKE_REQUIRED_INCLUDES "${ZLIB_INCLUDE_DIRS}") # Public wolfSSL headers require zlib headers
else()
find_package(NGTCP2 REQUIRED "quictls")
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libngtcp2_crypto_quictls")
+ if(NOT HAVE_LIBRESSL)
+ set(_openssl "quictls")
+ endif()
endif()
curl_openssl_check_quic()
elseif(USE_GNUTLS)
endif()
if(NOT DEFINED HAVE_QUICHE_CONN_SET_QLOG_FD)
cmake_push_check_state()
- set(CMAKE_REQUIRED_INCLUDES "${QUICHE_INCLUDE_DIRS}")
- set(CMAKE_REQUIRED_LIBRARIES "${QUICHE_LIBRARIES}")
+ list(APPEND CMAKE_REQUIRED_INCLUDES "${QUICHE_INCLUDE_DIRS}")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${QUICHE_LIBRARIES}")
check_symbol_exists("quiche_conn_set_qlog_fd" "quiche.h" HAVE_QUICHE_CONN_SET_QLOG_FD)
cmake_pop_check_state()
endif()
# Check for LDAP
cmake_push_check_state()
if(USE_OPENSSL)
- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
endif()
find_package(LDAP)
if(LDAP_FOUND)
option(USE_APPLE_IDN "Use Apple built-in IDN support" OFF)
if(USE_APPLE_IDN)
cmake_push_check_state()
- set(CMAKE_REQUIRED_LIBRARIES "icucore")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "icucore")
check_symbol_exists("uidna_openUTS46" "unicode/uidna.h" HAVE_APPLE_IDN)
cmake_pop_check_state()
if(HAVE_APPLE_IDN)
endif()
if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE)
- set(CMAKE_REQUIRED_FLAGS ${GSS_CFLAGS})
- set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES})
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${GSS_CFLAGS}")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES})
curl_required_libpaths("${GSS_LIBRARY_DIRS}")
check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" "${_include_list}" HAVE_GSS_C_NT_HOSTBASED_SERVICE)
endif()
option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON)
if(ENABLE_UNIX_SOCKETS)
- if(WIN32)
+ if(WIN32 OR DOS)
set(USE_UNIX_SOCKETS ON)
else()
include(CheckStructHasMember)
check_include_file_concat_curl("sys/time.h" HAVE_SYS_TIME_H)
check_include_file_concat_curl("sys/types.h" HAVE_SYS_TYPES_H)
check_include_file("sys/un.h" HAVE_SYS_UN_H)
-check_include_file("sys/utime.h" HAVE_SYS_UTIME_H)
+check_include_file_concat_curl("sys/utime.h" HAVE_SYS_UTIME_H) # sys/types.h (AmigaOS)
check_include_file("sys/xattr.h" HAVE_SYS_XATTR_H)
check_include_file_concat_curl("arpa/inet.h" HAVE_ARPA_INET_H)
check_include_file_concat_curl("unistd.h" HAVE_UNISTD_H)
check_include_file("utime.h" HAVE_UTIME_H)
-if(CMAKE_SYSTEM_NAME MATCHES "AmigaOS")
+if(AMIGA)
check_include_file_concat_curl("proto/bsdsocket.h" HAVE_PROTO_BSDSOCKET_H)
endif()
endif()
# Check for some functions that are used
+
+# Apply to all feature checks
if(WIN32)
- list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32") # Apply to all feature checks
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32")
elseif(HAVE_LIBSOCKET)
- list(APPEND CMAKE_REQUIRED_LIBRARIES "socket") # Apply to all feature checks
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "socket")
+elseif(DOS)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${WATT_ROOT}/lib/libwatt.a")
endif()
check_function_exists("fnmatch" HAVE_FNMATCH)
check_symbol_exists("gmtime_r" "stdlib.h;time.h" HAVE_GMTIME_R)
check_symbol_exists("gethostbyname_r" "netdb.h" HAVE_GETHOSTBYNAME_R)
+check_symbol_exists("gethostname" "${CURL_INCLUDES}" HAVE_GETHOSTNAME) # winsock2.h unistd.h proto/bsdsocket.h
check_symbol_exists("signal" "signal.h" HAVE_SIGNAL)
check_symbol_exists("strtoll" "stdlib.h" HAVE_STRTOLL)
check_function_exists("_setmode" HAVE__SETMODE)
endif()
-if(CMAKE_SYSTEM_NAME MATCHES "AmigaOS")
+if(AMIGA)
check_symbol_exists("CloseSocket" "${CURL_INCLUDES}" HAVE_CLOSESOCKET_CAMEL) # sys/socket.h proto/bsdsocket.h
endif()
cmake_push_check_state()
if(WIN32)
- set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY)
set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY})
elseif(HAVE_SYS_SOCKET_H)
- set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T)
set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T})
endif()
cmake_push_check_state()
if(HAVE_FILE_OFFSET_BITS)
set(_FILE_OFFSET_BITS 64)
- set(CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
endif()
check_type_size("off_t" SIZEOF_OFF_T)
# Include this header to get the type
cmake_push_check_state()
-set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/include")
-set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h")
+list(APPEND CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/include")
+list(APPEND CMAKE_EXTRA_INCLUDE_FILES "curl/system.h")
check_type_size("curl_off_t" SIZEOF_CURL_OFF_T)
-set(CMAKE_EXTRA_INCLUDE_FILES "curl/curl.h")
+list(APPEND CMAKE_EXTRA_INCLUDE_FILES "curl/curl.h")
check_type_size("curl_socket_t" SIZEOF_CURL_SOCKET_T)
cmake_pop_check_state() # pop curl system headers
cmake_pop_check_state() # pop -D_FILE_OFFSET_BITS=64
# Clear list and collect SSL backends
set(_items "")
curl_add_if("Schannel" _ssl_enabled AND USE_SCHANNEL)
-curl_add_if("OpenSSL" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_LESS 3.0.0)
-curl_add_if("OpenSSL v3+" _ssl_enabled AND USE_OPENSSL AND NOT OPENSSL_VERSION VERSION_LESS 3.0.0)
+curl_add_if("${_openssl}" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_LESS 3.0.0)
+curl_add_if("${_openssl} v3+" _ssl_enabled AND USE_OPENSSL AND NOT OPENSSL_VERSION VERSION_LESS 3.0.0)
curl_add_if("Secure Transport" _ssl_enabled AND USE_SECTRANSP)
curl_add_if("mbedTLS" _ssl_enabled AND USE_MBEDTLS)
curl_add_if("BearSSL" _ssl_enabled AND USE_BEARSSL)
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
./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
fi
case $host_os in
msys*) curl_pflags="${curl_pflags} MSYS";;
+ msdos*) curl_pflags="${curl_pflags} DOS";;
+ amiga*) curl_pflags="${curl_pflags} AMIGA";;
esac
if test "x$compiler_id" = 'xGNU_C'; then
curl_pflags="${curl_pflags} GCC"
if test "$HAVE_GETHOSTBYNAME" != "1"; then
dnl gethostbyname in the watt lib?
+ clean_CPPFLAGS=$CPPFLAGS
+ clean_LDFLAGS=$LDFLAGS
+ CPPFLAGS="-I${WATT_ROOT}/inc"
+ LDFLAGS="-L${WATT_ROOT}/lib"
AC_CHECK_LIB(watt, gethostbyname,
[
HAVE_GETHOSTBYNAME="1"
- CPPFLAGS="-I${WATT_ROOT}/inc"
- LDFLAGS="-L${WATT_ROOT}/lib"
LIBS="-lwatt $LIBS"
+ AC_DEFINE(USE_WATT32, 1, [if Watt-32 is in use])
+ ],
+ [
+ CPPFLAGS=$clean_CPPFLAGS
+ LDFLAGS=$clean_LDFLAGS
]
)
fi
;;
esac ],
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
- /* are AF_INET6 and sockaddr_in6 available? */
- #include <sys/types.h>
- #ifdef _WIN32
- #include <winsock2.h>
- #include <ws2tcpip.h>
- #else
- #include <sys/socket.h>
- #include <netinet/in.h>
- #if defined (__TANDEM)
- # include <netinet/in6.h>
- #endif
- #endif
-
- int main(void)
- {
- struct sockaddr_in6 s;
- (void)s;
- return socket(AF_INET6, SOCK_STREAM, 0) < 0;
- }
- ]])
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE([[
+ /* are AF_INET6 and sockaddr_in6 available? */
+ #include <sys/types.h>
+ #ifdef _WIN32
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+ #else
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #ifdef __TANDEM
+ #include <netinet/in6.h>
+ #endif
+ #endif
+
+ int main(void)
+ {
+ struct sockaddr_in6 s;
+ (void)s;
+ return socket(AF_INET6, SOCK_STREAM, 0) < 0;
+ }
+ ]])
],
- AC_MSG_RESULT(yes)
- ipv6=yes,
- AC_MSG_RESULT(no)
- ipv6=no,
- AC_MSG_RESULT(yes)
- ipv6=yes
-))
+ AC_MSG_RESULT(yes)
+ ipv6=yes,
+ AC_MSG_RESULT(no)
+ ipv6=no
+ )
+)
if test "$ipv6" = yes; then
curl_ipv6_msg="enabled"
IPV6_ENABLED=1
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
- AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
- #include <sys/types.h>
- #ifdef _WIN32
- #include <winsock2.h>
- #include <ws2tcpip.h>
- #else
- #include <netinet/in.h>
- #if defined (__TANDEM)
- # include <netinet/in6.h>
- #endif
- #endif
- ]], [[
- struct sockaddr_in6 s;
- s.sin6_scope_id = 0;
- ]])], [
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #ifdef _WIN32
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+ #else
+ #include <netinet/in.h>
+ #ifdef __TANDEM
+ #include <netinet/in6.h>
+ #endif
+ #endif
+ ]], [[
+ struct sockaddr_in6 s;
+ s.sin6_scope_id = 0;
+ ]])
+ ],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
- ], [
+ ],[
AC_MSG_RESULT([no])
])
fi
# check for sa_family_t
AC_CHECK_TYPE(sa_family_t,
- AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
+ AC_DEFINE(HAVE_SA_FAMILY_T, 1, [Define to 1 if symbol `sa_family_t' exists]),
[
# The Windows name?
AC_CHECK_TYPE(ADDRESS_FAMILY,
- AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
- AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
+ AC_DEFINE(HAVE_ADDRESS_FAMILY, 1, [Define to 1 if symbol `ADDRESS_FAMILY' exists]),
+ [],
[
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
- `CURL_ENABLE_SSL`: Enable SSL support. Default: `ON`
- `CURL_WINDOWS_SSPI`: Enable SSPI on Windows. Default: =`CURL_USE_SCHANNEL`
-- `ENABLE_IPV6`: Enable IPv6 support. Default: `ON`
-- `ENABLE_THREADED_RESOLVER`: Enable threaded DNS lookup. Default: `ON` if c-ares is not enabled
+- `ENABLE_IPV6`: Enable IPv6 support. Default: `ON` if target supports IPv6.
+- `ENABLE_THREADED_RESOLVER`: Enable threaded DNS lookup. Default: `ON` if c-ares is not enabled and target supports threading.
- `ENABLE_UNICODE`: Use the Unicode version of the Windows API functions. Default: `OFF`
- `ENABLE_UNIX_SOCKETS`: Enable Unix domain sockets support. Default: `ON`
- `USE_ECH`: Enable ECH support. Default: `OFF`
## Dependency options
- `PERL_EXECUTABLE` Perl binary used throughout the build and tests.
+- `AMISSL_INCLUDE_DIR`: The AmiSSL include directory.
+- `AMISSL_STUBS_LIBRARY`: Path to `amisslstubs` library.
+- `AMISSL_AUTO_LIBRARY`: Path to `amisslauto` library.
- `BEARSSL_INCLUDE_DIR`: The BearSSL include directory.
- `BEARSSL_LIBRARY`: Path to `bearssl` library.
- `BROTLI_INCLUDE_DIR`: The brotli include directory.
- `QUICHE_LIBRARY`: Path to `quiche` library.
- `RUSTLS_INCLUDE_DIR`: The Rustls include directory.
- `RUSTLS_LIBRARY`: Path to `rustls` library.
+- `WATT_ROOT`: Set this variable to the root installation of Watt-32.
- `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory.
- `WOLFSSH_LIBRARY`: Path to `wolfssh` library.
- `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory.
## MS-DOS
-Requires DJGPP in the search path and pointing to the Watt-32 stack via
-`WATT_PATH=c:/djgpp/net/watt`.
-
-Run `make -f Makefile.dist djgpp` in the root curl dir.
-
-For build configuration options, please see the mingw-w64 section.
+You can use either autotools or cmake:
+
+ ./configure \
+ CC=/path/to/djgpp/bin/i586-pc-msdosdjgpp-gcc \
+ AR=/path/to/djgpp/bin/i586-pc-msdosdjgpp-ar \
+ RANLIB=/path/to/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
+ WATT_ROOT=/path/to/djgpp/net/watt \
+ --host=i586-pc-msdosdjgpp \
+ --with-openssl=/path/to/djgpp \
+ --with-zlib=/path/to/djgpp \
+ --without-libpsl \
+ --disable-shared
+
+ cmake . \
+ -DCMAKE_SYSTEM_NAME=DOS \
+ -DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
+ -DCMAKE_C_COMPILER=/path/to/djgpp/bin/i586-pc-msdosdjgpp-gcc \
+ -DWATT_ROOT=/path/to/djgpp/net/watt \
+ -DOPENSSL_INCLUDE_DIR=/path/to/djgpp/include \
+ -DOPENSSL_SSL_LIBRARY=/path/to/djgpp/lib/libssl.a \
+ -DOPENSSL_CRYPTO_LIBRARY=/path/to/djgpp/lib/libcrypto.a \
+ -DZLIB_INCLUDE_DIR=/path/to/djgpp/include \
+ -DZLIB_LIBRARY=/path/to/djgpp/lib/libz.a \
+ -DCURL_USE_LIBPSL=OFF
Notes:
- - DJGPP 2.04 beta has a `sscanf()` bug so the URL parsing is not done
- properly. Use DJGPP 2.03 until they fix it.
+ - Requires DJGPP 2.04 or upper.
- Compile Watt-32 (and OpenSSL) with the same version of DJGPP. Otherwise
things go wrong because things like FS-extensions and `errno` values have
## AmigaOS
-Run `make -f Makefile.dist amiga` in the root curl dir.
-
-For build configuration options, please see the mingw-w64 section.
+You can use either autotools or cmake:
+
+ ./configure \
+ CC=/opt/amiga/bin/m68k-amigaos-gcc \
+ AR=/opt/amiga/bin/m68k-amigaos-ar \
+ RANLIB=/opt/amiga/bin/m68k-amigaos-ranlib \
+ --host=m68k-amigaos \
+ --with-amissl \
+ CFLAGS='-O0 -msoft-float -mcrt=clib2' \
+ CPPFLAGS=-I/path/to/AmiSSL/Developer/include \
+ LDFLAGS=-L/path/to/AmiSSL/Developer/lib/AmigaOS3 \
+ LIBS='-lnet -lm -latomic' \
+ --without-libpsl \
+ --disable-shared
+
+ cmake . \
+ -DAMIGA=1 \
+ -DCMAKE_SYSTEM_NAME=Generic \
+ -DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \
+ -DCMAKE_C_COMPILER=/opt/amiga/bin/m68k-amigaos-gcc \
+ -DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
+ -DAMISSL_INCLUDE_DIR=/path/to/AmiSSL/Developer/include \
+ -DAMISSL_STUBS_LIBRARY=/path/to/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \
+ -DAMISSL_AUTO_LIBRARY=/path/to/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a \
+ -DCURL_USE_LIBPSL=OFF
## Disabling Specific Protocols in Windows builds
AUTOMAKE_OPTIONS = foreign nostdinc
-EXTRA_DIST = README.md Makefile.example Makefile.mk CMakeLists.txt \
+EXTRA_DIST = README.md Makefile.example CMakeLists.txt \
$(COMPLICATED_EXAMPLES) .checksrc
# Specify our include paths here, and do it relative to $(top_srcdir) and
+++ /dev/null
-#***************************************************************************
-# _ _ ____ _
-# 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
-#
-#***************************************************************************
-
-# Build libcurl via lib/Makefile.mk first.
-
-PROOT := ../..
-
-### Common
-
-include $(PROOT)/lib/Makefile.mk
-
-### Local
-
-CPPFLAGS += -DCURL_NO_OLDIES
-LDFLAGS += -L$(PROOT)/lib
-LIBS := -lcurl $(LIBS)
-
-### Sources and targets
-
-# Provides check_PROGRAMS
-include Makefile.inc
-
-TARGETS := $(patsubst %,%$(BIN_EXT),$(strip $(check_PROGRAMS)))
-TOCLEAN := $(TARGETS)
-
-### Rules
-
-%$(BIN_EXT): %.c $(PROOT)/lib/libcurl.a
- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LIBS)
-
-all: $(TARGETS)
#include <stdio.h>
#include <curl/curl.h>
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(MSDOS) && !defined(__AMIGA__)
#include <net/if.h>
#endif
int main(void)
{
-#ifndef _WIN32
- /* Windows users need to find how to use if_nametoindex() */
+#if !defined(_WIN32) && !defined(MSDOS) && !defined(__AMIGA__)
+ /* Windows/MS-DOS users need to find how to use if_nametoindex() */
CURL *curl;
CURLcode res;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
+#if defined(MSDOS) || defined(__AMIGA__)
+ timeout.tv_sec = (time_t)(curl_timeo / 1000);
+#else
timeout.tv_sec = curl_timeo / 1000;
+#endif
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
+#if defined(MSDOS) || defined(__AMIGA__)
+ timeout.tv_usec = (time_t)(curl_timeo % 1000) * 1000;
+#else
timeout.tv_usec = (int)(curl_timeo % 1000) * 1000;
+#endif
}
/* get file descriptors from the transfers */
rc = 0;
#else
/* Portable sleep for platforms other than Windows. */
- struct timeval wait = { 0, 100 * 1000 }; /* 100ms */
+ struct timeval wait = {0};
+ wait.tv_usec = 100 * 1000; /* 100ms */
rc = select(0, NULL, NULL, NULL, &wait);
#endif
}
fd_set infd, outfd, errfd;
int res;
+#if defined(MSDOS) || defined(__AMIGA__)
+ tv.tv_sec = (time_t)(timeout_ms / 1000);
+ tv.tv_usec = (time_t)(timeout_ms % 1000) * 1000;
+#else
tv.tv_sec = timeout_ms / 1000;
tv.tv_usec = (int)(timeout_ms % 1000) * 1000;
+#endif
FD_ZERO(&infd);
FD_ZERO(&outfd);
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
+#if defined(__DJGPP__)
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4127) /* conditional expression is constant */
CHECKSRC_DIST = .checksrc vauth/.checksrc vquic/.checksrc vssh/.checksrc \
vtls/.checksrc
-EXTRA_DIST = Makefile.mk config-win32.h config-win32ce.h config-plan9.h \
- config-riscos.h config-mac.h curl_config.h.in config-dos.h libcurl.rc \
- config-amigaos.h config-win32ce.h config-os400.h setup-os400.h \
+EXTRA_DIST = config-win32.h config-win32ce.h config-plan9.h \
+ config-riscos.h config-mac.h curl_config.h.in libcurl.rc \
+ config-win32ce.h config-os400.h setup-os400.h \
$(CMAKE_DIST) setup-win32.h Makefile.soname optiontable.pl libcurl.def \
$(CHECKSRC_DIST)
+++ /dev/null
-#***************************************************************************
-# _ _ ____ _
-# 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
-#
-#***************************************************************************
-
-# Makefile to build curl parts with GCC-like toolchains and optional features.
-#
-# Usage: make -f Makefile.mk CFG=-feat1[-feat2][-feat3][...]
-# Example: make -f Makefile.mk CFG=-zlib-ssl-libssh2-ipv6
-#
-# Look for ' ?=' to find accepted customization variables.
-
-# This script is reused by 'src' and 'docs/examples' Makefile.mk scripts.
-
-ifndef PROOT
- PROOT := ..
- LOCAL := 1
-endif
-
-### Common
-
-CFLAGS ?=
-CPPFLAGS ?=
-LDFLAGS ?=
-LIBS ?=
-
-CROSSPREFIX ?=
-
-ifeq ($(CC),cc)
- CC := gcc
-endif
-CC := $(CROSSPREFIX)$(CC)
-AR := $(CROSSPREFIX)$(AR)
-
-TRIPLET ?= $(shell $(CC) -dumpmachine)
-
-BIN_EXT :=
-
-ifneq ($(findstring msdos,$(TRIPLET)),)
- # Cross-tools: https://github.com/andrewwutw/build-djgpp
- MSDOS := 1
- BIN_EXT := .exe
-else ifneq ($(findstring amigaos,$(TRIPLET)),)
- # Cross-tools: https://github.com/bebbo/amiga-gcc
- AMIGA := 1
-endif
-
-CPPFLAGS += -I. -I$(PROOT)/include
-
-### Deprecated settings. For compatibility.
-
-ifdef WATT_ROOT
- WATT_PATH := $(realpath $(WATT_ROOT))
-endif
-
-### Optional features
-
-ifneq ($(findstring -debug,$(CFG)),)
- CFLAGS += -g
- CPPFLAGS += -DDEBUGBUILD
-else
- CPPFLAGS += -DNDEBUG
-endif
-ifneq ($(findstring -trackmem,$(CFG)),)
- CPPFLAGS += -DCURLDEBUG
-endif
-ifneq ($(findstring -map,$(CFG)),)
- MAP := 1
-endif
-
-# CPPFLAGS below are only necessary when building libcurl via 'lib' (see
-# comments below about exceptions). Always include them anyway to match
-# behavior of other build systems.
-
-ifneq ($(findstring -sync,$(CFG)),)
- CPPFLAGS += -DUSE_SYNC_DNS
-else ifneq ($(findstring -ares,$(CFG)),)
- LIBCARES_PATH ?= $(PROOT)/../c-ares
- CPPFLAGS += -DUSE_ARES
- CPPFLAGS += -isystem "$(LIBCARES_PATH)/include"
- LDFLAGS += -L"$(LIBCARES_PATH)/lib"
- LIBS += -lcares
-endif
-
-ifneq ($(findstring -rtmp,$(CFG)),)
- LIBRTMP_PATH ?= $(PROOT)/../librtmp
- CPPFLAGS += -DUSE_LIBRTMP
- CPPFLAGS += -isystem "$(LIBRTMP_PATH)"
- LDFLAGS += -L"$(LIBRTMP_PATH)/librtmp"
- LIBS += -lrtmp
- ZLIB := 1
-endif
-
-ifneq ($(findstring -ssh2,$(CFG)),)
- LIBSSH2_PATH ?= $(PROOT)/../libssh2
- CPPFLAGS += -DUSE_LIBSSH2
- CPPFLAGS += -isystem "$(LIBSSH2_PATH)/include"
- LDFLAGS += -L"$(LIBSSH2_PATH)/lib"
- LIBS += -lssh2
-else ifneq ($(findstring -libssh,$(CFG)),)
- LIBSSH_PATH ?= $(PROOT)/../libssh
- CPPFLAGS += -DUSE_LIBSSH
- CPPFLAGS += -isystem "$(LIBSSH_PATH)/include"
- LDFLAGS += -L"$(LIBSSH_PATH)/lib"
- LIBS += -lssh
-else ifneq ($(findstring -wolfssh,$(CFG)),)
- WOLFSSH_PATH ?= $(PROOT)/../wolfssh
- CPPFLAGS += -DUSE_WOLFSSH
- CPPFLAGS += -isystem "$(WOLFSSH_PATH)/include"
- LDFLAGS += -L"$(WOLFSSH_PATH)/lib"
- LIBS += -lwolfssh
-endif
-
-ifneq ($(findstring -ssl,$(CFG)),)
- OPENSSL_PATH ?= $(PROOT)/../openssl
- CPPFLAGS += -DUSE_OPENSSL
- CPPFLAGS += -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
- OPENSSL_INCLUDE ?= $(OPENSSL_PATH)/include
- OPENSSL_LIBPATH ?= $(OPENSSL_PATH)/lib
- CPPFLAGS += -isystem "$(OPENSSL_INCLUDE)"
- LDFLAGS += -L"$(OPENSSL_LIBPATH)"
- OPENSSL_LIBS ?= -lssl -lcrypto
- LIBS += $(OPENSSL_LIBS)
-
- ifneq ($(findstring -srp,$(CFG)),)
- ifneq ($(wildcard $(OPENSSL_INCLUDE)/openssl/srp.h),)
- # OpenSSL 1.0.1 and later.
- CPPFLAGS += -DHAVE_OPENSSL_SRP -DUSE_TLS_SRP
- endif
- endif
- SSLLIBS += 1
-endif
-ifneq ($(findstring -wolfssl,$(CFG)),)
- WOLFSSL_PATH ?= $(PROOT)/../wolfssl
- CPPFLAGS += -DUSE_WOLFSSL
- CPPFLAGS += -DSIZEOF_LONG_LONG=8
- CPPFLAGS += -isystem "$(WOLFSSL_PATH)/include"
- LDFLAGS += -L"$(WOLFSSL_PATH)/lib"
- LIBS += -lwolfssl
- SSLLIBS += 1
-endif
-ifneq ($(findstring -mbedtls,$(CFG)),)
- MBEDTLS_PATH ?= $(PROOT)/../mbedtls
- CPPFLAGS += -DUSE_MBEDTLS
- CPPFLAGS += -isystem "$(MBEDTLS_PATH)/include"
- LDFLAGS += -L"$(MBEDTLS_PATH)/lib"
- LIBS += -lmbedtls -lmbedx509 -lmbedcrypto
- SSLLIBS += 1
-endif
-ifneq ($(findstring -bearssl,$(CFG)),)
- BEARSSL_PATH ?= $(PROOT)/../bearssl
- CPPFLAGS += -DUSE_BEARSSL
- CPPFLAGS += -isystem "$(BEARSSL_PATH)/inc"
- LDFLAGS += -L"$(BEARSSL_PATH)/build"
- LIBS += -lbearssl
- SSLLIBS += 1
-endif
-
-ifneq ($(findstring -nghttp2,$(CFG)),)
- NGHTTP2_PATH ?= $(PROOT)/../nghttp2
- CPPFLAGS += -DUSE_NGHTTP2
- CPPFLAGS += -isystem "$(NGHTTP2_PATH)/include"
- LDFLAGS += -L"$(NGHTTP2_PATH)/lib"
- LIBS += -lnghttp2
-endif
-
-ifeq ($(findstring -nghttp3,$(CFG))$(findstring -ngtcp2,$(CFG)),-nghttp3-ngtcp2)
- NGHTTP3_PATH ?= $(PROOT)/../nghttp3
- CPPFLAGS += -DUSE_NGHTTP3
- CPPFLAGS += -isystem "$(NGHTTP3_PATH)/include"
- LDFLAGS += -L"$(NGHTTP3_PATH)/lib"
- LIBS += -lnghttp3
-
- NGTCP2_PATH ?= $(PROOT)/../ngtcp2
- CPPFLAGS += -DUSE_NGTCP2
- CPPFLAGS += -isystem "$(NGTCP2_PATH)/include"
- LDFLAGS += -L"$(NGTCP2_PATH)/lib"
-
- NGTCP2_LIBS ?=
- ifeq ($(NGTCP2_LIBS),)
- ifneq ($(findstring -ssl,$(CFG)),)
- ifneq ($(wildcard $(OPENSSL_INCLUDE)/openssl/aead.h),)
- NGTCP2_LIBS := -lngtcp2_crypto_boringssl
- else # including libressl
- NGTCP2_LIBS := -lngtcp2_crypto_quictls
- endif
- else ifneq ($(findstring -wolfssl,$(CFG)),)
- NGTCP2_LIBS := -lngtcp2_crypto_wolfssl
- endif
- endif
-
- LIBS += -lngtcp2 $(NGTCP2_LIBS)
-endif
-
-ifneq ($(findstring -zlib,$(CFG))$(ZLIB),)
- ZLIB_PATH ?= $(PROOT)/../zlib
- # These CPPFLAGS are also required when compiling the curl tool via 'src'.
- CPPFLAGS += -DHAVE_LIBZ
- CPPFLAGS += -isystem "$(ZLIB_PATH)/include"
- LDFLAGS += -L"$(ZLIB_PATH)/lib"
- ZLIB_LIBS ?= -lz
- LIBS += $(ZLIB_LIBS)
- ZLIB := 1
-endif
-ifneq ($(findstring -zstd,$(CFG)),)
- ZSTD_PATH ?= $(PROOT)/../zstd
- CPPFLAGS += -DHAVE_ZSTD
- CPPFLAGS += -isystem "$(ZSTD_PATH)/include"
- LDFLAGS += -L"$(ZSTD_PATH)/lib"
- ZSTD_LIBS ?= -lzstd
- LIBS += $(ZSTD_LIBS)
-endif
-ifneq ($(findstring -brotli,$(CFG)),)
- BROTLI_PATH ?= $(PROOT)/../brotli
- CPPFLAGS += -DHAVE_BROTLI
- CPPFLAGS += -isystem "$(BROTLI_PATH)/include"
- LDFLAGS += -L"$(BROTLI_PATH)/lib"
- BROTLI_LIBS ?= -lbrotlidec -lbrotlicommon
- LIBS += $(BROTLI_LIBS)
-endif
-ifneq ($(findstring -gsasl,$(CFG)),)
- LIBGSASL_PATH ?= $(PROOT)/../gsasl
- CPPFLAGS += -DUSE_GSASL
- CPPFLAGS += -isystem "$(LIBGSASL_PATH)/include"
- LDFLAGS += -L"$(LIBGSASL_PATH)/lib"
- LIBS += -lgsasl
-endif
-
-ifneq ($(findstring -idn2,$(CFG)),)
- LIBIDN2_PATH ?= $(PROOT)/../libidn2
- CPPFLAGS += -DHAVE_LIBIDN2 -DHAVE_IDN2_H
- CPPFLAGS += -isystem "$(LIBIDN2_PATH)/include"
- LDFLAGS += -L"$(LIBIDN2_PATH)/lib"
- LIBS += -lidn2
-
-ifneq ($(findstring -psl,$(CFG)),)
- LIBPSL_PATH ?= $(PROOT)/../libpsl
- CPPFLAGS += -DUSE_LIBPSL
- CPPFLAGS += -isystem "$(LIBPSL_PATH)/include"
- LDFLAGS += -L"$(LIBPSL_PATH)/lib"
- LIBS += -lpsl
-endif
-endif
-
-ifneq ($(findstring -ipv6,$(CFG)),)
- CPPFLAGS += -DUSE_IPV6
-endif
-
-ifneq ($(findstring -watt,$(CFG))$(MSDOS),)
- WATT_PATH ?= $(PROOT)/../watt
- CPPFLAGS += -isystem "$(WATT_PATH)/inc"
- LDFLAGS += -L"$(WATT_PATH)/lib"
- LIBS += -lwatt
-endif
-
-ifneq ($(findstring 11,$(subst $(subst ,, ),,$(SSLLIBS))),)
- CPPFLAGS += -DCURL_WITH_MULTI_SSL
-endif
-
-### Common rules
-
-OBJ_DIR := $(TRIPLET)
-
-ifneq ($(findstring /sh,$(SHELL)),)
-DEL = rm -f $1
-COPY = -cp -afv $1 $2
-MKDIR = mkdir -p $1
-RMDIR = rm -fr $1
-else
-DEL = -del 2>NUL /q /f $(subst /,\,$1)
-COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
-MKDIR = -md 2>NUL $(subst /,\,$1)
-RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
-endif
-
-all: $(TARGETS)
-
-$(OBJ_DIR):
- -$(call MKDIR, $(OBJ_DIR))
-
-$(OBJ_DIR)/%.o: %.c
- $(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-
-clean:
- @$(call DEL, $(TOCLEAN))
- @$(RMDIR) $(OBJ_DIR)
-
-distclean vclean: clean
- @$(call DEL, $(TARGETS) $(TOVCLEAN))
-
-### Local
-
-ifdef LOCAL
-
-CPPFLAGS += -DBUILDING_LIBCURL
-
-### Sources and targets
-
-# Provides CSOURCES, HHEADERS
-include Makefile.inc
-
-vpath %.c vauth vquic vssh vtls
-
-libcurl_a_LIBRARY := libcurl.a
-
-TARGETS := $(libcurl_a_LIBRARY)
-
-libcurl_a_OBJECTS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(notdir $(strip $(CSOURCES))))
-libcurl_a_DEPENDENCIES := $(strip $(CSOURCES) $(HHEADERS))
-
-TOCLEAN :=
-TOVCLEAN :=
-
-### Rules
-
-$(libcurl_a_LIBRARY): $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
- @$(call DEL, $@)
- $(AR) rcs $@ $(libcurl_a_OBJECTS)
-
-all: $(OBJ_DIR) $(TARGETS)
-endif
*/
struct Library *SocketBase = NULL;
-extern int errno, h_errno;
#ifdef __libnix__
void __request(const char *msg);
#else
-# define __request(msg) Printf(msg "\n\a")
+# define __request(msg) Printf((const unsigned char *)(msg "\n\a"), 0)
#endif
void Curl_amiga_cleanup(void)
CURLcode Curl_amiga_init(void)
{
if(!SocketBase)
- SocketBase = OpenLibrary("bsdsocket.library", 4);
+ SocketBase = OpenLibrary((const unsigned char *)"bsdsocket.library", 4);
if(!SocketBase) {
__request("No TCP/IP Stack running!");
+++ /dev/null
-#ifndef HEADER_CURL_CONFIG_AMIGAOS_H
-#define HEADER_CURL_CONFIG_AMIGAOS_H
-/***************************************************************************
- * _ _ ____ _
- * 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
- *
- ***************************************************************************/
-
-/* ================================================================ */
-/* Hand crafted config file for AmigaOS */
-/* ================================================================ */
-
-#ifdef __AMIGA__ /* Any AmigaOS flavour */
-
-#define HAVE_ARPA_INET_H 1
-#define HAVE_CLOSESOCKET_CAMEL 1
-#define HAVE_IOCTLSOCKET_CAMEL 1
-#define HAVE_IOCTLSOCKET_CAMEL_FIONBIO 1
-#define HAVE_LONGLONG 1
-#define HAVE_NETDB_H 1
-#define HAVE_NETINET_IN_H 1
-#define HAVE_NET_IF_H 1
-#define HAVE_PWD_H 1
-#define HAVE_SELECT 1
-#define HAVE_SIGNAL 1
-#define HAVE_SOCKET 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRDUP 1
-#define HAVE_STRICMP 1
-#define HAVE_STRINGS_H 1
-#define HAVE_STRUCT_TIMEVAL 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_SOCKET_H 1
-#define HAVE_SYS_SOCKIO_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_UNISTD_H 1
-#define HAVE_UTIME 1
-#define HAVE_UTIME_H 1
-#define HAVE_WRITABLE_ARGV 1
-#define HAVE_SYS_IOCTL_H 1
-
-#define SIZEOF_INT 4
-#define SIZEOF_SIZE_T 4
-
-#ifndef SIZEOF_CURL_OFF_T
-#define SIZEOF_CURL_OFF_T 8
-#endif
-
-#define USE_MANUAL 1
-#define CURL_DISABLE_LDAP 1
-
-#ifndef CURL_OS
-#define CURL_OS "AmigaOS"
-#endif
-
-#define PACKAGE "curl"
-#define PACKAGE_BUGREPORT "a suitable mailing list: https://curl.se/mail/"
-#define PACKAGE_NAME "curl"
-#define PACKAGE_STRING "curl -"
-#define PACKAGE_TARNAME "curl"
-#define PACKAGE_VERSION "-"
-
-#if defined(USE_AMISSL)
-#define CURL_CA_PATH "AmiSSL:Certs"
-#elif defined(__MORPHOS__)
-#define CURL_CA_BUNDLE "MOSSYS:Data/SSL/curl-ca-bundle.crt"
-#else
-#define CURL_CA_BUNDLE "s:curl-ca-bundle.crt"
-#endif
-
-#define STDC_HEADERS 1
-
-#define in_addr_t int
-
-#ifndef F_OK
-# define F_OK 0
-#endif
-
-#ifndef O_RDONLY
-# define O_RDONLY 0x0000
-#endif
-
-#ifndef LONG_MAX
-# define LONG_MAX 0x7fffffffL
-#endif
-
-#ifndef LONG_MIN
-# define LONG_MIN (-0x7fffffffL-1)
-#endif
-
-#define HAVE_RECV 1
-#define RECV_TYPE_ARG1 long
-#define RECV_TYPE_ARG2 char *
-#define RECV_TYPE_ARG3 long
-#define RECV_TYPE_ARG4 long
-#define RECV_TYPE_RETV long
-
-#define HAVE_SEND 1
-#define SEND_TYPE_ARG1 int
-#define SEND_QUAL_ARG2 const
-#define SEND_TYPE_ARG2 char *
-#define SEND_TYPE_ARG3 int
-#define SEND_TYPE_ARG4 int
-#define SEND_TYPE_RETV int
-
-#endif /* __AMIGA__ */
-#endif /* HEADER_CURL_CONFIG_AMIGAOS_H */
+++ /dev/null
-#ifndef HEADER_CURL_CONFIG_DOS_H
-#define HEADER_CURL_CONFIG_DOS_H
-/***************************************************************************
- * _ _ ____ _
- * 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
- *
- ***************************************************************************/
-
-
-/* ================================================================ */
-/* lib/config-dos.h - Hand crafted config file for DOS */
-/* ================================================================ */
-
-#ifndef CURL_OS
-#if defined(DJGPP)
- #define CURL_OS "MSDOS/djgpp"
-#elif defined(__HIGHC__)
- #define CURL_OS "MSDOS/HighC"
-#else
- #define CURL_OS "MSDOS/?"
-#endif
-#endif
-
-#define PACKAGE "curl"
-
-#define USE_MANUAL 1
-
-#define HAVE_ARPA_INET_H 1
-#define HAVE_FCNTL_H 1
-#define HAVE_FREEADDRINFO 1
-#define HAVE_GETADDRINFO 1
-#define HAVE_GETTIMEOFDAY 1
-#define HAVE_IO_H 1
-#define HAVE_IOCTL_FIONBIO 1
-#define HAVE_IOCTLSOCKET 1
-#define HAVE_IOCTLSOCKET_FIONBIO 1
-#define HAVE_LOCALE_H 1
-#define HAVE_LONGLONG 1
-#define HAVE_NETDB_H 1
-#define HAVE_NETINET_IN_H 1
-#define HAVE_NETINET_TCP_H 1
-#define HAVE_NET_IF_H 1
-#define HAVE_RECV 1
-#define HAVE_SELECT 1
-#define HAVE_SEND 1
-#define HAVE_SETLOCALE 1
-#define HAVE_SETMODE 1
-#define HAVE_SIGNAL 1
-#define HAVE_SOCKET 1
-#define HAVE_STRDUP 1
-#define HAVE_STRICMP 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRUCT_TIMEVAL 1
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_SYS_SOCKET_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_UNISTD_H 1
-
-#define SIZEOF_INT 4
-#define SIZEOF_LONG 4
-#define SIZEOF_SIZE_T 4
-#define SIZEOF_CURL_OFF_T 8
-#define STDC_HEADERS 1
-
-/* Qualifiers for send() and recv() */
-
-#define SEND_TYPE_ARG1 int
-#define SEND_QUAL_ARG2 const
-#define SEND_TYPE_ARG2 void *
-#define SEND_TYPE_ARG3 int
-#define SEND_TYPE_ARG4 int
-#define SEND_TYPE_RETV int
-
-#define RECV_TYPE_ARG1 int
-#define RECV_TYPE_ARG2 void *
-#define RECV_TYPE_ARG3 int
-#define RECV_TYPE_ARG4 int
-#define RECV_TYPE_RETV int
-
-#define BSD
-
-/* CURLDEBUG definition enables memory tracking */
-/* #define CURLDEBUG */
-
-/* to disable LDAP */
-#define CURL_DISABLE_LDAP 1
-
-#define in_addr_t u_long
-
-#if defined(__HIGHC__) || \
- (defined(__GNUC__) && (__GNUC__ < 4))
- #define ssize_t int
-#endif
-
-/* Target HAVE_x section */
-
-#if defined(DJGPP)
- #define HAVE_BASENAME 1
- #define HAVE_STRCASECMP 1
- #define HAVE_SIGACTION 1
- #define HAVE_SIGSETJMP 1
- #define HAVE_SYS_TIME_H 1
- #define HAVE_TERMIOS_H 1
-
-#elif defined(__HIGHC__)
- #define HAVE_SYS_TIME_H 1
- #define strerror(e) strerror_s_((e))
-#endif
-
-#ifdef MSDOS /* Watt-32 */
- #define HAVE_CLOSE_S 1
-#endif
-
-#undef word
-#undef byte
-
-#endif /* HEADER_CURL_CONFIG_DOS_H */
addr = (void *)ai->ai_addr; /* storage area for this info */
memcpy(&addr->sin_addr, curr, sizeof(struct in_addr));
-#ifdef __MINGW32__
- addr->sin_family = (short)(he->h_addrtype);
-#else
addr->sin_family = (CURL_SA_FAMILY_T)(he->h_addrtype);
-#endif
addr->sin_port = htons((unsigned short)port);
break;
addr6 = (void *)ai->ai_addr; /* storage area for this info */
memcpy(&addr6->sin6_addr, curr, sizeof(struct in6_addr));
-#ifdef __MINGW32__
- addr6->sin6_family = (short)(he->h_addrtype);
-#else
addr6->sin6_family = (CURL_SA_FAMILY_T)(he->h_addrtype);
-#endif
addr6->sin6_port = htons((unsigned short)port);
break;
#endif
/* if OpenSSL is in use */
#cmakedefine USE_OPENSSL 1
+/* if AmiSSL is in use */
+#cmakedefine USE_AMISSL 1
+
/* if librtmp/rtmpdump is in use */
#cmakedefine USE_LIBRTMP 1
/* to enable Windows SSL */
#cmakedefine USE_SCHANNEL 1
+/* if Watt-32 is in use */
+#cmakedefine USE_WATT32 1
+
/* enable multiple SSL backends */
#cmakedefine CURL_WITH_MULTI_SSL 1
#else /* DEBUGBUILD */
name[0] = '\0';
+#ifdef __AMIGA__
+ err = gethostname((unsigned char *)name, namelen);
+#else
err = gethostname(name, namelen);
+#endif
#endif
# include "config-riscos.h"
#endif
-#ifdef __AMIGA__
-# include "config-amigaos.h"
-#endif
-
#ifdef __OS400__
# include "config-os400.h"
#endif
# include "config-plan9.h"
#endif
-#ifdef MSDOS
-# include "config-dos.h"
-#endif
-
#endif /* HAVE_CONFIG_H */
/* ================================================================ */
FILE *curlx_win32_fopen(const char *filename, const char *mode);
#endif
+#ifdef __DJGPP__
+/* Requires DJGPP 2.04 */
+# include <unistd.h>
+# undef lseek
+# define lseek(fdes,offset,whence) llseek(fdes, offset, whence)
+# define LSEEK_ERROR (offset_t)-1
+#endif
+
/*
* Small file (<2Gb) support using Win32 functions.
*/
# define CURL_SA_FAMILY_T sa_family_t
# elif defined(HAVE_ADDRESS_FAMILY)
# define CURL_SA_FAMILY_T ADDRESS_FAMILY
+# elif defined(__AMIGA__)
+# define CURL_SA_FAMILY_T unsigned char
# else
/* use a sensible default */
# define CURL_SA_FAMILY_T unsigned short
# define sclose(x) closesocket((x))
#elif defined(HAVE_CLOSESOCKET_CAMEL)
# define sclose(x) CloseSocket((x))
-#elif defined(HAVE_CLOSE_S)
+#elif defined(MSDOS) /* Watt-32 */
# define sclose(x) close_s((x))
#elif defined(USE_LWIPSOCK)
# define sclose(x) lwip_close((x))
addr = (void *)ai->ai_addr; /* storage area for this info */
DEBUGASSERT(sizeof(struct in_addr) == sizeof(de->addr[i].ip.v4));
memcpy(&addr->sin_addr, &de->addr[i].ip.v4, sizeof(struct in_addr));
-#ifdef __MINGW32__
- addr->sin_family = (short)addrtype;
-#else
- addr->sin_family = addrtype;
-#endif
+ addr->sin_family = (CURL_SA_FAMILY_T)addrtype;
addr->sin_port = htons((unsigned short)port);
break;
addr6 = (void *)ai->ai_addr; /* storage area for this info */
DEBUGASSERT(sizeof(struct in6_addr) == sizeof(de->addr[i].ip.v6));
memcpy(&addr6->sin6_addr, &de->addr[i].ip.v6, sizeof(struct in6_addr));
-#ifdef __MINGW32__
- addr6->sin6_family = (short)addrtype;
-#else
- addr6->sin6_family = addrtype;
-#endif
+ addr6->sin6_family = (CURL_SA_FAMILY_T)addrtype;
addr6->sin6_port = htons((unsigned short)port);
break;
#endif
if(data->state.resume_from) {
if(!S_ISDIR(statbuf.st_mode)) {
+#ifdef __AMIGA__
+ if(data->state.resume_from !=
+ lseek(fd, (off_t)data->state.resume_from, SEEK_SET))
+#else
if(data->state.resume_from !=
lseek(fd, data->state.resume_from, SEEK_SET))
+#endif
return CURLE_BAD_DOWNLOAD_RESUME;
}
else {
/* If we asked for a time of the file and we actually got one as well,
we "emulate" an HTTP-style header in our output. */
+#if defined(__GNUC__) && (defined(__DJGPP__) || defined(__AMIGA__))
+#pragma GCC diagnostic push
+/* 'time_t' is unsigned in MSDOS and AmigaOS. Silence:
+ warning: comparison of unsigned expression in '>= 0' is always true */
+#pragma GCC diagnostic ignored "-Wtype-limits"
+#endif
if(data->req.no_body &&
ftpc->file &&
data->set.get_filetime &&
(data->info.filetime >= 0) ) {
+#if defined(__GNUC__) && (defined(__DJGPP__) || defined(__AMIGA__))
+#pragma GCC diagnostic pop
+#endif
char headerbuf[128];
int headerbuflen;
time_t filetime = data->info.filetime;
/* int send(int, const char *, int, int); */
#define SEND_TYPE_ARG1 int
+#define SEND_QUAL_ARG2
#define SEND_TYPE_ARG2 char *
#define SEND_TYPE_ARG3 int
#define SEND_TYPE_RETV int
case CURLINFO_FILETIME:
if(data->info.filetime > LONG_MAX)
*param_longp = LONG_MAX;
+#if !defined(MSDOS) && !defined(__AMIGA__)
else if(data->info.filetime < LONG_MIN)
*param_longp = LONG_MIN;
+#endif
else
*param_longp = (long)data->info.filetime;
break;
if(dns->timestamp) {
/* age in seconds */
time_t age = prune->now - dns->timestamp;
- if(age >= prune->max_age_sec)
+ if(age >= (time_t)prune->max_age_sec)
return TRUE;
if(age > prune->oldest)
prune->oldest = age;
sa6.sin6_family = AF_INET6;
sa6.sin6_port = htons(port16);
sa6.sin6_flowinfo = 0;
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
sa6.sin6_scope_id = 0;
+#endif
(void)Curl_inet_pton(AF_INET6, "::1", ipv6);
memcpy(&sa6.sin6_addr, ipv6, sizeof(ipv6));
(void)curlx_strtoofft(v, NULL, 10, &retry_after);
if(!retry_after) {
time_t date = Curl_getdate_capped(v);
- if(-1 != date)
+ if((time_t)-1 != date)
/* convert date to number of seconds into the future */
retry_after = date - time(NULL);
}
#ifdef _WIN32
#define Curl_inet_ntop(af,addr,buf,size) \
inet_ntop(af, addr, buf, size)
+#elif defined(__AMIGA__)
+#define Curl_inet_ntop(af,addr,buf,size) \
+ (char *)inet_ntop(af, (void *)addr, (unsigned char *)buf, \
+ (curl_socklen_t)(size))
#else
#define Curl_inet_ntop(af,addr,buf,size) \
inet_ntop(af, addr, buf, (curl_socklen_t)(size))
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#if defined(__AMIGA__)
+#define Curl_inet_pton(x,y,z) inet_pton(x,(unsigned char *)y,z)
+#else
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
#endif
+#endif
#endif /* HEADER_CURL_INET_PTON_H */
if(!FDSET_SOCK(data->last_poll.sockets[i]))
/* pretend it does not exist */
continue;
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
if(data->last_poll.actions[i] & CURL_POLL_IN)
FD_SET(data->last_poll.sockets[i], read_fd_set);
if(data->last_poll.actions[i] & CURL_POLL_OUT)
FD_SET(data->last_poll.sockets[i], write_fd_set);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if((int)data->last_poll.sockets[i] > this_max_fd)
this_max_fd = (int)data->last_poll.sockets[i];
}
#ifndef CURL_DISABLE_NETRC
#ifdef HAVE_PWD_H
+#undef __NO_NET_API /* required for AmigaOS to declare getpwuid() */
#include <pwd.h>
+#define __NO_NET_API
#endif
#include <curl/curl.h>
flags &= ~O_NONBLOCK;
return sfcntl(sockfd, F_SETFL, flags);
+#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
+
+ /* Amiga */
+ long flags = nonblock ? 1L : 0L;
+ return IoctlSocket(sockfd, FIONBIO, (char *)&flags);
+
#elif defined(HAVE_IOCTL_FIONBIO)
/* older Unix versions */
unsigned long flags = nonblock ? 1UL : 0UL;
return ioctlsocket(sockfd, (long)FIONBIO, &flags);
-#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
-
- /* Amiga */
- long flags = nonblock ? 1L : 0L;
- return IoctlSocket(sockfd, FIONBIO, (char *)&flags);
-
#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
/* Orbis OS */
if(tzoff == -1)
tzoff = 0;
- if((tzoff > 0) && (t > TIME_T_MAX - tzoff)) {
+ if((tzoff > 0) && (t > (time_t)(TIME_T_MAX - tzoff))) {
*output = TIME_T_MAX;
return PARSEDATE_LATER; /* time_t overflow */
}
(void)now; /* legacy argument from the past that we ignore */
if(rc == PARSEDATE_OK) {
- if(parsed == -1)
+ if(parsed == (time_t)-1)
/* avoid returning -1 for a working scenario */
parsed++;
return parsed;
switch(rc) {
case PARSEDATE_OK:
- if(parsed == -1)
+ if(parsed == (time_t)-1)
/* avoid returning -1 for a working scenario */
parsed++;
return parsed;
return -1;
}
#if defined(MSDOS)
- delay(timeout_ms);
+ delay((unsigned int)timeout_ms);
#elif defined(_WIN32)
/* prevent overflow, timeout_ms is typecast to ULONG/DWORD. */
#if TIMEDIFF_T_MAX >= ULONG_MAX
not have a size_t argument, like older unixes that want an 'int' */
senddata = sendto(state->sockfd, (void *)state->spacket.data,
(SEND_TYPE_ARG3)sbytes, 0,
- &data->conn->remote_addr->curl_sa_addr,
+ (struct sockaddr *)&data->conn->remote_addr->curl_sa_addr,
(curl_socklen_t)data->conn->remote_addr->addrlen);
if(senddata != (ssize_t)sbytes) {
char buffer[STRERROR_LEN];
check_for_ca_bundle=1
with_ca_fallback=yes
LIBS="-lamisslstubs -lamisslauto $LIBS"
+ CURL_NETWORK_AND_TIME_LIBS="-lamisslstubs -lamisslauto $CURL_NETWORK_AND_TIME_LIBS"
AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use])
AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])
AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
dnl --disable-threaded-resolver option used
want_thres="no"
;;
+ yes)
+ dnl --enable-threaded-resolver option used
+ want_thres="yes"
+ ;;
*)
dnl configure option not specified
- want_thres="yes"
+ case $host_os in
+ msdos* | amiga*)
+ want_thres="no"
+ ;;
+ *)
+ want_thres="yes"
+ ;;
+ esac
;;
esac
AC_MSG_RESULT([$want_thres])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
#
tst_links_closesocket_camel="unknown"
- tst_proto_closesocket_camel="unknown"
tst_compi_closesocket_camel="unknown"
tst_allow_closesocket_camel="unknown"
#
])
#
if test "$tst_links_closesocket_camel" = "yes"; then
- AC_MSG_CHECKING([if CloseSocket is prototyped])
- AC_EGREP_CPP([CloseSocket],[
- $curl_includes_bsdsocket
- $curl_includes_sys_socket
- ],[
- AC_MSG_RESULT([yes])
- tst_proto_closesocket_camel="yes"
- ],[
- AC_MSG_RESULT([no])
- tst_proto_closesocket_camel="no"
- ])
- fi
- #
- if test "$tst_proto_closesocket_camel" = "yes"; then
AC_MSG_CHECKING([if CloseSocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#
AC_MSG_CHECKING([if CloseSocket might be used])
if test "$tst_links_closesocket_camel" = "yes" &&
- test "$tst_proto_closesocket_camel" = "yes" &&
test "$tst_compi_closesocket_camel" = "yes" &&
test "$tst_allow_closesocket_camel" = "yes"; then
AC_MSG_RESULT([yes])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
#
tst_links_ioctlsocket_camel="unknown"
- tst_proto_ioctlsocket_camel="unknown"
tst_compi_ioctlsocket_camel="unknown"
tst_allow_ioctlsocket_camel="unknown"
#
])
#
if test "$tst_links_ioctlsocket_camel" = "yes"; then
- AC_MSG_CHECKING([if IoctlSocket is prototyped])
- AC_EGREP_CPP([IoctlSocket],[
- $curl_includes_bsdsocket
- ],[
- AC_MSG_RESULT([yes])
- tst_proto_ioctlsocket_camel="yes"
- ],[
- AC_MSG_RESULT([no])
- tst_proto_ioctlsocket_camel="no"
- ])
- fi
- #
- if test "$tst_proto_ioctlsocket_camel" = "yes"; then
AC_MSG_CHECKING([if IoctlSocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#
AC_MSG_CHECKING([if IoctlSocket might be used])
if test "$tst_links_ioctlsocket_camel" = "yes" &&
- test "$tst_proto_ioctlsocket_camel" = "yes" &&
test "$tst_compi_ioctlsocket_camel" = "yes" &&
test "$tst_allow_ioctlsocket_camel" = "yes"; then
AC_MSG_RESULT([yes])
.DELETE_ON_ERROR:
EXTRA_DIST = mk-file-embed.pl mkhelp.pl \
- Makefile.mk curl.rc Makefile.inc CMakeLists.txt .checksrc
+ curl.rc Makefile.inc CMakeLists.txt .checksrc
# Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library
+++ /dev/null
-#***************************************************************************
-# _ _ ____ _
-# 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
-#
-#***************************************************************************
-
-# See usage in lib/Makefile.mk
-
-PROOT := ..
-
-### Common
-
-include $(PROOT)/lib/Makefile.mk
-
-### Local
-
-CPPFLAGS += -I$(PROOT)/lib
-LDFLAGS += -L$(PROOT)/lib
-LIBS := -lcurl $(LIBS)
-
-### Sources and targets
-
-# Provides CURL_CFILES, CURLX_CFILES
-include Makefile.inc
-
-TARGETS := curl$(BIN_EXT)
-
-CURL_CFILES += $(notdir $(CURLX_CFILES))
-
-ifneq ($(CURL_CA_EMBED),)
-CPPFLAGS += -DCURL_CA_EMBED
-CURL_CFILES += tool_ca_embed.c
-endif
-
-curl_OBJECTS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(strip $(CURL_CFILES)))
-ifdef MAP
-CURL_MAP := curl.map
-LDFLAGS += -Wl,-Map,$(CURL_MAP)
-TOVCLEAN := $(CURL_MAP)
-endif
-vpath %.c $(PROOT)/lib
-
-TOCLEAN := $(curl_OBJECTS)
-
-### Rules
-
-PERL ?= perl
-
-ifneq ($(wildcard tool_hugehelp.c.cvs),)
-TOCLEAN += tool_hugehelp.c
-# Load DPAGES
-include $(PROOT)/docs/cmdline-opts/Makefile.inc
-$(PROOT)/docs/cmdline-opts/curl.txt: $(addprefix $(PROOT)/docs/cmdline-opts/,$(DPAGES)) $(PROOT)/scripts/managen
- cd $(PROOT)/docs/cmdline-opts && $(PERL) ../../scripts/managen ascii $(DPAGES) > curl.txt
-# Necessary for the generated tools_hugehelp.c
-CPPFLAGS += -DUSE_MANUAL
-ifdef ZLIB
-_MKHELPOPT += -c
-endif
-tool_hugehelp.c: $(PROOT)/docs/cmdline-opts/curl.txt mkhelp.pl
- $(PERL) mkhelp.pl $(_MKHELPOPT) < $< > $@
-else
-tool_hugehelp.c:
- @echo Creating $@
- @$(call COPY, $@.cvs, $@)
-endif
-
-ifneq ($(CURL_CA_EMBED),)
-TOCLEAN += tool_ca_embed.c
-tool_ca_embed.c: mk-file-embed.pl
- $(PERL) mk-file-embed.pl --var curl_ca_embed < $(CURL_CA_EMBED) > $@
-endif
-
-$(TARGETS): $(curl_OBJECTS) $(PROOT)/lib/libcurl.a
- $(CC) $(LDFLAGS) -o $@ $(curl_OBJECTS) $(LIBS)
-
-all: $(OBJ_DIR) $(TARGETS)
timeout.tv_usec = (int)((wait%1000)*1000);
FD_ZERO(&bits);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(per->infd, &bits);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(!select(per->infd + 1, &bits, NULL, NULL, &timeout))
return 0; /* timeout */
}
}
#endif
+#ifdef __AMIGA__
+ if(LSEEK_ERROR == lseek(per->infd, (off_t)offset, whence))
+#else
if(LSEEK_ERROR == lseek(per->infd, offset, whence))
+#endif
/* could not rewind, the reason is in errno but errno is just not portable
enough and we do not actually care that much why we failed. We will let
libcurl know that it may try other means if it wants to. */
SANITIZE_ERR_INVALID_PATH: Bad -- 'path' cannot be truncated
!= SANITIZE_ERR_OK && != SANITIZE_ERR_INVALID_PATH: Error
*/
-SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos)
+static SANITIZEcode truncate_dryrun(const char *path,
+ const size_t truncate_pos)
{
size_t len;
Success: (SANITIZE_ERR_OK) *sanitized points to a sanitized copy of file_name.
Failure: (!= SANITIZE_ERR_OK) *sanitized is NULL.
*/
-SANITIZEcode msdosify(char **const sanitized, const char *file_name,
- int flags)
+static SANITIZEcode msdosify(char **const sanitized, const char *file_name,
+ int flags)
{
char dos_name[PATH_MAX];
static const char illegal_chars_dos[] = ".+, ;=[]" /* illegal in DOS */
SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name,
int flags);
-#ifdef UNITTESTS
-SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos);
-SANITIZEcode msdosify(char **const sanitized, const char *file_name,
- int flags);
-SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized,
- const char *file_name,
- int flags);
-#endif /* UNITTESTS */
#if defined(MSDOS) && (defined(__DJGPP__) || defined(__GO32__))
#include "tool_setup.h"
#ifdef HAVE_PWD_H
-# undef __NO_NET_API /* required for building for AmigaOS */
-# include <pwd.h>
+#undef __NO_NET_API /* required for AmigaOS to declare getpwuid() */
+#include <pwd.h>
+#define __NO_NET_API
#endif
#ifdef HAVE_SYS_STAT_H
#include "memdebug.h" /* keep this as LAST include */
-#ifdef MSDOS
-# define USE_WATT32
-#endif
-
#define ALLOW_BLANK TRUE
#define DENY_BLANK FALSE
#include "memdebug.h" /* keep this as LAST include */
-#ifdef MSDOS
-# define USE_WATT32
-#endif
-
#ifndef ARRAYSIZE
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
#endif
int vms_show = 0;
#endif
+#if defined(__AMIGA__)
+#if defined(__GNUC__)
+#define CURL_USED __attribute__((used))
+#else
+#define CURL_USED
+#endif
+static const char CURL_USED min_stack[] = "$STACK:16384";
+#endif
+
#ifdef __MINGW32__
/*
* There seems to be no way to escape "*" in command-line arguments with MinGW
outs->bytes);
fflush(outs->stream);
/* truncate file at the position where we started appending */
-#ifdef HAVE_FTRUNCATE
+#if defined(HAVE_FTRUNCATE) && !defined(__DJGPP__) && !defined(__AMIGA__)
if(ftruncate(fileno(outs->stream), outs->init)) {
/* when truncate fails, we cannot just append as then we will
create something strange, bail out */
</stdout>
# This test case previously tested an overflow case ("2094 Nov 6 =>
-# 2147483647") for 32bit time_t, but since some systems have 64bit time_t and
-# handles this (returning 3939840000), and some 64bit-time_t systems don't
+# 2147483647") for 32-bit time_t, but since some systems have 64-bit time_t and
+# handles this (returning 3939840000), and some 64-bit time_t systems don't
# handle this and return -1 for this, it turned very tricky to write a fine
# test case and thus it is now removed until we have a way to write test cases
# for this kind of things.
#
###########################################################################
-# Get 'LIBTESTPROGS', '*_SOURCES', 'TESTUTIL', 'TSTTRACE', 'WARNLESS', 'MULTIBYTE', 'TIMEDIFF', 'THREADS', 'FIRSTFILES' variables
+# Get 'LIBTESTPROGS', '*_SOURCES', 'TESTUTIL', 'TSTTRACE', 'WARNLESS', 'MULTIBYTE', 'INET_PTON', 'TIMEDIFF', 'THREADS',
+# 'FIRSTFILES' variables
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
list(APPEND libtests_SOURCES ${TESTUTIL} ${TSTTRACE})
if(LIB_SELECTED STREQUAL LIB_SHARED)
# These are part of the libcurl static lib. Add them here when linking shared.
- list(APPEND libtests_SOURCES ${WARNLESS} ${MULTIBYTE} ${TIMEDIFF} ${THREADS})
+ list(APPEND libtests_SOURCES ${WARNLESS} ${MULTIBYTE} ${INET_PTON} ${TIMEDIFF} ${THREADS})
endif()
endif()
if(LIB_SELECTED STREQUAL LIB_STATIC)
# These are part of the libcurl static lib. Do not compile/link them again.
- list(REMOVE_ITEM _sources ${WARNLESS} ${MULTIBYTE} ${TIMEDIFF} ${THREADS})
+ list(REMOVE_ITEM _sources ${WARNLESS} ${MULTIBYTE} ${INET_PTON} ${TIMEDIFF} ${THREADS})
endif()
string(TOUPPER ${_target} _upper_target)
if USE_CPPFLAG_CURL_STATICLIB
else
# These are part of the libcurl static lib. Add them here when linking shared.
-libtests_SOURCES += $(WARNLESS) $(MULTIBYTE) $(TIMEDIFF) $(THREADS)
+libtests_SOURCES += $(WARNLESS) $(MULTIBYTE) $(INET_PTON) $(TIMEDIFF) $(THREADS)
endif
else
noinst_PROGRAMS = $(LIBTESTPROGS)
# files used only in some libcurl test programs
MULTIBYTE = ../../lib/curl_multibyte.c ../../lib/curl_multibyte.h
+# files used only in some libcurl test programs
+INET_PTON = ../../lib/inet_pton.c ../../lib/inet_pton.h
+
# these files are used in every single test program below
TIMEDIFF = ../../lib/timediff.c ../../lib/timediff.h
FIRSTFILES = first.c first.h
lib1959_SOURCES = lib1959.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1959_LDADD = $(TESTUTIL_LIBS)
-lib1960_SOURCES = lib1960.c $(SUPPORTFILES)
+lib1960_SOURCES = lib1960.c $(SUPPORTFILES) $(INET_PTON)
lib1960_LDADD = $(TESTUTIL_LIBS)
lib1964_SOURCES = lib1964.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
rc = 0;
#else
/* Portable sleep for platforms other than Windows. */
- struct timeval wait = { 0, 100 * 1000 }; /* 100ms */
+ struct timeval wait = {0};
+ wait.tv_usec = 100 * 1000; /* 100ms */
rc = select(0, NULL, NULL, NULL, &wait);
#endif
}
***************************************************************************/
#include "test.h"
-#ifdef HAVE_INET_PTON
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
+#include "inet_pton.h"
#include "memdebug.h"
/* to prevent libcurl from closing our socket */
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(port);
- if(inet_pton(AF_INET, libtest_arg2, &serv_addr.sin_addr) <= 0) {
+ if(Curl_inet_pton(AF_INET, libtest_arg2, &serv_addr.sin_addr) <= 0) {
fprintf(stderr, "inet_pton failed\n");
goto test_cleanup;
}
return res;
}
-#else
-CURLcode test(char *URL)
-{
- (void)URL;
- printf("lacks inet_pton\n");
- return CURLE_OK;
-}
-#endif
{
int i;
for(i = 0; i < sockets->count; ++i) {
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sockets->sockets[i], fdset);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(*maxFd < sockets->sockets[i] + 1) {
*maxFd = sockets->sockets[i] + 1;
}
CURLcode res = CURLE_OK;
CURL *curl = NULL; CURLM *m = NULL;
struct ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}};
- struct timeval timeout = {-1, 0};
int success = 0;
+ struct timeval timeout = {0};
+ timeout.tv_sec = (time_t)-1;
/* set the limits */
max_timer_calls = timercb;
while(!checkForCompletion(m, &success)) {
fd_set readSet, writeSet;
curl_socket_t maxFd = 0;
- struct timeval tv = {10, 0};
+ struct timeval tv = {0};
+ tv.tv_sec = 10;
FD_ZERO(&readSet);
FD_ZERO(&writeSet);
updateFdSet(&sockets.read, &readSet, &maxFd);
updateFdSet(&sockets.write, &writeSet, &maxFd);
- if(timeout.tv_sec != -1) {
+ if(timeout.tv_sec != (time_t)-1) {
int usTimeout = getMicroSecondTimeout(&timeout);
tv.tv_sec = usTimeout / 1000000;
tv.tv_usec = usTimeout % 1000000;
goto test_cleanup;
}
- if(timeout.tv_sec != -1 && getMicroSecondTimeout(&timeout) == 0) {
+ if(timeout.tv_sec != (time_t)-1 && getMicroSecondTimeout(&timeout) == 0) {
/* Curl's timer has elapsed. */
if(socket_action(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) {
res = TEST_ERR_BAD_TIMEOUT;
{
int i;
for(i = 0; i < sockets->count; ++i) {
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sockets->sockets[i], fdset);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(*maxFd < sockets->sockets[i] + 1) {
*maxFd = sockets->sockets[i] + 1;
}
struct_stat file_info;
CURLM *m = NULL;
struct ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}};
- struct timeval timeout = {-1, 0};
int success = 0;
+ struct timeval timeout = {0};
+ timeout.tv_sec = (time_t)-1;
assert(test_argc >= 5);
while(!checkForCompletion(m, &success)) {
fd_set readSet, writeSet;
curl_socket_t maxFd = 0;
- struct timeval tv = {10, 0};
+ struct timeval tv = {0};
+ tv.tv_sec = 10;
FD_ZERO(&readSet);
FD_ZERO(&writeSet);
updateFdSet(&sockets.read, &readSet, &maxFd);
updateFdSet(&sockets.write, &writeSet, &maxFd);
- if(timeout.tv_sec != -1) {
+ if(timeout.tv_sec != (time_t)-1) {
int usTimeout = getMicroSecondTimeout(&timeout);
tv.tv_sec = usTimeout / 1000000;
tv.tv_usec = usTimeout % 1000000;
checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, "read");
checkFdSet(m, &sockets.write, &writeSet, CURL_CSELECT_OUT, "write");
- if(timeout.tv_sec != -1 && getMicroSecondTimeout(&timeout) == 0) {
+ if(timeout.tv_sec != (time_t)-1 && getMicroSecondTimeout(&timeout) == 0) {
/* Curl's timer has elapsed. */
notifyCurl(m, CURL_SOCKET_TIMEOUT, 0, "timeout");
}
FD_ZERO(&fds_err);
/* there's always a socket to wait for */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sockfd, &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
do {
/* select() blocking behavior call on blocking descriptors please */
/* gethostbyname() resolve */
struct hostent *he;
+#ifdef __AMIGA__
+ he = gethostbyname((unsigned char *)host);
+#else
he = gethostbyname(host);
+#endif
rc = !he;
}
FD_ZERO(&fds_write);
FD_ZERO(&fds_err);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET((curl_socket_t)fileno(stdin), &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
switch(*mode) {
/* server mode */
sockfd = listenfd;
/* there's always a socket to wait for */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sockfd, &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
maxfd = (int)sockfd;
break;
}
else {
/* there's always a socket to wait for */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sockfd, &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
maxfd = (int)sockfd;
}
break;
sockfd = *sockfdp;
/* sockfd turns CURL_SOCKET_BAD when our connection has been closed */
if(CURL_SOCKET_BAD != sockfd) {
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sockfd, &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
maxfd = (int)sockfd;
}
else {
FD_ZERO(&fds_err);
/* there's always a socket to wait for */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sockfd, &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
for(i = 0; i < 2; i++) {
if(c[i].used) {
curl_socket_t fd = c[i].clientfd;
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(fd, &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if((int)fd > maxfd)
maxfd = (int)fd;
fd = c[i].remotefd;
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(fd, &fds_read);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if((int)fd > maxfd)
maxfd = (int)fd;
}
int rc;
fd_set input;
fd_set output;
- struct timeval timeout = {1, 0}; /* 1000 ms */
+ struct timeval timeout = {0};
+ timeout.tv_sec = 1; /* 1000 ms */
logmsg("Got EAGAIN from sread");
FD_ZERO(&input);
FD_ZERO(&output);
got = 0;
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(sock, &input);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
do {
logmsg("Wait until readable");
rc = select((int)sock + 1, &input, &output, NULL, &timeout);
error = SOCKERRNO;
if((error == EINPROGRESS) || (error == EWOULDBLOCK)) {
fd_set output;
- struct timeval timeout = {1, 0}; /* 1000 ms */
+ struct timeval timeout = {0};
+ timeout.tv_sec = 1; /* 1000 ms */
FD_ZERO(&output);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(serverfd, &output);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
while(1) {
rc = select((int)serverfd + 1, NULL, &output, NULL, &timeout);
if(rc < 0 && SOCKERRNO != EINTR)
fd_set input;
fd_set output;
- struct timeval timeout = {1, 0}; /* 1000 ms */
ssize_t rc;
curl_socket_t maxfd = (curl_socket_t)-1;
+ struct timeval timeout = {0};
+ timeout.tv_sec = 1; /* 1000 ms */
FD_ZERO(&input);
FD_ZERO(&output);
/* listener socket is monitored to allow client to establish
secondary tunnel only when this tunnel is not established
and primary one is fully operational */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(rootfd, &input);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
maxfd = rootfd;
}
if(clientfd[i] != CURL_SOCKET_BAD) {
if(poll_client_rd[i]) {
/* unless told not to do so, monitor readability */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(clientfd[i], &input);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(clientfd[i] > maxfd)
maxfd = clientfd[i];
}
if(poll_client_wr[i] && toc[i]) {
/* unless told not to do so, monitor writability
if there is data ready to be sent to client */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(clientfd[i], &output);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(clientfd[i] > maxfd)
maxfd = clientfd[i];
}
if(serverfd[i] != CURL_SOCKET_BAD) {
if(poll_server_rd[i]) {
/* unless told not to do so, monitor readability */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(serverfd[i], &input);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(serverfd[i] > maxfd)
maxfd = serverfd[i];
}
if(poll_server_wr[i] && tos[i]) {
/* unless told not to do so, monitor writability
if there is data ready to be sent to server */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(serverfd[i], &output);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(serverfd[i] > maxfd)
maxfd = serverfd[i];
}
for(;;) {
fd_set input;
fd_set output;
- struct timeval timeout = {0, 250000L}; /* 250 ms */
curl_socket_t maxfd = (curl_socket_t)-1;
int active;
+ struct timeval timeout = {0};
+ timeout.tv_usec = 250000L; /* 250 ms */
/* Clear out closed sockets */
for(socket_idx = num_sockets - 1; socket_idx >= 1; --socket_idx) {
for(socket_idx = 0; socket_idx < num_sockets; ++socket_idx) {
/* Listen on all sockets */
+#if defined(__DJGPP__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warith-conversion"
+#endif
FD_SET(all_sockets[socket_idx], &input);
+#if defined(__DJGPP__)
+#pragma GCC diagnostic pop
+#endif
if(all_sockets[socket_idx] > maxfd)
maxfd = all_sockets[socket_idx];
}
static int synchnet(curl_socket_t f /* socket to flush */)
{
-
-#if defined(HAVE_IOCTLSOCKET)
- unsigned long i;
-#else
- int i;
-#endif
int j = 0;
char rbuf[PKTSIZE];
srvr_sockaddr_union_t fromaddr;
curl_socklen_t fromaddrlen;
for(;;) {
-#if defined(HAVE_IOCTLSOCKET)
+#if defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
+ long i;
+ (void) IoctlSocket(f, FIONBIO, &i);
+#elif defined(HAVE_IOCTLSOCKET)
+ unsigned long i;
(void) ioctlsocket(f, FIONREAD, &i);
#else
+ int i;
(void) ioctl(f, FIONREAD, &i);
#endif
if(i) {
#include <sys/poll.h>
#endif
+#ifdef MSDOS
+#include <dos.h> /* delay() */
+#endif
+
#include "curlx.h" /* from the private lib dir */
#include "getpart.h"
#include "util.h"
} \
} while(0)
-#define abort_test(msg) \
+#define unittest_abort(msg) \
do { \
fprintf(stderr, "%s:%d test ABORTED: '%s'\n", \
__FILE__, __LINE__, msg); \