~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to tests/testcurl.pl

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-05-26 18:58:51 UTC
  • mfrom: (3.3.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090526185851-t1gun9nboi5kbd9u
Tags: 7.19.5-1ubuntu1
* Merge from Debian unstable (LP: #380281), remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* Fixes LP: #379477

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.68 2008-10-02 03:59:25 yangtse 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.68 $';
 
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";
297
305
logit "CFLAGS = ".$ENV{CFLAGS};
298
306
logit "LDFLAGS = ".$ENV{LDFLAGS};
299
307
logit "CC = ".$ENV{CC};
 
308
logit "MAKEFLAGS = ".$ENV{MAKEFLAGS};
300
309
logit "target = ".$targetos;
301
310
logit "version = $version"; # script version
302
311
logit "date = $timestamp";  # When the test build starts
498
507
    system("cp -af ../$CURLDIR/Makefile.dist Makefile");
499
508
    system("$make -i -C lib -f Makefile.netware prebuild");
500
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
    }
501
513
  }
502
514
  elsif ($^O eq 'linux') {
503
515
    system("cp -afr ../$CURLDIR/* .");
505
517
    system("cp -af ../$CURLDIR/include/curl/curlbuild.h.dist ./include/curl/curlbuild.h");
506
518
    system("$make -i -C lib -f Makefile.$targetos prebuild");
507
519
    system("$make -i -C src -f Makefile.$targetos prebuild");
 
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);
508
535
  }
509
536
}
510
537
 
511
538
if(-f "./include/curl/curlbuild.h") {
512
 
  logit "display include/curl/curlbuild.h";
 
539
  logit_spaced "display include/curl/curlbuild.h";
513
540
  if(open(F, "<./include/curl/curlbuild.h")) {
514
541
    while(<F>) {
515
542
      my $ll = $_;
516
 
      print $ll if(($ll =~ /^ *# *define/) && ($ll !~ /__CURL_CURLBUILD_H/));
 
543
      print $ll if(($ll =~ /^ *# *define *CURL_/) && ($ll !~ /__CURL_CURLBUILD_H/));
517
544
    }
518
545
    close(F);
519
546
  }
522
549
  mydie "no curlbuild.h created/found";
523
550
}
524
551
 
525
 
logit "display lib/config$confsuffix.h";
 
552
logit_spaced "display lib/config$confsuffix.h";
526
553
open(F, "lib/config$confsuffix.h") or die "lib/config$confsuffix.h: $!";
527
554
while (<F>) {
528
555
  print if /^ *#/;
530
557
close(F);
531
558
 
532
559
if (grepfile("define USE_ARES", "lib/config$confsuffix.h")) {
 
560
  print "\n";
533
561
  logit "setup to build ares";
534
562
 
535
 
  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";
536
589
  if(open(F, "ares/config$confsuffix.h")) {
537
590
      while (<F>) {
538
591
          print if /^ *#/;
540
593
      close(F);
541
594
  }
542
595
 
 
596
  print "\n";
543
597
  logit "build ares";
544
598
  chdir "ares";
545
599