public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Finding GCC+GCJ greater than 3.4.2
@ 2005-04-25  1:03 Jared Rhine
  2005-04-25  2:15 ` Mike Frysinger
  0 siblings, 1 reply; 2+ messages in thread
From: Jared Rhine @ 2005-04-25  1:03 UTC (permalink / raw
  To: gentoo-dev

This question relates to ebuild development, and is being asked by a
non-developer.  Apologies if there's a better forum for the question
(perhaps gentoo-toolchain?)

I've developed an ebuild for a package which requires GCJ >= 3.4.2
(GCJ is specifically required for its ability to translate Java to C
for embedding).

I run a x86-stable desktop, so my profile's basic GCC is at 3.3.5
(which was built without a GCJ use flag).  I've installed a 3.4.3 GCC
with GCJ using slots.

Are there any suggestions for how my ebuild might identify whether
there is a GCC installed, in any slot, which matches both the version
requirement (>3.4.2) and the "gcj" USE requirement?

The ebuild has this:

DEPEND="${RDEPEND} 
    >=sys-devel/gcc-3.4.2" 
 
which succeeds since that is installed.  I also have this block
commented out in my ebuild:

#pkg_setup() {
#   if [[ ! $(built_with_use gcc gcj) ]] ; then
#       eerror 'Chandler build requires that GCC be built with the "gcj" USE flag'
#       die "exiting because of GCJ dependency"
#   fi
#}

If I uncomment it, this block will fail because my 3.3.5 GCC isn't
"built_with_use" gcj and I think "best_version" (which built_with_use
uses) only looks at my 3.3.5 installation.  Even if I 'gcc-config' the
3.4.3 version, best_version still looks at my 3.3.5.

My goal is to make this ebuild find and use a working GCC if it is
present, even in the presence of slots and mixed use flags.

I'm not sure this is possible without some fairly serious scripting.
Suggestions are welcome.

One improvement might be to replace the built_with_use check with
something like a `gcc-config -B`/gcj check, and check at runtime that
it's version 3.4.2 or higher.  That seems straightforward.

I might also look at every profile returned by `gcc-config -l`, and
try them one at a time until I found one that works.  That's sort of
what I want to encode, but may be more scripting than it is worth.

Are there any other options, eclasses, or general approaches I should
consider for this problem?

Thanks for your time.

-- jared@wordzoo.com

"One cannot mark the point without marking the path."
-- 
gentoo-dev@gentoo.org mailing list


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

* Re: [gentoo-dev] Finding GCC+GCJ greater than 3.4.2
  2005-04-25  1:03 [gentoo-dev] Finding GCC+GCJ greater than 3.4.2 Jared Rhine
@ 2005-04-25  2:15 ` Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2005-04-25  2:15 UTC (permalink / raw
  To: gentoo-dev

On Sunday 24 April 2005 09:03 pm, Jared Rhine wrote:
> #pkg_setup() {
> #   if [[ ! $(built_with_use gcc gcj) ]] ; then
> #       eerror 'Chandler build requires that GCC be built with the "gcj"
> USE flag' #       die "exiting because of GCJ dependency"
> #   fi
> #}

first, that if statement is straight up wrong ... it should be (syntax wise):
if built_with_use gcc gcj ; then

to address the version issue, try something like:
local gccpkg=$(best_version '>=sys-devel/gcc-3.4.2')
if built_with_use ${gccpkg} gcj ; then

> My goal is to make this ebuild find and use a working GCC if it is
> present, even in the presence of slots and mixed use flags.

i'd say make the user run `gcc-config` themselves before emerging
-mike
-- 
gentoo-dev@gentoo.org mailing list


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

end of thread, other threads:[~2005-04-25  2:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-25  1:03 [gentoo-dev] Finding GCC+GCJ greater than 3.4.2 Jared Rhine
2005-04-25  2:15 ` Mike Frysinger

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