Make building on OSX work out of the box (#18)

Conditionally declare strlcat() and strlcpy() in proxytunnel.h
Conditionally include strlcat.o and strlcpy.o in Makefile
This commit is contained in:
Chris Veenboer 2016-11-08 14:52:19 +01:00 committed by Dag Wieers
parent ee962a3e90
commit 0cfce96280
2 changed files with 12 additions and 2 deletions

View file

@ -63,8 +63,6 @@ mandir = $(datadir)/man
# Remove strlcpy/strlcat on (open)bsd/darwin systems
OBJ = proxytunnel.o \
base64.o \
strlcpy.o \
strlcat.o \
strzcat.o \
setproctitle.o \
io.o \
@ -76,6 +74,12 @@ OBJ = proxytunnel.o \
ntlm.o \
ptstream.o
UNAME = $(shell uname)
ifneq ($(UNAME),Darwin)
OBJ += strlcpy.o \
strlcat.o
endif
.PHONY: all clean docs install
all: proxytunnel

View file

@ -32,8 +32,14 @@ void closeall();
void do_daemon();
void initsetproctitle(int argc, char *argv[]);
void setproctitle(const char *fmt, ...);
#if defined(__APPLE__) && defined(__MACH__)
/* Don't include strlcat and strlcpy since they are provided as macros on OSX */
#else
size_t strlcat(char *dst, const char *src, size_t siz);
size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
size_t strzcat(char *dst, char *format, ...);
int main( int argc, char *argv[] );
char * readpassphrase(const char *, char *, size_t, int);