How to compile SDL in MINGW?
“How to build the environment of MSYS for the crossing compiler? ” has introduced how to establish the environment of MINGW in Windows. It works well in the normal daily activities, however, it fails to call ‘autogen.sh ’ shell script to generate configure file. Readers maybe find the similar errors information as follows.
$ ./autogen.sh Generating build information using autoconf This may take a while ... /mingw/bin/autoconf: line 582: /usr/bin/autom4te: No such file or directory /mingw/bin/autoconf: line 582: exec: /usr/bin/autom4te: cannot execute: No such file or directory Couldn't find autoconf, aborting |
After investigating the errors, the root cause is obtained. The wrong settings in the ‘autoconf ’ lead to miss the related configuration. Three files are listed in the table.
1. /mingw/bin/autoconf 2. /mingw/bin/autom4te 3. /mingw/share/autoconf/autom4te.cfg |
Ok, the reason has been found, so how to solve it?
There are two ways to get ride of this case.
1. Open three files: ‘/mingw/bin/autoconf ’, ‘/mingw/bin/autom4te ’ and ‘/mingw/share/autoconf/autom4te.cfg’.
Substitutes ‘/mingw/share’ for ‘/usr/share’ and ‘/mingw/bin’ for ‘/usr/bin’. Although it is a simple operation by using the ‘replace’ command in the menu item, it looks a bit stupid:- (.
2. Map the folders.
As MSYS has provided this mechanism, we should make full use of it.
Open ‘/etc/fstab ’ file, and append two entries as follows.
XXX/YYY/mingw /mingw XXX/YYY/mingw/bin /usr/local/bin XXX/YYY/mingw /share /usr/local/share |
How to compile SDL?
1. Download it by SVN tool
$ svn checkout http://svn.libsdl.org/trunk/SDL |
2. Configure it
$ cd ./SDL $ ./autogen.sh $ ./configure –prefix=/mingw –disable-shared –enable-static –enable-sse2 –enable-ssemath |
3. Compile it
$ make |
4. Install it
$ make install
[Summarization]
1. if ‘/usr ’, ‘/local ’, ‘/local/bin ’ and ‘/local/share ’ have not been created in the local file system, please create these folders firstly.
2. The original folders must be the real local folders, and virtual folders do not work well. For example, if we define them as below, it will not be recognized.
/ming/bin /usr/local/bin /ming/share /usr/local/share |
3. Try to use simple solution when options are available, and the second is preferable in this case.