📄 configure.ac
字号:
dnl # -*- mode: fundamental; -*-dnl # Autoconf configuration file for Nbasednl #dnl # Process this file with autoconf to produce a configure script.dnl # $Id: configure.ac 6327 2007-11-27 06:36:52Z david $# Because nbase is usually distributed with Nmap, the necessary files# config.guess, config.guess, and install-sh are not distributed with# nbase. Rather they are gotten from Nmap.# Require autoconf 2.13AC_PREREQ(2.13)# Include my own macrossinclude(configlocal.m4)AC_INIT(nbase.h)AC_ARG_WITH(localdirs, [ --with-localdirs Explicitly ask compiler to use /usr/local/{include,libs} if they exist ], [ case "$with_localdirs" in yes) user_localdirs=1 ;; no) user_localdirs=0 ;; esac ], [ user_localdirs=0 ] )if test "$user_localdirs" = 1; then if test -d /usr/local/lib; then LDFLAGS="$LDFLAGS -L/usr/local/lib" fi if test -d /usr/local/include; then CFLAGS="$CFLAGS -I/usr/local/include" fifidnl use config.h instad of -D macrosAC_CONFIG_HEADER(nbase_config.h)dnl Checks for programs.AC_PROG_CC if test -n "$GCC"; then CFLAGS="$CFLAGS -Wall " fiAC_PROG_RANLIBdnl AC_PROG_INSTALLdnl AC_PATH_PROG(MAKEDEPEND, makedepend)AC_SUBST(COMPAT_OBJS)AC_SUBST(COMPAT_SRCS)dnl Host specific hacksAC_CANONICAL_HOSTdnl equiv to '#define inline' to 'inline', '__inline__', '__inline' or ''AC_C_INLINEcase "$host" in *-sgi-irix5* | *-sgi-irix6*) if test -z "$GCC"; then AC_DEFINE(inline, ) fi ;;esacdnl Checks for header files.AC_HEADER_STDCAC_CHECK_HEADERS( string.h getopt.h strings.h sys/param.h sys/time.h unistd.h errno.h sys/types.h sys/socket.h netinet/in.h arpa/inet.h sys/stat.h net/if.h netdb.h sys/wait.h fcntl.h sys/resource.h)AC_HEADER_TIMEAC_MSG_CHECKING(for __attribute__)AC_CACHE_VAL(ac_cv___attribute__, [ AC_TRY_COMPILE( [ #include <stdlib.h> static void foo(void) __attribute__ ((noreturn)); static void foo(void) { exit(1); } ], [ foo(); ], ac_cv___attribute__=yes, ac_cv___attribute__=no )])if test "$ac_cv___attribute__" = "yes"; then AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])fiAC_MSG_RESULT($ac_cv___attribute__)AC_SUBST(CFLAGS)dnl check endednessAC_C_BIGENDIANdnl determine integer widths so nbase can export u32, u16, etc.AC_CHECK_SIZEOF(char, 1)AC_CHECK_SIZEOF(short, 2)AC_CHECK_SIZEOF(int, 4)AC_CHECK_SIZEOF(long, 4)dnl Checks for library functions.AC_CHECK_FUNCS( snprintf vsnprintf nanosleep strerror strcasestr strcasecmp strncasecmp )needsnprintf=noAC_CHECK_FUNCS(vsnprintf snprintf asprintf asnprintf vasprintf vasnprintf,, [needsnprintf=yes])if test $needsnprintf = yes; then AC_LIBOBJ([snprintf])fiAC_CHECK_FUNCS( getopt getopt_long_only)AC_CHECK_FUNCS(usleep gettimeofday sleep, , [ AC_LIBOBJ([nbase_time]) ])AC_CHECK_FUNC(getopt_long_only, , [ AC_LIBOBJ([getopt]) ])AC_CHECK_FUNCS(strcasecmp strncasecmp, , [ AC_LIBOBJ([strcasecmp]) ])dnl We always want some of our filesAC_LIBOBJ([nbase_str])AC_LIBOBJ([nbase_misc])AC_LIBOBJ([nbase_memalloc])AC_LIBOBJ([nbase_rnd])# Check for IPv6 support -- modified from Apache 2.0.40:AC_ARG_ENABLE(ipv6, [ --disable-ipv6 Disable IPv6 support ], [ if test "$enableval" = "no"; then user_disabled_ipv6=1 fi ], [ user_disabled_ipv6=0 ] )AC_SEARCH_LIBS(getaddrinfo, [inet6 socket])AC_SEARCH_LIBS(gai_strerror, [inet6 socket])AC_SEARCH_LIBS(getnameinfo, [inet6 socket])AC_CHECK_FUNCS(gai_strerror)AC_REPLACE_FUNCS(inet_ntop inet_pton)APR_CHECK_WORKING_GETADDRINFOAPR_CHECK_WORKING_GETNAMEINFOAPR_CHECK_SOCKADDR_IN6APR_CHECK_SOCKADDR_STORAGECHECK_AF_INET6_DEFINEAC_MSG_CHECKING(for IPv6 support)have_ipv6="0"if test "$user_disabled_ipv6" = 1; then AC_MSG_RESULT("no -- disabled by user")else if test "x$have_sockaddr_in6" = "x1"; then if test "x$ac_cv_working_getaddrinfo" = "xyes"; then if test "x$ac_cv_working_getnameinfo" = "xyes"; then have_ipv6="1" AC_MSG_RESULT(yes) else AC_MSG_RESULT("no -- no working getnameinfo") fi else AC_MSG_RESULT("no -- no working getaddrinfo") fi else AC_MSG_RESULT("no -- no sockaddr_in6"); fifiif test "x$ac_cv_working_getaddrinfo" != "xyes"; thenAC_LIBOBJ([getaddrinfo])fiif test "x$ac_cv_working_getnameinfo" != "xyes"; thenAC_LIBOBJ([getnameinfo])fiif test "$have_ipv6" = "1"; then AC_DEFINE(HAVE_IPV6)fiAC_OUTPUT(Makefile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -