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