* cygload/cygload.cc: Move to winsup.api. Add comments from README.
* cygload/cygload.h: Move to winsup.api.
* cygload/cygload.exp: Move to winsup.api.
* Makefile.in: Remove cygload.
* winsup.api/winsup.exp: If a .exp file is detected, run it rather than using
standard compile.
* winsup.api/resethand.c (main): Use printf to print status or expect thinks
something is wrong.
+2006-01-02 Christopher Faylor <cgf@timesys.com>
+
+ * cygload/README: Delete.
+ * cygload/cygload.cc: Move to winsup.api. Add comments from README.
+ * cygload/cygload.h: Move to winsup.api.
+ * cygload/cygload.exp: Move to winsup.api.
+ * Makefile.in: Remove cygload.
+ * winsup.api/winsup.exp: If a .exp file is detected, run it rather than
+ using standard compile.
+
+ * winsup.api/resethand.c (main): Use printf to print status or expect
+ thinks something is wrong.
+
2006-01-01 Christopher Faylor <cgf@timesys.com>
* winsup.api/resethand.c (main): Remove core dump flag from exit
export TCL_LIBRARY ; fi ; \
PATH=$(bupdir)/cygwin:$${PATH} ;\
$(RUNTEST) --tool winsup $(RUNTESTFLAGS) ;\
- $(RUNTEST) --tool cygload $(RUNTESTFLAGS)
cygrun.o: cygrun.c
$(CC) $(MINGW_CFLAGS) -o $@ -c $<
+++ /dev/null
-# Makefile for cygload
-
-###
-### MinGW options
-###
-CC = gcc
-CFLAGS = -mno-cygwin -Wall
-LINKFLAGS = -lstdc++ -Wl,-e,_cygloadCRTStartup@0
-
-###
-### MSVC options
-###
-ifndef MSVCDir
-MSVCDir = C:/cygwin/usr/local/tools/i686_win32/vc7/Vc7
-endif
-
-CL = $(MSVCDir)/bin/cl
-# If you want to look at the assembly, add "/Famsvc-cygload.asm /FAs".
-MSVCCFLAGS = /nologo /GX /MDd /Zi /W4 /TP
-MSVCINCLUDES = /I $(MSVCDir)/include /I $(MSVCDir)/PlatformSDK/Include
-# Using /ENTRY seems to automatically invoke /NODEFAULTLIBS.
-MSVCLIBS = /link /LIBPATH:$(MSVCDir)/lib /LIBPATH:$(MSVCDir)/PlatformSDK/lib \
- /ENTRY:cygloadCRTStartup uuid.lib msvcprtd.lib msvcrtd.lib \
- oldnames.lib kernel32.lib
-
-all: mingw-cygload.exe
-
-mingw-cygload.exe: cygload.cc cygload.h
- $(CC) $(CFLAGS) $< -o $@ $(LINKFLAGS)
-
-msvc-cygload.exe: cygload.cc cygload.h
- $(CL) $(MSVCCFLAGS) $(MSVCINCLUDES) $< /o $@ $(MSVCLIBS)
-
-clean:
- rm -f msvc-cygload.exe msvc-cygload.ilk cygload.obj \
- msvc-cygload.pdb vc70.pdb mingw-cygload.exe
+++ /dev/null
-cygload demonstrates how to dynamically load cygwin1.dll. The default
-build uses MinGW to compile it; the Makefile also shows how to build
-it using the Microsoft compiler.
-
-By default, the program will silently test basic functionality:
- * Making space on the stack for cygtls
- * Loading and initializing cygwin1.dll
- * Path translation
- * Error handling
- * Signal handling
-
-Command line parameters are:
-
- -v Verbose output
- -testinterrupts Pause for 30 seconds to allow testing command line
- interrupts (^C)
- -cygwin xxx Specifies an alternative DLL to load instead of
- cygwin1.dll.
-// cygload.cpp
-//
-// Copyright 2005, Red Hat, Inc.
-//
-// Written by Max Kaehn <slothman@electric-cloud.com>
-//
-// This software is a copyrighted work licensed under the terms of the
-// Cygwin license. Please consult the file "CYGWIN_LICENSE" for details.
-//
-// Note that dynamically linking to cygwin1.dll automatically places your code
-// under the GPL unless you purchase a Cygwin Contract with Red Hat, Inc.
-// See http://www.redhat.com/software/cygwin/ for more information.
-
-
-// Options for this program:
-// -v Verbose output. Normal operation is entirely silent,
-// save for errors.
-// -testinterrupts Pauses the program for 30 seconds so you can demonstrate
-// that it handles ^C properly.
-// -cygwin Name of DLL to load. Defaults to "cygwin1.dll".
+/* cygload.cc
+
+ Copyright 2005, 2006 Red Hat, Inc.
+
+ Written by Max Kaehn <slothman@electric-cloud.com>
+
+ This software is a copyrighted work licensed under the terms of the
+ Cygwin license. Please consult the file "CYGWIN_LICENSE" for details.
+
+ Note that dynamically linking to cygwin1.dll automatically places your code
+ under the GPL unless you purchase a Cygwin Contract with Red Hat, Inc.
+ See http://www.redhat.com/software/cygwin/ for more information.
+
+ cygload demonstrates how to dynamically load cygwin1.dll. The default
+ build uses MinGW to compile it; the Makefile also shows how to build
+ it using the Microsoft compiler.
+
+ By default, the program will silently test basic functionality:
+ * Making space on the stack for cygtls
+ * Loading and initializing cygwin1.dll
+ * Path translation
+ * Error handling
+ * Signal handling
+
+ Options for this program:
+ -v Verbose output. Normal operation is entirely silent,
+ save for errors.
+ -testinterrupts Pauses the program for 30 seconds so you can demonstrate
+ that it handles ^C properly.
+ -cygwin Name of DLL to load. Defaults to "cygwin1.dll". */
#include "cygload.h"
#include <iostream>
// gdb reports sizeof(_cygtls) == 3964 at the time of this writing.
// This is at the end of the object so it'll be toward the bottom
// of the stack when it gets declared.
- char _padding[4096];
+ char _padding[8192];
static padding *_main;
static DWORD _mainTID;
void
ouch (int sig)
{
- fprintf (stderr, "ouch %d\n", sig);
if (doit++ > 0)
kill (getpid (), SIGTERM);
}
exit (0x42);
}
status &= ~0x80; // remove core dump flag
- fprintf (stderr, "pid %d exited with status %p\n", pid, (void *) status);
+ printf ("pid %d exited with status %p\n", pid, (void *) status);
exit (argc == 1 ? !(status == SIGSEGV) : !(status == SIGTERM));
}
verbose "Filter: $test_filter"
-foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.{cc,c}]] {
if { $test_filter != "" && ! [regexp $test_filter $src] } {
verbose -log "Skipping $src"
continue
clear_xfail
}
- ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs $runtime_root/binmode.o -lgcc $runtime_root/libcygwin0.a -lkernel32 -luser32 -o $base.exe"
- if { $rv != "" } {
- verbose -log "$rv"
- fail "$testcase (compile)"
+ if [ file exists "$srcdir/$subdir/$basename.exp" ] then {
+ source "$srcdir/$subdir/$basename.exp"
} else {
- if { $verbose } {
- set redirect_output "./$base.log"
- } else {
- set redirect_output /dev/null
- }
- ws_spawn "$rootme/cygrun ./$base.exe > $redirect_output"
- if { $rv != "" } {
- verbose -log "$testcase: $rv"
- fail "$testcase (execute)"
- if { $xfail_expected } {
- catch { file delete "$base.exe" } err
- if { $err != "" } {
- note "error deleting $base.exe: $err"
- }
- }
+ ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs $runtime_root/binmode.o -lgcc $runtime_root/libcygwin0.a -lkernel32 -luser32 -o $base.exe"
+ if { $rv != "" } {
+ verbose -log "$rv"
+ fail "$testcase (compile)"
} else {
- pass "$testcase"
- if { ! $xfail_expected } {
- catch { file delete "$base.exe" } err
- if { $err != "" } {
- note "error deleting $base.exe: $err"
+ if { $verbose } {
+ set redirect_output "./$base.log"
+ } else {
+ set redirect_output /dev/null
+ }
+ ws_spawn "$rootme/cygrun ./$base.exe > $redirect_output"
+ if { $rv != "" } {
+ verbose -log "$testcase: $rv"
+ fail "$testcase (execute)"
+ if { $xfail_expected } {
+ catch { file delete "$base.exe" } err
+ if { $err != "" } {
+ note "error deleting $base.exe: $err"
+ }
+ }
+ } else {
+ pass "$testcase"
+ if { ! $xfail_expected } {
+ catch { file delete "$base.exe" } err
+ if { $err != "" } {
+ note "error deleting $base.exe: $err"
+ }
}
}
}