⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configure.ac

📁 this is sample about DHCP-agent
💻 AC
字号:
dnl $Header: /cvsroot/dhcp-agent/dhcp-agent/configure.ac,v 1.15 2003/07/15 11:01:27 actmodern Exp $dnldnl Second try at writing a more coherent configure script.dnl We've layed it out per the gnu autoconf manualdnl Please look at:dnl http://www.gnu.org/manual/autoconf/html_node/configure.ac-Layout.html#configure.ac%20Layoutdnl before making any changes.dnl dnl -- tmh@whitefang.comdnldnl initdnlAC_PREREQ(2.57)AC_INIT([dhcp-agent],[0.41],[tmh@whitefang.com])AM_INIT_AUTOMAKE([dhcp-agent], [0.41])AC_CONFIG_SRCDIR([src/dhcp-client.c])dnldnl command line optionsdnldnl fail-on-warning option for strict compilationFAIL_ON_WARNING="no"AC_ARG_ENABLE(fail-on-warning,              AC_HELP_STRING([--enable-fail-on-warning],                             [fail on compiler warning (default is NO)]),  [case "${enableval}" in     yes | y) FAIL_ON_WARNING="yes" ;;     no | n)  FAIL_ON_WARNING="no" ;;     *) AC_MSG_ERROR(bad value ${enableval} for --enable-fail-on-warning) ;;   esac])dnl allow user to pick HTML documentationAC_ARG_ENABLE(htmldoc,              AC_HELP_STRING([--enable-htmldoc],                             [generate html documentation (default is NO)]),[case "${enableval}" in  yes) htmldoc=true ;;  no)  htmldoc=false ;;  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-htmldoc) ;;  esac],[htmldoc=false])AM_CONDITIONAL(HTMLDOC, test x$htmldoc = xtrue)dnl allow user to pick where dhcp-agent does its workdnl check for CC, INSTALL, and sane makeAC_PROG_CCAC_PROG_INSTALLAC_PROG_MAKE_SETAC_PROG_LIBTOOLdnl check header files we should haveAC_HEADER_STDCAC_CHECK_HEADERS(inttypes.h signal.h varargs.h stdarg.h sys/utsname.h getopt.h)dnldnl check for typesdnlAC_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 macrosAC_WF_TRY_PRI_MACROSif test  "x$have_primacros" = "x"; thendnl this ought to work -- i think :-)        echo > stdint_marcos.h        echo "#define PRIi8   \"i\""  >> stdint_marcos.h        echo "#define PRIi16  \"i\""  >> stdint_marcos.h        echo "#define PRIi32  \"i\""  >> stdint_marcos.h        echo "#define PRIu8   \"u\"" >> stdint_marcos.h        echo "#define PRIu16  \"u\"" >> stdint_marcos.h        echo "#define PRIu32  \"u\"" >> stdint_marcos.h        echo "#define SCNi8   \"hhi\"" >> stdint_marcos.h        echo "#define SCNi16  \"hi\""  >> stdint_marcos.h        echo "#define SCNi32  \"i\""   >> stdint_marcos.h        echo "#define SCNu8   \"hhu\"" >> stdint_marcos.h        echo "#define SCNu16  \"hu\""  >> stdint_marcos.h        echo "#define SCNu32  \"u\""   >> stdint_marcos.h   AC_DEFINE(HAVE_STDINT_MARCOS_H, 1, [ generated our own primacros ])   echo " done!"fiAC_TYPE_SIGNALdnl check for functionsAC_CHECK_FUNCS(strdup uname calloc daemon rename sysconf getrusage getprogname)dnl other checksdnl check if kill(pid, 0) can be used to detect a processAC_WF_CHECK_KILL_SIGNAL_DETECTdnl check for BPF_IMMEDIATE flagAC_WF_CHECK_BPF_IMMEDIATEdnl check for __prognameAC_MSG_CHECKING(for __progname)AC_LINK_IFELSE([AC_LANG_PROGRAM([[#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)fidnl pcap siftingif test -z "$pcap_prefix"; thendnl excessive pcap siftingAC_WF_CHECK_PCAP_LIB_DIRPCAP_LIB="-L$ac_pcap_lib_dir -lpcap"AC_WF_CHECK_PCAP_HEADER_DIRPCAP_INC="-I$ac_pcap_header_dir"elsednl 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"fidnl check for pcap_freecodeAC_MSG_CHECKING([pcap_freecode in pcap])LIBS=$PCAP_LIBAC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ pcap_freecode(); ]])],[ have_pcap_freecode="yes" ],[ have_pcap_freecode="no" ])LIBS=if test x$have_pcap_freecode = "xyes"; then   AC_MSG_RESULT([found])   AC_DEFINE(HAVE_PCAP_FREECODE, 1, [have pcap_freecode()])else   AC_MSG_RESULT([not found])   AC_MSG_WARN([you don't seem to have an up to date libpcap installed. i could not find pcap_freecode() because of this you may encounter a small memory leak. please considering updating to the latest pcap distribution from http://www.tcpdump.org/])fiAC_MSG_CHECKING(BIOCIMMEDIATE)AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>                 #include <stdlib.h>                 #include <pcap.h>]], [[    ioctl(0, BIOCIMMEDIATE, NULL);]])],[AC_MSG_RESULT(found)AC_DEFINE(HAVE_BPF_IMMEDIATE, 1, [have BPF_IMMEDIATE])],[AC_MSG_RESULT(not found)])dnldnl libdnet sifting; actually it's a lot more well behaveddnl than pcap. dnl begin by looking for dnet-config if we find it, thendnl just use it to get the include and lib dirs.dnlAC_PATH_PROGS(DNET_PATH, [dnet-config], [no])if test $DNET_PATH = "no"; then  AC_MSG_ERROR([libdnet not found. get a copy from http://libdnet.sourceforge.net])else   DNET_LIB="`dnet-config --libs`"   DNET_INC="`dnet-config --cflags`"   fiAC_PATH_PROGS(GUILE_PATH, [guile-config], [no])  if test $GUILE_PATH = "no"; then  AC_MSG_ERROR([could not find guile on this system. get a copy from http://www.gnu.org/software/guile])  else  GUILE_LIB="`guile-config link`"  GUILE_INC="`guile-config compile`"fiif test x$htmldoc = "xtrue"; then   AC_PATH_PROGS(TEXI2HTML_PATH, [texi2html], [no])   if test $TEXI2HTML_PATH = "no"; then      AC_MSG_ERROR([you selected --enable-htmldoc and no texi2html has been found. please install texi2html first.])   fi;fidnldnl setup paths so they can be passed to the Makefile.indnldhcpsysconfdir="${sysconfdir}/${PACKAGE_NAME}"dhcplocalstatedir="${localstatedir}/${PACKAGE_NAME}"dhcpsysconf_clientdir="${dhcpsysconfdir}/dhcp-client"dhcplocalstate_clientdir="${dhcplocalstatedir}/dhcp-client"dhcpsysconf_serverdir="${dhcpsysconfdir}/dhcp-server"dhcplocalstate_serverdir="${dhcplocalstatedir}/dhcp-server"dhcpdocdir="/doc/dhcp-agent"AC_SUBST(PCAP_LIB)AC_SUBST(PCAP_INC)AC_SUBST(DNET_LIB)AC_SUBST(DNET_INC)AC_SUBST(GUILE_LIB)AC_SUBST(GUILE_INC)AC_SUBST(dhcpsysconfdir)AC_SUBST(dhcpsysconf_clientdir)AC_SUBST(dhcpsysconf_serverdir)AC_SUBST(dhcplocalstatedir)AC_SUBST(dhcplocalstate_clientdir)AC_SUBST(dhcplocalstate_serverdir)AC_SUBST(infodir)AC_SUBST(dhcpdocdir)if test x"${FAIL_ON_WARNING}" = "xyes"; then   CFLAGS="${CFLAGS} -Werror"fiAC_CONFIG_HEADERS([config.h])AC_CONFIG_FILES([Makefile src/Makefile man/Makefile tests/Makefile conf/Makefile conf/dhcp-client/Makefile conf/dhcp-server/Makefile doc/Makefile contrib/Makefile])AC_OUTPUTechoecho "DHCP Agent build configuration successful!"echo

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -