A few months ago I started a new job and was forced, against my
wishes, to use Windows. One of the first things I tried to do is
compile Cscope on my workstation. It has turned out to be quite a
challenge to create a native Windows build of Cscope (I am unable to
use Cygwin in my work environment). I decided to put the effort into
facilitating such builds. The result is a forked version of Cscope,
called min-cscope (for minimal and MinGW), which I believe may be of
interest even to people who are working on "proper" operating
The most notable changes from the mainline Cscope code are as follows:
1. CMake-based build system (die, autotools, die!).
2. The curses-based interface is optional (many people, including
myself, are using Cscope as a backend process only, and dropping
curses makes compilation on Windows considerably easier). Curses
support is added only if CMake determines that the appropriate header
and library exist.
3. Built-in sorting for the inverted index (replacing the piped
invocation of a Unix-like sort application). The implementation is
multi-platform, efficient (using considerably less memory than GNU
sort, with about the same runtime) and provides progress information.
4. Uses a binary search in invmake() to locate the matching file index
for the given offset. This dramatically cuts down on the time to build
the inverted index (and can be easily applied to the current Cscope
On my Linux machine, building the cross-reference database and the
inverted index for the Linux kernel takes 41 seconds with Cscope, and
23 with min-cscope (both with a warm file cache)
It is important to note that the database format is exactly the same
as that of Cscope - only the build process has been affected. Thus,
Cscope can be invoked on a database created by min-cscope and
I have only tested min-cscope on Linux and Windows. When I have the
time, I will also try it on FreeBSD and Solaris. I see no point in
maintaining support for older Unix variants (it saddens me to say so,
but it's reality).
The code is available for download from SourceForge:
Comments are welcome.