[perl #34356] Module to query parrot-config

4 views
Skip to first unread message

Lambeck

unread,
Mar 6, 2005, 1:37:04 PM3/6/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Lambeck
# Please include the string: [perl #34356]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34356 >


It would be nice to have a module that returns the installed parrot config.
Other applications (hopefully a lot) that configure depending on parrot might
need this. I mean something like App::Info::HTTPD::Apache
(http://search.cpan.org/~dwheeler/App-Info-0.44/).
I am not into App::Info so I can not decide what is neccessary to make it
return parrot specific values ...


Adrian Lambeck

William Coleda

unread,
Mar 6, 2005, 2:06:02 PM3/6/05
to perl6-i...@perl.org
Already exists.

perldoc parrot/library/config.imc

Regards.

William Coleda

unread,
Mar 6, 2005, 2:13:13 PM3/6/05
to William Coleda, perl6-i...@perl.org
Whoops, had already cd'd...

it's actually in 'runtime/parrot/library/config.imc'

Is this what you're looking for?

Adrian Lambeck

unread,
Mar 6, 2005, 2:31:19 PM3/6/05
to parrotbug...@parrotcode.org
This might be it - how do I access the data ?

--
-----------
Adrian Lambeck
Basics EDV
Feldnerstr. 11
21075 Hamburg
Germany

Tel. 040/788 901 76
E-Mail: adrian....@basicsedv.de

William Coleda

unread,
Mar 6, 2005, 7:03:03 PM3/6/05
to Adrian Lambeck, parrotbug...@parrotcode.org
Here's the sample from the perldoc:

.sub _some
# store the config data into $P0
$P0 = _config()
# Retrieve and print a key
$P1 = $P0["cc"]
print "Your C compiler is "
print $P1
print "\n"
.end
.include "library/config.imc"

Which, when run on my OS X box, gives:

oolong:~/research/parrot coke$ ./parrot foo.imc
Your C compiler is cc

How's that?

Adrian Lambeck

unread,
Mar 7, 2005, 2:26:18 AM3/7/05
to parrotbug...@parrotcode.org
I will try it out to see if it works for me. Now I know how to get the data
but how can I include this into a Makfile. If this were Perl-code I could use
MakeMaker but this way I need to do it somehow different.
By the way - in which file did you find this example.

Adrian

--

Leopold Toetsch

unread,
Mar 7, 2005, 8:03:12 AM3/7/05
to Adrian Lambeck, perl6-i...@perl.org
Adrian Lambeck <adrian....@basicsedv.de> wrote:

[ please don't top post ]

> I will try it out to see if it works for me. Now I know how to get the
> data but how can I include this into a Makfile. If this were Perl-code
> I could use MakeMaker but this way I need to do it somehow different.

There's a TODO item in the bug tracker, which describes an extension to
parrot-config.imc.

$ ./parrot parrot-config.imc libs
-lnsl -ldl -lm -lposix -lcrypt -lutil -lpthread -lrt -lgmp

It should eventually understand shortcuts like --compile or --link or
some such.

For now you can include something like:

foo$(EXE) : foo.c $(PARROT) # or better the lib
`$(PARROT) parrot-config.imc link` \
`$(PARROT) parrot-config.imc libs` \
...

in the Makefile.

> By the way - in which file did you find this example.

You are citing it:

>> > Am Sonntag, 6. März 2005 20:13 schrieb Will Coleda via RT:

>> >>it's actually in 'runtime/parrot/library/config.imc'

$ perldoc -F runtime/parrot/library/config.imc

leo

Reply all
Reply to author
Forward
0 new messages