Here is the result. This is a script which will download, compile and install libssh2, along with mbedTLS. The latter is a cryptographic library.
There are three mandatory environment variables you must set before running the script.
ABUCC=/home/dodo/PRG/ANDROID.12/bin/arm-linux-androideabi-gcc \ ABUAR=/home/dodo/PRG/ANDROID.12/bin/arm-linux-androideabi-ar \ ABUDEST=/home/dodo/PRG/ANDROID.12/sysroot/usr \ ./android-ssh.shYou can also set the variable ABUCFLAGS. This is optional and is provided so that you can set additional compiler flags, it doesn't replace the flags in the script.
The resulting library file libandroidssh.a can be used to link ssh2 applications. You will also need libz.a.
The license file is generated to $ABUDEST/LICENSE-androidssh.txt. This contains the licenses for the two components. You should probably display them to your users when they ask about such things.
You will need bash, md5sum, wget and gawk in order to run this script. It will create a directory called android-ssh-build in the working directory. This can be removed after you're done. I just leave it there for troubleshooting or playing around with examples.