From c630cddc43dc69dcbbecb6b6001f459aeaafd5d4 Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Tue, 25 Jan 2005 08:45:46 +0000 Subject: [PATCH] Unbreak on recent FreeBSD versions: - Avoid usage in vafor of - Correctly detect `libtelnet' location --- net/tn3270/Makefile | 18 ++++++++----- net/tn3270/files/patch-commands.c | 44 +++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 net/tn3270/files/patch-commands.c diff --git a/net/tn3270/Makefile b/net/tn3270/Makefile index a89043410bdd..a526768d18c3 100644 --- a/net/tn3270/Makefile +++ b/net/tn3270/Makefile @@ -20,12 +20,12 @@ MAN1= tn3270.1 mset.1 MAN5= map3270.5 MANCOMPRESSED= maybe +OLD_LIBTELNETDIR= /usr/src/contrib/telnet + +.if exists(${OLD_LIBTELNETDIR}) +LIBTELNETDIR?= /usr/src/contrib/telnet/libtelnet +.else LIBTELNETDIR?= /usr/src/lib/libtelnet - -.include - -.if ${OSVERSION} >= 500113 -BROKEN= "Does not compile on FreeBSD ${OSVERSION}" .endif post-extract: @@ -36,6 +36,12 @@ post-extract: exit 1; \ fi ${CP} -rp ${LIBTELNETDIR} ${WRKSRC} +.if exists(${OLD_LIBTELNETDIR}) + ${CP} ${LIBTELNETDIR}/../arpa/telnet.h ${WRKSRC}/libtelnet + ${SED} -E '/^(TELNETDIR|\.PATH|CFLAGS|INCS)/d' \ + ${LIBTELNETDIR}/../../../lib/libtelnet/Makefile > \ + ${WRKSRC}/libtelnet/Makefile +.endif do-configure: ${ECHO_CMD} "BINDIR= ${PREFIX}/bin" > ${WRKDIR}/Makefile.inc @@ -45,4 +51,4 @@ do-build: ${MAKE} depend; \ ${MAKE} all -.include +.include diff --git a/net/tn3270/files/patch-commands.c b/net/tn3270/files/patch-commands.c new file mode 100644 index 000000000000..b65745915aef --- /dev/null +++ b/net/tn3270/files/patch-commands.c @@ -0,0 +1,44 @@ +--- telnet/commands.c.orig Tue Aug 31 01:52:04 1999 ++++ telnet/commands.c Tue Jan 25 14:15:56 2005 +@@ -55,7 +55,7 @@ + #include + #include + #include +-#include ++#include + #include + + #include +@@ -95,7 +95,9 @@ + extern char **genget(); + extern int Ambiguous(); + +-static call(); ++typedef int (*intrtn_t)(); ++ ++static call(intrtn_t routine, ...); + + typedef struct { + char *name; /* command name */ +@@ -2452,19 +2454,14 @@ + * Call routine with argc, argv set from args (terminated by 0). + */ + +- /*VARARGS1*/ + static +-call(va_alist) +- va_dcl ++call(intrtn_t routine, ...) + { + va_list ap; +- typedef int (*intrtn_t)(); +- intrtn_t routine; + char *args[100]; + int argno = 0; + +- va_start(ap); +- routine = (va_arg(ap, intrtn_t)); ++ va_start(ap, routine); + while ((args[argno++] = va_arg(ap, char *)) != 0) { + ; + }