This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Compiling on cygwin
Hello, and please Cc: me on replies,
NightStrike <nightstrike <at> gmail.com> writes:
>
> While compiling binutils on cygwin, one of the first steps is the
> target "configure-intl". This results in a sed failure with cygwin's
> latest version of sed, 4.1.5-2:
There are several things that look weird in this output:
> $ make configure-intl
> r=`${PWDCMD-pwd}`; export r; \
> s=`cd ../src; ${PWDCMD-pwd}`; export s; \
> test ! -f ./intl/Makefile || exit 0; \
> /bin/sh ../src/mkinstalldirs ./intl ; \
> FLEX="flex"; export FLEX; LEX="flex"; export LEX;
> BISON="bison"; export BISON; YACC="bison -y"; export YACC;
> "m4"; export M4; MAKEINFO="makeinfo"; export MAKEINFO; CC="gcc";
> export CC; CFLAGS="-g -O2"; export CFLAGS; CONFIG_S
> ="/bin/sh"; export CONFIG_SHELL; CXX="g++"; export CXX; CXXFLAGS="-g
The 'HELL' bit from CONFIG_SHELL is missing. IOW, your output is garbled.
Please repost with non-garbled output. If your mailer can't do that,
then create an attachment to do so.
> -O2"; export CXXFLAGS; AR="ar"; export AR; AS="
> export AS; CC_FOR_BUILD="gcc"; export CC_FOR_BUILD;
> DLLTOOL="dlltool"; export DLLTOOL; LD="/usr/lib/gcc/i686-pc-cyg
> 3.4.4/../../../../i686-pc-cygwin/bin/ld.exe"; export LD; LDFLAGS="";
> export LDFLAGS; NM="nm"; export NM; RANLIB="ran
> ; export RANLIB; WINDRES="windres"; export WINDRES; WINDMC="windmc";
> export WINDMC; OBJCOPY=""; export OBJCOPY; OBJD
> "objdump"; export OBJDUMP; AR_FOR_TARGET="$r/./binutils/ar"; export
> AR_FOR_TARGET; AS_FOR_TARGET="$r/./gas/as-new";
> rt AS_FOR_TARGET; GCC_FOR_TARGET=" x86_64-pc-mingw32-gcc
> -L$r/x86_64-pc-mingw32/winsup/mingw -L$r/x86_64-pc-mingw32/
> up/w32api/lib -isystem $s/winsup/mingw/include -isystem
> $s/winsup/w32api/include -L$r/./ld"; export GCC_FOR_TARGET;
> OR_TARGET="$r/./ld/ld-new"; export LD_FOR_TARGET;
> NM_FOR_TARGET="$r/./binutils/nm-new"; export NM_FOR_TARGET; OBJDUM
> R_TARGET="$r/./binutils/objdump"; export OBJDUMP_FOR_TARGET;
> RANLIB_FOR_TARGET="$r/./binutils/ranlib"; export RANLIB
> _TARGET; TOPLEVEL_CONFIGURE_ARGUMENTS="../src/configure
> --prefix=/tmp/root-x86_64-pc-linux --with-sysroot=/tmp/root-
> 64-pc-linux --target=x86_64-pc-mingw32"; export
> TOPLEVEL_CONFIGURE_ARGUMENTS; GMPLIBS="-lmpfr -lgmp"; export GMPLIBS
> PINC=""; export GMPINC; LD_LIBRARY_PATH=`echo
> "$r/./bfd/.libs:$r/./prev-bfd/.libs:$r/./opcodes/.libs:$r/./prev-opcod
> libs:$LD_LIBRARY_PATH" | sed 's,::*,:,g;s,^:*,,;s,:*$,,'`; export
> LD_LIBRARY_PATH; \
> echo Configuring in ./intl; \
> cd "./intl" || exit 1; \
> case ../src in \
> /* | [A-Za-z]:[\\/]*) topdir=../src ;; \
> *) topdir=`echo ./intl/ | \
> sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `../src ;; \
> esac; \
> srcdiroption="--srcdir=${topdir}/intl"; \
> libsrcdir="$s/intl"; \
> /bin/sh ${libsrcdir}/configure \
> --cache-file=./config.cache --with-gnu-as --with-gnu-ld
> '--prefix=/tmp/root-x86_64-pc-linux' '--with-sysr
Characters missing here as well.
> /tmp/root-x86_64-pc-linux'
> --program-transform-name='s,^,x86_64-pc-mingw32-,'
> --build=i686-pc-cygwin --host=i686-pc-
> in \
> --target=x86_64-pc-mingw32 ${srcdiroption} \
> || exit 1
> Configuring in ./intl
> /usr/bin/sed: -e expression #1, char 6: unterminated `s' command
This is the weirdest of all: there is nothing here that calls /usr/bin/sed.
The makefiles and configure scripts only ever call plain sed. Has Cygwin
hacked sed to output a full path even in that case?
The first idea that comes to mind is that the error is from
> *) topdir=`echo ./intl/ | \
> sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `../src ;; \
with your shell doing weird path translation like MSYS does.
But of course Cygwin sh doesn't do that.
> configure: error: expected an absolute directory name for --prefix: 0
> make: *** [configure-intl] Error 1
Can you please look at the output of
make configure-intl SHELL=/bin/sh\ -x
to find out what is happening? (If you must post, then post only the
initial part of it).
Hmm, you use --program-prefix=x86_64-pc-mingw32, maybe that exposes the
problematic code. The trace, for me, contains
++ echo '--program-transform-name=s,^,x86_64-pc-mingw32,'
++ sed 's/'\''/'\''\\'\'''\''/g'
which is to quote single quotes.
The other possible contender for being buggy is expr. configure does
something like
++ expr x--prefix=/tmp/root-x86_64-pc-linux : 'x[^=]*=\(.*\)'
+ ac_optarg=/tmp/root-x86_64-pc-linux
+ case $ac_option in
+ prefix=/tmp/root-x86_64-pc-linux
and if either your expr is broken, or the shell munges the third argument,
then $prefix could be set to 0.
Hope that helps.
Cheers,
Ralf