#
CFLAGS+= -I${.CURDIR}
+CFLAGS+= -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME
DPADD= ${LIBSSL} ${LIBCRYPTO}
LDADD= -lssl -lcrypto
#
-# If you want to compile dma for Linux, you probably have to do:
-# make -f Makefile.plain CPPFLAGS="-DNEED_REALLOCF -DNEED_STRLCPY \
-# -DNEED_GETPROGNAME"
+# Depending on your operating system, you might want to influence
+# the conditional inclusion of some helper functions:
+#
+# Define HAVE_* (in caps) if your system already provides:
+# reallocf
+# strlcpy
+# getprogname
#
CC?= gcc
-#ifdef NEED_STRLCPY
+#ifndef HAVE_STRLCPY
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
return(s - src - 1); /* count does not include NUL */
}
-#endif /* NEED_STRLCPY */
+#endif /* !HAVE_STRLCPY */
-#ifdef NEED_REALLOCF
+#ifndef HAVE_REALLOCF
/*-
* Copyright (c) 1998, M. Warner Losh <imp@freebsd.org>
return (nptr);
}
-#endif /* NEED_REALLOCF */
+#endif /* !HAVE_REALLOCF */
-#ifdef NEED_GETPROGNAME
+#ifndef HAVE_GETPROGNAME
#ifdef __GLIBC__
#error "no getprogname implementation available"
#endif
-#endif /* NEED_GETPROGNAME */
+#endif /* !HAVE_GETPROGNAME */
#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
#endif
-#ifdef NEED_STRLCPY
+#ifndef HAVE_STRLCPY
size_t strlcpy(char *, const char *, size_t);
#endif
-#ifdef NEED_REALLOCF
+#ifndef HAVE_REALLOCF
void *reallocf(void *, size_t);
#endif
-#ifdef NEED_GETPROGNAME
+#ifndef HAVE_GETPROGNAME
const char *getprogname(void);
#endif