📄 configure.in
字号:
dnl `configure.in' file for a sample packagednl Process this file with autoconf to produce a configure script.dnldnl Permission is hereby granted, free of charge, to any person obtaining adnl copy of this software and associated documentation files (the "Software"),dnl to deal in the Software without restriction, subject to the conditionsdnl listed in the Click LICENSE file. These conditions include: you mustdnl preserve this copyright notice, and you cannot mention the copyrightdnl holders in advertising related to the Software without their permission.dnl The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. Thisdnl notice is a summary of the Click LICENSE file; the license in that file isdnl legally binding.dnldnl the usual `configure.in' boilerplatednlAC_INIT(config.h.in)AC_CONFIG_HEADER(config.h)AC_SUBST(ac_configure_args)dnldnl locate Click install directorydnlAC_ARG_WITH(click, [ --with-click[=DIR] Click install path is DIR [$prefix]], [clickprefix=$withval; if test -z "$withval" -o "$withval" = yes; then clickprefix=$prefix; fi], clickprefix=NONE)dnl Preset $prefix and $exec_prefix.test "x$prefix" = xNONE && prefix=$ac_default_prefixtest "x$exec_prefix" = xNONE && exec_prefix='${prefix}'if test "$clickprefix" = NONE; then clickprefix=$prefixficlickbindir='${clickprefix}/bin'clicksbindir='${clickprefix}/sbin'AC_SUBST(clickprefix)AC_SUBST(clickbindir)AC_SUBST(clicksbindir)if test ! -r $clickprefix/include/click/pathvars.h ; then AC_MSG_ERROR([Can't read \`$clickprefix/include/click/pathvars.h'!(Are you sure \`$clickprefix' is a Click install directory?)])fidnldnl extract properties of the Click installationdnlclick_have_linuxmodule=`if grep 'define HAVE_LINUXMODULE_TARGET' $clickprefix/include/click/config.h >/dev/null 2>&1; then echo 1; else echo 0; fi`click_linuxdir=`grep LINUX_SRCDIR $clickprefix/include/click/pathvars.h | sed 's/.*"\(.*\)".*/\1/'`dnldnl The rest of this file is based on Click `configure.in'. You shouldn'tdnl generally need to change it, although you may want to add to it.dnlAC_PROG_CCAC_PROG_CPPAC_PROG_CXXAC_PROG_CXXCPPAC_PATH_PROG(AR, ar)AC_PATH_PROG(LD, ld)AC_PATH_PROG(RANLIB, ranlib, :)AC_PATH_PROG(STRIP, strip, :)AC_PROG_INSTALLdnldnl check for install -CdnlAC_MSG_CHECKING(whether install accepts -C)echo X > conftest.1if $INSTALL -C conftest.1 conftest.2 >/dev/null 2>&1; then INSTALL_IF_CHANGED="$INSTALL -C" AC_MSG_RESULT(yes)else INSTALL_IF_CHANGED="$INSTALL" AC_MSG_RESULT(no)fiAC_SUBST(INSTALL_IF_CHANGED)dnldnl check suitability of the C++ compilerdnlif test -z "$GXX"; then AC_MSG_WARN(Your C++ compiler ($CXX) is not a GNU C++ compiler!Either set the "'`'"CXX' environment variable to tell me where[a GNU C++ compiler is, or compile at your own risk.(This code uses a few GCC extensions and GCC-specific compiler options,and Linux header files are GCC-specific.)])fiAC_LANG_CPLUSPLUSAC_CACHE_CHECK(for recent version of C++, ac_cv_good_cxx, AC_TRY_COMPILE([], [#ifdef __GNUG__#if (__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)#error "fuckers! fuckers!"#endif#endifreturn 0;], ac_cv_good_cxx=yes, ac_cv_good_cxx=no))if test "$ac_cv_good_cxx" != yes; then AC_MSG_ERROR(Your GNU C++ compiler ($CXX) is too old![Either download a newer compiler, or tell me to use a different compilerby setting the "'`'"CXX' environment variable and rerunning me.])fiAC_CACHE_CHECK(for working new.h, ac_cv_good_new_h, AC_TRY_LINK([#include <new.h>], [ int a; int *b = new(&a) int; return 0;], ac_cv_good_new_h=yes, ac_cv_good_new_h=no))if test "$ac_cv_good_new_h" = yes; then AC_DEFINE(HAVE_NEW_H)fiCPPFLAGS="$CPPFLAGS"if test -n "$GCC"; then CC="$CC -Wall"fiif test -n "$GXX"; then CXX="$CXX -Wp,-w -W -Wall"; KERNEL_CXX="$CXX -w -Wall"else KERNEL_CXX="$CXX"fiif test -n "$GXX"; then CXXFLAGS="-fno-exceptions -fno-rtti -fvtable-thunks $CXXFLAGS"fiAC_SUBST(KERNEL_CXX)dnldnl find autoconfdnlmissing_dir=`cd $srcdir && pwd`AC_MSG_CHECKING(for working autoconf)AUTOCONF=${AUTOCONF-autoconf}if ($AUTOCONF --version) < /dev/null > conftest.out 2>&1; then if test `head -1 conftest.out | sed 's/.*2\.\([[0-9]]*\).*/\1/'` -ge 13 2>/dev/null; then AC_MSG_RESULT(found) else AUTOCONF="$missing_dir/missing autoconf" AC_MSG_RESULT(old) fielse AUTOCONF="$missing_dir/missing autoconf" AC_MSG_RESULT(missing)fiAC_SUBST(AUTOCONF)dnldnl make FLAGS variables without `-g'dnlCFLAGS_NDEBUG=`echo "$CFLAGS" | sed 's/-g//'`CXXFLAGS_NDEBUG=`echo "$CXXFLAGS" | sed 's/-g//'`AC_SUBST(CFLAGS_NDEBUG)AC_SUBST(CXXFLAGS_NDEBUG)dnldnl check for GNU makednlif test ${GMAKE-NO} = NO; then AC_CACHE_CHECK(for GNU make, ac_cv_gnu_make,[if /bin/sh -c 'make -f /dev/null -n --version | grep GNU' >/dev/null 2>&1; then ac_cv_gnu_make='make'elif /bin/sh -c 'gmake -f /dev/null -n --version | grep GNU' >/dev/null 2>&1; then ac_cv_gnu_make='gmake'else AC_MSG_RESULT(not found) AC_MSG_ERROR(can't find GNU make. Either put "'`'"gmake' on your PATH andrerun "'`'"./configure', or set the GMAKE environment variable toGNU make's pathname.)fi]) GMAKE="$ac_cv_gnu_make"fiSUBMAKE=''AC_SUBST(SUBMAKE)if test $GMAKE != make; then AC_MSG_WARN(You must compile with GNU make ("'`'"$GMAKE').) SUBMAKE="MAKE = $ac_cv_gnu_make"fidnldnl build userlevel? Linux module? are we compiling on Linux?dnlAC_ARG_ENABLE(userlevel, [ --disable-userlevel disable user-level driver], :, enable_userlevel=yes)AC_ARG_ENABLE(linuxmodule, [ --disable-linuxmodule disable Linux kernel driver], :, enable_linuxmodule=yes)AC_ARG_WITH(linux, [ --with-linux[=DIR] Linux source code is in DIR [/usr/src/linux]], [linuxdir=$withval; if test -z "$withval" -o "$withval" = yes; then linuxdir=/usr/src/linux; fi], linuxdir=NONE)if test "x$linuxdir" = xNONE -o "x$linuxdir" = xno; then linuxdir=$click_linuxdirfiif test "x$linuxdir" != xNONE -a "x$linuxdir" != "x$click_linuxdir" -a "x$enable_linuxmodule" = xyes; then AC_MSG_WARN([Specified Linux directory for package \`$linuxdir'differs from Linux directory used for Click \`$click_linuxdir'!])fiif test "x$linuxdir" = xNONE -o "x$linuxdir" = xno -o "x$enable_linuxmodule" != xyes; then ac_have_linux_kernel=n linuxdir=NONEelif test -r $linuxdir/include/linux/skbuff.h; then ac_have_linux_kernel=y if test $click_have_linuxmodule = 0; then AC_MSG_WARN([Compiling for Linux kernel module, although Click reports it has not compileda Linux kernel module]) fielse AC_MSG_ERROR([Can't find \`$linuxdir/include/linux/skbuff.h'!(Are you sure \`$linuxdir' holds the Linux source code?)])fiAC_SUBST(linuxdir)HAVE_USERLEVEL_TARGET=`if test "x$enable_userlevel" = xyes; then echo 1; else echo 0; fi`HAVE_LINUXMODULE_TARGET=`if test "x$linuxdir" = xNONE; then echo 0; else echo 1; fi`AC_SUBST(HAVE_USERLEVEL_TARGET)AC_SUBST(HAVE_LINUXMODULE_TARGET)dnldnl OutputdnlAC_OUTPUT(Makefile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -