📄 configure.in
字号:
dnl test for Unix variantsAC_ISC_POSIXAC_MINIXAC_SYS_LARGEFILEdnl BEGIN changes for cross-building (currently cygwin, minGW, anddnl (obsolete) BeOS)SIGNAMES_O=SIGNAMES_H=lsignames.hdnl load up the cross-building cache file -- add more cases and cachednl files as necessarydnl Note that host and target machine are the same, and different than thednl build machine.dnl Set SIGNAMES_H based on whether or not we're cross-compiling.CROSS_COMPILE=if test "x$cross_compiling" = "xyes"; then case "${host}" in *-cygwin*) cross_cache=${srcdir}/cross-build/cygwin32.cache ;; *-mingw*) cross_cache=${srcdir}/cross-build/cygwin32.cache ;; i[[3456]]86-*-beos*) cross_cache=${srcdir}/cross-build/x86-beos.cache ;; *) echo "configure: cross-compiling for $host is not supported" >&2 ;; esac if test -n "${cross_cache}" && test -r "${cross_cache}"; then echo "loading cross-build cache file ${cross_cache}" . ${cross_cache} fi unset cross_cache SIGNAMES_O='signames.o' CROSS_COMPILE='-DCROSS_COMPILING' AC_SUBST(CROSS_COMPILE)fiAC_SUBST(SIGNAMES_H)AC_SUBST(SIGNAMES_O)if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' else CC_FOR_BUILD=gcc fifiAC_SUBST(CC_FOR_BUILD)dnl END changes for cross-buildingdnl We want these before the checks, so the checks can modify their values.test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"dnl handle options that alter how bash is compiled and linkeddnl these must come after the test for cc/gccif test "$opt_profiling" = "yes"; then PROFILE_FLAGS=-pg case "$host_os" in solaris2*) ;; *) opt_static_link=yes ;; esac DEBUG= MALLOC_DEBUG=fiif test "$opt_static_link" = yes; then # if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2 if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then STATIC_LD="-static" case "$host_os" in solaris2*) ;; *) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental esac fifiif test "X$cross_compiling" = "Xno"; then CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"} LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'}else CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""} LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}fitest -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g"AC_SUBST(CFLAGS)AC_SUBST(CPPFLAGS)AC_SUBST(LDFLAGS)AC_SUBST(STATIC_LD)AC_SUBST(CFLAGS_FOR_BUILD)AC_SUBST(CPPFLAGS_FOR_BUILD)AC_SUBST(LDFLAGS_FOR_BUILD)AC_PROG_GCC_TRADITIONALdnl BEGIN READLINE and HISTORY LIBRARY SECTIONdnl prepare to allow bash to be linked against an already-installed readlinednl first test that the readline version is new enough to link bash againstif test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no"then # If the user specified --with-installed-readline=PREFIX and PREFIX # is not `yes', set ac_cv_rl_prefix to PREFIX test $opt_with_installed_readline != "yes" && ac_cv_rl_prefix=$opt_with_installed_readline RL_LIB_READLINE_VERSION case "$ac_cv_rl_version" in 5*|6*|7*|8*|9*) ;; *) opt_with_installed_readline=no AC_MSG_WARN([installed readline library is too old to be linked with bash]) AC_MSG_WARN([using private bash version]) ;; esacfiTILDE_LIB=-ltildeif test $opt_readline = yes; then AC_DEFINE(READLINE) if test "$opt_with_installed_readline" != "no" ; then case "$opt_with_installed_readline" in yes) RL_INCLUDE= ;; *) case "$RL_INCLUDEDIR" in /usr/include) ;; *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; esac ;; esac READLINE_DEP= READLINE_LIB=-lreadline # section for OS versions that don't allow unresolved symbols # to be compiled into dynamic libraries. case "$host_os" in cygwin*) TILDE_LIB= ;; esac else RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' READLINE_DEP='$(READLINE_LIBRARY)' # section for OS versions that ship an older/broken version of # readline as a standard dynamic library and don't allow a # static version specified as -llibname to override the # dynamic version case "${host_os}" in darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; *) READLINE_LIB=-lreadline ;; esac fielse RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' READLINE_LIB= READLINE_DEP=fiif test $opt_history = yes || test $opt_bang_history = yes; then if test $opt_history = yes; then AC_DEFINE(HISTORY) fi if test $opt_bang_history = yes; then AC_DEFINE(BANG_HISTORY) fi if test "$opt_with_installed_readline" != "no"; then HIST_LIBDIR=$RL_LIBDIR HISTORY_DEP= HISTORY_LIB=-lhistory case "$opt_with_installed_readline" in yes) RL_INCLUDE= ;; *) case "$RL_INCLUDEDIR" in /usr/include) ;; *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; esac ;; esac else HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' HISTORY_DEP='$(HISTORY_LIBRARY)' # section for OS versions that ship an older version of # readline as a standard dynamic library and don't allow a # static version specified as -llibname to override the # dynamic version case "${host_os}" in darwin[[89]]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;; *) HISTORY_LIB=-lhistory ;; esac fielse HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' HISTORY_LIB= HISTORY_DEP=fiAC_SUBST(READLINE_LIB)AC_SUBST(READLINE_DEP)AC_SUBST(RL_LIBDIR)AC_SUBST(RL_INCLUDEDIR)AC_SUBST(RL_INCLUDE)AC_SUBST(HISTORY_LIB)AC_SUBST(HISTORY_DEP)AC_SUBST(HIST_LIBDIR)AC_SUBST(TILDE_LIB)dnl END READLINE and HISTORY LIBRARY SECTIONdnl programs needed by the build and install processAC_PROG_INSTALLAC_CHECK_PROG(AR, ar, , ar)dnl Set default for ARFLAGS, since autoconf does not have a macro for it.dnl This allows people to set it when running configure or maketest -n "$ARFLAGS" || ARFLAGS="cr"AC_PROG_RANLIBAC_PROG_YACCAC_PROG_MAKE_SETcase "$host_os" inopennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;*) MAKE_SHELL=/bin/sh ;;esacAC_SUBST(MAKE_SHELL)dnl this is similar to the expanded AC_PROG_RANLIBif test x$SIZE = x; then if test x$ac_tool_prefix = x; then SIZE=size else SIZE=${ac_tool_prefix}size save_IFS=$IFS ; IFS=: size_found=0 for dir in $PATH; do if test -x $dir/$SIZE ; then size_found=1 break fi done if test $size_found -eq 0; then SIZE=: fi IFS=$save_IFS fifiAC_SUBST(SIZE)dnl Turn on any extensions available in the GNU C library.AC_DEFINE(_GNU_SOURCE, 1)dnl C compiler characteristicsAC_C_CONSTAC_C_INLINEAC_C_BIGENDIANAC_C_STRINGIZEAC_C_LONG_DOUBLEAC_C_PROTOTYPESAC_C_CHAR_UNSIGNEDAC_C_VOLATILEAC_C_RESTRICTdnl initialize GNU gettextAM_GNU_GETTEXT([no-libtool], [need-ngettext], [lib/intl])dnl header filesAC_HEADER_DIRENTAC_HEADER_TIMEBASH_HEADER_INTTYPESAC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ stddef.h stdint.h netdb.h pwd.h grp.h strings.h regex.h \ syslog.h ulimit.h)AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h \ sys/resource.h sys/param.h sys/socket.h sys/stat.h \ sys/time.h sys/times.h sys/types.h sys/wait.h)AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)dnl sys/ptem.h requires definitions from sys/stream.h on systems where itdnl existsAC_CHECK_HEADER(sys/ptem.h, , ,[[#if HAVE_SYS_STREAM_H# include <sys/stream.h>#endif]])dnl special checks for libc functionsAC_FUNC_ALLOCAAC_FUNC_GETPGRPAC_FUNC_SETVBUF_REVERSEDAC_FUNC_VPRINTFAC_FUNC_STRCOLLdnl if we're not using the bash malloc but require the C alloca, set thingsdnl up to build a libmalloc.a containing only alloca.oif test "$ac_cv_func_alloca_works" = "no" && test "$opt_bash_malloc" = "no"; then MALLOC_TARGET=alloca MALLOC_SRC=alloca.c MALLOC_LIB='-lmalloc' MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' MALLOC_DEP='$(MALLOC_LIBRARY)'fidnl if vprintf is not in libc, see if it's defined in stdio.hif test "$ac_cv_func_vprintf" = no; then AC_MSG_CHECKING(for declaration of vprintf in stdio.h) AC_EGREP_HEADER([[int[ ]*vprintf[^a-zA-Z0-9]]],stdio.h,ac_cv_func_vprintf=yes) AC_MSG_RESULT($ac_cv_func_vprintf) if test $ac_cv_func_vprintf = yes; then AC_DEFINE(HAVE_VPRINTF) fifiif test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then AC_LIBOBJ(vprint)fidnl signal stuffAC_TYPE_SIGNALdnl checks for certain version-specific system calls and libc functionsAC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE))AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3))AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF_IN_LIBC))AC_CHECK_FUNC(isnan, AC_DEFINE(HAVE_ISNAN_IN_LIBC))dnl checks for missing libc functionsAC_CHECK_FUNC(mkfifo,AC_DEFINE(HAVE_MKFIFO),AC_DEFINE(MKFIFO_MISSING))dnl checks for system callsAC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \ getpagesize getpeername getrlimit getrusage gettimeofday \ kill killpg lstat readlink sbrk select setdtablesize \ setitimer tcgetpgrp uname ulimit waitpid)AC_REPLACE_FUNCS(rename)dnl checks for c library functionsAC_CHECK_FUNCS(bcopy bzero confstr faccessat fnmatch \ getaddrinfo gethostbyname getservbyname getservent inet_aton \ memmove pathconf putenv raise regcomp regexec \ setenv setlinebuf setlocale setvbuf siginterrupt strchr \ sysconf syslog tcgetattr times ttyname tzset unsetenv)AC_CHECK_FUNCS(vasprintf asprintf)AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit)AC_CHECK_FUNCS(getpwent getpwnam getpwuid)AC_REPLACE_FUNCS(getcwd memset)AC_REPLACE_FUNCS(strcasecmp strcasestr strerror strftime strnlen strpbrk strstr)AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoimax strtoumax)AC_REPLACE_FUNCS(dprintf)AC_REPLACE_FUNCS(strchrnul)AC_CHECK_DECLS([confstr])AC_CHECK_DECLS([printf])AC_CHECK_DECLS([sbrk])AC_CHECK_DECLS([setregid])AC_CHECK_DECLS([strcpy])AC_CHECK_DECLS([strsignal])dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3)AC_CHECK_DECLS([strtold], [ AC_MSG_CHECKING([for broken strtold]) AC_CACHE_VAL(bash_cv_strtold_broken, [AC_TRY_COMPILE( [#include <stdlib.h>], [int main() { long double r; char *foo, bar; r = strtold(foo, &bar);}], bash_cv_strtold_broken=no, bash_cv_strtold_broken=yes, [AC_MSG_WARN(cannot check for broken strtold if cross-compiling, defaulting to no)]) ] ) AC_MSG_RESULT($bash_cv_strtold_broken) if test "$bash_cv_strtold_broken" = "yes" ; then AC_DEFINE(STRTOLD_BROKEN) fi]) BASH_CHECK_DECL(strtoimax)BASH_CHECK_DECL(strtol)BASH_CHECK_DECL(strtoll)BASH_CHECK_DECL(strtoul)BASH_CHECK_DECL(strtoull)BASH_CHECK_DECL(strtoumax)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -