Re: [Chicken-users] Compiling eggs to .c

2016-10-26 Thread Norman Gray


Christian, hello.

On 25 Oct 2016, at 20:02, Christian Kellermann wrote:


* Norman Gray  [161025 20:42]:



With 'chicken-install -n' I appear to have the required .c files ...
somewhere, but the only way of finding where they are appears to be 
reading
the chicken-install chatter to find the location of the temp 
directory.  I

was wondering if there was a more automatable way.


You could retrieve the dir yourself first with chicken-install -r and
then cd into it, run chicken-install -n (without addifitional
arguments).


Genius!  That works -- thank you.

It is also, in retrospect, quite obvious (so often the case...).

Best wishes,

Norman


--
Norman Gray  :  https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Compiling eggs to .c

2016-10-25 Thread Christian Kellermann
* Norman Gray  [161025 20:42]:
>
> With 'chicken-install -n' I appear to have the required .c files ...
> somewhere, but the only way of finding where they are appears to be reading
> the chicken-install chatter to find the location of the temp directory.  I
> was wondering if there was a more automatable way.

You could retrieve the dir yourself first with chicken-install -r and
then cd into it, run chicken-install -n (without addifitional
arguments). But of course you would need to track dependencies
manually.

>
> >For my projects I have manually unrolled the compilation
> >stuff into a shell script. Yes it is tedious and sucks but it
> >works.
>
> I was really hoping to avoid that, partly because I'm not confident I'd get
> all the build invocations right for the various extensions, so I'd never
> really know if subsequent problems were because of that or not.  But the
> trial-and-error might be quicker than what I'm doing just now.

I know that feeling...

Cheers,

Christian

--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Compiling eggs to .c

2016-10-25 Thread Norman Gray


Christian, hello.

On 25 Oct 2016, at 13:37, Christian Kellermann wrote:


It looks like


% chicken-install -n uri-match

should work, because that retains the intermediate files -- including 
the .c
files -- in the temporary (download) directory.  But (a) the only way 
I can
see of finding what that temporary directory is, is by scanning the 
output
chatter from chicken-install, which obviously isn't robust in a 
Makefile;

and (b) scavenging the two .c files from this directory (namely
uri-match{,.import}.c) seems a slightly ad-hoc/hacky way of obtaining 
them,

which suggests I'm Doing It Wrong.

[...]


The -k option should keep intermediate files, you can pass this with
CSC_OPTIONS.


Thanks for this.  However, my understanding is that the -n option to 
chicken-install implies -k, and additionally stops after building (which 
includes building the .c from the .scm) and before the extension is 
installed (so avoiding changing the rest of the system).


With 'chicken-install -n' I appear to have the required .c files ... 
somewhere, but the only way of finding where they are appears to be 
reading the chicken-install chatter to find the location of the temp 
directory.  I was wondering if there was a more automatable way.



For my projects I have manually unrolled the compilation
stuff into a shell script. Yes it is tedious and sucks but it
works.


I was really hoping to avoid that, partly because I'm not confident I'd 
get all the build invocations right for the various extensions, so I'd 
never really know if subsequent problems were because of that or not.  
But the trial-and-error might be quicker than what I'm doing just now.



Also for CHICKEN 5 the new build system will make things easier...


Roll on Chicken 5!

All the best,

Norman


--
Norman Gray  :  https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Compiling eggs to .c

2016-10-25 Thread Christian Kellermann
* Norman Gray  [161025 12:28]:
>
> Greetings.
>
> I'm (still) trying to assemble a .c version of a simple but non-trivial
> Chicken program, for subsequent bundling and distribution.  I'm having
> difficulties.
>
> I've managed to assemble a set of dependencies for the various eggs
> required.  The first half-dozen of these download and build successfully,
> but I can't work out how to built the .c version of an egg.
>
> For some extensions, I can do:
>
> % /Data/tools/chicken-4.11.0/bin/chicken-install -r uri-match
> >uri-match.log
> % m=uri-match; "/Data/tools/chicken-4.11.0/bin/csc" -embedded -t
> -optimize-level 3 -emit-all-import-libraries -unit $m -include-path $m
> -output-file uri-match.c $m/$m.scm
>
> But for slightly more complicated .setup files (and uri-match.setup is an
> example, with its test of (chicken-version)), this doesn't work, because csc
> doesn't read the .setup file, so the above ends up calling csc in the wrong
> way.
>
> It looks like
>
> % chicken-install -n uri-match
>
> should work, because that retains the intermediate files -- including the .c
> files -- in the temporary (download) directory.  But (a) the only way I can
> see of finding what that temporary directory is, is by scanning the output
> chatter from chicken-install, which obviously isn't robust in a Makefile;
> and (b) scavenging the two .c files from this directory (namely
> uri-match{,.import}.c) seems a slightly ad-hoc/hacky way of obtaining them,
> which suggests I'm Doing It Wrong.
>
> I can't see any way of specifying a temporary directory in
> chicken-install.scm.
>
> The Deployment page refers to 'Using the compiler' for guidance on this
> route, but that page doesn't appear to cover this case.
>
> What am I missing?

The -k option should keep intermediate files, you can pass this with
CSC_OPTIONS. For my projects I have manually unrolled the compilation
stuff into a shell script. Yes it is tedious and sucks but it
works. Also for CHICKEN 5 the new build system will make things
easier...

HTH,

Christian


--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users