Update of /cvsroot/dhcp-agent/dhcp-agent
In directory sc8-pr-cvs1:/tmp/cvs-serv14156
Modified Files:
config.h.in
Added Files:
configure.ac
Removed Files:
configure.in
Log Message:
now using configure.ac and not configure.in
--- NEW FILE: configure.ac ---
dnl $Header: /cvsroot/dhcp-agent/dhcp-agent/configure.ac,v 1.1 2002/12/19 18:00:26 actmodern Exp $
dnl
dnl Second try at writing a more coherent configure script.
dnl We've layed it out per the gnu autoconf manual
dnl Please look at:
dnl http://www.gnu.org/manual/autoconf/html_node/configure.ac-Layout.html#configure.ac%20Layout
dnl before making any changes.
dnl
dnl -- tm...@wh...
dnl
dnl init
dnl
AC_PREREQ(2.53)
AC_INIT(dhcp-agent, 0.38, tm...@wh...)
AM_INIT_AUTOMAKE(dhcp-agent, 0.38)
AC_CONFIG_SRCDIR(src/dhcp-client.c)
dnl
dnl additional arguments to autoconf
dnl
AC_ARG_WITH(libdnet-prefix,[ --with-libdnet-prefix=PREFIX Prefix where libdnet is installed (optional)],
dnet_prefix="$withval", dnet_prefix="")
AC_ARG_WITH(libpcap-prefix,[ --with-libpcap-prefix=PREFIX Prefix where libpcap is installed (optional)],
pcap_prefix="$withval", pcap_prefix="")
AC_ARG_WITH(libpcap-prefix,[ --client-work-dir=WORK_DIR Default dhcpclient work dir (optional)],
client_work_dir="$withval", client_work_dir="/etc/dhcp-client")
dnl check for CC, INSTALL, and sane make
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
dnl check header files we should have
AC_HEADER_STDC
AC_CHECK_HEADERS(inttypes.h signal.h varargs.h stdarg.h sys/utsname.h getopt.h)
dnl
dnl check for types
dnl
AC_CHECK_TYPE(sig_atomic_t, [AC_DEFINE(HAVE_SIG_ATOMIC_T, 1, [have sigatomic_t])], [], [#include <signal.h>])
AC_CHECK_TYPE(struct bpf_timeval, [AC_DEFINE(HAVE_BPF_TIMEVAL, 1, [have struct bpf_timeval])], [],
[#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <net/bpf.h> ])
dnl try finding or generating our own C99 stdint macros
AC_WF_TRY_PRI_MACROS
if test -z "$have_primacros"; then
echo -n "attempting to generate stdint conversion macros..."
AC_WF_GET_PRI_MACROS
AC_DEFINE(HAVE_PRIMACROS_H, 1, [ generated our own primacros ])
echo " done!"
fi
AC_TYPE_SIGNAL
dnl check for functions
AC_CHECK_FUNCS(strdup uname calloc daemon rename sysconf getrusage getprogname)
dnl other checks
dnl check if kill(pid, 0) can be used to detect a process
AC_WF_CHECK_KILL_SIGNAL_DETECT
dnl check for BPF_IMMEDIATE flag
AC_WF_CHECK_BPF_IMMEDIATE
dnl check for __progname
AC_MSG_CHECKING(for __progname)
AC_TRY_LINK([
#include <stdlib.h>
#include <stdio.h>
extern const char *__progname;
],
[ __progname = 0; ],
[ have_progname="yes" ],
[ have_progname="no" ])
if test $have_progname = "yes"; then
AC_DEFINE(HAVE_PROGNAME, 1, [have __progname var ])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
dnl pcap sifting
if test -z "$pcap_prefix"; then
dnl excessive pcap sifting
AC_WF_CHECK_PCAP_LIB_DIR
PCAP_LIB="-L$ac_pcap_lib_dir -lpcap"
AC_WF_CHECK_PCAP_HEADER_DIR
PCAP_INC="-I$ac_pcap_header_dir"
else
dnl if we've been passed the correct options just force a set.
PCAP_INC="-I$pcap_prefix/include"
PCAP_LIB="-L$pcap_prefix/lib -lpcap"
fi
dnl
dnl libdnet sifting; actually it's a lot more well behaved
dnl than pcap.
dnl begin by looking for dnet-config if we find it, then
dnl just use it to get the include and lib dirs.
dnl
if test -z "$dnet_prefix"; then
AC_PATH_PROGS(DNET_PATH, dnet-config, [ "no" ])
if test $DNET_PATH = "no"; then
dnl try linking by default path
AC_CHECK_LIB(dnet, eth_open, DNET_LIB="-ldnet",
AC_MSG_ERROR(`libdnet not found http://libdnet.sourceforge.net/ to get a copy', 1))
DNET_INC=""
else
DNET_LIB="`dnet-config --libs`"
DNET_INC="`dnet-config --cflags`"
fi
else
DNET_LIB="-L$dnet_prefix/lib -ldnet"
DNET_INC="-I$dnet_prefix/include"
fi
AC_SUBST(PCAP_LIB)
AC_SUBST(PCAP_INC)
AC_SUBST(DNET_LIB)
AC_SUBST(DNET_INC)
AC_DEFINE_UNQUOTED(CLIENT_WORK_DIR, "$client_work_dir", [ default client work directory])
dnl kill defs
DEFS=""
AC_SUBST(DEFS)
AM_CONFIG_HEADER(config.h)
AC_OUTPUT([Makefile src/Makefile man/Makefile])
echo
echo "DHCP Agent build configuration successful!"
echo
Index: config.h.in
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/config.h.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** config.h.in 30 Oct 2002 05:00:46 -0000 1.2
--- config.h.in 19 Dec 2002 18:00:25 -0000 1.3
***************
*** 1,3 ****
! /* config.h.in. Generated from configure.in by autoheader. */
/* default client work directory */
--- 1,3 ----
! /* config.h.in. Generated from configure.ac by autoheader. */
/* default client work directory */
--- configure.in DELETED ---
|