Curl is a tool for internet communication and supports many protocols. Most important is probably HTTPS so a web server can be connected. If you read this article (what you obviously do) you know what you want to do with it. This article explains how to cross compile it for AmigaOS 3.
Besides downloading curl from Aminet you may want to compile the most current version and this article explains how to do that. We will cross compile it using Linux or macOS including AmiSSL so you can use HTTPS.
First we have to prepare our cross compiler. Here we use GCC 6 that you can download on GitHub from user bebbo. He explains how to compile it for Windows, Linux and macOS and also provides binaries so I assume you have successfully installed it. When you compile it from source you also have all tools installed that we will need here. I assume here that it is installed in its default path
We also need zlib. Like before, copy
Now we clone my fork of curl. You can also clone the most recent version of curl but there is no guarantee that this will still work in future.
git clone https://github.com/curl/curl.git
Now change to your checkout.
If one day the compilation fails you can go back to a version where I can say that it will work:
git checkout 0d16a49c16a868524a3e51d390b5ea106ce9b51c
Create files for configuration and configure it.
./buildconf && PKG_CONFIG=true ./configure --host=m68k-amigaos --disable-shared --disable-ipv6 --disable-ntlm-wb --prefix=/opt/amiga --disable-netrc --with-amissl --disable-threaded-resolver CFLAGS="-mcrt=clib2" LIBS="-lnet -lm -lc -lunix -mcrt=clib2"
<path> is the path where you extracted AmiSSL. We set
PKG_CONFIG to just true which is a shell command that never fails. Otherwise configure would search for the pkg-config command, cannot find a version for cross compiling and just uses the one from your OS which gives wrong results for cross compiling.
We also have to disable some stuff that cannot be compiled for Amiga and specify that we want to compile with clib2. You can find more information about clib2 in the GitHub repo.
Now compile it.
That wasn’t hard, right? If you have issues you may want to write a comment here.
If you want to develop your own software using libcurl you can find the
libcurl.a in your curl checkout folder
There is also a precompiled version including a simple example for compiling a https client in curl-7.40.0.lha on Aminet. If you want to see more examples, in your checkout from above you can find the folder
docs/examples. Enter that directory (
cd) and just type
make. All examples should build without errors but not all will run as we disabled some features of curl.