Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 227689 Details for
Bug 310407
Gentoo Devmanual - src_compile example for no build system is wrong
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-Fix-examples-for-src_compile-with-no-build-system.patch (text/plain), 3.05 KB, created by
Dror Levin (RETIRED)
on 2010-04-14 00:32:14 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Dror Levin (RETIRED)
Created:
2010-04-14 00:32:14 UTC
Size:
3.05 KB
patch
obsolete
>From 1576b2e41b09d7e5640f72b6302917592f731e83 Mon Sep 17 00:00:00 2001 >From: Dror Levin <spatz@gentoo.org> >Date: Wed, 14 Apr 2010 03:27:11 +0300 >Subject: [PATCH] Fix examples for src_compile with no build system > >Update code from app-misc/hilite to properly respect LDFLAGS, and >replace example from x11-plugins/gkrelltop which wrongly used gcc >instead of $(tc-getCC) with one from x11-plugins/asclock. Also add >recommendation to document reason for manually compiling. >--- > .../functions/src_compile/no-build-system/text.xml | 43 +++++++++++++------ > 1 files changed, 29 insertions(+), 14 deletions(-) > >diff --git a/ebuild-writing/functions/src_compile/no-build-system/text.xml b/ebuild-writing/functions/src_compile/no-build-system/text.xml >index 5d71708..99b873a 100644 >--- a/ebuild-writing/functions/src_compile/no-build-system/text.xml >+++ b/ebuild-writing/functions/src_compile/no-build-system/text.xml >@@ -8,36 +8,51 @@ > Occasionally some really small packages are shipped simply as a single > <c>.c</c> file. In these circumstances, you can either write your own > <c>Makefile</c> and ship it with the source tarball, or just manually >-compile the thing from within the ebuild. Here's an example, from >-<c>app-misc/hilite</c>: >+compile the thing from within the ebuild, preferebly explaining why. >+Here's an example, from <c>app-misc/hilite</c>: > </p> > > <codesample lang="ebuild"> > src_compile() { >- $(tc-getCC ) ${CFLAGS} -o ${PN} ${P}.c \ >- || die "Compile failed!" >+ $(tc-getCC) ${LDFLAGS} ${CFLAGS} -o ${PN} ${P}.c || die > } > </codesample> > > <p> >-Here's an example from <c>x11-plugins/gkrelltop</c>, which ships with a >-<c>Makefile</c> that doesn't actually work: >+Here's an example from <c>x11-plugins/asclock</c>, which ships with a >+broken build system that doesn't actually work: > </p> > > <codesample lang="ebuild"> > src_compile() { >- CONFIG="-DLINUX -DGKRELLM2 -fPIC $(pkg-config gtk+-2.0 --cflags)" >- LIBS="$(pkg-config gtk+-2.0 --libs) -shared" >- OBJS="top_three2.o gkrelltop2.o" >- >- gcc -c $CONFIG $CFLAGS top_three.c -o top_three2.o || die >- gcc -c $CONFIG $CFLAGS gkrelltop.c -o gkrelltop2.o || die >- gcc $LDFLAGS $CONFIG $CFLAGS -o gkrelltop2.so $OBJS $LIBS || die >+ local x >+ for x in asclock parser symbols config >+ do >+ $(tc-getCC) \ >+ ${CPPFLAGS} ${CFLAGS} ${ASFLAGS} \ >+ -I/usr/include \ >+ -Dlinux \ >+ -D_POSIX_C_SOURCE=199309L \ >+ -D_POSIX_SOURCE \ >+ -D_XOPEN_SOURCE \ >+ -D_BSD_SOURCE \ >+ -D_SVID_SOURCE \ >+ -DFUNCPROTO=15 \ >+ -DNARROWPROTO \ >+ -c -o ${x}.o ${x}.c || die "compile asclock failed" >+ done >+ $(tc-getCC) \ >+ ${LDFLAGS} \ >+ -o asclock \ >+ asclock.o parser.o symbols.o config.o \ >+ -L/usr/lib \ >+ -L/usr/lib/X11 \ >+ -lXpm -lXext -lX11 || die "link asclock failed" > } > </codesample> > > <p> >-A possibly better alternative would be to patch the <c>Makefile</c> >+A possibly better alternative would be to patch the build system > and send it upstream. > </p> > >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 310407
: 227689