public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR binutils/12110 spaces in source path
@ 2010-10-12 23:47 Alan Modra
  2010-10-13  5:13 ` Ralf Wildenhues
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2010-10-12 23:47 UTC (permalink / raw)
  To: gcc-patches, binutils

Patch does as per the ChangeLog.  A fix to actually support spaces in
$srcdir is a bit more work.  I started down that path, fixing all the
shell expansions, but then hit the problem of VPATH and $srcdir in
make targets/dependencies.  Apparently it is possible to escape spaces
with a backslash for make, but I'm not motivated enough to do that..

Fiddling with AS_MESSAGE_LOG_FD below is necessary because
AC_MSG_ERROR at this point in configure.ac would normally echo to
config.log, but we're using m4_divert_text to put the test before the
first real use of $srcdir, before config.log output is opened.

OK to install?  Tested with gcc and binutils configure.

	PR binutils/12110
	* configure.ac: Error when source path contains spaces.
	* configure: Regenerate.

Index: configure.ac
===================================================================
RCS file: /cvs/src/src/configure.ac,v
retrieving revision 1.109
diff -u -p -r1.109 configure.ac
--- configure.ac	7 Oct 2010 20:50:01 -0000	1.109
+++ configure.ac	12 Oct 2010 08:04:55 -0000
@@ -221,7 +221,14 @@ target_configdirs=`echo ${target_librari
 build_configdirs=`echo ${build_libs} ${build_tools}`
 
 m4_divert_text([PARSE_ARGS],
-[ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
+[case $srcdir in
+  *" "*)
+m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
+    AC_MSG_ERROR([path to source, $srcdir, contains spaces])
+_m4_popdef([AS_MESSAGE_LOG_FD])dnl
+    ;;
+esac
+ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
 ])
 
 ################################################################################

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PR binutils/12110 spaces in source path
  2010-10-12 23:47 PR binutils/12110 spaces in source path Alan Modra
@ 2010-10-13  5:13 ` Ralf Wildenhues
  2010-10-18 14:27   ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Wildenhues @ 2010-10-13  5:13 UTC (permalink / raw)
  To: gcc-patches, binutils

Hello Alan,

* Alan Modra wrote on Wed, Oct 13, 2010 at 01:47:14AM CEST:
> Patch does as per the ChangeLog.  A fix to actually support spaces in
> $srcdir is a bit more work.  I started down that path, fixing all the
> shell expansions, but then hit the problem of VPATH and $srcdir in
> make targets/dependencies.  Apparently it is possible to escape spaces
> with a backslash for make, but I'm not motivated enough to do that..

Supporting white space in $srcdir is impossible.  Posix 'make' doesn't
allow it.  Supporting white space in $abs_srcdir is theoretically
possible (in the sense that recent Autoconf and Automake have the
necessary measures in place, and 'make' will play along as long as you
make sure to never try to use absolute file names for things), but in
practice impossible due to *lots* of places in GCC that require absolute
file names; among others, the whole staging machinery relies on it.
Same with white space in $abs_builddir.

For white space in $abs_builddir and in $prefix, Libtool is also a
serious violator (and too much hassle to be fixed, sorry).

> Fiddling with AS_MESSAGE_LOG_FD below is necessary because
> AC_MSG_ERROR at this point in configure.ac would normally echo to
> config.log, but we're using m4_divert_text to put the test before the
> first real use of $srcdir, before config.log output is opened.

This uses undocumented details of Autoconf but otherwise seems right.

> OK to install?  Tested with gcc and binutils configure.

See nit below.  FWIW I cannot approve it.

Thanks,
Ralf

> 	PR binutils/12110
> 	* configure.ac: Error when source path contains spaces.
> 	* configure: Regenerate.

> --- configure.ac	7 Oct 2010 20:50:01 -0000	1.109
> +++ configure.ac	12 Oct 2010 08:04:55 -0000
> @@ -221,7 +221,14 @@ target_configdirs=`echo ${target_librari
>  build_configdirs=`echo ${build_libs} ${build_tools}`
>  
>  m4_divert_text([PARSE_ARGS],
> -[ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
> +[case $srcdir in
> +  *" "*)
> +m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
> +    AC_MSG_ERROR([path to source, $srcdir, contains spaces])
> +_m4_popdef([AS_MESSAGE_LOG_FD])dnl

Why not m4_popdef instead of _m4_popdef?

> +    ;;
> +esac
> +ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
>  ])
>  
>  ################################################################################

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PR binutils/12110 spaces in source path
  2010-10-13  5:13 ` Ralf Wildenhues
@ 2010-10-18 14:27   ` Alan Modra
  2010-11-01 23:37     ` DJ Delorie
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2010-10-18 14:27 UTC (permalink / raw)
  To: Ralf Wildenhues, gcc-patches, binutils

On Wed, Oct 13, 2010 at 07:13:29AM +0200, Ralf Wildenhues wrote:
> > +m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
> > +    AC_MSG_ERROR([path to source, $srcdir, contains spaces])
> > +_m4_popdef([AS_MESSAGE_LOG_FD])dnl
> 
> Why not m4_popdef instead of _m4_popdef?

Because I cut and pasted this from somewhere else that happened to use
_m4_popdef.  ;-)  Yes, m4_popdef works fine.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PR binutils/12110 spaces in source path
  2010-10-18 14:27   ` Alan Modra
@ 2010-11-01 23:37     ` DJ Delorie
  0 siblings, 0 replies; 4+ messages in thread
From: DJ Delorie @ 2010-11-01 23:37 UTC (permalink / raw)
  To: Alan Modra; +Cc: Ralf.Wildenhues, gcc-patches, binutils


> Because I cut and pasted this from somewhere else that happened to use
> _m4_popdef.  ;-)  Yes, m4_popdef works fine.

Ok with me.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-01 23:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-12 23:47 PR binutils/12110 spaces in source path Alan Modra
2010-10-13  5:13 ` Ralf Wildenhues
2010-10-18 14:27   ` Alan Modra
2010-11-01 23:37     ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).