mirror of https://github.com/moparisthebest/curl
added new --target option for autobuilding other targets than GNU-like.
This commit is contained in:
parent
450c178d77
commit
53189fb2d7
|
@ -35,12 +35,15 @@
|
||||||
|
|
||||||
# USAGE:
|
# USAGE:
|
||||||
# testcurl.pl [curl-daily-name] > output
|
# testcurl.pl [curl-daily-name] > output
|
||||||
|
# or:
|
||||||
|
# testcurl.pl --target=your_os > output
|
||||||
|
|
||||||
# Updated:
|
# Updated:
|
||||||
# v1.2 8-Mar-04 - rewritten in perl
|
# v1.7 22-Jun-04 - added --target option for other platform targets.
|
||||||
# v1.1 6-Nov-03 - to take an optional parameter, the name of a daily-build
|
# v1.2 8-Mar-04 - rewritten in perl
|
||||||
# directory. If present, build from that directory, otherwise
|
# v1.1 6-Nov-03 - to take an optional parameter, the name of a daily-build
|
||||||
# perform a normal CVS build.
|
# directory. If present, build from that directory, otherwise
|
||||||
|
# perform a normal CVS build.
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
|
@ -49,20 +52,44 @@ use Cwd;
|
||||||
# Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env)
|
# Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env)
|
||||||
BEGIN { $^W = 1; }
|
BEGIN { $^W = 1; }
|
||||||
|
|
||||||
use vars qw($version $fixed $infixed $CURLDIR $CVS $pwd $build $buildlog $buildlogname $gnulikebuild);
|
use vars qw($version $fixed $infixed $CURLDIR $CVS $pwd $build $buildlog
|
||||||
|
$buildlogname $gnulikebuild $targetos $confsuffix $binext);
|
||||||
use vars qw($name $email $desc $confopts);
|
use vars qw($name $email $desc $confopts);
|
||||||
|
|
||||||
# version of this script
|
# version of this script
|
||||||
$version='$Revision$';
|
$version='$Revision$';
|
||||||
$fixed=0;
|
$fixed=0;
|
||||||
|
|
||||||
# Determine if we're running from CVS or a canned copy of curl
|
# Determine if we're running from CVS or a canned copy of curl,
|
||||||
|
# or if we got a specific target option
|
||||||
|
$CURLDIR="curl";
|
||||||
|
$CVS=1;
|
||||||
if (@ARGV && $ARGV[0]) {
|
if (@ARGV && $ARGV[0]) {
|
||||||
$CURLDIR=$ARGV[0];
|
if ($ARGV[0] =~ /--target=/) {
|
||||||
$CVS=0;
|
$targetos = (split(/=/, $ARGV[0]))[1];
|
||||||
} else {
|
} else {
|
||||||
$CURLDIR="curl";
|
$CURLDIR=$ARGV[0];
|
||||||
$CVS=1;
|
$CVS=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Do the platform-specific stuff here
|
||||||
|
$gnulikebuild = 1;
|
||||||
|
$confsuffix = '';
|
||||||
|
$binext = '';
|
||||||
|
if ($^O eq 'MSWin32' || defined($targetos)) {
|
||||||
|
$gnulikebuild = 0;
|
||||||
|
if (!defined($targetos)) {
|
||||||
|
# If no target defined on Win32 lets assume vc
|
||||||
|
$targetos = 'vc';
|
||||||
|
}
|
||||||
|
if ($targetos =~ /vc/ || $targetos =~ /mingw32/) {
|
||||||
|
$confsuffix = '-win32';
|
||||||
|
$binext = '.exe';
|
||||||
|
} elsif ($targetos =~ /netware/) {
|
||||||
|
$confsuffix = '-netware';
|
||||||
|
$binext = '.nlm';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ENV{LANG}="C";
|
$ENV{LANG}="C";
|
||||||
|
@ -118,11 +145,6 @@ sub mydie($){
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$gnulikebuild = 1;
|
|
||||||
if ($^O eq 'MSWin32') {
|
|
||||||
$gnulikebuild = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open(F, "setup")) {
|
if (open(F, "setup")) {
|
||||||
while (<F>) {
|
while (<F>) {
|
||||||
if (/(\w+)=(.*)/) {
|
if (/(\w+)=(.*)/) {
|
||||||
|
@ -183,6 +205,7 @@ logit "DESC = $desc";
|
||||||
logit "CONFOPTS = $confopts";
|
logit "CONFOPTS = $confopts";
|
||||||
logit "CFLAGS = ".($ENV{CFLAGS} ? $ENV{CFLAGS} : "");
|
logit "CFLAGS = ".($ENV{CFLAGS} ? $ENV{CFLAGS} : "");
|
||||||
logit "CC = ".($ENV{CC} ? $ENV{CC} : "");
|
logit "CC = ".($ENV{CC} ? $ENV{CC} : "");
|
||||||
|
logit "target = ".($targetos ? $targetos : "");
|
||||||
logit "version = $version";
|
logit "version = $version";
|
||||||
logit "date = ".(scalar gmtime)." UTC";
|
logit "date = ".(scalar gmtime)." UTC";
|
||||||
|
|
||||||
|
@ -286,7 +309,8 @@ if ($CVS) {
|
||||||
mydie "buildconf was NOT successful";
|
mydie "buildconf was NOT successful";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
system("buildconf.bat");
|
system("buildconf.bat") if ($^O eq 'MSWin32');
|
||||||
|
# logit "buildconf was successful (dummy message)" if ($^O eq 'linux');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -314,24 +338,28 @@ if ($gnulikebuild) {
|
||||||
mydie "configure didn't work";
|
mydie "configure didn't work";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
system("xcopy /s /q ..\\$CURLDIR .");
|
system("xcopy /s /q ..\\$CURLDIR .") if ($^O eq 'MSWin32');
|
||||||
|
if ($^O eq 'linux') {
|
||||||
|
system("cp -ar ../$CURLDIR/* .");
|
||||||
|
system("cp -a ../$CURLDIR/Makefile.dist Makefile");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logit "display lib/config.h";
|
logit "display lib/config$confsuffix.h";
|
||||||
open(F, $gnulikebuild ? "lib/config.h" : "lib/config-win32.h") or die;
|
open(F, "lib/config$confsuffix.h") or die;
|
||||||
while (<F>) {
|
while (<F>) {
|
||||||
print if /^ *#/;
|
print if /^ *#/;
|
||||||
}
|
}
|
||||||
close(F);
|
close(F);
|
||||||
|
|
||||||
logit "display src/config.h";
|
logit "display src/config$confsuffix.h";
|
||||||
open(F, $gnulikebuild ? "src/config.h" : "src/config-win32.h") or die;
|
open(F, "src/config$confsuffix.h") or die;
|
||||||
while (<F>) {
|
while (<F>) {
|
||||||
print if /^ *#/;
|
print if /^ *#/;
|
||||||
}
|
}
|
||||||
close(F);
|
close(F);
|
||||||
|
|
||||||
if (grepfile("define USE_ARES", $gnulikebuild ? "lib/config.h" : "lib/config-win32.h")) {
|
if (grepfile("define USE_ARES", "lib/config$confsuffix.h")) {
|
||||||
logit "setup to build ares";
|
logit "setup to build ares";
|
||||||
|
|
||||||
logit "build ares";
|
logit "build ares";
|
||||||
|
@ -362,7 +390,15 @@ if ($gnulikebuild) {
|
||||||
}
|
}
|
||||||
close(F);
|
close(F);
|
||||||
} else {
|
} else {
|
||||||
open(F, "nmake -i vc|") or die;
|
if ($^O eq 'MSWin32') {
|
||||||
|
if ($targetos =~ /vc/) {
|
||||||
|
open(F, "nmake -i $targetos|") or die;
|
||||||
|
} else {
|
||||||
|
open(F, "make -i $targetos |") or die;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
open(F, "make -i $targetos 2>&1 |") or die;
|
||||||
|
}
|
||||||
while (<F>) {
|
while (<F>) {
|
||||||
s/$pwd//g;
|
s/$pwd//g;
|
||||||
print;
|
print;
|
||||||
|
@ -370,16 +406,19 @@ if ($gnulikebuild) {
|
||||||
close(F);
|
close(F);
|
||||||
}
|
}
|
||||||
|
|
||||||
my $exe = $gnulikebuild ? "curl" : "curl.exe";
|
if (-f "src/curl$binext") {
|
||||||
if (-f "src/$exe") {
|
logit "src/curl was created fine (curl$binext)";
|
||||||
logit "src/curl was created fine ($exe)";
|
|
||||||
} else {
|
} else {
|
||||||
mydie "src/curl was not created ($exe)";
|
mydie "src/curl was not created (curl$binext)";
|
||||||
}
|
}
|
||||||
|
|
||||||
logit "display $exe --version output";
|
if (defined($targetos) && $targetos =~ /netware/) {
|
||||||
|
#system('../../curlver.sh');
|
||||||
|
} else {
|
||||||
|
logit "display curl$binext --version output";
|
||||||
|
|
||||||
system("./src/$exe --version");
|
system("./src/curl$binext --version");
|
||||||
|
}
|
||||||
|
|
||||||
if ($gnulikebuild) {
|
if ($gnulikebuild) {
|
||||||
logit "run make test-full";
|
logit "run make test-full";
|
||||||
|
|
Loading…
Reference in New Issue