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