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

📄 torture.at

📁 autoconf是一个产生可以自动配置源代码包
💻 AT
📖 第 1 页 / 共 2 页
字号:
# Checking that AC_SUBST worked properly.AT_DATA([expout],[m4_for(AT_Count, 1, 100, 1,[AT_BIG_VALUEcontent of file AT_Count])])AT_CHECK([cat dummy], 0, expout)AT_CLEANUP## ------------------------------- #### Substitute a 2000-byte string.  #### ------------------------------- ### Solaris 9 /usr/ucb/sed that rejects commands longer than 4000 bytes.  HP/UX# sed dumps core around 8 KiB.  However, POSIX says that sed need not# handle lines longer than 2048 bytes (including the trailing newline).# So we'll just test a 2000-byte value.AT_SETUP([Substitute a 2000-byte string])AT_DATA([Foo.in], [@foo@])AT_DATA([configure.ac],[[AC_INITAC_CONFIG_AUX_DIR($top_srcdir/config)AC_SUBST([foo], ]m4_for([n], 1, 100,, ....................)[)AC_CONFIG_FILES([Foo])AC_OUTPUT]])AT_CHECK_AUTOCONFAT_CHECK_CONFIGUREAT_CHECK([cat Foo], 0, m4_for([n], 1, 100,, ....................))AT_CLEANUP## ------------------------------ #### Define to a 2000-byte string.  #### ------------------------------ ##AT_SETUP([Define to a 2000-byte string])AT_CONFIGURE_AC([[AC_DEFINE([foo], ]m4_for([n], 1, 100,, ....................)[, [desc])]])AT_CHECK_AUTOCONFAT_CHECK_AUTOHEADERAT_CHECK_CONFIGUREAT_CHECK_DEFINES([@%:@define foo m4_for([n], 1, 100,, ....................)])AT_CLEANUP## ------------------------------------------ #### Substitute and define special characters.  #### ------------------------------------------ ### Use characters special to the shell, sed, and M4.AT_SETUP([Substitute and define special characters])AT_DATA([Foo.in], [@foo@])AT_CONFIGURE_AC([[foo="AS@&t@_ESCAPE([[X*'[]+ ", `\($foo]])"AC_SUBST([foo])AC_DEFINE([foo], [[X*'[]+ ", `\($foo]], [Awful value.])AC_CONFIG_FILES([Foo])]])AT_CHECK_AUTOCONFAT_CHECK_AUTOHEADERAT_CHECK_CONFIGUREAT_CHECK([cat Foo], 0, [[X*'[]+ ", `\($foo]])AT_CHECK_DEFINES([[#define foo X*'[]+ ", `\($foo]])AT_CLEANUP## ---------------------- #### Substitute a newline.  #### ---------------------- ##AT_SETUP([Substitute a newline])AT_DATA([Foo.in],[@foo@])AT_DATA([configure.ac],[[AC_INITAC_CONFIG_AUX_DIR($top_srcdir/config)foo='onetwo'AC_SUBST([foo])AC_CONFIG_FILES([Foo])AC_OUTPUT]])AT_CHECK_AUTOCONFAT_CHECK_CONFIGUREAT_CHECK([cat Foo], 0, [onetwo])AT_CLEANUP## ------------------ #### Define a newline.  #### ------------------ ##AT_SETUP([Define a newline])AT_XFAIL_IF(:)AT_CONFIGURE_AC([[AC_DEFINE([foo], [onetwo], [This spans two lines.])]])AT_CHECK_AUTOCONFAT_CHECK_AUTOHEADERAT_CHECK_CONFIGUREAT_CHECK_DEFINES([[#define foo onetwo]])AT_CLEANUP## ------------------------ #### datarootdir workaround.  #### ------------------------ ##AT_SETUP([datarootdir workaround])AT_DATA([Foo.in],[@datadir@@docdir@@infodir@@localedir@@mandir@])AT_DATA([Bar.in],[@mydatadir@])AT_DATA([configure.ac],[[AC_INITd@&t@nl The following line silences the warnings, if uncommented:d@&t@nl AC_DEFUN([AC_DATAROOTDIR_CHECKED])AC_CONFIG_AUX_DIR($top_srcdir/config)# This substitution is wrong and bogus!  Don't use it in your own code!# Read `info Autoconf "Defining Directories"'!AC_SUBST([mydatadir], [${datadir}/my])AC_CONFIG_FILES([Foo Bar])AC_OUTPUT]])AT_CHECK_AUTOCONFAT_CHECK_CONFIGURE([], [], [],  [config.status: WARNING:  Foo.in seems to ignore the --datarootdir settingconfig.status: WARNING: Bar contains a reference to the variable `datarootdir'which seems to be undefined.  Please make sure it is defined.])AT_CHECK([grep datarootdir Foo], 1, [])rm configuresed '/AC_DEFUN/s/^d@&t@nl //' configure.ac >tmv t configure.acAT_CHECK_AUTOCONFAT_CHECK_CONFIGUREAT_CLEANUP## -------- #### srcdir.  #### -------- ##AT_SETUP([srcdir])rm -f -r at-dirmkdir at-dir: >at-dir/bar.in: >foo.inAT_DATA([configure.ac],[[AC_INITAC_CONFIG_FILES([foo at-dir/bar])AC_CONFIG_COMMANDS([report],[test -f $srcdir/configure.ac ||   AC_MSG_ERROR([cannot find $srcdir/configure.ac])],		   [srcdir=$srcdir])AC_OUTPUTrm -f -r foo at-dir/bar]])AT_CHECK_AUTOCONF# In place.AT_CHECK([./configure], [], [ignore])# Relative name.AT_CHECK([cd at-dir && ../configure], [], [ignore])# Absolute name.at_here=`pwd`AT_CHECK([cd at-dir && "$at_here/configure"], [], [ignore])AT_CLEANUP## ----------------- #### Signal handling.  #### ----------------- ##AT_SETUP([Signal handling])AT_DATA([configure.ac],[[AC_INITkill -2 $$exit 77]])AT_CHECK_AUTOCONFAT_CHECK_CONFIGURE([], 1, ignore, ignore)AT_CLEANUPAT_BANNER([autoreconf.])## ---------------------------- #### Configuring subdirectories.  #### ---------------------------- ### .# |-- builddir# |   |-- config.log# |   |-- config.status# |   `-- inner# |       |-- config.log# |       |-- config.status# |       `-- innermost# |           `-- config# |-- configure# |-- configure.ac# |-- inner# |   |-- configure# |   |-- configure.ac# |   `-- innermost# |       `-- config.in# `-- install-sh#AT_SETUP([Configuring subdirectories])AT_KEYWORDS(autoreconf)# We use aclocal (via autoreconf).AT_CHECK([aclocal --version || exit 77], [], [stdout], [ignore])# It should understand configure.ac.AT_CHECK([[grep '1.[01234]' stdout && exit 77]], [1], [ignore])# The contents of `inner/', and `inner/innermost/'.AS_MKDIR_P([inner/innermost])# We have to use configure.in, not configure.ac, if we still want to# be compatible with Automake 1.4: aclocal (run by autoreconf) would# die because it can't find configure.in.AT_DATA([inner/configure.in],[[AC_INIT(GNU Inner, 1.0)AC_CONFIG_SRCDIR([innermost/config.in])AC_ARG_VAR([INNER], [an inner variable])AC_SUBST([INNER])if test "x$INNER" = x; then  INNER=innerfiAC_CONFIG_FILES([innermost/config])AC_OUTPUT]])AT_DATA([inner/innermost/config.in],[INNER=@INNER@srcdir=@srcdir@top_srcdir=@top_srcdir@prefix=@prefix@])# The contents of `.'AT_DATA([install-sh], [])# nonexistent is allowed not to exist.AT_DATA([configure.in],[[AC_INIT(GNU Outer, 1.0)AC_ARG_VAR([OUTER], [an outer variable])if false; then  AC_CONFIG_SUBDIRS([nonexistent])fiAC_CONFIG_SUBDIRS([inner])AC_OUTPUT]])# If there are improperly quoted AC_DEFUN installed in share/aclocal,# they trigger warnings from aclocal 1.8, so ignore stderr.AT_CHECK([autoreconf], [], [], [ignore])AT_CHECK([test -f inner/configure])# Running the outer configure recursively should provide the innermost# help strings.AT_CHECK([./configure --help=recursive | grep INNER], 0, [ignore])# Running the outer configure should trigger the inner.AT_CHECK_CONFIGUREAT_CHECK([cat inner/innermost/config], 0,[INNER=innersrcdir=.top_srcdir=..prefix=/usr/local])# The same, but from a builddir.AS_MKDIR_P([builddir])AT_CHECK([cd builddir && ../configure], 0, [ignore])AT_CHECK([cat builddir/inner/innermost/config], 0,[INNER=innersrcdir=../../../inner/innermosttop_srcdir=../../../innerprefix=/usr/local])# Make sure precious variables and command line options are properly# passed, even when there are duplicates.  Run another directory so# that if the user has set config.site to have a config.cache, then# the two runs don't have colliding caches.AS_MKDIR_P([builddir2])AT_CHECK([cd builddir2 && ../configure --prefix /bad --prefix /good INNER=bad INNER=good], 0, [ignore])AT_CHECK([cat builddir2/inner/innermost/config], 0,[INNER=goodsrcdir=../../../inner/innermosttop_srcdir=../../../innerprefix=/good])# Make sure we can run autoreconf on a subdirectoryrm -f configure configure.inAT_CHECK([autoreconf inner], [], [], [ignore])# Make sure we can pass a configure.ac nameAT_CHECK([cd inner && autoreconf configure.in], [], [], [ignore])AT_CHECK([autoreconf inner/configure.in], [], [], [ignore])AT_CLEANUP## -------------- #### Deep Package.  #### -------------- ##AT_SETUP([Deep Package])AT_KEYWORDS(autoreconf)# We use aclocal (via autoreconf).AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])# The contents of `.'AT_DATA([install-sh], [])AT_DATA([configure.in],[[AC_INIT(GNU Outer, 1.0)AC_ARG_VAR([OUTER], [an outer variable])AC_CONFIG_SUBDIRS([inner])AC_OUTPUT]])# The contents of `inner/', and `inner/innermost/'.AS_MKDIR_P([inner/innermost])AT_DATA([inner/configure.in],[[AC_INIT(GNU Inner, 1.0)AC_ARG_VAR([INNER], [an inner variable])AC_CONFIG_SUBDIRS(innermost)AC_OUTPUT]])AT_DATA([inner/innermost/configure.in],[[AC_INIT(GNU Innermost, 1.0)AC_ARG_VAR([INNERMOST], [an innermost variable])AC_CONFIG_HEADERS(config.h:config.hin)AC_DEFINE_UNQUOTED([INNERMOST], [$INNERMOST], [an innermost variable])AC_OUTPUT]])AT_CHECK([autoreconf -Wall -v], [0], [ignore], [ignore])AT_CHECK([test -f inner/configure])AT_CHECK([test -f inner/innermost/configure])AT_CHECK([test -f inner/innermost/config.hin])# Running the outer configure recursively should provide the innermost# help strings.AT_CHECK([./configure --help=recursive | grep " INNER "],     0, [ignore])AT_CHECK([./configure --help=recursive | grep " INNERMOST "], 0, [ignore])# Running the outer configure should trigger the inner.AT_CHECK_CONFIGURE([INNERMOST=tsomrenni])AT_CHECK([grep INNERMOST inner/innermost/config.h], 0,[[#define INNERMOST tsomrenni]])# The same, but from a builddir.AS_MKDIR_P([builddir])AT_CHECK([cd builddir && ../configure INNERMOST=build/tsomrenni], 0, [ignore])AT_CHECK([grep INNERMOST builddir/inner/innermost/config.h], 0,[[#define INNERMOST build/tsomrenni]])AT_CLEANUP## -------------------------------- #### Non-Autoconf AC_CONFIG_SUBDIRS.  #### -------------------------------- ##AT_SETUP([Non-Autoconf AC_CONFIG_SUBDIRS])AT_KEYWORDS([autoreconf])# We use aclocal (via autoreconf).AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])AT_DATA([install-sh], [])AT_DATA([configure.in],[[AC_INIT(GNU Outer, 1.0)AC_CONFIG_SUBDIRS([inner])AC_OUTPUT]])AS_MKDIR_P([inner])AT_DATA([inner/configure],[[#! /bin/shcase "$*" in    *--help*) echo 'No Autoconf here, folks!' ;;    *)        echo got_it >myfile ;;esacexit 0]])chmod +x inner/configureAT_CHECK([autoreconf -Wall -v], 0, [ignore], [ignore])# Running the outer configure recursively should provide the innermost# help strings.AT_CHECK([./configure --help=recursive | grep "folks"], 0, [ignore])# Running the outer configure should trigger the inner.AT_CHECK([./configure], 0, [ignore])AT_CHECK([test -f inner/myfile], 0)AT_CLEANUP## ----------------- #### Empty directory.  #### ----------------- ##AT_SETUP([Empty directory])AT_KEYWORDS([autoreconf])# We use aclocal (via autoreconf).AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])# The test group directory is not necessarily _empty_, but it does not contain# files meaningful to `autoreconf'.AT_CHECK([autoreconf -Wall -v], 1, [ignore], [ignore])AT_CLEANUP## ------------------------------ #### Unusual Automake input files.  #### ------------------------------ ### This parallels gnumake.test in Automake.AT_SETUP([Unusual Automake input files])AT_KEYWORDS([autoreconf])# We use aclocal and automake via autoreconf.AT_CHECK([automake --version || exit 77], [], [ignore], [ignore])AT_DATA([configure.in],[[AC_INIT(GNU foo, 1.0)AM_INIT_AUTOMAKEAC_CONFIG_FILES([HeeHee])AC_OUTPUT]])AT_DATA([HeeHee.am],[[# Humans do no worse than `GNUmakefile.am'.AUTOMAKE_OPTIONS = foreign 1.8]])AT_CHECK([autoreconf -Wall -v -i], 0, [ignore], [stderr],	 [AT_CHECK([grep 'require.*1\.8' stderr && exit 77], [1])])AT_CHECK([test -f HeeHee.in])AT_CLEANUP

⌨️ 快捷键说明

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