public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/
@ 2014-03-08 14:53 Markos Chandras
  0 siblings, 0 replies; 7+ messages in thread
From: Markos Chandras @ 2014-03-08 14:53 UTC (permalink / raw
  To: gentoo-commits

commit:     9a778ae5bf5369f04ab5493bfc1e6bc84b4e5b51
Author:     Uwe L. Korn <uwelk <AT> xhochy <DOT> com>
AuthorDate: Fri Mar  7 19:41:15 2014 +0000
Commit:     Markos Chandras <hwoarang <AT> gentoo <DOT> org>
CommitDate: Fri Mar  7 19:41:15 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit;h=9a778ae5

Link to toolchain-funcs.eclass in src_compile/building

---
 ebuild-writing/functions/src_compile/building/text.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml
index 700f0f1..bed3dd7 100644
--- a/ebuild-writing/functions/src_compile/building/text.xml
+++ b/ebuild-writing/functions/src_compile/building/text.xml
@@ -34,7 +34,7 @@ some MIPS and SPARC systems.
 <p>
 Sometimes a package will try to use a bizarre compiler, or will need to be told
 which compiler to use. In these situations, the <c>tc-getCC()</c> function from
-<c>toolchain-funcs.eclass</c> should be used. Other similar functions are available
+<uri link="::eclass-reference/toolchain-funcs.eclass/">toolchain-funcs.eclass</uri> should be used. Other similar functions are available
 <d/> these are documented in <c>man toolchain-funcs.eclass</c>.
 </p>
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/
@ 2021-01-03 14:18 Ulrich Müller
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Müller @ 2021-01-03 14:18 UTC (permalink / raw
  To: gentoo-commits

commit:     9612233e20944cb719690da2cc79586a538afd15
Author:     Alexey Sokolov <sokolov <AT> google <DOT> com>
AuthorDate: Thu Nov 26 00:39:09 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jan  3 14:17:41 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=9612233e

src_compile/building: Change example with bug 685160 #c9 in mind

Closes: https://github.com/gentoo/devmanual/pull/181
Signed-off-by: Alexey Sokolov <sokolov <AT> google.com>
[Delete build.sh example because it is not used afterwards.
The note refers to sed usage in the codesample so keep it below.]
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 .../functions/src_compile/building/text.xml        | 25 +++++++++++++++-------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml
index 4245c5f..696dacf 100644
--- a/ebuild-writing/functions/src_compile/building/text.xml
+++ b/ebuild-writing/functions/src_compile/building/text.xml
@@ -47,27 +47,36 @@ It is <e>not</e> correct to use the <c>${CC}</c> variable for this purpose.
 Sometimes a package will not use the user's <c>${CFLAGS}</c> or <c>${LDFLAGS}</c>.
 This must be worked around, as sometimes these variables are used for specifying
 critical ABI options. In these cases, the build scripts should be modified (for
-example, with <c>sed</c>) to use <c>${CFLAGS}</c> or <c>${LDFLAGS}</c> correctly.
+example, with <c>sed</c> or via a patch) to use <c>${CFLAGS}</c> or
+<c>${LDFLAGS}</c> correctly.
 </p>
 
 <codesample lang="ebuild">
 inherit flag-o-matic toolchain-funcs
 
+src_prepare() {
+	default
+
+	# We have a weird Makefile to work with which ignores our
+	# compiler preferences. yay!
+	# Note the single quotes.
+	sed -i -e 's:cc -O2:$(CC) $(CFLAGS) $(LDFLAGS):' Makefile \
+		|| die "sed fix failed. Uh-oh..."
+}
+
 src_compile() {
 	# -Os not happy
 	replace-flags -Os -O2
 
-	# We have a weird build.sh to work with which ignores our
-	# compiler preferences. yay!
-	sed -i -e "s:cc -O2:$(tc-getCC) ${CFLAGS} ${LDFLAGS}:" build.sh \
-		|| die "sed fix failed. Uh-oh..."
-	./build.sh || die "Build failed!"
+	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
 }
 </codesample>
 
 <note>
-When using <c>sed</c> with <c>CFLAGS</c> or <c>LDFLAGS</c>, it is not safe to use
-a comma or a slash as a delimiter. The recommended character is a colon.
+Try to not substitute the value with <c>sed</c> directly, but instead make the
+build script use the variables. The variables may contain characters such as a
+slash, a comma, or a colon, which are often used with <c>sed</c>, and this
+would break its syntax.
 </note>
 
 <p>


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/
@ 2021-03-29 20:44 Ulrich Müller
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Müller @ 2021-03-29 20:44 UTC (permalink / raw
  To: gentoo-commits

commit:     d8066eee52eddd73dee6f1d16fbce0d124701baa
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 20 09:55:09 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Mar 29 20:41:36 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=d8066eee

ebuild-writing/functions/src_compile/building: note that the delimiter is OK

Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ebuild-writing/functions/src_compile/building/text.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml
index 696dacf..fcde02e 100644
--- a/ebuild-writing/functions/src_compile/building/text.xml
+++ b/ebuild-writing/functions/src_compile/building/text.xml
@@ -59,7 +59,7 @@ src_prepare() {
 
 	# We have a weird Makefile to work with which ignores our
 	# compiler preferences. yay!
-	# Note the single quotes.
+	# Note the single quotes (hence the delimiter is not an issue)
 	sed -i -e 's:cc -O2:$(CC) $(CFLAGS) $(LDFLAGS):' Makefile \
 		|| die "sed fix failed. Uh-oh..."
 }


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/
@ 2021-06-15  8:20 Ulrich Müller
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Müller @ 2021-06-15  8:20 UTC (permalink / raw
  To: gentoo-commits

commit:     7f2ae3ccb2158e06fed1eeee5fbae4d0779120d8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 10 01:32:20 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Jun 15 08:20:07 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=7f2ae3cc

ebuild-writing/functions/src_compile/building: add ${CPPFLAGS} to cc invocation

Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ebuild-writing/functions/src_compile/building/text.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml
index fcde02e..c9ca6ed 100644
--- a/ebuild-writing/functions/src_compile/building/text.xml
+++ b/ebuild-writing/functions/src_compile/building/text.xml
@@ -60,7 +60,7 @@ src_prepare() {
 	# We have a weird Makefile to work with which ignores our
 	# compiler preferences. yay!
 	# Note the single quotes (hence the delimiter is not an issue)
-	sed -i -e 's:cc -O2:$(CC) $(CFLAGS) $(LDFLAGS):' Makefile \
+	sed -i -e 's:cc -O2:$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS):' Makefile \
 		|| die "sed fix failed. Uh-oh..."
 }
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/
@ 2021-06-15  8:25 Ulrich Müller
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Müller @ 2021-06-15  8:25 UTC (permalink / raw
  To: gentoo-commits

commit:     dfdaa4e2f10f4b223516b4f4f8608a8f9e479986
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 15 08:24:51 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Jun 15 08:24:51 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=dfdaa4e2

ebuild-writing/functions/src_compile/building: Pass CPPFLAGS to emake

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ebuild-writing/functions/src_compile/building/text.xml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml
index c9ca6ed..0f332b9 100644
--- a/ebuild-writing/functions/src_compile/building/text.xml
+++ b/ebuild-writing/functions/src_compile/building/text.xml
@@ -68,7 +68,10 @@ src_compile() {
 	# -Os not happy
 	replace-flags -Os -O2
 
-	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+	emake CC="$(tc-getCC)" \
+		CPPFLAGS="${CPPFLAGS}" \
+		CFLAGS="${CFLAGS}" \
+		LDFLAGS="${LDFLAGS}"
 }
 </codesample>
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/
@ 2021-08-01  2:30 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2021-08-01  2:30 UTC (permalink / raw
  To: gentoo-commits

commit:     c2b640b7160e0ad1920649618126136da1d2be97
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  1 02:23:58 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug  1 02:23:58 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=c2b640b7

ebuild-writing/functions/src_compile/building: minor phrasing fix

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ebuild-writing/functions/src_compile/building/text.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml
index 0f332b9..f78c482 100644
--- a/ebuild-writing/functions/src_compile/building/text.xml
+++ b/ebuild-writing/functions/src_compile/building/text.xml
@@ -20,9 +20,9 @@ cleanly, it should be patched.
 
 <p>
 If patching <e>really</e> isn't an option, <c>emake -j1</c> should be
-used. However, when doing this please remember that you are seriously
+used. However, when doing this, please remember that you are seriously
 hurting build times for many non-x86 users in particular. Forcing
-a <c>-j1</c> can increase build times from a few minutes to an hour on
+<c>-j1</c> can increase build times from a few minutes to an hour on
 some MIPS and SPARC systems.
 </p>
 </body>


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/
@ 2021-08-14  1:43 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2021-08-14  1:43 UTC (permalink / raw
  To: gentoo-commits

commit:     d0bced7586bcab1a00a8db11baae895bd4f0a646
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  1 02:28:43 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug 14 01:42:58 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=d0bced75

ebuild-writing/functions/src_compile/building: don't call CC directly

Bug: https://bugs.gentoo.org/243502
Bug: https://bugs.gentoo.org/726034
Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/devmanual/pull/243
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ebuild-writing/functions/src_compile/building/text.xml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml
index f78c482..e1887ab 100644
--- a/ebuild-writing/functions/src_compile/building/text.xml
+++ b/ebuild-writing/functions/src_compile/building/text.xml
@@ -39,6 +39,15 @@ Other similar functions are available <d/> these are documented in
 <c>man toolchain-funcs.eclass</c>.
 </p>
 
+<p>
+Note that packages should always respect the user's <c>CC</c> preference
+and must not rely on convenience symlinks such as <c>/usr/bin/cc</c>
+or <c>/usr/bin/gcc</c>. A tracker <uri link="https://bugs.gentoo.org/243502">
+bug</uri> exists to document such issues. Additional documentation exists on the
+<uri link="https://wiki.gentoo.org/wiki/Project:Toolchain/use_native_symlinks">
+wiki</uri>.
+</p>
+
 <note>
 It is <e>not</e> correct to use the <c>${CC}</c> variable for this purpose.
 </note>


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-14  1:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-15  8:25 [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_compile/building/ Ulrich Müller
  -- strict thread matches above, loose matches on Subject: below --
2021-08-14  1:43 Sam James
2021-08-01  2:30 Sam James
2021-06-15  8:20 Ulrich Müller
2021-03-29 20:44 Ulrich Müller
2021-01-03 14:18 Ulrich Müller
2014-03-08 14:53 Markos Chandras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox