mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
47920915c7
* Update Solaris / Illumos support 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. * Comment on manually specifying CC in readme Some systems, including versions of illumos I use, do not have a `cc` alias to the system C compiler. Arguably this is a flaw in the distribution, but as a user, it's perhaps helpful to be reminded that this is an option.
17 lines
373 B
Makefile
17 lines
373 B
Makefile
CC?=cc
|
|
CFLAGS?=-O
|
|
LIBS=`[ \`uname\` = "SunOS" ] && echo -lsocket -lnsl -lsendfile`
|
|
|
|
all: darkhttpd
|
|
|
|
darkhttpd: darkhttpd.c
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) darkhttpd.c -o $@
|
|
|
|
darkhttpd-static: darkhttpd.c
|
|
$(CC) -static $(CFLAGS) $(LDFLAGS) $(LIBS) darkhttpd.c -o $@
|
|
|
|
clean:
|
|
rm -f darkhttpd core darkhttpd.core darkhttpd-static darkhttpd-static.core
|
|
|
|
.PHONY: all clean
|