Unbreak on recent FreeBSD versions:

- Avoid <varagrs.h> usage in vafor of <stdarg.h>
- Correctly detect `libtelnet' location
This commit is contained in:
Alexey Dokuchaev 2005-01-25 08:45:46 +00:00
parent 0c439ee34f
commit c630cddc43
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=127286
2 changed files with 56 additions and 6 deletions

View file

@ -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 <bsd.port.pre.mk>
.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 <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -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 <netdb.h>
#include <ctype.h>
#include <pwd.h>
-#include <varargs.h>
+#include <stdarg.h>
#include <errno.h>
#include <arpa/telnet.h>
@@ -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) {
;
}