configure.ac
来自「Ubuntu packages of security software。 相」· AC 代码 · 共 708 行 · 第 1/2 页
AC
708 行
if test $have_libpcap != yes ; then AC_CONFIG_SUBDIRS(libpcap)fihave_pcre=norequested_included_pcre=noLIBPCREDIR=libpcre# First we test whether they specified libpcre explicitlyAC_ARG_WITH(libpcre,AC_HELP_STRING([--with-libpcre=DIR], [Use an existing (compiled) pcre lib from DIR/include and DIR/lib.])AC_HELP_STRING([--with-libpcre=included], [Always use the version included with Nmap]),[ case "$with_libpcre" in yes) ;; included) requested_included_pcre=yes ;; *) CXXFLAGS="-I$with_libpcre/include $CXXFLAGS" LDFLAGS="-L$with_libpcre/lib $LDFLAGS" have_pcre=yes ;; esac])# If they didn't specify it, we try to find itif test $have_pcre != yes -a $requested_included_pcre != yes ; then AC_CHECK_HEADER(pcre.h, AC_CHECK_LIB(pcre, pcre_version, [have_pcre=yes ]), [AC_CHECK_HEADER(pcre/pcre.h, [AC_CHECK_LIB(pcre, pcre_version, [have_pcre=yes])] )] )fi# If we still don't have it, we use our ownif test $have_pcre != yes ; then AC_CONFIG_SUBDIRS( libpcre ) CXXFLAGS="-I$LIBPCREDIR $CXXFLAGS" LIBPCRE_LIBS="$LIBPCREDIR/libpcre.a" PCRE_DEPENDS="$LIBPCREDIR/libpcre.a" PCRE_BUILD="pcre_build" PCRE_CLEAN="pcre_clean" PCRE_DIST_CLEAN="pcre_dist_clean"else# We only need to check for and use this if we are NOT using included pcre AC_CHECK_HEADERS(pcre/pcre.h) LIBPCRE_LIBS="-lpcre" PCRE_DEPENDS="" PCRE_BUILD="" PCRE_CLEAN="" PCRE_DIST_CLEAN=""fiAC_SUBST(LIBPCRE_LIBS)AC_SUBST(LIBPCREDIR)AC_SUBST(PCRE_DEPENDS)AC_SUBST(PCRE_BUILD)AC_SUBST(PCRE_CLEAN)AC_SUBST(PCRE_DIST_CLEAN)have_dnet=norequested_included_dnet=noLIBDNETDIR=libdnet-stripped# First we test whether they specified libdnet explicitlyAC_ARG_WITH(libdnet,AC_HELP_STRING([--with-libdnet=DIR], [Use an existing (compiled) dnet lib from DIR/include and DIR/lib.]),[ case "$with_libdnet" in yes) ;; included) ;; *) CXXFLAGS="-I$with_libdnet/include $CXXFLAGS" LDFLAGS="-L$with_libdnet/lib $LDFLAGS" have_dnet=yes ;; esac])# If they didn't provide location, we use the included oneif test $have_dnet != yes ; then AC_CONFIG_SUBDIRS( libdnet-stripped ) CXXFLAGS="-I$LIBDNETDIR/include $CXXFLAGS" LIBDNET_LIBS="$LIBDNETDIR/src/.libs/libdnet.a" DNET_DEPENDS="$LIBDNETDIR/src/.libs/libdnet.a" DNET_BUILD="dnet_build" DNET_CLEAN="dnet_clean" DNET_DIST_CLEAN="dnet_dist_clean"else LIBDNET_LIBS="-ldnet" DNET_DEPENDS="" DNET_BUILD="" DNET_CLEAN="" DNET_DIST_CLEAN=""fiAC_SUBST(LIBDNET_LIBS)AC_SUBST(LIBDNETDIR)AC_SUBST(DNET_DEPENDS)AC_SUBST(DNET_BUILD)AC_SUBST(DNET_CLEAN)AC_SUBST(DNET_DIST_CLEAN)LIBLUADIR=libluahave_lua=norequested_included_lua=nono_lua=no# First we test whether they specified liblua explicitlyAC_ARG_WITH(liblua, AC_HELP_STRING([--with-liblua=DIR], [Use an existing (compiled) lua lib from DIR/include and DIR/lib.])AC_HELP_STRING([--with-liblua=included], [Use the liblua version included with Nmap])AC_HELP_STRING([--without-liblua], [Compile without lua (this will exclude all of NSE from compilation)]),[ case "$with_liblua" in yes) ;; included) CXXFLAGS="-I$LIBLUADIR $CXXFLAGS" LIBLUA_LIBS="$LIBLUADIR/liblua.a" LUA_DEPENDS="$LIBLUADIR/liblua.a" LUA_BUILD="lua_build" LUA_CLEAN="lua_clean" LUA_DIST_CLEAN="lua_dist_clean" have_lua="yes" ;; no) no_lua="yes" ;; *) CXXFLAGS="-I$with_liblua/include $CXXFLAGS" LDFLAGS="-L$with_liblua/lib $LDFLAGS" have_lua=yes ;; esac])# They don't want luaif test $no_lua == yes; then CXXFLAGS="-DNOLUA $CXXFLAGS" LIBLUA_LIBS="" LUA_DEPENDS="" LUA_BUILD="" LUA_CLEAN="" LUA_DIST_CLEAN="" INSTALLNSE=""else # NSE C modules are loaded with dlopen. AC_SEARCH_LIBS(dlopen, dl) # If they didn't specify it, we try to find it if test $have_lua != yes; then AC_CHECK_HEADER(lua.h, AC_CHECK_LIB(lua, lua_call, [have_lua=yes ]), [AC_CHECK_HEADERS(lua/lua.h, [AC_CHECK_LIB(lua, lua_call, [have_lua=yes])] )] ) AC_LANG_PUSH(C++) AC_MSG_CHECKING([for lua version >= 501]) AC_RUN_IFELSE([ AC_LANG_PROGRAM( [[#include <lua.h>]], [[if(LUA_VERSION_NUM < 501) return 1;]])], have_lua=yes, have_lua=no) AC_LANG_POP(C++) LIBLUA_LIBS="-llua" LUA_DEPENDS="" LUA_BUILD="" LUA_CLEAN="" LUA_DIST_CLEAN="" fi # if we didn't find we use our own if test $have_lua != yes; then AC_MSG_RESULT(no) CXXFLAGS="-I$LIBLUADIR $CXXFLAGS" LIBLUA_LIBS="$LIBLUADIR/liblua.a" LUA_DEPENDS="$LIBLUADIR/liblua.a" LUA_BUILD="lua_build" LUA_CLEAN="lua_clean" LUA_DIST_CLEAN="lua_dist_clean" else AC_MSG_RESULT(yes) fi INSTALLNSE="install-nse"fiif test $no_lua != yes; then AC_CONFIG_SUBDIRS( nselib-bin ) NSELIB_CLEAN=nselib_clean NSELIB_DIST_CLEAN=nselib_dist_cleanfiAC_SUBST(LIBLUA_LIBS)AC_SUBST(LIBLUADIR)AC_SUBST(LUA_DEPENDS)AC_SUBST(LUA_BUILD)AC_SUBST(LUA_CLEAN)AC_SUBST(LUA_DIST_CLEAN)AC_SUBST(INSTALLNSE)AC_SUBST(NSELIB_CLEAN)AC_SUBST(NSELIB_DIST_CLEAN)AC_SUBST(CXXFLAGS)dnl This test is from the configure.in of Unix Network Programming seconddnl edition example code by W. Richard Stevensdnl ##################################################################dnl Check if sockaddr{} has sa_len member.dnlAC_CACHE_CHECK(if sockaddr{} has sa_len member, ac_cv_sockaddr_has_sa_len, AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/socket.h>], [unsigned int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_sockaddr_has_sa_len=yes, ac_cv_sockaddr_has_sa_len=no))if test $ac_cv_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN)fi#dnl check endednessAC_C_BIGENDIANAC_MSG_CHECKING([if struct in_addr is a wacky huge structure (some Sun boxes)])AC_TRY_COMPILE([#include <netinet/in.h>], struct in_addr i; i._S_un._S_addr;, \ AC_DEFINE(IN_ADDR_DEEPSTRUCT) \ AC_MSG_RESULT(yes) , \ AC_TRY_COMPILE([#include <sys/types.h>#include <netinet/in.h>], struct in_addr i; i.S_un.S_addr;, \ AC_DEFINE(IN_ADDR_DEEPSTRUCT) \ AC_MSG_RESULT(yes) , \ AC_MSG_RESULT(no);))AC_CACHE_CHECK(if struct icmp exists, ac_cv_struct_icmp_exists, AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/param.h> #include <netinet/in_systm.h> #include <netinet/in.h> #define __USE_BSD #define __FAVOR_BSD #define _BSD_SOURCE #include <netinet/ip.h> #include <netinet/ip_icmp.h>], [unsigned int i = sizeof(struct icmp)], ac_cv_struct_icmp_exists=yes, ac_cv_struct_icmp_exists=no))if test $ac_cv_struct_icmp_exists = yes ; then AC_DEFINE(HAVE_STRUCT_ICMP)fiAC_CACHE_CHECK(if struct ip exists, ac_cv_struct_ip_exists, AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/param.h> #include <netinet/in_systm.h> #include <netinet/in.h> #define __USE_BSD #define __FAVOR_BSD #define _BSD_SOURCE #include <netinet/ip.h>], [unsigned int i = sizeof(struct ip)], ac_cv_struct_ip_exists=yes, ac_cv_struct_ip_exists=no))if test $ac_cv_struct_ip_exists = yes ; then AC_DEFINE(HAVE_STRUCT_IP)fiAC_CACHE_CHECK(if struct ip has ip_sum member, ac_cv_ip_has_ip_sum, AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/param.h> #include <netinet/in_systm.h> #include <netinet/in.h> #define __USE_BSD #define __FAVOR_BSD #define _BSD_SOURCE #include <netinet/ip.h> #include <netinet/ip_icmp.h>], [unsigned int i = sizeof(((struct ip *)0)->ip_sum)], ac_cv_ip_has_ip_sum=yes, ac_cv_ip_has_ip_sum=no))if test $ac_cv_ip_has_ip_sum = yes ; then AC_DEFINE(HAVE_IP_IP_SUM)fidnl Checks for library functions.AC_CHECK_FUNCS(strerror)RECVFROM_ARG6_TYPEAC_ARG_WITH(libnbase,AC_HELP_STRING([--with-libnbase=DIR], [Look for nbase include/libs in DIR]),[ case "$with_libnbase" in yes) ;; *) NBASEDIR="$with_libnbase" NBASE_BUILD="" ;; esac],NBASE_BUILD="nbase_build"NBASEDIR="nbase")LDFLAGS="$LDFLAGS -L$NBASEDIR"CXXFLAGS="$CXXFLAGS -I$NBASEDIR"LIBNBASE_LIBS="-lnbase"AC_SUBST(NBASEDIR)AC_SUBST(NBASE_BUILD)AC_SUBST(LIBNBASE_LIBS)AC_CONFIG_SUBDIRS(nbase)NSOCKDIR="nsock"NSOCK_BUILD="nsock_build"AC_ARG_WITH(libnsock,AC_HELP_STRING([--with-libnsock=DIR], [Compile and link to libnsock in DIR]),[ case "$with_libnsock" in yes) ;; *) NSOCKDIR="$with_libnsock" NSOCK_BUILD="" ;; esac])LDFLAGS="$LDFLAGS -L$NSOCKDIR/src/"CXXFLAGS="$CXXFLAGS -I$NSOCKDIR/include"LIBNSOCK_LIBS="-lnsock"AC_SUBST(NSOCKDIR)AC_SUBST(NSOCK_BUILD)AC_SUBST(LIBNSOCK_LIBS)AC_CONFIG_SUBDIRS(nsock/src)AC_OUTPUT(Makefile)# Krad ASCII ART#!#@$!@#$if test -f docs/leet-nmap-ascii-art.txt; then cat docs/leet-nmap-ascii-art.txtfiecho "Configuration complete. Type make (or gmake on some *BSD machines) to compile."
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?