On Mon, Jan 20, 2014 at 12:09 PM, Nick Wellnhofer <[email protected]> wrote:
> Lucifers,

I love the appellation!

> Now that we’re about to build Clownfish and Lucy separately, we have to find 
> a way to point Lucy to the Clownfish .cfh files. I can see the following 
> options:

Does the Lucy build process really need to know where they are, or can
the CFC executable just have that knowledge internally?   I suppose it
would be useful in odd cases to tell CFC to use alternate base
headers, but this seems like a fairly rare issue.

>     * Add a command-line option to Lucy’s build scripts which in
>       turn gets passed to the Clownfish compiler.
>     * Use an environment variable like CLOWNFISH_INCLUDE which
>       contains a list of paths the Clownfish compiler should search.
>     * Install .cfh files in some well-known locations like
>       /usr/include/cfh, /usr/local/include/cfh and have CFC always
>       search there.
>
> We should probably provide a combination of these methods.
> I think we should use all three. Thoughts?

>From the point of view of the interface to CFC, a well-known location
plus a command-line override seems sufficient.  I suppose CFC could
allow an environment variable to override the compiled default
location in the absence of a command line arg, but feels like
overkill.   Is there a frequent case where the command line wouldn't
be adequate?

But for my own version of overkill, you might consider adding a
"well-known name" within the current working directory or the
executable's directory at the head of the list of places that CFC
searches.  It's often nice for new users to be able to test things
from a single directory before they are required to install them.

Both working and executable relative have some advantages.  Working
directory may be simplest, but executable relative can be helpful for
a permanent non-root install.  Finding the executable's directory on
Linux and other Unix systems is shown here, with the implication that
it's possible on Windows as well:
http://stackoverflow.com/questions/606041/how-do-i-get-the-path-of-a-process-in-unix-linux

--nate

Reply via email to