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

📄 configure.in

📁 boa:著名嵌入式系统网页服务器源代码。
💻 IN
字号:
dnl $Id: configure.in,v 1.21.2.5 2002/07/28 02:38:32 jnelson Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(boa.c)

dnl Look for gunzip
AC_PATH_PROG(GUNZIP, gunzip)
AC_DEFINE_UNQUOTED(GUNZIP, "$ac_cv_path_GUNZIP")

dnl Checks for programs.
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET

dnl Checks for libraries.

dnl Make config.h
AC_CONFIG_HEADER(config.h)

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/fcntl.h limits.h sys/time.h sys/select.h)
AC_CHECK_HEADERS(getopt.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_HEADER_TIME

dnl Checks for library functions.
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_MMAP
AC_CHECK_FUNCS(getcwd strdup strstr)
AC_CHECK_FUNCS(gethostname gethostbyname select socket inet_aton)
AC_CHECK_FUNCS(scandir alphasort)

AC_CHECK_STRUCT_FOR([
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif
],tm,tm_gmtoff)

if test "$ac_cv_struct_tm_has_tm_gmtoff" = "yes"; then
  AC_DEFINE(HAVE_TM_GMTOFF)
fi

AC_CHECK_STRUCT_FOR([

#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif
],tm,tm_zone)

if test "$ac_cv_struct_tm_has_tm_zone" = "yes"; then
  AC_DEFINE(HAVE_TM_ZONE)
fi

AC_CHECK_STRUCT_FOR([
#include <sys/types.h>
#include <netinet/in.h>
],sockaddr_in,sin_len)

if test "$ac_cv_struct_sockaddr_in_has_sin_len" = "yes"; then
  AC_DEFINE(HAVE_SIN_LEN)
fi

if test $ac_cv_func_socket = no; then
  # socket is not in the default libraries.
  AC_CHECK_LIB(socket, socket, 
   [ MYLIBS="$MYLIBS -lsocket" ])
fi

if test $ac_cv_func_inet_aton = no; then
  # inet_aton is not in the default libraries.
  AC_CHECK_LIB(resolv, inet_aton, MYLIBS="$MYLIBS -lresolv")
fi

if test $ac_cv_func_gethostname = no; then
  AC_CHECK_LIB(nsl, gethostname, MYLIBS="$MYLIBS -lnsl")
fi

dnl May end up with duplicate -lnsl -- oh well
if test $ac_cv_func_gethostbyname = no; then
  AC_CHECK_LIB(nsl, gethostbyname, MYLIBS="$MYLIBS -lnsl")
fi

LIBS="$LIBS $MYLIBS"

if test $ac_cv_func_scandir = no; then
  # scandir not defined, add it
  SCANDIR="scandir.o"
fi

if test $ac_cv_func_alphasort = no; then
  # alphasort not defined, add it
  ALPHASORT="alphasort.o"
fi

if test $ac_cv_func_strdup = no -o $ac_cv_func_strstr = no; then
  # strdup or strstr not defined
  STRUTIL="strutil.o"
fi

if test -n "$GCC"; then
  dnl if we are running gcc, use -pipe
  test -n "$GCC" && CFLAGS="$CFLAGS -pipe"

  AC_MSG_CHECKING(compile and link profiling code)
  AC_ARG_ENABLE(profiling,
  [  --enable-profiling      Compile and link profiling code],
  [
    if test "$enableval" = "yes" ; then
      AC_MSG_RESULT(yes)
      CFLAGS="$CFLAGS -pg"
      LDFLAGS="$LDFLAGS -g -pg"    
    else
      AC_MSG_RESULT(no)
    fi
  ],
  [
    AC_MSG_RESULT(no)
  ])
fi

AC_MSG_CHECKING(whether to compile and link debugging code)
AC_ARG_ENABLE(debug,
[  --disable-debug         Compile and link debugging code],
[
  if test "$enableval" = "yes" ; then
    AC_MSG_RESULT(yes)
    LDFLAGS="$LDFLAGS -g"
    test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
  else
    AC_MSG_RESULT(no)
  fi
],
[
    AC_MSG_RESULT(yes)
    LDFLAGS="$LDFLAGS -g"
    test -n "$GCC" && CFLAGS="$CFLAGS -Wall"
])

AC_MSG_CHECKING(whether to link with the Dmalloc memory debugger/profiler)
AC_ARG_WITH(dmalloc, 
[  --with-dmalloc          link with the Dmalloc memory debugger/profiler],
[
  if test "$withval" = "yes"; then
    AC_MSG_RESULT(trying)
    AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
  else
    AC_MSG_RESULT(no)
  fi
],
[
  AC_MSG_RESULT(no)
])

AC_MSG_CHECKING(whether to link with the Electric Fence memory debugger)
AC_ARG_WITH(efence, 
[  --with-efence           link with the Electric Fence memory debugger ],
[
  if test "$withval" = "yes"; then
    AC_MSG_RESULT(trying)
    AC_CHECK_LIB(efence, main)
  else
    AC_MSG_RESULT(no)
  fi
],
[
  AC_MSG_RESULT(no)
])

dnl For anything that wasn't found but we have source for
AC_SUBST(STRUTIL)
AC_SUBST(ALPHASORT)
AC_SUBST(SCANDIR)

AC_OUTPUT(Makefile)

⌨️ 快捷键说明

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