Since this thread shows up at the top of a google search for the obvious thing one might search for trying to build the examples from Stevens, even though the question is almost a decade old here's the new, 10.5 leopard answer:
1. download, ungzip, and untar unpv12e.tar.gz from the net.
2. cd to the unpv12e directory
3. cp /usr/share/automake-1.10/config.* .
(note that the automake version may change)
4. ./configure
5. cd lib
6. Edit the file lib/mcast_join.c replacing
IPV6_ADD_MEMBERSHIP with IPV6_JOIN_GROUP
7. Edit the file lib/mcast_leave.c replacing
IPV6_DROP_MEMBERSHIP with IPV6_LEAVE_GROUP
8. Still in the lib directory:
make
[and just to help google a little more, these are the instructions howto for building
the example programs supplied with Richard Stevens, Unix Network Programming
on Apple Macintosh Mac OS X 10.5 leopard tiger panther]