Repository navigation
Conversation
|
Successfully cross-built for MS-DOS with: DJGPP=/path/to/djgpp
./configure \
CC="$DJGPP/bin/i586-pc-msdosdjgpp-gcc" \
AR="$DJGPP/bin/i586-pc-msdosdjgpp-ar" \
RANLIB="$DJGPP/bin/i586-pc-msdosdjgpp-ranlib" \
WATT_ROOT="$DJGPP/net/watt" \
--host=i586-pc-msdosdjgpp \
--with-openssl="$DJGPP" \
--with-zlib="$DJGPP" \
--without-libpsl \
--disable-shared
cmake . \
-DCMAKE_SYSTEM_NAME=DOS \
-DCMAKE_SYSTEM_PROCESSOR=x86 \
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
-DCMAKE_C_COMPILER="$DJGPP/bin/i586-pc-msdosdjgpp-gcc" \
-DWATT_ROOT="$DJGPP/net/watt" \
-DOPENSSL_INCLUDE_DIR="$DJGPP/include" \
-DOPENSSL_SSL_LIBRARY="$DJGPP/lib/libssl.a" \
-DOPENSSL_CRYPTO_LIBRARY="$DJGPP/lib/libcrypto.a" \
-DZLIB_INCLUDE_DIR="$DJGPP/include" \
-DZLIB_LIBRARY="$DJGPP/lib/libz.a" \
-DCURL_USE_LIBPSL=OFFbuild templates for Amiga: # https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz
# https://github.com/jens-maus/amissl/releases/download/5.18/AmiSSL-5.18-SDK.lha
AMISSL='/path/to/AmiSSL/Developer'
./configure \
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 \
--with-amissl \
CFLAGS='-O0 -msoft-float -mcrt=clib2' \
CPPFLAGS="-I$AMISSL/include" \
LDFLAGS="-L$AMISSL/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/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-gcc \
-DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
-DAMISSL_INCLUDE_DIR="$AMISSL/include" \
-DAMISSL_STUBS_LIBRARY="$AMISSL/lib/AmigaOS3/libamisslstubs.a" \
-DAMISSL_AUTO_LIBRARY="$AMISSL/lib/AmigaOS3/libamisslauto.a" \
-DCURL_USE_LIBPSL=OFFbased on #15603 Officially there is no CMake support for DJGPP, but it works with some tweaks. |
|
I'm wondering if it'd make sense to delete edit: converting them to a cmake or autotools cache is certainly possible, but the maintenance cost is high. |
0a532ec to
85694c5
Compare
6fe0d32 to
732e98f
Compare
I think trying to do them as caches is just overkill and not something we do for any other platforms either. configure/cmake should be able to generate the correct setup on their own. IMHO, those two "hard coded" config files should be removed if we think configure/cmake can do the job. |
|
Arrived to the same conclusion, it's overkill. With MS-DOS + CMake the toolchain env is detected fine now (also matching previous manual values). Dependency detection is probably broken due to CMake insisting on the |
fc2a411 to
09796ce
Compare
It's a simple cross-build, not "non-native", just like AmigaOS.
This reverts commit c59917ecf441a69ea3496f2cb8f26e2f3cf91476. I'm not sure if we want this chore.
Overriding the default 4096. Suggested-by: Darren Banfi Ref: curl#15543 (comment) Ref: https://wiki.amigaos.net/wiki/Controlling_Application_Stack
Include `netinet/in.h` for FreeBSD/OpenBSD. Also include `sys/socket.h`
just in case, based on earlier code in `tests/libtest/lib1960.c`.
Also:
- document these in `CMakeLists.txt`.
- add a CI job testing FreeBSD with no unity and no test bundles.
(without running tests to keep it fast)
FreeBSD (autotools):
```
../../../tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
66 | struct sockaddr_in serv_addr;
| ^
../../../tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
66 | struct sockaddr_in serv_addr;
| ^
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725114118?pr=16188#step:3:5289
OpenBSD (cmake):
```
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
struct sockaddr_in serv_addr;
^
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
struct sockaddr_in serv_addr;
^
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725102004?pr=16188#step:3:2166
Reported-by: CueXXIII on Github
Fixes #16184
Follow-up to a3585c9 #15543
Closes #16188
Almost all feature detection results are pre-filled on Windows for performance, so none of the issues fixed here affected builds. For good measure, this patch add missing detections and fixes others to make sure they work even when omitting the pre-fill. It also fixes detecting IPv6 for MS-DOS. - fix `HAVE_STRUCT_TIMEVAL` detection for MSVC. Follow-up to c1bc090 #12495 - add `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection for Windows. - fix `HAVE_STRDUP` detection for MSVC. - fix `HAVE_SNPRINTF` detection for Windows. Regression from 8e34505 #15164 - fix `HAVE_IOCTLSOCKET` detection for non-UWP MSVC. - exclude `if_nametoindex` detection for Windows. Although it exists on Windows, detection, usage and availability is complicated, and curl doesn't use it on this platform. Regression from 8e34505 #15164 - move IPv6 detections so that pre-filling and MS-DOS Watt-32 configuration applies to them. This fixes `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection with MS-DOS. Ref: https://github.com/curl/curl/actions/runs/13260511764/job/37015877585#step:7:306 Follow-up to a3585c9 #15543 Also: - add debug option to test without pre-filling. - replace `NOT LESS` with `GREATER_EQUAL` Closes #16278
`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 curl#15537
Closes curl#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: curl#15543 (comment)
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 a8861b6 curl#9764
Closes curl#15543
Include `netinet/in.h` for FreeBSD/OpenBSD. Also include `sys/socket.h`
just in case, based on earlier code in `tests/libtest/lib1960.c`.
Also:
- document these in `CMakeLists.txt`.
- add a CI job testing FreeBSD with no unity and no test bundles.
(without running tests to keep it fast)
FreeBSD (autotools):
```
../../../tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
66 | struct sockaddr_in serv_addr;
| ^
../../../tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
66 | struct sockaddr_in serv_addr;
| ^
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725114118?pr=16188#step:3:5289
OpenBSD (cmake):
```
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
struct sockaddr_in serv_addr;
^
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
struct sockaddr_in serv_addr;
^
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725102004?pr=16188#step:3:2166
Reported-by: CueXXIII on Github
Fixes curl#16184
Follow-up to a3585c9 curl#15543
Closes curl#16188
Almost all feature detection results are pre-filled on Windows for performance, so none of the issues fixed here affected builds. For good measure, this patch add missing detections and fixes others to make sure they work even when omitting the pre-fill. It also fixes detecting IPv6 for MS-DOS. - fix `HAVE_STRUCT_TIMEVAL` detection for MSVC. Follow-up to c1bc090 curl#12495 - add `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection for Windows. - fix `HAVE_STRDUP` detection for MSVC. - fix `HAVE_SNPRINTF` detection for Windows. Regression from 8e34505 curl#15164 - fix `HAVE_IOCTLSOCKET` detection for non-UWP MSVC. - exclude `if_nametoindex` detection for Windows. Although it exists on Windows, detection, usage and availability is complicated, and curl doesn't use it on this platform. Regression from 8e34505 curl#15164 - move IPv6 detections so that pre-filling and MS-DOS Watt-32 configuration applies to them. This fixes `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection with MS-DOS. Ref: https://github.com/curl/curl/actions/runs/13260511764/job/37015877585#step:7:306 Follow-up to a3585c9 curl#15543 Also: - add debug option to test without pre-filling. - replace `NOT LESS` with `GREATER_EQUAL` Closes curl#16278
Makefile.mksupported MS-DOS and Amiga, but./configurealsosupported them in a better tested and more flexible way.
This patch also adds CMake support for MS-DOS/DJGPP and Amiga OS 3.
Makefile.mkwas not maintained. Delete it in favour of first-tierbuild methods.
Also include some non-MS-DOS/AmigaOS-specific tidy-up, see details at
the end of this message.
Details:
ENABLE_THREADED_RESOLVER=OFFfor MS-DOS.WATT_ROOT.USE_UNIX_SOCKETS.--disable-threaded-resolverfor MS-DOS.close_s()(from Watt-32) with autotools and cmake.Makefile.mkused it before this patch.Also build tests and examples with cmake.
CloseSocket()when it's a macro.IoctlSocketdetection on AmigaOS.HAVE_IOCTLSOCKET_CAMELandHAVE_IOCTLSOCKET_CAMEL_FIONBIOdetections.and they did not compile with AmigaOS.
gethostnamedetection with autotools.Fixes detection for AmigaOS, where
gethostnameis a macro.sys/utime.hdetection on AmigaOS.getaddrinfofor AmigaOS.AMIGAto enable the platform.Also build tests and examples with cmake.
-Wpointer-signandzero or negative size array '_args'inPrintf().-Wpointer-sign-Wredundant-declserrnoandh_errno.lseek()size warnings.-Wdiscarded-qualifiers.-Wpointer-sign.CURL_SA_FAMILY_Ttype.HAVE_IOCTLSOCKET_CAMEL_FIONBIOfor AmigaOS.ioctlis also detected, but fails when used. Make the above overrideit for a successful build.
Authored-by: Darren Banfi
Fixes Cross Compiling for Amiga OS - Error implicit declaration of function 'ioctl' #15537
Closes Crosscompile for AmigaOS3 - Changes to Configure.ac and Nonblock.c #15603
HAVE_IOCTLSOCKET_CAMEL_FIONBIOfor AmigaOS.Overriding the default 4096.
Suggested-by: Darren Banfi
Ref: Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) #15543 (comment)
Ref: https://wiki.amigaos.net/wiki/Controlling_Application_Stack
SEND_QUAL_ARG2for AmigaOS.RLIMIT_NOFILE.-Wtype-limitsfor AmigaOS.timevalinitialization for AmigaOS.DOStag for MS-DOS builds.AMIGAto buildinfo.txt in auttools.USE_WATT32macro definition to cmake/configure.Non-MS-DOS/AmigeOS-specific tidy-ups:
sa_family_tdetection with cmake.ADDRESS_FAMILYdetection signals with cmake.CURL_SA_FAMILY_T.CURL_SA_FAMILY_Tworkaround.configurations/requirements.
This allows to honor global requirements added earlier.
Necessary for AmigaOS for example.
No IPv6 support on these platforms. Also sync with autotools.
inet_pton()wrapper.HAVE_SOCKADDR_IN6_SIN6_SCOPE_IDguard.Follow-up to a8861b6 #9764
w/o whitespace: https://github.com/curl/curl/pull/15543/files?w=1