Bad timing, I know, since 3.0pre1 has just been announced, but here it
goes anyways. This series of patches adds Win32 support for ccache.
Tested with mingw32. Compiling FFmpeg went from 5m13s (first run) to
45s (direct mode). Impressive!

The first 8 patches clean code up to simplify adding win32 support,
which comes in the last patch.
0001 Creates an x_fmmap function that opens, stats, and mmap()s a file.
0002 gzclose() opened file so it's not left open.
0003 Don't overwrite a file that is currently opened, windows doesn't
allow that.
0004 Split a function that will be reused on its own by win32 code.
0005 Simplify basename().
0006 Close more files before moving them (windows doesn't allow moving
opened files).
0007 Open files in binary mode.
0008 #include sys/wait.h under proper ifdefs.
0009 The core of the win32 stuff.

Windows >= XP is expected, I have no intention of getting it to work
with < XP, and I don't think anyone will care. Some things are still
hackish in the final patch, so I'd appreciate the other people that
have implemented their own win32 versions of ccache to review and

There is one other patch that I use to make sure the tests work. It
takes care of some remaining issues:
- getopt_long() gets compiled internally, but it's already available
in libmingwex.a, so there is a linking error. any autofoo experts to
take care of that?
- sed_in_place doesn't work in windows (can't write to a file currently open)
- the stdout test fails because echo is not a program
- there is no /dev/null in Windows, but there is NUL. It's a matter of
letting the test script know it's running under Windows and use the
proper name.
- some basedir tests don't work since mingw gcc transforms the file
names from msys to win32 by turning them into absolute paths.

It might be a better idea to create a branch for win32 for now so as
to not interfere with 3.0.

Ramiro Polla

Attachment: 0001-Introduce-and-use-x_fmmap.patch
Description: Binary data

Attachment: 0002-Don-t-dup-fd-for-zlib-and-gzclose-gzdopen-d-file.patch
Description: Binary data

Attachment: 0003-Don-t-overwrite-a-file-that-is-currently-opened.patch
Description: Binary data

Attachment: 0004-Split-find_executable_in_path-out-of-find_executab.patch
Description: Binary data

Attachment: 0005-Simplify-basename.patch
Description: Binary data

Attachment: 0006-Close-manifest-files-before-moving-them.patch
Description: Binary data

Attachment: 0007-Open-files-in-binary-mode.patch
Description: Binary data

Attachment: 0008--include-sys-wait.h-under-proper-ifdefs.patch
Description: Binary data

Attachment: 0009-Win32-support.patch
Description: Binary data

Attachment: win32_tests.diff
Description: Binary data

ccache mailing list

Reply via email to