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

📄 tools.at

📁 autoconf是一个产生可以自动配置源代码包
💻 AT
📖 第 1 页 / 共 2 页
字号:
VAL3 iftest1.cVAL4 iftest1.c], [])AT_CLEANUP## ------------ #### autoheader.  #### ------------ ### autoheader is intensively used in its modern form throughout this# test suite.  But we also have to check that acconfig.h still works.# autoheader uses autoconf --trace, so traces first.AT_SETUP([autoheader])AT_DATA([acconfig.h],[[/* Define this to whatever you want. */#undef this]])# 1. Check that `acconfig.h' is still honored.AT_DATA([configure.ac],[[AC_INITAC_CONFIG_HEADERS(config.h:config.hin)AC_DEFINE(this, "whatever you want.")]])AT_CHECK_AUTOHEADER([], [], [], [ignore])AT_CHECK([cat config.hin], 0,[[/* config.hin.  Generated from configure.ac by autoheader.  *//* Define this to whatever you want. */#undef this/* Define to the address where bug reports for this package should be sent. */#undef PACKAGE_BUGREPORT/* Define to the full name of this package. */#undef PACKAGE_NAME/* Define to the full name and version of this package. */#undef PACKAGE_STRING/* Define to the one symbol short name of this package. */#undef PACKAGE_TARNAME/* Define to the version of this package. */#undef PACKAGE_VERSION]])# 2. Check that missing templates are a fatal error.AT_DATA([configure.ac],[[AC_INITAC_CONFIG_HEADERS(config.h:config.hin)AC_DEFINE(that, "whatever you want.")]])# The test suite goes too fast for the cache time stamps...# Pass --force.AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])# 3. Check TOP and BOTTOM.AT_DATA([acconfig.h],[[/* Top from acconfig.h. */@TOP@/* Middle from acconfig.h. */@BOTTOM@/* Bottom from acconfig.h. */]])AT_DATA([configure.ac],[[AC_INITAC_CONFIG_HEADERS(config.h:config.hin)AH_TOP([Top1 from configure.ac.])AH_TOP([Top2 from configure.ac.])AH_TOP([The Cat in a h@t.])AH_VERBATIM([Middle], [Middle from configure.ac.])AH_VERBATIM([Mouse],  [The Mouse in a h@t.])AH_BOTTOM([Bottom1 from configure.ac.])AH_BOTTOM([Bottom2 from configure.ac.])AH_BOTTOM([The Dog in a h@t.])AC_DEFINE([ANT], [@], [The Ant in a h@t.])]])# Yes, that's right: the `middle' part of `acconfig.h' is still before# the AH_TOP part.  But so what, you're not supposed to use the two# together.# Ignore STDERR which is the longuish complaint against autoheader junk# files.AT_CHECK_AUTOHEADER([--force], [], [], [ignore])AT_CHECK([cat config.hin], 0,[[/* config.hin.  Generated from configure.ac by autoheader.  *//* Top from acconfig.h. *//* Middle from acconfig.h. */Top1 from configure.ac.Top2 from configure.ac.The Cat in a h@t./* The Ant in a h@t. */#undef ANTMiddle from configure.ac.The Mouse in a h@t./* Define to the address where bug reports for this package should be sent. */#undef PACKAGE_BUGREPORT/* Define to the full name of this package. */#undef PACKAGE_NAME/* Define to the full name and version of this package. */#undef PACKAGE_STRING/* Define to the one symbol short name of this package. */#undef PACKAGE_TARNAME/* Define to the version of this package. */#undef PACKAGE_VERSIONBottom1 from configure.ac.Bottom2 from configure.ac.The Dog in a h@t./* Bottom from acconfig.h. */]])AT_CLEANUP## ------------ #### autoupdate.  #### ------------ ### Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.AT_SETUP([autoupdate])AT_DATA([configure.ac],[[AC_INIT(Test, 1.0)AC_CANONICAL_SYSTEM# The doc says 27 is a valid fubar.fubar=27AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)]])AT_DATA([expout],[[AC_INIT([Test],[1.0])AC_CANONICAL_TARGET# The doc says 27 is a valid fubar.fubar=27AC_CONFIG_FILES([Makefile])AC_CONFIG_COMMANDS([default],[echo $fubar],[fubar=$fubar])AC_OUTPUT]])# Checking `autoupdate'.AT_CHECK_AUTOUPDATEAT_CHECK([cat configure.ac], 0, [expout])# Checking that `autoupdate' is idempotentAT_CHECK_AUTOUPDATEAT_CHECK([cat configure.ac], 0, [expout])AT_CLEANUP(configure.ac~)# autoupdating AC_LINK_FILES# --------------------------AT_SETUP([autoupdating AC_LINK_FILES])AT_DATA([configure.ac],[[AC_INITAC_LINK_FILES(dst1 dst2, src1 src2)AC_OUTPUT]])AT_DATA([dst1], dst1)AT_DATA([dst2], dst2)# Checking `autoupdate'.AT_CHECK_AUTOUPDATE([], 0, [], ignore)AT_CHECK_AUTOCONFAT_CHECK_CONFIGUREAT_CHECK([cat src1], 0, [dst1])AT_CHECK([cat src2], 0, [dst2])AT_CLEANUP(src1 src2 configure.ac~)# autoupdating AC_PREREQ# ----------------------AT_SETUP([autoupdating AC_PREREQ])# Produce `AC_PREREQ(<AUTOUPDATE VERSION>)'.AT_CHECK([autoupdate --version | sed 's/.*) //;q'], 0, [stdout])autoupdate_version=`cat stdout`echo "AC_PREREQ($autoupdate_version)" >expoutAT_CHECK([echo "AC_PREREQ(1.0)" | autoupdate -],	 0, [expout], [])AT_CHECK([echo "AC_PREREQ($autoupdate_version)" | autoupdate -],	 0, [expout], [])AT_CHECK([echo "AC_PREREQ(999.99)" | autoupdate -],	 63, [], [ignore])AT_CLEANUP# autoupdating AU_ALIAS# ---------------------AT_SETUP([autoupdating AU_ALIAS])AT_DATA([configure.ac],[[AC_INITAC_DEFUN([FOO], [$#])AU_ALIAS([BAZ],[FOO])test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1AC_PROG_CCAC_STDC_HEADERSAC_OUTPUT]])# Checking `autoupdate'.AT_CHECK_AUTOUPDATEAT_CHECK_AUTOCONFAT_CHECK_CONFIGUREAT_CHECK([grep 'AC_HEADER_STDC(' configure.ac], 1, [ignore], [ignore])AT_CHECK([grep 'AC_HEADER_STDC' configure.ac], 0, [ignore], [ignore])AT_CLEANUP# autoupdating OLD to NEW# -----------------------# The example taken from the code comments.AT_SETUP([autoupdating OLD to NEW])AT_DATA([aclocal.m4],[[AU_DEFUN([OLD], [NEW([$1, $2], m4@&t@_eval([$1 + $2]))])AC_DEFUN([NEW], [echo "sum($1) = $2"])]])AT_DATA([configure.ac],[[AC_INITOLD(1, 2)NEW([0, 0], [0])]])# Checking `autoupdate'.AT_CHECK_AUTOUPDATEAT_CHECK_AUTOCONFAT_CHECK_CONFIGUREAT_CHECK([[grep 'NEW(\[1, 2], *\[3])' configure.ac]], 0, [ignore], [ignore])AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, [ignore], [ignore])AT_CLEANUP# autoupdating AC_HELP_STRING# ---------------------------AT_SETUP([autoupdating AC_HELP_STRING])AT_DATA([configure.ac],[[AC_INITAC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:])]])# Checking `autoupdate'.AT_CHECK_AUTOUPDATE([], [], [], [ignore])AT_CHECK_AUTOCONFAT_CHECK_CONFIGURE([], [], [], [ignore])AT_CHECK([[grep '\[--enable-foo], *\[foo bar]' configure.ac]], 0, [ignore], [ignore])AT_CLEANUP# autoupdating with m4sugar# -------------------------AT_SETUP([autoupdating with m4sugar])AT_DATA([aclocal.m4],[[AU_DEFUN([OLD],[m4@&t@_pushdef([foo], [bar])dn@&t@lecho "foo $1 foo"m4@&t@_popdef([foo])dn@&t@l])]])touch foo.inAT_DATA([configure.ac],[[AC_PREREQ(2.54)m4_define([gnumeric_version_epoch], [1])AC_INITOLD([ bla  bla ])AC_FOREACH([name], [n1 n2],           [echo name])AC_CHECKING([for feature])AC_MSG_RESULT_UNQUOTED([`echo done`])AC_OUTPUT([foo])]])# Checking `autoupdate'.AT_CHECK_AUTOUPDATE([], [], [], [ignore])AT_CHECK_AUTOCONFAT_CHECK_CONFIGURE([], [], [], [ignore])AT_CLEANUP# autoupdating AC_LANG_SAVE# -------------------------AT_SETUP([autoupdating AC_LANG_SAVE])AT_DATA([configure.ac],[[AC_INITAC_LANG_SAVEAC_LANG_RESTOREAC_LANG_SAVEAC_LANG_RESTORE]])# Checking `autoupdate'.AT_CHECK_AUTOUPDATE([], [], [], [ignore])AT_CHECK_AUTOCONFAT_CHECK_CONFIGURE([], [], [], [ignore])AT_CLEANUP# autoupdating AC_FOREACH# -----------------------AT_SETUP([autoupdating AC_FOREACH])AT_DATA([aclocal.m4],[[AU_DEFUN([OLD], [AC_FOREACH([myvar], [4 5 6], [' myvar'])])]])AT_DATA([configure.ac],[[AC_INITecho AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD]])# Checking `autoupdate'.AT_CHECK_AUTOUPDATEAT_CHECK([[grep 'echo 1 2 3 4 5 6' configure.ac]], 1, [ignore], [ignore])AT_CHECK([[grep 'm4@&t@_foreach_w' configure.ac]], 0, [ignore], [ignore])AT_CHECK_AUTOCONFAT_CHECK_CONFIGURE([], [0], [stdout])AT_CHECK([[grep ' 1 2 3 4 5 6' stdout]], 0, [ignore], [ignore])AT_CLEANUP# autoupdating with aclocal and m4_include# ----------------------------------------AT_SETUP([autoupdating with aclocal and m4@&t@_include])# We use aclocal.AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])mkdir m4 aclocalAT_DATA([configure.in],[[AC_INIT(x,0)AC_UNCHANGED_MACROAC_OLD_MACROAC_OUTPUT]])AT_DATA([m4/stuff.m4],[[AU_ALIAS([AC_OLD_MACRO], [AC_NEW_MACRO])AC_DEFUN([AC_NEW_MACRO], [echo hi])AC_DEFUN([AC_UNCHANGED_MACRO], [echo one])]])cp m4/stuff.m4 aclocal/stuff.m4AT_CHECK([aclocal -I aclocal], [0], [ignore], [ignore])# Checking `autoupdate'.AT_CHECK_AUTOUPDATEAT_CHECK([aclocal -I m4], [0], [ignore], [ignore])AT_CHECK_AUTOUPDATEAT_CLEANUP

⌨️ 快捷键说明

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