Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/proj/en/qa: automagic.xml
Date: Wed, 01 Jun 2011 23:23:16
Message-Id: 20110601232301.B31FD20054@flycatcher.gentoo.org
1 flameeyes 11/06/01 23:23:01
2
3 Modified: automagic.xml
4 Log:
5 Update guide improving the autotools code in it.
6
7 Not only the code was using if/fi conditionals (which can conflict
8 with pkg-config macros depending on the project), but it was using the
9 == comparison bashism.
10
11 Fix both so that the code is more compliant with proper autotools.
12
13 Also rewrite the note about using cache values to work around the
14 issues.
15
16 Revision Changes Path
17 1.7 xml/htdocs/proj/en/qa/automagic.xml
18
19 file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/en/qa/automagic.xml?rev=1.7&view=markup
20 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/en/qa/automagic.xml?rev=1.7&content-type=text/plain
21 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/en/qa/automagic.xml?r1=1.6&r2=1.7
22
23 Index: automagic.xml
24 ===================================================================
25 RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/en/qa/automagic.xml,v
26 retrieving revision 1.6
27 retrieving revision 1.7
28 diff -u -r1.6 -r1.7
29 --- automagic.xml 8 Nov 2008 08:41:18 -0000 1.6
30 +++ automagic.xml 1 Jun 2011 23:23:01 -0000 1.7
31 @@ -1,12 +1,12 @@
32 <?xml version="1.0" encoding="UTF-8"?>
33 <!DOCTYPE guide SYSTEM "http://www.gentoo.org/dtd/guide.dtd">
34 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/qa/automagic.xml,v 1.6 2008/11/08 08:41:18 serkan Exp $ -->
35 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/qa/automagic.xml,v 1.7 2011/06/01 23:23:01 flameeyes Exp $ -->
36
37 <guide link="/proj/en/qa/automagic.xml" lang="en">
38 <title>Automagic dependencies, what they are and how to fix them</title>
39
40 <author title="Author">
41 - <mail link="flameeyes@g.o">Diego Pettenò</mail>
42 + <mail link="flameeyes@g.o">Diego Elio Pettenò</mail>
43 </author>
44 <author title="Author">
45 <mail link="serkan@g.o">Serkan Kaba</mail>
46 @@ -21,8 +21,8 @@
47 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
48 <license/>
49
50 -<version>0.2</version>
51 -<date>2008-11-07</date>
52 +<version>0.3</version>
53 +<date>2011-06-01</date>
54
55 <chapter> <!-- Introduction -->
56 <title>Introduction</title>
57 @@ -169,17 +169,17 @@
58 <pre caption="Adding an enabled-by-default check for an optional dependency">
59 <i>AC_ARG_WITH([foo], AS_HELP_STRING([--without-foo], [Build without foo library (default: test)]))</i>
60
61 -<i>if test "x$with_foo" != "xno"; then</i>
62 +<i>AS_IF([test "x$with_foo" != "xno"], [</i>
63 PKG_CHECK_MODULES([FOO], [foo >= 0.1])
64 -<i>fi</i>
65 +<i>])</i>
66 </pre>
67
68 <pre caption="Adding a disabled-by-default check for an optional dependency">
69 <i>AC_ARG_WITH([foo], AS_HELP_STRING([--with-foo], [Build with foo library (default: disabled)]))</i>
70
71 -<i>if test "x$with_foo" == "xyes"; then</i>
72 +<i>AS_IF([test "x$with_foo" = "xyes"], [</i>
73 PKG_CHECK_MODULES([FOO], [foo >= 0.1])
74 -<i>fi</i>
75 +<i>])</i>
76 </pre>
77
78 <p>
79 @@ -199,13 +199,11 @@
80 </warn>
81
82 <p>
83 -There's actually another way to workaround, without fixing (and patching), the
84 -automagic dependencies generated by <b>AC_CHECK_LIB</b>, and it's by playing
85 -around with the cache values used by <c>autoconf</c>. This method is actually
86 -deprecated because it does not fix the issue to the roots and might create
87 -problems if upstream changes the tests a bit using a different cache variable
88 -name. Also, in this way fixes can't be sent upstream for integration in later
89 -versions.
90 +While it is possible to work around the issue of automagic dependencies without
91 +patching <c>configure.ac</c>, by messing with the autoconf cache values, this
92 +method is not recommended. This does not fix the original issue, and cannot be
93 +sent upstream for integration in new versions, and can actually conflict when
94 +tests are slightly different between environments.
95 </p>
96
97 </body>