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