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

📄 configure.in

📁 模仿cisco路由器
💻 IN
字号:
dnl Disable config.cachedefine([AC_CACHE_LOAD], )define([AC_CACHE_SAVE], )AC_INITAC_CANONICAL_SYSTEMAM_INIT_AUTOMAKE(fprobe,1.0.2)AM_CONFIG_HEADER(config.h)AC_PROG_CCAC_PROG_INSTALLAC_CHECK_LIB(pthread, pthread_create, ,	AC_CHECK_LIB(c_r, pthread_create), ,	[AC_ERROR(POSIX threads not found)])AC_SEARCH_LIBS(socket, socket)AC_SEARCH_LIBS(gethostbyname, nsl)AC_SEARCH_LIBS(sched_setscheduler, rt)dnl ************************************************dnl OS typeif test "${target}" = "${host}"; then	case "${host}" in		*-*-*linux*)			AC_DEFINE_UNQUOTED(OS_LINUX, , OS type)			dnl AC_DEFINE_UNQUOTED(_BSD_SOURCE, , Linuxs headers (ip.h) BSD-compatibility (with FreeBSD and Solaris))			CFLAGS="$CFLAGS -D_BSD_SOURCE"			;;		*-*-solaris*)			AC_DEFINE_UNQUOTED(OS_SOLARIS, , OS type)			dnl AC_DEFINE_UNQUOTED(_POSIX_PTHREAD_SEMANTICS, , Solaris compatibility with POSIX threads)			CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"			;;		*-*-freebsd*)			AC_DEFINE_UNQUOTED(OS_FREEBSD, , OS type)			dnl CFLAGS="$CFLAGS -pthread"			;;	esacfidnl ************************************************dnl pcap.h locationAC_ARG_WITH(pcap,	[  --with-pcap=<path>      pcap.h location],	pcap="$withval")AC_CHECK_HEADER(pcap.h, , [	AC_MSG_CHECKING(for pcap.h in alternative location)	found=""	pcap_dirs="$pcap /usr/include/pcap"	for pcap in $pcap_dirs; do		if test -r $pcap/pcap.h; then			CFLAGS="$CFLAGS -I$pcap"			found="$pcap"			break		fi	done	AC_MSG_RESULT($found)	if test -z "$found"; then		AC_ERROR(pcap.h not found)	fi	])dnl ************************************************dnl libpcap locationAC_ARG_WITH(libpcap,	[  --with-libpcap=<path>   libpcap location],	libpcap="$withval")if test "$libpcap" = "yes"; then	libpcap=""fiif test "$libpcap"; then	LDFLAGS="$LDFLAGS -L$libpcap"fiAC_CHECK_LIB(pcap, pcap_loop, , AC_ERROR(libpcap not found), $LDFLAGS)dnl ************************************************dnl Memory bulk indexing modeAC_MSG_CHECKING(which memory bulk indexing mode to use)AC_ARG_WITH(membulk,	[  --with-membulk=<mode>   indexing mode: index8|index16|ptr [default=ptr]],	mem="$withval", mem="ptr")case "$mem" in	ptr)		mem_bits="0"		;;	index8)		mem_bits="8"		;;	index16)		mem_bits="16"		;;	*)		AC_ERROR(Invalid argument: "$mem")		;;esacAC_MSG_RESULT("$mem")AC_DEFINE_UNQUOTED(MEM_BITS, $mem_bits, Memory bulk indexing mode)dnl ************************************************dnl Hash typeAC_MSG_CHECKING(which hash type and size to use)AC_ARG_WITH(hash, 	[  --with-hash=<type>      hash type: xor8|xor16|crc16 [default=xor16]],	hash="$withval", hash="xor16")hash_type=`echo "$hash"|cut -b -3`hash_bits=`echo "$hash"|cut -b 4-`if test "$hash_type" = "xor"; then	AC_DEFINE_UNQUOTED(HASH_TYPE_XOR, , Hash type)	if test "$hash_bits" != "8" -a "$hash_bits" != "16"; then		AC_ERROR(Invalid argument: "$withval")	fielse	if test "$hash" != "crc16"; then		AC_ERROR(Invalid argument: "$hash")	fi	AC_DEFINE_UNQUOTED(HASH_TYPE_CRC, , Hash type)fiAC_DEFINE_UNQUOTED(HASH_BITS, $hash_bits , Hash size)AC_MSG_RESULT("$hash")dnl ************************************************dnl Uptime trickAC_MSG_CHECKING(whether to enable uptime trick)AC_ARG_ENABLE(uptime_trick,	[  --enable-uptime_trick   enable uptime trick [default=yes]],	uptime_trick="$enableval", uptime_trick="yes")case "$uptime_trick" in	yes)		AC_MSG_RESULT(yes)		AC_DEFINE_UNQUOTED(UPTIME_TRICK, , Uptime trick)		;;	*)		AC_MSG_RESULT(no)		;;esacdnl ************************************************dnl ICMP trickAC_MSG_CHECKING(whether to enable icmp trick)AC_ARG_ENABLE(icmp_trick, 	[  --enable-icmp_trick     enable icmp trick [default=yes]],	icmp_trick="$enableval", icmp_trick="yes")case "$icmp_trick" in	yes)		AC_MSG_RESULT(yes)		AC_DEFINE_UNQUOTED(ICMP_TRICK, , ICMP trick)		;;	*)		AC_MSG_RESULT(no)		;;esacdnl ************************************************dnl Debugging outputAC_MSG_CHECKING(whether to enable debugging)AC_ARG_ENABLE(debug,	[  --enable-debug          enable debugging [default=no]],	debug="$enableval", debug="no")case "$debug" in	no)		AC_MSG_RESULT(no)		debug_val="0"		;;	yes)		AC_MSG_RESULT(all)		debug_val="-1"		;;	*)		AC_MSG_RESULT(custom: $debug)		debug_val="0"		debug=`echo $debug|tr , " "`		for i in $debug; do			debug_val="$debug_val | DEBUG_$i"		done		;;esacAC_DEFINE_UNQUOTED(DEBUG, ($debug_val) , Debugging output)dnl ************************************************dnl Runtime messagesAC_MSG_CHECKING(whether to enable runtime messages)AC_ARG_ENABLE(messages,	[  --enable-messages       enable runtime messages [default=no]],	messages="$enableval", messages="no")case "$messages" in	yes)		AC_MSG_RESULT(yes)		AC_DEFINE_UNQUOTED(MESSAGES, , Runtime messages)		;;	*)		AC_MSG_RESULT(no)		;;esacCFLAGS="$CFLAGS -D_REENTRANT"CFLAGS="$CFLAGS -DWALL -W -Wall"AC_SUBST(PACKAGE)AC_SUBST(VERSION)DATE=`date +%Y-%m-%d`AC_SUBST(DATE)AC_OUTPUT(Makefile src/Makefile)

⌨️ 快捷键说明

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