This is the mail archive of the cygwin mailing list for the Cygwin 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]

AW: [bulk] - Re: Cygwin build scripts in perl


Hello all,


> Von: Christopher Faylor [mailto:cgf-use-the-mailinglist-please@cygwin.com]
> Gesendet: Donnerstag, 25. Februar 2010 16:43
> An: cygwin@cygwin.com
> Betreff: [bulk] - Re: Cygwin build scripts in perl
>
> On Tue, Feb 23, 2010 at 03:30:05PM -0800, Ilguiz Latypov wrote:
> >(a) I found that winsup/cygwin/mkimport specified non-existent file
> >names as arguments to objcopy invocations.  I am not sure why this did
> >not cause build breaks earlier.
> >
> >(b) It appears perl 5.6 and, possibly, perl 5.10 do not implement the
> >"list form of pipe" in calls to "open()",
> >
> >open $my_fd, '-|', $cmd, $arg1, $arg2

Try

use IO::File;

my $dosomething ="ls -al $what";
my $in = IO::File->new("$dosomething |");

while(my $line=$in->getline)
{
        Do what you need to do
}

For additional infos on this issue just use your favored search engine with
Keywords Perl pipe open

For me this stuff works fine and without problems under Cygwin.


> >I got around that by using regular pipes.
> >
> >(c) The Windows native build of perl wrapped into a cygpath-translating
> >script /usr/bin/perl will require protection of drive letters when
> >using a regex in speclib.  I believe this change may still work with
> >Cygwin builds of perl.

With the cygwin port you can use Cygwin:: win_to_posix_path to make
live easier

More info for perl and cygwin :

http://search.cpan.org/~shay/perl/README.cygwin


A nice weekend to everbody
Norbert

> >I am not aware of the purpose of the two scripts that I modified, but
> >the fixes made my build succeed.
>
> It isn't clear from your email what you are attempting to accomplish but
> it sounds like you are trying to build cygwin using a non-cygwin-aware
> version of perl.  If that is the case, then this is not of interest to
> the project or this mailing list.
>
> In the patch below many of the changes are either inexplicable or just
> whitespace so I haven't spent much time trying to figure out if there
> is a bug fix in there.  I suspect that, since many people are building
> the Cygwin DLL, there can't be much of a problem.
>
>
> cgf
>
> >Index: speclib
> >===============================================================
> ====
> >RCS file: /cvs/src/src/winsup/cygwin/speclib,v
> >retrieving revision 1.24
> >diff -d -u -r1.24 speclib
> >--- speclib  30 Nov 2009 15:40:23 -0000      1.24
> >+++ speclib  23 Feb 2010 23:18:37 -0000
> >@@ -13,7 +13,7 @@
> >
> > my ($ar, $as, $nm, $objcopy);
> > GetOptions('exclude=s'=>\@exclude, 'static!'=>\$static, 'v!'=>\$inverse,
> >-       'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy);
> >+           'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy);
>   ^^^^^^^^^^^^
> gratuitous whitespace change
> >
> > $_ = File::Spec->rel2abs($_) for @ARGV;
> >
> >@@ -22,8 +22,11 @@
> > (my $iname = basename $lib) =~ s/\.a$//o;
> > $iname = '_' . $iname . '_dll_iname';
> >
> >-open my $nm_fd, '-|', $nm, '-Apg', '--defined-only', @ARGV, $libdll or
> >-  die "$0: execution of $nm for object files failed - $!\n";
> >+my $qargs = join(" ", map("\"$_\"", @ARGV));
> >+my $cmd_nm = "$nm -Apg --defined-only $qargs \"$libdll\"";
> >+print "Reading from $cmd_nm ...\n";
> >+open my $nm_fd, "$cmd_nm |" or
> >+  die "E: $0: $cmd_nm:\n$!\n";
>          ^^
> inexplicable prepending of "E:" to an error message.
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--------------------------------------------------------------------------
Dipl. Phys.
Norbert Zacharias
Wind Measurements & Power Curve Measurements
DEWI GmbH
Ebertstrasse 96
26382 Wilhelmshaven
Germany


Tel.:   +49 4421 4808 876

Fax:    +49 4421 4808 843


Email:  N.Zacharias@dewi.de
Home:   http://http://www.dewi.de

DEWI GmbH - Deutsches Windenergie-Institut, Wilhelmshaven
Commercial Register No.: Amtsgericht Oldenburg, HRB 130241
Managing Director: Jens Peter Molly
Chairman of the supervisory board: Ministerialrat Dr. Niels Kämpny

P Please consider the environment before printing this email.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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