-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) #15543
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=OFF
build 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=OFF based 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
Fixes detection for AmigaOS, where `gethostname` is a macro.
It is mapped to OpenSSL and some CA fallback enabled to do what autotools does.
propagate `USE_AMISSL` via `curl_config.h` like autotools
Except LibreSSL.
``` In file included from /home/runner/work/curl/curl/bld/tests/libtest/libtest_bundle.c:27663:0, from /home/runner/work/curl/curl/bld/tests/libtest/CMakeFiles/libtests.dir/Unity/unity_0_c.c:4: /home/runner/work/curl/curl/tests/libtest/lib1960.c: In function 'test_lib1960': /home/runner/work/curl/curl/tests/libtest/lib1960.c:104:6: error: pointer targets in initialization differ in signedness [-Wpointer-sign] if(inet_pton(AF_INET, libtest_arg2, &serv_addr.sin_addr) <= 0) { ^~~~~~~~~ ``` https://github.com/curl/curl/actions/runs/11913123282/job/33198164993#step:8:96
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
Makefile.mk
supported MS-DOS and Amiga, but./configure
alsosupported 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-tierbuild methods.
Also include some non-MS-DOS/AmigaOS-specific tidy-up, see details at
the end of this message.
Details:
ENABLE_THREADED_RESOLVER=OFF
for MS-DOS.WATT_ROOT
.USE_UNIX_SOCKETS
.--disable-threaded-resolver
for MS-DOS.close_s()
(from Watt-32) with autotools and cmake.Makefile.mk
used it before this patch.Also build tests and examples with cmake.
CloseSocket()
when it's a macro.IoctlSocket
detection on AmigaOS.HAVE_IOCTLSOCKET_CAMEL
andHAVE_IOCTLSOCKET_CAMEL_FIONBIO
detections.and they did not compile with AmigaOS.
gethostname
detection with autotools.Fixes detection for AmigaOS, where
gethostname
is a macro.sys/utime.h
detection on AmigaOS.getaddrinfo
for AmigaOS.AMIGA
to enable the platform.Also build tests and examples with cmake.
-Wpointer-sign
andzero or negative size array '_args'
inPrintf()
.-Wpointer-sign
-Wredundant-decls
errno
andh_errno
.lseek()
size warnings.-Wdiscarded-qualifiers
.-Wpointer-sign
.CURL_SA_FAMILY_T
type.HAVE_IOCTLSOCKET_CAMEL_FIONBIO
for AmigaOS.ioctl
is 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_FIONBIO
for 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_ARG2
for AmigaOS.RLIMIT_NOFILE
.-Wtype-limits
for AmigaOS.timeval
initialization for AmigaOS.DOS
tag for MS-DOS builds.AMIGA
to buildinfo.txt in auttools.USE_WATT32
macro definition to cmake/configure.Non-MS-DOS/AmigeOS-specific tidy-ups:
sa_family_t
detection with cmake.ADDRESS_FAMILY
detection signals with cmake.CURL_SA_FAMILY_T
.CURL_SA_FAMILY_T
workaround.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_ID
guard.Follow-up to a8861b6 #9764
w/o whitespace: https://github.com/curl/curl/pull/15543/files?w=1