# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2012, 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
$timestamp $notes);
# version of this script
-$version='2012-04-13';
+$version='2014-11-25';
$fixed=0;
# Determine if we're running from git or a canned copy of curl,
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...
}
logit "DESC = $desc";
logit "NOTES = $notes";
logit "CONFOPTS = $confopts";
+logit "RUNTESTOPTS = ".$runtestopts;
logit "CPPFLAGS = ".$ENV{CPPFLAGS};
logit "CFLAGS = ".$ENV{CFLAGS};
logit "LDFLAGS = ".$ENV{LDFLAGS};
# 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) {
}
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\" ";