-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 07 Sep 2003 21:07 pm, wrote: > The HAVE_LIBNET define is not put in the config.h by configure. I define it > in the top of the file for testing purposes, because I do not know how to > change > configure.ac and related files. I also added -lnet to LIBS directly in the > makefile > for the same reason. I apologize for that, perhaps with some suggestions I > can > learn how to do it. Here's one I prepared earlier. The key thing to know about libnet is that it has fundamentally incompatible API changes between 1.0.x and 1.1.x. This version makes sure we don't have version 1.1, although making it check for another version should be obvious:
AC_CHECK_PROG([libnetconf], [libnet-config], yes) if test "$libnetconf" != yes; then AC_MSG_ERROR([*** libnet-config not found ***]) fi AC_MSG_CHECKING(for libnet.h version 1.0.x) libnet_dir="/usr/include /usr/local/include /usr/local/contrib/include" for i in $libnet_dir; do if test -r $i/libnet.h; then LIBNET_INC_DIR=$i fi done if test "$LIBNET_INC_DIR" != ""; then if eval "grep LIBNET_VERSION $LIBNET_INC_DIR/libnet.h | grep -v 1.0 >/dev/null"; then FAIL_MESSAGE("libnet 1.0.x (libnet.h)", $tmp) fi CPPFLAGS="${CPPFLAGS} -I${LIBNET_INC_DIR} `libnet-config --defines`" CFLAGS="${CFLAGS} `libnet-config --cflags`" LIBS="${LIBS} `libnet-config --libs`" AC_MSG_RESULT(${LIBNET_INC_DIR}) else AC_MSG_RESULT(no) fi -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE/WxNMW6pHgIdAuOMRAp0tAKCalRyQLGnDgUDc2yOGWfhG1ztdNQCgme3p bc5zaSaIUaC0IAMkDQEusnA= =vhIX -----END PGP SIGNATURE-----