-Glut then!\r
-\r
-By Jean-Seb on Friday July 10, 2009, 00:18\r
-Translated by Babelfish with a scrub from John F. Fay. For points of confusion\r
-please refer to the original French version.\r
-\r
-Freeglut is an open-source evolution of GLUT.\r
-Under Windows, one can use it with Cygwin.\r
-Easy? Yes, if one agrees to distribute "cygwin1.dll".\r
-Let us help freeglut gain its independence !\r
-m.à.j 10/7/2009: generation of a library for linking without the DLL.\r
-\r
-\r
-Recovery of the sources\r
-\r
- * Download the sources of version 2.6.0 which integrates recent changes.\r
- * For the moment, it is a RC (Release Candidate), but the final version\r
- should not delay.\r
- * The use of the 2.6 is preferable with the 2.4-stable branch because many\r
- bugs have been corrected.\r
- * You will find the sources on the site of Freeglut:\r
- o http://freeglut.sourceforge.net/\r
-\r
-\r
-Objectives and preparation\r
-Objectives\r
-\r
- * We will create a DLL related to Cygwin, and an independent static library\r
- * We will also create a dynamic library, allowing linking with the DLL.\r
-\r
-\r
-List of generated files\r
-\r
- * freeglut.dll: a traditional DLL for the dynamic linkage.\r
- * libfreeglut.a: the static library. The final program is autonomous (at\r
- least for OpenGL).\r
- * libfreeglutdll.a: the dynamic library. The final program needs\r
- freeglut.dll.\r
-\r
-\r
-Preparation\r
-\r
- * Extract the files from the freeglut archive.\r
- * Go in the directory src (located at the root of the Freeglut directory),\r
- and create a "Gl" sub-directory\r
- o In this sub-directory, copy the files of the directory "include/Gl"\r
-\r
- * Why is it necessary to create a "Gl" directory for compilation?\r
- o I needed it to simplify things during my tests.\r
- o If not you can create the repertories directly, and copy the files\r
- as indicated in the point installation (see below).\r
-\r
- * Do a little housekeeping in /lib:\r
- o Erase all the references to the glut, so as not to conflict with the\r
- linking.\r
- o This stage is optional, you can also choose to do the housekeeping\r
- only after a successful compilation of Freeglut.\r
- o In your enthusiasm to clean things up, be careful not to erase the\r
- library glu32.lib (not to be confused with glut32.lib).\r
-\r
-\r
-Compilation\r
-\r
- * Forget the "./configure, make, make install" triptych.\r
- o It does not go at all with Cygwin.\r
-\r
- * Here Makefile which will make the deal:\r
-\r
-#Makefile for Freeglut 2.6.0-rc and Cygwin\r
-#To place in the directory \93src/Common\94\r
-\r
-sources=$ (wildcard *.c)\r
-objs=$ (sources: .c=.o)\r
-libname=freeglut\r
-\r
-\r
-CFLAGS=-O2 - DTARGET_HOST_MS_WINDOWS - DX_DISPLAY_MISSING - DFREEGLUT_STATIC - I./\r
-LDFLAGS=-lopengl32 - lgdi32 - lwinmm\r
-\r
-nocyg=-mno-cygwin - mwindows\r
-\r
-all: $ (objs)\r
- #construction DLL related to cygwin1.dll\r
- GCC $ (nocyg) $ (objs) - shared $ (LDFLAGS) - O $ (libname) .dll\r
- Nm $ (libname) .dll | awk \93BEGIN {print \93EXPORTS\94} /T _glut/{sub (/^.*T _/,\94 \ T "); print}\94 > $ (libname) .def\r
- dlltool --dllname $ (libname) .dll --input-def $ (libname) .def --output-lib lib$ (libname) dll.a\r
-\r
- #construction static library independent of cygwin\r
- rear Cr lib$ (libname) .a $ (objs)\r
- #pas inevitably obligatory (creation of an index to accelerate the accesses)\r
- ranlib lib$ (libname) .a\r
-\r
-%.o: %.c\r
- GCC $ (nocyg) - C $ (CFLAGS) $<\r
-\r
-clean:\r
- rm - F *.o $ (libname) .dll $ (libname) .def lib$ (libname) dll.a lib$ (libname) .a\r
-\r
-\r
-\r
-\r
-Some remarks on the makefile\r
-\r
- * This makefile creates a DLL, a static library (a file, in other words) and\r
- the dynamic library which will allow the use of the DLL.\r
-\r
- * Do not try to strip the static library! You may not be able to compile\r
- applications with static library any more.\r
- o On the other hand, you can strip the final executable obtained after\r
- compiling your application.\r
-\r
- * I chose to call the DLL and the libraries by their "true names":\r
- freeglut.dll libfreeglutdll.a and libfreeglut.a.\r
- o Script configures recreated (for reasons of compatibility with the\r
- old GLUT library) glut.dll and libglut.a.\r
- o During the my tests, I had conflicts with an authentic "glut" which\r
- trailed in my "/lib". I decided to call the things by their name, in\r
- order to avoid confusions.\r
- o Nothing prevents you from renaming the DLL, if you need to use GLUT\r
- programs which you cannot recompile.\r
-\r
- * The dynamic library is generated starting from the DLL.\r
- o For reasons of brevity, I used awk. It generates the export file\r
- used by dlltool.\r
- o The only notable thing is the selection of the functions whose name\r
- starts with _glut, in order to avoid including in the dynamic\r
- library the functions that are not related to freeglut.\r
- o then, one uses dlltool in a very traditional way.\r
-\r
-Nm $ (libname) .dll | awk \93BEGIN {print \93EXPORTS\94} /T _glut/{sub (/^.*T _/,\94 \ T "); print}\94 > $ (libname) .def\r
-dlltool --dllname $ (libname) .dll --input-def $ (libname) .def --output-lib lib$ (libname) dll.a\r
-\r
-\r
-\r
-\r
-Installation\r
-\r
- * Copy libfreeglut.a, libfreeglutdll.a into the Cygwin directory /lib.\r
- * Copy freglut.dll in the system32 of Windows (this is practical, but not\r
- clean!).\r
- * Copy the files headers of Freeglut (/include/gl) into the Cygwin directory\r
- /usr/include/Gl.\r
- * Copy the files headers (always /include/gl) into /usr/include/mingw/Gl:\r
- this is used for compilations with the flag - mno-cygwin, which uses the\r
- includes in mingw.\r
- o You may need to erase the old GLUT include files if you installed it\r
- with Cygwin.\r
-\r
-\r
-Use of the library\r
-\r
- * We will test with the program shapes, found in progs/demonstrations/shapes\r
- o -mno-cygwin is used to force the use of Mingw without the large\r
- dependence cygwin1.dll.\r
- o -mwindows is only used to remove the horrible Shell window (very\r
- useful for the settling, on the other hand).\r
- o -L. (note the period after the "L"): I left libfreeglut.a,\r
- libfreeglutdll.a and freeglut.dll in the test directory, at the time \r
- of the tests.\r
-\r
-\r
-Compilation of the static freeglut library, without cygwin\r
-\r
- * All the simplicity lies in the define: -DFREEGLUT_STATIC\r
- o It serves to obtain good decoration of the function names in the\r
- imports of the lib Freeglut.\r
- o You can test without and use a hex editor to see the differences\r
- in the objects.\r
- * attention with the order of the libraries: -lfreeglut (static) must be\r
- before the declaration of the dynamic libraries.\r
-\r
- * gcc shapes.c -L. -lfreeglut -lopengl32 -lwinmm -lgdi32 -mno-cygwin -mwindows -DFREEGLUT_STATIC\r
-\r
-\r
-Compilation with DLL freeglut, without cygwin\r
-\r
- * For the define, see the notices above\r
- * The order of the libraries is no longer important.\r
-\r
- * gcc shapes.c -L. -lopengl32 -lwinmm -lgdi32 -lfreeglut -mno-cygwin -DFREEGLUT_STATIC\r
-\r
-\r
-Compilation with DLL freeglut, Cygwin\r
-\r
- * This example is given only for reference, the topic of this ticket being\r
- to get rid of Cygwin.\r
- o Let us say that can be used to make the point (and later).\r
-\r
- * gcc shapes.c -L. -lopengl32 -lwinmm -lgdi32 -lfreeglut\r
-\r
-\r
-\r
-Where are the dooooocs?\r
-\r
- * Freeglut is delivered with its documentation, more very up to date.\r
- o It seems that there is a problem with the original GLUT\r
- documentation. Not only it does not correspond completely to the\r
- operation of Freeglut, but moreover, its author (Mark Kilgard)\r
- copyrighted it. Its distribution is thus difficult.\r
-\r
- * Jocelyn Fréchot undertook a levelling of the docs for version 2.6.0. One can find them on his site for the moment:\r
- o http://jocelyn.frechot.free.fr/freeglut/\r
-\r
-\r
-Something survived\85\r
-\r
- * I also tested the recompiling of the demonstrations of the original lib\r
- GLUT (peace with its ashes).\r
- o Nothing in particular to be announced.\r
-\r
- * Thank you with all the courageous maintainers for Freeglut, that one\r
- believed dead, but which still move.\r
+Glut then!
+
+By Jean-Seb on Friday July 10, 2009, 00:18
+Translated by Babelfish with a scrub from John F. Fay. For points of confusion
+please refer to the original French version.
+
+Freeglut is an open-source evolution of GLUT.
+Under Windows, one can use it with Cygwin.
+Easy? Yes, if one agrees to distribute "cygwin1.dll".
+Let us help freeglut gain its independence !
+Update 10/7/2009: generation of a library for linking without the DLL.
+
+
+Grabbing the sources
+
+ * Download the sources for version 2.6.0 which integrates recent changes.
+ * Using version 2.6 is better than the 2.4-stable branch because many
+ bugs have been corrected.
+ * You will find the sources on the site of Freeglut:
+ o http://freeglut.sourceforge.net/
+
+
+Goals
+
+ * We will create a DLL for Cygwin, and an independent static library
+ * We will also create a dynamic library, allowing linking with the DLL.
+
+
+List of generated files
+
+ * freeglut.dll: a traditional DLL for the dynamic linkage.
+ * libfreeglut.a: the static library. The final program is autonomous (at
+ least for OpenGL).
+ * libfreeglutdll.a: the dynamic library. The final program needs
+ freeglut.dll.
+
+
+Preparation
+
+ * Extract the files from the freeglut archive.
+ * Go in the directory src (located at the root of the Freeglut directory),
+ and create a "Gl" sub-directory
+ o In this sub-directory, copy the files of the directory "include/Gl"
+
+ * Why is it necessary to create a "Gl" directory for compilation?
+ o I needed it to simplify things during my tests.
+ o If not you can create the repertories directly, and copy the files
+ as indicated in the point installation (see below).
+
+ * Do a little housekeeping in /lib:
+ o Erase all the references to the glut, so as not to conflict with the
+ linking.
+ o This stage is optional, you can also choose to do the housekeeping
+ only after a successful compilation of Freeglut.
+ o In your enthusiasm to clean things up, be careful not to erase the
+ library glu32.lib (not to be confused with glut32.lib).
+
+
+Compilation
+
+ * Forget the "./configure, make, make install" triptych.
+ o It does not go at all with Cygwin.
+
+ * Here Makefile which will make the deal:
+
+#Makefile for Freeglut 2.6.0-rc and Cygwin
+#To place in the directory 'src/Common'
+
+sources=$ (wildcard *.c)
+objs=$ (sources: .c=.o)
+libname=freeglut
+
+
+CFLAGS=-O2 - DTARGET_HOST_MS_WINDOWS - DX_DISPLAY_MISSING - DFREEGLUT_STATIC - I./
+LDFLAGS=-lopengl32 - lgdi32 - lwinmm
+
+nocyg=-mno-cygwin - mwindows
+
+all: $ (objs)
+ #construction DLL related to cygwin1.dll
+ gcc $(nocyg) $(objs) -shared $(LDFLAGS) -o $(libname).dll
+ nm $(libname).dll | awk 'BEGIN { print "EXPORTS" } /T _glut/ {sub( /^.*T _/, "\t"); print}' > $(libname).def
+ dlltool --dllname $(libname).dll --input-def $(libname).def --output-lib lib$(libname)dll.a
+
+ #construction static library independent of cygwin
+ ar cr lib$(libname).a $(objs)
+ #pas inevitably obligatory (creation of an index to accelerate the accesses)
+ ranlib lib$(libname).a
+
+%.o: %.c
+ gcc $(nocyg) -c $(CFLAGS) $<
+
+clean:
+ rm -f *.o $(libname).dll $(libname).def lib$(libname)dll.a lib$(libname).a
+
+
+
+
+Some remarks on the Makefile
+
+ * This makefile creates a DLL, a static library (a file, in other words) and
+ the dynamic library which will allow the use of the DLL.
+
+ * Do not try to strip the static library! You may not be able to compile
+ applications with static library any more.
+ o On the other hand, you can strip the final executable obtained after
+ compiling your application.
+
+ * I chose to call the DLL and the libraries by their "true names":
+ freeglut.dll libfreeglutdll.a and libfreeglut.a.
+ o Script configures recreated (for reasons of compatibility with the
+ old GLUT library) glut.dll and libglut.a.
+ o During the my tests, I had conflicts with an authentic "glut" which
+ trailed in my "/lib". I decided to call the things by their name, in
+ order to avoid confusions.
+ o Nothing prevents you from renaming the DLL, if you need to use GLUT
+ programs which you cannot recompile.
+
+ * The dynamic library is generated starting from the DLL.
+ o For reasons of brevity, I used awk. It generates the export file
+ used by dlltool.
+ o The only notable thing is the selection of the functions whose name
+ starts with _glut, in order to avoid including in the dynamic
+ library the functions that are not related to freeglut.
+ o then, one uses dlltool in a very traditional way.
+
+nm $(libname).dll | awk 'BEGIN { print "EXPORTS" } /T _glut/ {sub( /^.*T _/, "\t"); print}' > $(libname).def
+dlltool --dllname $(libname).dll --input-def $(libname).def --output-lib lib$(libname)dll.a
+
+
+
+
+Installation
+
+ * Copy libfreeglut.a, libfreeglutdll.a into the Cygwin directory /lib.
+ * Copy freglut.dll in the system32 of Windows (this is practical, but not
+ clean!).
+ * Copy the files headers of Freeglut (/include/gl) into the Cygwin directory
+ /usr/include/Gl.
+ * Copy the files headers (always /include/gl) into /usr/include/mingw/Gl:
+ this is used for compilations with the flag - mno-cygwin, which uses the
+ includes in mingw.
+ o You may need to erase the old GLUT include files if you installed it
+ with Cygwin.
+
+
+Use of the library
+
+ * We will test with the program shapes, found in progs/demonstrations/shapes
+ o -mno-cygwin is used to force the use of Mingw without the large
+ dependence cygwin1.dll.
+ o -mwindows is only used to remove the horrible Shell window (very
+ useful for the settling, on the other hand).
+ o -L. (note the period after the "L"): I left libfreeglut.a,
+ libfreeglutdll.a and freeglut.dll in the test directory, at the time
+ of the tests.
+
+
+Compilation of the static freeglut library, without cygwin
+
+ * All the simplicity lies in the define: -DFREEGLUT_STATIC
+ o It serves to obtain good decoration of the function names in the
+ imports of the lib Freeglut.
+ o You can test without and use a hex editor to see the differences
+ in the objects.
+ * attention with the order of the libraries: -lfreeglut (static) must be
+ before the declaration of the dynamic libraries.
+
+ * gcc shapes.c -L. -lfreeglut -lopengl32 -lwinmm -lgdi32 -mno-cygwin -mwindows -DFREEGLUT_STATIC
+
+
+Compilation with DLL freeglut, without cygwin
+
+ * For the define, see the notices above
+ * The order of the libraries is no longer important.
+
+ * gcc shapes.c -L. -lopengl32 -lwinmm -lgdi32 -lfreeglut -mno-cygwin -DFREEGLUT_STATIC
+
+
+Compilation with DLL freeglut, Cygwin
+
+ * This example is given only for reference, the topic of this ticket being
+ to get rid of Cygwin.
+ o Let us say that can be used to make the point (and later).
+
+ * gcc shapes.c -L. -lopengl32 -lwinmm -lgdi32 -lfreeglut
+
+
+
+Where are the dooooocs?
+
+ * Freeglut is delivered with its documentation, more very up to date.
+ o It seems that there is a problem with the original GLUT
+ documentation. Not only it does not correspond completely to the
+ operation of Freeglut, but moreover, its author (Mark Kilgard)
+ copyrighted it. Its distribution is thus difficult.
+
+ * Jocelyn Fréchot undertook a levelling of the docs for version 2.6.0. One can find them on his site for the moment:
+ o http://jocelyn.frechot.free.fr/freeglut/
+
+
+Something survived...
+
+ * I also tested the recompiling of the demonstrations of the original lib
+ GLUT (peace with its ashes).
+ o Nothing in particular to be announced.
+
+ * Thank you with all the courageous maintainers for Freeglut, that one
+ believed dead, but which still move.