Hi fedora-mingw,
I'm one of the developers on an open source game currently compiling on Linux, OS X and Windows. I'd like to set up Fedora cross-compile for the Windows binary; under MSYS/MinGW on Windows, all needed libraries and the game itself compile, so I'm hopeful it will be possible to do this without leaving Fedora.
I have a number of distinct problems in accomplishing this, mostly due to my lack of education with MinGW, so I'm hoping this is the correct list to seek help. I think it would be best if I start with some of the earliest issues I encountered in my build process, as they may affect or resolve later questions.
First, our software requires: libxml2, SDL, SDL_image, SDL_mixer and FTGL. SDL and libxml2 already have MinGW packages on Fedora and they worked very well. SDL_image and SDL_mixer did not but they compiled fine simply using mingw-configure, make, make install. Be that as it is, is there much else involved in package management for this sort of software? If not, I'd be interested in volunteering to maintain Fedora MinGW packages for SDL_image and SDL_mixer if they're not already on the way.
My first real spot of trouble came with FTGL, which uses the GNU autotools but seems to have some compatibility issues with MinGW. I understand this is a bug in FTGL, but I was hoping for advice on fixing this.
Their configure script fails to find OpenGL, attempting to link against -lGL. I understand for MinGW it's proper to link against -lopengl32 and add -mwindows to the compiler flags. Would the proper thing to do here be to add a check for the mingw system type in configure.ac and change the CFLAGS and LIBS to -lopengl32 instead of -lGL?
My apologies if this is such an elementary question but if I could learn more about this, I'd like to help ensure MinGW compatibility in more packages and in my own software.
Again, this is sort of the first of a small number of issues I ran into, but I'd like to take them one at a time instead of spamming the list with problems.
If this is not the proper list, I'd appreciate some advice on finding another.
Thank you, Chris Thielen
Hi Chris,
First, our software requires: libxml2, SDL, SDL_image, SDL_mixer and FTGL. SDL and libxml2 already have MinGW packages on Fedora and they worked very well. SDL_image and SDL_mixer did not but they compiled fine simply using mingw-configure, make, make install. Be that as it is, is there much else involved in package management for this sort of software? If not, I'd be interested in volunteering to maintain Fedora MinGW packages for SDL_image and SDL_mixer if they're not already on the way.
New mingw32 packages are always welcome! I don't know if you're already familiar with maintaining regular RPMs for Fedora, but we tried to keep the packaging of mingw32 packages as easy as possible. In order to port a native Fedora package to a mingw32 package, there are some steps which need to be done:
- Calls to the macro %configure need to be replaced with %{_mingw32_configure}. - File lists will need to be updated to use macro's like %{_mingw32_bindir} and %{_mingw32_libdir} instead of %{_bindir} and %{_libdir} - The package needs to be made noarch, so a 'BuildArch: noarch' needs to be added - Some mingw32 specific BuildRequires need to be added. At least ones should be added for mingw32-filesystem, mingw32-gcc and mingw32-binutils. Depending on the dependencies of the package itself more mingw32-specific BR's might be needed - The top of the .spec file should begin with these set of macro's: %global __strip %{_mingw32_strip} %global __objdump %{_mingw32_objdump} %global _use_internal_dependency_generator 0 %global __find_requires %{_mingw32_findrequires} %global __find_provides %{_mingw32_findprovides}
When putting a new package up for review, don't forget to CC fedora-mingw@lists.fedoraproject.org so that you have a better chance that somebody reviews the package soon.
Their configure script fails to find OpenGL, attempting to link against -lGL. I understand for MinGW it's proper to link against -lopengl32 and add -mwindows to the compiler flags. Would the proper thing to do here be to add a check for the mingw system type in configure.ac and change the CFLAGS and LIBS to -lopengl32 instead of -lGL?
The '-mwindows' compiler flag is used to indicate that the resulting executable shouldn't show a console window when it's started. When the compiler flag '-mconsole' is used a console window will be shown where all stdout/stderr-output gets shown.
Applying a change in the configure.ac file which adds a special check for mingw32 environments seems like the correct approach to me.
I don't know if the Windows opengl32 library contains all the OpenGL functions you want to use, but there's also a mingw32-freeglut package in the Fedora repositories which offers additional OpenGL functions.
If you've got any more questions, feel free to drop them on this list
Kind regards,
Erik van Pienbroek
Please note that SDL_image and SDL_mixer are awaiting review at https://bugzilla.redhat.com/show_bug.cgi?id=543154%C2%A0and https://bugzilla.redhat.com/show_bug.cgi?id=543147). It would be great if you could a (informal?) review.
Thanks, Stefan (who needs to update those review requests...)
2010/9/25 Erik van Pienbroek erik@vanpienbroek.nl
Hi Chris,
First, our software requires: libxml2, SDL, SDL_image, SDL_mixer and FTGL. SDL and libxml2 already have MinGW packages on Fedora and they worked very well. SDL_image and SDL_mixer did not but they compiled fine simply using mingw-configure, make, make install. Be that as it is, is there much else involved in package management for this sort of software? If not, I'd be interested in volunteering to maintain Fedora MinGW packages for SDL_image and SDL_mixer if they're not already on the way.
New mingw32 packages are always welcome! I don't know if you're already familiar with maintaining regular RPMs for Fedora, but we tried to keep the packaging of mingw32 packages as easy as possible. In order to port a native Fedora package to a mingw32 package, there are some steps which need to be done:
- Calls to the macro %configure need to be replaced with
%{_mingw32_configure}.
- File lists will need to be updated to use macro's like
%{_mingw32_bindir} and %{_mingw32_libdir} instead of %{_bindir} and %{_libdir}
- The package needs to be made noarch, so a 'BuildArch: noarch' needs to
be added
- Some mingw32 specific BuildRequires need to be added. At least ones
should be added for mingw32-filesystem, mingw32-gcc and mingw32-binutils. Depending on the dependencies of the package itself more mingw32-specific BR's might be needed
- The top of the .spec file should begin with these set of macro's:
%global __strip %{_mingw32_strip} %global __objdump %{_mingw32_objdump} %global _use_internal_dependency_generator 0 %global __find_requires %{_mingw32_findrequires} %global __find_provides %{_mingw32_findprovides}
When putting a new package up for review, don't forget to CC fedora-mingw@lists.fedoraproject.org so that you have a better chance that somebody reviews the package soon.
Their configure script fails to find OpenGL, attempting to link against -lGL. I understand for MinGW it's proper to link against -lopengl32 and add -mwindows to the compiler flags. Would the proper thing to do here be to add a check for the mingw system type in configure.ac and change the CFLAGS and LIBS to -lopengl32 instead of -lGL?
The '-mwindows' compiler flag is used to indicate that the resulting executable shouldn't show a console window when it's started. When the compiler flag '-mconsole' is used a console window will be shown where all stdout/stderr-output gets shown.
Applying a change in the configure.ac file which adds a special check for mingw32 environments seems like the correct approach to me.
I don't know if the Windows opengl32 library contains all the OpenGL functions you want to use, but there's also a mingw32-freeglut package in the Fedora repositories which offers additional OpenGL functions.
If you've got any more questions, feel free to drop them on this list
Kind regards,
Erik van Pienbroek
mingw mailing list mingw@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/mingw
On Sat, Sep 25, 2010 at 01:03:39AM +0200, Erik van Pienbroek wrote:
In order to port a native Fedora package to a mingw32 package, there are some steps which need to be done:
[...]
Another good idea is to take a look at how existing packages are done. Go to:
http://pkgs.fedoraproject.org/gitweb/?p=mingw32-glib2.git;a=tree
(replace mingw32-glib2 with other package names too)
and click on the .spec file.
When putting a new package up for review, don't forget to CC fedora-mingw@lists.fedoraproject.org so that you have a better chance that somebody reviews the package soon.
See also:
http://join.fedoraproject.org/ http://fedoraproject.org/wiki/PackageMaintainers/Join
Rich.