bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnu-libiconv] windres/RC compilation of libiconv.rc fails


From: Bruno Haible
Subject: Re: [bug-gnu-libiconv] windres/RC compilation of libiconv.rc fails
Date: Wed, 12 Apr 2023 10:36:38 +0200

Philippe Payant wrote:
> I have this issue where my toolchain configuration makes it so that
> libiconv's configure script wants to use the rc.exe from the Windows Kit
> installation.

The INSTALL.windows file explains that the recommended environment for
building GNU libiconv on Windows is Cygwin. There, $(RC) is
i686-w64-mingw32-windres, and the problem does not exist.

> This is fine except for the fact that the full path to
> rc.exe is "C:\Program Files (x86)\Windows
> Kits\10\bin\10.0.22000.0\x64\rc.exe" and this contains spaces.  When the
> compilation of the resource file is launched, the path is not quoted and
> fails:
> 
> /bin/sh ../libtool --mode=compile --tag=RC C:/Program Files (x86)/Windows
> Kits/10/bin/10.0.22000.0/x86/rc.exe `/bin/sh
> /c/users/philippe.payant/.conan/data/libiconv/1.16/_/_/build/164640aad040835ac89882393a96d89200694f04/src/lib/../windows/windres-options
> --escape 1.16` -i
> /c/users/philippe.payant/.conan/data/libiconv/1.16/_/_/build/164640aad040835ac89882393a96d89200694f04/src/lib/../windows/libiconv.rc
> -o libiconv.res.lo --output-format=coff
> 
> /bin/sh: -c: line 1: syntax error near unexpected token `('
> /bin/sh: -c: line 1: `/bin/sh ../libtool --mode=compile --tag=RC C:/Program
> Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/rc.exe `/bin/sh
> /c/users/philippe.payant/.conan/data/libiconv/1.16/_/_/build/164640aad040835ac89882393a96d89200694f04/src/lib/../windows/windres-options
> --escape 1.16` -i
> /c/users/philippe.payant/.conan/data/libiconv/1.16/_/_/build/164640aad040835ac89882393a96d89200694f04/src/lib/../windows/libiconv.rc
> -o libiconv.res.lo --output-format=coff'

I agree with you that the spaces in that file name are probably the cause
of the shell syntax error.

> At lib/Makefile.in, line 99, we have this:
> 
>  $(LIBTOOL_COMPILE) --tag=RC $(RC) `$(SHELL)
> $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i
> $(srcdir)/../windows/libiconv.rc -o libiconv.res.lo --output-format=coff
> 
> I propose to quote $(RC).  Does this make sense?

No, this is not reasonable.

Variables that are supposed to contain command names also may contain options.
It is frequent to set e.g. CC="gcc -m64" on Linux bi-arch systems, AR="ar -X 64"
on 64-bit AIX systems, and so on. The variable RC should be treated in the
same way.

The proper action for you is
  - either to use Cygwin, or
  - copy the rc.exe to a location in your $PATH that does not contain spaces
    and that comes before locations that contain spaces.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]