+2009-09-05 Micah Cowan <micah@cowan.name>
+
+ * configure.ac: If we can't find idna.h, check to see if it's
+ because we need to add /usr/include/idn to the inclusion
+ path (for OpenSolaris).
+
2009-09-04 Steven Schubiger <stsc@member.fsf.org>
* configure.ac: Place gl_EARLY and md5_EARLY before the gettext
LDFLAGS="${LDFLAGS} -L$libidn/lib"
CPPFLAGS="${CPPFLAGS} -I$libidn/include"
fi
- AC_CHECK_HEADER(idna.h,
+
+ # If idna.h can't be found, check to see if it was installed under
+ # /usr/include/idn (OpenSolaris, at least, places it there).
+ # Check for idn-int.h in that case, because idna.h won't find
+ # idn-int.h until we've decided to add -I/usr/include/idn.
+ AC_CHECK_HEADER(idna.h, ,
+ [AC_CHECK_HEADER(idn/idn-int.h,
+ [CPPFLAGS="${CPPFLAGS} -I/usr/include/idn"],
+ [iri=no])]
+ )
+
+ if test "X$iri" != "Xno"; then
AC_CHECK_LIB(idn, stringprep_check_version,
- [iri=yes LIBS="${LIBS} -lidn"], iri=no),
- iri=no)
+ [iri=yes LIBS="${LIBS} -lidn"], iri=no)
+ fi
if test "X$iri" != "Xno" ; then
AC_DEFINE(ENABLE_IRI, 1, [Define if IRI support is enabled.])
+2009-09-05 Gisle Vanem <gvanem@broadpark.no>
+
+ * config.h: Added 'HAVE_ALLOCA_H' for Watcom 1.5+. Added
+ 'USE_WATT32' since all DOS-targets use the Watt-32 tcp/ip stack.
+ Added meaningless dummy LOCALEDIR.
+
+ * Makefile.wc: A much needed update. Added rules for many files
+ in ./lib, css.c and version.c.
+
+ * Makefile.dj: A much needed update. Added rules for css.c and
+ version.c.
+
2008-01-25 Micah Cowan <micah@cowan.name>
* config.h: Updated copyright year.
#
# GNU Makefile for wget / djgpp / MSDOS.
-# By Gisle Vanem <giva@bgnett.no> 2007.
+# By Gisle Vanem <gvanem@broadpark.no> 2009.
#
# `cd' to `./src' and issue the command:
-# make -f ../msdos/Makefile.dj
+# make -f ../msdos/Makefile.dj depend
+# followed by:
+# make -f ../msdos/Makefile.dj
#
+VERSION = 1.12 (djgpp/DOS)
+
.SUFFIXES: .exe
-VPATH = ../lib
+VPATH = ../lib ../md5
USE_OPENSSL = 0
USE_IPV6 = 1
OBJ_DIR = djgpp.obj
CC = gcc
-CFLAGS = -O2 -g -Wall -Wcast-align -I. -I../msdos -I../lib -I/dev/env/WATT_ROOT/inc \
- -DHAVE_CONFIG_H -DENABLE_DEBUG
+CFLAGS = -O2 -g -Wall -Wcast-align -I. -I../msdos -I../lib -I../md5 \
+ -I/dev/env/WATT_ROOT/inc -DHAVE_CONFIG_H -DENABLE_DEBUG \
+ -DUSE_WATT32
# LDFLAGS = -s
EX_LIBS += /dev/env/WATT_ROOT/lib/libwatt.a
-SOURCES += cmpt.c connect.c cookies.c ftp.c ftp-basic.c ftp-ls.c \
+SOURCES += cmpt.c connect.c cookies.c exits.c ftp.c ftp-basic.c ftp-ls.c \
ftp-opie.c hash.c host.c html-parse.c html-url.c http.c \
init.c log.c main.c gen-md5.c netrc.c progress.c recur.c \
- res.c retr.c snprintf.c url.c utils.c version.c convert.c xmalloc.c \
- ptimer.c spider.c ../lib/getopt.c ../lib/getopt1.c ../lib/md5.c
+ res.c retr.c snprintf.c url.c utils.c version.c convert.c \
+ ptimer.c spider.c css.c css-url.c build_info.c ../md5/md5.c \
+ $(addprefix ../lib/, error.c exitfail.c quote.c \
+ quotearg.c getopt.c getopt1.c xalloc-die.c xmalloc.c)
OBJECTS = $(addprefix $(OBJ_DIR)/, $(notdir $(SOURCES:.c=.o)))
wget.exe: $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^ $(EX_LIBS)
+css.c: css.l
+ flex -8 -o$@ $^
+
clean:
rm -f $(OBJ_DIR)/*.o $(MAPFILE)
vclean realclean: clean
- rm -f wget.exe depend.dj
+ rm -f wget.exe depend.dj version.c
- rmdir $(OBJ_DIR)
$(OBJ_DIR)/%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
@echo
-depend:
+version.c: ../msdos/Makefile.DJ
+ @echo 'char *version_string = "$(VERSION)";' > $@
+ @echo 'char *compilation_string = "$(CC) $(CFLAGS)";' >> $@
+ @echo 'char *link_string = "$(CC) $(LDFLAGS) -o wget.exe $$(OBJECTS) $(EX_LIBS)";' >> $@
+
+depend: version.c
$(CC) -MM $(CFLAGS) $(SOURCES) | \
sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj
#
# Makefile for Wget / DOS32A / OpenWatcom
-# by G. Vanem <gvanem@broadpark.no> 2007
+# by G. Vanem <gvanem@broadpark.no> 2009
#
-COMPILE = *wcc386 -mf -3r -w6 -d2 -zq -zm -of -I. -I$(%watt_root)\inc &
- -I..\msdos -I..\lib -fr=nul -bt=dos -s -dHAVE_CONFIG_H &
- -dENABLE_DEBUG -dSIZEOF_INT=4
+VERSION = 1.12 (Watcom/DOS)
+
+COMPILE = *wcc386 -mf -3r -w3 -d2 -zq -zm -of -I. -I$(%watt_root)\inc &
+ -I..\msdos -I..\lib -I..\md5 -fr=nul -bt=dos -s -dHAVE_CONFIG_H &
+ -dENABLE_DEBUG -dSIZEOF_INT=4 -dUSE_WATT32
LINK = *wlink option quiet, map, verbose, eliminate, caseexact, stack=100k &
debug all system dos32a
-OBJ_DIR = Watcom.obj
-
-OBJECTS = $(OBJ_DIR)\cmpt.obj $(OBJ_DIR)\connect.obj &
- $(OBJ_DIR)\convert.obj $(OBJ_DIR)\cookies.obj &
- $(OBJ_DIR)\c-ctype.obj $(OBJ_DIR)\ftp-basic.obj &
- $(OBJ_DIR)\ftp-ls.obj $(OBJ_DIR)\ftp-opie.obj &
- $(OBJ_DIR)\ftp.obj $(OBJ_DIR)\gen-md5.obj &
- $(OBJ_DIR)\getopt.obj $(OBJ_DIR)\getopt1.obj &
- $(OBJ_DIR)\hash.obj $(OBJ_DIR)\host.obj &
- $(OBJ_DIR)\html-parse.obj $(OBJ_DIR)\html-url.obj &
- $(OBJ_DIR)\http.obj $(OBJ_DIR)\init.obj &
- $(OBJ_DIR)\log.obj $(OBJ_DIR)\main.obj &
- $(OBJ_DIR)\md5.obj $(OBJ_DIR)\netrc.obj &
- $(OBJ_DIR)\progress.obj $(OBJ_DIR)\ptimer.obj &
- $(OBJ_DIR)\recur.obj $(OBJ_DIR)\res.obj &
- $(OBJ_DIR)\retr.obj $(OBJ_DIR)\spider.obj &
- $(OBJ_DIR)\url.obj $(OBJ_DIR)\utils.obj &
- $(OBJ_DIR)\version.obj $(OBJ_DIR)\xmalloc.obj
+OBJ_DIR = WC_DOS.obj
+
+OBJECTS = $(OBJ_DIR)\cmpt.obj $(OBJ_DIR)\build_info.obj &
+ $(OBJ_DIR)\c-ctype.obj $(OBJ_DIR)\cookies.obj &
+ $(OBJ_DIR)\connect.obj $(OBJ_DIR)\convert.obj &
+ $(OBJ_DIR)\css.obj $(OBJ_DIR)\css-url.obj &
+ $(OBJ_DIR)\error.obj $(OBJ_DIR)\exits.obj &
+ $(OBJ_DIR)\exitfail.obj $(OBJ_DIR)\ftp-basic.obj &
+ $(OBJ_DIR)\ftp-ls.obj $(OBJ_DIR)\ftp-opie.obj &
+ $(OBJ_DIR)\ftp.obj $(OBJ_DIR)\gen-md5.obj &
+ $(OBJ_DIR)\getopt.obj $(OBJ_DIR)\getopt1.obj &
+ $(OBJ_DIR)\getpass.obj $(OBJ_DIR)\hash.obj &
+ $(OBJ_DIR)\host.obj $(OBJ_DIR)\html-parse.obj &
+ $(OBJ_DIR)\html-url.obj $(OBJ_DIR)\http.obj &
+ $(OBJ_DIR)\init.obj $(OBJ_DIR)\log.obj &
+ $(OBJ_DIR)\main.obj $(OBJ_DIR)\md5.obj &
+ $(OBJ_DIR)\netrc.obj $(OBJ_DIR)\progress.obj &
+ $(OBJ_DIR)\ptimer.obj $(OBJ_DIR)\recur.obj &
+ $(OBJ_DIR)\res.obj $(OBJ_DIR)\retr.obj &
+ $(OBJ_DIR)\spider.obj $(OBJ_DIR)\url.obj &
+ $(OBJ_DIR)\utils.obj $(OBJ_DIR)\version.obj &
+ $(OBJ_DIR)\xalloc-die.obj $(OBJ_DIR)\xmalloc.obj &
+ $(OBJ_DIR)\quote.obj $(OBJ_DIR)\quotearg.obj
all: $(OBJ_DIR) wget.exe .SYMBOLIC
@echo 'Welcome to Wget / Watcom'
*$(COMPILE) -fo=$@ $[@
.ERASE
-$(OBJ_DIR)\md5.obj: ..\lib\md5.c
+$(OBJ_DIR)\exitfail.obj: ..\lib\exitfail.c
+ *$(COMPILE) -fo=$@ $[@
+
+.ERASE
+$(OBJ_DIR)\error.obj: ..\lib\error.c
*$(COMPILE) -fo=$@ $[@
.ERASE
$(OBJ_DIR)\getopt1.obj: ..\lib\getopt1.c
*$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
+.ERASE
+$(OBJ_DIR)\getpass.obj: ..\lib\getpass.c
+ *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
+
+.ERASE
+$(OBJ_DIR)\md5.obj: ..\md5\md5.c
+ *$(COMPILE) -fo=$@ $[@
+
+.ERASE
+$(OBJ_DIR)\xmalloc.obj: ..\lib\xmalloc.c
+ *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
+
+.ERASE
+$(OBJ_DIR)\xalloc-die.obj: ..\lib\xalloc-die.c
+ *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
+
+.ERASE
+$(OBJ_DIR)\quote.obj: ..\lib\quote.c
+ *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
+
+.ERASE
+$(OBJ_DIR)\quotearg.obj: ..\lib\quotearg.c
+ *$(COMPILE) -d_UNISTD_H_INCLUDED -fo=$@ $[@
+
+css.c: css.l
+ flex -8 -o$@ $[@
+
wget.exe: $(OBJECTS)
- $(LINK) name $@ file { $(OBJECTS) } library $(%watt_root)\lib\wattcpwf.lib
+ $(LINK) name $@ file { $(OBJECTS) } library $(%watt_root)\lib\wattcpwf.lib
+version.c: ..\msdos\Makefile.WC
+ @echo char *version_string = "$(VERSION)"; > $@
+ @echo char *compilation_string = "$(COMPILE)"; >> $@
+ @echo char *link_string = "$(LINK) name wget.exe file { $$(OBJECTS) }"; >> $@
clean: .SYMBOLIC
- - rm $(OBJ_DIR)\*.obj wget.exe wget.map
+ - rm $(OBJ_DIR)\*.obj wget.exe wget.map version.c css.c
- rmdir $(OBJ_DIR)
#endif
#ifdef OPENWATCOM_15
+ #define HAVE_ALLOCA_H 1
#define HAVE_INT64_T 1
#define HAVE_SNPRINTF 1
#define HAVE_STRCASECMP 1
#define MSDOS
#endif
+#if !defined(USE_WATT32)
+ #define USE_WATT32
+#endif
+
+#define LOCALEDIR ""
#define OS_TYPE "DOS"
#endif /* CONFIG_DOS_H */
separate parameters, one input (passed_expected_bytes) and one
output (qtyread). Fixes bug #26870.
+2009-09-05 Steven Schubiger <stsc@member.fsf.org>
+
+ * retr.h: Declare set_local_file() to avoid build warnings.
+
+2009-09-05 Gisle Vanem <gvanem@broadpark.no>
+
+ * connect.c, init.c, main.c, openssl.c, options.h: Replace
+ "ifdef MSDOS" with "ifdef USE_WATT32" since DOS-targets in fact
+ use the Watt-32 tcp/ip stack.
+
2009-09-04 Micah Cowan <micah@cowan.name>
* Makefile.am: Move build_info.c to wget_SOURCES from
\f
/* Basic socket operations, mostly EINTR wrappers. */
-#if defined(WINDOWS) || defined(MSDOS)
+#if defined(WINDOWS) || defined(USE_WATT32)
# define read(fd, buf, cnt) recv (fd, buf, cnt, 0)
# define write(fd, buf, cnt) send (fd, buf, cnt, 0)
# define close(fd) closesocket (fd)
{ "verbose", NULL, cmd_spec_verbose },
{ "wait", &opt.wait, cmd_time },
{ "waitretry", &opt.waitretry, cmd_time },
-#ifdef MSDOS
+#ifdef USE_WATT32
{ "wdebug", &opt.wdebug, cmd_boolean },
#endif
};
{ "version", 'V', OPT_FUNCALL, (void *) print_version, no_argument },
{ "wait", 'w', OPT_VALUE, "wait", -1 },
{ "waitretry", 0, OPT_VALUE, "waitretry", -1 },
-#ifdef MSDOS
+#ifdef USE_WATT32
{ "wdebug", 0, OPT_BOOLEAN, "wdebug", -1 },
#endif
};
N_("\
-d, --debug print lots of debugging information.\n"),
#endif
-#ifdef MSDOS
+#ifdef USE_WATT32
N_("\
--wdebug print Watt-32 debug output.\n"),
#endif
exit (1);
}
-#ifdef MSDOS
+#ifdef USE_WATT32
if (opt.wdebug)
dbug_init();
sock_init();
xfree_null (ctx->last_error);
xfree (ctx);
-#if defined(WINDOWS) || defined(MSDOS)
+#if defined(WINDOWS) || defined(USE_WATT32)
closesocket (fd);
#else
close (fd);
bool debug; /* Debugging on/off */
#endif
-#ifdef MSDOS
+#ifdef USE_WATT32
bool wdebug; /* Watt-32 tcp/ip debugging on/off */
#endif
bool url_uses_proxy (struct url *);
+void set_local_file (const char **, const char *);
+
#endif /* RETR_H */
* WgetTest.pm.in (run): Error-checking improvements.
+2009-09-05 Steven Schubiger <stsc@member.fsf.org>
+
+ * run-px: Introduce two new diagnostics: Skip and Unknown.
+
+ * WgetFeature.pm (import): Parse the version output of Wget
+ and assert the availability of a feature.
+
+ * WgetFeature.cfg: Messages to be printed in absence of a
+ required feature.
+
+ * Test-ftp-iri-disabled.px, Test-ftp-iri-fallback.px,
+ Test-ftp-iri-recursive.px, Test-ftp-iri.px, Test-idn-cmd.px,
+ Test-idn-headers.px, Test-idn-meta.px, Test-idn-robots.px,
+ Test-iri-forced-remote.px, Test-iri-list.px,
+ Test-iri-percent.px, Test-iri.px: Use WgetFeature.pm to
+ check for the presence of the IDN/IRI feature.
+
+ * Test-proxied-https-auth.px: Replace grepping for a feature
+ with loading WgetFeature.pm at compile-time.
+
+ * Makefile.am: Add WgetFeature.pm and WgetFeature.cfg
+ to EXTRA_DIST.
+
2009-09-02 Micah Cowan <micah@cowan.name>
* Makefile.am (unit-tests): explicit dependency is
$(srcdir)/run-px $(top_srcdir)
EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
+ WgetFeature.pm WgetFeature.cfg \
Test-auth-basic.px \
Test-auth-no-challenge.px \
Test-auth-no-challenge-url.px \
use strict;
use warnings;
+use WgetFeature qw(iri);
use FTPTest;
use strict;
use warnings;
+use WgetFeature qw(iri);
use FTPTest;
use strict;
use warnings;
+use WgetFeature qw(iri);
use FTPTest;
use strict;
use warnings;
+use WgetFeature qw(iri);
use FTPTest;
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# " Kon'nichiwa <dot> Japan
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# " Kon'nichiwa <dot> Japan
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# " Kon'nichiwa <dot> Japan
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# " Kon'nichiwa <dot> Japan
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# cf. http://en.wikipedia.org/wiki/Latin1
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# cf. http://en.wikipedia.org/wiki/Latin1
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# Just a sanity check to verify that %-encoded values are always left
use strict;
use warnings;
+use WgetFeature qw(iri);
use HTTPTest;
# cf. http://en.wikipedia.org/wiki/Latin1
use strict;
use warnings;
+use WgetFeature qw(https);
use WgetTest; # For $WGETPATH.
my $cert_path;
$cert_path = "$top_srcdir/tests/certs/server-cert.pem";
}
-# Have we even built an HTTPS-supporting Wget?
-{
- my @version_lines = `${WgetTest::WGETPATH} --version`;
- unless (grep /\+(openssl|gnutls)/, @version_lines) {
- print "Not running test: Wget under test doesn't support HTTPS.\n";
- exit 0;
- }
-}
-
use HTTP::Daemon;
use HTTP::Request;
use IO::Socket::SSL;
--- /dev/null
+%skip_messages = (
+ https => "Not running test: Wget under test doesn't support HTTPS.",
+ iri => "Not running test: Wget under test doesn't support IDN/IRI.",
+);
+
+1;
--- /dev/null
+package WgetFeature;
+
+use strict;
+use warnings;
+
+use WgetTest;
+
+our %skip_messages;
+require 'WgetFeature.cfg';
+
+sub import
+{
+ my ($class, $feature) = @_;
+
+ my $output = `$WgetTest::WGETPATH --version`;
+ my ($list) = $output =~ /^([\+\-]\S+(?:\s+[\+\-]\S+)+)/m;
+ my %have_features = map {
+ my $feature = $_;
+ $feature =~ s/^.//;
+ ($feature, /^\+/ ? 1 : 0);
+ } split /\s+/, $list;
+
+ unless ($have_features{$feature}) {
+ print $skip_messages{$feature}, "\n";
+ exit 2; # skip
+ }
+}
+
+1;
use strict;
use warnings;
-use Term::ANSIColor ':constants';
-$Term::ANSIColor::AUTORESET = 1;
+use Term::ANSIColor;
die "Please specify the top source directory.\n" if (!@ARGV);
my $top_srcdir = shift @ARGV;
foreach my $test (@tests) {
print "Running $test\n\n";
system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
- push @tested, { name => $test, result => $? };
+ push @tested, { name => $test, result => $? >> 8 };
}
foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
delete $ENV{$var};
}
+my %exit = (
+ pass => 0,
+ fail => 1,
+ skip => 2,
+ unknown => 3, # or greater
+);
+
+my %colors = (
+ $exit{pass} => colored('pass:', 'green' ),
+ $exit{fail} => colored('FAIL:', 'red' ),
+ $exit{skip} => colored('Skip:', 'yellow' ),
+ $exit{unknown} => colored('Unknown:', 'magenta'),
+);
+
print "\n";
foreach my $test (@tested) {
- ($test->{result} == 0)
- ? print GREEN 'pass: '
- : print RED 'FAIL: ';
- print $test->{name}, "\n";
+ my $colored = exists $colors{$test->{result}}
+ ? $colors{$test->{result}}
+ : $colors{$exit{unknown}};
+ print "$colored $test->{name}\n";
}
my $count = sub
{
return {
- pass => sub { scalar grep $_->{result} == 0, @tested },
- fail => sub { scalar grep $_->{result} != 0, @tested },
+ pass => sub { scalar grep $_->{result} == $exit{pass}, @tested },
+ fail => sub { scalar grep $_->{result} == $exit{fail}, @tested },
+ skip => sub { scalar grep $_->{result} == $exit{skip}, @tested },
+ unknown => sub { scalar grep $_->{result} >= $exit{unknown}, @tested },
}->{$_[0]}->();
};
my @lines = (
"${\scalar @tested} tests were run",
"${\$count->('pass')} PASS, ${\$count->('fail')} FAIL",
+ "${\$count->('skip')} SKIP, ${\$count->('unknown')} UNKNOWN",
);
my $len_longest = sub
{
print "\n";
print $count->('fail')
- ? RED $summary
- : GREEN $summary;
+ ? colored($summary, 'red')
+ : colored($summary, 'green');
print "\n";
exit $count->('fail');