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