cross-compiling and `orc.m4`

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

cross-compiling and `orc.m4`

Paul Menzel
Dear orcc folks,


using OpenEmbedded [1] trying to cross-compile GStreamer plug-ins (or
PulseAudio from git master), which includes `orc.m4`, `Makefile` has to be
adapted as noted in `gst-plugins.inc` [2].

        # orc.m4 calls pkg-config ----variable=orcc orc-0.4 to get the path to orcc,
        # resulting in /usr/bin/orcc. Force it to use the staged orcc.
        do_configure_append() {
        for i in $(find ${S} -name "Makefile") ; do
        sed -i -e s:${bindir}/orcc:${STAGING_BINDIR_NATIVE}/orcc:g $i
        done
        }

To be usable in cross compile environments `orc.m4` should not use
`ORC_CHECK` and

        pkg-config --variable=orcc orc-0.4

but something like `AC_CHECK_TOOL` (?) [3] which other projects seem to
use. I am not very familiar with Autotools but I found some examples on
the Web [4–6].


Thanks,

Paul


[1] http://www.openembedded.org/
[2] http://cgit.openembedded.org/cgit.cgi/openembedded/commit/recipes/gstreamer/gst-plugins.inc?id=3d7f3a9e493b6ac454b89add37108083b5cbfa97
[3] http://www.gnu.org/software/hello/manual/autoconf/Generic-Programs.html
[4] http://www.google.com/codesearch/p?hl=de#xBmykwmrpPk/r2/r2/lib/contrib/discount/configure.inc&q=%22ac_prog_yacc%22&sa=N&cd=4&ct=rc
[5] http://www.ctan.org/tex-archive/support/autoconf/
[6] http://www.freesoftwaremagazine.com/books/agaal/autotools_example (AC_PROG_TRY_DOXYGEN)


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cross-compiling and `orc.m4`

David Schleef-2
On Fri, Mar 11, 2011 at 01:38:28AM +0100, Paul Menzel wrote:

> Dear orcc folks,
>
>
> using OpenEmbedded [1] trying to cross-compile GStreamer plug-ins (or
> PulseAudio from git master), which includes `orc.m4`, `Makefile` has to be
> adapted as noted in `gst-plugins.inc` [2].
>
>         # orc.m4 calls pkg-config ----variable=orcc orc-0.4 to get the path to orcc,
>         # resulting in /usr/bin/orcc. Force it to use the staged orcc.
>         do_configure_append() {
>         for i in $(find ${S} -name "Makefile") ; do
>         sed -i -e s:${bindir}/orcc:${STAGING_BINDIR_NATIVE}/orcc:g $i
>         done
>         }

Use 'ORCC=/usr/bin/orcc ./configure' to override ORCC.

This is the correct way of doing things, because the tools involved
(pkg-config and autoconf) don't understand the concept of building
a native tool when cross-compiling.

Alternately, a build system could modify the orc-0.4.pc file when
cross-building orc, so that the orcc variable is set to the tool in
the staging directory.



David


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: cross-compiling and `orc.m4`

Maarten Bosmans
2011/3/19 David Schleef <[hidden email]>:

> On Fri, Mar 11, 2011 at 01:38:28AM +0100, Paul Menzel wrote:
>> Dear orcc folks,
>>
>>
>> using OpenEmbedded [1] trying to cross-compile GStreamer plug-ins (or
>> PulseAudio from git master), which includes `orc.m4`, `Makefile` has to be
>> adapted as noted in `gst-plugins.inc` [2].
>>
>>         # orc.m4 calls pkg-config ----variable=orcc orc-0.4 to get the path to orcc,
>>         # resulting in /usr/bin/orcc. Force it to use the staged orcc.
>>         do_configure_append() {
>>               for i in $(find ${S} -name "Makefile") ; do
>>                       sed -i -e s:${bindir}/orcc:${STAGING_BINDIR_NATIVE}/orcc:g $i
>>               done
>>         }
>
> Use 'ORCC=/usr/bin/orcc ./configure' to override ORCC.
It would be nice to automatically detect when pkg-config returns a
non-functional orcc. The attached patch for orc.m4 does this and uses
the first orcc from $PATH when cross-compiling.

Should be enough to automatically do the right thing for Paul's and my
situation. Of course it is still overridable by setting ORCC
explicitly.

How about maintaining the m4 orc detection macro in the orc tree? Then
there is a canonical location for other projects (gstreamer,
pulseaudio) to look for updates of the file.
I'd say only the ORC_CHECK part should move to the orc tree and
ORC_OUTPUT can stay in the gstreamer tree, as we for pulseaudio do not
use ORC_OUPUT.

> This is the correct way of doing things, because the tools involved
> (pkg-config and autoconf) don't understand the concept of building
> a native tool when cross-compiling.
>
> Alternately, a build system could modify the orc-0.4.pc file when
> cross-building orc, so that the orcc variable is set to the tool in
> the staging directory.
>
> David

Maarten

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

gstreamer-orc-m4.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cross-compiling and `orc.m4`

Maarten Bosmans
ping

2011/5/3 Maarten Bosmans <[hidden email]>:

> 2011/3/19 David Schleef <[hidden email]>:
>> On Fri, Mar 11, 2011 at 01:38:28AM +0100, Paul Menzel wrote:
>>> Dear orcc folks,
>>>
>>>
>>> using OpenEmbedded [1] trying to cross-compile GStreamer plug-ins (or
>>> PulseAudio from git master), which includes `orc.m4`, `Makefile` has to be
>>> adapted as noted in `gst-plugins.inc` [2].
>>>
>>>         # orc.m4 calls pkg-config ----variable=orcc orc-0.4 to get the path to orcc,
>>>         # resulting in /usr/bin/orcc. Force it to use the staged orcc.
>>>         do_configure_append() {
>>>               for i in $(find ${S} -name "Makefile") ; do
>>>                       sed -i -e s:${bindir}/orcc:${STAGING_BINDIR_NATIVE}/orcc:g $i
>>>               done
>>>         }
>>
>> Use 'ORCC=/usr/bin/orcc ./configure' to override ORCC.
>
> It would be nice to automatically detect when pkg-config returns a
> non-functional orcc. The attached patch for orc.m4 does this and uses
> the first orcc from $PATH when cross-compiling.
>
> Should be enough to automatically do the right thing for Paul's and my
> situation. Of course it is still overridable by setting ORCC
> explicitly.
>
> How about maintaining the m4 orc detection macro in the orc tree? Then
> there is a canonical location for other projects (gstreamer,
> pulseaudio) to look for updates of the file.
> I'd say only the ORC_CHECK part should move to the orc tree and
> ORC_OUTPUT can stay in the gstreamer tree, as we for pulseaudio do not
> use ORC_OUPUT.
>
>> This is the correct way of doing things, because the tools involved
>> (pkg-config and autoconf) don't understand the concept of building
>> a native tool when cross-compiling.
>>
>> Alternately, a build system could modify the orc-0.4.pc file when
>> cross-building orc, so that the orcc variable is set to the tool in
>> the staging directory.
>>
>> David
>
> Maarten
>

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

gstreamer-orc-m4.patch (1K) Download Attachment