emikulic / darkhttpd

When you need a web server in a hurry.
https://unix4lyfe.org/darkhttpd/
ISC License
1.03k stars 83 forks source link

Update illumos support to the modern era #24

Closed faithanalog closed 1 year ago

faithanalog commented 2 years ago

This PR introduces 2 commits. The primary is 95d785acc1e4bc5f1b9ff8bda17ffb51b6f7a5f6.

Old versions of Solaris did not have vasprintf, so darkhttpd defined one
gated behind an ifdef. Oracle Solaris 10 has had vasprintf since 2011.
Oracle Solaris 11 has had it since release. illumos (which also reports
as `__sun`) also has it in all current incarnations. As a result, this
ifdef'd block creates compiler errors due to a second definition of the
function. This commit removes the block.

This commit also adds `-lsendfile` to the Makefile for systems that
report as `SunOS` in `uname` (Solaris and Illumos), which is necessary
to link successfully in current day

This should bring darkhttpd up to date with the current state of illumos and solaris and allow it to build on those systems.

In the second commit I added a note to the README that CC=<compiler> make may be necessary if cc isn't a command on the system. For whatever reason, some variants of illumos I'm using don't have this. I need to look into that more, but in the mean time, I think it's a helpful tip.

emikulic commented 1 year ago

Thanks!