After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648816 - [compile] with-ffmpeg-extra-configure passes incorrect cflags
[compile] with-ffmpeg-extra-configure passes incorrect cflags
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
0.10.11
Other Linux
: Normal major
: 0.10.12
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-27 22:18 UTC by pprakash
Modified: 2011-05-06 11:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config error file attached for reference (59.80 KB, application/octet-stream)
2011-04-27 22:18 UTC, pprakash
  Details
proposed patch (729 bytes, patch)
2011-05-05 19:23 UTC, pprakash
committed Details | Review

Description pprakash 2011-04-27 22:18:36 UTC
Created attachment 186784 [details]
config error file attached for reference

I am trying to compile gst-ffmpeg for armv7 with arm optimization. I have validated vfp and neon optimization configuration on FFmpeg. However, when I pass these exact config elements through gst-ffmpeg, FFmpeg configure fails. config.err shows extra quotes added to cflags which is obviously not recognized by the compiler. 

Validated on FFmpeg alone (ffmpeg/configure):
--extra-cflags='-march=armv7-a -mfpu=neon -mfloat-abi=softfp' 

gst-ffmpeg extra configuration (gst-ffmpeg-0.10.11/configure):
--with-ffmpeg-extra-configure="--disable-gpl --disable-postproc --extra-cflags='-mfpu=neon -mfloat-abi=softfp'"
--->
Resultant config parameters on FFmpeg (gst-ffmpeg-0.10.11/gst-libs/ext/ffmpeg/config.err- attached):
 --extra-cflags=''\''-mfpu=neon' -mfloat-abi='softfp'\'''

I shall look into this in more detail, but any inputs are highly appreciated.

Also, I think passing in --enable-gpl and --enable-postproc should be an optional extra configure rather than a default config option. Thoughts?

Thank you.

Regards,
Punya
Comment 1 Sebastian Dröge (slomo) 2011-04-29 07:53:37 UTC
For the --enable-gpl see bug #532779 , --enable-postproc could be made optional but please file a different bug for that.

No idea about the additional quotes though, there's nothing obvious in gst-ffmpeg's configure.ac that could add additional quotes
Comment 2 pprakash 2011-04-29 21:54:44 UTC
Hello Sebastian,

Thank you for your response. I have been trying to trace the root cause for the extra quotes but no luck yet. Though I am now confident that it is a script issue.

works: --with-ffmpeg-extra-configure=" --target-os=linux --extra-cflags=-mfpu=neon"
- Result: --extra-cflags='-mcpu=cortex-a8'
Does not work: --with-ffmpeg-extra-configure=" --target-os=linux --extra-cflags='-mfpu=neon -mfloat-abi=softfp'"
- Result: --extra-cflags=''\''-mfpu=neon' -mfloat-abi='softfp'\'''
(Should and does) not work: --with-ffmpeg-extra-configure=" --target-os=linux --extra-cflags=-mfpu=neon -mfloat-abi=softfp"
- Result: --extra-cflags='-mcpu=cortex-a8' -mfpu=neon -mfloat-abi=softfp

The looked at the command in gst-ffmpeg configure file which is attempting to configure ./gst-lib/ext/ffmpeg/configure, it looks right. It is passing in the right parameters (as you have suggested). I cant seem to figure out where in the configuration procedure the extra quotes are being appended.

gst-ffmpeg/configure.ac
cd "$ac_top_build_prefix"gst-libs/ext/ffmpeg &&
         $confcmd $embffmpeg_configure_args
*all the parameters here look right*

BR,
Punya
Comment 3 pprakash 2011-04-29 22:26:20 UTC
ac_cs_config in config.status appends single quotes to every compiler option. Looks like it is not re-constructed correctly when it detects a single quote being passed in. Could this issue be related to autoconf? Please advice.

ac_cs_config="'--build=i686-linux' '--host=arm-none-linux-gnueabi' '--target=arm-none-linux-gnueabi' '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/libexec' '--datadir=/usr/share' '--sysconfdir=/etc' '--sharedstatedir=/com' '--localstatedir=/var' '--libdir=/usr/lib' '--includedir=/usr/include' '--oldincludedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-largefile' '--disable-nls' '--enable-ipv6' '--with-ffmpeg-extra-configure=  --target-os=linux --extra-cflags='\\''-mfpu=neon -mfloat-abi=softfp'\\''' 'build_alias=i686-linux' 'host_alias=arm-none-linux-gnueabi' 'target_alias=arm-none-linux-gnueabi' 'CC=arm-none-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb --sysroot=/home/pprakash/arago/arago-tmp/sysroots/armv7a-none-linux-gnueabi' 'CFLAGS=-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2 -ggdb2' 'LDFLAGS=-Wl,-O1 -Wl,--hash-style=gnu' 'CPP=arm-none-linux-gnueabi-gcc -E --sysroot=/home/pprakash/arago/arago-tmp/sysroots/armv7a-none-linux-gnueabi'"

BR,
Punya
Comment 4 Sebastian Dröge (slomo) 2011-05-03 07:13:50 UTC
FWIW I can reproduce this but I have no idea how to fix it, IMHO this is something that autoconf should just handle correctly.
Comment 5 pprakash 2011-05-05 19:23:56 UTC
Created attachment 187313 [details] [review]
proposed patch
Comment 6 Sebastian Dröge (slomo) 2011-05-06 11:23:15 UTC
commit cc9d778844078d0eb2c23c7a11f7f855d013bca5
Author: Punya Prakash <pprakash@ti.com>
Date:   Thu May 5 11:12:20 2011 -0500

    configure: Fix ac_cs_config handling
    
    Previously autoconf appended too many additional quotes
    to parameters like --with-ffmpeg-extra-configure=" --target-os=linux
    --extra-cflags='-mfpu=neon -mfloat-abi=softfp'".
    
    Fixes bug #648816.