spstansbury has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to build Perl with threading turned off in a Cygwin environment, but it's failing as shown here:

cp op.c opmini.c `sh cflags "optimize='-O2'" opmini.o` -DPERL_EXTERNAL_GLOB opmini.c CCCMD = gcc -DPERL_CORE -c -DPERL_USE_SAFE_PUTENV -U__STRICT_AN +SI__ -fno-strict-aliasing -pipe -std=c89 -O2 -Wall -ansi -W -Wextr +a -Wdeclaration-after-statement -Wendif-labels PATH=/home/Administrator/perl/perl-5.10.0:.:/usr/local/bin:/usr/bin:/b +in:/usr/X11R6/bin:/cygdrive/c/Perl64/site/bin:/cygdrive/c/Perl64/bin: +/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/ +System32/Wbem:/cygdrive/c/Program\ Files\ (x86)/Microsoft\ SQL\ Serve +r/100/Tools/Binn/:/cygdrive/c/Program\ Files/Microsoft\ SQL\ Server/1 +00/Tools/Binn/:/cygdrive/c/Program\ Files/Microsoft\ SQL\ Server/100/ +DTS/Binn/:/cygdrive/c/Program\ Files\ (x86)/Microsoft\ SQL\ Server/10 +0/Tools/Binn/VSShell/Common7/IDE/:/cygdrive/c/Program\ Files\ (x86)/M +icrosoft\ SQL\ Server/100/DTS/Binn/:/cygdrive/c/Program\ Files\ (x86) +/Microsoft\ Visual\ Studio\ 9.0/Common7/IDE/PrivateAssemblies/:/cygdr +ive/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/lib/lapack:/usr/l +ocal:/etc:/usr/lib:/lib:/sbin:/usr/sbin:/usr/libexec gcc -L/home/Admi +nistrator/perl/perl-5.10.0 -Wl,--enable-auto-import -Wl,--export-all +-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base -Wl,--enabl +e-auto-import -L/usr/local/lib -o miniperl miniperlmain.o opmini.o li +bperl.a -ldl -lcrypt -lgdbm_compat /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `PATH=/home/Administrator/perl/perl-5.10.0:.:/usr +/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Perl64/site/bin:/ +cygdrive/c/Perl64/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Window +s:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Program\ Files\ (x86) +/Microsoft\ SQL\ Server/100/Tools/Binn/:/cygdrive/c/Program\ Files/Mi +crosoft\ SQL\ Server/100/Tools/Binn/:/cygdrive/c/Program\ Files/Micro +soft\ SQL\ Server/100/DTS/Binn/:/cygdrive/c/Program\ Files\ (x86)/Mic +rosoft\ SQL\ Server/100/Tools/Binn/VSShell/Common7/IDE/:/cygdrive/c/P +rogram\ Files\ (x86)/Microsoft\ SQL\ Server/100/DTS/Binn/:/cygdrive/c +/Program\ Files\ (x86)/Microsoft\ Visual\ Studio\ 9.0/Common7/IDE/Pri +vateAssemblies/:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0/: +/usr/lib/lapack:/usr/local:/etc:/usr/lib:/lib:/sbin:/usr/sbin:/usr/li +bexec gcc -L/home/Administrator/perl/perl-5.10.0 -Wl,--enable-auto-i +mport -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto- +image-base -Wl,--enable-auto-import -L/usr/local/lib -o miniperl mini +perlmain.o opmini.o libperl.a -ldl -lcrypt -lgdbm_compat ' make: *** [miniperl.exe] Error 2

Any pointers on where to fix the syntax?

As always, thanks for your support!


Replies are listed 'Best First'.
Re: Error building Perl under cygwin
by almut (Canon) on May 28, 2009 at 17:56 UTC

    Looks like it's tripping over the (x86) parts in your PATH.  So, the first thing I would try is to get rid of those four paths (I wouldn't know why you would need them for building Perl), and then start again...

      That worked. Thank you!

      Everything seemed to compile properly, but make test failed:

      Failed Test Stat Wstat Total Fail List of Failed ---------------------------------------------------------------------- +--------- ../ext/IPC/SysV/t/ipcsysv.t 1 256 17 34 1-17 ../ext/IPC/SysV/t/msg.t 0 12 ?? ?? ?? ../ext/IPC/SysV/t/sem.t 0 12 ?? ?? ?? ../ext/Sys/Syslog/t/syslog.t 1 256 199 1 176 ../ext/Time/HiRes/t/HiRes.t 0 15 38 0 ?? op/taint.t 0 12 267 236 150-267 76 tests and 853 subtests skipped. Failed 6/1482 test scripts. 136/188699 subtests failed. Files=1482, Tests=188699, 1246 wallclock secs (343.98 cusr + 256.92 cs +ys = 600.89 CPU) Failed 6/1482 test programs. 136/188699 subtests failed.

      Any and all ideas welcome...

        It's hard to diagnose remotely why those tests failed...  As a start, you could try to run those failing tests manually, e.g.

        $ PERL_CORE=1 ./perl ext/IPC/SysV/t/ipcsysv.t

        (run this from the main build directory wherein the new perl has been created)

        You should then see more output which might help figuring out what's wrong.  Also look at the respective .t sources to see what exactly those tests are testing...