chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hard coded paths in csc and relocatable chicken


From: Matt Welland
Subject: Re: Hard coded paths in csc and relocatable chicken
Date: Fri, 21 May 2021 14:05:22 -0700

HI Mario,

Yes, static csc, csi etc would work but the calls in csc to other chicken tools would need to use $PATH or I would be up against the same issue.

I'll try some of the other suggestions. I did look at csc.scm but I have not been able to figure out where the hard-coded paths are created. Maybe it is in the "C" compilation step?

The classic solution for this in the scripting world is to find the path to the running executable and use that to find the child executables:

I.e. if csc used (pathname-directory (car (argv)))) to prefix as a path to the other executable calls or an env var to give end users control then I'd be enabled.

Thanks,
Matt
-=-

On Fri, May 21, 2021 at 10:58 AM Mario Domenech Goulart <mario@parenteses.org> wrote:
Hi Matt,

On Thu, 20 May 2021 15:04:16 -0700 Matt Welland <mattrwelland@gmail.com> wrote:

> As mentioned in the coding jam I put together a chicken bundle including the iup egg ready to go outside the box. It turns out that my assertion that
> it worked was wrong. I tested by running csi and was able to load iup and create a button and I assumed that if this worked then so would compilation
> with csc. Not so. While a little script hackery could swizzle the full paths in the .info files for eggs I don't think there is any way to change the
> paths in compiled binaries such as csc.
>
> I really would like to be able to make a relocatable build system to enable us to use chicken in our ever more constrained compute environment.
>
> The directories are all pointing to the original install directory. E.g.
>> strings csc | less
> ...
> _edata
> __bss_start
> _end
> /home/matt/buildall/ck5.2/lib
> GLIBC_2.3
> GLIBC_2.2.5
>
> Any suggestions or ideas on how to work around this?

Would static linking be an acceptable solution in this case?

All the best.
Mario
--
http://parenteses.org/mario



--
--
Complexity is your enemy. Any fool can make something complicated.
It is hard to keep things simple. - Richard Branson.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]