2004-03-25 07:16:42 -05:00
|
|
|
#!/usr/bin/env perl
|
2004-03-23 11:07:02 -05:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
2009-04-27 15:21:45 -04:00
|
|
|
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2004-03-23 11:07:02 -05:00
|
|
|
#
|
|
|
|
# This software is licensed as described in the file COPYING, which
|
|
|
|
# you should have received as part of this distribution. The terms
|
|
|
|
# are also available at http://curl.haxx.se/docs/copyright.html.
|
|
|
|
#
|
|
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
###########################
|
|
|
|
# What is This Script?
|
|
|
|
###########################
|
|
|
|
|
|
|
|
# testcurl.pl is the master script to use for automatic testing of CVS-curl.
|
|
|
|
# This is written for the purpose of being run from a crontab job or similar
|
2005-03-15 07:13:37 -05:00
|
|
|
# at a regular interval. The output is suitable to be mailed to
|
|
|
|
# curl-autocompile@haxx.se to be dealt with automatically (make sure the
|
|
|
|
# subject includes the word "autobuild" as the mail gets silently discarded
|
|
|
|
# otherwise). The most current build status (with a resonable backlog) will
|
|
|
|
# be published on the curl site, at http://curl.haxx.se/auto/
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
# USAGE:
|
2005-03-15 02:35:36 -05:00
|
|
|
# testcurl.pl [options] [curl-daily-name] > output
|
2004-03-23 11:07:02 -05:00
|
|
|
|
2005-03-15 02:35:36 -05:00
|
|
|
# Options:
|
|
|
|
#
|
|
|
|
# --configure=[options] Configure options
|
|
|
|
# --crosscompile This is a crosscompile
|
|
|
|
# --desc=[desc] Description of your test system
|
|
|
|
# --email=[email] Set email address to report as
|
2008-03-20 12:10:54 -04:00
|
|
|
# --extvercmd=[command] Command to use for displaying version with cross compiles.
|
2005-03-15 02:35:36 -05:00
|
|
|
# --mktarball=[command] Command to run after completed test
|
|
|
|
# --name=[name] Set name to report as
|
|
|
|
# --nocvsup Don't update from CVS even though it is a CVS tree
|
2005-05-20 07:24:55 -04:00
|
|
|
# --nobuildconf Don't run buildconf
|
2005-03-18 13:03:38 -05:00
|
|
|
# --runtestopts=[options] Options to pass to runtests.pl
|
2005-03-15 02:35:36 -05:00
|
|
|
# --setup=[file name] File name to read setup from (deprecated)
|
|
|
|
# --target=[your os] Specify your target environment.
|
|
|
|
#
|
|
|
|
# if [curl-daily-name] is omitted, a 'curl' CVS directory is assumed.
|
|
|
|
#
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
use Cwd;
|
|
|
|
|
2004-03-25 07:16:42 -05:00
|
|
|
# Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env)
|
2005-03-15 02:35:36 -05:00
|
|
|
#BEGIN { $^W = 1; }
|
2004-03-25 07:16:42 -05:00
|
|
|
|
2004-06-22 16:02:49 -04:00
|
|
|
use vars qw($version $fixed $infixed $CURLDIR $CVS $pwd $build $buildlog
|
2005-03-15 02:35:36 -05:00
|
|
|
$buildlogname $configurebuild $targetos $confsuffix $binext
|
|
|
|
$libext);
|
2005-03-16 19:57:17 -05:00
|
|
|
use vars qw($name $email $desc $confopts $runtestopts $setupfile $mktarball
|
2008-03-20 12:10:54 -04:00
|
|
|
$extvercmd $nocvsup $nobuildconf $crosscompile $timestamp);
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
# version of this script
|
|
|
|
$version='$Revision$';
|
|
|
|
$fixed=0;
|
|
|
|
|
2004-06-22 16:02:49 -04:00
|
|
|
# Determine if we're running from CVS or a canned copy of curl,
|
2004-06-29 09:20:37 -04:00
|
|
|
# or if we got a specific target option or setup file option.
|
2004-06-22 16:02:49 -04:00
|
|
|
$CURLDIR="curl";
|
|
|
|
$CVS=1;
|
2004-06-29 09:20:37 -04:00
|
|
|
$setupfile = 'setup';
|
|
|
|
while ($ARGV[0]) {
|
2004-06-22 16:02:49 -04:00
|
|
|
if ($ARGV[0] =~ /--target=/) {
|
2004-06-29 09:20:37 -04:00
|
|
|
$targetos = (split(/=/, shift @ARGV))[1];
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--setup=/) {
|
2004-06-29 09:20:37 -04:00
|
|
|
$setupfile = (split(/=/, shift @ARGV))[1];
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
2008-03-20 12:10:54 -04:00
|
|
|
elsif ($ARGV[0] =~ /--extvercmd=/) {
|
|
|
|
$extvercmd = (split(/=/, shift @ARGV))[1];
|
|
|
|
}
|
2005-03-15 02:35:36 -05:00
|
|
|
elsif ($ARGV[0] =~ /--mktarball=/) {
|
2004-07-05 18:35:00 -04:00
|
|
|
$mktarball = (split(/=/, shift @ARGV))[1];
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--name=/) {
|
|
|
|
$name = (split(/=/, shift @ARGV))[1];
|
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--email=/) {
|
|
|
|
$email = (split(/=/, shift @ARGV))[1];
|
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--desc=/) {
|
|
|
|
$desc = (split(/=/, shift @ARGV))[1];
|
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--configure=/) {
|
|
|
|
$confopts = (split(/=/, shift @ARGV))[1];
|
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--nocvsup/) {
|
|
|
|
$nocvsup=1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-05-20 07:24:55 -04:00
|
|
|
elsif ($ARGV[0] =~ /--nobuildconf/) {
|
|
|
|
$nobuildconf=1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-03-15 02:35:36 -05:00
|
|
|
elsif ($ARGV[0] =~ /--crosscompile/) {
|
|
|
|
$crosscompile=1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-03-16 19:57:17 -05:00
|
|
|
elsif ($ARGV[0] =~ /--runtestopts=/) {
|
|
|
|
$runtestopts = (split(/=/, shift @ARGV, 2))[1];
|
|
|
|
}
|
2005-03-15 02:35:36 -05:00
|
|
|
else {
|
2004-06-29 09:20:37 -04:00
|
|
|
$CURLDIR=shift @ARGV;
|
2004-06-22 16:02:49 -04:00
|
|
|
$CVS=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Do the platform-specific stuff here
|
2005-03-15 02:35:36 -05:00
|
|
|
$configurebuild = 1;
|
2004-06-22 16:02:49 -04:00
|
|
|
$confsuffix = '';
|
|
|
|
$binext = '';
|
2004-07-25 02:03:10 -04:00
|
|
|
$libext = '.la'; # .la since both libcurl and libcares are made with libtool
|
2005-03-15 02:35:36 -05:00
|
|
|
if ($^O eq 'MSWin32' || $targetos) {
|
|
|
|
if (!$targetos) {
|
2004-06-22 16:02:49 -04:00
|
|
|
# If no target defined on Win32 lets assume vc
|
|
|
|
$targetos = 'vc';
|
|
|
|
}
|
2006-05-27 07:36:05 -04:00
|
|
|
if ($targetos =~ /vc/ || $targetos =~ /borland/) {
|
2004-06-22 16:02:49 -04:00
|
|
|
$binext = '.exe';
|
2006-05-27 07:36:05 -04:00
|
|
|
$libext = '.lib';
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
2007-01-18 15:32:46 -05:00
|
|
|
elsif ($targetos =~ /mingw32/) {
|
|
|
|
$binext = '.exe';
|
2007-01-25 09:06:38 -05:00
|
|
|
if ($^O eq 'MSWin32') {
|
|
|
|
$libext = '.a';
|
|
|
|
}
|
2007-01-18 15:32:46 -05:00
|
|
|
}
|
2005-03-15 02:35:36 -05:00
|
|
|
elsif ($targetos =~ /netware/) {
|
2005-03-18 13:03:38 -05:00
|
|
|
$configurebuild = 0;
|
2004-06-22 16:02:49 -04:00
|
|
|
$binext = '.nlm';
|
2007-03-26 13:18:36 -04:00
|
|
|
if ($^O eq 'MSWin32') {
|
|
|
|
$libext = '.lib';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$libext = '.a';
|
|
|
|
}
|
2004-06-22 16:02:49 -04:00
|
|
|
}
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
2006-05-27 07:36:05 -04:00
|
|
|
if (($^O eq 'MSWin32') &&
|
|
|
|
($targetos =~ /vc/ || $targetos =~ /mingw32/ || $targetos =~ /borland/)) {
|
2005-03-15 02:35:36 -05:00
|
|
|
|
2005-08-11 14:02:09 -04:00
|
|
|
# Set these things only when building ON Windows and for Win32 platform.
|
2005-03-15 02:35:36 -05:00
|
|
|
# FOR Windows since we might be cross-compiling on another system. Non-
|
|
|
|
# Windows builds still default to configure-style builds with no confsuffix.
|
|
|
|
|
|
|
|
$configurebuild = 0;
|
|
|
|
$confsuffix = '-win32';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-03-23 11:07:02 -05:00
|
|
|
$ENV{LANG}="C";
|
|
|
|
|
|
|
|
sub rmtree($) {
|
|
|
|
my $target = $_[0];
|
|
|
|
if ($^O eq 'MSWin32') {
|
|
|
|
foreach (glob($target)) {
|
|
|
|
s:/:\\:g;
|
|
|
|
system("rd /s /q $_");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
system("rm -rf $target");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub grepfile($$) {
|
|
|
|
my ($target, $fn) = @_;
|
|
|
|
open(F, $fn) or die;
|
|
|
|
while (<F>) {
|
|
|
|
if (/$target/) {
|
|
|
|
close(F);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub logit($) {
|
|
|
|
my $text=$_[0];
|
|
|
|
if ($text) {
|
|
|
|
print "testcurl: $text\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub mydie($){
|
|
|
|
my $text=$_[0];
|
|
|
|
logit "$text";
|
|
|
|
chdir $pwd; # cd back to the original root dir
|
|
|
|
|
|
|
|
if ($pwd && $build) {
|
|
|
|
# we have a build directory name, remove the dir
|
|
|
|
logit "removing the $build dir";
|
|
|
|
rmtree "$pwd/$build";
|
|
|
|
}
|
|
|
|
if (-r $buildlog) {
|
|
|
|
# we have a build log output file left, remove it
|
|
|
|
logit "removing the $buildlogname file";
|
|
|
|
unlink "$buildlog";
|
|
|
|
}
|
|
|
|
logit "ENDING HERE"; # last line logged!
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
2004-06-29 09:20:37 -04:00
|
|
|
if (open(F, "$setupfile")) {
|
2004-03-23 11:07:02 -05:00
|
|
|
while (<F>) {
|
|
|
|
if (/(\w+)=(.*)/) {
|
|
|
|
eval "\$$1=$2;";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
$infixed=$fixed;
|
|
|
|
} else {
|
2004-07-05 17:32:18 -04:00
|
|
|
$infixed=0; # so that "additional args to configure" works properly first time...
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!$name) {
|
|
|
|
print "please enter your name\n";
|
|
|
|
$name = <>;
|
|
|
|
chomp $name;
|
|
|
|
$fixed=1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$email) {
|
|
|
|
print "please enter your contact email address\n";
|
|
|
|
$email = <>;
|
|
|
|
chomp $email;
|
|
|
|
$fixed=2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$desc) {
|
|
|
|
print "please enter a one line system description\n";
|
|
|
|
$desc = <>;
|
|
|
|
chomp $desc;
|
|
|
|
$fixed=3;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$confopts) {
|
|
|
|
if ($infixed < 4) {
|
|
|
|
print "please enter your additional arguments to configure\n";
|
|
|
|
print "examples: --with-ssl --enable-debug --enable-ipv6 --with-krb4\n";
|
|
|
|
$confopts = <>;
|
|
|
|
chomp $confopts;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-10 19:20:30 -05:00
|
|
|
if ($fixed < 4) {
|
2005-03-15 02:35:36 -05:00
|
|
|
$fixed=4;
|
|
|
|
open(F, ">$setupfile") or die;
|
|
|
|
print F "name='$name'\n";
|
|
|
|
print F "email='$email'\n";
|
|
|
|
print F "desc='$desc'\n";
|
|
|
|
print F "confopts='$confopts'\n";
|
|
|
|
print F "fixed='$fixed'\n";
|
|
|
|
close(F);
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
2008-10-01 23:59:25 -04:00
|
|
|
# Enable picky compiler warnings unless explicitly disabled
|
|
|
|
if (($confopts !~ /--enable-debug/) &&
|
|
|
|
($confopts !~ /--enable-warnings/) &&
|
|
|
|
($confopts !~ /--disable-warnings/)) {
|
|
|
|
$confopts .= " --enable-warnings";
|
|
|
|
}
|
|
|
|
|
2007-02-27 18:46:48 -05:00
|
|
|
my $str1066os = 'o' x 1066;
|
|
|
|
|
2007-02-20 00:28:41 -05:00
|
|
|
# Set timestamp to the UTC this script is running. Its value might
|
|
|
|
# be changed later in the script to the value present in curlver.h
|
|
|
|
$timestamp = scalar(gmtime)." UTC";
|
|
|
|
|
2005-03-15 02:35:36 -05:00
|
|
|
logit "STARTING HERE"; # first line logged, for scripts to trigger on
|
2007-02-27 18:46:48 -05:00
|
|
|
logit 'TRANSFER CONTROL ==== 1120 CHAR LINE' . $str1066os . 'LINE_END';
|
2004-03-23 11:07:02 -05:00
|
|
|
logit "NAME = $name";
|
|
|
|
logit "EMAIL = $email";
|
|
|
|
logit "DESC = $desc";
|
|
|
|
logit "CONFOPTS = $confopts";
|
2005-12-13 14:07:33 -05:00
|
|
|
logit "CPPFLAGS = ".$ENV{CPPFLAGS};
|
2005-03-14 07:26:29 -05:00
|
|
|
logit "CFLAGS = ".$ENV{CFLAGS};
|
|
|
|
logit "LDFLAGS = ".$ENV{LDFLAGS};
|
|
|
|
logit "CC = ".$ENV{CC};
|
2009-04-27 15:21:45 -04:00
|
|
|
logit "MAKEFLAGS = ".$ENV{MAKEFLAGS};
|
2005-03-14 07:26:29 -05:00
|
|
|
logit "target = ".$targetos;
|
2005-03-15 02:35:36 -05:00
|
|
|
logit "version = $version"; # script version
|
2007-02-20 00:28:41 -05:00
|
|
|
logit "date = $timestamp"; # When the test build starts
|
2004-03-23 11:07:02 -05:00
|
|
|
|
2007-02-27 18:46:48 -05:00
|
|
|
$str1066os = undef;
|
|
|
|
|
2004-03-23 11:07:02 -05:00
|
|
|
# Make $pwd to become the path without newline. We'll use that in order to cut
|
|
|
|
# off that path from all possible logs and error messages etc.
|
2007-12-20 16:21:43 -05:00
|
|
|
$pwd = getcwd();
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
if (-d $CURLDIR) {
|
|
|
|
if ($CVS && -d "$CURLDIR/CVS") {
|
2004-06-29 09:20:37 -04:00
|
|
|
logit "$CURLDIR is verified to be a fine source dir";
|
2004-03-23 11:07:02 -05:00
|
|
|
# remove the generated sources to force them to be re-generated each
|
|
|
|
# time we run this test
|
|
|
|
unlink "$CURLDIR/src/hugehelp.c";
|
2004-03-25 06:39:29 -05:00
|
|
|
} elsif (!$CVS && -f "$CURLDIR/tests/testcurl.pl") {
|
2004-06-29 09:20:37 -04:00
|
|
|
logit "$CURLDIR is verified to be a fine daily source dir"
|
2004-03-23 11:07:02 -05:00
|
|
|
} else {
|
2004-06-29 09:20:37 -04:00
|
|
|
mydie "$CURLDIR is not a daily source dir or checked out from CVS!"
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
$build="build-$$";
|
|
|
|
$buildlogname="buildlog-$$";
|
|
|
|
$buildlog="$pwd/$buildlogname";
|
|
|
|
|
|
|
|
# remove any previous left-overs
|
|
|
|
rmtree "build-*";
|
|
|
|
rmtree "buildlog-*";
|
|
|
|
|
|
|
|
# this is to remove old build logs that ended up in the wrong dir
|
|
|
|
foreach (glob("$CURLDIR/buildlog-*")) { unlink $_; }
|
|
|
|
|
|
|
|
# create a dir to build in
|
2004-03-24 16:28:31 -05:00
|
|
|
mkdir $build, 0777;
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
if (-d $build) {
|
|
|
|
logit "build dir $build was created fine";
|
|
|
|
} else {
|
|
|
|
mydie "failed to create dir $build";
|
|
|
|
}
|
|
|
|
|
|
|
|
# get in the curl source tree root
|
|
|
|
chdir $CURLDIR;
|
|
|
|
|
|
|
|
# Do the CVS thing, or not...
|
|
|
|
if ($CVS) {
|
|
|
|
|
|
|
|
# this is a temporary fix to make things work again, remove later
|
|
|
|
logit "remove ares/aclocal.m4";
|
|
|
|
unlink "ares/aclocal.m4";
|
|
|
|
|
|
|
|
logit "update from CVS";
|
|
|
|
my $cvsstat;
|
|
|
|
|
|
|
|
sub cvsup() {
|
|
|
|
# update quietly to the latest CVS
|
2005-03-15 02:35:36 -05:00
|
|
|
if($nocvsup) {
|
|
|
|
logit "Skipping CVS update (--nocvsup)";
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else {
|
2007-04-01 09:59:50 -04:00
|
|
|
logit "run cvs up";
|
2005-03-15 02:35:36 -05:00
|
|
|
system("cvs -Q up -dP 2>&1");
|
|
|
|
}
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
$cvsstat=$?;
|
|
|
|
|
|
|
|
# return !RETURNVALUE so that errors return 0 while goodness
|
|
|
|
# returns 1
|
|
|
|
return !$cvsstat;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $att=0;
|
|
|
|
while (!cvsup()) {
|
|
|
|
$att++;
|
|
|
|
logit "failed CVS update attempt number $att.";
|
2008-08-22 14:18:20 -04:00
|
|
|
if ($att > 20) {
|
2004-03-23 11:07:02 -05:00
|
|
|
$cvsstat=111;
|
|
|
|
last; # get out of the loop
|
|
|
|
}
|
|
|
|
sleep 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($cvsstat != 0) {
|
|
|
|
mydie "failed to update from CVS ($cvsstat), exiting";
|
|
|
|
}
|
2007-02-20 00:28:41 -05:00
|
|
|
elsif (!$nocvsup) {
|
|
|
|
# Set timestamp to the UTC the CVS update took place.
|
|
|
|
$timestamp = scalar(gmtime)." UTC";
|
|
|
|
}
|
2004-03-23 11:07:02 -05:00
|
|
|
|
2005-05-20 07:24:55 -04:00
|
|
|
if($nobuildconf) {
|
|
|
|
logit "told to not run buildconf";
|
|
|
|
}
|
|
|
|
elsif ($configurebuild) {
|
|
|
|
# remove possible left-overs from the past
|
|
|
|
unlink "configure";
|
|
|
|
unlink "autom4te.cache";
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
# generate the build files
|
2008-07-30 21:41:20 -04:00
|
|
|
logit "invoke buildconf, but filter off aclocal underquoted definition warnings";
|
2004-03-23 11:07:02 -05:00
|
|
|
open(F, "./buildconf 2>&1 |") or die;
|
|
|
|
open(LOG, ">$buildlog") or die;
|
|
|
|
while (<F>) {
|
2008-07-30 00:42:16 -04:00
|
|
|
next if /warning: underquoted definition of/;
|
2004-03-23 11:07:02 -05:00
|
|
|
print;
|
|
|
|
print LOG;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
close(LOG);
|
|
|
|
|
|
|
|
if (grepfile("^buildconf: OK", $buildlog)) {
|
2004-07-05 17:32:18 -04:00
|
|
|
logit "buildconf was successful";
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
else {
|
2004-07-05 17:32:18 -04:00
|
|
|
mydie "buildconf was NOT successful";
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
logit "buildconf was successful (dummy message)";
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-20 00:28:41 -05:00
|
|
|
# Set timestamp to the one in curlver.h if this isn't a CVS test build.
|
2007-02-22 12:34:02 -05:00
|
|
|
if ((-f "include/curl/curlver.h") &&
|
|
|
|
(open(F, "<include/curl/curlver.h"))) {
|
2007-02-20 00:28:41 -05:00
|
|
|
while (<F>) {
|
|
|
|
chomp;
|
|
|
|
if ($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) {
|
|
|
|
my $stampstring = $1;
|
|
|
|
if ($stampstring !~ /CVS/) {
|
|
|
|
$stampstring =~ s/\s+UTC//;
|
|
|
|
$timestamp = $stampstring." UTC";
|
|
|
|
}
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Show timestamp we are using for this test build.
|
|
|
|
logit "timestamp = $timestamp";
|
|
|
|
|
2005-03-15 02:35:36 -05:00
|
|
|
if ($configurebuild) {
|
2004-03-23 11:07:02 -05:00
|
|
|
if (-f "configure") {
|
2005-05-20 07:24:55 -04:00
|
|
|
logit "configure created (at least it exists)";
|
2004-03-23 11:07:02 -05:00
|
|
|
} else {
|
2005-05-20 07:24:55 -04:00
|
|
|
mydie "no configure created/found";
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
logit "configure created (dummy message)"; # dummy message to feign success
|
|
|
|
}
|
|
|
|
|
2005-05-17 08:07:08 -04:00
|
|
|
sub findinpath {
|
2005-08-30 14:37:08 -04:00
|
|
|
my $c;
|
|
|
|
my $e;
|
|
|
|
my $x='';
|
|
|
|
$x='.exe' if ($^O eq 'MSWin32');
|
|
|
|
my $s=':';
|
|
|
|
$s=';' if ($^O eq 'MSWin32');
|
|
|
|
my $p=$ENV{'PATH'};
|
|
|
|
my @pa = split($s, $p);
|
|
|
|
for $c (@_) {
|
|
|
|
for $e (@pa) {
|
|
|
|
if( -x "$e/$c$x") {
|
|
|
|
return $c;
|
|
|
|
}
|
2005-05-17 08:07:08 -04:00
|
|
|
}
|
2005-08-30 14:37:08 -04:00
|
|
|
}
|
2005-05-17 08:07:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
my $make = findinpath("gmake", "make", "nmake");
|
|
|
|
if(!$make) {
|
|
|
|
mydie "Couldn't find make in the PATH";
|
|
|
|
}
|
|
|
|
logit "going with $make as make";
|
|
|
|
|
2004-03-23 11:07:02 -05:00
|
|
|
# change to build dir
|
2004-03-24 05:52:21 -05:00
|
|
|
chdir "$pwd/$build";
|
2004-03-23 11:07:02 -05:00
|
|
|
|
2005-03-15 02:35:36 -05:00
|
|
|
if ($configurebuild) {
|
2004-03-23 11:07:02 -05:00
|
|
|
# run configure script
|
2004-10-10 03:51:25 -04:00
|
|
|
print `../$CURLDIR/configure $confopts 2>&1`;
|
2004-03-23 11:07:02 -05:00
|
|
|
|
|
|
|
if (-f "lib/Makefile") {
|
|
|
|
logit "configure seems to have finished fine";
|
|
|
|
} else {
|
|
|
|
mydie "configure didn't work";
|
|
|
|
}
|
|
|
|
} else {
|
2007-06-28 18:31:18 -04:00
|
|
|
logit "copying files to build dir ...";
|
2004-07-05 22:37:52 -04:00
|
|
|
if (($^O eq 'MSWin32') && ($targetos !~ /netware/)) {
|
2004-07-05 17:32:18 -04:00
|
|
|
system("xcopy /s /q ..\\$CURLDIR .");
|
|
|
|
system("buildconf.bat");
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
2008-08-10 14:33:41 -04:00
|
|
|
elsif ($targetos =~ /netware/) {
|
|
|
|
system("cp -afr ../$CURLDIR/* .");
|
|
|
|
system("cp -af ../$CURLDIR/Makefile.dist Makefile");
|
|
|
|
system("$make -i -C lib -f Makefile.netware prebuild");
|
|
|
|
system("$make -i -C src -f Makefile.netware prebuild");
|
|
|
|
}
|
|
|
|
elsif ($^O eq 'linux') {
|
|
|
|
system("cp -afr ../$CURLDIR/* .");
|
|
|
|
system("cp -af ../$CURLDIR/Makefile.dist Makefile");
|
2008-08-08 08:34:01 -04:00
|
|
|
system("cp -af ../$CURLDIR/include/curl/curlbuild.h.dist ./include/curl/curlbuild.h");
|
2005-05-17 08:07:08 -04:00
|
|
|
system("$make -i -C lib -f Makefile.$targetos prebuild");
|
|
|
|
system("$make -i -C src -f Makefile.$targetos prebuild");
|
2004-06-22 16:02:49 -04:00
|
|
|
}
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
2008-08-10 20:15:20 -04:00
|
|
|
if(-f "./include/curl/curlbuild.h") {
|
|
|
|
logit "display include/curl/curlbuild.h";
|
|
|
|
if(open(F, "<./include/curl/curlbuild.h")) {
|
|
|
|
while(<F>) {
|
|
|
|
my $ll = $_;
|
|
|
|
print $ll if(($ll =~ /^ *# *define/) && ($ll !~ /__CURL_CURLBUILD_H/));
|
|
|
|
}
|
|
|
|
close(F);
|
2008-08-09 19:14:40 -04:00
|
|
|
}
|
2008-08-10 20:15:20 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
mydie "no curlbuild.h created/found";
|
2008-08-09 19:14:40 -04:00
|
|
|
}
|
|
|
|
|
2004-06-22 16:02:49 -04:00
|
|
|
logit "display lib/config$confsuffix.h";
|
2004-07-05 19:35:49 -04:00
|
|
|
open(F, "lib/config$confsuffix.h") or die "lib/config$confsuffix.h: $!";
|
2004-03-23 11:07:02 -05:00
|
|
|
while (<F>) {
|
|
|
|
print if /^ *#/;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
|
2004-06-22 16:02:49 -04:00
|
|
|
if (grepfile("define USE_ARES", "lib/config$confsuffix.h")) {
|
2004-03-23 11:07:02 -05:00
|
|
|
logit "setup to build ares";
|
|
|
|
|
2005-05-09 03:45:30 -04:00
|
|
|
logit "display ares/config$confsuffix.h";
|
2005-05-10 07:19:12 -04:00
|
|
|
if(open(F, "ares/config$confsuffix.h")) {
|
|
|
|
while (<F>) {
|
|
|
|
print if /^ *#/;
|
|
|
|
}
|
|
|
|
close(F);
|
2005-05-09 03:45:30 -04:00
|
|
|
}
|
|
|
|
|
2004-03-23 11:07:02 -05:00
|
|
|
logit "build ares";
|
|
|
|
chdir "ares";
|
2004-07-24 17:24:03 -04:00
|
|
|
|
2005-03-18 04:21:25 -05:00
|
|
|
if ($targetos && !$configurebuild) {
|
2005-05-17 08:07:08 -04:00
|
|
|
logit "$make -f Makefile.$targetos";
|
|
|
|
open(F, "$make -f Makefile.$targetos 2>&1 |") or die;
|
2005-03-18 04:21:25 -05:00
|
|
|
}
|
|
|
|
else {
|
2005-05-17 08:07:08 -04:00
|
|
|
logit "$make";
|
|
|
|
open(F, "$make 2>&1 |") or die;
|
2004-07-05 17:32:18 -04:00
|
|
|
}
|
2004-03-23 11:07:02 -05:00
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
|
2006-05-27 07:36:05 -04:00
|
|
|
if (-f "libcares$libext") {
|
2004-07-05 22:37:52 -04:00
|
|
|
logit "ares is now built successfully (libcares$libext)";
|
2004-03-23 11:07:02 -05:00
|
|
|
} else {
|
2004-07-05 22:37:52 -04:00
|
|
|
logit "ares build failed (libares$libext)";
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
# cd back to the curl build dir
|
2004-03-24 05:52:21 -05:00
|
|
|
chdir "$pwd/$build";
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
2005-03-15 02:35:36 -05:00
|
|
|
if ($configurebuild) {
|
2005-05-17 08:07:08 -04:00
|
|
|
logit "$make -i";
|
|
|
|
open(F, "$make -i 2>&1 |") or die;
|
2004-03-23 11:07:02 -05:00
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
close(F);
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
else {
|
2005-05-17 08:07:08 -04:00
|
|
|
logit "$make -i $targetos";
|
2004-06-22 16:02:49 -04:00
|
|
|
if ($^O eq 'MSWin32') {
|
|
|
|
if ($targetos =~ /vc/) {
|
|
|
|
open(F, "nmake -i $targetos|") or die;
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
else {
|
2005-05-17 08:07:08 -04:00
|
|
|
open(F, "$make -i $targetos |") or die;
|
2004-06-22 16:02:49 -04:00
|
|
|
}
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
else {
|
2005-05-17 08:07:08 -04:00
|
|
|
open(F, "$make -i $targetos 2>&1 |") or die;
|
2004-06-22 16:02:49 -04:00
|
|
|
}
|
2004-03-23 11:07:02 -05:00
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
}
|
|
|
|
|
2006-05-27 07:36:05 -04:00
|
|
|
if (-f "lib/libcurl$libext") {
|
2006-05-25 07:04:08 -04:00
|
|
|
logit "libcurl was created fine (libcurl$libext)";
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
else {
|
2006-05-25 07:04:08 -04:00
|
|
|
mydie "libcurl was not created (libcurl$libext)";
|
2004-07-05 22:37:52 -04:00
|
|
|
}
|
|
|
|
|
2004-06-22 16:02:49 -04:00
|
|
|
if (-f "src/curl$binext") {
|
2006-05-25 07:04:08 -04:00
|
|
|
logit "curl was created fine (curl$binext)";
|
2005-03-15 02:35:36 -05:00
|
|
|
}
|
|
|
|
else {
|
2006-05-25 07:04:08 -04:00
|
|
|
mydie "curl was not created (curl$binext)";
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
2008-03-20 12:10:54 -04:00
|
|
|
if (!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) {
|
|
|
|
logit "display curl${binext} --version output";
|
|
|
|
my $cmd = ($extvercmd ne '' ? $extvercmd.' ' : '')."./src/curl${binext} --version|";
|
|
|
|
open(F, $cmd);
|
2005-04-18 01:46:10 -04:00
|
|
|
while(<F>) {
|
|
|
|
print;
|
|
|
|
print LOG;
|
|
|
|
}
|
|
|
|
close(F);
|
2004-06-22 16:02:49 -04:00
|
|
|
}
|
2004-03-23 11:07:02 -05:00
|
|
|
|
2005-03-15 02:35:36 -05:00
|
|
|
if ($configurebuild && !$crosscompile) {
|
2005-03-17 04:44:09 -05:00
|
|
|
my $o;
|
|
|
|
if($runtestopts) {
|
|
|
|
$o = "TEST_F=\"$runtestopts\" ";
|
|
|
|
}
|
2005-09-15 17:49:26 -04:00
|
|
|
logit "$make -k ${o}test-full";
|
|
|
|
open(F, "$make -k ${o}test-full 2>&1 |") or die;
|
2004-03-23 11:07:02 -05:00
|
|
|
open(LOG, ">$buildlog") or die;
|
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
print LOG;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
close(LOG);
|
|
|
|
|
|
|
|
if (grepfile("^TEST", $buildlog)) {
|
|
|
|
logit "tests were run";
|
|
|
|
} else {
|
|
|
|
mydie "test suite failure";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (grepfile("^TESTFAIL:", $buildlog)) {
|
|
|
|
logit "the tests were not successful";
|
|
|
|
} else {
|
|
|
|
logit "the tests were successful!";
|
|
|
|
}
|
|
|
|
} else {
|
2005-03-15 02:35:36 -05:00
|
|
|
# dummy message to feign success
|
|
|
|
if($crosscompile) {
|
|
|
|
logit "cross-compiling, can't run tests";
|
|
|
|
}
|
|
|
|
print "TESTDONE: 1 tests out of 0 (dummy message)\n";
|
2004-03-23 11:07:02 -05:00
|
|
|
}
|
|
|
|
|
2004-07-05 18:35:00 -04:00
|
|
|
# create a tarball if we got that option.
|
2008-03-20 12:10:54 -04:00
|
|
|
if (($mktarball ne '') && (-x $mktarball)) {
|
2004-07-05 18:35:00 -04:00
|
|
|
system($mktarball);
|
2004-07-05 17:41:28 -04:00
|
|
|
}
|
|
|
|
|
2004-03-23 11:07:02 -05:00
|
|
|
# mydie to cleanup
|
|
|
|
mydie "ending nicely";
|