configure: Initial support for --target-os=symbian

Message ID 1300873642-83040-1-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö March 23, 2011, 9:47 a.m.
The filtering of ASFLAGS is required since the symbian toolchain
requires a --include parameter in extra_cflags, which shouldn't
be passed on to ASFLAGS. The $(echo) surrounding the filtering
is needed since the output from filter_out contains linebreaks
between each parameter.
---
 configure |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

Comments

Mans Rullgard March 23, 2011, 10 a.m. | #1
Martin Storsjö <martin@martin.st> writes:

> The filtering of ASFLAGS is required since the symbian toolchain
> requires a --include parameter in extra_cflags, which shouldn't
> be passed on to ASFLAGS. The $(echo) surrounding the filtering
> is needed since the output from filter_out contains linebreaks
> between each parameter.
> ---
>  configure |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index 00aa9ed..14ef220 100755
> --- a/configure
> +++ b/configure
> @@ -1824,7 +1824,7 @@ set_default host_cc
>  
>  exesuf() {
>      case $1 in
> -        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
> +        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
>      esac
>  }
>  
> @@ -2487,6 +2487,12 @@ case $target_os in
>          add_cppflags -D_QNX_SOURCE
>          network_extralibs="-lsocket"
>          ;;
> +    symbian)
> +        SLIBSUF=".dll"
> +        disable ffserver

Why does ffserver need to be explicitly disabled?  If it fails to build,
there is a missing check somewhere.

> +        enable dos_paths
> +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))

filter_asflags="filter_out --include*"

> +        ;;
>      none)
>          ;;
>      *)
> -- 
> 1.7.3.1
>
Martin Storsjö March 23, 2011, 10:32 a.m. | #2
On Wed, 23 Mar 2011, Måns Rullgård wrote:

> Martin Storsjö <martin@martin.st> writes:
> 
> > The filtering of ASFLAGS is required since the symbian toolchain
> > requires a --include parameter in extra_cflags, which shouldn't
> > be passed on to ASFLAGS. The $(echo) surrounding the filtering
> > is needed since the output from filter_out contains linebreaks
> > between each parameter.
> > ---
> >  configure |    8 +++++++-
> >  1 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 00aa9ed..14ef220 100755
> > --- a/configure
> > +++ b/configure
> > @@ -1824,7 +1824,7 @@ set_default host_cc
> >  
> >  exesuf() {
> >      case $1 in
> > -        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
> > +        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
> >      esac
> >  }
> >  
> > @@ -2487,6 +2487,12 @@ case $target_os in
> >          add_cppflags -D_QNX_SOURCE
> >          network_extralibs="-lsocket"
> >          ;;
> > +    symbian)
> > +        SLIBSUF=".dll"
> > +        disable ffserver
> 
> Why does ffserver need to be explicitly disabled?  If it fails to build,
> there is a missing check somewhere.

Indeed - sent a patchset fixing this.

> > +        enable dos_paths
> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
> 
> filter_asflags="filter_out --include*"

Ah yes - I tried that initially, but this is past the section where cflags 
are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
compiler detection section) - setting filter_asflags here doesn't have any 
effect.

Do you prefer moving part this up a bit, as a separate block, next to the 
compiler section? Something like this:

if [ "$target_os = "symbian" ]; then
    filter_asflags="filter_out --include*"
endif

// Martin
Mans Rullgard March 23, 2011, 11:08 a.m. | #3
Martin Storsjö <martin@martin.st> writes:

> On Wed, 23 Mar 2011, Måns Rullgård wrote:
>
>> Martin Storsjö <martin@martin.st> writes:
>> 
>> > The filtering of ASFLAGS is required since the symbian toolchain
>> > requires a --include parameter in extra_cflags, which shouldn't
>> > be passed on to ASFLAGS. The $(echo) surrounding the filtering
>> > is needed since the output from filter_out contains linebreaks
>> > between each parameter.
>> > ---
>> >  configure |    8 +++++++-
>> >  1 files changed, 7 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/configure b/configure
>> > index 00aa9ed..14ef220 100755
>> > --- a/configure
>> > +++ b/configure
>> > @@ -1824,7 +1824,7 @@ set_default host_cc
>> >  
>> >  exesuf() {
>> >      case $1 in
>> > -        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
>> > +        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
>> >      esac
>> >  }
>> >  
>> > @@ -2487,6 +2487,12 @@ case $target_os in
>> >          add_cppflags -D_QNX_SOURCE
>> >          network_extralibs="-lsocket"
>> >          ;;
>> > +    symbian)
>> > +        SLIBSUF=".dll"
>> > +        disable ffserver
>> 
>> Why does ffserver need to be explicitly disabled?  If it fails to build,
>> there is a missing check somewhere.
>
> Indeed - sent a patchset fixing this.
>
>> > +        enable dos_paths
>> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
>> 
>> filter_asflags="filter_out --include*"
>
> Ah yes - I tried that initially, but this is past the section where cflags 
> are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
> compiler detection section) - setting filter_asflags here doesn't have any 
> effect.
>
> Do you prefer moving part this up a bit, as a separate block, next to the 
> compiler section? Something like this:
>
> if [ "$target_os = "symbian" ]; then
>     filter_asflags="filter_out --include*"
> endif

No, that's worse.  Bother me about it later today, I'll try to think of
a nice solution.
Martin Storsjö March 30, 2011, 8:07 p.m. | #4
On Wed, 23 Mar 2011, Måns Rullgård wrote:

> Martin Storsjö <martin@martin.st> writes:
> 
> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
> >
> >> Martin Storsjö <martin@martin.st> writes:
> >> 
> >> > The filtering of ASFLAGS is required since the symbian toolchain
> >> > requires a --include parameter in extra_cflags, which shouldn't
> >> > be passed on to ASFLAGS. The $(echo) surrounding the filtering
> >> > is needed since the output from filter_out contains linebreaks
> >> > between each parameter.
> >> > ---
> >> >  configure |    8 +++++++-
> >> >  1 files changed, 7 insertions(+), 1 deletions(-)
> >> >
> >> > diff --git a/configure b/configure
> >> > index 00aa9ed..14ef220 100755
> >> > --- a/configure
> >> > +++ b/configure
> >> > @@ -1824,7 +1824,7 @@ set_default host_cc
> >> >  
> >> >  exesuf() {
> >> >      case $1 in
> >> > -        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
> >> > +        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
> >> >      esac
> >> >  }
> >> >  
> >> > @@ -2487,6 +2487,12 @@ case $target_os in
> >> >          add_cppflags -D_QNX_SOURCE
> >> >          network_extralibs="-lsocket"
> >> >          ;;
> >> > +    symbian)
> >> > +        SLIBSUF=".dll"
> >> > +        disable ffserver
> >> 
> >> Why does ffserver need to be explicitly disabled?  If it fails to build,
> >> there is a missing check somewhere.
> >
> > Indeed - sent a patchset fixing this.
> >
> >> > +        enable dos_paths
> >> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
> >> 
> >> filter_asflags="filter_out --include*"
> >
> > Ah yes - I tried that initially, but this is past the section where cflags 
> > are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
> > compiler detection section) - setting filter_asflags here doesn't have any 
> > effect.
> >
> > Do you prefer moving part this up a bit, as a separate block, next to the 
> > compiler section? Something like this:
> >
> > if [ "$target_os = "symbian" ]; then
> >     filter_asflags="filter_out --include*"
> > endif
> 
> No, that's worse.  Bother me about it later today, I'll try to think of
> a nice solution.

Ping - any better suggestion?

// Martin
Mans Rullgard March 30, 2011, 8:33 p.m. | #5
Martin Storsjö <martin@martin.st> writes:

> On Wed, 23 Mar 2011, Måns Rullgård wrote:
>
>> Martin Storsjö <martin@martin.st> writes:
>> 
>> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
>> >
>> >> Martin Storsjö <martin@martin.st> writes:
>> >> 
>> >> > +        enable dos_paths
>> >> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
>> >> 
>> >> filter_asflags="filter_out --include*"
>> >
>> > Ah yes - I tried that initially, but this is past the section where cflags 
>> > are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
>> > compiler detection section) - setting filter_asflags here doesn't have any 
>> > effect.
>> >
>> > Do you prefer moving part this up a bit, as a separate block, next to the 
>> > compiler section? Something like this:
>> >
>> > if [ "$target_os = "symbian" ]; then
>> >     filter_asflags="filter_out --include*"
>> > endif
>> 
>> No, that's worse.  Bother me about it later today, I'll try to think of
>> a nice solution.
>
> Ping - any better suggestion?

What does the --include do, and can we add it ourselves somehow?  That
would solve the problem and make life easier for the user.
Martin Storsjö March 30, 2011, 8:40 p.m. | #6
On Wed, 30 Mar 2011, Måns Rullgård wrote:

> Martin Storsjö <martin@martin.st> writes:
> 
> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
> >
> >> Martin Storsjö <martin@martin.st> writes:
> >> 
> >> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
> >> >
> >> >> Martin Storsjö <martin@martin.st> writes:
> >> >> 
> >> >> > +        enable dos_paths
> >> >> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
> >> >> 
> >> >> filter_asflags="filter_out --include*"
> >> >
> >> > Ah yes - I tried that initially, but this is past the section where cflags 
> >> > are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
> >> > compiler detection section) - setting filter_asflags here doesn't have any 
> >> > effect.
> >> >
> >> > Do you prefer moving part this up a bit, as a separate block, next to the 
> >> > compiler section? Something like this:
> >> >
> >> > if [ "$target_os = "symbian" ]; then
> >> >     filter_asflags="filter_out --include*"
> >> > endif
> >> 
> >> No, that's worse.  Bother me about it later today, I'll try to think of
> >> a nice solution.
> >
> > Ping - any better suggestion?
> 
> What does the --include do, and can we add it ourselves somehow?  That
> would solve the problem and make life easier for the user.

The --include is for including a toolchain (gcc or rvct) specific header 
that all the platform headers require to be present before they are 
included.

If we'd add it ourselves, it would be something like this for the gcce 
case:

add_cflags --include=$EPOCROOT/epoc32/include/gcce/gcce.h

It's kinda ugly to have to rely on an external env variable for the SDK 
root, although $EPOCROOT is the standard env var name for this in symbian 
stuff.

// Martin
Mans Rullgard March 30, 2011, 8:42 p.m. | #7
Martin Storsjö <martin@martin.st> writes:

> On Wed, 30 Mar 2011, Måns Rullgård wrote:
>
>> Martin Storsjö <martin@martin.st> writes:
>> 
>> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
>> >
>> >> Martin Storsjö <martin@martin.st> writes:
>> >> 
>> >> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
>> >> >
>> >> >> Martin Storsjö <martin@martin.st> writes:
>> >> >> 
>> >> >> > +        enable dos_paths
>> >> >> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
>> >> >> 
>> >> >> filter_asflags="filter_out --include*"
>> >> >
>> >> > Ah yes - I tried that initially, but this is past the section where cflags 
>> >> > are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
>> >> > compiler detection section) - setting filter_asflags here doesn't have any 
>> >> > effect.
>> >> >
>> >> > Do you prefer moving part this up a bit, as a separate block, next to the 
>> >> > compiler section? Something like this:
>> >> >
>> >> > if [ "$target_os = "symbian" ]; then
>> >> >     filter_asflags="filter_out --include*"
>> >> > endif
>> >> 
>> >> No, that's worse.  Bother me about it later today, I'll try to think of
>> >> a nice solution.
>> >
>> > Ping - any better suggestion?
>> 
>> What does the --include do, and can we add it ourselves somehow?  That
>> would solve the problem and make life easier for the user.
>
> The --include is for including a toolchain (gcc or rvct) specific header 
> that all the platform headers require to be present before they are 
> included.
>
> If we'd add it ourselves, it would be something like this for the gcce 
> case:
>
> add_cflags --include=$EPOCROOT/epoc32/include/gcce/gcce.h
>
> It's kinda ugly to have to rely on an external env variable for the SDK 
> root, although $EPOCROOT is the standard env var name for this in symbian 
> stuff.

Can we use the existing --sysinclude flag for this?
Martin Storsjö March 30, 2011, 9:02 p.m. | #8
On Wed, 30 Mar 2011, Måns Rullgård wrote:

> Martin Storsjö <martin@martin.st> writes:
> 
> > On Wed, 30 Mar 2011, Måns Rullgård wrote:
> >
> >> Martin Storsjö <martin@martin.st> writes:
> >> 
> >> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
> >> >
> >> >> Martin Storsjö <martin@martin.st> writes:
> >> >> 
> >> >> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
> >> >> >
> >> >> >> Martin Storsjö <martin@martin.st> writes:
> >> >> >> 
> >> >> >> > +        enable dos_paths
> >> >> >> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
> >> >> >> 
> >> >> >> filter_asflags="filter_out --include*"
> >> >> >
> >> >> > Ah yes - I tried that initially, but this is past the section where cflags 
> >> >> > are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
> >> >> > compiler detection section) - setting filter_asflags here doesn't have any 
> >> >> > effect.
> >> >> >
> >> >> > Do you prefer moving part this up a bit, as a separate block, next to the 
> >> >> > compiler section? Something like this:
> >> >> >
> >> >> > if [ "$target_os = "symbian" ]; then
> >> >> >     filter_asflags="filter_out --include*"
> >> >> > endif
> >> >> 
> >> >> No, that's worse.  Bother me about it later today, I'll try to think of
> >> >> a nice solution.
> >> >
> >> > Ping - any better suggestion?
> >> 
> >> What does the --include do, and can we add it ourselves somehow?  That
> >> would solve the problem and make life easier for the user.
> >
> > The --include is for including a toolchain (gcc or rvct) specific header 
> > that all the platform headers require to be present before they are 
> > included.
> >
> > If we'd add it ourselves, it would be something like this for the gcce 
> > case:
> >
> > add_cflags --include=$EPOCROOT/epoc32/include/gcce/gcce.h
> >
> > It's kinda ugly to have to rely on an external env variable for the SDK 
> > root, although $EPOCROOT is the standard env var name for this in symbian 
> > stuff.
> 
> Can we use the existing --sysinclude flag for this?

Yes, that seems to work.

Tests like _FILE_OFFSET_BITS=64 that are done before the target-os switch 
(where the include flag is added to cflags) do fail even though they would 
have succeeded otherwise, but that's not really an issue, I'm not sure the 
os itself supports such files anyway.

// Martin
Mans Rullgard March 30, 2011, 9:20 p.m. | #9
Martin Storsjö <martin@martin.st> writes:

> On Wed, 30 Mar 2011, Måns Rullgård wrote:
>
>> Martin Storsjö <martin@martin.st> writes:
>> 
>> > On Wed, 30 Mar 2011, Måns Rullgård wrote:
>> >
>> >> Martin Storsjö <martin@martin.st> writes:
>> >> 
>> >> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
>> >> >
>> >> >> Martin Storsjö <martin@martin.st> writes:
>> >> >> 
>> >> >> > On Wed, 23 Mar 2011, Måns Rullgård wrote:
>> >> >> >
>> >> >> >> Martin Storsjö <martin@martin.st> writes:
>> >> >> >> 
>> >> >> >> > +        enable dos_paths
>> >> >> >> > +        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
>> >> >> >> 
>> >> >> >> filter_asflags="filter_out --include*"
>> >> >> >
>> >> >> > Ah yes - I tried that initially, but this is past the section where cflags 
>> >> >> > are added to ASFLAGS ("add_asflags $extra_cflags", quite soon after the 
>> >> >> > compiler detection section) - setting filter_asflags here doesn't have any 
>> >> >> > effect.
>> >> >> >
>> >> >> > Do you prefer moving part this up a bit, as a separate block, next to the 
>> >> >> > compiler section? Something like this:
>> >> >> >
>> >> >> > if [ "$target_os = "symbian" ]; then
>> >> >> >     filter_asflags="filter_out --include*"
>> >> >> > endif
>> >> >> 
>> >> >> No, that's worse.  Bother me about it later today, I'll try to think of
>> >> >> a nice solution.
>> >> >
>> >> > Ping - any better suggestion?
>> >> 
>> >> What does the --include do, and can we add it ourselves somehow?  That
>> >> would solve the problem and make life easier for the user.
>> >
>> > The --include is for including a toolchain (gcc or rvct) specific header 
>> > that all the platform headers require to be present before they are 
>> > included.
>> >
>> > If we'd add it ourselves, it would be something like this for the gcce 
>> > case:
>> >
>> > add_cflags --include=$EPOCROOT/epoc32/include/gcce/gcce.h
>> >
>> > It's kinda ugly to have to rely on an external env variable for the SDK 
>> > root, although $EPOCROOT is the standard env var name for this in symbian 
>> > stuff.
>> 
>> Can we use the existing --sysinclude flag for this?
>
> Yes, that seems to work.
>
> Tests like _FILE_OFFSET_BITS=64 that are done before the target-os switch 
> (where the include flag is added to cflags) do fail even though they would 
> have succeeded otherwise, but that's not really an issue, I'm not sure the 
> os itself supports such files anyway.

I don't see any immediate reason those tests couldn't be moved down.

Patch

diff --git a/configure b/configure
index 00aa9ed..14ef220 100755
--- a/configure
+++ b/configure
@@ -1824,7 +1824,7 @@  set_default host_cc
 
 exesuf() {
     case $1 in
-        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
+        mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
     esac
 }
 
@@ -2487,6 +2487,12 @@  case $target_os in
         add_cppflags -D_QNX_SOURCE
         network_extralibs="-lsocket"
         ;;
+    symbian)
+        SLIBSUF=".dll"
+        disable ffserver
+        enable dos_paths
+        ASFLAGS=$(echo $(filter_out --include* $ASFLAGS))
+        ;;
     none)
         ;;
     *)