]>
Commit | Line | Data |
---|---|---|
1 | dnl Process this file with autoconf to produce a configure script. | |
2 | AC_REVISION($Id$)dnl | |
3 | ||
4 | dnl --------------------------------------------------------------------------- | |
5 | dnl | |
6 | dnl Top-level configure.in for wxWindows by Robert Roebling, Phil Blecker and | |
7 | dnl Vadim Zeitlin | |
8 | dnl | |
9 | dnl This script is under the wxWindows licence. | |
10 | dnl | |
11 | dnl Version: $Id$ | |
12 | dnl --------------------------------------------------------------------------- | |
13 | ||
14 | dnl --------------------------------------------------------------------------- | |
15 | dnl initialization | |
16 | dnl --------------------------------------------------------------------------- | |
17 | ||
18 | dnl the file passed to AC_INIT should be speicific to our package | |
19 | AC_INIT(wx-config.in) | |
20 | ||
21 | AC_CANONICAL_HOST | |
22 | AM_INIT_AUTOMAKE(wxWindows, 2.1.0) | |
23 | ||
24 | WX_MAJOR_VERSION_NUMBER=2 | |
25 | WX_MINOR_VERSION_NUMBER=1 | |
26 | WX_RELEASE_NUMBER=0 | |
27 | ||
28 | dnl FIXME this hack suppresses automake 1.4 warning about @LTLIBOBJS@ being | |
29 | dnl never defined in configure.in (remove these lines to see what I'm | |
30 | dnl speaking about) - Tom Tromey <tromey@cygnus.com> told me that it will | |
31 | dnl be fixed in the next release. | |
32 | LIBOBJS= | |
33 | LIBOBJS="$LIBOBJS ../common/extended.o" | |
34 | ||
35 | dnl ------------------------------------------------------------------------ | |
36 | dnl Check platform (host system) | |
37 | dnl ------------------------------------------------------------------------ | |
38 | ||
39 | dnl assume Unix | |
40 | USE_UNIX=1 | |
41 | USE_LINUX= | |
42 | USE_SGI= | |
43 | USE_HPUX= | |
44 | USE_SYSV= | |
45 | USE_SVR4= | |
46 | USE_AIX= | |
47 | USE_SUN= | |
48 | USE_SOLARIS= | |
49 | USE_SUNOS= | |
50 | USE_ALPHA= | |
51 | USE_OSF= | |
52 | USE_BSD= | |
53 | USE_FREEBSD= | |
54 | USE_VMS= | |
55 | USE_ULTRIX= | |
56 | USE_CYGWIN= | |
57 | USE_MINGW32= | |
58 | USE_DATA_GENERAL= | |
59 | ||
60 | dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones | |
61 | dnl which are either yes or no | |
62 | DEFAULT_wxUSE_GTK=0 | |
63 | DEFAULT_wxUSE_MOTIF=0 | |
64 | DEFAULT_wxUSE_MSW=0 | |
65 | ||
66 | case "${host}" in | |
67 | *-hp-hpux* ) | |
68 | USE_HPUX=1 | |
69 | DEFAULT_wxUSE_MOTIF=1 | |
70 | AC_DEFINE(__HPUX__) | |
71 | ;; | |
72 | *-*-linux* ) | |
73 | USE_LINUX=1 | |
74 | AC_DEFINE(__LINUX__) | |
75 | TMP=`uname -m` | |
76 | if test "x$TMP" = "xalpha"; then | |
77 | USE_ALPHA=1 | |
78 | AC_DEFINE(__ALPHA__) | |
79 | fi | |
80 | DEFAULT_wxUSE_GTK=1 | |
81 | ;; | |
82 | *-*-irix5* | *-*-irix6* ) | |
83 | USE_SGI=1 | |
84 | USE_SVR4=1 | |
85 | AC_DEFINE(__SGI__) | |
86 | AC_DEFINE(__SVR4__) | |
87 | DEFAULT_wxUSE_MOTIF=1 | |
88 | ;; | |
89 | *-*-solaris2* ) | |
90 | USE_SUN=1 | |
91 | USE_SOLARIS=1 | |
92 | USE_SVR4=1 | |
93 | AC_DEFINE(__SUN__) | |
94 | AC_DEFINE(__SOLARIS__) | |
95 | AC_DEFINE(__SVR4__) | |
96 | DEFAULT_wxUSE_MOTIF=1 | |
97 | ;; | |
98 | *-*-sunos4* ) | |
99 | USE_SUN=1 | |
100 | USE_SUNOS=1 | |
101 | USE_BSD=1 | |
102 | AC_DEFINE(__SUN__) | |
103 | AC_DEFINE(__SUNOS__) | |
104 | AC_DEFINE(__BSD__) | |
105 | DEFAULT_wxUSE_MOTIF=1 | |
106 | ;; | |
107 | *-*-freebsd* | *-*-netbsd*) | |
108 | USE_BSD=1 | |
109 | USE_FREEBSD=1 | |
110 | AC_DEFINE(__FREEBSD__) | |
111 | AC_DEFINE(__BSD__) | |
112 | DEFAULT_wxUSE_GTK=1 | |
113 | ;; | |
114 | *-*-osf* ) | |
115 | USE_ALPHA=1 | |
116 | USE_OSF=1 | |
117 | AC_DEFINE(__ALPHA__) | |
118 | AC_DEFINE(__OSF__) | |
119 | DEFAULT_wxUSE_MOTIF=1 | |
120 | ;; | |
121 | *-*-dgux5* ) | |
122 | USE_ALPHA=1 | |
123 | USE_SVR4=1 | |
124 | AC_DEFINE(__ALPHA__) | |
125 | AC_DEFINE(__SVR4__) | |
126 | DEFAULT_wxUSE_MOTIF=1 | |
127 | ;; | |
128 | *-*-sysv5* ) | |
129 | USE_SYSV=1 | |
130 | USE_SVR4=1 | |
131 | AC_DEFINE(__SYSV__) | |
132 | AC_DEFINE(__SVR4__) | |
133 | DEFAULT_wxUSE_MOTIF=1 | |
134 | ;; | |
135 | *-*-aix* ) | |
136 | USE_AIX=1 | |
137 | USE_SYSV=1 | |
138 | USE_SVR4=1 | |
139 | AC_DEFINE(__AIX__) | |
140 | AC_DEFINE(__SYSV__) | |
141 | AC_DEFINE(__SVR4__) | |
142 | DEFAULT_wxUSE_MOTIF=1 | |
143 | ;; | |
144 | *) | |
145 | AC_MSG_ERROR(unknown system type $(host).) | |
146 | esac | |
147 | ||
148 | if test "$USE_UNIX" = 1 ; then | |
149 | wxUSE_UNIX=yes | |
150 | AC_DEFINE(__UNIX__) | |
151 | EXTRA_VPATH="$EXTRA_VPATH:\$(srcdir)/../unix" | |
152 | SRC_SUBDIRS="$SRC_SUBDIRS unix" | |
153 | INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS unix" | |
154 | fi | |
155 | ||
156 | dnl Linux: test for libc5/glibc2: glibc2 has gettext() included | |
157 | if test "$USE_LINUX" = 1; then | |
158 | AC_CHECK_LIB(c,gettext,AC_DEFINE(wxHAVE_GLIBC2)) | |
159 | fi | |
160 | ||
161 | dnl TODO cross-compiling for Windows not yet supported | |
162 | AC_DEFINE(__UNIX__) | |
163 | ||
164 | dnl if eval "test $USE_CYGWIN != 1 -a $USE_MINGW32 != 1"; then | |
165 | dnl AC_DEFINE(__UNIX__) | |
166 | dnl else | |
167 | dnl AC_DEFINE(__WINDOWS__) | |
168 | dnl DEFAULT_wxUSE_MSW=1 | |
169 | dnl fi | |
170 | ||
171 | dnl --------------------------------------------------------------------------- | |
172 | dnl command line options for configure | |
173 | dnl --------------------------------------------------------------------------- | |
174 | ||
175 | dnl the default values for all options - we collect them all here to simplify | |
176 | dnl modification of the default values (for example, if the defaults for some | |
177 | dnl platform should be changed, it can be done here too) | |
178 | dnl | |
179 | dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above | |
180 | ||
181 | dnl useful to test the compilation with minimum options, define as 0 for normal | |
182 | dnl usage | |
183 | DEBUG_CONFIGURE=0 | |
184 | if test $DEBUG_CONFIGURE = 1; then | |
185 | DEFAULT_wxUSE_THREADS=yes | |
186 | ||
187 | DEFAULT_wxUSE_OPTIMISE=no | |
188 | DEFAULT_wxUSE_PROFILE=no | |
189 | DEFAULT_wxUSE_DEBUG_FLAG=yes | |
190 | DEFAULT_wxUSE_DEBUG_INFO=yes | |
191 | DEFAULT_wxUSE_DEBUG_GDB=yes | |
192 | DEFAULT_wxUSE_MEM_TRACING=no | |
193 | DEFAULT_wxUSE_DMALLOC=no | |
194 | DEFAULT_wxUSE_APPLE_IEEE=no | |
195 | ||
196 | DEFAULT_wxUSE_LOG=yes | |
197 | ||
198 | DEFAULT_wxUSE_GUI=yes | |
199 | ||
200 | DEFAULT_wxUSE_ZLIB=no | |
201 | DEFAULT_wxUSE_LIBPNG=no | |
202 | DEFAULT_wxUSE_LIBGIF=no | |
203 | DEFAULT_wxUSE_LIBJPEG=no | |
204 | DEFAULT_wxUSE_ODBC=no | |
205 | ||
206 | DEFAULT_wxUSE_FILE=no | |
207 | DEFAULT_wxUSE_TEXTFILE=no | |
208 | DEFAULT_wxUSE_TIMEDATE=no | |
209 | DEFAULT_wxUSE_INTL=no | |
210 | DEFAULT_wxUSE_CONFIG=no | |
211 | DEFAULT_wxUSE_STREAMS=no | |
212 | DEFAULT_wxUSE_SOCKETS=no | |
213 | DEFAULT_wxUSE_SERIAL=no | |
214 | DEFAULT_wxUSE_JOYSTICK=no | |
215 | DEFAULT_wxUSE_DYNLIB_CLASS=no | |
216 | DEFAULT_wxUSE_LONGLONG=no | |
217 | ||
218 | DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no | |
219 | DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no | |
220 | DEFAULT_wxUSE_POSTSCRIPT=no | |
221 | ||
222 | DEFAULT_wxUSE_X_RESOURCES=no | |
223 | DEFAULT_wxUSE_CLIPBOARD=no | |
224 | DEFAULT_wxUSE_TOOLTIPS=no | |
225 | DEFAULT_wxUSE_DRAG_AND_DROP=no | |
226 | DEFAULT_wxUSE_SPLINES=no | |
227 | ||
228 | DEFAULT_wxUSE_MDI_ARCHITECTURE=no | |
229 | DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no | |
230 | DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no | |
231 | ||
232 | DEFAULT_wxUSE_PROLOGIO=no | |
233 | DEFAULT_wxUSE_RESOURCES=no | |
234 | DEFAULT_wxUSE_CONSTRAINTS=no | |
235 | DEFAULT_wxUSE_IPC=no | |
236 | DEFAULT_wxUSE_HELP=no | |
237 | DEFAULT_wxUSE_WXTREE=no | |
238 | DEFAULT_wxUSE_METAFILE=no | |
239 | ||
240 | DEFAULT_wxUSE_COMMONDLGS=no | |
241 | DEFAULT_wxUSE_MINIFRAME=no | |
242 | DEFAULT_wxUSE_VALIDATORS=yes | |
243 | ||
244 | DEFAULT_wxUSE_ACCEL=no | |
245 | DEFAULT_wxUSE_CARET=no | |
246 | DEFAULT_wxUSE_BMPBUTTON=no | |
247 | DEFAULT_wxUSE_CHECKBOX=no | |
248 | DEFAULT_wxUSE_CHECKLST=no | |
249 | DEFAULT_wxUSE_COMBOBOX=no | |
250 | DEFAULT_wxUSE_GAUGE=no | |
251 | DEFAULT_wxUSE_GRID=no | |
252 | DEFAULT_wxUSE_IMAGLIST=no | |
253 | DEFAULT_wxUSE_LISTBOX=no | |
254 | DEFAULT_wxUSE_LISTCTRL=no | |
255 | DEFAULT_wxUSE_NOTEBOOK=no | |
256 | DEFAULT_wxUSE_RADIOBOX=no | |
257 | DEFAULT_wxUSE_RADIOBTN=no | |
258 | DEFAULT_wxUSE_SASH=no | |
259 | DEFAULT_wxUSE_SCROLLBAR=no | |
260 | DEFAULT_wxUSE_SLIDER=no | |
261 | DEFAULT_wxUSE_SPINBTN=no | |
262 | DEFAULT_wxUSE_SPLITTER=no | |
263 | DEFAULT_wxUSE_STATBMP=no | |
264 | DEFAULT_wxUSE_STATBOX=no | |
265 | DEFAULT_wxUSE_STATLINE=no | |
266 | DEFAULT_wxUSE_STATUSBAR=yes | |
267 | DEFAULT_wxUSE_TABDIALOG=no | |
268 | DEFAULT_wxUSE_TOOLBAR=no | |
269 | DEFAULT_wxUSE_TREECTRL=no | |
270 | ||
271 | DEFAULT_wxUSE_UNICODE=no | |
272 | DEFAULT_wxUSE_WCSRTOMBS=no | |
273 | else | |
274 | DEFAULT_wxUSE_THREADS=yes | |
275 | ||
276 | DEFAULT_wxUSE_OPTIMISE=yes | |
277 | DEFAULT_wxUSE_PROFILE=no | |
278 | DEFAULT_wxUSE_DEBUG_FLAG=no | |
279 | DEFAULT_wxUSE_DEBUG_INFO=no | |
280 | DEFAULT_wxUSE_DEBUG_GDB=no | |
281 | DEFAULT_wxUSE_MEM_TRACING=no | |
282 | DEFAULT_wxUSE_DMALLOC=no | |
283 | DEFAULT_wxUSE_APPLE_IEEE=yes | |
284 | ||
285 | DEFAULT_wxUSE_LOG=yes | |
286 | ||
287 | DEFAULT_wxUSE_GUI=yes | |
288 | ||
289 | DEFAULT_wxUSE_ZLIB=yes | |
290 | DEFAULT_wxUSE_LIBPNG=yes | |
291 | DEFAULT_wxUSE_LIBGIF=yes | |
292 | DEFAULT_wxUSE_LIBJPEG=yes | |
293 | DEFAULT_wxUSE_ODBC=no | |
294 | ||
295 | DEFAULT_wxUSE_FILE=yes | |
296 | DEFAULT_wxUSE_TEXTFILE=yes | |
297 | DEFAULT_wxUSE_TIMEDATE=yes | |
298 | DEFAULT_wxUSE_INTL=yes | |
299 | DEFAULT_wxUSE_CONFIG=yes | |
300 | DEFAULT_wxUSE_STREAMS=yes | |
301 | DEFAULT_wxUSE_SOCKETS=yes | |
302 | DEFAULT_wxUSE_SERIAL=yes | |
303 | DEFAULT_wxUSE_JOYSTICK=yes | |
304 | DEFAULT_wxUSE_DYNLIB_CLASS=yes | |
305 | DEFAULT_wxUSE_LONGLONG=no | |
306 | ||
307 | DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes | |
308 | DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes | |
309 | DEFAULT_wxUSE_POSTSCRIPT=yes | |
310 | ||
311 | DEFAULT_wxUSE_X_RESOURCES=no | |
312 | DEFAULT_wxUSE_CLIPBOARD=yes | |
313 | DEFAULT_wxUSE_TOOLTIPS=yes | |
314 | DEFAULT_wxUSE_DRAG_AND_DROP=yes | |
315 | DEFAULT_wxUSE_SPLINES=yes | |
316 | ||
317 | DEFAULT_wxUSE_MDI_ARCHITECTURE=yes | |
318 | DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes | |
319 | DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes | |
320 | ||
321 | DEFAULT_wxUSE_PROLOGIO=yes | |
322 | DEFAULT_wxUSE_RESOURCES=yes | |
323 | DEFAULT_wxUSE_CONSTRAINTS=yes | |
324 | DEFAULT_wxUSE_IPC=yes | |
325 | DEFAULT_wxUSE_HELP=yes | |
326 | DEFAULT_wxUSE_WXTREE=yes | |
327 | DEFAULT_wxUSE_METAFILE=yes | |
328 | ||
329 | DEFAULT_wxUSE_COMMONDLGS=yes | |
330 | DEFAULT_wxUSE_MINIFRAME=yes | |
331 | DEFAULT_wxUSE_VALIDATORS=yes | |
332 | ||
333 | DEFAULT_wxUSE_ACCEL=yes | |
334 | DEFAULT_wxUSE_CARET=yes | |
335 | DEFAULT_wxUSE_BMPBUTTON=yes | |
336 | DEFAULT_wxUSE_CHECKBOX=yes | |
337 | DEFAULT_wxUSE_CHECKLST=yes | |
338 | DEFAULT_wxUSE_COMBOBOX=yes | |
339 | DEFAULT_wxUSE_GAUGE=yes | |
340 | DEFAULT_wxUSE_GRID=yes | |
341 | DEFAULT_wxUSE_IMAGLIST=yes | |
342 | DEFAULT_wxUSE_LISTBOX=yes | |
343 | DEFAULT_wxUSE_LISTCTRL=yes | |
344 | DEFAULT_wxUSE_NOTEBOOK=yes | |
345 | DEFAULT_wxUSE_RADIOBOX=yes | |
346 | DEFAULT_wxUSE_RADIOBTN=yes | |
347 | DEFAULT_wxUSE_SASH=yes | |
348 | DEFAULT_wxUSE_SCROLLBAR=yes | |
349 | DEFAULT_wxUSE_SLIDER=yes | |
350 | DEFAULT_wxUSE_SPINBTN=yes | |
351 | DEFAULT_wxUSE_SPLITTER=yes | |
352 | DEFAULT_wxUSE_STATBMP=yes | |
353 | DEFAULT_wxUSE_STATBOX=yes | |
354 | DEFAULT_wxUSE_STATLINE=yes | |
355 | DEFAULT_wxUSE_STATUSBAR=yes | |
356 | DEFAULT_wxUSE_TABDIALOG=no | |
357 | DEFAULT_wxUSE_TOOLBAR=yes | |
358 | DEFAULT_wxUSE_TREECTRL=yes | |
359 | ||
360 | DEFAULT_wxUSE_UNICODE=no | |
361 | DEFAULT_wxUSE_WCSRTOMBS=no | |
362 | fi | |
363 | ||
364 | dnl AC_ARG_WITH should be used to select whether an external package will be | |
365 | dnl used or not, to configure compile-time features of this package itself, | |
366 | dnl use AC_ARG_ENABLE instead | |
367 | ||
368 | dnl ============================ | |
369 | dnl external package dependecies | |
370 | dnl ============================ | |
371 | ||
372 | AC_ARG_WITH(gtk-prefix, [ --with-gtk-prefix=PFX prefix where GTK is installed], | |
373 | gtk_config_prefix="$withval", gtk_config_prefix="") | |
374 | AC_ARG_WITH(gtk-exec-prefix, [ --with-gtk-exec-prefix=PFX exec prefix where GTK is installed], | |
375 | gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") | |
376 | AC_ARG_WITH(gtk, [ --with-gtk use GTK+], | |
377 | [wxUSE_GTK="$withval" TOOLKIT_GIVEN=1]) | |
378 | AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], | |
379 | [wxUSE_MOTIF="$withval" TOOLKIT_GIVEN=1]) | |
380 | AC_ARG_WITH(cygwin, [ --with-cygwin use Cygwin for MS-Windows], | |
381 | [wxUSE_CYGWIN="$withval" TOOLKIT_GIVEN=1]) | |
382 | AC_ARG_WITH(mingw, [ --with-mingw use GCC Minimal MS-Windows], | |
383 | [wxUSE_MINGW="$withval" TOOLKIT_GIVEN=1]) | |
384 | ||
385 | AC_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (www.letters.com/dmalloc)], | |
386 | wxUSE_DMALLOC="$withval",wxUSE_DMALLOC=$DEFAULT_wxUSE_DMALLOC) | |
387 | AC_ARG_WITH(zlib, [ --with-zlib use zlib for LZW compression], | |
388 | wxUSE_ZLIB="$withval",wxUSE_ZLIB=$DEFAULT_wxUSE_ZLIB) | |
389 | AC_ARG_WITH(libpng, [ --with-libpng use libpng (PNG image format)], | |
390 | wxUSE_LIBPNG="$withval",wxUSE_LIBPNG=$DEFAULT_wxUSE_LIBPNG) | |
391 | AC_ARG_WITH(libgif, [ --with-libgif use libgif (GIF file format)], | |
392 | wxUSE_LIBGIF="${withval}",wxUSE_LIBGIF=$DEFAULT_wxUSE_LIBGIF) | |
393 | AC_ARG_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], | |
394 | wxUSE_LIBJPEG="${withval}",wxUSE_LIBJPEG=$DEFAULT_wxUSE_LIBJPEG) | |
395 | AC_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], | |
396 | wxUSE_OPENGL="$withval",wxUSE_OPENGL=$DEFAULT_wxUSE_OPENGL) | |
397 | AC_ARG_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], | |
398 | wxUSE_ODBC="$withval",wxUSE_ODBC=$DEFAULT_wxUSE_ODBC) | |
399 | ||
400 | dnl ==================== | |
401 | dnl compile-time options | |
402 | dnl ==================== | |
403 | ||
404 | dnl --------------------------------------------------------------------------- | |
405 | dnl compile options | |
406 | dnl --------------------------------------------------------------------------- | |
407 | ||
408 | AC_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], | |
409 | wxUSE_OPTIMISE="$enableval",wxUSE_OPTIMISE=$DEFAULT_wxUSE_OPTIMISE) | |
410 | AC_ARG_ENABLE(optimize, [ --enable-optimize create optimized code], | |
411 | wxUSE_OPTIMISE="$enableval",wxUSE_OPTIMISE=$DEFAULT_wxUSE_OPTIMISE) | |
412 | AC_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], | |
413 | wxUSE_DEBUG="${enableval}",wxUSE_DEBUG=$DEFAULT_wxUSE_DEBUG) | |
414 | ||
415 | if test "$wxUSE_DEBUG" = "yes"; then | |
416 | DEFAULT_wxUSE_DEBUG_FLAG=yes | |
417 | DEFAULT_wxUSE_DEBUG_INFO=yes | |
418 | elif test "$wxUSE_DEBUG" = "no"; then | |
419 | DEFAULT_wxUSE_DEBUG_FLAG=no | |
420 | DEFAULT_wxUSE_DEBUG_INFO=no | |
421 | fi | |
422 | ||
423 | AC_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)], | |
424 | wxUSE_DEBUG_FLAG="$enableval",wxUSE_DEBUG_FLAG=$DEFAULT_wxUSE_DEBUG_FLAG) | |
425 | AC_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information], | |
426 | wxUSE_DEBUG_INFO="$enableval",wxUSE_DEBUG_INFO=$DEFAULT_wxUSE_DEBUG_INFO) | |
427 | AC_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], | |
428 | wxUSE_DEBUG_GDB="$enableval",wxUSE_DEBUG_GDB=$DEFAULT_wxUSE_DEBUG_GDB) | |
429 | AC_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], | |
430 | AC_DEFINE(wxUSE_DEBUG_CONTEXT)) | |
431 | AC_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], | |
432 | wxUSE_MEM_TRACING="$enableval", wxUSE_MEM_TRACING=$DEFAULT_wxUSE_MEM_TRACING) | |
433 | AC_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], | |
434 | wxUSE_PROFILE="$enableval",wxUSE_PROFILE=$DEFAULT_wxUSE_PROFILE) | |
435 | ||
436 | dnl --------------------------------------------------------------------------- | |
437 | dnl --disable-gui will build only non-GUI part of wxWindows | |
438 | dnl | |
439 | dnl NB: this is still in testing stage, don't use if you don't know what you're | |
440 | dnl doing | |
441 | dnl --------------------------------------------------------------------------- | |
442 | ||
443 | AC_ARG_ENABLE(gui, [ --enable-gui use GUI classes], | |
444 | wxUSE_GUI="$enableval",wxUSE_GUI=$DEFAULT_wxUSE_GUI) | |
445 | ||
446 | dnl --------------------------------------------------------------------------- | |
447 | dnl (small) optional non GUI classes | |
448 | dnl --------------------------------------------------------------------------- | |
449 | ||
450 | AC_ARG_ENABLE(intl, [ --enable-intl use internationalization system], | |
451 | wxUSE_INTL="$enableval",wxUSE_INTL=$DEFAULT_wxUSE_INTL) | |
452 | AC_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], | |
453 | wxUSE_CONFIG="$enableval",wxUSE_CONFIG=$DEFAULT_wxUSE_CONFIG) | |
454 | AC_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], | |
455 | wxUSE_SOCKETS="$enableval",wxUSE_SOCKETS=$DEFAULT_wxUSE_SOCKETS) | |
456 | AC_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], | |
457 | wxUSE_IPC="$enableval",wxUSE_IPC=$DEFAULT_wxUSE_IPC) | |
458 | AC_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], | |
459 | wxUSE_APPLE_IEEE="$enableval",wxUSE_APPLE_IEEE=$DEFAULT_wxUSE_APPLE_IEEE) | |
460 | AC_ARG_ENABLE(timedate, [ --enable-timedate use date/time classes], | |
461 | wxUSE_TIMEDATE="$enableval",wxUSE_TIMEDATE=$DEFAULT_wxUSE_TIMEDATE) | |
462 | AC_ARG_ENABLE(fraction, [ --enable-fraction use wxFraction class], | |
463 | wxUSE_FRACTION="$enableval",wxUSE_FRACTION=$DEFAULT_wxUSE_FRACTION) | |
464 | AC_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], | |
465 | wxUSE_DYNLIB_CLASS="$enableval",wxUSE_DYNLIB_CLASS=$DEFAULT_wxUSE_DYNLIB_CLASS) | |
466 | AC_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], | |
467 | wxUSE_LONGLONG="${enableval}",wxUSE_LONGLONG=$DEFAULT_wxUSE_LONGLONG) | |
468 | AC_ARG_ENABLE(log, [ --enable-log use logging system], | |
469 | wxUSE_LOG="$enableval",wxUSE_LOG=$DEFAULT_wxUSE_LOG) | |
470 | AC_ARG_ENABLE(streams, [ --enable-streams use wxStream etc classes], | |
471 | wxUSE_STREAMS="$enableval",wxUSE_STREAMS=$DEFAULT_wxUSE_STREAMS) | |
472 | AC_ARG_ENABLE(file, [ --enable-file use wxFile classes], | |
473 | wxUSE_FILE="$enableval",wxUSE_FILE=$DEFAULT_wxUSE_FILE) | |
474 | AC_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile classes], | |
475 | wxUSE_TEXTFILE="$enableval",wxUSE_TEXTFILE=$DEFAULT_wxUSE_TEXTFILE) | |
476 | AC_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], | |
477 | wxUSE_UNICODE="$enableval",wxUSE_UNICODE=$DEFAULT_wxUSE_UNICODE) | |
478 | AC_ARG_ENABLE(wcsrtombs, [ --enable-wcsrtombs use wcsrtombs instead of buggy (GNU libc1/Linux libc5) wcstombs], | |
479 | wxUSE_WCSRTOMBS="$enableval",wxUSE_WCSRTOMBS=$DEFAULT_wxUSE_WCSRTOMBS) | |
480 | AC_ARG_ENABLE(joystick, [ --enable-joystick compile in joystick support (Linux only)], | |
481 | wxUSE_JOYSTICK="$enableval", wxUSE_JOYSTICK=$DEFAULT_wxUSE_JOYSTICK) | |
482 | ||
483 | dnl --------------------------------------------------------------------------- | |
484 | dnl "big" options (i.e. those which change a lot of things throughout the library) | |
485 | dnl --------------------------------------------------------------------------- | |
486 | ||
487 | AC_ARG_ENABLE(threads, [ --enable-threads use threads], | |
488 | wxUSE_THREADS="${enableval}",wxUSE_THREADS=$DEFAULT_wxUSE_THREADS) | |
489 | AC_ARG_ENABLE(serial, [ --enable-serial use class serialization], | |
490 | wxUSE_SERIAL="${enableval}",wxUSE_SERIAL=$DEFAULT_wxUSE_SERIAL) | |
491 | ||
492 | dnl --------------------------------------------------------------------------- | |
493 | dnl "big" GUI options | |
494 | dnl --------------------------------------------------------------------------- | |
495 | ||
496 | AC_ARG_ENABLE(docview, [ --enable-docview use document view architecture], | |
497 | wxUSE_DOC_VIEW_ARCHITECTURE="$enableval",wxUSE_DOC_VIEW_ARCHITECTURE=$DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE) | |
498 | AC_ARG_ENABLE(help, [ --enable-help use help (using external browser at present)], | |
499 | wxUSE_HELP="$enableval",wxUSE_HELP=$DEFAULT_wxUSE_HELP) | |
500 | AC_ARG_ENABLE(constraints, [ --enable-constraints use layout-constraints system], | |
501 | wxUSE_CONSTRAINTS="$enableval",wxUSE_CONSTRAINTS=$DEFAULT_wxUSE_CONSTRAINTS) | |
502 | AC_ARG_ENABLE(printarch, [ --enable-printarch use printing architecture], | |
503 | wxUSE_PRINTING_ARCHITECTURE="${enableval}",wxUSE_PRINTING_ARCHITECTURE=$DEFAULT_wxUSE_PRINTING_ARCHITECTURE) | |
504 | AC_ARG_ENABLE(mdi, [ --enable-mdi use multiple document interface architecture], | |
505 | wxUSE_MDI_ARCHITECTURE="${enableval}",wxUSE_MDI_ARCHITECTURE=$DEFAULT_wxUSE_MDI_ARCHITECTURE) | |
506 | ||
507 | dnl --------------------------------------------------------------------------- | |
508 | dnl PostScript options | |
509 | dnl --------------------------------------------------------------------------- | |
510 | AC_ARG_ENABLE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], | |
511 | wxUSE_POSTSCRIPT="$enableval",wxUSE_POSTSCRIPT=$DEFAULT_wxUSE_POSTSCRIPT) | |
512 | ||
513 | dnl VZ: these options seem to be always on, if someone wants to change it please do | |
514 | dnl AC_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], | |
515 | dnl wxUSE_NORMALIZED_PS_FONTS="${enableval}",wxUSE_NORMALIZED_PS_FONTS=$DEFAULT_wxUSE_NORMALIZED_PS_FONTS) | |
516 | dnl AC_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], | |
517 | dnl wxUSE_AFM_FOR_POSTSCRIPT="${enableval}",wxUSE_AFM_FOR_POSTSCRIPT=$DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT) | |
518 | ||
519 | dnl --------------------------------------------------------------------------- | |
520 | dnl resources | |
521 | dnl --------------------------------------------------------------------------- | |
522 | AC_ARG_ENABLE(prologio, [ --enable-prologio use Prolog IO library], | |
523 | wxUSE_PROLOGIO="${enableval}",wxUSE_PROLOGIO=$DEFAULT_wxUSE_PROLOGIO) | |
524 | AC_ARG_ENABLE(resources, [ --enable-resources use wxWindows resources], | |
525 | wxUSE_RESOURCES="${enableval}",wxUSE_RESOURCES=$DEFAULT_wxUSE_RESOURCES) | |
526 | ||
527 | AC_ARG_ENABLE(xresources, [ --enable-xresources use X resources for save (default for gtk+)], | |
528 | wxUSE_X_RESOURCES="${enableval}",wxUSE_X_RESOURCES=$DEFAULT_wxUSE_X_RESOURCES) | |
529 | dnl --------------------------------------------------------------------------- | |
530 | dnl IPC &c | |
531 | dnl --------------------------------------------------------------------------- | |
532 | AC_ARG_ENABLE(clipboard, [ --enable-clipboard use wxClipboard classes], | |
533 | wxUSE_CLIPBOARD="${enableval}",wxUSE_CLIPBOARD=$DEFAULT_wxUSE_CLIPBOARD) | |
534 | AC_ARG_ENABLE(dnd, [ --enable-dnd use Drag'n'Drop classes], | |
535 | wxUSE_DRAG_AND_DROP="${enableval}",wxUSE_DRAG_AND_DROP=$DEFAULT_wxUSE_DRAG_AND_DROP) | |
536 | ||
537 | dnl --------------------------------------------------------------------------- | |
538 | dnl options which don't work yet | |
539 | dnl --------------------------------------------------------------------------- | |
540 | AC_ARG_ENABLE(wxtree, [ --enable-wxtree make wxTree library], | |
541 | wxUSE_WXTREE="${enableval}",wxUSE_WXTREE=$DEFAULT_wxUSE_WXTREE) | |
542 | ||
543 | dnl --------------------------------------------------------------------------- | |
544 | dnl optional GUI controls (in alphabetical order except the first one) | |
545 | dnl --------------------------------------------------------------------------- | |
546 | ||
547 | AC_ARG_ENABLE(controls, [ --enable-controls use all usual controls], | |
548 | wxUSE_CONTROLS="${enableval}") | |
549 | ||
550 | dnl even with --enable-controls, some may be disabled by giving | |
551 | dnl --disable-<control> later on the command line - but by default all will be | |
552 | dnl used (and vice versa) | |
553 | if test "$wxUSE_CONTROLS" = "yes"; then | |
554 | DEFAULT_wxUSE_ACCEL=yes | |
555 | DEFAULT_wxUSE_CARET=yes | |
556 | DEFAULT_wxUSE_COMBOBOX=yes | |
557 | DEFAULT_wxUSE_BMPBUTTON=yes | |
558 | DEFAULT_wxUSE_CHECKBOX=yes | |
559 | DEFAULT_wxUSE_CHECKLISTBOX=yes | |
560 | DEFAULT_wxUSE_GAUGE=yes | |
561 | DEFAULT_wxUSE_GRID=yes | |
562 | DEFAULT_wxUSE_IMAGLIST=yes | |
563 | DEFAULT_wxUSE_LISTBOX=yes | |
564 | DEFAULT_wxUSE_LISTCTRL=yes | |
565 | DEFAULT_wxUSE_NOTEBOOK=yes | |
566 | DEFAULT_wxUSE_RADIOBOX=yes | |
567 | DEFAULT_wxUSE_RADIOBTN=yes | |
568 | DEFAULT_wxUSE_SASH=yes | |
569 | DEFAULT_wxUSE_SCROLLBAR=yes | |
570 | DEFAULT_wxUSE_SLIDER=yes | |
571 | DEFAULT_wxUSE_SPINBTN=yes | |
572 | DEFAULT_wxUSE_SPLITTER=yes | |
573 | DEFAULT_wxUSE_STATBMP=yes | |
574 | DEFAULT_wxUSE_STATBOX=yes | |
575 | DEFAULT_wxUSE_STATLINE=yes | |
576 | DEFAULT_wxUSE_STATUSBAR=yes | |
577 | DEFAULT_wxUSE_TAB_DIALOG=yes | |
578 | DEFAULT_wxUSE_TOOLBAR=yes | |
579 | DEFAULT_wxUSE_TOOLTIPS=yes | |
580 | DEFAULT_wxUSE_TREECTRL=yes | |
581 | elif test "$wxUSE_CONTROLS" = "no"; then | |
582 | DEFAULT_wxUSE_ACCEL=no | |
583 | DEFAULT_wxUSE_CARET=no | |
584 | DEFAULT_wxUSE_COMBOBOX=no | |
585 | DEFAULT_wxUSE_BMPBUTTON=no | |
586 | DEFAULT_wxUSE_CHECKBOX=no | |
587 | DEFAULT_wxUSE_CHECKLISTBOX=no | |
588 | DEFAULT_wxUSE_GAUGE=no | |
589 | DEFAULT_wxUSE_GRID=no | |
590 | DEFAULT_wxUSE_IMAGLIST=no | |
591 | DEFAULT_wxUSE_LISTBOX=no | |
592 | DEFAULT_wxUSE_LISTCTRL=no | |
593 | DEFAULT_wxUSE_NOTEBOOK=no | |
594 | DEFAULT_wxUSE_RADIOBOX=no | |
595 | DEFAULT_wxUSE_RADIOBTN=no | |
596 | DEFAULT_wxUSE_SASH=no | |
597 | DEFAULT_wxUSE_SCROLLBAR=no | |
598 | DEFAULT_wxUSE_SLIDER=no | |
599 | DEFAULT_wxUSE_SPINBTN=no | |
600 | DEFAULT_wxUSE_SPLITTER=no | |
601 | DEFAULT_wxUSE_STATBMP=no | |
602 | DEFAULT_wxUSE_STATBOX=no | |
603 | DEFAULT_wxUSE_STATLINE=no | |
604 | DEFAULT_wxUSE_STATUSBAR=no | |
605 | DEFAULT_wxUSE_TAB_DIALOG=no | |
606 | DEFAULT_wxUSE_TOOLBAR=no | |
607 | DEFAULT_wxUSE_TOOLTIPS=no | |
608 | DEFAULT_wxUSE_TREECTRL=no | |
609 | fi | |
610 | ||
611 | AC_ARG_ENABLE(accel, [ --enable-accel use accelerators], | |
612 | wxUSE_ACCEL="${enableval}",wxUSE_ACCEL=$DEFAULT_wxUSE_ACCEL) | |
613 | AC_ARG_ENABLE(caret, [ --enable-caret use wxCaret class], | |
614 | wxUSE_CARET="${enableval}",wxUSE_CARET=$DEFAULT_wxUSE_CARET) | |
615 | AC_ARG_ENABLE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], | |
616 | wxUSE_BMPBUTTON="${enableval}",wxUSE_BMPBUTTON=$DEFAULT_wxUSE_BMPBUTTON) | |
617 | AC_ARG_ENABLE(checkbox, [ --enable-checkbox use wxCheckBox class], | |
618 | wxUSE_CHECKBOX="${enableval}",wxUSE_CHECKBOX=$DEFAULT_wxUSE_CHECKBOX) | |
619 | AC_ARG_ENABLE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], | |
620 | wxUSE_CHECKLST="${enableval}",wxUSE_CHECKLST=$DEFAULT_wxUSE_CHECKLST) | |
621 | AC_ARG_ENABLE(combobox, [ --enable-combobox use wxChoice and wxComboBox classes], | |
622 | wxUSE_COMBOBOX="${enableval}",wxUSE_COMBOBOX=$DEFAULT_wxUSE_COMBOBOX) | |
623 | AC_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], | |
624 | wxUSE_GAUGE="${enableval}",wxUSE_GAUGE=$DEFAULT_wxUSE_GAUGE) | |
625 | AC_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], | |
626 | wxUSE_GRID="${enableval}",wxUSE_GRID=$DEFAULT_wxUSE_GRID) | |
627 | AC_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], | |
628 | wxUSE_IMAGLIST="${enableval}",wxUSE_IMAGLIST=$DEFAULT_wxUSE_IMAGLIST) | |
629 | AC_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], | |
630 | wxUSE_LISTBOX="${enableval}",wxUSE_LISTBOX=$DEFAULT_wxUSE_LISTBOX) | |
631 | AC_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], | |
632 | wxUSE_LISTCTRL="${enableval}",wxUSE_LISTCTRL=$DEFAULT_wxUSE_LISTCTRL) | |
633 | AC_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], | |
634 | wxUSE_NOTEBOOK="${enableval}",wxUSE_NOTEBOOK=$DEFAULT_wxUSE_NOTEBOOK) | |
635 | AC_ARG_ENABLE(radiobox, [ --enable-radiobox use wxRadioBox class], | |
636 | wxUSE_RADIOBOX="${enableval}",wxUSE_RADIOBOX=$DEFAULT_wxUSE_RADIOBOX) | |
637 | AC_ARG_ENABLE(radiobtn, [ --enable-radiobtn use wxRadioButton class], | |
638 | wxUSE_RADIOBTN="${enableval}",wxUSE_RADIOBTN=$DEFAULT_wxUSE_RADIOBTN) | |
639 | AC_ARG_ENABLE(sash, [ --enable-sash use wxSashWindow class], | |
640 | wxUSE_SASH="${enableval}",wxUSE_SASH=$DEFAULT_wxUSE_SASH) | |
641 | AC_ARG_ENABLE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], | |
642 | wxUSE_SCROLLBAR="${enableval}",wxUSE_SCROLLBAR=$DEFAULT_wxUSE_SCROLLBAR) | |
643 | AC_ARG_ENABLE(slider, [ --enable-slider use wxSlider class], | |
644 | wxUSE_SLIDER="${enableval}",wxUSE_SLIDER=$DEFAULT_wxUSE_SLIDER) | |
645 | AC_ARG_ENABLE(spinbtn, [ --enable-spinbtn use wxSpinButton class], | |
646 | wxUSE_SPINBTN="${enableval}",wxUSE_SPINBTN=$DEFAULT_wxUSE_SPINBTN) | |
647 | AC_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class], | |
648 | wxUSE_SPLITTER="${enableval}",wxUSE_SPLITTER=$DEFAULT_wxUSE_SPLITTER) | |
649 | AC_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], | |
650 | wxUSE_STATBMP="${enableval}",wxUSE_STATBMP=$DEFAULT_wxUSE_STATBMP) | |
651 | AC_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], | |
652 | wxUSE_STATBOX="${enableval}",wxUSE_STATBOX=$DEFAULT_wxUSE_STATBOX) | |
653 | AC_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], | |
654 | wxUSE_STATLINE="${enableval}",wxUSE_STATLINE=$DEFAULT_wxUSE_STATLINE) | |
655 | AC_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], | |
656 | wxUSE_STATUSBAR="${enableval}",wxUSE_STATUSBAR=$DEFAULT_wxUSE_STATUSBAR) | |
657 | AC_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], | |
658 | wxUSE_TABDIALOG="${enableval}",wxUSE_TABDIALOG=$DEFAULT_wxUSE_TABDIALOG) | |
659 | AC_ARG_ENABLE(toolbar, [ --enable-toolbar use wxToolBar class], | |
660 | wxUSE_TOOLBAR="${enableval}",wxUSE_TOOLBAR=$DEFAULT_wxUSE_TOOLBAR) | |
661 | AC_ARG_ENABLE(treectrl, [ --enable-treectrl use wxTreeCtrl class], | |
662 | wxUSE_TREECTRL="${enableval}",wxUSE_TREECTRL=$DEFAULT_wxUSE_TREECTRL) | |
663 | ||
664 | dnl --------------------------------------------------------------------------- | |
665 | dnl misc GUI options | |
666 | dnl --------------------------------------------------------------------------- | |
667 | ||
668 | AC_ARG_ENABLE(commondlg, [ --enable-commondlg use common dialogs (wxDirDialog, wxProgressDialog, wxTextDialog, ...)], | |
669 | wxUSE_COMMONDLGS="${enableval}",wxUSE_COMMONDLGS=$DEFAULT_wxUSE_COMMONDLGS) | |
670 | AC_ARG_ENABLE(miniframe, [ --enable-miniframe use wxMiniFrame class], | |
671 | wxUSE_MINIFRAME="${enableval}",wxUSE_MINIFRAME=$DEFAULT_wxUSE_MINIFRAME) | |
672 | AC_ARG_ENABLE(tooltips, [ --enable-tooltips use wxToolTip class], | |
673 | wxUSE_TOOLTIPS="${enableval}",wxUSE_TOOLTIPS=$DEFAULT_wxUSE_TOOLTIPS) | |
674 | AC_ARG_ENABLE(splines, [ --enable-splines use spline drawing code], | |
675 | wxUSE_SPLINES="${enableval}",wxUSE_SPLINES=$DEFAULT_wxUSE_SPLINES) | |
676 | AC_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], | |
677 | wxUSE_VALIDATORS="${enableval}",wxUSE_VALIDATORS=$DEFAULT_wxUSE_VALIDATORS) | |
678 | ||
679 | dnl check that no more than one toolkit is given and that if none are given that | |
680 | dnl we have a default one | |
681 | ||
682 | if test "$TOOLKIT_GIVEN" = 1; then | |
683 | dnl convert "yes" to 1 and "no" to 0 | |
684 | wxUSE_GTK=`echo $wxUSE_GTK | sed -e 's/yes/1/' -e 's/no/0/'` | |
685 | wxUSE_MOTIF=`echo $wxUSE_MOTIF | sed -e 's/yes/1/' -e 's/no/0/'` | |
686 | wxUSE_MSW=`echo $wxUSE_MSW | sed -e 's/yes/1/' -e 's/no/0/'` | |
687 | else | |
688 | dnl try to guess the most apropriate toolkit for this platform | |
689 | wxUSE_GTK=$DEFAULT_wxUSE_GTK | |
690 | wxUSE_MOTIF=$DEFAULT_wxUSE_MOTIF | |
691 | wxUSE_MSW=$DEFAULT_wxUSE_MSW | |
692 | fi | |
693 | ||
694 | dnl NB: this supposes that the shell is able to handle arithmetic expansion and | |
695 | dnl the ${VAR:-VALUE} construction. It does simplify our life though... | |
696 | NUM_TOOLKITS="$((${wxUSE_GTK:-0}+${wxUSE_MOTIF:-0}+${wxUSE_MSW:-0}))" | |
697 | ||
698 | case "$NUM_TOOLKITS" in | |
699 | 1) | |
700 | ;; | |
701 | 0) | |
702 | AC_MSG_ERROR(Please specify a toolkit) | |
703 | ;; | |
704 | *) | |
705 | AC_MSG_ERROR(Please specify at most one toolkit) | |
706 | esac | |
707 | ||
708 | dnl --------------------------------------------------------------------------- | |
709 | dnl Checks for programs | |
710 | dnl --------------------------------------------------------------------------- | |
711 | ||
712 | dnl flush the cache because checking for programs might abort | |
713 | AC_CACHE_SAVE | |
714 | ||
715 | dnl cross-compiling support: we're cross compiling if the build system is | |
716 | dnl different from the target one (assume host and target be always the same) | |
717 | if eval "test $host != $build"; then | |
718 | if eval "test $build != NONE"; then | |
719 | CC="$build-gcc" | |
720 | CXX="$build-g++" | |
721 | RANLIB="$build-ranlib" | |
722 | NM="$build-nm" | |
723 | fi | |
724 | fi | |
725 | ||
726 | dnl C-compiler checks | |
727 | dnl defines CC with the compiler to use | |
728 | dnl defines GCC with yes if using gcc | |
729 | dnl defines GCC empty if not using gcc | |
730 | dnl defines CFLAGS | |
731 | AC_PROG_CC | |
732 | ||
733 | CFLAGS=`echo "$CFLAGS" | sed 's/-g//g'` | |
734 | ||
735 | dnl what is the c-preprocessor | |
736 | dnl defines CPP with the c-preprocessor | |
737 | AC_PROG_CPP | |
738 | ||
739 | dnl is -traditional needed for correct compilations | |
740 | dnl adds -traditional for gcc if needed | |
741 | AC_PROG_GCC_TRADITIONAL | |
742 | ||
743 | AC_LANG_SAVE | |
744 | AC_LANG_CPLUSPLUS | |
745 | ||
746 | dnl C++-compiler checks | |
747 | dnl defines CXX with the compiler to use | |
748 | dnl defines GXX with yes if using gxx | |
749 | dnl defines GXX empty if not using gxx | |
750 | dnl defines CXXFLAGS | |
751 | AC_PROG_CXX | |
752 | ||
753 | dnl what is the C++-preprocessor | |
754 | dnl defines CXXCPP with the C++-preprocessor | |
755 | AC_PROG_CXXCPP | |
756 | ||
757 | CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g//g'` | |
758 | ||
759 | AC_LANG_RESTORE | |
760 | ||
761 | dnl ranlib command | |
762 | dnl defines RANLIB with the appropriate command | |
763 | AC_PROG_RANLIB | |
764 | ||
765 | dnl ar command | |
766 | dnl defines AR with the appropriate command | |
767 | AC_CHECK_PROG(AR, ar, ar, ar) | |
768 | ||
769 | dnl install checks | |
770 | dnl defines INSTALL with the appropriate command | |
771 | AC_PROG_INSTALL | |
772 | ||
773 | dnl strip command | |
774 | dnl defines STRIP as strip or nothing if not found | |
775 | AC_CHECK_PROG(STRIP, strip, strip, true) | |
776 | ||
777 | dnl check if VPATH works | |
778 | AC_MSG_CHECKING("make for VPATH support") | |
779 | dnl create Makefile | |
780 | cat - << EOF > confMake | |
781 | check : file | |
782 | cp \$? \$@ | |
783 | cp \$? final_file | |
784 | EOF | |
785 | ||
786 | if test ! -d sub ; then | |
787 | mkdir sub | |
788 | fi | |
789 | echo dummy > sub/file | |
790 | ${MAKE-make} -f confMake VPATH=sub 2> config.log > /dev/null | |
791 | RESULT=$? | |
792 | rm -f sub/file check final_file confMake | |
793 | rmdir sub | |
794 | if test "$RESULT" = 0; then | |
795 | AC_MSG_RESULT(yes) | |
796 | else | |
797 | AC_MSG_RESULT(no) | |
798 | AC_MSG_ERROR( | |
799 | You need a make-utility that is able to use the variable | |
800 | VPATH correctly. | |
801 | If your version of make does not support VPATH correctly, | |
802 | please install GNU-make (possibly as gmake), and start | |
803 | configure with the following command: | |
804 | export MAKE=gmake; ./configure for sh-type shells | |
805 | setenv MAKE gmake; ./configure for csh-type shells | |
806 | Also please do remember to use gmake in this case every time | |
807 | you are trying to compile. | |
808 | ) | |
809 | fi | |
810 | ||
811 | dnl YACC checks | |
812 | dnl defines YACC with the appropriate command | |
813 | AC_PROG_YACC | |
814 | ||
815 | dnl LEX checks | |
816 | dnl defines LEX with the appropriate command | |
817 | dnl defines LEXLIB with the appropriate library | |
818 | dnl this AM version (don't use AC_PROG_LEX!) also | |
819 | dnl defines YYTEXT_POINTER if yytext is char* | |
820 | dnl defines LEX_OUTPUT_ROOT as to the base of the | |
821 | dnl filename output by the lexer | |
822 | AM_PROG_LEX | |
823 | ||
824 | dnl needed for making link to setup.h | |
825 | AC_PROG_LN_S | |
826 | ||
827 | dnl libtool checks (disable static libs by default, this takes too much time...) | |
828 | AM_DISABLE_STATIC | |
829 | AM_PROG_LIBTOOL | |
830 | ||
831 | dnl --------------------------------------------------------------------------- | |
832 | dnl Define search path for includes and libraries: all headers and libs will be | |
833 | dnl looked for in all directories of this path | |
834 | dnl --------------------------------------------------------------------------- | |
835 | ||
836 | SEARCH_INCLUDE="\ | |
837 | /usr/Motif-1.2/include \ | |
838 | /usr/Motif-2.1/include \ | |
839 | \ | |
840 | /usr/include/Motif1.2 \ | |
841 | /opt/xpm/include/X11 \ | |
842 | \ | |
843 | /usr/Motif1.2/include \ | |
844 | /usr/dt/include \ | |
845 | /usr/include/Xm \ | |
846 | \ | |
847 | /usr/X11R6/include \ | |
848 | /usr/X11R5/include \ | |
849 | /usr/X11R4/include \ | |
850 | \ | |
851 | /usr/X11R6/lib \ | |
852 | /usr/X11R5/lib \ | |
853 | /usr/X11R4/lib \ | |
854 | \ | |
855 | /usr/include/X11R6 \ | |
856 | /usr/include/X11R5 \ | |
857 | /usr/include/X11R4 \ | |
858 | \ | |
859 | /usr/local/X11R6/include \ | |
860 | /usr/local/X11R5/include \ | |
861 | /usr/local/X11R4/include \ | |
862 | \ | |
863 | /usr/local/include/X11R6 \ | |
864 | /usr/local/include/X11R5 \ | |
865 | /usr/local/include/X11R4 \ | |
866 | \ | |
867 | /usr/X11/include \ | |
868 | /usr/include/X11 \ | |
869 | /usr/local/X11/include \ | |
870 | /usr/local/include/X11 \ | |
871 | \ | |
872 | /usr/X386/include \ | |
873 | /usr/x386/include \ | |
874 | /usr/XFree86/include/X11 \ | |
875 | \ | |
876 | /usr/include \ | |
877 | /usr/include/gtk \ | |
878 | /usr/include/gdk \ | |
879 | /usr/include/glib \ | |
880 | /usr/local/include \ | |
881 | /usr/unsupported/include \ | |
882 | /usr/athena/include \ | |
883 | /usr/local/x11r5/include \ | |
884 | /usr/lpp/Xamples/include \ | |
885 | \ | |
886 | /usr/local/include/gtk \ | |
887 | /usr/local/include/qt \ | |
888 | /usr/include/qt \ | |
889 | \ | |
890 | /usr/openwin/include \ | |
891 | /usr/openwin/share/include \ | |
892 | " | |
893 | ||
894 | SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` " | |
895 | ||
896 | dnl ------------------------------------------------------------------------ | |
897 | dnl Check for libraries | |
898 | dnl ------------------------------------------------------------------------ | |
899 | ||
900 | dnl flush the cache because checking for libraries might abort | |
901 | AC_CACHE_SAVE | |
902 | ||
903 | dnl find the X11 include and library files | |
904 | dnl defines x_includes and x_libraries | |
905 | AC_PATH_XTRA | |
906 | ||
907 | if test "$no_x" = "yes"; then | |
908 | AC_MSG_ERROR(X11 libraries not found, aborting) | |
909 | fi | |
910 | ||
911 | CHECK_INCLUDE="-I/usr/include $X_CFLAGS" | |
912 | CHECK_LIB="-L/lib -L/usr/lib $X_LIBS" | |
913 | ||
914 | dnl ---------------------------------------------------------------- | |
915 | dnl search for toolkit (widget sets) | |
916 | dnl ---------------------------------------------------------------- | |
917 | ||
918 | TOOLKIT= | |
919 | TOOLKIT_DEF= | |
920 | TOOLKIT_DIR= | |
921 | TOOLKIT_INCLUDE= | |
922 | ||
923 | GUI_TK_LIBRARY= | |
924 | GUI_TK_LINK= | |
925 | ||
926 | WXGTK12= | |
927 | ||
928 | if test "$wxUSE_GTK" = 1; then | |
929 | dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and | |
930 | dnl only then, if it wasn't found, for an older one | |
931 | AM_PATH_GTK(1.2.0, WXGTK12=1) | |
932 | if test "$WXGTK12" != 1; then | |
933 | AM_PATH_GTK(1.0.0, , AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.X or 1.0.X?)) | |
934 | fi | |
935 | ||
936 | TOOLKIT_INCLUDE="$GTK_CFLAGS" | |
937 | GUI_TK_LIBRARY="$GTK_LIBS" | |
938 | TOOLKIT=GTK | |
939 | fi | |
940 | ||
941 | if test "$wxUSE_MOTIF" = 1; then | |
942 | AC_MSG_CHECKING(for Motif/Lesstif includes) | |
943 | AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h) | |
944 | if test "$ac_find_includes" != "" ; then | |
945 | AC_MSG_RESULT(found $ac_find_includes) | |
946 | else | |
947 | AC_MSG_RESULT(no) | |
948 | AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h) | |
949 | fi | |
950 | ||
951 | AC_MSG_CHECKING(for Motif/Lesstif library) | |
952 | AC_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) | |
953 | if test "$ac_find_libraries" != "" ; then | |
954 | AC_INCLUDE_PATH_EXIST($ac_find_includes, $CHECK_INCLUDE) | |
955 | AC_LINK_PATH_EXIST($ac_find_libraries, $CHECK_LIB) | |
956 | ||
957 | CHECK_LINK="$CHECK_LIB $ac_path_to_link" | |
958 | CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include" | |
959 | AC_MSG_RESULT(found at $ac_find_libraries) | |
960 | else | |
961 | AC_MSG_RESULT(no) | |
962 | AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm) | |
963 | fi | |
964 | ||
965 | AC_MSG_CHECKING(for Xt library) | |
966 | AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt) | |
967 | if test "$ac_find_libraries" != "" ; then | |
968 | AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB) | |
969 | CHECK_LINK="$CHECK_LIB $ac_path_to_link" | |
970 | AC_MSG_RESULT(found at $ac_find_libraries) | |
971 | else | |
972 | AC_MSG_RESULT(no) | |
973 | AC_MSG_ERROR(please set LDFLAGS to contain the location of libXt) | |
974 | fi | |
975 | ||
976 | XPM_LINK="" | |
977 | AC_MSG_CHECKING(for Xpm library) | |
978 | AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm) | |
979 | if test "$ac_find_libraries" != "" ; then | |
980 | AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB) | |
981 | CHECK_LINK="$CHECK_LIB $ac_path_to_link" | |
982 | XPM_LINK="-lXpm " | |
983 | AC_DEFINE(wxHAVE_LIB_XPM) | |
984 | AC_MSG_RESULT(found at $ac_find_libraries) | |
985 | else | |
986 | AC_MSG_RESULT(no) | |
987 | AC_MSG_WARN(library will be compiled without support for images in XPM format) | |
988 | fi | |
989 | ||
990 | GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -lm" | |
991 | GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK" | |
992 | TOOLKIT=MOTIF | |
993 | fi | |
994 | ||
995 | dnl the name of the directory where the files for this toolkit live | |
996 | TOOLKIT_DIR=`echo ${TOOLKIT} | tr "A-Z" "a-z"` | |
997 | ||
998 | dnl the symbol which allows conditional compilation for the given toolkit | |
999 | TOOLKIT_DEF=-D__WX${TOOLKIT}__ | |
1000 | ||
1001 | dnl the name of the (libtool) library | |
1002 | WX_LIBRARY_NAME="libwx_${TOOLKIT_DIR}2.la" | |
1003 | ||
1004 | dnl ------------------------------------------------------------------------ | |
1005 | dnl Check for headers | |
1006 | dnl ------------------------------------------------------------------------ | |
1007 | ||
1008 | dnl defines HAVE_STRINGS_H (where some string functions live on AIX for example) | |
1009 | AC_CHECK_HEADERS(strings.h) | |
1010 | dnl defines HAVE_UNISTD_H | |
1011 | AC_CHECK_HEADERS(unistd.h) | |
1012 | dnl defines HAVE_WCHAR_H | |
1013 | AC_CHECK_HEADERS(wchar.h) | |
1014 | dnl defines HAVE_WCSTR_H | |
1015 | AC_CHECK_HEADERS(wcstr.h) | |
1016 | dnl defines HAVE_FNMATCH_H | |
1017 | AC_CHECK_HEADERS(fnmatch.h) | |
1018 | dnl defines HAVE_XKBLIB_H | |
1019 | AC_CHECK_HEADERS(X11/XKBlib.h) | |
1020 | ||
1021 | dnl --------------------------------------------------------------------------- | |
1022 | dnl Checks for typedefs | |
1023 | dnl --------------------------------------------------------------------------- | |
1024 | ||
1025 | dnl defines mode_t if not already defined | |
1026 | AC_TYPE_MODE_T | |
1027 | dnl defines off_t if not already defined | |
1028 | AC_TYPE_OFF_T | |
1029 | dnl defines pid_t if not already defined | |
1030 | AC_TYPE_PID_T | |
1031 | dnl defines size_t if not already defined | |
1032 | AC_TYPE_SIZE_T | |
1033 | dnl defines uid_t and gid_t if not already defined | |
1034 | AC_TYPE_UID_T | |
1035 | ||
1036 | dnl --------------------------------------------------------------------------- | |
1037 | dnl Checks for structures | |
1038 | dnl --------------------------------------------------------------------------- | |
1039 | ||
1040 | dnl --------------------------------------------------------------------------- | |
1041 | dnl Checks for compiler characteristics | |
1042 | dnl --------------------------------------------------------------------------- | |
1043 | ||
1044 | dnl defines const to be empty if c-compiler does not support const fully | |
1045 | AC_C_CONST | |
1046 | dnl defines inline to a sensible value for the c-compiler | |
1047 | AC_C_INLINE | |
1048 | ||
1049 | dnl check the sizes of integral types (give some reasonable default values for | |
1050 | dnl cross-compiling) | |
1051 | dnl defines the size of certain types of variables in SIZEOF_<TYPE> | |
1052 | AC_CHECK_SIZEOF(char, 1) | |
1053 | AC_CHECK_SIZEOF(short, 2) | |
1054 | AC_CHECK_SIZEOF(int *, 4) | |
1055 | AC_CHECK_SIZEOF(int, 4) | |
1056 | AC_CHECK_SIZEOF(long, 4) | |
1057 | AC_CHECK_SIZEOF(long long, 0) | |
1058 | ||
1059 | dnl for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling) | |
1060 | WX_C_BIGENDIAN | |
1061 | ||
1062 | dnl check for iostream (as opposed to iostream.h) standard header | |
1063 | WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH)) | |
1064 | ||
1065 | dnl check whether C++ compiler supports bool built-in type | |
1066 | WX_CPP_BOOL | |
1067 | ||
1068 | dnl check whether overloading on size_t/int parameter works | |
1069 | WX_CPP_SIZE_T_IS_NOT_INT | |
1070 | ||
1071 | dnl --------------------------------------------------------------------------- | |
1072 | dnl Check for functions | |
1073 | dnl --------------------------------------------------------------------------- | |
1074 | ||
1075 | dnl check for wcslen | |
1076 | AC_CHECK_LIB(c, wcslen, [ | |
1077 | AC_DEFINE(HAVE_WCSLEN) | |
1078 | WCHAR_LINK="" | |
1079 | ], [ | |
1080 | AC_CHECK_LIB(w, wcslen, [ | |
1081 | AC_DEFINE(HAVE_WCSLEN) | |
1082 | WCHAR_LINK="-lw" | |
1083 | ]) | |
1084 | ]) | |
1085 | ||
1086 | dnl check for vprintf/vsprintf() which are GNU extensions | |
1087 | AC_FUNC_VPRINTF | |
1088 | ||
1089 | dnl check for vsnprintf() - a safe version of vsprintf() | |
1090 | AC_CHECK_FUNCS(vsnprintf, | |
1091 | AC_DEFINE(HAVE_VSNPRINTF), | |
1092 | AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf) | |
1093 | ) | |
1094 | ||
1095 | dnl check for vfork() (even if it's the same as fork() in modern Unices) | |
1096 | AC_CHECK_FUNCS(vfork) | |
1097 | ||
1098 | POSIX4_LINK= | |
1099 | AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), [ | |
1100 | AC_CHECK_LIB(posix4, nanosleep, [ | |
1101 | AC_DEFINE(HAVE_NANOSLEEP) | |
1102 | POSIX4_LINK="-lposix4" | |
1103 | ], [ | |
1104 | AC_CHECK_FUNCS(usleep, | |
1105 | AC_DEFINE(HAVE_USLEEP), | |
1106 | AC_MSG_WARN([wxSleep() function will not work])) | |
1107 | ]) | |
1108 | ]) | |
1109 | ||
1110 | dnl check for uname (POSIX) and gethostname (BSD) | |
1111 | AC_CHECK_FUNCS(uname gethostname, break) | |
1112 | ||
1113 | dnl =========================================================================== | |
1114 | dnl Now we have all the info we need - use it! | |
1115 | dnl =========================================================================== | |
1116 | ||
1117 | dnl flush the cache | |
1118 | AC_CACHE_SAVE | |
1119 | ||
1120 | dnl --------------------------------------------------------------------------- | |
1121 | dnl thread support | |
1122 | dnl --------------------------------------------------------------------------- | |
1123 | ||
1124 | dnl the code below: | |
1125 | dnl defines THREADS_OBJ which contains the object files to build | |
1126 | dnl defines THREADS_LINK which contains the thread library to link with | |
1127 | dnl defines wxUSE_THREADS=1 if thread support is activated | |
1128 | ||
1129 | THREADS_LINK="" | |
1130 | THREADS_OBJ="" | |
1131 | ||
1132 | if test "$wxUSE_THREADS" = "yes"; then | |
1133 | dnl find if POSIX threads are available | |
1134 | ||
1135 | dnl standard lib name is pthread | |
1136 | dnl We no longer test for pthread-0.7 as it breaks compilation on some | |
1137 | dnl glibc2 systems, especially for static linkage. | |
1138 | AC_CHECK_LIB(pthread, pthread_create, [ | |
1139 | THREADS_OBJ="threadpsx.lo" | |
1140 | THREADS_LINK="pthread" | |
1141 | ], [ | |
1142 | dnl thread functions are in libc_r under FreeBSD | |
1143 | AC_CHECK_LIB(c_r, pthread_create, [ | |
1144 | THREADS_OBJ="threadpsx.lo" | |
1145 | THREADS_LINK="c_r" | |
1146 | ], [ | |
1147 | dnl VZ: SGI threads are not supported currently | |
1148 | AC_CHECK_HEADER(sys/prctl.h, [ | |
1149 | THREADS_OBJ="threadsgi.lo" | |
1150 | ]) | |
1151 | ]) | |
1152 | ]) | |
1153 | if test "$THREADS_LINK" != ""; then | |
1154 | AC_DEFINE(wxUSE_THREADS) | |
1155 | else | |
1156 | AC_MSG_WARN(No thread support on this system) | |
1157 | fi | |
1158 | fi | |
1159 | ||
1160 | if test -z "$THREADS_OBJ"; then | |
1161 | wxUSE_THREADS=no | |
1162 | fi | |
1163 | ||
1164 | dnl do other tests only if we are using threads | |
1165 | if test "$wxUSE_THREADS" = "yes"; then | |
1166 | dnl must define _REENTRANT for multithreaded code | |
1167 | CFLAGS="${CFLAGS} -D_REENTRANT" | |
1168 | CXXFLAGS="${CXXFLAGS} -D_REENTRANT" | |
1169 | ||
1170 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread" | |
1171 | dnl LTLIBOBJS="$LTLIBOBJS $THREADS_OBJ" | |
1172 | ||
1173 | dnl define autoconf macro to check for given function in both pthread and | |
1174 | dnl posix4 libraries | |
1175 | dnl usage: AC_FUNC_THREAD(FUNCTION_NAME) | |
1176 | dnl VZ: TODO | |
1177 | dnl AC_DEFUN(AC_FUNC_THREAD, | |
1178 | dnl [ | |
1179 | dnl AC_CHECK_LIB($THREADS_LINK, $1, | |
1180 | dnl AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'), | |
1181 | dnl [AC_CHECK_LIB("posix4", $1, | |
1182 | dnl [AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z')) | |
1183 | dnl POSIX4_LINK="-lposix4" | |
1184 | dnl ]) | |
1185 | dnl ]) | |
1186 | dnl ]) | |
1187 | ||
1188 | AC_CHECK_HEADERS(sched.h) | |
1189 | ||
1190 | AC_CHECK_LIB($THREADS_LINK, sched_yield, | |
1191 | AC_DEFINE(HAVE_SCHED_YIELD), | |
1192 | [AC_CHECK_LIB("posix4", sched_yield, | |
1193 | [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK="-lposix4"], | |
1194 | AC_MSG_WARN(wxThread::Yield will not work properly) | |
1195 | )] | |
1196 | ) | |
1197 | ||
1198 | dnl VZ: we should be checking for all of the following functions instead: | |
1199 | dnl 1. pthread_attr_getschedpolicy | |
1200 | dnl 2. sched_get_priority_min and sched_get_priority_max | |
1201 | dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam | |
1202 | dnl but it seems that if the first one is there, the other ones are too (of | |
1203 | dnl course the proper solution would be to implement AC_FUNC_THREAD above | |
1204 | dnl and do test for them all - anyone?) | |
1205 | AC_CHECK_LIB($THREADS_LINK, pthread_attr_getschedpolicy, | |
1206 | AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS), | |
1207 | [AC_CHECK_LIB("posix4", pthread_attr_getschedpolicy, | |
1208 | [AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) POSIX4_LINK="-lposix4"], | |
1209 | AC_MSG_WARN(Setting thread priority will not work) | |
1210 | )] | |
1211 | ) | |
1212 | ||
1213 | AC_CHECK_LIB($THREADS_LINK, pthread_cancel, | |
1214 | AC_DEFINE(HAVE_PTHREAD_CANCEL), | |
1215 | AC_MSG_WARN([wxThread::Kill() will not work properly])) | |
1216 | ||
1217 | AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push, | |
1218 | [ | |
1219 | AC_TRY_COMPILE([#include <pthread.h>], | |
1220 | [ | |
1221 | pthread_cleanup_push(NULL, NULL); | |
1222 | pthread_cleanup_pop(0); | |
1223 | ], [ | |
1224 | wx_cv_func_pthread_cleanup_push=yes | |
1225 | AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS) | |
1226 | ], [ | |
1227 | wx_cv_func_pthread_cleanup_push=no | |
1228 | ]) | |
1229 | ]) | |
1230 | ||
1231 | THREADS_LINK="-l$THREADS_LINK" | |
1232 | fi | |
1233 | ||
1234 | if test "$WXGTK12" = 1 ; then | |
1235 | AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12) | |
1236 | fi | |
1237 | ||
1238 | WXDEBUG= | |
1239 | if test "$wxUSE_DEBUG_GDB" = "yes" ; then | |
1240 | wxUSE_DEBUG_INFO=yes | |
1241 | WXDEBUG="-ggdb" | |
1242 | fi | |
1243 | ||
1244 | if test "$wxUSE_DEBUG_INFO" = "yes" ; then | |
1245 | WXDEBUG="-g" | |
1246 | wxUSE_OPTIMISE=no | |
1247 | fi | |
1248 | ||
1249 | if test "$wxUSE_DEBUG_FLAG" = "yes" ; then | |
1250 | AC_DEFINE(WXDEBUG) | |
1251 | WXDEBUG_DEFINE="-D__WXDEBUG__" | |
1252 | else | |
1253 | WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS" | |
1254 | fi | |
1255 | ||
1256 | if test "$wxUSE_MEM_TRACING" = "yes" ; then | |
1257 | AC_DEFINE(wxUSE_MEMORY_TRACING) | |
1258 | AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS) | |
1259 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck" | |
1260 | fi | |
1261 | ||
1262 | if test "$wxUSE_DMALLOC" = "yes" ; then | |
1263 | DMALLOC_LINK="-ldmalloc" | |
1264 | fi | |
1265 | ||
1266 | PROFILE= | |
1267 | if test "$wxUSE_PROFILE" = "yes" ; then | |
1268 | PROFILE="-pg" | |
1269 | fi | |
1270 | ||
1271 | CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" ` | |
1272 | CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" ` | |
1273 | if test "$wxUSE_OPTIMISE" = "no" ; then | |
1274 | OPTIMISE= | |
1275 | else | |
1276 | if test "$GCC" = yes ; then | |
1277 | OPTIMISE="-O2" | |
1278 | case "${host}" in | |
1279 | i586-*-*|i686-*-* ) | |
1280 | OPTIMISE="${OPTIMISE} " | |
1281 | ;; | |
1282 | esac | |
1283 | else | |
1284 | OPTIMISE="-O" | |
1285 | fi | |
1286 | fi | |
1287 | ||
1288 | dnl --------------------------------------------------------------------------- | |
1289 | dnl Optional libraries | |
1290 | dnl --------------------------------------------------------------------------- | |
1291 | ||
1292 | if test "$wxUSE_ZLIB" = "yes" ; then | |
1293 | AC_DEFINE(wxUSE_ZLIB) | |
1294 | EXTRA_VPATH="$EXTRA_VPATH:\$(srcdir)/../zlib" | |
1295 | LTLIBOBJS="$LTLIBOBJS adler32.lo compress.lo crc32.lo gzio.lo uncompr.lo deflate.lo trees.lo zutil.lo inflate.lo infblock.lo inftrees.lo infcodes.lo infutil.lo inffast.lo" | |
1296 | fi | |
1297 | ||
1298 | if test "$wxUSE_LIBPNG" = "yes" ; then | |
1299 | AC_DEFINE(wxUSE_LIBPNG) | |
1300 | LTLIBOBJS="$LTLIBOBJS png.lo pngset.lo pngget.lo pngrutil.lo pngtrans.lo pngwutil.lo pngread.lo pngrio.lo pngwio.lo pngwrite.lo pngrtran.lo pngwtran.lo pngmem.lo pngerror.lo pngpread.lo" | |
1301 | EXTRA_VPATH="$EXTRA_VPATH:\$(srcdir)/../png" | |
1302 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png" | |
1303 | fi | |
1304 | ||
1305 | if test "$wxUSE_LIBGIF" = "yes" ; then | |
1306 | AC_DEFINE(wxUSE_LIBGIF) | |
1307 | fi | |
1308 | ||
1309 | if test "$wxUSE_LIBJPEG" = "yes" ; then | |
1310 | AC_DEFINE(wxUSE_LIBJPEG) | |
1311 | EXTRA_VPATH="$EXTRA_VPATH:\${srcdir}/../jpeg" | |
1312 | LTLIBOBJS="$LTLIBOBJS \ | |
1313 | jcomapi.lo jutils.lo jerror.lo jmemmgr.lo jmemnobs.lo \ | |
1314 | jcapimin.lo jcapistd.lo jctrans.lo jcparam.lo jdatadst.lo \ | |
1315 | jcinit.lo jcmaster.lo jcmarker.lo jcmainct.lo jcprepct.lo \ | |
1316 | jccoefct.lo jccolor.lo jcsample.lo jchuff.lo jcphuff.lo \ | |
1317 | jcdctmgr.lo jfdctfst.lo jfdctflt.lo jfdctint.lo \ | |
1318 | jdapimin.lo jdapistd.lo jdtrans.lo jdatasrc.lo \ | |
1319 | jdmaster.lo jdinput.lo jdmarker.lo jdhuff.lo jdphuff.lo \ | |
1320 | jdmainct.lo jdcoefct.lo jdpostct.lo jddctmgr.lo jidctfst.lo \ | |
1321 | jidctflt.lo jidctint.lo jidctred.lo jdsample.lo jdcolor.lo \ | |
1322 | jquant1.lo jquant2.lo jdmerge.lo" | |
1323 | fi | |
1324 | ||
1325 | if test "$wxUSE_OPENGL" = "yes"; then | |
1326 | AC_CHECK_HEADER(GL/gl.h, [ | |
1327 | AC_CHECK_LIB(GL, glInitNames, [ | |
1328 | OPENGL_LINK="-lGL" | |
1329 | AC_DEFINE(wxUSE_OPENGL) | |
1330 | UTILS_SUBDIRS="$UTILS_SUBDIRS glcanvas/src" | |
1331 | ],[ | |
1332 | AC_CHECK_LIB(MesaGL, glInitNames, [ | |
1333 | OPENGL_LINK="-lMesaGL" | |
1334 | AC_DEFINE(wxUSE_OPENGL) | |
1335 | UTILS_SUBDIRS="$UTILS_SUBDIRS glcanvas/src" | |
1336 | ],wxUSE_OPENGL=0) | |
1337 | ],wxUSE_OPENGL=0) | |
1338 | ],wxUSE_OPENGL=0) | |
1339 | fi | |
1340 | ||
1341 | dnl --------------------------------------------------------------------------- | |
1342 | dnl the library may be built without GUI classes at all | |
1343 | dnl --------------------------------------------------------------------------- | |
1344 | ||
1345 | if test "$wxUSE_GUI" = "yes"; then | |
1346 | AC_DEFINE(wxUSE_GUI) | |
1347 | ||
1348 | dnl the things we always pull in the GUI version of the library: | |
1349 | dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the | |
1350 | dnl library really can't be built without those) | |
1351 | dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in | |
1352 | dnl almost any program and the first 2 are needed to show a message box | |
1353 | dnl which want to be always able to do) | |
1354 | dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice | |
1355 | dnl to compile without them (if the app doesn't do any drawing, it doesn't | |
1356 | dnl need the dcs, pens, brushes, ...), this just can't be done now | |
1357 | dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem | |
1358 | dnl 5. misc stuff: timers, settings, message box | |
1359 | dnl LTLIBOBJS="$LTLIBOBJS \ | |
1360 | dnl main.lo app.lo event.lo wincmn.lo window.lo control.lo framecmn.lo frame.lo dialog.lo panelg.lo \ | |
1361 | dnl button.lo stattext.lo textctrl.lo \ | |
1362 | dnl bitmap.lo brush.lo colour.lo cursor.lo data.lo dc.lo dcbase.lo dcclient.lo \ | |
1363 | dnl dcmemory.lo dcscreen.lo font.lo gdicmn.lo gdiobj.lo icon.lo palette.lo pen.lo region.lo \ | |
1364 | dnl menu.lo \ | |
1365 | dnl settings.lo timer.lo msgdlgg.lo" | |
1366 | else | |
1367 | AC_DEFINE(wxUSE_NOGUI) | |
1368 | fi | |
1369 | ||
1370 | dnl --------------------------------------------------------------------------- | |
1371 | dnl Unix/Windows | |
1372 | dnl --------------------------------------------------------------------------- | |
1373 | ||
1374 | if test "$wxUSE_UNIX" = "yes"; then | |
1375 | AC_DEFINE(wxUSE_UNIX) | |
1376 | fi | |
1377 | ||
1378 | dnl --------------------------------------------------------------------------- | |
1379 | dnl Register non-GUI class options for makefiles and setup.h | |
1380 | dnl --------------------------------------------------------------------------- | |
1381 | ||
1382 | if test "$wxUSE_APPLE_IEEE" = "yes"; then | |
1383 | AC_DEFINE(wxUSE_APPLE_IEEE) | |
1384 | fi | |
1385 | ||
1386 | if test "$wxUSE_TIMEDATE" = "yes"; then | |
1387 | AC_DEFINE(wxUSE_TIMEDATE) | |
1388 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest" | |
1389 | fi | |
1390 | ||
1391 | if test "$wxUSE_FILE" = "yes"; then | |
1392 | AC_DEFINE(wxUSE_FILE) | |
1393 | fi | |
1394 | ||
1395 | if test "$wxUSE_TEXTFILE" = "yes"; then | |
1396 | if test "$wxUSE_FILE" != "yes"; then | |
1397 | AC_MSG_WARN(wxTextFile requires wxFile and it won't be compiled without it) | |
1398 | else | |
1399 | AC_DEFINE(wxUSE_TEXTFILE) | |
1400 | fi | |
1401 | fi | |
1402 | ||
1403 | if test "$wxUSE_CONFIG" = "yes" ; then | |
1404 | if test "$wxUSE_TEXTFILE" != "yes"; then | |
1405 | AC_MSG_WARN(wxConfig requires wxTextFile and it won't be compiled without it) | |
1406 | else | |
1407 | AC_DEFINE(wxUSE_CONFIG) | |
1408 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config" | |
1409 | fi | |
1410 | fi | |
1411 | ||
1412 | if test "$wxUSE_INTL" = "yes" ; then | |
1413 | if test "$wxUSE_FILE" != "yes"; then | |
1414 | AC_MSG_WARN(I18n code requires wxFile and it won't be compiled without it) | |
1415 | else | |
1416 | AC_DEFINE(wxUSE_INTL) | |
1417 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat" | |
1418 | fi | |
1419 | fi | |
1420 | ||
1421 | if test "$wxUSE_LOG" = "yes"; then | |
1422 | AC_DEFINE(wxUSE_LOG) | |
1423 | fi | |
1424 | ||
1425 | if test "$wxUSE_LONGLONG" = "yes"; then | |
1426 | AC_DEFINE(wxUSE_LONGLONG) | |
1427 | fi | |
1428 | ||
1429 | if test "$wxUSE_SOCKETS" = "yes" ; then | |
1430 | if test "$wxUSE_THREADS" = "yes" ; then | |
1431 | AC_DEFINE(wxUSE_SOCKETS) | |
1432 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wxsocket" | |
1433 | INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS protocol" | |
1434 | else | |
1435 | AC_MSG_WARN(socket classes require --with-threads and won't be compiled without it) | |
1436 | wxUSE_SOCKETS=0 | |
1437 | fi | |
1438 | fi | |
1439 | ||
1440 | if test "$wxUSE_STREAMS" = "yes" ; then | |
1441 | AC_DEFINE(wxUSE_STREAMS) | |
1442 | fi | |
1443 | ||
1444 | if test "$wxUSE_SERIAL" = "yes" ; then | |
1445 | AC_DEFINE(wxUSE_SERIAL) | |
1446 | fi | |
1447 | ||
1448 | dnl ------------------------------------------------------------------------ | |
1449 | dnl wxSocket | |
1450 | dnl ------------------------------------------------------------------------ | |
1451 | ||
1452 | if test "$wxUSE_SOCKETS" = "yes"; then | |
1453 | AC_LANG_SAVE | |
1454 | AC_LANG_CPLUSPLUS | |
1455 | dnl determine the type of third argument for getsockname | |
1456 | AC_MSG_CHECKING(the type of the third argument of getsockname) | |
1457 | AC_TRY_COMPILE( | |
1458 | [#include <sys/socket.h>], | |
1459 | [socklen_t len; getsockname(0, NULL, &len);], | |
1460 | AC_DEFINE(SOCKLEN_T, socklen_t) AC_MSG_RESULT(socklen_t), | |
1461 | AC_TRY_COMPILE( | |
1462 | [#include <sys/socket.h>], | |
1463 | [size_t len; getsockname(0, NULL, &len);], | |
1464 | AC_DEFINE(SOCKLEN_T, size_t) AC_MSG_RESULT(size_t), | |
1465 | AC_TRY_COMPILE( | |
1466 | [#include <sys/socket.h>], | |
1467 | [int len; getsockname(0, NULL, &len);], | |
1468 | AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int), | |
1469 | AC_MSG_RESULT(unknown) | |
1470 | ) | |
1471 | ) | |
1472 | ) | |
1473 | AC_LANG_RESTORE | |
1474 | fi | |
1475 | ||
1476 | dnl --------------------------------------------------------------------------- | |
1477 | dnl Joystick support | |
1478 | dnl --------------------------------------------------------------------------- | |
1479 | ||
1480 | if test "$wxUSE_JOYSTICK" = 1; then | |
1481 | dnl joystick support is only for Linux 2.1.x or greater | |
1482 | AC_CHECK_HEADERS(linux/joystick.h) | |
1483 | if test "$ac_cv_header_linux_joystick_h" = "yes"; then | |
1484 | AC_DEFINE(wxUSE_JOYSTICK) | |
1485 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest" | |
1486 | fi | |
1487 | fi | |
1488 | ||
1489 | dnl ------------------------------------------------------------------------ | |
1490 | dnl DLL support | |
1491 | dnl ------------------------------------------------------------------------ | |
1492 | ||
1493 | HAVE_DL_FUNCS=0 | |
1494 | HAVE_SHL_FUNCS=0 | |
1495 | if test "$wxUSE_DYNLIB_CLASS" = "yes"; then | |
1496 | dnl the test is a bit complicated because we check for dlopen() both with | |
1497 | dnl and without -ldl | |
1498 | AC_CHECK_FUNCS(dlopen, | |
1499 | [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1], | |
1500 | [AC_CHECK_LIB(dl, dlopen, | |
1501 | [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1])]) | |
1502 | AC_CHECK_FUNCS( shl_load, | |
1503 | [AC_DEFINE(HAVE_SHL_LOAD) HAVE_DL_FUNCS=1 HAVE_SHL_FUNCS=1]) | |
1504 | ||
1505 | if test "$HAVE_DL_FUNCS" = 0; then | |
1506 | AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support") | |
1507 | wxUSE_ODBC=no | |
1508 | wxUSE_DYNLIB_CLASS=no | |
1509 | fi | |
1510 | fi | |
1511 | ||
1512 | if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then | |
1513 | AC_DEFINE(wxUSE_DYNLIB_CLASS) | |
1514 | fi | |
1515 | ||
1516 | dnl --------------------------------------------------------------------------- | |
1517 | dnl Unicode | |
1518 | dnl --------------------------------------------------------------------------- | |
1519 | ||
1520 | if test "$wxUSE_UNICODE" = "yes" ; then | |
1521 | AC_DEFINE(wxUSE_UNICODE) | |
1522 | fi | |
1523 | ||
1524 | if test "$wxUSE_WCSRTOMBS" = "yes" ; then | |
1525 | AC_DEFINE(wxUSE_WCSRTOMBS) | |
1526 | fi | |
1527 | ||
1528 | dnl ---------------------------------------------------------------- | |
1529 | dnl iODBC support | |
1530 | dnl ---------------------------------------------------------------- | |
1531 | ||
1532 | IODBC_C_SRC="" | |
1533 | if test "$wxUSE_ODBC" = "yes" ; then | |
1534 | AC_DEFINE(wxUSE_ODBC) | |
1535 | EXTRA_VPATH="$EXTRA_VPATH:\$(srcdir)/../iodbc" | |
1536 | LTLIBOBJS="$LTLIBOBJS catalog.lo connect.lo dlf.lo dlproc.lo execute.lo fetch.lo hdbc.lo henv.lo herr.lo hstmt.lo info.lo itrace.lo misc.lo prepare.lo result.lo" | |
1537 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db" | |
1538 | fi | |
1539 | ||
1540 | dnl ---------------------------------------------------------------- | |
1541 | dnl Register PostScript options for makefiles and setup.h | |
1542 | dnl ---------------------------------------------------------------- | |
1543 | ||
1544 | if test "$wxUSE_POSTSCRIPT" = "yes" ; then | |
1545 | AC_DEFINE(wxUSE_POSTSCRIPT) | |
1546 | fi | |
1547 | ||
1548 | AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT) | |
1549 | ||
1550 | AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS) | |
1551 | ||
1552 | dnl --------------------------------------------------------------------------- | |
1553 | dnl big GUI components: MDI, doc/view, printing, help, ... | |
1554 | dnl --------------------------------------------------------------------------- | |
1555 | ||
1556 | if test "$wxUSE_CONSTRAINTS" = "yes"; then | |
1557 | AC_DEFINE(wxUSE_CONSTRAINTS) | |
1558 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout" | |
1559 | fi | |
1560 | ||
1561 | if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then | |
1562 | AC_DEFINE(wxUSE_MDI_ARCHITECTURE) | |
1563 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi" | |
1564 | fi | |
1565 | ||
1566 | if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then | |
1567 | AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE) | |
1568 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview" | |
1569 | if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then | |
1570 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi" | |
1571 | fi | |
1572 | fi | |
1573 | ||
1574 | if test "$wxUSE_HELP" = "yes"; then | |
1575 | AC_DEFINE(wxUSE_HELP) | |
1576 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help" | |
1577 | fi | |
1578 | ||
1579 | if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then | |
1580 | AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE) | |
1581 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing" | |
1582 | fi | |
1583 | ||
1584 | if test "$wxUSE_PROLOGIO" = "yes" ; then | |
1585 | AC_DEFINE(wxUSE_PROLOGIO) | |
1586 | fi | |
1587 | ||
1588 | if test "$wxUSE_RESOURCES" = "yes" ; then | |
1589 | if test "$wxUSE_PROLOGIO" = "yes" ; then | |
1590 | AC_DEFINE(wxUSE_RESOURCES) | |
1591 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS resource" | |
1592 | else | |
1593 | AC_MSG_WARN([wxWindows ressource system requires PrologIO and can't be compiled without it.]) | |
1594 | fi | |
1595 | fi | |
1596 | ||
1597 | if test "$wxUSE_X_RESOURCES" = "yes"; then | |
1598 | AC_DEFINE(wxUSE_X_RESOURCES) | |
1599 | fi | |
1600 | ||
1601 | dnl --------------------------------------------------------------------------- | |
1602 | dnl IPC: IPC, d-n-d, clipboard, ... | |
1603 | dnl --------------------------------------------------------------------------- | |
1604 | ||
1605 | if test "$wxUSE_IPC" = "yes"; then | |
1606 | AC_DEFINE(wxUSE_IPC) | |
1607 | fi | |
1608 | ||
1609 | if test "$wxUSE_CLIPBOARD" = "yes"; then | |
1610 | AC_DEFINE(wxUSE_CLIPBOARD) | |
1611 | fi | |
1612 | ||
1613 | if test "$wxUSE_DRAG_AND_DROP" = "yes"; then | |
1614 | if test "$WXGTK12" = 1 ; then | |
1615 | AC_DEFINE(wxUSE_DRAG_AND_DROP) | |
1616 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd" | |
1617 | else | |
1618 | AC_MSG_WARN(drag and drop is only supported under GTK 1.2) | |
1619 | fi | |
1620 | fi | |
1621 | ||
1622 | if test "$wxUSE_SPLINES" = "yes" ; then | |
1623 | AC_DEFINE(wxUSE_SPLINES) | |
1624 | fi | |
1625 | ||
1626 | dnl --------------------------------------------------------------------------- | |
1627 | dnl GUI controls | |
1628 | dnl --------------------------------------------------------------------------- | |
1629 | ||
1630 | if test "$wxUSE_ACCEL" = "yes"; then | |
1631 | AC_DEFINE(wxUSE_ACCEL) | |
1632 | fi | |
1633 | ||
1634 | if test "$wxUSE_CARET" = "yes"; then | |
1635 | AC_DEFINE(wxUSE_CARET) | |
1636 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret" | |
1637 | fi | |
1638 | ||
1639 | if test "$wxUSE_COMBOBOX" = "yes"; then | |
1640 | AC_DEFINE(wxUSE_COMBOBOX) | |
1641 | fi | |
1642 | ||
1643 | if test "$wxUSE_BMPBUTTON" = "yes"; then | |
1644 | AC_DEFINE(wxUSE_BMPBUTTON) | |
1645 | fi | |
1646 | ||
1647 | if test "$wxUSE_CHECKBOX" = "yes"; then | |
1648 | AC_DEFINE(wxUSE_CHECKBOX) | |
1649 | fi | |
1650 | ||
1651 | if test "$wxUSE_CHECKLST" = "yes"; then | |
1652 | AC_DEFINE(wxUSE_CHECKLISTBOX) | |
1653 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst" | |
1654 | fi | |
1655 | ||
1656 | if test "$wxUSE_GAUGE" = "yes"; then | |
1657 | AC_DEFINE(wxUSE_GAUGE) | |
1658 | fi | |
1659 | ||
1660 | if test "$wxUSE_GRID" = "yes"; then | |
1661 | AC_DEFINE(wxUSE_GRID) | |
1662 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid" | |
1663 | fi | |
1664 | ||
1665 | if test "$wxUSE_IMAGLIST" = "yes"; then | |
1666 | AC_DEFINE(wxUSE_IMAGLIST) | |
1667 | fi | |
1668 | ||
1669 | if test "$wxUSE_LISTBOX" = "yes"; then | |
1670 | AC_DEFINE(wxUSE_LISTBOX) | |
1671 | fi | |
1672 | ||
1673 | if test "$wxUSE_LISTCTRL" = "yes"; then | |
1674 | if test "$wxUSE_IMAGLIST" = "yes"; then | |
1675 | AC_DEFINE(wxUSE_LISTCTRL) | |
1676 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl" | |
1677 | else | |
1678 | AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it]) | |
1679 | fi | |
1680 | fi | |
1681 | ||
1682 | if test "$wxUSE_NOTEBOOK" = "yes"; then | |
1683 | AC_DEFINE(wxUSE_NOTEBOOK) | |
1684 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook" | |
1685 | fi | |
1686 | ||
1687 | if test "$wxUSE_RADIOBOX" = "yes"; then | |
1688 | AC_DEFINE(wxUSE_RADIOBOX) | |
1689 | fi | |
1690 | ||
1691 | if test "$wxUSE_RADIOBTN" = "yes"; then | |
1692 | AC_DEFINE(wxUSE_RADIOBTN) | |
1693 | fi | |
1694 | ||
1695 | if test "$wxUSE_SASH" = "yes"; then | |
1696 | AC_DEFINE(wxUSE_SASH) | |
1697 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest" | |
1698 | fi | |
1699 | ||
1700 | if test "$wxUSE_SCROLLBAR" = "yes"; then | |
1701 | AC_DEFINE(wxUSE_SCROLLBAR) | |
1702 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll" | |
1703 | fi | |
1704 | ||
1705 | if test "$wxUSE_SLIDER" = "yes"; then | |
1706 | AC_DEFINE(wxUSE_SLIDER) | |
1707 | fi | |
1708 | ||
1709 | if test "$wxUSE_SPINBTN" = "yes"; then | |
1710 | AC_DEFINE(wxUSE_SPINBTN) | |
1711 | fi | |
1712 | ||
1713 | if test "$wxUSE_SPLITTER" = "yes"; then | |
1714 | AC_DEFINE(wxUSE_SPLITTER) | |
1715 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter" | |
1716 | fi | |
1717 | ||
1718 | if test "$wxUSE_STATBMP" = "yes"; then | |
1719 | AC_DEFINE(wxUSE_STATBMP) | |
1720 | fi | |
1721 | ||
1722 | if test "$wxUSE_STATBOX" = "yes"; then | |
1723 | AC_DEFINE(wxUSE_STATBOX) | |
1724 | fi | |
1725 | ||
1726 | if test "$wxUSE_STATLINE" = "yes"; then | |
1727 | AC_DEFINE(wxUSE_STATLINE) | |
1728 | fi | |
1729 | ||
1730 | if test "$wxUSE_STATUSBAR" = "yes"; then | |
1731 | AC_DEFINE(wxUSE_STATUSBAR) | |
1732 | fi | |
1733 | ||
1734 | if test "$wxUSE_TABDIALOG" = "yes"; then | |
1735 | AC_DEFINE(wxUSE_TAB_DIALOG) | |
1736 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS tab" | |
1737 | fi | |
1738 | ||
1739 | if test "$wxUSE_TOOLBAR" = "yes"; then | |
1740 | AC_DEFINE(wxUSE_TOOLBAR) | |
1741 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar" | |
1742 | fi | |
1743 | ||
1744 | if test "$wxUSE_TOOLTIPS" = "yes" ; then | |
1745 | if test "$wxUSE_MOTIF" = "yes"; then | |
1746 | AC_MSG_WARN(tooltips are not supported yet under Motif) | |
1747 | else | |
1748 | AC_DEFINE(wxUSE_TOOLTIPS) | |
1749 | fi | |
1750 | fi | |
1751 | ||
1752 | if test "$wxUSE_TREECTRL" = "yes"; then | |
1753 | if test "$wxUSE_IMAGLIST" = "yes"; then | |
1754 | AC_DEFINE(wxUSE_TREECTRL) | |
1755 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl" | |
1756 | else | |
1757 | AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it]) | |
1758 | fi | |
1759 | fi | |
1760 | ||
1761 | dnl --------------------------------------------------------------------------- | |
1762 | dnl misc options | |
1763 | dnl --------------------------------------------------------------------------- | |
1764 | ||
1765 | dnl TODO this is unused for now... | |
1766 | dnl if test "$wxUSE_WXTREE" = "yes"; then | |
1767 | dnl AC_DEFINE(wxUSE_WXTREE) | |
1768 | dnl fi | |
1769 | ||
1770 | if test "$wxUSE_METAFILE" = "yes"; then | |
1771 | AC_DEFINE(wxUSE_METAFILE) | |
1772 | fi | |
1773 | ||
1774 | if test "$wxUSE_COMMONDLGS" = "yes"; then | |
1775 | dnl these classes don't depend on anything at all | |
1776 | ||
1777 | if test "$wxUSE_CONSTRAINTS" != "yes"; then | |
1778 | AC_MSG_WARN(many common dialogs cannot be used without constraints so they won't be compiled without them) | |
1779 | else | |
1780 | AC_DEFINE(wxUSE_CONSTRAINTS) | |
1781 | AC_DEFINE(wxUSE_TEXTDLG) | |
1782 | ||
1783 | if test "$wxUSE_TREECTRL" != "yes"; then | |
1784 | AC_MSG_WARN(wxDirDialog cannot be used without wxTreeCtrl and it won't be compiled without it) | |
1785 | else | |
1786 | AC_DEFINE(wxUSE_DIRDLG) | |
1787 | fi | |
1788 | fi | |
1789 | ||
1790 | if test "$wxUSE_PRINTING_ARCHITECTURE" = "no"; then | |
1791 | AC_MSG_WARN([wxPrintDialog class won't be compiled without printing support]) | |
1792 | fi | |
1793 | fi | |
1794 | ||
1795 | if test "$wxUSE_MINIFRAME" = "yes"; then | |
1796 | AC_DEFINE(wxUSE_MINIFRAME) | |
1797 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram" | |
1798 | fi | |
1799 | ||
1800 | if test "$wxUSE_VALIDATORS" = "yes"; then | |
1801 | AC_DEFINE(wxUSE_VALIDATORS) | |
1802 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate" | |
1803 | fi | |
1804 | ||
1805 | dnl --------------------------------------------------------------------------- | |
1806 | dnl Output the makefiles and such from the results found above | |
1807 | dnl --------------------------------------------------------------------------- | |
1808 | ||
1809 | dnl if we add wxUSE_GUI in the future, it might be handy to separate the libs | |
1810 | dnl into GUI and non-GUI parts | |
1811 | GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK" | |
1812 | ||
1813 | dnl all additional libraries (except wxWindows itself) we link with | |
1814 | EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $GUILIBS" | |
1815 | ||
1816 | dnl all the libraries needed to link wxWindows programs (when the library is not | |
1817 | dnl yet installed) | |
1818 | LIBS="\${top_builddir}/src/${TOOLKIT_DIR}/${WX_LIBRARY_NAME} $EXTRA_LIBS" | |
1819 | ||
1820 | dnl all -I options we must pass to the compiler | |
1821 | INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include $TOOLKIT_INCLUDE $ZLIB_INCLUDE $LIBPNG_INCLUDE" | |
1822 | ||
1823 | dnl C/C++ compiler options used to compile wxWindows | |
1824 | if test "$ac_cv_prog_gcc" = "yes"; then | |
1825 | dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" | |
1826 | CXXWARNINGS="-Wall" | |
1827 | dnl there is one weird warning in docview.h:71 which prevents me from doing | |
1828 | dnl this... | |
1829 | dnl CXXWARNINGS="-Wall -Werror" | |
1830 | fi | |
1831 | EXTRA_CFLAGS="$WXDEBUG $PROFILE $OPTIMISE $INCLUDES" | |
1832 | ||
1833 | CFLAGS="$CFLAGS $EXTRA_CFLAGS" | |
1834 | CXXFLAGS="$CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS" | |
1835 | ||
1836 | if test "$wxUSE_GUI" = "yes"; then | |
1837 | dnl TODO add checks that these samples will really compile (i.e. all the | |
1838 | dnl library features they need are present) | |
1839 | ||
1840 | dnl TODO some samples are never built so far: | |
1841 | dnl mfc, nativdlg, oleauto, ownerdrw, proplist | |
1842 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \ | |
1843 | forty fractal image wxpoem" | |
1844 | fi | |
1845 | ||
1846 | dnl for convenience, sort the files to build in alphabetical order | |
1847 | dnl | |
1848 | dnl another shell command to do it which might be faster but is less clear: | |
1849 | dnl LTLIBOBJS="`for obj in $LTLIBOBJS; do echo $obj; done | sort | sed 's@^@ @'`" | |
1850 | LTLIBOBJS="`echo $LTLIBOBJS | tr -s ' ' | tr ' ' '\n' | sort | tr '\n' ' '`" | |
1851 | ||
1852 | dnl for convenience, sort the samples in alphabetical order | |
1853 | dnl | |
1854 | dnl FIXME For some mysterious reasons, sometimes the directories are duplicated | |
1855 | dnl in this list - hence uniq. But normally, this shouldn't be needed! | |
1856 | SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '`" | |
1857 | ||
1858 | dnl global options | |
1859 | AC_SUBST(WX_MAJOR_VERSION_NUMBER) | |
1860 | AC_SUBST(WX_MINOR_VERSION_NUMBER) | |
1861 | AC_SUBST(WX_RELEASE_NUMBER) | |
1862 | AC_SUBST(WX_LIBRARY_NAME) | |
1863 | ||
1864 | dnl suppress libtool's informational messages - they duplicate its command line | |
1865 | LIBTOOL="$LIBTOOL --silent" | |
1866 | AC_SUBST(LIBTOOL) | |
1867 | ||
1868 | dnl debugging options | |
1869 | AC_SUBST(WXDEBUG_DEFINE) | |
1870 | ||
1871 | dnl toolkit options | |
1872 | AC_SUBST(TOOLKIT) | |
1873 | AC_SUBST(TOOLKIT_DEF) | |
1874 | AC_SUBST(TOOLKIT_DIR) | |
1875 | AC_SUBST(TOOLKIT_INCLUDE) | |
1876 | ||
1877 | dnl additional sources | |
1878 | AC_SUBST(EXTRA_VPATH) | |
1879 | AC_SUBST(LTLIBOBJS) | |
1880 | ||
1881 | dnl additional subdirectories where we will build | |
1882 | AC_SUBST(SRC_SUBDIRS) | |
1883 | AC_SUBST(INCLUDE_SUBDIRS) | |
1884 | AC_SUBST(UTILS_SUBDIRS) | |
1885 | AC_SUBST(DOCS_SUBDIRS) | |
1886 | AC_SUBST(SAMPLES_SUBDIRS) | |
1887 | AC_SUBST(USER_SUBDIRS) | |
1888 | ||
1889 | dnl additional libraries | |
1890 | AC_SUBST(EXTRA_LIBS) | |
1891 | AC_SUBST(LIBS) | |
1892 | ||
1893 | dnl create the configuration header file from the template | |
1894 | dnl | |
1895 | dnl NB: automake can't work correctly if our header lives in a directory which | |
1896 | dnl is only determined at configure time, so we create it on the top-level | |
1897 | dnl and make a link to allow '#include "wx/setup.h"' to still work | |
1898 | AM_CONFIG_HEADER(setup.h) | |
1899 | ||
1900 | dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE | |
1901 | dnl itself (this is macro is required if SUBDIRS variable is used in Makefile.am | |
1902 | dnl - and we do use it) | |
1903 | AC_PROG_MAKE_SET | |
1904 | ||
1905 | dnl create each of the files in the space separated list from the file.in | |
1906 | dnl (the original file name may be overriden by appending another name after a | |
1907 | dnl colon) | |
1908 | AC_OUTPUT([ | |
1909 | wx-config | |
1910 | Makefile | |
1911 | src/Makefile | |
1912 | src/common/Makefile | |
1913 | src/generic/Makefile | |
1914 | src/gtk/Makefile | |
1915 | src/motif/Makefile | |
1916 | src/unix/Makefile | |
1917 | include/Makefile | |
1918 | include/wx/Makefile | |
1919 | include/wx/generic/Makefile | |
1920 | include/wx/gtk/Makefile | |
1921 | include/wx/motif/Makefile | |
1922 | include/wx/msw/Makefile | |
1923 | include/wx/protocol/Makefile | |
1924 | include/wx/unix/Makefile | |
1925 | samples/Makefile | |
1926 | samples/bombs/Makefile | |
1927 | samples/caret/Makefile | |
1928 | samples/checklst/Makefile | |
1929 | samples/config/Makefile | |
1930 | samples/controls/Makefile | |
1931 | samples/db/Makefile | |
1932 | samples/dialogs/Makefile | |
1933 | samples/dnd/Makefile | |
1934 | samples/docview/Makefile | |
1935 | samples/docvwmdi/Makefile | |
1936 | samples/drawing/Makefile | |
1937 | samples/dynamic/Makefile | |
1938 | samples/forty/Makefile | |
1939 | samples/fractal/Makefile | |
1940 | samples/grid/Makefile | |
1941 | samples/help/Makefile | |
1942 | samples/image/Makefile | |
1943 | samples/internat/Makefile | |
1944 | samples/joytest/Makefile | |
1945 | samples/layout/Makefile | |
1946 | samples/listctrl/Makefile | |
1947 | samples/mdi/Makefile | |
1948 | samples/memcheck/Makefile | |
1949 | samples/mfc/Makefile | |
1950 | samples/minifram/Makefile | |
1951 | samples/minimal/Makefile | |
1952 | samples/nativdlg/Makefile | |
1953 | samples/notebook/Makefile | |
1954 | samples/oleauto/Makefile | |
1955 | samples/ownerdrw/Makefile | |
1956 | samples/png/Makefile | |
1957 | samples/printing/Makefile | |
1958 | samples/proplist/Makefile | |
1959 | samples/regtest/Makefile | |
1960 | samples/resource/Makefile | |
1961 | samples/sashtest/Makefile | |
1962 | samples/scroll/Makefile | |
1963 | samples/splitter/Makefile | |
1964 | samples/tab/Makefile | |
1965 | samples/taskbar/Makefile | |
1966 | samples/text/Makefile | |
1967 | samples/thread/Makefile | |
1968 | samples/toolbar/Makefile | |
1969 | samples/treectrl/Makefile | |
1970 | samples/typetest/Makefile | |
1971 | samples/validate/Makefile | |
1972 | samples/wxpoem/Makefile | |
1973 | samples/wxsocket/Makefile | |
1974 | ], | |
1975 | [ | |
1976 | chmod +x wx-config | |
1977 | if test ! -e include/wx/${TOOLKIT_DIR}/setup.h; then | |
1978 | ${LN_S} `pwd`/setup.h include/wx/${TOOLKIT_DIR}/setup.h | |
1979 | fi | |
1980 | ], | |
1981 | [ | |
1982 | LN_S="${ac_cv_prog_LN_S}" | |
1983 | TOOLKIT_DIR="${TOOLKIT_DIR}" | |
1984 | ] | |
1985 | ) | |
1986 |