[Top][All Lists]

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

Re: Arguments to configure

From: Sébastien Hinderer
Subject: Re: Arguments to configure
Date: Wed, 21 Nov 2018 11:41:37 +0100

Dear Vivien,

I'm really sorry about my delayed response!

Vivien Kraus (2018/10/03 18:33 +0200):
> Sébastien Hinderer writes:
> >
> > Coming to the directory I was talking about, it is currently called
> > "target-bindir" and is used to define where the bytecode interpreter,
> > ocamlrun, will reside on the target system. This is something the
> > compiler running on the host needs to know because it adds a line like
> > #!/path/to/ocamlrun/on/target/system
> > at the beginning of the bytecode executables it produces, so that they
> > can then be run as regular executable programs on the target. Does all
> > this make sense? Perhaps autoconf has a different way of handling such
> > settings?
> I like OCaml very much, so I could not help but reply again to the
> thread :)  Sorry if it's uninformative / not the proper way to do it.

You are very welcome! Thanks a lot for your interest!

> Can this target-bindir be configured when running the program?  Like:
> ocamlc --target-bindir="/whatever/bin"
> I could not find such an option in ocamlc options, but maybe it's under
> a different name.  Or deep down in a to-do list.

I don't think such an option exists, but I think in theory nothing
prevents it from being implemented. But of course the problem of
providing a default value for that option remains, although a runtime
option makes it definitely less critical.

> Anyway, it looks like a default hard-coded value for a run-time option
> of the program that the user / distribution might wish to change.

Yes, exactly.

> I would
> put it in a --enable-default-target-bindir="/whatever/bin" option or
> DEFAULT_TARGET_BINDIR="/whatever/bin" variable, and then in the program
> code use a command-line option to override it.  (see autogen / autoopts
> which is great if you want more:

Well OCaml has its own command-line option processing facilities, but I
will definitely have a look to your link. Thanks!

Regarding the name of the configuration time option, I am really tempted
to use --with-target-bindir because, although I know it is supposed to
be for external packages, to me it makes more sense semantically, if you
just look at words, than enable-with-target-bindir.

> I think it is different from the other target-specific options like what
> kind of code the program should produce, which is not something that the
> user would like to change when running the program.

Sure, wel at least as long the compiler has only one builtin backend. In
my dreams, one would be able to embed several backends, but I think this
is far away from where we are today.

> Anyway, this is what I would do, with my limited knowledge about
> cross-compilers :)

I am myself a complete noob in that area. :)

Best wishes and thanks again for your mail,


reply via email to

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