This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR binutils/12110 spaces in source path


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'`
>  ])
>  
>  ################################################################################


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]