Page MenuHomePhabricator

Cross compile efl
Closed, ResolvedPublic

Description

While testing efl building with meson in yocto I came to the point where to define the native tools to use:

"Can not use target eolian_gen as a generator because it is cross-built"

With autotools there where configure parameters to do this.
--with-eolian-gen=
--with-edje-cc=
--with-eolian-cxx=
--with-eet-eet=
--with-eldbus_codegen=
--with-elementary-codegen=
--with-elm-prefs-cc=

Could not find them in meson_options

MarkvdP created this task.Oct 9 2018, 4:30 AM
MarkvdP triaged this task as Normal priority.
MarkvdP created this object with edit policy "Subscribers".

Yes this is not done yet. I just landed the first bunch so it is ready for more, this is deinfintly something that needs to be done - however, i don't have time yet.

What should be done in general:

  • Check in meson if the build is cross build, if this is the case, assign eolian_gen / edje_cc /eet/ eldbus_codegen (etc.) the result of a find_program(...) call. After that things should *just* work :)
MarkvdP changed the edit policy from "Subscribers" to "All Users".Oct 9 2018, 4:45 AM

I am fresh to meson, and have to dig in.
But I think I get the point.

The native directory where the executables live, is not always the root of the building host, so some kind of a "native-sysroot" variable would be nice. But I could not find one predefined variable for this in meson. According to the docs there is an option to provide custom variables in meson.cross file.

[properties]
somekey = 'somevalue'

Is this the correct approach to do this with efl?

I never really tried it myself, but its probebly enough to have something like

[binaries]
eolian_gen = ['path-to-eolian-gen']

In the cross file.
(http://mesonbuild.com/Cross-compilation.html#defining-the-environment)

And the corresponding

if (meson.is_cross_build())
  eolian_gen = find_program('eolian_gen')
else
  [...]

in src/bin/eolian/meson.build

MarkvdP added a comment.EditedOct 10 2018, 4:38 AM

Oke looking at yocto the cross file is pretty generic and not per recipe customizable. Maybee altering the cross file is not flexible for other build envs as well..
Would a build option be oke? Just like done with autotools.

-Deolian-gen=

meson.build

if (meson.is_cross_build())
  path  = get_option('oelian-gen')
  eolian_gen = find_program('path')
else
  [...]

Is this something that would make it in the repo?

The approach yes. However your goal can be achived a lot easier :)

src/bin/eolian/meson.build

The definition of eolian_gen = can be overriden with the native one with a find_program(...) call :) Then you don't need to add that to every file.

It should work analogue for the other binaries etc. :)

I thought of that, but that way there is no eolian_gen build for the target platform.
Maybe someone needs them on the target.

What do you think?

eolian_gen is just the binary variable that is used to call eolian_gen in the build process.

(The current eolian tests are not behaving so - i am changing them right now, so it gets easier for your patch :))