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

📄 tools.at

📁 autoconf是一个产生可以自动配置源代码包
💻 AT
📖 第 1 页 / 共 2 页
字号:
#							-*- Autotest -*-AT_BANNER([Executables (autoheader, autoupdate...).])# Copyright (C) 2000, 2001, 2003, 2004, 2006 Free Software Foundation, Inc.## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA# 02110-1301, USA.## ----------------------------- #### Syntax of the shell scripts.  #### ----------------------------- ### We use `/bin/sh -n script' to check that there are no syntax errors# in the scripts.  Although incredible, there are /bin/sh that go into# endless loops with `-n', e.g., SunOS's:##   $ uname -a#   SunOS ondine 4.1.3 2 sun4m unknown#   $ cat endless.sh#   while false#   do#     :#   done#   exit 0#   $ time sh endless.sh#   sh endless.sh  0,02s user 0,03s system 78% cpu 0,064 total#   $ time sh -nx endless.sh#   ^Csh -nx endless.sh  3,67s user 0,03s system 63% cpu 5,868 total## So before using `/bin/sh -n' to check our scripts, we first check# that `/bin/sh -n' is not broken to death.AT_SETUP([Syntax of the shell scripts])AT_CHECK([test "$ac_cv_sh_n_works" = yes || exit 77])# Specify the absolute name of the tool, as some shells don't honor PATH when# running `sh PROG'.AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/bin/autoconf])AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/autoconf])AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/testsuite])# These are not built, they are in the src tree.AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/install-sh])AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/mkinstalldirs])AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/missing])AT_CLEANUP## ---------------------------- #### Syntax of the Perl scripts.  #### ---------------------------- ##AT_SETUP([Syntax of the Perl scripts])AT_CHECK_PERL_SYNTAX([autoheader])AT_CHECK_PERL_SYNTAX([autom4te])AT_CHECK_PERL_SYNTAX([autoreconf])AT_CHECK_PERL_SYNTAX([autoscan])AT_CHECK_PERL_SYNTAX([autoupdate])AT_CHECK_PERL_SYNTAX([ifnames])AT_CLEANUP## ------------------ #### autom4te's cache.  #### ------------------ ##AT_SETUP([autom4te cache])AT_DATA_M4SUGAR([[script.4s]],[[m4_include([foo])]])# Everything is OK.touch fooAT_CHECK_M4SUGAR# We moved a file: it should failmkdir submv foo subAT_CHECK_M4SUGAR([], [1], [],[m4: script.4s: 1: Cannot open foo: No such file or directoryautom4te: m4 failed with exit status: 1])# But if we change the main file, then we should no longer complain of# missing files.AT_DATA_M4SUGAR([[script.4s]],[[m4_include([sub/foo])]])AT_CHECK_M4SUGARAT_CLEANUP## ------------------ #### autoconf --trace.  #### ------------------ ### autoconf --trace: user macros# -----------------------------AT_SETUP([autoconf --trace: user macros])AT_DATA([configure.ac],[[m4_define([active], [ACTIVE])m4_define([TRACE1], [TRACE2(m4_shift($@))])m4_define([TRACE2], [[$2], $1])# No arguments.TRACE1TRACE2# With arguments, single line.TRACE1(foo, @bar, @baz)TRACE1(foo, TRACE1(bar, baz))TRACE1(foo, active, baz)TRACE1(foo, [active], TRACE1(active, [active]))# With arguments, multiple lines.TRACE1(foobar,barfoo)]])# Several --traces.AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,[[configure.ac:6:TRACE1:configure.ac:6:TRACE2:configure.ac:7:TRACE2:configure.ac:10:TRACE1:foo:@bar:@bazconfigure.ac:10:TRACE2:@bar:@bazconfigure.ac:11:TRACE1:bar:bazconfigure.ac:11:TRACE2:bazconfigure.ac:11:TRACE1:foo::bazconfigure.ac:11:TRACE2::bazconfigure.ac:12:TRACE1:foo:ACTIVE:bazconfigure.ac:12:TRACE2:ACTIVE:bazconfigure.ac:13:TRACE1:ACTIVE:activeconfigure.ac:13:TRACE2:activeconfigure.ac:13:TRACE1:foo:active::ACTIVEconfigure.ac:13:TRACE2:active::ACTIVEconfigure.ac:19:TRACE1:foo bar:bar fooconfigure.ac:19:TRACE2:bar foo]])# Several line requests.AT_CHECK_AUTOCONF([[-t TRACE1:'[$1], [$2], [$3].']], 0,[[[], [], [].[foo], [@bar], [@baz].[bar], [baz], [].[foo], [], [baz].[foo], [ACTIVE], [baz].[ACTIVE], [active], [].[foo], [active], [].[foobar], [barfoo], [].]])# ${sep}@.AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,[[[][][@bar])===([@baz][baz][])===([baz][ACTIVE])===([baz][active][active])===([])===([ACTIVE][barfoo]]])AT_CLEANUP# autoconf --trace: builtins# --------------------------AT_SETUP([autoconf --trace: builtins])AT_DATA([configure.ac],[[define([active], [ACTIVE])]])AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],	 0,[[configure.ac:1:define:active:ACTIVE]])# FIXME: Without `$1' the following test dies.  Groumphf, once again to# dive into obscure feature interaction...# Note that using `-i' means we need the *.m4 files, not the *.m4f files,# hence we need srcdir, not builddir.AT_CHECK_AUTOCONF([[-t define:'$1' -i| sed -n '$p']],	 0,[[active]])AT_CLEANUP## ---------------------------- #### autoconf: forbidden tokens.  #### ---------------------------- ### autoconf: forbidden tokens, basic# ---------------------------------AT_SETUP([autoconf: forbidden tokens, basic])AT_DATA_M4SH([configure.ac],[[AS_INITm4_foo_m4_barAS_FOO_AS_BAR[dnl]]])AT_CHECK_AUTOCONF([], 1, [],[[configure.ac:2: error: possibly undefined macro: m4@&t@_foo      If this token and others are legitimate, please use m4@&t@_pattern_allow.      See the Autoconf documentation.configure.ac:3: error: possibly undefined macro: _m4@&t@_barconfigure.ac:4: error: possibly undefined macro: AS@&t@_FOOconfigure.ac:5: error: possibly undefined macro: _AS@&t@_BARconfigure.ac:6: error: possibly undefined macro: d@&t@nl]])AT_CLEANUP# autoconf: forbidden tokens, exceptions# --------------------------------------AT_SETUP([autoconf: forbidden tokens, exceptions])AT_DATA_M4SH([configure.ac],[[AS_INIT# This is allowed in spite of the name.# It is on purpose that we check the case where there are several# tokens on the same line.m4_pattern_allow([^AS_ALLOWED$])NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT# Test forbidding.m4_pattern_forbid([^FORBIDDEN$])NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT# Test Autoconf's patterns.AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOOBUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS# This is legal, although there is `AS_DEFINE' in there.BAS_DEFINE# AS_THIS_IS_A_COMMENT so just shut up.It would be very bad if Autoconf forgot to expand [AS_]INIT!]])AT_CHECK_AUTOCONF([], 1, [],[[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT      If this token and others are legitimate, please use m4@&t@_pattern_allow.      See the Autoconf documentation.configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOTconfigure.ac:10: error: possibly undefined macro: FORBIDDENconfigure.ac:14: error: possibly undefined macro: AS@&t@_THIS_IS_INVALIDconfigure.ac:14: error: possibly undefined macro: _AS@&t@_THIS_IS_INVALID_TOO]])AT_CLEANUP# autoconf: automatically allowed tokens# --------------------------------------AT_SETUP([autoconf: automatically allowed tokens])AT_DATA_M4SH([configure.ac],[[AC_INITm4_pattern_forbid([^FB_])AC_DEFINE([FB_ONE])AC_SUBST([FB_TWO])AC_OUTPUT]])AT_CHECK_AUTOCONFAT_CLEANUP# autoconf: do not forbid the empty token# ---------------------------------------AT_SETUP([autoconf: the empty token])AT_DATA_M4SH([configure.ac],[[m4_pattern_allow([^foo$])m4_divert([0])dnl line that begins with a space]])AT_CHECK_AUTOCONFAT_CLEANUP# autoconf: subdirectories# ------------------------AT_SETUP([autoconf: subdirectories])AT_DATA([configure.ac],[[AC_INITAC_PROG_MKDIR_PAC_CONFIG_FILES(sub/foo)AC_OUTPUT]])mkdir subAT_DATA([sub/foo.in],[[@MKDIR_P@]])AT_DATA([install-sh])AT_CHECK_AUTOCONFAT_CHECK_CONFIGUREAT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)AT_CLEANUP## --------- #### ifnames.  #### --------- ##AT_SETUP([ifnames])AT_DATA([iftest1.c],[[#ifdef DEF1#ifndef DEF2#if ! defined DEF3 && defined DEF4 /* but not defined DEF5 */    # if SPACES	#	if	TABS/* #if C_COMMENTS */// #if CXX_COMMENTS#if LINE1 = \LINE2#if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */]])AT_DATA([iftest2.c],[[#ifdef IFTEST2#if VAL1]])AT_CHECK([ifnames iftest1.c iftest2.c], 0,[DEF1 iftest1.cDEF2 iftest1.cDEF3 iftest1.cDEF4 iftest1.cIFTEST2 iftest2.cLINE1 iftest1.cLINE2 iftest1.cSPACES iftest1.cTABS iftest1.cVAL1 iftest1.c iftest2.cVAL2 iftest1.c

⌨️ 快捷键说明

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