# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_MSG_RESULT() AC_MSG_RESULT(configuring utunnel) AC_MSG_RESULT() AC_PREREQ(2.5) AC_INIT(utunnel.c) AM_INIT_AUTOMAKE(utunnel, 0.4) AC_CONFIG_SRCDIR([utunnel.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC LIBS="${LIBS} -L/usr/local/lib" CPPFLAGS="${CPPFLAGS} -I/usr/local/include" AC_CANONICAL_HOST case "$host" in *-apple*) AC_DEFINE([MACOS], 1, [Mac OS X]) LIBS="${LIBS} -L/opt/local/lib -L/sw/lib -lpthread" CPPFLAGS="${CPPFLAGS} -I/opt/local/include -I/sw/include" ;; *-freebsd*) AC_DEFINE([FREEBSD], 1, [FreeBSD]) LIBS="${LIBS} -pthread" ;; # *-openbsd*) # AC_DEFINE([OPENBSD]) # ;; # *-netbsd*) # AC_DEFINE([NETBSD]) # ;; *-linux*) AC_DEFINE([LINUX], 1, [Linux]) ;; *) AC_MSG_WARN(Your OS is not officially supported yet) ;; esac # Checks for libraries. AC_CHECK_LIB([net], [libnet_init], [], [ echo "Error! You must have libnet." exit 1 ]) AC_CHECK_LIB([pcap], [pcap_open_live], [], [ echo "Error! You must have libpcap." exit 1 ]) # Checks for header files. AC_CHECK_HEADERS([netinet/in.h sys/socket.h unistd.h libnet.h pcap.h], [], [AC_MSG_ERROR([Error! Missing header files.])]) # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. AC_FUNC_FORK AC_HEADER_STDC AC_CHECK_FUNCS([memset strdup]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT