README.Unix.txt 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. README.Unix.txt - 2010-11-14 - Building FLTK on Unix
  2. -----------------------------------------------------
  3. CONTENTS
  4. ==========
  5. 1 INTRODUCTION
  6. 2 PREREQUISITES
  7. 2.1 Ubuntu 10
  8. 2.2 Linux Mint 9
  9. 2.3 Fedora 13
  10. 2.4 * http://www2.mandriva.com/
  11. 2.5 * http://www.opensuse.org/en/
  12. 2.6 * http://www.debian.org/
  13. 2.7 * Mandrake?
  14. 2.8 * Sun?
  15. 2.9 * SGI?
  16. 2.10 * HPUX?
  17. 3 HOW TO BUILD FLTK USING GCC
  18. 3.1 Prerequisites
  19. 3.2 Downloading and Unpacking
  20. 3.3 Configuring FLTK
  21. 3.4 Building FLTK
  22. 3.5 Testing FLTK
  23. 3.6 Installing FLTK
  24. 3.7 Creating new Projects
  25. 4 CREATING A NEW PROJECT IN CODE::BLOCKS
  26. 5 DOCUMENT HISTORY
  27. * TODO: we still need to write these chapters
  28. 1 INTRODUCTION
  29. =================
  30. FLTK currently supports the following development environments on vmost Unix
  31. platforms:
  32. - gcc command line tools
  33. - Code::Blocks
  34. - ...
  35. The Symbol font and the Zapf Dingbats font do not work on X11. This is correct
  36. behavior for UTF-8 platforms.
  37. 2 PREREQUISITES
  38. ==================
  39. 2.1 Ubuntu 10
  40. ----------------
  41. Ubuntu Linux can be downloaded here:
  42. http://www.ubuntu.com/
  43. If you have not done so yet, download and install Ubuntu.
  44. Open a shell and install some software:
  45. sudo apt-get install g++
  46. sudo apt-get install gdb
  47. sudo apt-get install subversion
  48. sudo apt-get install autoconf
  49. sudo apt-get install libx11-dev
  50. sudo apt-get install libglu1-mesa-dev
  51. These two are optional, but highly recommended:
  52. sudo apt-get install libasound2-dev
  53. sudo apt-get install libxft-dev
  54. If you are planning to use the Code::Blocks IDE, also install this
  55. sudo apt-get install codeblocks
  56. I like to use subversion to install the latest FLTK-1.3.release:
  57. svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
  58. To update to the latest version, just go into the fltk-1.3 directory and type
  59. svn update
  60. 2.2 Linux Mint 9
  61. -------------------
  62. Linux Mint 9 can be downloaded here:
  63. http://www.linuxmint.com/
  64. If you have not done so yet, download and install Linux Mint.
  65. Open a shell and install some software:
  66. sudo apt-get install g++
  67. sudo apt-get install gdb
  68. sudo apt-get install subversion
  69. sudo apt-get install autoconf
  70. sudo apt-get install libx11-dev
  71. sudo apt-get install libglu1-mesa-dev
  72. These two are optional, but highly recommended:
  73. sudo apt-get install libasound2-dev
  74. sudo apt-get install libxft-dev
  75. If you are planning to use the Code::Blocks IDE, also install this
  76. sudo apt-get install codeblocks
  77. I like to use subversion to install the latest FLTK-1.3.release:
  78. svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
  79. To update to the latest version, just go into the fltk-1.3 directory and type
  80. svn update
  81. FIXME: no FL_SYMBOL font (-*-symbol-*), font 15 (Zapf-Dingbats)
  82. 2.3 Fedora 13
  83. -------------------
  84. Fedora 13 Linux can be downloaded here:
  85. http://fedoraproject.org/
  86. If you have not done so yet, download and install Fedora.
  87. Open a terminal window and install some software. In Fedora, the default user
  88. has no permission to call "sudo", so we will change user a few times:
  89. su root
  90. yum groupinstall "Development Tools"
  91. yum groupinstall "X Software Development"
  92. If you are planning to use the Code::Blocks IDE, also install this
  93. yum install codeblocks.i686 (for 64 bit machines)
  94. Don't forget to leave root status (Ctrl-D) before loading FLTK. To install FLTK
  95. for every user, you either have to set root user again, or use "visudo" to add
  96. yourself to the "sudo" list.
  97. I like to use subversion to install the latest FLTK-1.3.release:
  98. svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
  99. To update to the latest version, just go into the fltk-1.3 directory and type
  100. svn update
  101. FIXME: no FL_SYMBOL font (-*-symbol-*), font 15 (Zapf-Dingbats)
  102. 3 HOW TO BUILD FLTK USING GCC
  103. ================================
  104. 3.1 Downloading and Unpacking
  105. --------------------------------
  106. Download FLTK from here:
  107. http://www.fltk.org/software.php
  108. If you are familiar with "subversion" and like to stay current with your
  109. version, you will find the subversion access parameters at the bottom of that
  110. page. Unpack FLTK into a convenient location. I like to have everything in my
  111. dev directory:
  112. cd
  113. mkdir dev
  114. cd dev
  115. mv ~/Downloads/fltk-1.3.xxxx.tar.gz .
  116. tar xvfz fltk-1.3.xxxx.tar.gz
  117. cd fltk-1.3.xxxx
  118. 3.2 Configuring FLTK
  119. -----------------------
  120. Stay in your FLTK source-code directory. Type:
  121. autoconf
  122. Now configure your FLTK installation:
  123. ./configure
  124. ADVANCED: type "./configure --help" to get a complete list of optional
  125. configurations parameters. These should be pretty self-explanatory. Some
  126. more details can be found in README.
  127. :END_ADVANCED
  128. The configuration script will check your machine for the required resources
  129. which you should have installed as described in the Prerequisites chapter. Review
  130. the Configuration Summary, maybe take some notes.
  131. 3.3 Building FLTK
  132. --------------------
  133. Now this is easy. Stay in your FLTK source-code directory and type:
  134. make
  135. The entire FLTK toolkit including many test programs will be built for you. No
  136. warnings should appear. If some do, please let the FLTK developer team know via
  137. the mailing list or the bug reporting template at www.fltk.org .
  138. Actually, as of Oct 28 2010, quite a bunch of warnings will show, mostly about
  139. suggested parenthesis. Please ignore them until we can fix them.
  140. 3.4 Testing FLTK
  141. -------------------
  142. After a successful build, you can test FLTK's capabilities:
  143. test/demo
  144. 3.5 Installing FLTK
  145. ----------------------
  146. If you did not change any of the configuration settings, FLTK will be installed
  147. in "/usr/local/include" and "/usr/local/lib" by typing
  148. sudo make install
  149. If you are using the KDE, GNOME or XFCE desktop environments and want to call
  150. "fluid" from the desktop menu, you will need to install additional files and
  151. icons under "/usr/share" by typing:
  152. sudo make install-desktop
  153. It is possible to install FLTK without superuser privileges by changing the
  154. installation path to a location within the user account by adding the
  155. "--prefix=PREFIX" parameters to the "./configure" command.
  156. 3.6 Creating new Projects
  157. ----------------------------
  158. FLTK provides a neat script named "fltk-config" that can provide all the flags
  159. needed to build FLTK applications using the same flags that were used to build
  160. the library itself. Running "fltk-config" without arguments will print a list
  161. options. The easiest call to compile an FLTK application from a single source
  162. file is:
  163. fltk-config --compile myProgram.cxx
  164. "fltk-config" and "fluid" will be installed in "/usr/local/bin/" by default. I
  165. recommend that you add it to the command search path.
  166. 4 CREATING A NEW PROJECT IN CODE::BLOCKS
  167. ===========================================
  168. Code::Blocks is a free and popular C++ IDE in the Linux world. It also runs on
  169. OS X and MSWindows. Configured correctly, it can also cross-compile between
  170. these platforms. This chapter focuses on creating a new FLTK project for Linux,
  171. assuming that FLTK 1.3 was previously built and installed in its default
  172. location from the command line.
  173. If not done yet, install Code::Blocks as described in the Prerequisites chapter
  174. above, or download it from their web site. This description is based on
  175. version 10.05:
  176. http://www.codeblocks.org/
  177. Start Code::Blocks. Select File > New > Project. In the "New from template"
  178. dialog box, click on "FLTK project" and follow the instructions.
  179. The default project support basic fltk. If you would like to add support for
  180. images, OpenGL, GLUT, or Forms, add the corresponding flags --use-images,
  181. --use-gl, --use-glut, and --use-forms respectively.
  182. The flags are located in the "Project Build Options" dialog. To change the
  183. compiler flags, select your project in the tree view, then select the
  184. "Compiler Settings" tab, then "Other Options" and add the flags to
  185. `fltk-config --cxxflags` in front of the second "`".
  186. The linker flags are located in the "Linker Settings" tab under "Other Linker
  187. Options". Add the flags to `fltk-config --ldstaticflags` in front of the
  188. second "`".
  189. 5 DOCUMENT HISTORY
  190. =====================
  191. Oct 30 2010 - matt: added Code::Blocks chapter
  192. Oct 28 2010 - matt: restructured entire document and verified instructions
  193. Nov 14 2010 - duncan: added install-desktop