# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
use vars qw($name $email $desc $confopts $runtestopts $setupfile $mktarball
$extvercmd $nogitpull $nobuildconf $crosscompile
- $timestamp);
+ $timestamp $notes);
# version of this script
-$version='2010-08-20';
+$version='2014-11-25';
$fixed=0;
# Determine if we're running from git or a canned copy of curl,
elsif ($ARGV[0] =~ /--desc=/) {
$desc = (split(/=/, shift @ARGV))[1];
}
- elsif ($ARGV[0] =~ /--configure=/) {
- $confopts = (split(/=/, shift @ARGV))[1];
+ elsif ($ARGV[0] =~ /--configure=(.*)/) {
+ $confopts = $1;
+ shift @ARGV;
}
elsif (($ARGV[0] eq "--nocvsup") || ($ARGV[0] eq "--nogitpull")) {
$nogitpull=1;
return $triplet;
}
-if (open(F, "$setupfile")) {
+if($name && $email && $desc) {
+ # having these fields set are enough to continue, skip reading the setup
+ # file
+ $infixed=4;
+ $fixed=4;
+}
+elsif (open(F, "$setupfile")) {
while (<F>) {
if (/(\w+)=(.*)/) {
eval "\$$1=$2;";
}
close(F);
$infixed=$fixed;
-} else {
+}
+else {
$infixed=0; # so that "additional args to configure" works properly first time...
}
print F "email='$email'\n";
print F "desc='$desc'\n";
print F "confopts='$confopts'\n";
+ print F "notes='$notes'\n";
print F "fixed='$fixed'\n";
close(F);
}
logit "NAME = $name";
logit "EMAIL = $email";
logit "DESC = $desc";
+logit "NOTES = $notes";
logit "CONFOPTS = $confopts";
+logit "RUNTESTOPTS = ".$runtestopts;
logit "CPPFLAGS = ".$ENV{CPPFLAGS};
logit "CFLAGS = ".$ENV{CFLAGS};
logit "LDFLAGS = ".$ENV{LDFLAGS};
+logit "LIBS = ".$ENV{LIBS};
logit "CC = ".$ENV{CC};
+logit "TMPDIR = ".$ENV{TMPDIR};
logit "MAKEFLAGS = ".$ENV{MAKEFLAGS};
+logit "ACLOCAL_FLAGS = ".$ENV{ACLOCAL_FLAGS};
logit "PKG_CONFIG_PATH = ".$ENV{PKG_CONFIG_PATH};
+logit "DYLD_LIBRARY_PATH = ".$ENV{DYLD_LIBRARY_PATH};
+logit "LD_LIBRARY_PATH = ".$ENV{LD_LIBRARY_PATH};
+logit "LIBRARY_PATH = ".$ENV{LIBRARY_PATH};
+logit "SHLIB_PATH = ".$ENV{SHLIB_PATH};
+logit "LIBPATH = ".$ENV{LIBPATH};
logit "target = ".$targetos;
logit "version = $version"; # script version
logit "date = $timestamp"; # When the test build starts
# off that path from all possible logs and error messages etc.
$pwd = getcwd();
+my $have_embedded_ares = 0;
+
if (-d $CURLDIR) {
if ($git && -d "$CURLDIR/.git") {
logit "$CURLDIR is verified to be a fine git source dir";
# remove the generated sources to force them to be re-generated each
# time we run this test
- unlink "$CURLDIR/src/hugehelp.c";
+ unlink "$CURLDIR/src/tool_hugehelp.c";
+ # find out if curl source dir has an in-tree c-ares repo
+ $have_embedded_ares = 1 if (-f "$CURLDIR/ares/GIT-INFO");
} elsif (!$git && -f "$CURLDIR/tests/testcurl.pl") {
- logit "$CURLDIR is verified to be a fine daily source dir"
+ logit "$CURLDIR is verified to be a fine daily source dir";
+ # find out if curl source dir has an in-tree c-ares extracted tarball
+ $have_embedded_ares = 1 if (-f "$CURLDIR/ares/ares_build.h");
} else {
mydie "$CURLDIR is not a daily source dir or checked out from git!"
}
# Do the git thing, or not...
if ($git) {
+ my $gitstat = 0;
+ my @commits;
+
# update quietly to the latest git
if($nogitpull) {
logit "skipping git pull (--nogitpull)";
} else {
- my $gitstat = 0;
- my @commits;
logit "run git pull in curl";
system("git pull 2>&1");
$gitstat += $?;
logit "failed to update from curl git ($?), continue anyway" if ($?);
+
+ # Set timestamp to the UTC the git update took place.
+ $timestamp = scalar(gmtime)." UTC" if (!$gitstat);
+ }
+
+ # get the last 5 commits for show (even if no pull was made)
+ @commits=`git log --pretty=oneline --abbrev-commit -5`;
+ logit "The most recent curl git commits:";
+ for (@commits) {
+ chomp ($_);
+ logit " $_";
+ }
+
+ if (-d "ares/.git") {
+ chdir "ares";
+
+ if($nogitpull) {
+ logit "skipping git pull (--nogitpull) in ares";
+ } else {
+ logit "run git pull in ares";
+ system("git pull 2>&1");
+ $gitstat += $?;
+ logit "failed to update from ares git ($?), continue anyway" if ($?);
+
+ # Set timestamp to the UTC the git update took place.
+ $timestamp = scalar(gmtime)." UTC" if (!$gitstat);
+ }
+
# get the last 5 commits for show (even if no pull was made)
@commits=`git log --pretty=oneline --abbrev-commit -5`;
- logit "The most recent curl git commits:";
+ logit "The most recent ares git commits:";
for (@commits) {
chomp ($_);
logit " $_";
}
- if (-d "ares/.git") {
- chdir "ares";
- logit "run git pull in ares";
- system("git pull 2>&1");
- $gitstat += $?;
- logit "failed to update from ares git ($?), continue anyway" if ($?);
- # get the last 5 commits for show (even if no pull was made)
- @commits=`git log --pretty=oneline --abbrev-commit -5`;
- logit "The most recent ares git commits:";
- for (@commits) {
- chomp ($_);
- logit " $_";
- }
- chdir "$pwd/$CURLDIR";
- }
- # Set timestamp to the UTC the git update took place.
- $timestamp = scalar(gmtime)." UTC" if (!$gitstat);
+
+ chdir "$pwd/$CURLDIR";
}
if($nobuildconf) {
unlink "autom4te.cache";
# generate the build files
- logit "invoke buildconf, but filter off aclocal underquoted definition warnings";
+ logit "invoke buildconf";
open(F, "./buildconf 2>&1 |") or die;
open(LOG, ">$buildlog") or die;
while (<F>) {
- next if /warning: underquoted definition of/;
- print;
- print LOG;
+ my $ll = $_;
+ # ignore messages pertaining to third party m4 files we don't care
+ next if ($ll =~ /aclocal\/gtk\.m4/);
+ next if ($ll =~ /aclocal\/gtkextra\.m4/);
+ print $ll;
+ print LOG $ll;
}
close(F);
close(LOG);
}
close(F);
-if (grepfile("^#define USE_ARES", "lib/$confheader")) {
+if (($have_embedded_ares) &&
+ (grepfile("^#define USE_ARES", "lib/$confheader"))) {
print "\n";
logit "setup to build ares";
}
if ($configurebuild && !$crosscompile) {
+ my $host_triplet = get_host_triplet();
+ # build example programs for selected build targets
+ if(($host_triplet =~ /([^-]+)-([^-]+)-irix(.*)/) ||
+ ($host_triplet =~ /([^-]+)-([^-]+)-aix(.*)/) ||
+ ($host_triplet =~ /([^-]+)-([^-]+)-osf(.*)/) ||
+ ($host_triplet =~ /([^-]+)-([^-]+)-solaris2(.*)/)) {
+ chdir "$pwd/$build/docs/examples";
+ logit_spaced "build examples";
+ open(F, "$make -i 2>&1 |") or die;
+ open(LOG, ">$buildlog") or die;
+ while (<F>) {
+ s/$pwd//g;
+ print;
+ print LOG;
+ }
+ close(F);
+ close(LOG);
+ chdir "$pwd/$build";
+ }
+ # build and run full test suite
my $o;
if($runtestopts) {
$o = "TEST_F=\"$runtestopts\" ";
}
else {
if($crosscompile) {
- # build test harness programs for selected cross-compiles
my $host_triplet = get_host_triplet();
+ # build example programs for selected cross-compiles
+ if(($host_triplet =~ /([^-]+)-([^-]+)-mingw(.*)/) ||
+ ($host_triplet =~ /([^-]+)-([^-]+)-android(.*)/)) {
+ chdir "$pwd/$build/docs/examples";
+ logit_spaced "build examples";
+ open(F, "$make -i 2>&1 |") or die;
+ open(LOG, ">$buildlog") or die;
+ while (<F>) {
+ s/$pwd//g;
+ print;
+ print LOG;
+ }
+ close(F);
+ close(LOG);
+ chdir "$pwd/$build";
+ }
+ # build test harness programs for selected cross-compiles
if($host_triplet =~ /([^-]+)-([^-]+)-mingw(.*)/) {
chdir "$pwd/$build/tests";
logit_spaced "build test harness";