install.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. * The most simple case
  2. -----------------------
  3. If you compile wxWidgets on Linux for the first time and don't like to read
  4. install instructions just do (in the base dir):
  5. > ./configure --with-wine
  6. > make
  7. > su <type root password>
  8. > make install
  9. > ldconfig
  10. > exit
  11. On all variants of Unix except Linux (and maybe except *BSD), shared libraries
  12. are not supported out of the box due to the utter stupidity of libtool, so you'll
  13. have to do this to get shared library support:
  14. > ./configure --with-wine --disable-unicode --disable-static --enable-shared
  15. Then you'll have to edit the wrongly created libtool script. There are two
  16. important entries with respect to shared library creation, which are
  17. archive_cmds="\$LD -shared ....
  18. archive_expsym_cmds="\$LD -shared ....
  19. which should be something like
  20. archive_cmds="\$CC -shared ....
  21. archive_expsym_cmds="\$CC -shared ....
  22. Afterwards you can continue with
  23. > make
  24. > su <type root password>
  25. > make install
  26. > ldconfig
  27. > exit
  28. If you want to remove wxWidgets on Unix you can do this:
  29. > su <type root password>
  30. > make uninstall
  31. > ldconfig
  32. > exit
  33. * The expert case
  34. -----------------
  35. If you want to do some more serious cross-platform programming with wxWidgets,
  36. such as for GTK and Motif, you can now build two complete libraries and use
  37. them concurrently. For this end, you have to create a directory for each build
  38. of wxWidgets - you may also want to create different versions of wxWidgets
  39. and test them concurrently. Most typically, this would be a version configured
  40. with --enable-debug_flag and one without. Note, that only one build can currently
  41. be installed, so you'd have to use local version of the library for that purpose.
  42. For building three versions (one GTK, one WINE and a debug version of the WINE
  43. source) you'd do this:
  44. md buildmotif
  45. cd buildmotif
  46. ../configure --with-motif
  47. make
  48. cd ..
  49. md buildwine
  50. cd buildwine
  51. ../configure --with-wine
  52. make
  53. cd ..
  54. md buildwined
  55. cd buildwined
  56. ../configure --with-wine --enable-debug_flag
  57. make
  58. cd ..
  59. * The most simple errors
  60. ------------------------
  61. wxWINE doesn't work yet as WINE isn't really up to the task yet.
  62. You get errors during compilation: The reason is that you probably have a broken
  63. compiler, which includes almost everything that is called gcc. If you use gcc 2.8
  64. you have to disable optimisation as the compiler will give up with an internal
  65. compiler error.
  66. If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
  67. You get immediate segfault when starting any sample or application: This is either
  68. due to having compiled the library with different flags or options than your program -
  69. typically you might have the __WXDEBUG__ option set for the library but not for your
  70. program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
  71. * The most simple program
  72. -------------------------
  73. Now create your super-application myfoo.app and compile anywhere with
  74. g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
  75. * General
  76. -----------------------
  77. The Unix variants of wxWidgets use GNU configure. If you have problems with your
  78. make use GNU make instead.
  79. If you have general problems with installation, read my homepage at
  80. http://wesley.informatik.uni-freiburg.de/~wxxt
  81. for newest information. If you still don't have any success, please send a bug
  82. report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
  83. YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF WINE, WXWINE, WHAT DISTRIBUTION
  84. YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
  85. * GUI libraries
  86. -----------------------
  87. wxWidgets/WINE requires the WINE library to be installed on your system.
  88. You can get the newest version of the WINE from the WINE homepage at:
  89. http://www.winehq.com
  90. * Create your configuration
  91. -----------------------------
  92. Usage:
  93. ./configure options
  94. If you want to use system's C and C++ compiler,
  95. set environment variables CC and CCC as
  96. % setenv CC cc
  97. % setenv CCC CC
  98. % ./configure options
  99. to see all the options please use:
  100. ./configure --help
  101. The basic philosophy is that if you want to use different
  102. configurations, like a debug and a release version,
  103. or use the same source tree on different systems,
  104. you have only to change the environment variable OSTYPE.
  105. (Sadly this variable is not set by default on some systems
  106. in some shells - on SGI's for example). So you will have to
  107. set it there. This variable HAS to be set before starting
  108. configure, so that it knows which system it tries to
  109. configure for.
  110. Configure will complain if the system variable OSTYPE has
  111. not been defined. And Make in some circumstances as well...
  112. * General options
  113. -------------------
  114. Given below are the commands to change the default behaviour,
  115. i.e. if it says "--disable-threads" it means that threads
  116. are enabled by default.
  117. Many of the configure options have been thoroughly tested
  118. in wxWidgets snapshot 6, but not yet all (ODBC not).
  119. You must do this by running configure with either of:
  120. --with-wine Use the WINE library
  121. The following options handle the kind of library you want to build.
  122. --enable-threads Compile with thread support. Threads
  123. support is also required for the
  124. socket code to work.
  125. --disable-shared Do not create shared libraries.
  126. --disable-optimise Do not optimise the code. Can
  127. sometimes be useful for debugging
  128. and is required on some architectures
  129. such as Sun with gcc 2.8.X which
  130. would otherwise produce segvs.
  131. --enable-profile Add profiling info to the object
  132. files. Currently broken, I think.
  133. --enable-no_rtti Enable compilation without creation of
  134. C++ RTTI information in object files.
  135. This will speed-up compilation and reduce
  136. binary size.
  137. --enable-no_exceptions Enable compilation without creation of
  138. C++ exception information in object files.
  139. This will speed-up compilation and reduce
  140. binary size. Also fewer crashes during the
  141. actual compilation...
  142. --enable-mem_tracing Add built-in memory tracing.
  143. --enable-dmalloc Use the dmalloc memory debugger.
  144. Read more at www.letters.com/dmalloc/
  145. --enable-debug_info Add debug info to object files and
  146. executables for use with debuggers
  147. such as gdb (or its many frontends).
  148. --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
  149. compiling. This enable wxWidgets' very
  150. useful internal debugging tricks (such
  151. as automatically reporting illegal calls)
  152. to work. Note that program and library
  153. must be compiled with the same debug
  154. options.
  155. * Feature Options
  156. -------------------
  157. Many of the configure options have been thoroughly tested
  158. in wxWidgets snapshot 6, but not yet all (ODBC not).
  159. When producing an executable that is linked statically with wxGTK
  160. you'll be surprised at its immense size. This can sometimes be
  161. drastically reduced by removing features from wxWidgets that
  162. are not used in your program. The most relevant such features
  163. are
  164. --without-libpng Disables PNG image format code.
  165. --without-libjpeg Disables JPEG image format code.
  166. { --without-odbc Disables ODBC code. Not yet. }
  167. --disable-resources Disables the use of *.wxr type
  168. resources.
  169. --disable-threads Disables threads. Will also
  170. disable sockets.
  171. --disable-sockets Disables sockets.
  172. --disable-dnd Disables Drag'n'Drop.
  173. --disable-clipboard Disables Clipboard.
  174. --disable-serial Disables object instance serialisation.
  175. --disable-streams Disables the wxStream classes.
  176. --disable-file Disables the wxFile class.
  177. --disable-textfile Disables the wxTextFile class.
  178. --disable-intl Disables the internationalisation.
  179. --disable-validators Disables validators.
  180. --disable-accel Disables accel.
  181. Apart from disabling certain features you can very often "strip"
  182. the program of its debugging information resulting in a significant
  183. reduction in size.
  184. * Compiling
  185. -------------
  186. The following must be done in the base directory (e.g. ~/wxGTK
  187. or ~/wxWin or whatever)
  188. Now the makefiles are created (by configure) and you can compile
  189. the library by typing:
  190. make
  191. make yourself some coffee, as it will take some time. On an old
  192. 386SX possibly two weeks. During compilation, you'll get a few
  193. warning messages depending in your compiler.
  194. If you want to be more selective, you can change into a specific
  195. directory and type "make" there.
  196. Then you may install the library and its header files under
  197. /usr/local/include/wx and /usr/local/lib respectively. You
  198. have to log in as root (i.e. run "su" and enter the root
  199. password) and type
  200. make install
  201. You can remove any traces of wxWidgets by typing
  202. make uninstall
  203. If you want to save disk space by removing unnecessary
  204. object-files:
  205. make clean
  206. in the various directories will do the work for you.
  207. * Creating a new Project
  208. --------------------------
  209. 1) The first way uses the installed libraries and header files
  210. automatically using wx-config
  211. g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
  212. Using this way, a make file for the minimal sample would look
  213. like this
  214. CXX = g++
  215. minimal: minimal.o
  216. $(CXX) -o minimal minimal.o `wx-config --libs`
  217. minimal.o: minimal.cpp
  218. $(CXX) `wx-config --cflags` -c minimal.cpp -o minimal.o
  219. clean:
  220. rm -f *.o minimal
  221. This is certain to become the standard way unless we decide
  222. to stick to tmake.
  223. 2) The other way creates a project within the source code
  224. directories of wxWidgets. For this endeavour, you'll need
  225. the usual number of GNU tools, at least
  226. GNU automake version 1.4
  227. GNU autoheader version 2.14
  228. GNU autoconf version 2.14
  229. GNU libtool version 1.3
  230. and quite possibly
  231. GNU make
  232. GNU C++
  233. and if you have all this then you probably know enough to
  234. go ahead yourself :-)
  235. ----------------------
  236. In the hope that it will be useful,
  237. Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>
  238. Addition notes by Julian Smart, August 2002
  239. ===========================================
  240. I've fixed some compile errors, and got as far as
  241. compiling wxWINE, but actually linking a sample will take
  242. further work.
  243. To compile wxWINE, export these variables:
  244. export CPPFLAGS=-I/usr/local/include/wine
  245. export LDFLAGS=-L/usr/local/lib/wine
  246. and configure with:
  247. configure --disable-static --enable-shared --enable-gui \
  248. --with-wine --without-libpng --enable-debug_flag --enable-log \
  249. --enable-debug_info --enable-ole --enable-clipboard --enable-dataobj \
  250. --enable-debug --enable-threads --disable-sockets \
  251. --with-libjpeg --enable-debug_cntxt
  252. Compiling a sample won't work yet because 'winebuild' needs
  253. to be called, and the resuling C file compiled and linked.
  254. Plus, Windows DLLs need to be imported.
  255. Note that the documentation on the WINE web site on using
  256. winebuild is out of date (August 2002) -- the spec file no
  257. longer supports import and type keywords. Instead look at
  258. samples in the WINE 'programs' directory for inspiration
  259. and compile options to use. It's probable that the
  260. wxWINE library will need recompiling with different options.
  261. Any progress on this front will be very welcome.
  262. Note that while wxWINE builds with --enable-unicode, samples
  263. don't run. Some samples will run when built with
  264. --disable-unicode, and others (such as auidemo) fail.