Needed to build ngspice for a windows 7 machine using cygwin, and without the GUI as ngspice is being run from a python script. Ran into a few issues before I could get it working, the included patch (against the latest version from git) seems to fix those.
* Added "AM_PROG_AR" to configure.ac let autogen.sh work. I'm not sure what exactly this does, took a guess based on the errors autogen spat out and it worked...
* Once the program would configure and build, there were errors relating to a temp file not being created. Traced this back to the #ifdefs in main.c around line 1170 - the original call to tmpfile() was failing, but since HAS_WINDOWS wasn't defined (didn't want the GUI built), the alternative smktemp() and fopen() weren't getting built.
* Adjusting some #ifdefs and #defines to get smktemp() to produce a valid windows temp file name, which got ngspice to create temp files and run as desired.
* Unfortunately, this smktemp() + fopen() mechanism didn't delete the temp files after ngspice closed, so added a call to remove() to get rid of them.
I haven't tested this beyond one windows 7 machine (at work), but it does appear to work just fine for my purposes.