After such disappointments, I just compiled both a 32-bit and a 64-bit version of libreadline 6.2 using MinGW-w64 . Here is how I did it:
Layout of my dev directory:
c:\dev\msys c:\dev\mingw32 c:\dev\local32 c:\dev\mingw64 c:\dev\local64
Set some environment variables for the 32-bit build:
export CPPFLAGS=-I/c/dev/local32/include export LDFLAGS=-L/c/dev/local32/lib
termcap 1.3.1.
Run configure script:
./configure --host=i686-w64_mingw32 --prefix=/c/dev/local32
Modify termcap.c and correct a few lines at the top. My looks like this:
#ifdef HAVE_CONFIG_H #include <config.h> #endif #ifdef emacs #include <lisp.h> /* xmalloc is here */ /* Get the O_* definitions for open et al. */ #include <sys/file.h> #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif //#ifdef HAVE_UNISTD_H #include <unistd.h> //#endif #else /* not emacs */ //#ifdef STDC_HEADERS #include <stdlib.h> #include <string.h> #define bcopy(b1,b2,len) (memmove((b2), (b1), (len)), (void) 0) //#else //char *getenv (); //char *malloc (); //char *realloc (); //#endif
and tparam.c
/* Emacs config.h may rename various library functions such as malloc. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #ifdef emacs #include "lisp.h" /* for xmalloc */ #else //#ifdef STDC_HEADERS #include <stdlib.h> #include <string.h> //#else //char *malloc (); //char *realloc (); //#endif /* Do this after the include, in case string.h prototypes bcopy. */ //#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy) #define bcopy(s, d, n) memcpy ((d), (s), (n)) //#endif #endif /* not emacs */
Change the Makefile:
Line 23: CC = i686-w64-mingw32-gcc Line 24: AR = i686-w64-mingw32-ar Line 36: prefix = /c/dev/local32 Line 49:
After this call, make install and it should compile without warnings or errors.
readline 6.2
Set the same CPPFLAGS and LDFLAGS variables as termcap before calling:
./configure --prefix=/c/dev/local32 --host=i686-w64-mingw32 --enable-static --enable-shared
Edit the Makefile:
Line 40: AR = i686-w64-mingw32-ar
make install should now compile and install readline!
If you want a 64-bit library, replace i686-w64-mingw32 with * x86_64-w64-mingw32 * and local32 with local64.