]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3)
authorViktor Szakats <commit@vsz.me>
Sat, 16 Nov 2024 18:04:36 +0000 (19:04 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 16 Dec 2024 22:20:55 +0000 (23:20 +0100)
`Makefile.mk` supported MS-DOS and Amiga, but `./configure` also
supported them in a better tested and more flexible way.

This patch also adds CMake support for MS-DOS/DJGPP and Amiga OS 3.

`Makefile.mk` was not maintained. Delete it in favour of first-tier
build methods.

Also include some non-MS-DOS/AmigaOS-specific tidy-up, see details at
the end of this message.

Details:

- fix/silence all MS-DOS/DJGPP build warnings and issues.
- add MS-DOS support to cmake.
  - default to `ENABLE_THREADED_RESOLVER=OFF` for MS-DOS.
  - add support for `WATT_ROOT`.
  - use static libcurl with MS-DOS.
  - fixup default CMake suffixes/prefixes for DJGPP.
  - disable hidden symbols for MS-DOS. Not supported on MS-DOS.
  - opt-in MS-DOS into `USE_UNIX_SOCKETS`.
- improve MS-DOS support in autotools.
  - default to `--disable-threaded-resolver` for MS-DOS.
- make sure to use `close_s()` (from Watt-32) with autotools and cmake.
  `Makefile.mk` used it before this patch.
- GHA: add DJGPP cmake (~30s) and autotools (~60s) build jobs.
  Also build tests and examples with cmake.
- improve AmigaOS support in autotools:
  - configure: detect `CloseSocket()` when it's a macro.
  - configure: fix `IoctlSocket` detection on AmigaOS.
  - curl-amissl.m4: pass AmiSSL libs to tests/servers.
- add AmigaOS3 support to cmake:
  - cmake: fix `HAVE_IOCTLSOCKET_CAMEL` and
    `HAVE_IOCTLSOCKET_CAMEL_FIONBIO` detections.
  - set necessary system libs.
  - add AmiSSL support.
  - inet_ntop, inet_pton: fix using it for AmigaOS. cmake detects them,
    and they did not compile with AmigaOS.
  - cmake: better sync `gethostname` detection with autotools.
    Fixes detection for AmigaOS, where `gethostname` is a macro.
  - cmake: fix `sys/utime.h` detection on AmigaOS.
  - cmake: force-disable `getaddrinfo` for AmigaOS.
  - cmake: tweak threading and static/shared default for AmigaOS.
  - cmake: rely on manual variable `AMIGA` to enable the platform.
- GHA: add AmigaOS cmake and autotools (~45s) jobs.
  Also build tests and examples with cmake.
- INSTALL: update MS-DOS and AmigaOS build instructions.
- amigaos: fix `-Wpointer-sign` and
  `zero or negative size array '_args'` in `Printf()`.
- amigaos: fix `-Wpointer-sign`
- amigaos: fix `-Wredundant-decls` `errno` and `h_errno`.
- amigaos: brute-force silence `lseek()` size warnings.
- amigaos: server/resolve: silence `-Wdiscarded-qualifiers`.
- amigaos: server/resolve: fix `-Wpointer-sign`.
- amigaos: fix `CURL_SA_FAMILY_T` type.
- nonblock: prefer `HAVE_IOCTLSOCKET_CAMEL_FIONBIO` for AmigaOS.
  `ioctl` is also detected, but fails when used. Make the above override
  it for a successful build.
Authored-by: Darren Banfi
  Fixes #15537
  Closes #15603
- tftpd: prefer `HAVE_IOCTLSOCKET_CAMEL_FIONBIO` for AmigaOS.
- tftpd: tidy-up conditional code.
- curl: set stack size to 16384 for AmigaOS3/4
  Overriding the default 4096.
Suggested-by: Darren Banfi
  Ref: https://github.com/curl/curl/pull/15543#issuecomment-2498783123
  Ref: https://wiki.amigaos.net/wiki/Controlling_Application_Stack
- functypes.h: fix `SEND_QUAL_ARG2` for AmigaOS.
- tftp: add missing cast in sendto() call for AmigaOS.
- getinfo: fix warning with AmigaOS.
- tool_operate: silence warning with AmigaOS
- amigaos: fix building libtests due to missing `RLIMIT_NOFILE`.
- curl_gethostname: silence warning for AmigaOS.
- ftp: silence `-Wtype-limits` for AmigaOS.
- libtest: fix timeval initialization for AmigaOS.
- examples: fix `timeval` initialization for AmigaOS.
- examples: silence warning for AmigaOS.
- configure: fix IPv6 detection for cross-builds.
- netrc: fix to build with AmigaOS cleanly.
- buildinfo: detect and add `DOS` tag for MS-DOS builds.
- buildinfo: add `AMIGA` to buildinfo.txt in auttools.
- build: move `USE_WATT32` macro definition to cmake/configure.

Non-MS-DOS/AmigeOS-specific tidy-ups:

- configure: sync `sa_family_t` detection with cmake.
- configure: sync `ADDRESS_FAMILY` detection signals with cmake.
- doh: use `CURL_SA_FAMILY_T`.
- lib: drop mingw-specific `CURL_SA_FAMILY_T` workaround.
- cmake: extend instead of override check-specific
  configurations/requirements.
  This allows to honor global requirements added earlier.
  Necessary for AmigaOS for example.
- cmake: omit warning on disabled IPv6 for MS-DOS and AmigaOS.
  No IPv6 support on these platforms. Also sync with autotools.
- lib1960: use libcurl `inet_pton()` wrapper.
- cmake: detect LibreSSL (to match autotools).
- cmake: say the specific OpenSSL flavour detected.
- hostip: add missing `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` guard.
- lib: simplify classic mac feature guards.

Follow-up to a8861b6ccdd7ca35b6115588a578e36d765c9e38 #9764

Closes #15543

74 files changed:
.github/labeler.yml
.github/scripts/cmp-config.pl
.github/workflows/non-native.yml
CMake/CurlSymbolHiding.cmake
CMake/CurlTests.c
CMake/FindGSS.cmake
CMake/OtherTests.cmake
CMake/PickyWarnings.cmake
CMakeLists.txt
Makefile.dist
acinclude.m4
configure.ac
docs/INSTALL-CMAKE.md
docs/INSTALL.md
docs/examples/Makefile.am
docs/examples/Makefile.mk [deleted file]
docs/examples/address-scope.c
docs/examples/multi-legacy.c
docs/examples/sendrecv.c
lib/Makefile.am
lib/Makefile.mk [deleted file]
lib/amigaos.c
lib/config-amigaos.h [deleted file]
lib/config-dos.h [deleted file]
lib/curl_addrinfo.c
lib/curl_config.h.cmake
lib/curl_gethostname.c
lib/curl_setup.h
lib/curl_setup_once.h
lib/doh.c
lib/file.c
lib/ftp.c
lib/functypes.h
lib/getinfo.c
lib/hostip.c
lib/http.c
lib/inet_ntop.h
lib/inet_pton.h
lib/multi.c
lib/netrc.c
lib/nonblock.c
lib/parsedate.c
lib/select.c
lib/tftp.c
m4/curl-amissl.m4
m4/curl-confopts.m4
m4/curl-functions.m4
src/Makefile.am
src/Makefile.mk [deleted file]
src/tool_cb_rea.c
src/tool_cb_see.c
src/tool_doswin.c
src/tool_doswin.h
src/tool_findfile.c
src/tool_getparam.c
src/tool_help.c
src/tool_main.c
src/tool_operate.c
tests/data/test517
tests/libtest/CMakeLists.txt
tests/libtest/Makefile.am
tests/libtest/Makefile.inc
tests/libtest/lib1531.c
tests/libtest/lib1960.c
tests/libtest/lib530.c
tests/libtest/lib582.c
tests/server/mqttd.c
tests/server/resolve.c
tests/server/sockfilt.c
tests/server/socksd.c
tests/server/sws.c
tests/server/tftpd.c
tests/server/util.c
tests/unit/curlcheck.h

index cd0468d88fe841793c75bfdc00d7ac35b1e20c45..b2085fbf9e60af52c7923081d4043acbf9446fdc 100644 (file)
@@ -63,7 +63,6 @@ build:
               **/CMakeLists.txt,\
               **/Makefile.am,\
               **/Makefile.inc,\
-              **/Makefile.mk,\
               **/*.m4,\
               **/*.mk,\
               *.m4,\
index 55c5c6ef40a294ada29a6dfa580161cc1a0bc8f7..54c974117d68323bab7cc121a94b6e647d308f1c 100755 (executable)
@@ -37,11 +37,8 @@ my %remove = (
     '#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,
@@ -74,7 +71,6 @@ my %remove = (
     '#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,
index e11bd086e09a7d02facf6801d678999d77d2b67b..be2210152085abbf6cb56ad10ec988dfd43d507a 100644 (file)
@@ -37,7 +37,7 @@ permissions: {}
 
 jobs:
   netbsd:
-    name: 'NetBSD (cmake, openssl, clang)'
+    name: 'NetBSD (CM, openssl, clang)'
     runs-on: ubuntu-latest
     timeout-minutes: 30
     strategy:
@@ -77,7 +77,7 @@ jobs:
             echo '::endgroup::'
 
   openbsd:
-    name: 'OpenBSD (cmake, libressl, clang)'
+    name: 'OpenBSD (CM, libressl, clang)'
     runs-on: ubuntu-latest
     timeout-minutes: 30
     strategy:
@@ -118,7 +118,7 @@ jobs:
             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:
@@ -194,7 +194,7 @@ jobs:
             echo '::endgroup::'
 
   omnios:
-    name: 'OmniOS (autotools, openssl, gcc, amd64)'
+    name: 'OmniOS (AM, openssl, gcc, amd64)'
     runs-on: ubuntu-latest
     timeout-minutes: 30
     steps:
@@ -224,3 +224,199 @@ jobs:
             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
index df601aa3c2aa0a145f974507253a16c3787286b8..31a97cb107085c7fb3ed07455a6d4db6bdaf050e 100644 (file)
@@ -29,6 +29,8 @@ if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
   # 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)
index 03346187d6b050148d16886bdb1e4e1165891ff4..2118f3ca44d3297eca922c5fcde1ae7c7895c439 100644 (file)
@@ -181,9 +181,7 @@ int main(void)
 
 #ifdef HAVE_IOCTLSOCKET_CAMEL
 /* includes start */
-#ifdef _WIN32
-#  include <winsock2.h>
-#endif
+#include <proto/bsdsocket.h>
 int main(void)
 {
   /* IoctlSocket source code */
@@ -196,8 +194,9 @@ int main(void)
 
 #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)
 {
index 94fdc5f5db2dfcc92c8c50b49238b6dba182bd58..c939cb166f7ebe0843554d02f2006aa255543272 100644 (file)
@@ -175,7 +175,7 @@ if(NOT _GSS_FOUND)  # Not found by pkg-config. Let us take more traditional appr
 
     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)
index 52e558c18371446c9ca63207c50eb27de3efdb48..01885381f32dd0f08ba1be7d511436151e007f41 100644 (file)
@@ -40,7 +40,7 @@ if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
   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()
index e431df4ccc9a2a9c7ce13a94437a73630b86a333..bfafbb970a26186c4bd6d1879b02c2210c09e333 100644 (file)
@@ -27,6 +27,7 @@ set(_picky "")
 
 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"))
index 226ed8494ecde350fcde95b90ddfd54d6da7d73e..8c97885d868999bfc0d349b092c8ac420c350d7a 100644 (file)
@@ -108,6 +108,12 @@ endif()
 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()
@@ -201,11 +207,20 @@ if(WIN32)
   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)
@@ -420,7 +435,9 @@ if(ENABLE_IPV6 AND NOT WIN32)
   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()
@@ -469,6 +486,9 @@ 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
@@ -489,6 +509,8 @@ elseif(APPLE)
   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)
@@ -503,15 +525,34 @@ 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()
@@ -637,14 +678,29 @@ if(CURL_USE_OPENSSL)
   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)
@@ -730,8 +786,8 @@ if(CURL_USE_GNUTLS)
 
   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()
@@ -804,8 +860,8 @@ 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()
@@ -814,8 +870,8 @@ macro(curl_openssl_check_symbol_exists _symbol _files _variable _extra_libs)
       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
@@ -910,6 +966,9 @@ if(USE_NGTCP2)
     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)
@@ -949,8 +1008,8 @@ if(USE_QUICHE)
   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()
@@ -1015,7 +1074,7 @@ if(NOT CURL_DISABLE_LDAP)
     # 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)
@@ -1076,7 +1135,7 @@ if(APPLE)
   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)
@@ -1216,8 +1275,8 @@ if(CURL_USE_GSSAPI)
         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()
@@ -1282,7 +1341,7 @@ 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)
@@ -1430,7 +1489,7 @@ check_include_file("sys/stat.h"       HAVE_SYS_STAT_H)
 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)
@@ -1458,7 +1517,7 @@ check_include_file("termios.h"        HAVE_TERMIOS_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()
 
@@ -1504,10 +1563,14 @@ if(SIZEOF_SUSECONDS_T)
 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)
@@ -1544,6 +1607,7 @@ check_function_exists("utime"         HAVE_UTIME)
 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)
@@ -1568,7 +1632,7 @@ if(WIN32 OR CYGWIN)
   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()
 
@@ -1597,11 +1661,11 @@ 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()
@@ -1635,7 +1699,7 @@ endforeach()
 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)
 
@@ -1650,10 +1714,10 @@ endif()
 
 # 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
@@ -1972,8 +2036,8 @@ message(STATUS "Features: ${SUPPORT_FEATURES}")
 # 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)
index e9132040325ad5d56f33ac2dc174a0d03e98404e..ee1c2be59b053c5b6bcd54584dca906200399fc8 100644 (file)
@@ -38,10 +38,6 @@ 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
@@ -50,10 +46,6 @@ 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
index f9c9c82f8d86525b1439c03db14e257f37bfde97..4081c009a9793ba6cb72db27d25f39472cd2ed88 100644 (file)
@@ -1563,6 +1563,8 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
   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"
index 2bdec7c010a9507944b38ad1b872575bd34baa0d..a5560cc82bdcee8830e70c43226d53428a350540 100644 (file)
@@ -1214,12 +1214,19 @@ fi
 
 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
@@ -1784,35 +1791,35 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
     ;;
   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"
@@ -1820,24 +1827,26 @@ if test "$ipv6" = yes; then
   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
@@ -4018,12 +4027,12 @@ AC_CHECK_TYPE([bool],[
 
 # 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
index 4e38328ee366965736b06aca21166984d5bb43c4..507d5fd48f19b4972be33428d3f5e3a0a114e9c5 100644 (file)
@@ -182,8 +182,8 @@ assumes that CMake generates `Makefile`:
 
 - `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`
@@ -304,6 +304,9 @@ Details via CMake
 ## 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.
@@ -345,6 +348,7 @@ Details via CMake
 - `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.
index 3b403cf8046b51bd4c1aee017f368712f8cc4c44..ff924d49387af5fdb6d4bc274399f00cd18ee078 100644 (file)
@@ -211,17 +211,34 @@ Run `make`
 
 ## 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
@@ -229,9 +246,31 @@ Notes:
 
 ## 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
 
index e5ff9ffdcf0e89c804d2c93027d18557937badbc..d67b4dd6c4e7a586062d171c1d0fe3a8b1df20cb 100644 (file)
@@ -24,7 +24,7 @@
 
 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
diff --git a/docs/examples/Makefile.mk b/docs/examples/Makefile.mk
deleted file mode 100644 (file)
index 5a5372d..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#***************************************************************************
-#                                  _   _ ____  _
-#  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)
index a4ae26539172bbc9f9bbf41de01fa0d347e52de0..43e9cf8986276c2a0325e79dc6a45c4cb0f0b1a2 100644 (file)
 #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;
 
index 3e7714f40c55b0e0cf5ecfcab381adccd7245a56..2028cf464888b63ade10a3dae7d73be746c2818f 100644 (file)
@@ -100,11 +100,19 @@ int main(void)
 
     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 */
@@ -127,7 +135,8 @@ int main(void)
       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
     }
index 93e06099c9b7eea80e1b28f614313a24e77cdce8..6215f0ddf2ae151113b5551447f0539d2a96e48f 100644 (file)
@@ -37,8 +37,13 @@ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms)
   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);
@@ -51,6 +56,9 @@ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms)
 #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 */
index 3a40280b94cf731fa60c56bfefbd9318c0281ab6..74bff0e565447af983898185ebd4bf97bc16e7bd 100644 (file)
@@ -28,9 +28,9 @@ CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
 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)
 
diff --git a/lib/Makefile.mk b/lib/Makefile.mk
deleted file mode 100644 (file)
index e130b75..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-#***************************************************************************
-#                                  _   _ ____  _
-#  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
index 1321c53c484809e076d777cb374bf372eb18550d..c4872f248d92755ab99b1fb3c250716c6afb3cfe 100644 (file)
@@ -196,12 +196,11 @@ int Curl_amiga_select(int nfds, fd_set *readfds, fd_set *writefds,
  */
 
 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)
@@ -215,7 +214,7 @@ 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!");
diff --git a/lib/config-amigaos.h b/lib/config-amigaos.h
deleted file mode 100644 (file)
index 5eac4ae..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#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 */
diff --git a/lib/config-dos.h b/lib/config-dos.h
deleted file mode 100644 (file)
index 52571ce..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#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 */
index a08caf3328c6bd752a712091561c876fcf7b2229..52f0f9125519c8fa2205c5f8b7ae77932be7547e 100644 (file)
@@ -318,11 +318,7 @@ Curl_he2ai(const struct hostent *he, int port)
       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;
 
@@ -331,11 +327,7 @@ Curl_he2ai(const struct hostent *he, int port)
       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
index 65088f233e2f16c2bef2b98f0c607a6f1080d060..f0438f8024446c8b1c081f4b21055e135b9e1e6e 100644 (file)
@@ -736,6 +736,9 @@ ${SIZEOF_TIME_T_CODE}
 /* 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
 
@@ -785,6 +788,9 @@ ${SIZEOF_TIME_T_CODE}
 /* 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
 
index 617a8ad52f6320f06a2e8880569cacb7745b9bbf..fb418b400d89a261bd613af76440b7d0e8358871 100644 (file)
@@ -73,7 +73,11 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen)
 #else /* DEBUGBUILD */
 
   name[0] = '\0';
+#ifdef __AMIGA__
+  err = gethostname((unsigned char *)name, namelen);
+#else
   err = gethostname(name, namelen);
+#endif
 
 #endif
 
index 1237a531487693ccf5f26d82a0a3a263a700e616..f722e330f80a43e5188512f85b480fc6d3720182 100644 (file)
 #  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.
  */
@@ -908,6 +908,8 @@ endings either CRLF or LF so 't' is appropriate.
 #    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
index d5ff481b5478fd1f633f54a53182d3156cb72d2f..32f176451209b807387c8b2fc416f893e056a583 100644 (file)
@@ -187,7 +187,7 @@ struct timeval {
 #  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))
index 8769372e0be6f6769c8267e29f3ac4257ff065ea..a74f9447ce841d576da259814debf7bce5728df8 100644 (file)
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -961,11 +961,7 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname,
       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;
 
@@ -974,11 +970,7 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname,
       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
index 4cd8d0ff83e1622747cfe54c8889e4158ef855b5..39860da68cf2f677d259f703d9d4bf836c882979 100644 (file)
@@ -553,8 +553,13 @@ static CURLcode file_do(struct Curl_easy *data, bool *done)
 
   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 {
index 16ab0af0de15ba6dd81f20ebaf4fab3dabb76f77..26c9630f25ad2adb49ca8a93c09ba50a25e9b299 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2079,10 +2079,19 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data,
       /* 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;
index ea66d3281d9ecadccedfcb3a877e263c076708b3..b4dccc0ce48744462eeab2288756d73a09a95bfc 100644 (file)
@@ -62,6 +62,7 @@
 
 /* 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
index 9144ad715df6048e8645ad6325ee653ae1695d01..e6d67195056d97c3af223fb1ef70f990c6815206 100644 (file)
@@ -238,8 +238,10 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info,
   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;
index 1a9432d52afa89cb17bddb96ce8f4a680e2d093f..509b9d48671506b4d4705556739f35c3c0e48a1d 100644 (file)
@@ -198,7 +198,7 @@ hostcache_entry_is_stale(void *datap, void *hc)
   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;
@@ -541,7 +541,9 @@ static struct Curl_addrinfo *get_localhost6(int port, const char *name)
   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));
index 35e70855152fd372efbbe95e091065a4e24aaad3..50fae23720da6d81db3583614062df019bd26dac 100644 (file)
@@ -2903,7 +2903,7 @@ CURLcode Curl_http_header(struct Curl_easy *data,
       (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);
       }
index f592f252517cadb1967e9e553ada6453a1253cd7..206d79c86624ac218d3f6c70962a6fe11962fea7 100644 (file)
@@ -35,6 +35,10 @@ char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
 #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))
index f8562fa8a7aa0dd9139cb33ffae3b7b13ec1a713..50bce613427e1b79a19407aee64ae7e10a181d45 100644 (file)
@@ -32,7 +32,11 @@ int Curl_inet_pton(int, const char *, void *);
 #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 */
index 1851dc731e657eb13b406d05b38cbbc8cc50d81b..9d76ae9696caebd36e53c93baf027e3fe81ee050 100644 (file)
@@ -1170,10 +1170,17 @@ CURLMcode curl_multi_fdset(CURLM *m,
       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];
     }
index 056ea96a7c801001b190e3380aa693d618c873f8..cbc86484f6f886ed464d6f9e44b61a2a97f27d16 100644 (file)
@@ -26,7 +26,9 @@
 #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>
index 6dcf42a7eab096af83a383c46f658648c99e7fb3..a59cab83253e3a0caab926a4d743e29900e75745 100644 (file)
@@ -63,6 +63,12 @@ int curlx_nonblock(curl_socket_t sockfd,    /* operate on this */
     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 */
@@ -75,12 +81,6 @@ int curlx_nonblock(curl_socket_t sockfd,    /* operate on this */
   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 */
index 4d0a221fbfbf9c31c55acb3e014ef642a46e6de9..65b231ad5c69f415533ab61b1ebd7f27c16d94b9 100644 (file)
@@ -558,7 +558,7 @@ static int parsedate(const char *date, time_t *output)
   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 */
   }
@@ -586,7 +586,7 @@ time_t curl_getdate(const char *p, const time_t *now)
   (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;
@@ -606,7 +606,7 @@ time_t Curl_getdate_capped(const char *p)
 
   switch(rc) {
   case PARSEDATE_OK:
-    if(parsed == -1)
+    if(parsed == (time_t)-1)
       /* avoid returning -1 for a working scenario */
       parsed++;
     return parsed;
index c1779ad1e51188c0c45af9165dc78adf562048ac..ab11e0871d2f800060861ad980ddd098987f6fdd 100644 (file)
@@ -78,7 +78,7 @@ int Curl_wait_ms(timediff_t timeout_ms)
     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
index e92e5127a56bde76934bb2a2d676511c401b594a..4d47be838704b002ccc33d53896d7018ae68a54e 100644 (file)
@@ -524,7 +524,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state,
        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];
index b417207210c72fe277329ac61809a959e53ad3a3..a70a5366321ee458349af4feb8925ba0211b90c1 100644 (file)
@@ -50,6 +50,7 @@ if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then
       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 \
index b015abc6186ba711e49251298f3372f939631284..f11a320eb93ec0e7bdbcaa7ca28584274446ad71 100644 (file)
@@ -43,9 +43,20 @@ AS_HELP_STRING([--disable-threaded-resolver],[Disable threaded resolver]),
       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])
index b2afbe7c5ec1b386371b65ca33e28709326786d0..46665977d4c973b4ac71dd6fb90aad93808ef6c6 100644 (file)
@@ -742,7 +742,6 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
   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"
   #
@@ -764,20 +763,6 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
   ])
   #
   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([[
@@ -809,7 +794,6 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
   #
   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])
@@ -2870,7 +2854,6 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
   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"
   #
@@ -2890,19 +2873,6 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
   ])
   #
   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([[
@@ -2933,7 +2903,6 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
   #
   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])
index 98cc194c4d8a08293ec28ad5ebf666fabba1681f..4fc7ef68cf18edd5e9061c1b657fa66d9350fec1 100644 (file)
@@ -27,7 +27,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
 .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
diff --git a/src/Makefile.mk b/src/Makefile.mk
deleted file mode 100644 (file)
index f25fc02..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#***************************************************************************
-#                                  _   _ ____  _
-#  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)
index a9b0d68aae8e4a27f9242a5c41857edf32740880..fb8d7a3a7ead6b1ae00a10ad4ac73ea645e06336 100644 (file)
@@ -74,7 +74,14 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
       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 */
     }
index a425ebe9de7daa54a1d58c2d1060fcf9ec94c6e6..99d3197eae9deacd301d5759f49b9900f89ff8ee 100644 (file)
@@ -80,7 +80,11 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
   }
 #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. */
index 301b2974e5bd85c1c28a7001edaec37581c188ce..31490cc4c12f6c6c6bfddf4617ebb5836ab9a271 100644 (file)
@@ -242,7 +242,8 @@ SANITIZE_ERR_OK: Good -- 'path' can be truncated
 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;
 
@@ -291,8 +292,8 @@ sanitize_file_name.
 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 */
index 25df78ee5d28449b42e1a76928f8c126145b11db..bee1466c273b33627368852666f93aec739735c6 100644 (file)
@@ -40,14 +40,6 @@ typedef enum {
 
 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__))
 
index 672fc7b9924957955e4df611697b73cf570e26e9..5b1e256a08472953c735bf1194bf2b20701ea03c 100644 (file)
@@ -24,8 +24,9 @@
 #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
index 9fb729086bed33f6ae0c374867e4ba49883e27b3..8754f0bc6f98649ec232c20b47df8abcfc5802bd 100644 (file)
 
 #include "memdebug.h" /* keep this as LAST include */
 
-#ifdef MSDOS
-#  define USE_WATT32
-#endif
-
 #define ALLOW_BLANK TRUE
 #define DENY_BLANK FALSE
 
index 57b14a3b07fa0be2d042bb4e8ab0ad4daf028a1b..4f71c8ee8ed07eb204bcc5f8e9a132424c12fa4d 100644 (file)
 
 #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
index 07eb70bfd296111868cc5530401d5ab569e74044..7f8890483b09f007890063297a90d5f0846a5f79 100644 (file)
 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
index b3a938c737a3998a3ee016365bf120b2c6797790..ff28d77b39aa7f3ffdd4877450dc6ede767bc0e5 100644 (file)
@@ -676,7 +676,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
               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 */
index bd197cb5bc1b140e51756f6599100b44da8b2789..ef18e3395ad54de187106e06bd6f8248df6f3755 100644 (file)
@@ -35,8 +35,8 @@ nothing
 </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.
index 2a24eca85bfde52a3d64ae82e38cccc3ab5ab46b..0e43c7f2ab5e36509d784ab8d42dad7137404d9c 100644 (file)
@@ -22,7 +22,8 @@
 #
 ###########################################################################
 
-# 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")
 
@@ -50,7 +51,7 @@ if(CURL_TEST_BUNDLES)
   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()
 
@@ -63,7 +64,7 @@ foreach(_target IN LISTS LIBTESTPROGS)
 
   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)
index 809731d074a8923e5c266c006f86a9665177091a..a2288da5fa4a7bdc7155cce696d552d7fe7cd81f 100644 (file)
@@ -103,7 +103,7 @@ CLEANFILES += libtest_bundle.c
 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)
index 8f58fd64229d5cbcebdb4949111b3c3184d82eb3..4824def74a158e5223ec9c74054a6bf5ab3a61d2 100644 (file)
@@ -33,6 +33,9 @@ WARNLESS = ../../lib/warnless.c ../../lib/warnless.h
 # 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
@@ -641,7 +644,7 @@ lib1958_LDADD = $(TESTUTIL_LIBS)
 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)
index f4814f1222f23b5ec8badd43b832ecdc8be0e3f9..ec40f6a1c858169ae3f55bd1a8e7f3a7354849d1 100644 (file)
@@ -115,7 +115,8 @@ CURLcode test(char *URL)
       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
     }
index 020ee4ba69b4c599fc7ee038bf5fdec4fe73eab2..58cc8da10978463b9f59026ff85cc4fc40d540bf 100644 (file)
  ***************************************************************************/
 #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 */
@@ -101,7 +90,7 @@ CURLcode test(char *URL)
   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;
   }
@@ -139,11 +128,3 @@ test_cleanup:
 
   return res;
 }
-#else
-CURLcode test(char *URL)
-{
-  (void)URL;
-  printf("lacks inet_pton\n");
-  return CURLE_OK;
-}
-#endif
index 5f24c904bc5a2291dd3384bde3d6f47a7e14860b..c63b0a5b87815a94b2862f71b54b56ec8acd367e 100644 (file)
@@ -218,7 +218,14 @@ static void updateFdSet(struct Sockets *sockets, fd_set* fdset,
 {
   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;
     }
@@ -261,8 +268,9 @@ static CURLcode testone(char *URL, int timercb, int socketcb)
   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;
@@ -303,14 +311,15 @@ static CURLcode testone(char *URL, int timercb, int socketcb)
   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;
@@ -333,7 +342,7 @@ static CURLcode testone(char *URL, int timercb, int socketcb)
       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;
index d1609a83d3ff4fc76d0bdcfb427fa779fcdb08bc..5cbe8426be51284544fe5fb74ebe5de5594aeaac 100644 (file)
@@ -186,7 +186,14 @@ static void updateFdSet(struct Sockets *sockets, fd_set* fdset,
 {
   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;
     }
@@ -227,8 +234,9 @@ CURLcode test(char *URL)
   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);
 
@@ -299,14 +307,15 @@ CURLcode test(char *URL)
   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;
@@ -322,7 +331,7 @@ CURLcode test(char *URL)
     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");
     }
index dc56d99a9e636310872fe54989482322ce1cc570..233d03dbf0e6335b1438fc4ecd1597c183033b53 100644 (file)
@@ -748,7 +748,14 @@ static bool incoming(curl_socket_t listenfd)
     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 */
index 96db23b4facd61b99010be6e32355cd383b53ba5..0e8166f70ae0e12e3fc3beaef4ebefcc00234e0f 100644 (file)
@@ -142,7 +142,11 @@ int main(int argc, char *argv[])
     /* gethostbyname() resolve */
     struct hostent *he;
 
+#ifdef __AMIGA__
+    he = gethostbyname((unsigned char *)host);
+#else
     he = gethostbyname(host);
+#endif
 
     rc = !he;
   }
index 480d23ccebd8bfc95a17e4c96db8939249819858..3c401113acaf05a24ccd58f45c3f2abd0966b34e 100644 (file)
@@ -996,7 +996,14 @@ static bool juggle(curl_socket_t *sockfdp,
   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) {
 
@@ -1005,7 +1012,14 @@ static bool juggle(curl_socket_t *sockfdp,
     /* 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;
 
@@ -1019,7 +1033,14 @@ static bool juggle(curl_socket_t *sockfdp,
     }
     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;
@@ -1029,7 +1050,14 @@ static bool juggle(curl_socket_t *sockfdp,
     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 {
index 5206c6bf59d1f323489ea7e34e8cf75acf5a90c0..6df6bd4cdf354c35044c00ca85ee42adfd0b2e01 100644 (file)
@@ -717,16 +717,37 @@ static bool incoming(curl_socket_t listenfd)
     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;
       }
index ef139bfc3c1f39f5c7c009b70780ddcab5dd95a5..21ba2093786821937c6460d046c6d43bfc9cab3f 100644 (file)
@@ -902,13 +902,21 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
           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);
@@ -1375,10 +1383,18 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port)
     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)
@@ -1488,9 +1504,10 @@ static void http_connect(curl_socket_t *infdp,
 
     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);
@@ -1502,7 +1519,14 @@ static void http_connect(curl_socket_t *infdp,
       /* 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;
     }
 
@@ -1512,14 +1536,28 @@ static void http_connect(curl_socket_t *infdp,
       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];
         }
@@ -1528,14 +1566,28 @@ static void http_connect(curl_socket_t *infdp,
       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];
         }
@@ -2323,9 +2375,10 @@ int main(int argc, char *argv[])
   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) {
@@ -2347,7 +2400,14 @@ int main(int argc, char *argv[])
 
     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];
     }
index 4edc2fd6ddf4c505a4d52d882d7f3b91a372de7c..63e642dc0d0a78f32ac158d81d629f3e275957cb 100644 (file)
@@ -512,21 +512,20 @@ skipit:
 
 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) {
index 287ca3000ac5630fb81ef19a34f2acdd59d07527..9af8b6e9402cc7af1bb5ad7b8175061a95a55708 100644 (file)
 #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"
index c0faf5069b28285c1e679421ccb972a66dd95687..280b8b1b5664726dbb78bec814bd08d2c7646078 100644 (file)
@@ -84,7 +84,7 @@
     }                                                                   \
   } while(0)
 
-#define abort_test(msg)                                       \
+#define unittest_abort(msg)                                   \
   do {                                                        \
     fprintf(stderr, "%s:%d test ABORTED: '%s'\n",             \
             __FILE__, __LINE__, msg);                         \