$NetBSD: patch-aa,v 1.5 2009/06/04 21:49:18 minskim Exp $ --- Makefile.orig 2009-04-21 13:10:22.000000000 -0700 +++ Makefile @@ -79,7 +79,18 @@ LDFLAGS+= -L/usr/local/lib .ifdef PROFILE LDFLAGS+= -pg .endif -LIBS+= -lutil -lncurses +.if ${OS} == "SunOS" +LIBS+= -lsocket -lnsl +.else +LIBS+= -lutil +.endif +LIBS+= -lncurses + +# Darwin +.if ${OS} == "Darwin" +SRCS+= compat/strtonum.c compat/vis.c +CFLAGS+= -DNO_SETPROCTITLE -DNO_STRTONUM -DNO_QUEUE_H -DNO_TREE_H +.endif # FreeBSD and DragonFly .if ${OS} == "FreeBSD" || ${OS} == "DragonFly" @@ -91,10 +102,21 @@ LIBS+= -lcrypt # NetBSD .if ${OS} == "NetBSD" -INCDIRS= -Icompat +INCDIRS+= -Icompat SRCS+= compat/strtonum.c compat/vis.c LIBS+= -lcrypt -CFLAGS+=-DNO_STRTONUM +CFLAGS+=-DNO_STRTONUM -DNO_QUEUE_H -DNO_TREE_H +.endif + +# SunOS +.if ${OS} == "SunOS" +INCDIRS+= -Icompat +SRCS+= compat/asprintf.c compat/daemon.c compat/fgetln.c \ + compat/forkpty-sunos.c compat/getopt_long.c compat/strtonum.c \ + compat/vis.c +CFLAGS+= -DNO_ASPRINTF -DNO_CDEFS_H -DNO_DAEMON -DNO_FGETLN -DNO_FORKPTY \ + -DNO_PATHS_H -DNO_PROGNAME -DNO_QUEUE_H -DNO_SETPROCTITLE \ + -DNO_STRTONUM -DNO_TREE_H .endif OBJS= ${SRCS:S/.c/.o/:S/.y/.o/} @@ -152,7 +174,7 @@ update-index.html: sed "s/%%VERSION%%/${VERSION}/g" index.html.in >index.html install: all - ${INSTALLDIR} ${DESTDIR}${PREFIX}/bin - ${INSTALLBIN} ${PROG} ${DESTDIR}${PREFIX}/bin/ - ${INSTALLDIR} ${DESTDIR}${PREFIX}/man/man1 - ${INSTALLMAN} ${PROG}.1 ${DESTDIR}${PREFIX}/man/man1/ + ${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/bin + ${BSD_INSTALL_PROGRAM} ${PROG} ${DESTDIR}${PREFIX}/bin/ + ${BSD_INSTALL_MAN_DIR} ${DESTDIR}${PREFIX}/man/man1 + ${BSD_INSTALL_MAN} ${PROG}.1 ${DESTDIR}${PREFIX}/man/man1/