~ubuntu-branches/ubuntu/natty/curl/natty-proposed

« back to all changes in this revision

Viewing changes to tests/testcurl.pl

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-05-24 21:12:19 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090524211219-7jgcwuhl04ixuqsm
Tags: upstream-7.19.5
ImportĀ upstreamĀ versionĀ 7.19.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#                            | (__| |_| |  _ <| |___
7
7
#                             \___|\___/|_| \_\_____|
8
8
#
9
 
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 
9
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
10
10
#
11
11
# This software is licensed as described in the file COPYING, which
12
12
# you should have received as part of this distribution. The terms
19
19
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20
20
# KIND, either express or implied.
21
21
#
22
 
# $Id: testcurl.pl,v 1.55 2008-03-20 16:10:54 gknauf Exp $
 
22
# $Id: testcurl.pl,v 1.74 2009-05-12 11:24:29 yangtse Exp $
23
23
###########################################################################
24
24
 
25
25
###########################
69
69
            $extvercmd $nocvsup $nobuildconf $crosscompile $timestamp);
70
70
 
71
71
# version of this script
72
 
$version='$Revision: 1.55 $';
 
72
$version='$Revision: 1.74 $';
73
73
$fixed=0;
74
74
 
75
75
# Determine if we're running from CVS or a canned copy of curl,
166
166
  $confsuffix = '-win32';
167
167
}
168
168
 
169
 
 
 
169
$ENV{LC_ALL}="C" if (($ENV{LC_ALL}) && ($ENV{LC_ALL} !~ /^C$/));
 
170
$ENV{LC_CTYPE}="C" if (($ENV{LC_CTYPE}) && ($ENV{LC_CTYPE} !~ /^C$/));
170
171
$ENV{LANG}="C";
171
172
 
172
173
sub rmtree($) {
201
202
    }
202
203
}
203
204
 
 
205
sub logit_spaced($) {
 
206
    my $text=$_[0];
 
207
    if ($text) {
 
208
      print "\ntestcurl: $text\n\n";
 
209
    }
 
210
}
 
211
 
204
212
sub mydie($){
205
213
    my $text=$_[0];
206
214
    logit "$text";
274
282
    close(F);
275
283
}
276
284
 
 
285
# Enable picky compiler warnings unless explicitly disabled
 
286
if (($confopts !~ /--enable-debug/) &&
 
287
    ($confopts !~ /--enable-warnings/) &&
 
288
    ($confopts !~ /--disable-warnings/)) {
 
289
  $confopts .= " --enable-warnings";
 
290
}
 
291
 
277
292
my $str1066os = 'o' x 1066;
278
293
 
279
294
# Set timestamp to the UTC this script is running. Its value might
290
305
logit "CFLAGS = ".$ENV{CFLAGS};
291
306
logit "LDFLAGS = ".$ENV{LDFLAGS};
292
307
logit "CC = ".$ENV{CC};
 
308
logit "MAKEFLAGS = ".$ENV{MAKEFLAGS};
293
309
logit "target = ".$targetos;
294
310
logit "version = $version"; # script version
295
311
logit "date = $timestamp";  # When the test build starts
367
383
  while (!cvsup()) {
368
384
    $att++;
369
385
    logit "failed CVS update attempt number $att.";
370
 
    if ($att > 10) {
 
386
    if ($att > 20) {
371
387
      $cvsstat=111;
372
388
      last; # get out of the loop
373
389
    }
391
407
    unlink "autom4te.cache";
392
408
 
393
409
    # generate the build files
394
 
    logit "invoke buildconf, but filter off the silly aclocal warnings";
 
410
    logit "invoke buildconf, but filter off aclocal underquoted definition warnings";
395
411
    open(F, "./buildconf 2>&1 |") or die;
396
412
    open(LOG, ">$buildlog") or die;
397
413
    while (<F>) {
486
502
    system("xcopy /s /q ..\\$CURLDIR .");
487
503
    system("buildconf.bat");
488
504
  }
489
 
  elsif (($^O eq 'linux') || ($targetos =~ /netware/)) {
490
 
    system("cp -afr ../$CURLDIR/* ."); 
491
 
    system("cp -af ../$CURLDIR/Makefile.dist Makefile"); 
 
505
  elsif ($targetos =~ /netware/) {
 
506
    system("cp -afr ../$CURLDIR/* .");
 
507
    system("cp -af ../$CURLDIR/Makefile.dist Makefile");
 
508
    system("$make -i -C lib -f Makefile.netware prebuild");
 
509
    system("$make -i -C src -f Makefile.netware prebuild");
 
510
    if (-d "../$CURLDIR/ares") {
 
511
      system("$make -i -C ares -f Makefile.netware prebuild");
 
512
    }
 
513
  }
 
514
  elsif ($^O eq 'linux') {
 
515
    system("cp -afr ../$CURLDIR/* .");
 
516
    system("cp -af ../$CURLDIR/Makefile.dist Makefile");
 
517
    system("cp -af ../$CURLDIR/include/curl/curlbuild.h.dist ./include/curl/curlbuild.h");
492
518
    system("$make -i -C lib -f Makefile.$targetos prebuild");
493
519
    system("$make -i -C src -f Makefile.$targetos prebuild");
494
 
  }
495
 
}
496
 
 
497
 
logit "display lib/config$confsuffix.h";
 
520
    if (-d "../$CURLDIR/ares") {
 
521
      system("cp -af ../$CURLDIR/ares/ares_build.h.dist ./ares/ares_build.h");
 
522
      system("$make -i -C ares -f Makefile.$targetos prebuild");
 
523
    }
 
524
  }
 
525
}
 
526
 
 
527
if(-f "./libcurl.pc") {
 
528
  logit_spaced "display libcurl.pc";
 
529
  if(open(F, "<./libcurl.pc")) {
 
530
    while(<F>) {
 
531
      my $ll = $_;
 
532
      print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/));
 
533
    }
 
534
    close(F);
 
535
  }
 
536
}
 
537
 
 
538
if(-f "./include/curl/curlbuild.h") {
 
539
  logit_spaced "display include/curl/curlbuild.h";
 
540
  if(open(F, "<./include/curl/curlbuild.h")) {
 
541
    while(<F>) {
 
542
      my $ll = $_;
 
543
      print $ll if(($ll =~ /^ *# *define *CURL_/) && ($ll !~ /__CURL_CURLBUILD_H/));
 
544
    }
 
545
    close(F);
 
546
  }
 
547
}
 
548
else {
 
549
  mydie "no curlbuild.h created/found";
 
550
}
 
551
 
 
552
logit_spaced "display lib/config$confsuffix.h";
498
553
open(F, "lib/config$confsuffix.h") or die "lib/config$confsuffix.h: $!";
499
554
while (<F>) {
500
555
  print if /^ *#/;
502
557
close(F);
503
558
 
504
559
if (grepfile("define USE_ARES", "lib/config$confsuffix.h")) {
 
560
  print "\n";
505
561
  logit "setup to build ares";
506
562
 
507
 
  logit "display ares/config$confsuffix.h";
 
563
  if(-f "./ares/libcares.pc") {
 
564
    logit_spaced  "display ares/libcares.pc";
 
565
    if(open(F, "<./ares/libcares.pc")) {
 
566
      while(<F>) {
 
567
        my $ll = $_;
 
568
        print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/));
 
569
      }
 
570
      close(F);
 
571
    }
 
572
  }
 
573
 
 
574
  if(-f "./ares/ares_build.h") {
 
575
    logit_spaced "display ares/ares_build.h";
 
576
    if(open(F, "<./ares/ares_build.h")) {
 
577
      while(<F>) {
 
578
        my $ll = $_;
 
579
        print $ll if(($ll =~ /^ *# *define *CARES_/) && ($ll !~ /__CARES_BUILD_H/));
 
580
      }
 
581
      close(F);
 
582
    }
 
583
  }
 
584
  else {
 
585
    mydie "no ares_build.h created/found";
 
586
  }
 
587
 
 
588
  logit_spaced "display ares/config$confsuffix.h";
508
589
  if(open(F, "ares/config$confsuffix.h")) {
509
590
      while (<F>) {
510
591
          print if /^ *#/;
512
593
      close(F);
513
594
  }
514
595
 
 
596
  print "\n";
515
597
  logit "build ares";
516
598
  chdir "ares";
517
599