diff mbox

[FFmpeg-devel] configure: quote compiler paths

Message ID 20170919235416.95771-1-modmaker@google.com
State New
Headers show

Commit Message

Jacob Trimble Sept. 19, 2017, 11:54 p.m. UTC
Signed-off-by: Jacob Trimble <modmaker@google.com>
---
 configure | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Michael Niedermayer Sept. 20, 2017, 11:29 p.m. UTC | #1
On Tue, Sep 19, 2017 at 04:54:16PM -0700, Jacob Trimble wrote:
> Signed-off-by: Jacob Trimble <modmaker@google.com>
> ---
>  configure | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

breaks build with ccache

./configure --cc='ccache gcc'
ccache gcc is unable to create an executable file.
If ccache gcc is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.

[...]
Jacob Trimble Sept. 21, 2017, 4:51 p.m. UTC | #2
On Wed, Sep 20, 2017 at 4:29 PM, Michael Niedermayer
<michael@niedermayer.cc> wrote:
>
> On Tue, Sep 19, 2017 at 04:54:16PM -0700, Jacob Trimble wrote:
> > Signed-off-by: Jacob Trimble <modmaker@google.com>
> > ---
> >  configure | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
>
> breaks build with ccache
>
> ./configure --cc='ccache gcc'
> ccache gcc is unable to create an executable file.
> If ccache gcc is a cross-compiler, use the --enable-cross-compile option.
> Only do this if you know what cross compiling means.
> C compiler test failed.
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Let us carefully observe those good qualities wherein our enemies excel us
> and endeavor to excel them, by avoiding what is faulty, and imitating what
> is excellent in them. -- Plutarch
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

But without this, you can't have a compiler path that has a space in
it.  Plus, AFAIK, there is no way to escape the space through a bash
variable.  Meaning there is no way for $cc to have an escaped space in
it.  Is this just something that won't be supported?
Nicolas George Sept. 21, 2017, 5:03 p.m. UTC | #3
Le jour de la Récompense, an CCXXV, Jacob Trimble a écrit :
> But without this, you can't have a compiler path that has a space in
> it.  Plus, AFAIK, there is no way to escape the space through a bash
> variable.  Meaning there is no way for $cc to have an escaped space in
> it.  Is this just something that won't be supported?

Do you know any build system that does?

Regards,
Jacob Trimble Sept. 21, 2017, 5:20 p.m. UTC | #4
On Thu, Sep 21, 2017 at 10:03 AM, Nicolas George <george@nsup.org> wrote:
> Le jour de la Récompense, an CCXXV, Jacob Trimble a écrit :
>> But without this, you can't have a compiler path that has a space in
>> it.  Plus, AFAIK, there is no way to escape the space through a bash
>> variable.  Meaning there is no way for $cc to have an escaped space in
>> it.  Is this just something that won't be supported?
>
> Do you know any build system that does?
>
> Regards,
>
> --
>   Nicolas George

Now that I think about it more, I guess that is the correct behavior.
I guess I am just used to working in non-configure-based build systems
that separate out the compiler path from the flags/wrappers.

It would be nice to be able to specify it as --cc='a path/gcc'
--cc_wrapper=ccache --cflags=-m32, but I see that changing it would
break everything and that is not the ./configure style.

NVM
diff mbox

Patch

diff --git a/configure b/configure
index 2de20a02a4..16aa09be05 100755
--- a/configure
+++ b/configure
@@ -920,14 +920,14 @@  check_cc(){
     log check_cc "$@"
     cat > $TMPC
     log_file $TMPC
-    check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
+    check_cmd "$cc" $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
 }
 
 check_cxx(){
     log check_cxx "$@"
     cat > $TMPCPP
     log_file $TMPCPP
-    check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
+    check_cmd "$cxx" $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
 }
 
 check_objcc(){
@@ -981,7 +981,7 @@  check_inline_asm_flags(){
 void foo(void){ __asm__ volatile($code); }
 EOF
     log_file $TMPC
-    check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
+    check_cmd "$cc" $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
     enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
 }
 
@@ -1012,7 +1012,7 @@  check_ld(){
     check_$type $($cflags_filter $flags) || return
     flags=$($ldflags_filter $flags)
     libs=$($ldflags_filter $libs)
-    check_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
+    check_cmd "$ld" $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
 }
 
 print_include(){
@@ -4382,7 +4382,7 @@  if test "$cpu" = host; then
     case "$cc_type" in
         gcc|llvm_gcc)
             check_native(){
-                $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+                "$cc" $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
                 sed -n "/cc1.*$1=/{
                             s/.*$1=\\([^ ]*\\).*/\\1/
                             p
@@ -4393,7 +4393,7 @@  if test "$cpu" = host; then
         ;;
         clang)
             check_native(){
-                $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+                "$cc" $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
                 sed -n "/cc1.*-target-cpu /{
                             s/.*-target-cpu \\([^ ]*\\).*/\\1/
                             p
@@ -5476,7 +5476,7 @@  elif enabled mips; then
 elif enabled parisc; then
 
     if enabled gcc; then
-        case $($cc -dumpversion) in
+        case $("$cc" -dumpversion) in
             4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
         esac
     fi
@@ -6407,7 +6407,7 @@  if enabled icc; then
     # The test above does not test linking
     enabled lto && disable symver_asm_label
     if enabled x86_32; then
-        icc_version=$($cc -dumpversion)
+        icc_version=$("$cc" -dumpversion)
         test ${icc_version%%.*} -ge 11 &&
             check_cflags -falign-stack=maintain-16-byte ||
             disable aligned_stack