~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to .pc/multiarch_paths.patch/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-08-19 08:45:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110819084553-80x6dj77ebrneoda
Tags: 2.8.11.0-0ubuntu10
debian/patches/multiarch_paths.patch: look in the multiarch path
when detecting libraries.  Closes LP: #828999.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Process this file with autoconf to produce a configure script.
 
2
AC_REVISION($Id: configure.in 63392 2010-02-05 00:27:19Z RD $)dnl
 
3
 
 
4
AC_PREREQ(2.58)
 
5
 
 
6
dnl ---------------------------------------------------------------------------
 
7
dnl
 
8
dnl Top-level configure.in for wxWidgets by Robert Roebling, Phil Blecker,
 
9
dnl Vadim Zeitlin and Ron Lee
 
10
dnl
 
11
dnl This script is under the wxWidgets licence.
 
12
dnl
 
13
dnl Version: $Id: configure.in 63392 2010-02-05 00:27:19Z RD $
 
14
dnl ---------------------------------------------------------------------------
 
15
 
 
16
dnl ---------------------------------------------------------------------------
 
17
dnl initialization
 
18
dnl ---------------------------------------------------------------------------
 
19
 
 
20
AC_INIT([wxWidgets], [2.8.11], [wx-dev@lists.wxwidgets.org])
 
21
 
 
22
dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package
 
23
AC_CONFIG_SRCDIR([wx-config.in])
 
24
 
 
25
dnl sets build, host, target variables and the same with _alias
 
26
AC_CANONICAL_BUILD
 
27
AC_CANONICAL_HOST
 
28
AC_CANONICAL_TARGET
 
29
 
 
30
 
 
31
dnl When making releases do:
 
32
dnl
 
33
dnl wx_release_number += 1
 
34
 
 
35
wx_major_version_number=2
 
36
wx_minor_version_number=8
 
37
wx_release_number=11
 
38
wx_subrelease_number=0
 
39
 
 
40
WX_RELEASE=$wx_major_version_number.$wx_minor_version_number
 
41
WX_VERSION=$WX_RELEASE.$wx_release_number
 
42
WX_SUBVERSION=$WX_VERSION.$wx_subrelease_number
 
43
 
 
44
WX_MSW_VERSION=$wx_major_version_number$wx_minor_version_number$wx_release_number
 
45
 
 
46
 
 
47
dnl Autoconf-2.60 changed the meaning of top_builddir variable, so we have
 
48
dnl to use our own replacement that will work with both 2.5x and 2.60+:
 
49
wx_top_builddir="`pwd`"
 
50
AC_SUBST(wx_top_builddir)
 
51
 
 
52
 
 
53
dnl ------------------------------------------------------------------------
 
54
dnl Check platform (host system)
 
55
dnl ------------------------------------------------------------------------
 
56
 
 
57
dnl OS (assume Unix)
 
58
USE_UNIX=1
 
59
USE_OS2=0
 
60
USE_WIN32=0
 
61
USE_DOS=0
 
62
USE_BEOS=0
 
63
USE_MAC=0
 
64
 
 
65
dnl Unix kind
 
66
USE_AIX=
 
67
USE_BSD=                            dnl any BSD
 
68
USE_DARWIN=                         dnl a.k.a. Mac OS X
 
69
USE_FREEBSD=
 
70
USE_GNU=                            dnl GNU/Hurd
 
71
USE_HPUX=
 
72
USE_LINUX=
 
73
USE_NETBSD=
 
74
USE_OPENBSD=
 
75
USE_OSF=                            dnl OSF/1 (obsolete?)
 
76
USE_SGI=
 
77
USE_SOLARIS=                        dnl Solaris ("SunOS" >= 5)
 
78
USE_SUN=                            dnl SunOS or Solaris
 
79
USE_SUNOS=                          dnl old/real SunOS (obsolete)
 
80
USE_SVR4=                           dnl SysV R4
 
81
USE_SYSV=                           dnl any System V
 
82
USE_VMS=
 
83
USE_ULTRIX=
 
84
USE_UNIXWARE=
 
85
 
 
86
dnl hardware platform
 
87
USE_ALPHA=
 
88
 
 
89
dnl on some platforms xxx_r() functions are declared inside "#ifdef
 
90
dnl _REENTRANT" and it's easier to just define this symbol for these platforms
 
91
dnl than checking it during run-time
 
92
NEEDS_D_REENTRANT_FOR_R_FUNCS=0
 
93
 
 
94
dnl the list of all available toolkits
 
95
dnl
 
96
dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
 
97
ALL_TOOLKITS="COCOA GTK MAC MGL MICROWIN MOTIF MSW PM X11 DFB"
 
98
 
 
99
dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
 
100
dnl     which are either yes or no
 
101
DEFAULT_wxUSE_COCOA=0
 
102
DEFAULT_wxUSE_GTK=0
 
103
DEFAULT_wxUSE_MAC=0
 
104
DEFAULT_wxUSE_MGL=0
 
105
DEFAULT_wxUSE_MICROWIN=0
 
106
DEFAULT_wxUSE_MOTIF=0
 
107
DEFAULT_wxUSE_MSW=0
 
108
DEFAULT_wxUSE_PM=0
 
109
DEFAULT_wxUSE_X11=0
 
110
DEFAULT_wxUSE_DFB=0
 
111
 
 
112
dnl these are the values which are really default for the given platform -
 
113
dnl they're not cached and are only used if no --with-toolkit was given *and*
 
114
dnl nothing was found in the cache
 
115
DEFAULT_DEFAULT_wxUSE_COCOA=0
 
116
DEFAULT_DEFAULT_wxUSE_GTK=0
 
117
DEFAULT_DEFAULT_wxUSE_MAC=0
 
118
DEFAULT_DEFAULT_wxUSE_MGL=0
 
119
DEFAULT_DEFAULT_wxUSE_MICROWIN=0
 
120
DEFAULT_DEFAULT_wxUSE_MOTIF=0
 
121
DEFAULT_DEFAULT_wxUSE_MSW=0
 
122
DEFAULT_DEFAULT_wxUSE_PM=0
 
123
DEFAULT_DEFAULT_wxUSE_X11=0
 
124
DEFAULT_DEFAULT_wxUSE_DFB=0
 
125
 
 
126
PROGRAM_EXT=
 
127
SO_SUFFIX=so
 
128
SAMPLES_RPATH_FLAG=
 
129
SAMPLES_RPATH_POSTLINK=
 
130
 
 
131
DEFAULT_STD_FLAG=yes
 
132
 
 
133
dnl to support a new system, you need to add its canonical name (as determined
 
134
dnl by config.sub or specified by the configure command line) to this "case"
 
135
dnl and also define the shared library flags below - search for
 
136
dnl SHARED_LIB_SETUP to find the exact place
 
137
case "${host}" in
 
138
  *-hp-hpux* )
 
139
    USE_HPUX=1
 
140
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
141
    NEEDS_D_REENTRANT_FOR_R_FUNCS=1
 
142
    SO_SUFFIX=sl
 
143
    AC_DEFINE(__HPUX__)
 
144
 
 
145
    dnl many standard declarations in HP-UX headers are only included if either
 
146
    dnl _HPUX_SOURCE is defined, see stdsyms(5)
 
147
    CPPFLAGS="-D_HPUX_SOURCE $CPPFLAGS"
 
148
  ;;
 
149
  *-*-linux* )
 
150
    USE_LINUX=1
 
151
    AC_DEFINE(__LINUX__)
 
152
    TMP=`uname -m`
 
153
    if test "x$TMP" = "xalpha"; then
 
154
      USE_ALPHA=1
 
155
      AC_DEFINE(__ALPHA__)
 
156
    fi
 
157
    DEFAULT_DEFAULT_wxUSE_GTK=1
 
158
  ;;
 
159
  *-*-gnu* | *-*-k*bsd*-gnu )
 
160
    USE_GNU=1
 
161
    TMP=`uname -m`
 
162
    if test "x$TMP" = "xalpha"; then
 
163
      USE_ALPHA=1
 
164
      AC_DEFINE(__ALPHA__)
 
165
    fi
 
166
    DEFAULT_DEFAULT_wxUSE_GTK=1
 
167
  ;;
 
168
  *-*-irix5* | *-*-irix6* )
 
169
    USE_SGI=1
 
170
    USE_SVR4=1
 
171
    AC_DEFINE(__SGI__)
 
172
    AC_DEFINE(__SVR4__)
 
173
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
174
  ;;
 
175
  *-*-solaris2* )
 
176
    USE_SUN=1
 
177
    USE_SOLARIS=1
 
178
    USE_SVR4=1
 
179
    AC_DEFINE(__SUN__)
 
180
    AC_DEFINE(__SOLARIS__)
 
181
    AC_DEFINE(__SVR4__)
 
182
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
183
    NEEDS_D_REENTRANT_FOR_R_FUNCS=1
 
184
  ;;
 
185
  *-*-sunos4* )
 
186
    USE_SUN=1
 
187
    USE_SUNOS=1
 
188
    USE_BSD=1
 
189
    AC_DEFINE(__SUN__)
 
190
    AC_DEFINE(__SUNOS__)
 
191
    AC_DEFINE(__BSD__)
 
192
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
193
  ;;
 
194
  *-*-freebsd*)
 
195
    USE_BSD=1
 
196
    USE_FREEBSD=1
 
197
    AC_DEFINE(__FREEBSD__)
 
198
    AC_DEFINE(__BSD__)
 
199
    DEFAULT_DEFAULT_wxUSE_GTK=1
 
200
  ;;
 
201
  *-*-openbsd*|*-*-mirbsd*)
 
202
    USE_BSD=1
 
203
    USE_OPENBSD=1
 
204
    AC_DEFINE(__OPENBSD__)
 
205
    AC_DEFINE(__BSD__)
 
206
    DEFAULT_DEFAULT_wxUSE_GTK=1
 
207
  ;;
 
208
  *-*-netbsd*)
 
209
    USE_BSD=1
 
210
    USE_NETBSD=1
 
211
    AC_DEFINE(__NETBSD__)
 
212
    AC_DEFINE(__BSD__)
 
213
    DEFAULT_DEFAULT_wxUSE_GTK=1
 
214
    NEEDS_D_REENTRANT_FOR_R_FUNCS=1
 
215
 
 
216
    dnl some standard declarations in NetBSD headers are only included if
 
217
    dnl _NETBSD_SOURCE and _LIBC are defined, e.g. getservbyname_r in netdb.h
 
218
    CPPFLAGS="-D_NETBSD_SOURCE -D_LIBC $CPPFLAGS"
 
219
  ;;
 
220
  *-*-osf* )
 
221
    USE_ALPHA=1
 
222
    USE_OSF=1
 
223
    AC_DEFINE(__ALPHA__)
 
224
    AC_DEFINE(__OSF__)
 
225
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
226
    NEEDS_D_REENTRANT_FOR_R_FUNCS=1
 
227
  ;;
 
228
  *-*-dgux5* )
 
229
    USE_ALPHA=1
 
230
    USE_SVR4=1
 
231
    AC_DEFINE(__ALPHA__)
 
232
    AC_DEFINE(__SVR4__)
 
233
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
234
  ;;
 
235
  *-*-sysv5* )
 
236
    USE_SYSV=1
 
237
    USE_SVR4=1
 
238
    AC_DEFINE(__SYSV__)
 
239
    AC_DEFINE(__SVR4__)
 
240
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
241
  ;;
 
242
  *-*-aix* )
 
243
    USE_AIX=1
 
244
    USE_SYSV=1
 
245
    USE_SVR4=1
 
246
    dnl quoting from http://www-1.ibm.com/servers/esdd/articles/gnu.html:
 
247
    dnl
 
248
    dnl     Both archive libraries and shared libraries on AIX have an .a
 
249
    dnl     extension. This will explain why you can't link with an .so and
 
250
    dnl     why it works with the name changed to .a.
 
251
    SO_SUFFIX=a
 
252
    AC_DEFINE(__AIX__)
 
253
    AC_DEFINE(__SYSV__)
 
254
    AC_DEFINE(__SVR4__)
 
255
    DEFAULT_DEFAULT_wxUSE_MOTIF=1
 
256
  ;;
 
257
 
 
258
  *-*-*UnixWare*)
 
259
    USE_SYSV=1
 
260
    USE_SVR4=1
 
261
    USE_UNIXWARE=1
 
262
    AC_DEFINE(__UNIXWARE__)
 
263
  ;;
 
264
 
 
265
  *-*-cygwin* | *-*-mingw32* )
 
266
    dnl MBN: some of the defines have been moved after toolkit detection
 
267
    dnl      because for wxMotif/wxGTK/wxX11 to build on Cygwin
 
268
    dnl      USE_UNIX  must be set and not USE_WIN32
 
269
    SO_SUFFIX=dll
 
270
    PROGRAM_EXT=".exe"
 
271
    DEFAULT_DEFAULT_wxUSE_MSW=1
 
272
  ;;
 
273
 
 
274
  *-pc-msdosdjgpp )
 
275
    USE_UNIX=0
 
276
    USE_DOS=1
 
277
    AC_DEFINE(__DOS__)
 
278
    PROGRAM_EXT=".exe"
 
279
    DEFAULT_DEFAULT_wxUSE_MGL=1
 
280
  ;;
 
281
 
 
282
  *-pc-os2_emx | *-pc-os2-emx )
 
283
    AC_DEFINE(__EMX__)
 
284
    USE_OS2=1
 
285
    AC_DEFINE(__OS2__)
 
286
    PROGRAM_EXT=".exe"
 
287
    DEFAULT_DEFAULT_wxUSE_PM=1
 
288
    dnl "c++" wrapper is not always available, so always use plain gcc.
 
289
    CXX=gcc
 
290
    LDFLAGS="$LDFLAGS -Zcrtdll"
 
291
    dnl
 
292
    dnl Some special code that's automatically added by autoconf-2.57 for OS/2
 
293
    dnl and hopefully also by autoconf-2.58 and newer on all other platforms.
 
294
    dnl For now however, we still need it to make sure the configure script
 
295
    dnl works on OS/2 no matter what platform it is generated on.
 
296
    ac_executable_extensions=".exe"
 
297
    export ac_executable_extensions
 
298
    dnl This strange code is necessary to deal with handling of
 
299
    dnl backslashes by ksh and pdksh's sh variant.
 
300
    ac_save_IFS="$IFS"
 
301
    IFS='\\'
 
302
    ac_TEMP_PATH=
 
303
    for ac_dir in $PATH; do
 
304
      IFS=$ac_save_IFS
 
305
      if test -z "$ac_TEMP_PATH"; then
 
306
        ac_TEMP_PATH="$ac_dir"
 
307
      else
 
308
        ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
 
309
      fi
 
310
    done
 
311
    export PATH="$ac_TEMP_PATH"
 
312
    unset ac_TEMP_PATH
 
313
    DEFAULT_STD_FLAG=no
 
314
  ;;
 
315
 
 
316
  *-*-darwin* )
 
317
    dnl Darwin based distributions (including Mac OS X)
 
318
    USE_BSD=1
 
319
    USE_DARWIN=1
 
320
    SO_SUFFIX=dylib
 
321
    AC_DEFINE(__BSD__)
 
322
    AC_DEFINE(__DARWIN__)
 
323
    AC_DEFINE(TARGET_CARBON)
 
324
    DEFAULT_DEFAULT_wxUSE_MAC=1
 
325
    DEFAULT_STD_FLAG=no
 
326
  ;;
 
327
  powerpc-apple-macos* )
 
328
    dnl Classic Mac OS (< X)
 
329
    USE_UNIX=0
 
330
    dnl For some reason the test that should be cross-compiler capable fails
 
331
    dnl However, there is no doubt that MacOS PowerPC is big endian.
 
332
    ac_cv_c_bigendian=yes
 
333
    SO_SUFFIX=shlib
 
334
    dnl AC_DEFINE(TARGET_CARBON)
 
335
    dnl platform.h needs TARGET_CARBON before setup.h, we'll add it to CPPFLAGS
 
336
    DEFAULT_DEFAULT_wxUSE_MAC=1
 
337
    DEFAULT_STD_FLAG=no
 
338
  ;;
 
339
 
 
340
  *-*-beos* )
 
341
    dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this
 
342
    USE_BEOS=1
 
343
    AC_DEFINE(__BEOS__)
 
344
  ;;
 
345
 
 
346
  *)
 
347
    AC_MSG_WARN([*** System type ${host} is unknown, assuming generic Unix and continuing nevertheless.])
 
348
    AC_MSG_WARN([*** Please report the build results to wx-dev@lists.wxwidgets.org.])
 
349
 
 
350
    DEFAULT_DEFAULT_wxUSE_X11=1
 
351
    DEFAULT_wxUSE_SHARED=no
 
352
esac
 
353
 
 
354
dnl ---------------------------------------------------------------------------
 
355
dnl command line options for configure
 
356
dnl ---------------------------------------------------------------------------
 
357
 
 
358
dnl the default values for all options - we collect them all here to simplify
 
359
dnl modification of the default values (for example, if the defaults for some
 
360
dnl platform should be changed, it can be done here too)
 
361
dnl
 
362
dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above
 
363
 
 
364
WX_ARG_CACHE_INIT
 
365
 
 
366
dnl useful to test the compilation with minimum options, define as 0 for normal
 
367
dnl usage
 
368
DEBUG_CONFIGURE=0
 
369
if test $DEBUG_CONFIGURE = 1; then
 
370
  DEFAULT_wxUSE_UNIVERSAL=no
 
371
  DEFAULT_wxUSE_STL=no
 
372
 
 
373
  DEFAULT_wxUSE_NANOX=no
 
374
 
 
375
  DEFAULT_wxUSE_THREADS=yes
 
376
 
 
377
  DEFAULT_wxUSE_SHARED=${DEFAULT_wxUSE_SHARED:-yes}
 
378
  DEFAULT_wxUSE_OPTIMISE=no
 
379
  DEFAULT_wxUSE_PROFILE=no
 
380
  DEFAULT_wxUSE_NO_DEPS=no
 
381
  DEFAULT_wxUSE_VARARG_MACROS=no
 
382
  DEFAULT_wxUSE_NO_RTTI=no
 
383
  DEFAULT_wxUSE_NO_EXCEPTIONS=no
 
384
  DEFAULT_wxUSE_UNIVERSAL_BINARY=no
 
385
  DEFAULT_wxUSE_RPATH=yes
 
386
  DEFAULT_wxUSE_PERMISSIVE=no
 
387
  DEFAULT_wxUSE_DEBUG_FLAG=yes
 
388
  DEFAULT_wxUSE_DEBUG_INFO=yes
 
389
  DEFAULT_wxUSE_DEBUG_GDB=yes
 
390
  DEFAULT_wxUSE_MEM_TRACING=no
 
391
  DEFAULT_wxUSE_DEBUG_CONTEXT=no
 
392
  DEFAULT_wxUSE_DMALLOC=no
 
393
  DEFAULT_wxUSE_APPLE_IEEE=no
 
394
 
 
395
  DEFAULT_wxUSE_EXCEPTIONS=no
 
396
  DEFAULT_wxUSE_LOG=yes
 
397
  DEFAULT_wxUSE_LOGWINDOW=no
 
398
  DEFAULT_wxUSE_LOGGUI=no
 
399
  DEFAULT_wxUSE_LOGDIALOG=no
 
400
 
 
401
  DEFAULT_wxUSE_GUI=yes
 
402
  DEFAULT_wxUSE_CONTROLS=no
 
403
 
 
404
  DEFAULT_wxUSE_REGEX=no
 
405
  DEFAULT_wxUSE_XML=no
 
406
  DEFAULT_wxUSE_EXPAT=no
 
407
  DEFAULT_wxUSE_ZLIB=no
 
408
  DEFAULT_wxUSE_LIBPNG=no
 
409
  DEFAULT_wxUSE_LIBJPEG=no
 
410
  DEFAULT_wxUSE_LIBTIFF=no
 
411
  DEFAULT_wxUSE_LIBXPM=no
 
412
  DEFAULT_wxUSE_LIBMSPACK=no
 
413
  DEFAULT_wxUSE_LIBSDL=no
 
414
  DEFAULT_wxUSE_LIBGNOMEPRINT=no
 
415
  DEFAULT_wxUSE_LIBGNOMEVFS=no
 
416
  DEFAULT_wxUSE_LIBHILDON=no
 
417
  DEFAULT_wxUSE_ODBC=no
 
418
  DEFAULT_wxUSE_OPENGL=no
 
419
 
 
420
  DEFAULT_wxUSE_ON_FATAL_EXCEPTION=no
 
421
  DEFAULT_wxUSE_STACKWALKER=no
 
422
  DEFAULT_wxUSE_DEBUGREPORT=no
 
423
  DEFAULT_wxUSE_SNGLINST_CHECKER=no
 
424
  DEFAULT_wxUSE_STD_IOSTREAM=no
 
425
  DEFAULT_wxUSE_STD_STRING=no
 
426
  DEFAULT_wxUSE_CMDLINE_PARSER=no
 
427
  DEFAULT_wxUSE_DATETIME=no
 
428
  DEFAULT_wxUSE_TIMER=no
 
429
  DEFAULT_wxUSE_STOPWATCH=no
 
430
  DEFAULT_wxUSE_FILE=no
 
431
  DEFAULT_wxUSE_FFILE=no
 
432
  DEFAULT_wxUSE_STDPATHS=no
 
433
  DEFAULT_wxUSE_TEXTBUFFER=no
 
434
  DEFAULT_wxUSE_TEXTFILE=no
 
435
  DEFAULT_wxUSE_SOUND=no
 
436
  DEFAULT_wxUSE_MEDIACTRL=no
 
437
  DEFAULT_wxUSE_GSTREAMER8=no
 
438
  DEFAULT_wxUSE_PRINTF_POS_PARAMS=no
 
439
  DEFAULT_wxUSE_INTL=no
 
440
  DEFAULT_wxUSE_CONFIG=no
 
441
  DEFAULT_wxUSE_FONTMAP=no
 
442
  DEFAULT_wxUSE_STREAMS=no
 
443
  DEFAULT_wxUSE_SOCKETS=no
 
444
  DEFAULT_wxUSE_OLE=no
 
445
  DEFAULT_wxUSE_DATAOBJ=no
 
446
  DEFAULT_wxUSE_DIALUP_MANAGER=no
 
447
  DEFAULT_wxUSE_JOYSTICK=no
 
448
  DEFAULT_wxUSE_DYNLIB_CLASS=no
 
449
  DEFAULT_wxUSE_DYNAMIC_LOADER=no
 
450
  DEFAULT_wxUSE_LONGLONG=no
 
451
  DEFAULT_wxUSE_GEOMETRY=no
 
452
 
 
453
  DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no
 
454
  DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no
 
455
  DEFAULT_wxUSE_POSTSCRIPT=no
 
456
 
 
457
  DEFAULT_wxUSE_CLIPBOARD=no
 
458
  DEFAULT_wxUSE_TOOLTIPS=no
 
459
  DEFAULT_wxUSE_DRAG_AND_DROP=no
 
460
  DEFAULT_wxUSE_DRAGIMAGE=no
 
461
  DEFAULT_wxUSE_SPLINES=no
 
462
  DEFAULT_wxUSE_MOUSEWHEEL=no
 
463
 
 
464
  DEFAULT_wxUSE_MDI=no
 
465
  DEFAULT_wxUSE_MDI_ARCHITECTURE=no
 
466
  DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no
 
467
  DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no
 
468
 
 
469
  DEFAULT_wxUSE_RESOURCES=no
 
470
  DEFAULT_wxUSE_CONSTRAINTS=no
 
471
  DEFAULT_wxUSE_IPC=no
 
472
  DEFAULT_wxUSE_HELP=no
 
473
  DEFAULT_wxUSE_MS_HTML_HELP=no
 
474
  DEFAULT_wxUSE_WXHTML_HELP=no
 
475
  DEFAULT_wxUSE_TREELAYOUT=no
 
476
  DEFAULT_wxUSE_METAFILE=no
 
477
  DEFAULT_wxUSE_MIMETYPE=no
 
478
  DEFAULT_wxUSE_SYSTEM_OPTIONS=no
 
479
  DEFAULT_wxUSE_PROTOCOL=no
 
480
  DEFAULT_wxUSE_PROTOCOL_HTTP=no
 
481
  DEFAULT_wxUSE_PROTOCOL_FTP=no
 
482
  DEFAULT_wxUSE_PROTOCOL_FILE=no
 
483
  DEFAULT_wxUSE_URL=no
 
484
  DEFAULT_wxUSE_VARIANT=no
 
485
 
 
486
  DEFAULT_wxUSE_ABOUTDLG=no
 
487
  DEFAULT_wxUSE_COMMONDLGS=no
 
488
  DEFAULT_wxUSE_CHOICEDLG=no
 
489
  DEFAULT_wxUSE_COLOURDLG=no
 
490
  DEFAULT_wxUSE_DIRDLG=no
 
491
  DEFAULT_wxUSE_FILEDLG=no
 
492
  DEFAULT_wxUSE_FINDREPLDLG=no
 
493
  DEFAULT_wxUSE_FONTDLG=no
 
494
  DEFAULT_wxUSE_MSGDLG=no
 
495
  DEFAULT_wxUSE_NUMBERDLG=no
 
496
  DEFAULT_wxUSE_TEXTDLG=no
 
497
  DEFAULT_wxUSE_SPLASH=no
 
498
  DEFAULT_wxUSE_STARTUP_TIPS=no
 
499
  DEFAULT_wxUSE_PROGRESSDLG=no
 
500
  DEFAULT_wxUSE_WIZARDDLG=no
 
501
 
 
502
  DEFAULT_wxUSE_MENUS=no
 
503
  DEFAULT_wxUSE_MINIFRAME=no
 
504
  DEFAULT_wxUSE_HTML=no
 
505
  DEFAULT_wxUSE_RICHTEXT=no
 
506
  DEFAULT_wxUSE_XRC=no
 
507
  DEFAULT_wxUSE_AUI=no
 
508
  DEFAULT_wxUSE_WEBKIT=no
 
509
  DEFAULT_wxUSE_FILESYSTEM=no
 
510
  DEFAULT_wxUSE_FS_INET=no
 
511
  DEFAULT_wxUSE_FS_ZIP=no
 
512
  DEFAULT_wxUSE_FS_ARCHIVE=no
 
513
  DEFAULT_wxUSE_BUSYINFO=no
 
514
  DEFAULT_wxUSE_ARCHIVE_STREAMS=no
 
515
  DEFAULT_wxUSE_ZIPSTREAM=no
 
516
  DEFAULT_wxUSE_TARSTREAM=no
 
517
  DEFAULT_wxUSE_VALIDATORS=no
 
518
 
 
519
  DEFAULT_wxUSE_ACCEL=no
 
520
  DEFAULT_wxUSE_ANIMATIONCTRL=no
 
521
  DEFAULT_wxUSE_BUTTON=no
 
522
  DEFAULT_wxUSE_BMPBUTTON=no
 
523
  DEFAULT_wxUSE_BITMAPCOMBOBOX=no
 
524
  DEFAULT_wxUSE_CALCTRL=no
 
525
  DEFAULT_wxUSE_CARET=no
 
526
  DEFAULT_wxUSE_CHECKBOX=no
 
527
  DEFAULT_wxUSE_CHECKLST=no
 
528
  DEFAULT_wxUSE_CHOICE=no
 
529
  DEFAULT_wxUSE_CHOICEBOOK=no
 
530
  DEFAULT_wxUSE_COLLPANE=no
 
531
  DEFAULT_wxUSE_COLOURPICKERCTRL=no
 
532
  DEFAULT_wxUSE_COMBOBOX=no
 
533
  DEFAULT_wxUSE_COMBOCTRL=no
 
534
  DEFAULT_wxUSE_DATEPICKCTRL=no
 
535
  DEFAULT_wxUSE_DISPLAY=no
 
536
  DEFAULT_wxUSE_DETECT_SM=no
 
537
  DEFAULT_wxUSE_DIRPICKERCTRL=no
 
538
  DEFAULT_wxUSE_FILEPICKERCTRL=no
 
539
  DEFAULT_wxUSE_FONTPICKERCTRL=no
 
540
  DEFAULT_wxUSE_GAUGE=no
 
541
  DEFAULT_wxUSE_GRAPHICS_CONTEXT=no
 
542
  DEFAULT_wxUSE_GRID=no
 
543
  DEFAULT_wxUSE_HYPERLINKCTRL=no
 
544
  DEFAULT_wxUSE_DATAVIEWCTRL=no
 
545
  DEFAULT_wxUSE_IMAGLIST=no
 
546
  DEFAULT_wxUSE_LISTBOOK=no
 
547
  DEFAULT_wxUSE_LISTBOX=no
 
548
  DEFAULT_wxUSE_LISTCTRL=no
 
549
  DEFAULT_wxUSE_NOTEBOOK=no
 
550
  DEFAULT_wxUSE_ODCOMBOBOX=no
 
551
  DEFAULT_wxUSE_RADIOBOX=no
 
552
  DEFAULT_wxUSE_RADIOBTN=no
 
553
  DEFAULT_wxUSE_SASH=no
 
554
  DEFAULT_wxUSE_SCROLLBAR=no
 
555
  DEFAULT_wxUSE_SEARCHCTRL=no
 
556
  DEFAULT_wxUSE_SLIDER=no
 
557
  DEFAULT_wxUSE_SPINBTN=no
 
558
  DEFAULT_wxUSE_SPINCTRL=no
 
559
  DEFAULT_wxUSE_SPLITTER=no
 
560
  DEFAULT_wxUSE_STATBMP=no
 
561
  DEFAULT_wxUSE_STATBOX=no
 
562
  DEFAULT_wxUSE_STATLINE=no
 
563
  DEFAULT_wxUSE_STATTEXT=no
 
564
  DEFAULT_wxUSE_STATUSBAR=yes
 
565
  DEFAULT_wxUSE_TAB_DIALOG=no
 
566
  DEFAULT_wxUSE_TEXTCTRL=no
 
567
  DEFAULT_wxUSE_TOGGLEBTN=no
 
568
  DEFAULT_wxUSE_TOOLBAR=no
 
569
  DEFAULT_wxUSE_TOOLBAR_NATIVE=no
 
570
  DEFAULT_wxUSE_TREEBOOK=no
 
571
  DEFAULT_wxUSE_TOOLBOOK=no
 
572
  DEFAULT_wxUSE_TREECTRL=no
 
573
  DEFAULT_wxUSE_POPUPWIN=no
 
574
  DEFAULT_wxUSE_TIPWINDOW=no
 
575
 
 
576
  DEFAULT_wxUSE_UNICODE=no
 
577
  DEFAULT_wxUSE_UNICODE_MSLU=no
 
578
  DEFAULT_wxUSE_WCSRTOMBS=no
 
579
 
 
580
  DEFAULT_wxUSE_PALETTE=no
 
581
  DEFAULT_wxUSE_IMAGE=no
 
582
  DEFAULT_wxUSE_GIF=no
 
583
  DEFAULT_wxUSE_PCX=no
 
584
  DEFAULT_wxUSE_TGA=no
 
585
  DEFAULT_wxUSE_PNM=no
 
586
  DEFAULT_wxUSE_IFF=no
 
587
  DEFAULT_wxUSE_XPM=no
 
588
  DEFAULT_wxUSE_ICO_CUR=no
 
589
  DEFAULT_wxUSE_ACCESSIBILITY=no
 
590
 
 
591
  DEFAULT_wxUSE_MONOLITHIC=no
 
592
  DEFAULT_wxUSE_PLUGINS=no
 
593
  DEFAULT_wxUSE_OFFICIAL_BUILD=no
 
594
else
 
595
  DEFAULT_wxUSE_UNIVERSAL=no
 
596
  DEFAULT_wxUSE_STL=no
 
597
 
 
598
  DEFAULT_wxUSE_NANOX=no
 
599
 
 
600
  DEFAULT_wxUSE_THREADS=yes
 
601
 
 
602
  DEFAULT_wxUSE_SHARED=${DEFAULT_wxUSE_SHARED:-yes}
 
603
  DEFAULT_wxUSE_OPTIMISE=yes
 
604
  DEFAULT_wxUSE_PROFILE=no
 
605
  DEFAULT_wxUSE_NO_DEPS=no
 
606
  DEFAULT_wxUSE_VARARG_MACROS=yes
 
607
  DEFAULT_wxUSE_NO_RTTI=no
 
608
  DEFAULT_wxUSE_NO_EXCEPTIONS=no
 
609
  DEFAULT_wxUSE_UNIVERSAL_BINARY=no
 
610
  DEFAULT_wxUSE_RPATH=yes
 
611
  DEFAULT_wxUSE_PERMISSIVE=no
 
612
  DEFAULT_wxUSE_DEBUG_FLAG=no
 
613
  DEFAULT_wxUSE_DEBUG_INFO=no
 
614
  DEFAULT_wxUSE_DEBUG_GDB=no
 
615
  DEFAULT_wxUSE_MEM_TRACING=no
 
616
  DEFAULT_wxUSE_DEBUG_CONTEXT=no
 
617
  DEFAULT_wxUSE_DMALLOC=no
 
618
  DEFAULT_wxUSE_APPLE_IEEE=yes
 
619
 
 
620
  DEFAULT_wxUSE_EXCEPTIONS=yes
 
621
  DEFAULT_wxUSE_LOG=yes
 
622
  DEFAULT_wxUSE_LOGWINDOW=yes
 
623
  DEFAULT_wxUSE_LOGGUI=yes
 
624
  DEFAULT_wxUSE_LOGDIALOG=yes
 
625
 
 
626
  DEFAULT_wxUSE_GUI=yes
 
627
 
 
628
  DEFAULT_wxUSE_REGEX=yes
 
629
  DEFAULT_wxUSE_XML=yes
 
630
  DEFAULT_wxUSE_EXPAT=yes
 
631
  DEFAULT_wxUSE_ZLIB=yes
 
632
  DEFAULT_wxUSE_LIBPNG=yes
 
633
  DEFAULT_wxUSE_LIBJPEG=yes
 
634
  DEFAULT_wxUSE_LIBTIFF=yes
 
635
  DEFAULT_wxUSE_LIBXPM=yes
 
636
  DEFAULT_wxUSE_LIBMSPACK=yes
 
637
  DEFAULT_wxUSE_LIBSDL=no
 
638
  DEFAULT_wxUSE_LIBGNOMEPRINT=yes
 
639
  DEFAULT_wxUSE_LIBGNOMEVFS=no
 
640
  DEFAULT_wxUSE_LIBHILDON=no
 
641
  DEFAULT_wxUSE_ODBC=no
 
642
  DEFAULT_wxUSE_OPENGL=no
 
643
 
 
644
  DEFAULT_wxUSE_ON_FATAL_EXCEPTION=yes
 
645
  DEFAULT_wxUSE_STACKWALKER=yes
 
646
  DEFAULT_wxUSE_DEBUGREPORT=yes
 
647
  DEFAULT_wxUSE_SNGLINST_CHECKER=yes
 
648
  DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
 
649
  DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
 
650
  DEFAULT_wxUSE_CMDLINE_PARSER=yes
 
651
  DEFAULT_wxUSE_DATETIME=yes
 
652
  DEFAULT_wxUSE_TIMER=yes
 
653
  DEFAULT_wxUSE_STOPWATCH=yes
 
654
  DEFAULT_wxUSE_FILE=yes
 
655
  DEFAULT_wxUSE_FFILE=yes
 
656
  DEFAULT_wxUSE_STDPATHS=yes
 
657
  DEFAULT_wxUSE_TEXTBUFFER=yes
 
658
  DEFAULT_wxUSE_TEXTFILE=yes
 
659
  DEFAULT_wxUSE_SOUND=yes
 
660
  DEFAULT_wxUSE_MEDIACTRL=no
 
661
  DEFAULT_wxUSE_GSTREAMER8=no
 
662
  DEFAULT_wxUSE_PRINTF_POS_PARAMS=yes
 
663
  DEFAULT_wxUSE_INTL=yes
 
664
  DEFAULT_wxUSE_CONFIG=yes
 
665
  DEFAULT_wxUSE_FONTMAP=yes
 
666
  DEFAULT_wxUSE_STREAMS=yes
 
667
  DEFAULT_wxUSE_SOCKETS=yes
 
668
  DEFAULT_wxUSE_OLE=yes
 
669
  DEFAULT_wxUSE_DATAOBJ=yes
 
670
  DEFAULT_wxUSE_DIALUP_MANAGER=yes
 
671
  DEFAULT_wxUSE_JOYSTICK=yes
 
672
  DEFAULT_wxUSE_DYNLIB_CLASS=yes
 
673
  DEFAULT_wxUSE_DYNAMIC_LOADER=yes
 
674
  DEFAULT_wxUSE_LONGLONG=yes
 
675
  DEFAULT_wxUSE_GEOMETRY=yes
 
676
 
 
677
  DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes
 
678
  DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes
 
679
  DEFAULT_wxUSE_POSTSCRIPT=yes
 
680
 
 
681
  DEFAULT_wxUSE_CLIPBOARD=yes
 
682
  DEFAULT_wxUSE_TOOLTIPS=yes
 
683
  DEFAULT_wxUSE_DRAG_AND_DROP=yes
 
684
  DEFAULT_wxUSE_DRAGIMAGE=yes
 
685
  DEFAULT_wxUSE_SPLINES=yes
 
686
  DEFAULT_wxUSE_MOUSEWHEEL=yes
 
687
 
 
688
  DEFAULT_wxUSE_MDI=yes
 
689
  DEFAULT_wxUSE_MDI_ARCHITECTURE=yes
 
690
  DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes
 
691
  DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes
 
692
 
 
693
  DEFAULT_wxUSE_RESOURCES=no
 
694
  DEFAULT_wxUSE_CONSTRAINTS=yes
 
695
  DEFAULT_wxUSE_IPC=yes
 
696
  DEFAULT_wxUSE_HELP=yes
 
697
  DEFAULT_wxUSE_MS_HTML_HELP=yes
 
698
  DEFAULT_wxUSE_WXHTML_HELP=yes
 
699
  DEFAULT_wxUSE_TREELAYOUT=yes
 
700
  DEFAULT_wxUSE_METAFILE=yes
 
701
  DEFAULT_wxUSE_MIMETYPE=yes
 
702
  DEFAULT_wxUSE_SYSTEM_OPTIONS=yes
 
703
  DEFAULT_wxUSE_PROTOCOL=yes
 
704
  DEFAULT_wxUSE_PROTOCOL_HTTP=yes
 
705
  DEFAULT_wxUSE_PROTOCOL_FTP=yes
 
706
  DEFAULT_wxUSE_PROTOCOL_FILE=yes
 
707
  DEFAULT_wxUSE_URL=yes
 
708
  DEFAULT_wxUSE_VARIANT=yes
 
709
 
 
710
  DEFAULT_wxUSE_ABOUTDLG=yes
 
711
  DEFAULT_wxUSE_COMMONDLGS=yes
 
712
  DEFAULT_wxUSE_CHOICEDLG=yes
 
713
  DEFAULT_wxUSE_COLOURDLG=yes
 
714
  DEFAULT_wxUSE_DIRDLG=yes
 
715
  DEFAULT_wxUSE_FILEDLG=yes
 
716
  DEFAULT_wxUSE_FINDREPLDLG=yes
 
717
  DEFAULT_wxUSE_FONTDLG=yes
 
718
  DEFAULT_wxUSE_MSGDLG=yes
 
719
  DEFAULT_wxUSE_NUMBERDLG=yes
 
720
  DEFAULT_wxUSE_TEXTDLG=yes
 
721
  DEFAULT_wxUSE_SPLASH=yes
 
722
  DEFAULT_wxUSE_STARTUP_TIPS=yes
 
723
  DEFAULT_wxUSE_PROGRESSDLG=yes
 
724
  DEFAULT_wxUSE_WIZARDDLG=yes
 
725
 
 
726
  DEFAULT_wxUSE_MENUS=yes
 
727
  DEFAULT_wxUSE_MINIFRAME=yes
 
728
  DEFAULT_wxUSE_HTML=yes
 
729
  DEFAULT_wxUSE_RICHTEXT=yes
 
730
  DEFAULT_wxUSE_XRC=yes
 
731
  DEFAULT_wxUSE_AUI=yes
 
732
  DEFAULT_wxUSE_WEBKIT=yes
 
733
  DEFAULT_wxUSE_FILESYSTEM=yes
 
734
  DEFAULT_wxUSE_FS_INET=yes
 
735
  DEFAULT_wxUSE_FS_ZIP=yes
 
736
  DEFAULT_wxUSE_FS_ARCHIVE=yes
 
737
  DEFAULT_wxUSE_BUSYINFO=yes
 
738
  DEFAULT_wxUSE_ARCHIVE_STREAMS=yes
 
739
  DEFAULT_wxUSE_ZIPSTREAM=yes
 
740
  DEFAULT_wxUSE_TARSTREAM=yes
 
741
  DEFAULT_wxUSE_VALIDATORS=yes
 
742
 
 
743
  DEFAULT_wxUSE_ACCEL=yes
 
744
  DEFAULT_wxUSE_ANIMATIONCTRL=yes
 
745
  DEFAULT_wxUSE_BUTTON=yes
 
746
  DEFAULT_wxUSE_BMPBUTTON=yes
 
747
  DEFAULT_wxUSE_BITMAPCOMBOBOX=yes
 
748
  DEFAULT_wxUSE_CALCTRL=yes
 
749
  DEFAULT_wxUSE_CARET=yes
 
750
  DEFAULT_wxUSE_CHECKBOX=yes
 
751
  DEFAULT_wxUSE_CHECKLST=yes
 
752
  DEFAULT_wxUSE_CHOICE=yes
 
753
  DEFAULT_wxUSE_CHOICEBOOK=yes
 
754
  DEFAULT_wxUSE_COLLPANE=yes
 
755
  DEFAULT_wxUSE_COLOURPICKERCTRL=yes
 
756
  DEFAULT_wxUSE_COMBOBOX=yes
 
757
  DEFAULT_wxUSE_COMBOCTRL=yes
 
758
  DEFAULT_wxUSE_DATEPICKCTRL=yes
 
759
  DEFAULT_wxUSE_DISPLAY=yes
 
760
  DEFAULT_wxUSE_DETECT_SM=yes
 
761
  DEFAULT_wxUSE_DIRPICKERCTRL=yes
 
762
  DEFAULT_wxUSE_FILEPICKERCTRL=yes
 
763
  DEFAULT_wxUSE_FONTPICKERCTRL=yes
 
764
  DEFAULT_wxUSE_GAUGE=yes
 
765
  DEFAULT_wxUSE_GRID=yes
 
766
  DEFAULT_wxUSE_GRAPHICS_CONTEXT=no
 
767
  DEFAULT_wxUSE_HYPERLINKCTRL=yes
 
768
  DEFAULT_wxUSE_DATAVIEWCTRL=no
 
769
  DEFAULT_wxUSE_IMAGLIST=yes
 
770
  DEFAULT_wxUSE_LISTBOOK=yes
 
771
  DEFAULT_wxUSE_LISTBOX=yes
 
772
  DEFAULT_wxUSE_LISTCTRL=yes
 
773
  DEFAULT_wxUSE_NOTEBOOK=yes
 
774
  DEFAULT_wxUSE_ODCOMBOBOX=yes
 
775
  DEFAULT_wxUSE_RADIOBOX=yes
 
776
  DEFAULT_wxUSE_RADIOBTN=yes
 
777
  DEFAULT_wxUSE_SASH=yes
 
778
  DEFAULT_wxUSE_SCROLLBAR=yes
 
779
  DEFAULT_wxUSE_SEARCHCTRL=yes
 
780
  DEFAULT_wxUSE_SLIDER=yes
 
781
  DEFAULT_wxUSE_SPINBTN=yes
 
782
  DEFAULT_wxUSE_SPINCTRL=yes
 
783
  DEFAULT_wxUSE_SPLITTER=yes
 
784
  DEFAULT_wxUSE_STATBMP=yes
 
785
  DEFAULT_wxUSE_STATBOX=yes
 
786
  DEFAULT_wxUSE_STATLINE=yes
 
787
  DEFAULT_wxUSE_STATTEXT=yes
 
788
  DEFAULT_wxUSE_STATUSBAR=yes
 
789
  DEFAULT_wxUSE_TAB_DIALOG=no
 
790
  DEFAULT_wxUSE_TEXTCTRL=yes
 
791
  DEFAULT_wxUSE_TOGGLEBTN=yes
 
792
  DEFAULT_wxUSE_TOOLBAR=yes
 
793
  DEFAULT_wxUSE_TOOLBAR_NATIVE=yes
 
794
  DEFAULT_wxUSE_TREEBOOK=yes
 
795
  DEFAULT_wxUSE_TOOLBOOK=yes
 
796
  DEFAULT_wxUSE_TREECTRL=yes
 
797
  DEFAULT_wxUSE_POPUPWIN=yes
 
798
  DEFAULT_wxUSE_TIPWINDOW=yes
 
799
 
 
800
  DEFAULT_wxUSE_UNICODE=no
 
801
  DEFAULT_wxUSE_UNICODE_MSLU=yes
 
802
  DEFAULT_wxUSE_WCSRTOMBS=no
 
803
 
 
804
  DEFAULT_wxUSE_PALETTE=yes
 
805
  DEFAULT_wxUSE_IMAGE=yes
 
806
  DEFAULT_wxUSE_GIF=yes
 
807
  DEFAULT_wxUSE_PCX=yes
 
808
  DEFAULT_wxUSE_TGA=yes
 
809
  DEFAULT_wxUSE_IFF=no  dnl why is this set to "no"?
 
810
  DEFAULT_wxUSE_PNM=yes
 
811
  DEFAULT_wxUSE_XPM=yes
 
812
  DEFAULT_wxUSE_ICO_CUR=yes
 
813
  DEFAULT_wxUSE_ACCESSIBILITY=no
 
814
 
 
815
  DEFAULT_wxUSE_MONOLITHIC=no
 
816
  DEFAULT_wxUSE_PLUGINS=no
 
817
  DEFAULT_wxUSE_OFFICIAL_BUILD=no
 
818
 
 
819
  dnl Applicable only when --with-gtk was used:
 
820
  DEFAULT_wxUSE_GTK2=yes
 
821
fi
 
822
 
 
823
dnl Always default to no. Only special cases require this.
 
824
DEFAULT_wxUSE_OBJC_UNIQUIFYING=no
 
825
 
 
826
 
 
827
dnl WX_ARG_WITH should be used to select whether an external package will be
 
828
dnl used or not, to configure compile-time features of this package itself,
 
829
dnl use WX_ARG_ENABLE instead
 
830
 
 
831
dnl ============================
 
832
dnl external package dependecies
 
833
dnl ============================
 
834
 
 
835
dnl these options use AC_ARG_WITH and not WX_ARG_WITH on purpose - we cache
 
836
dnl these values manually
 
837
for toolkit in `echo $ALL_TOOLKITS`; do
 
838
  LINE=`grep "wxUSE_$toolkit=" ${wx_arg_cache_file}`
 
839
  if test "x$LINE" != "x" ; then
 
840
    has_toolkit_in_cache=1
 
841
    eval "DEFAULT_$LINE"
 
842
    eval "CACHE_$toolkit=1"
 
843
 
 
844
    LINE=`grep "wx${toolkit}_VERSION=" ${wx_arg_cache_file}`
 
845
    if test "x$LINE" != "x" ; then
 
846
        eval "DEFAULT_$LINE"
 
847
    fi
 
848
  fi
 
849
done
 
850
 
 
851
dnl ---------------------------------------------------------------------------
 
852
dnl --disable-gui will build only non-GUI part of wxWidgets: check for this
 
853
dnl first to disable many other switches if it's given
 
854
dnl
 
855
dnl NB: this is still in testing stage, don't use if you don't know what you're
 
856
dnl     doing
 
857
dnl ---------------------------------------------------------------------------
 
858
 
 
859
WX_ARG_ENABLE(gui,         [  --enable-gui            use GUI classes], wxUSE_GUI)
 
860
WX_ARG_ENABLE(monolithic,  [  --enable-monolithic     build wxWidgets as single library], wxUSE_MONOLITHIC)
 
861
WX_ARG_ENABLE(plugins,     [  --enable-plugins        build parts of wxWidgets as loadable components], wxUSE_PLUGINS)
 
862
WX_ARG_WITH(subdirs,       [  --without-subdirs       don't generate makefiles for samples/demos/...], wxWITH_SUBDIRS, without)
 
863
 
 
864
if test "$wxUSE_GUI" = "yes"; then
 
865
 
 
866
WX_ARG_ENABLE(universal,   [  --enable-universal      use wxWidgets GUI controls instead of native ones], wxUSE_UNIVERSAL)
 
867
AC_ARG_WITH(gtk,          [[  --with-gtk[=VERSION]    use GTK+, VERSION can be 2 (default), 1 or "any"]], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
 
868
AC_ARG_WITH(motif,         [  --with-motif            use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
 
869
AC_ARG_WITH(mac,           [  --with-mac              use Mac OS X], [wxUSE_MAC="$withval" CACHE_MAC=1 TOOLKIT_GIVEN=1])
 
870
AC_ARG_WITH(cocoa,         [  --with-cocoa            use Cocoa], [wxUSE_COCOA="$withval" CACHE_COCOA=1 TOOLKIT_GIVEN=1])
 
871
AC_ARG_WITH(wine,          [  --with-wine             use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1])
 
872
AC_ARG_WITH(msw,           [  --with-msw              use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
 
873
AC_ARG_WITH(pm,            [  --with-pm               use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
 
874
AC_ARG_WITH(mgl,           [  --with-mgl              use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1])
 
875
AC_ARG_WITH(directfb,      [  --with-directfb         use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1])
 
876
AC_ARG_WITH(microwin,      [  --with-microwin         use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
 
877
AC_ARG_WITH(x11,           [  --with-x11              use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
 
878
WX_ARG_ENABLE(nanox,       [  --enable-nanox          use NanoX], wxUSE_NANOX)
 
879
 
 
880
AC_ARG_ENABLE(gtk2,        [  --disable-gtk2          use GTK+ 1.2 instead of 2.0], [wxUSE_GTK2="$enableval"])
 
881
WX_ARG_ENABLE(gpe,         [  --enable-gpe            use GNOME PDA Environment features if possible], wxUSE_GPE)
 
882
 
 
883
WX_ARG_SYS_WITH(libpng,    [  --with-libpng           use libpng (PNG image format)], wxUSE_LIBPNG)
 
884
WX_ARG_SYS_WITH(libjpeg,   [  --with-libjpeg          use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
 
885
WX_ARG_SYS_WITH(libtiff,   [  --with-libtiff          use libtiff (TIFF file format)], wxUSE_LIBTIFF)
 
886
WX_ARG_SYS_WITH(libxpm,    [  --with-libxpm           use libxpm (XPM file format)], wxUSE_LIBXPM)
 
887
WX_ARG_WITH(libmspack,     [  --with-libmspack        use libmspack (CHM help files loading)], wxUSE_LIBMSPACK)
 
888
WX_ARG_WITH(sdl,           [  --with-sdl              use SDL for audio on Unix], wxUSE_LIBSDL)
 
889
WX_ARG_WITH(gnomeprint,    [  --with-gnomeprint       use GNOME print for printing under GNOME], wxUSE_LIBGNOMEPRINT)
 
890
WX_ARG_WITH(gnomevfs,      [  --with-gnomevfs         use GNOME VFS for associating MIME types], wxUSE_LIBGNOMEVFS)
 
891
WX_ARG_WITH(hildon,        [  --with-hildon           use Hildon framework for Nokia 770], wxUSE_LIBHILDON)
 
892
WX_ARG_WITH(opengl,        [  --with-opengl           use OpenGL (or Mesa)], wxUSE_OPENGL)
 
893
 
 
894
if test "$wxUSE_UNIVERSAL" = "yes"; then
 
895
    AC_ARG_WITH(themes,        [  --with-themes=all|list  use only the specified comma-separated list of wxUniversal themes], [wxUNIV_THEMES="$withval"])
 
896
fi
 
897
 
 
898
fi
 
899
dnl for GUI only
 
900
 
 
901
WX_ARG_WITH(dmalloc,       [  --with-dmalloc          use dmalloc library (http://dmalloc.com/)], wxUSE_DMALLOC)
 
902
WX_ARG_SYS_WITH(regex,     [  --with-regex            enable support for wxRegEx class], wxUSE_REGEX)
 
903
WX_ARG_SYS_WITH(zlib,      [  --with-zlib             use zlib for LZW compression], wxUSE_ZLIB)
 
904
WX_ARG_SYS_WITH(odbc,      [  --with-odbc             use the IODBC and wxODBC classes], wxUSE_ODBC)
 
905
WX_ARG_SYS_WITH(expat,     [  --with-expat            enable XML support using expat parser], wxUSE_EXPAT)
 
906
 
 
907
AC_MSG_CHECKING([for --with-macosx-sdk])
 
908
AC_ARG_WITH(macosx-sdk,    [  --with-macosx-sdk=PATH  use an OS X SDK at PATH], [
 
909
        wxUSE_MACOSX_SDK=$withval
 
910
        wx_cv_use_macosx_sdk="wxUSE_MACOSX_SDK=$withval"
 
911
        echo "wxUSE_MACOSX_SDK=$wxUSE_MACOSX_SDK" >> ${wx_arg_cache_file}.tmp
 
912
    ], [
 
913
        # NOTE: Empty string on purpose so that --without-macosx-sdk (thus no)
 
914
        # will override --enable-universal_binary's automatic SDK usage.
 
915
        wxUSE_MACOSX_SDK=
 
916
        LINE=`grep "^wxUSE_MACOSX_SDK=" ${wx_arg_cache_file}`
 
917
        if test "x$LINE" != x ; then
 
918
            eval "$LINE"
 
919
            echo "$LINE" >> ${wx_arg_cache_file}.tmp
 
920
        fi
 
921
    ])
 
922
AC_MSG_RESULT([$wxUSE_MACOSX_SDK])
 
923
 
 
924
AC_MSG_CHECKING([for --with-macosx-version-min])
 
925
AC_ARG_WITH(macosx-version-min,    [  --with-macosx-version-min=VER   build binaries which require at least this OS X version], [
 
926
        wxUSE_MACOSX_VERSION_MIN=$withval
 
927
        wx_cv_use_macosx_version_min="wxUSE_MACOSX_VERSION_MIN=$withval"
 
928
        echo "wxUSE_MACOSX_VERSION_MIN=$wxUSE_MACOSX_VERSION_MIN" >> ${wx_arg_cache_file}.tmp
 
929
    ], [
 
930
        # default "yes" because when not using an SDK it means the same as no
 
931
        # but when using an SDK it means to use the SDK version
 
932
        wxUSE_MACOSX_VERSION_MIN=yes
 
933
        # See if there is a value in the cache
 
934
        LINE=`grep "^wxUSE_MACOSX_VERSION_MIN=" ${wx_arg_cache_file}`
 
935
        if test "x$LINE" != x ; then
 
936
            eval "$LINE"
 
937
            echo "$LINE" >> ${wx_arg_cache_file}.tmp
 
938
        fi
 
939
    ])
 
940
AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
 
941
 
 
942
dnl ---------------------------------------------------------------------------
 
943
dnl compile options
 
944
dnl ---------------------------------------------------------------------------
 
945
 
 
946
WX_ARG_ENABLE(shared,      [  --enable-shared         create shared library code], wxUSE_SHARED)
 
947
WX_ARG_ENABLE(optimise,    [  --enable-optimise       compile without optimisations], wxUSE_OPTIMISE)
 
948
WX_ARG_ENABLE(debug,       [  --enable-debug          same as debug_flag and debug_info], wxUSE_DEBUG)
 
949
WX_ARG_ENABLE(stl,         [  --enable-stl            use STL for containers], wxUSE_STL)
 
950
if test "$USE_OS2" = "1"; then
 
951
    DEFAULT_wxUSE_OMF=no
 
952
    WX_ARG_ENABLE(omf,     [  --enable-omf            use OMF object format], wxUSE_OMF)
 
953
fi
 
954
 
 
955
if test "$wxUSE_DEBUG" = "yes"; then
 
956
  DEFAULT_wxUSE_DEBUG_FLAG=yes
 
957
  DEFAULT_wxUSE_DEBUG_INFO=yes
 
958
  BUILD=debug
 
959
elif test "$wxUSE_DEBUG" = "no"; then
 
960
  DEFAULT_wxUSE_DEBUG_FLAG=no
 
961
  DEFAULT_wxUSE_DEBUG_INFO=no
 
962
  BUILD=release
 
963
fi
 
964
 
 
965
WX_ARG_ENABLE(debug_flag,    [  --enable-debug_flag     set __WXDEBUG__ flag (recommended for developers!)], wxUSE_DEBUG_FLAG)
 
966
WX_ARG_ENABLE(debug_info,    [  --enable-debug_info     create code with debugging information], wxUSE_DEBUG_INFO)
 
967
WX_ARG_ENABLE(debug_gdb,     [  --enable-debug_gdb      create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
 
968
WX_ARG_ENABLE(debug_cntxt,   [  --enable-debug_cntxt    use wxDebugContext], wxUSE_DEBUG_CONTEXT)
 
969
WX_ARG_ENABLE(mem_tracing,   [  --enable-mem_tracing    create code with memory tracing], wxUSE_MEM_TRACING)
 
970
WX_ARG_ENABLE(profile,       [  --enable-profile        create code with profiling information], wxUSE_PROFILE)
 
971
WX_ARG_ENABLE(no_rtti,       [  --enable-no_rtti        create code without RTTI information], wxUSE_NO_RTTI)
 
972
WX_ARG_ENABLE(no_exceptions, [  --enable-no_exceptions  create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS)
 
973
WX_ARG_ENABLE(permissive,    [  --enable-permissive     compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
 
974
WX_ARG_ENABLE(no_deps,       [  --enable-no_deps        create code without dependency information], wxUSE_NO_DEPS)
 
975
WX_ARG_ENABLE(vararg_macros, [  --disable-vararg_macros don't use vararg macros, even if they are supported], wxUSE_VARARG_MACROS)
 
976
WX_ARG_ENABLE_PARAM(universal_binary, [[  --enable-universal_binary  create Mac PowerPC and Intel Universal binary]], wxUSE_UNIVERSAL_BINARY)
 
977
 
 
978
WX_ARG_ENABLE(compat24,      [  --enable-compat24       enable wxWidgets 2.4 compatibility], WXWIN_COMPATIBILITY_2_4, enable)
 
979
WX_ARG_ENABLE(compat26,      [  --disable-compat26      disable wxWidgets 2.6 compatibility], WXWIN_COMPATIBILITY_2_6, disable)
 
980
 
 
981
WX_ARG_ENABLE(rpath,         [  --disable-rpath         disable use of rpath for uninstalled builds], wxUSE_RPATH)
 
982
 
 
983
WX_ARG_ENABLE(objc_uniquifying,[  --enable-objc_uniquifying enable Objective-C class name uniquifying], wxUSE_OBJC_UNIQUIFYING)
 
984
 
 
985
dnl If user didn't specify --enable/disable-abi-incompatible-features then set it based on wxUSE_SHARED
 
986
if test "x$wxUSE_SHARED" = "xno"; then
 
987
    DEFAULT_wxUSE_ABI_INCOMPATIBLE_FEATURES=yes
 
988
else
 
989
    DEFAULT_wxUSE_ABI_INCOMPATIBLE_FEATURES=no
 
990
fi
 
991
WX_ARG_ENABLE(abi-incompatible-features,[  --enable-abi-incompatible-features Enables features that break ABI compatibility], wxUSE_ABI_INCOMPATIBLE_FEATURES)
 
992
 
 
993
dnl ---------------------------------------------------------------------------
 
994
dnl (small) optional non GUI classes
 
995
dnl ---------------------------------------------------------------------------
 
996
 
 
997
WX_ARG_ENABLE(intl,          [  --enable-intl           use internationalization system], wxUSE_INTL)
 
998
WX_ARG_ENABLE(config,        [  --enable-config         use wxConfig (and derived) classes], wxUSE_CONFIG)
 
999
 
 
1000
WX_ARG_ENABLE(protocols,     [  --enable-protocols      use wxProtocol and derived classes], wxUSE_PROTOCOL)
 
1001
WX_ARG_ENABLE(ftp,           [  --enable-ftp            use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP)
 
1002
WX_ARG_ENABLE(http,          [  --enable-http           use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP)
 
1003
WX_ARG_ENABLE(fileproto,     [  --enable-fileproto      use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE)
 
1004
WX_ARG_ENABLE(sockets,       [  --enable-sockets        use socket/network classes], wxUSE_SOCKETS)
 
1005
WX_ARG_ENABLE(ole,           [  --enable-ole            use OLE classes (Win32 only)], wxUSE_OLE)
 
1006
WX_ARG_ENABLE(dataobj,       [  --enable-dataobj        use data object classes], wxUSE_DATAOBJ)
 
1007
 
 
1008
WX_ARG_ENABLE(ipc,           [  --enable-ipc            use interprocess communication (wxSocket etc.)], wxUSE_IPC)
 
1009
 
 
1010
dnl please keep the settings below in alphabetical order
 
1011
WX_ARG_ENABLE(apple_ieee,    [  --enable-apple_ieee     use the Apple IEEE codec], wxUSE_APPLE_IEEE)
 
1012
WX_ARG_ENABLE(arcstream,     [  --enable-arcstream      use wxArchive streams], wxUSE_ARCHIVE_STREAMS)
 
1013
WX_ARG_ENABLE(backtrace,     [  --enable-backtrace      use wxStackWalker class for getting backtraces], wxUSE_STACKWALKER)
 
1014
WX_ARG_ENABLE(catch_segvs,   [  --enable-catch_segvs    catch signals in wxApp::OnFatalException (Unix only)], wxUSE_ON_FATAL_EXCEPTION)
 
1015
WX_ARG_ENABLE(cmdline,       [  --enable-cmdline        use wxCmdLineParser class], wxUSE_CMDLINE_PARSER)
 
1016
WX_ARG_ENABLE(datetime,      [  --enable-datetime       use wxDateTime class], wxUSE_DATETIME)
 
1017
WX_ARG_ENABLE(debugreport,   [  --enable-debugreport    use wxDebugReport class], wxUSE_DEBUGREPORT)
 
1018
WX_ARG_ENABLE(dialupman,     [  --enable-dialupman      use dialup network classes], wxUSE_DIALUP_MANAGER)
 
1019
WX_ARG_ENABLE(dynlib,        [  --enable-dynlib         use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
 
1020
WX_ARG_ENABLE(dynamicloader, [  --enable-dynamicloader  use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER)
 
1021
WX_ARG_ENABLE(exceptions,    [  --enable-exceptions     build exception-safe library], wxUSE_EXCEPTIONS)
 
1022
WX_ARG_ENABLE(ffile,         [  --enable-ffile          use wxFFile class], wxUSE_FFILE)
 
1023
WX_ARG_ENABLE(file,          [  --enable-file           use wxFile class], wxUSE_FILE)
 
1024
WX_ARG_ENABLE(filesystem,    [  --enable-filesystem     use virtual file systems classes], wxUSE_FILESYSTEM)
 
1025
WX_ARG_ENABLE(fontmap,       [  --enable-fontmap        use font encodings conversion classes], wxUSE_FONTMAP)
 
1026
WX_ARG_ENABLE(fs_archive,    [  --enable-fs_archive     use virtual archive filesystems], wxUSE_FS_ARCHIVE)
 
1027
WX_ARG_ENABLE(fs_inet,       [  --enable-fs_inet        use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
 
1028
WX_ARG_ENABLE(fs_zip,        [  --enable-fs_zip         now replaced by fs_archive], wxUSE_FS_ZIP)
 
1029
WX_ARG_ENABLE(geometry,      [  --enable-geometry       use geometry class], wxUSE_GEOMETRY)
 
1030
WX_ARG_ENABLE(log,           [  --enable-log            use logging system], wxUSE_LOG)
 
1031
WX_ARG_ENABLE(longlong,      [  --enable-longlong       use wxLongLong class], wxUSE_LONGLONG)
 
1032
WX_ARG_ENABLE(mimetype,      [  --enable-mimetype       use wxMimeTypesManager], wxUSE_MIMETYPE)
 
1033
WX_ARG_ENABLE(mslu,          [  --enable-mslu           use MS Layer for Unicode on Windows 9x (Win32 only)], wxUSE_UNICODE_MSLU)
 
1034
WX_ARG_ENABLE(snglinst,      [  --enable-snglinst       use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER)
 
1035
WX_ARG_ENABLE(std_iostreams, [  --enable-std_iostreams  use standard C++ stream classes], wxUSE_STD_IOSTREAM)
 
1036
WX_ARG_ENABLE(std_string,    [  --enable-std_string     use standard C++ string classes], wxUSE_STD_STRING)
 
1037
WX_ARG_ENABLE(stdpaths,      [  --enable-stdpaths       use wxStandardPaths class], wxUSE_STDPATHS)
 
1038
WX_ARG_ENABLE(stopwatch,     [  --enable-stopwatch      use wxStopWatch class], wxUSE_STOPWATCH)
 
1039
WX_ARG_ENABLE(streams,       [  --enable-streams        use wxStream etc classes], wxUSE_STREAMS)
 
1040
WX_ARG_ENABLE(sysoptions,    [  --enable-sysoptions     use wxSystemOptions], wxUSE_SYSTEM_OPTIONS)
 
1041
WX_ARG_ENABLE(tarstream,     [  --enable-tarstream      use wxTar streams], wxUSE_TARSTREAM)
 
1042
WX_ARG_ENABLE(textbuf,       [  --enable-textbuf        use wxTextBuffer class], wxUSE_TEXTBUFFER)
 
1043
WX_ARG_ENABLE(textfile,      [  --enable-textfile       use wxTextFile class], wxUSE_TEXTFILE)
 
1044
WX_ARG_ENABLE(timer,         [  --enable-timer          use wxTimer class], wxUSE_TIMER)
 
1045
WX_ARG_ENABLE(unicode,       [  --enable-unicode        compile wxString with Unicode support], wxUSE_UNICODE)
 
1046
WX_ARG_ENABLE(sound,         [  --enable-sound          use wxSound class], wxUSE_SOUND)
 
1047
WX_ARG_ENABLE(mediactrl,     [  --enable-mediactrl      use wxMediaCtrl class], wxUSE_MEDIACTRL)
 
1048
WX_ARG_ENABLE(gstreamer8,    [  --enable-gstreamer8     force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8)
 
1049
WX_ARG_ENABLE(printfposparam,[  --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS)
 
1050
WX_ARG_ENABLE(zipstream,     [  --enable-zipstream      use wxZip streams], wxUSE_ZIPSTREAM)
 
1051
 
 
1052
WX_ARG_ENABLE(url,           [  --enable-url            use wxURL class], wxUSE_URL)
 
1053
WX_ARG_ENABLE(variant,       [  --enable-variant        use wxVariant class], wxUSE_VARIANT)
 
1054
WX_ARG_ENABLE(protocol,      [  --enable-protocol       use wxProtocol class], wxUSE_PROTOCOL)
 
1055
WX_ARG_ENABLE(protocol_http, [  --enable-protocol-http  HTTP support in wxProtocol], wxUSE_PROTOCOL_HTTP)
 
1056
WX_ARG_ENABLE(protocol_ftp,  [  --enable-protocol-ftp   FTP support in wxProtocol], wxUSE_PROTOCOL_FTP)
 
1057
WX_ARG_ENABLE(protocol_file, [  --enable-protocol-file  FILE support in wxProtocol], wxUSE_PROTOCOL_FILE)
 
1058
 
 
1059
 
 
1060
dnl ---------------------------------------------------------------------------
 
1061
dnl "big" options (i.e. those which change a lot of things throughout the library)
 
1062
dnl ---------------------------------------------------------------------------
 
1063
 
 
1064
WX_ARG_ENABLE(threads,     [  --enable-threads        use threads], wxUSE_THREADS)
 
1065
 
 
1066
if test "$wxUSE_GUI" = "yes"; then
 
1067
 
 
1068
dnl ---------------------------------------------------------------------------
 
1069
dnl "big" GUI options
 
1070
dnl ---------------------------------------------------------------------------
 
1071
 
 
1072
WX_ARG_ENABLE(docview,     [  --enable-docview        use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE)
 
1073
WX_ARG_ENABLE(help,        [  --enable-help           use help subsystem], wxUSE_HELP)
 
1074
WX_ARG_ENABLE(mshtmlhelp,  [  --enable-mshtmlhelp     use MS HTML Help (win32)], wxUSE_MS_HTML_HELP)
 
1075
WX_ARG_ENABLE(html,        [  --enable-html           use wxHTML sub-library], wxUSE_HTML)
 
1076
WX_ARG_ENABLE(htmlhelp,    [  --enable-htmlhelp       use wxHTML-based help], wxUSE_WXHTML_HELP)
 
1077
WX_ARG_ENABLE(xrc,         [  --enable-xrc            use XRC resources sub-library], wxUSE_XRC)
 
1078
WX_ARG_ENABLE(aui,         [  --enable-aui            use AUI docking library], wxUSE_AUI)
 
1079
WX_ARG_ENABLE(constraints, [  --enable-constraints    use layout-constraints system], wxUSE_CONSTRAINTS)
 
1080
WX_ARG_ENABLE(printarch,   [  --enable-printarch      use printing architecture], wxUSE_PRINTING_ARCHITECTURE)
 
1081
WX_ARG_ENABLE(mdi,         [  --enable-mdi            use multiple document interface architecture], wxUSE_MDI)
 
1082
WX_ARG_ENABLE(mdidoc,      [  --enable-mdidoc         use docview architecture with MDI], wxUSE_MDI_ARCHITECTURE)
 
1083
WX_ARG_ENABLE(loggui,      [  --enable-loggui         use standard GUI logger], wxUSE_LOGGUI)
 
1084
WX_ARG_ENABLE(logwin,      [  --enable-logwin         use wxLogWindow], wxUSE_LOGWINDOW)
 
1085
WX_ARG_ENABLE(logdialog,   [  --enable-logdialog      use wxLogDialog], wxUSE_LOGDIALOG)
 
1086
WX_ARG_ENABLE(webkit,      [  --enable-webkit         use wxWebKitCtrl (Mac)], wxUSE_WEBKIT)
 
1087
WX_ARG_ENABLE(richtext,    [  --enable-richtext       use wxRichTextCtrl], wxUSE_RICHTEXT)
 
1088
WX_ARG_ENABLE(graphics_ctx, [  --enable-graphics_ctx   use graphics context 2D drawing API], wxUSE_GRAPHICS_CONTEXT)
 
1089
 
 
1090
dnl ---------------------------------------------------------------------------
 
1091
dnl PostScript options
 
1092
dnl ---------------------------------------------------------------------------
 
1093
WX_ARG_ENABLE(postscript,  [  --enable-postscript     use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT)
 
1094
 
 
1095
dnl VZ: these options seem to be always on, if someone wants to change it please do
 
1096
dnl WX_ARG_ENABLE(PS-normalized,    [  --enable-PS-normalized  use normalized PS fonts], dnl             wxUSE_NORMALIZED_PS_FONTS)
 
1097
dnl WX_ARG_ENABLE(afmfonts,        [  --enable-afmfonts       use Adobe Font Metric Font table], dnl             wxUSE_AFM_FOR_POSTSCRIPT)
 
1098
 
 
1099
dnl ---------------------------------------------------------------------------
 
1100
dnl resources
 
1101
dnl ---------------------------------------------------------------------------
 
1102
 
 
1103
WX_ARG_ENABLE(prologio,    [  --enable-prologio       not available; see contrib], wxUSE_PROLOGIO)
 
1104
WX_ARG_ENABLE(resources,   [  --enable-resources      not available; see contrib], wxUSE_RESOURCES)
 
1105
 
 
1106
dnl ---------------------------------------------------------------------------
 
1107
dnl IPC &c
 
1108
dnl ---------------------------------------------------------------------------
 
1109
 
 
1110
WX_ARG_ENABLE(clipboard,   [  --enable-clipboard      use wxClipboard class], wxUSE_CLIPBOARD)
 
1111
WX_ARG_ENABLE(dnd,         [  --enable-dnd            use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP)
 
1112
WX_ARG_ENABLE(metafile,    [  --enable-metafile       use win32 metafiles], wxUSE_METAFILE)
 
1113
 
 
1114
dnl WX_ARG_ENABLE(treelayout,  [  --enable-treelayout     use wxTreeLayout class], wxUSE_TREELAYOUT)
 
1115
 
 
1116
dnl ---------------------------------------------------------------------------
 
1117
dnl optional GUI controls (in alphabetical order except the first one)
 
1118
dnl ---------------------------------------------------------------------------
 
1119
 
 
1120
WX_ARG_ENABLE(controls,    [  --enable-controls       use all usual controls], wxUSE_CONTROLS)
 
1121
 
 
1122
dnl even with --enable-controls, some may be disabled by giving
 
1123
dnl --disable-<control> later on the command line - but by default all will be
 
1124
dnl used (and vice versa)
 
1125
if test "$wxUSE_CONTROLS" = "yes"; then
 
1126
  DEFAULT_wxUSE_ACCEL=yes
 
1127
  DEFAULT_wxUSE_ANIMATIONCTRL=yes
 
1128
  DEFAULT_wxUSE_BMPBUTTON=yes
 
1129
  DEFAULT_wxUSE_BUTTON=yes
 
1130
  DEFAULT_wxUSE_CALCTRL=yes
 
1131
  DEFAULT_wxUSE_CARET=yes
 
1132
  DEFAULT_wxUSE_COMBOBOX=yes
 
1133
  DEFAULT_wxUSE_CHECKBOX=yes
 
1134
  DEFAULT_wxUSE_CHECKLISTBOX=yes
 
1135
  DEFAULT_wxUSE_CHOICE=yes
 
1136
  DEFAULT_wxUSE_CHOICEBOOK=yes
 
1137
  DEFAULT_wxUSE_COLLPANE=yes
 
1138
  DEFAULT_wxUSE_COLOURPICKERCTRL=yes
 
1139
  DEFAULT_wxUSE_COMBOBOX=yes
 
1140
  DEFAULT_wxUSE_DATEPICKCTRL=yes
 
1141
  DEFAULT_wxUSE_DISPLAY=yes
 
1142
  DEFAULT_wxUSE_DETECT_SM=yes
 
1143
  DEFAULT_wxUSE_DIRPICKERCTRL=yes
 
1144
  DEFAULT_wxUSE_FILEPICKERCTRL=yes
 
1145
  DEFAULT_wxUSE_FONTPICKERCTRL=yes
 
1146
  DEFAULT_wxUSE_GAUGE=yes
 
1147
  DEFAULT_wxUSE_GRID=yes
 
1148
  DEFAULT_wxUSE_HYPERLINKCTRL=yes
 
1149
  DEFAULT_wxUSE_DATAVIEWCTRL=no
 
1150
  DEFAULT_wxUSE_IMAGLIST=yes
 
1151
  DEFAULT_wxUSE_LISTBOOK=yes
 
1152
  DEFAULT_wxUSE_LISTBOX=yes
 
1153
  DEFAULT_wxUSE_LISTCTRL=yes
 
1154
  DEFAULT_wxUSE_NOTEBOOK=yes
 
1155
  DEFAULT_wxUSE_RADIOBOX=yes
 
1156
  DEFAULT_wxUSE_RADIOBTN=yes
 
1157
  DEFAULT_wxUSE_SASH=yes
 
1158
  DEFAULT_wxUSE_SCROLLBAR=yes
 
1159
  DEFAULT_wxUSE_SEARCHCTRL=yes
 
1160
  DEFAULT_wxUSE_SLIDER=yes
 
1161
  DEFAULT_wxUSE_SPINBTN=yes
 
1162
  DEFAULT_wxUSE_SPINCTRL=yes
 
1163
  DEFAULT_wxUSE_SPLITTER=yes
 
1164
  DEFAULT_wxUSE_STATBMP=yes
 
1165
  DEFAULT_wxUSE_STATBOX=yes
 
1166
  DEFAULT_wxUSE_STATLINE=yes
 
1167
  DEFAULT_wxUSE_STATUSBAR=yes
 
1168
  DEFAULT_wxUSE_TAB_DIALOG=yes
 
1169
  DEFAULT_wxUSE_TOGGLEBTN=yes
 
1170
  DEFAULT_wxUSE_TOOLBAR=yes
 
1171
  DEFAULT_wxUSE_TOOLBAR_NATIVE=yes
 
1172
  DEFAULT_wxUSE_TOOLTIPS=yes
 
1173
  DEFAULT_wxUSE_TREEBOOK=yes
 
1174
  DEFAULT_wxUSE_TOOLBOOK=yes
 
1175
  DEFAULT_wxUSE_TREECTRL=yes
 
1176
  DEFAULT_wxUSE_POPUPWIN=yes
 
1177
  DEFAULT_wxUSE_TIPWINDOW=yes
 
1178
elif test "$wxUSE_CONTROLS" = "no"; then
 
1179
  DEFAULT_wxUSE_ACCEL=no
 
1180
  DEFAULT_wxUSE_ANIMATIONCTRL=no
 
1181
  DEFAULT_wxUSE_BMPBUTTON=no
 
1182
  DEFAULT_wxUSE_BUTTON=no
 
1183
  DEFAULT_wxUSE_CALCTRL=no
 
1184
  DEFAULT_wxUSE_CARET=no
 
1185
  DEFAULT_wxUSE_COLLPANE=no
 
1186
  DEFAULT_wxUSE_COMBOBOX=no
 
1187
  DEFAULT_wxUSE_CHECKBOX=no
 
1188
  DEFAULT_wxUSE_CHECKLISTBOX=no
 
1189
  DEFAULT_wxUSE_CHOICE=no
 
1190
  DEFAULT_wxUSE_CHOICEBOOK=no
 
1191
  DEFAULT_wxUSE_COLOURPICKERCTRL=no
 
1192
  DEFAULT_wxUSE_COMBOBOX=no
 
1193
  DEFAULT_wxUSE_DATEPICKCTRL=no
 
1194
  DEFAULT_wxUSE_DISPLAY=no
 
1195
  DEFAULT_wxUSE_DETECT_SM=no
 
1196
  DEFAULT_wxUSE_DIRPICKERCTRL=no
 
1197
  DEFAULT_wxUSE_FILEPICKERCTRL=no
 
1198
  DEFAULT_wxUSE_FONTPICKERCTRL=no
 
1199
  DEFAULT_wxUSE_GAUGE=no
 
1200
  DEFAULT_wxUSE_GRID=no
 
1201
  DEFAULT_wxUSE_HYPERLINKCTRL=no
 
1202
  DEFAULT_wxUSE_DATAVIEWCTRL=no
 
1203
  DEFAULT_wxUSE_IMAGLIST=no
 
1204
  DEFAULT_wxUSE_LISTBOOK=no
 
1205
  DEFAULT_wxUSE_LISTBOX=no
 
1206
  DEFAULT_wxUSE_LISTCTRL=no
 
1207
  DEFAULT_wxUSE_NOTEBOOK=no
 
1208
  DEFAULT_wxUSE_RADIOBOX=no
 
1209
  DEFAULT_wxUSE_RADIOBTN=no
 
1210
  DEFAULT_wxUSE_SASH=no
 
1211
  DEFAULT_wxUSE_SCROLLBAR=no
 
1212
  DEFAULT_wxUSE_SEARCHCTRL=no
 
1213
  DEFAULT_wxUSE_SLIDER=no
 
1214
  DEFAULT_wxUSE_SPINBTN=no
 
1215
  DEFAULT_wxUSE_SPINCTRL=no
 
1216
  DEFAULT_wxUSE_SPLITTER=no
 
1217
  DEFAULT_wxUSE_STATBMP=no
 
1218
  DEFAULT_wxUSE_STATBOX=no
 
1219
  DEFAULT_wxUSE_STATLINE=no
 
1220
  DEFAULT_wxUSE_STATUSBAR=no
 
1221
  DEFAULT_wxUSE_TAB_DIALOG=no
 
1222
  DEFAULT_wxUSE_TOGGLEBTN=no
 
1223
  DEFAULT_wxUSE_TOOLBAR=no
 
1224
  DEFAULT_wxUSE_TOOLBAR_NATIVE=no
 
1225
  DEFAULT_wxUSE_TOOLTIPS=no
 
1226
  DEFAULT_wxUSE_TREEBOOK=no
 
1227
  DEFAULT_wxUSE_TOOLBOOK=no
 
1228
  DEFAULT_wxUSE_TREECTRL=no
 
1229
  DEFAULT_wxUSE_POPUPWIN=no
 
1230
  DEFAULT_wxUSE_TIPWINDOW=no
 
1231
fi
 
1232
 
 
1233
WX_ARG_ENABLE(accel,       [  --enable-accel          use accelerators], wxUSE_ACCEL)
 
1234
WX_ARG_ENABLE(animatectrl, [  --enable-animatectrl    use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL)
 
1235
WX_ARG_ENABLE(button,      [  --enable-button         use wxButton class], wxUSE_BUTTON)
 
1236
WX_ARG_ENABLE(bmpbutton,   [  --enable-bmpbutton      use wxBitmapButton class], wxUSE_BMPBUTTON)
 
1237
WX_ARG_ENABLE(bmpcombobox, [  --enable-bmpcombobox    use wxBitmapComboBox class], wxUSE_BITMAPCOMBOBOX)
 
1238
WX_ARG_ENABLE(calendar,    [  --enable-calendar       use wxCalendarCtrl class], wxUSE_CALCTRL)
 
1239
WX_ARG_ENABLE(caret,       [  --enable-caret          use wxCaret class], wxUSE_CARET)
 
1240
WX_ARG_ENABLE(checkbox,    [  --enable-checkbox       use wxCheckBox class], wxUSE_CHECKBOX)
 
1241
WX_ARG_ENABLE(checklst,    [  --enable-checklst       use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST)
 
1242
WX_ARG_ENABLE(choice,      [  --enable-choice         use wxChoice class], wxUSE_CHOICE)
 
1243
WX_ARG_ENABLE(choicebook,  [  --enable-choicebook     use wxChoicebook class], wxUSE_CHOICEBOOK)
 
1244
WX_ARG_ENABLE(collpane,    [  --enable-collpane       use wxCollapsiblePane class], wxUSE_COLLPANE)
 
1245
WX_ARG_ENABLE(colourpicker,[  --enable-colourpicker   use wxColourPickerCtrl class], wxUSE_COLOURPICKERCTRL)
 
1246
WX_ARG_ENABLE(combobox,    [  --enable-combobox       use wxComboBox class], wxUSE_COMBOBOX)
 
1247
WX_ARG_ENABLE(comboctrl,   [  --enable-comboctrl      use wxComboCtrl class], wxUSE_COMBOCTRL)
 
1248
WX_ARG_ENABLE(datepick,    [  --enable-datepick       use wxDatePickerCtrl class], wxUSE_DATEPICKCTRL)
 
1249
WX_ARG_ENABLE(dirpicker,   [  --enable-dirpicker      use wxDirPickerCtrl class], wxUSE_DIRPICKERCTRL)
 
1250
WX_ARG_ENABLE(display,     [  --enable-display        use wxDisplay class], wxUSE_DISPLAY)
 
1251
WX_ARG_ENABLE(detect_sm,   [  --enable-detect_sm      use code to detect X11 session manager], wxUSE_DETECT_SM)
 
1252
WX_ARG_ENABLE(filepicker,  [  --enable-filepicker     use wxFilePickerCtrl class], wxUSE_FILEPICKERCTRL)
 
1253
WX_ARG_ENABLE(fontpicker,  [  --enable-fontpicker     use wxFontPickerCtrl class], wxUSE_FONTPICKERCTRL)
 
1254
WX_ARG_ENABLE(gauge,       [  --enable-gauge          use wxGauge class], wxUSE_GAUGE)
 
1255
WX_ARG_ENABLE(grid,        [  --enable-grid           use wxGrid class], wxUSE_GRID)
 
1256
WX_ARG_ENABLE(dataviewctrl,[  --enable-dataviewctrl   use wxDataViewCtrl class], wxUSE_DATAVIEWCTRL)
 
1257
WX_ARG_ENABLE(hyperlink,   [  --enable-hyperlink      use wxHyperlinkCtrl class], wxUSE_HYPERLINKCTRL)
 
1258
WX_ARG_ENABLE(imaglist,    [  --enable-imaglist       use wxImageList class], wxUSE_IMAGLIST)
 
1259
WX_ARG_ENABLE(listbook,    [  --enable-listbook       use wxListbook class], wxUSE_LISTBOOK)
 
1260
WX_ARG_ENABLE(listbox,     [  --enable-listbox        use wxListBox class], wxUSE_LISTBOX)
 
1261
WX_ARG_ENABLE(listctrl,    [  --enable-listctrl       use wxListCtrl class], wxUSE_LISTCTRL)
 
1262
WX_ARG_ENABLE(notebook,    [  --enable-notebook       use wxNotebook class], wxUSE_NOTEBOOK)
 
1263
WX_ARG_ENABLE(odcombobox,  [  --enable-odcombobox     use wxOwnerDrawnComboBox class], wxUSE_ODCOMBOBOX)
 
1264
WX_ARG_ENABLE(radiobox,    [  --enable-radiobox       use wxRadioBox class], wxUSE_RADIOBOX)
 
1265
WX_ARG_ENABLE(radiobtn,    [  --enable-radiobtn       use wxRadioButton class], wxUSE_RADIOBTN)
 
1266
WX_ARG_ENABLE(sash,        [  --enable-sash           use wxSashWindow class], wxUSE_SASH)
 
1267
WX_ARG_ENABLE(scrollbar,   [  --enable-scrollbar      use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR)
 
1268
WX_ARG_ENABLE(searchctrl,  [  --enable-searchctrl     use wxSearchCtrl class], wxUSE_SEARCHCTRL)
 
1269
WX_ARG_ENABLE(slider,      [  --enable-slider         use wxSlider class], wxUSE_SLIDER)
 
1270
WX_ARG_ENABLE(spinbtn,     [  --enable-spinbtn        use wxSpinButton class], wxUSE_SPINBTN)
 
1271
WX_ARG_ENABLE(spinctrl,    [  --enable-spinctrl       use wxSpinCtrl class], wxUSE_SPINCTRL)
 
1272
WX_ARG_ENABLE(splitter,    [  --enable-splitter       use wxSplitterWindow class], wxUSE_SPLITTER)
 
1273
WX_ARG_ENABLE(statbmp,     [  --enable-statbmp        use wxStaticBitmap class], wxUSE_STATBMP)
 
1274
WX_ARG_ENABLE(statbox,     [  --enable-statbox        use wxStaticBox class], wxUSE_STATBOX)
 
1275
WX_ARG_ENABLE(statline,    [  --enable-statline       use wxStaticLine class], wxUSE_STATLINE)
 
1276
WX_ARG_ENABLE(stattext,    [  --enable-stattext       use wxStaticText class], wxUSE_STATTEXT)
 
1277
WX_ARG_ENABLE(statusbar,   [  --enable-statusbar      use wxStatusBar class], wxUSE_STATUSBAR)
 
1278
WX_ARG_ENABLE(tabdialog,   [  --enable-tabdialog      use wxTabControl class], wxUSE_TAB_DIALOG)
 
1279
WX_ARG_ENABLE(textctrl,    [  --enable-textctrl       use wxTextCtrl class], wxUSE_TEXTCTRL)
 
1280
WX_ARG_ENABLE(togglebtn,   [  --enable-togglebtn      use wxToggleButton class], wxUSE_TOGGLEBTN)
 
1281
WX_ARG_ENABLE(toolbar,     [  --enable-toolbar        use wxToolBar class], wxUSE_TOOLBAR)
 
1282
WX_ARG_ENABLE(tbarnative,  [  --enable-tbarnative     use native wxToolBar class], wxUSE_TOOLBAR_NATIVE)
 
1283
WX_ARG_ENABLE(treebook,    [  --enable-treebook       use wxTreebook class], wxUSE_TREEBOOK)
 
1284
WX_ARG_ENABLE(toolbook,    [  --enable-toolbook       use wxToolbook class], wxUSE_TOOLBOOK)
 
1285
WX_ARG_ENABLE(treectrl,    [  --enable-treectrl       use wxTreeCtrl class], wxUSE_TREECTRL)
 
1286
WX_ARG_ENABLE(tipwindow,   [  --enable-tipwindow      use wxTipWindow class], wxUSE_TIPWINDOW)
 
1287
WX_ARG_ENABLE(popupwin,    [  --enable-popupwin       use wxPopUpWindow class], wxUSE_POPUPWIN)
 
1288
 
 
1289
dnl ---------------------------------------------------------------------------
 
1290
dnl common dialogs
 
1291
dnl ---------------------------------------------------------------------------
 
1292
 
 
1293
WX_ARG_ENABLE(commondlg,   [  --enable-commondlg      use all common dialogs], wxUSE_COMMONDLGS)
 
1294
WX_ARG_ENABLE(aboutdlg,    [  --enable-aboutdlg       use wxAboutBox], wxUSE_ABOUTDLG)
 
1295
WX_ARG_ENABLE(choicedlg,   [  --enable-choicedlg      use wxChoiceDialog], wxUSE_CHOICEDLG)
 
1296
WX_ARG_ENABLE(coldlg,      [  --enable-coldlg         use wxColourDialog], wxUSE_COLOURDLG)
 
1297
WX_ARG_ENABLE(filedlg,     [  --enable-filedlg        use wxFileDialog], wxUSE_FILEDLG)
 
1298
WX_ARG_ENABLE(finddlg,     [  --enable-finddlg        use wxFindReplaceDialog], wxUSE_FINDREPLDLG)
 
1299
WX_ARG_ENABLE(fontdlg,     [  --enable-fontdlg        use wxFontDialog], wxUSE_FONTDLG)
 
1300
WX_ARG_ENABLE(dirdlg,      [  --enable-dirdlg         use wxDirDialog], wxUSE_DIRDLG)
 
1301
WX_ARG_ENABLE(msgdlg,      [  --enable-msgdlg         use wxMessageDialog], wxUSE_MSGDLG)
 
1302
WX_ARG_ENABLE(numberdlg,   [  --enable-numberdlg      use wxNumberEntryDialog], wxUSE_NUMBERDLG)
 
1303
WX_ARG_ENABLE(splash,      [  --enable-splash         use wxSplashScreen], wxUSE_SPLASH)
 
1304
WX_ARG_ENABLE(textdlg,     [  --enable-textdlg        use wxTextDialog], wxUSE_TEXTDLG)
 
1305
WX_ARG_ENABLE(tipdlg,      [  --enable-tipdlg         use startup tips], wxUSE_STARTUP_TIPS)
 
1306
WX_ARG_ENABLE(progressdlg, [  --enable-progressdlg    use wxProgressDialog], wxUSE_PROGRESSDLG)
 
1307
WX_ARG_ENABLE(wizarddlg,   [  --enable-wizarddlg      use wxWizard], wxUSE_WIZARDDLG)
 
1308
 
 
1309
dnl ---------------------------------------------------------------------------
 
1310
dnl misc GUI options
 
1311
dnl ---------------------------------------------------------------------------
 
1312
 
 
1313
WX_ARG_ENABLE(menus,       [  --enable-menus          use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS)
 
1314
WX_ARG_ENABLE(miniframe,   [  --enable-miniframe      use wxMiniFrame class], wxUSE_MINIFRAME)
 
1315
WX_ARG_ENABLE(tooltips,    [  --enable-tooltips       use wxToolTip class], wxUSE_TOOLTIPS)
 
1316
WX_ARG_ENABLE(splines,     [  --enable-splines        use spline drawing code], wxUSE_SPLINES)
 
1317
WX_ARG_ENABLE(mousewheel,  [  --enable-mousewheel     use mousewheel], wxUSE_MOUSEWHEEL)
 
1318
WX_ARG_ENABLE(validators,  [  --enable-validators     use wxValidator and derived classes], wxUSE_VALIDATORS)
 
1319
WX_ARG_ENABLE(busyinfo,    [  --enable-busyinfo       use wxBusyInfo], wxUSE_BUSYINFO)
 
1320
WX_ARG_ENABLE(joystick,    [  --enable-joystick       use wxJoystick], wxUSE_JOYSTICK)
 
1321
WX_ARG_ENABLE(metafile,    [  --enable-metafiles      use wxMetaFile (Win32 only)], wxUSE_METAFILE)
 
1322
WX_ARG_ENABLE(dragimage,   [  --enable-dragimage      use wxDragImage], wxUSE_DRAGIMAGE)
 
1323
WX_ARG_ENABLE(accessibility,[  --enable-accessibility  enable accessibility support], wxUSE_ACCESSIBILITY)
 
1324
 
 
1325
if test "$wxUSE_MSW" = "1"; then
 
1326
    WX_ARG_ENABLE(dccache, [  --enable-dccache        cache temporary wxDC objects (Win32 only)], wxUSE_DC_CACHEING)
 
1327
fi
 
1328
 
 
1329
dnl ---------------------------------------------------------------------------
 
1330
dnl support for image formats that do not rely on external library
 
1331
dnl ---------------------------------------------------------------------------
 
1332
 
 
1333
WX_ARG_ENABLE(palette,     [  --enable-palette        use wxPalette class], wxUSE_PALETTE)
 
1334
WX_ARG_ENABLE(image,       [  --enable-image          use wxImage class], wxUSE_IMAGE)
 
1335
WX_ARG_ENABLE(gif,         [  --enable-gif            use gif images (GIF file format)], wxUSE_GIF)
 
1336
WX_ARG_ENABLE(pcx,         [  --enable-pcx            use pcx images (PCX file format)], wxUSE_PCX)
 
1337
WX_ARG_ENABLE(tga,         [  --enable-tga            use tga images (TGA file format)], wxUSE_TGA)
 
1338
WX_ARG_ENABLE(iff,         [  --enable-iff            use iff images (IFF file format)], wxUSE_IFF)
 
1339
WX_ARG_ENABLE(pnm,         [  --enable-pnm            use pnm images (PNM file format)], wxUSE_PNM)
 
1340
WX_ARG_ENABLE(xpm,         [  --enable-xpm            use xpm images (XPM file format)], wxUSE_XPM)
 
1341
WX_ARG_ENABLE(ico_cur,     [  --enable-icocur         use Windows ICO and CUR formats], wxUSE_ICO_CUR)
 
1342
 
 
1343
fi
 
1344
 
 
1345
dnl ---------------------------------------------------------------------------
 
1346
dnl flavour support
 
1347
dnl ---------------------------------------------------------------------------
 
1348
 
 
1349
dnl Should this be --enable?  I flip-flopped a couple of times and this seems
 
1350
dnl in the spirit if not the letter, we have gtk-prefix and the like in this group.
 
1351
dnl It doesn't actually change anything but the output file names.
 
1352
AC_ARG_WITH(flavour,       [  --with-flavour=NAME     specify a name to identify this build], [WX_FLAVOUR="$withval"])
 
1353
 
 
1354
dnl ---------------------------------------------------------------------------
 
1355
dnl some win32 settings
 
1356
dnl ---------------------------------------------------------------------------
 
1357
 
 
1358
WX_ARG_ENABLE(official_build,  [  --enable-official_build official build of wxWidgets (win32 DLL only)], wxUSE_OFFICIAL_BUILD)
 
1359
AC_ARG_ENABLE(vendor,  [  --enable-vendor=VENDOR  vendor name (win32 DLL only)], [VENDOR="$enableval"])
 
1360
if test "x$VENDOR" = "x"; then
 
1361
    VENDOR="custom"
 
1362
fi
 
1363
 
 
1364
 
 
1365
dnl for GUI only
 
1366
 
 
1367
dnl cache the options values before (may be) aborting below
 
1368
WX_ARG_CACHE_FLUSH
 
1369
 
 
1370
dnl check that no more than one toolkit is given and that if none are given that
 
1371
dnl we have a default one
 
1372
 
 
1373
AC_MSG_CHECKING(for toolkit)
 
1374
 
 
1375
# In Wine, we need to default to MSW, not GTK or MOTIF
 
1376
if test "$wxUSE_WINE" = "yes"; then
 
1377
    DEFAULT_DEFAULT_wxUSE_GTK=0
 
1378
    DEFAULT_DEFAULT_wxUSE_MOTIF=0
 
1379
    DEFAULT_DEFAULT_wxUSE_MSW=1
 
1380
    wxUSE_SHARED=no
 
1381
    CC=${CC:-winegcc}
 
1382
    CXX=${CXX:-wineg++}
 
1383
fi
 
1384
 
 
1385
 
 
1386
if test "$wxUSE_GUI" = "yes"; then
 
1387
 
 
1388
    if test "$USE_BEOS" = 1; then
 
1389
        AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui])
 
1390
    fi
 
1391
 
 
1392
    if test "$TOOLKIT_GIVEN" = 1; then
 
1393
      dnl convert "yes", "any" or a number to 1 and "no" to 0
 
1394
      for toolkit in `echo $ALL_TOOLKITS`; do
 
1395
        var=wxUSE_$toolkit
 
1396
        eval "value=\$${var}"
 
1397
        if test "x$value" = "xno"; then
 
1398
          eval "$var=0"
 
1399
        elif test "x$value" != "x"; then
 
1400
          eval "$var=1"
 
1401
        fi
 
1402
 
 
1403
        if test "x$value" != "x" -a "x$value" != "xyes" -a "x$value" != "xno"; then
 
1404
          eval "wx${toolkit}_VERSION=$value"
 
1405
        fi
 
1406
      done
 
1407
    else
 
1408
      dnl try to guess the most apropriate toolkit for this platform
 
1409
      for toolkit in `echo $ALL_TOOLKITS`; do
 
1410
        if test "$has_toolkit_in_cache" != 1; then
 
1411
          var=DEFAULT_DEFAULT_wxUSE_$toolkit
 
1412
        else
 
1413
          var=DEFAULT_wxUSE_$toolkit
 
1414
 
 
1415
          eval "version=\$DEFAULT_wx${toolkit}_VERSION"
 
1416
          if test "x$version" != "x"; then
 
1417
            eval "wx${toolkit}_VERSION=$version"
 
1418
          fi
 
1419
        fi
 
1420
        eval "wxUSE_$toolkit=\$${var}"
 
1421
      done
 
1422
    fi
 
1423
 
 
1424
    dnl we suppose that expr is available (maybe there is a better way to do
 
1425
    dnl this? what about using ALL_TOOLKITS? TODO)
 
1426
    NUM_TOOLKITS=`expr ${wxUSE_COCOA:-0} + ${wxUSE_GTK:-0} + ${wxUSE_MAC:-0} \
 
1427
                  + ${wxUSE_MGL:-0} + ${wxUSE_DFB:-0} + ${wxUSE_MICROWIN:-0} \
 
1428
                  + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} + ${wxUSE_X11:-0}`
 
1429
 
 
1430
    dnl Allow wxUSE_PM only for OS/2 with EMX.
 
1431
    case "${host}" in
 
1432
      *-pc-os2_emx | *-pc-os2-emx )
 
1433
        NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}`
 
1434
    esac
 
1435
 
 
1436
    case "$NUM_TOOLKITS" in
 
1437
      1)
 
1438
      ;;
 
1439
      0)
 
1440
        AC_MSG_ERROR(Please specify a toolkit -- cannot determine the default for ${host})
 
1441
      ;;
 
1442
      *)
 
1443
        AC_MSG_ERROR(Please specify at most one toolkit (maybe some are cached in configarg.cache?))
 
1444
    esac
 
1445
 
 
1446
    # to be removed when --disable-gtk2 isn't needed
 
1447
    if test "x$wxUSE_GTK2" = "xyes"; then
 
1448
        wxGTK_VERSION=2
 
1449
    elif test "x$wxUSE_GTK2" = "xno"; then
 
1450
        wxGTK_VERSION=1
 
1451
    fi
 
1452
 
 
1453
    dnl cache the wxUSE_<TOOLKIT> values too
 
1454
    for toolkit in `echo $ALL_TOOLKITS`; do
 
1455
      var=wxUSE_$toolkit
 
1456
      eval "value=\$${var}"
 
1457
      if test "x$value" != x; then
 
1458
        cache_var=CACHE_$toolkit
 
1459
        eval "cache=\$${cache_var}"
 
1460
        if test "$cache" = 1; then
 
1461
          echo "$var=$value" >> ${wx_arg_cache_file}
 
1462
          eval "version=\$wx${toolkit}_VERSION"
 
1463
          if test "x$version" != "x"; then
 
1464
            echo "wx${toolkit}_VERSION=$version" >> ${wx_arg_cache_file}
 
1465
          fi
 
1466
        fi
 
1467
        if test "$value" = 1; then
 
1468
          toolkit_echo=`echo $toolkit | tr '[[A-Z]]' '[[a-z]]'`
 
1469
          AC_MSG_RESULT($toolkit_echo)
 
1470
        fi
 
1471
      fi
 
1472
    done
 
1473
else
 
1474
    if test "x$host_alias" != "x"; then
 
1475
        AC_MSG_RESULT(base ($host_alias hosted) only)
 
1476
    else
 
1477
        AC_MSG_RESULT(base only)
 
1478
    fi
 
1479
fi
 
1480
 
 
1481
dnl ---------------------------------------------------------------------------
 
1482
dnl Checks for programs
 
1483
dnl ---------------------------------------------------------------------------
 
1484
 
 
1485
dnl flush the cache because checking for programs might abort
 
1486
AC_CACHE_SAVE
 
1487
 
 
1488
dnl C-compiler checks
 
1489
dnl   defines CC with the compiler to use
 
1490
dnl   defines GCC with yes if using gcc
 
1491
dnl   defines GCC empty if not using gcc
 
1492
dnl   defines CFLAGS
 
1493
dnl
 
1494
dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
 
1495
dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add
 
1496
dnl -g and -O flags ourselves below
 
1497
CFLAGS=${CFLAGS:=}
 
1498
AC_BAKEFILE_PROG_CC
 
1499
 
 
1500
dnl is -traditional needed for correct compilations
 
1501
dnl   adds -traditional for gcc if needed
 
1502
AC_PROG_GCC_TRADITIONAL
 
1503
 
 
1504
dnl C++-compiler checks
 
1505
dnl   defines CXX with the compiler to use
 
1506
dnl   defines GXX with yes if using gxx
 
1507
dnl   defines GXX empty if not using gxx
 
1508
dnl   defines CXXFLAGS
 
1509
dnl
 
1510
dnl see CFLAGS line above
 
1511
CXXFLAGS=${CXXFLAGS:=}
 
1512
AC_BAKEFILE_PROG_CXX
 
1513
 
 
1514
dnl ranlib command
 
1515
dnl   defines RANLIB with the appropriate command
 
1516
AC_PROG_RANLIB
 
1517
 
 
1518
dnl ar command
 
1519
dnl   defines AR with the appropriate command
 
1520
dnl 
 
1521
dnl For Sun CC AC_BAKEFILE below sets AR to the compiler itself.
 
1522
if test "x$SUNCXX" != xyes; then
 
1523
    AC_CHECK_TOOL(AR, ar)
 
1524
    if test "x$AR" = "x" ; then
 
1525
        AC_MSG_ERROR([ar is needed to build wxWidgets])
 
1526
    fi
 
1527
fi
 
1528
 
 
1529
dnl install checks
 
1530
dnl   defines INSTALL with the appropriate command
 
1531
AC_PROG_INSTALL
 
1532
 
 
1533
dnl   make install path absolute (if not already);
 
1534
dnl   will fail with (some) MSDOS paths
 
1535
case ${INSTALL} in
 
1536
  /* ) # Absolute
 
1537
     ;;
 
1538
  ?:* ) # Drive letter, considered as absolute.
 
1539
     ;;
 
1540
  *)
 
1541
     INSTALL=`pwd`/${INSTALL} ;;
 
1542
esac
 
1543
 
 
1544
retest_macosx_linking=no
 
1545
 
 
1546
dnl Support the old --enable-universal_binary in case anyone was using it.
 
1547
#if test "$wxUSE_MAC" = 1; then
 
1548
    if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then
 
1549
        dnl --enable-universal_binary uses a default SDK (currently 10.4u)
 
1550
        dnl --enable-universal_binary=SDK names a path to an SDK
 
1551
        if test "x$wxUSE_UNIVERSAL_BINARY" == xyes; then
 
1552
            # Implicitly turn on the new --with-macosx-sdk using the default
 
1553
            # SDK which provides the behavior this option has always had.
 
1554
            if test "x$wxUSE_MACOSX_SDK" = "x"; then
 
1555
                AC_MSG_WARN([Enabling default SDK due to --enable-universal_binary.])
 
1556
                AC_MSG_WARN([If you don't want this, specify --without-macosx-sdk])
 
1557
                wxUSE_MACOSX_SDK=yes
 
1558
            fi
 
1559
        else
 
1560
            # Complain to user if he specified an argument to --enable-universal_binary
 
1561
            # and also 1) specified --with-macosx-sdk using the default (yes) or
 
1562
            # 2) specified --with-macosx-sdk using a path or 3) specified
 
1563
            # --without-macosx-sdk (no).
 
1564
            if test "x$wxUSE_MACOSX_SDK" != "x" ; then
 
1565
                AC_MSG_FAILURE([Please specify the new --with-macosx-sdk=PATH and do not specify an arg to --enable-universal_binary])
 
1566
            else
 
1567
                # Put the SDK path into the wxUSE_MACOSX_SDK.  We don't have to
 
1568
                # special-case the empty string because the below test simply
 
1569
                # converts "no" to the empty string anyway.
 
1570
                wxUSE_MACOSX_SDK="$wxUSE_UNIVERSAL_BINARY"
 
1571
                dnl Warn about deprecated usage.
 
1572
                AC_MSG_WARN([Please use --with-macosx-sdk=PATH and --enable-universal_binary without an argument])
 
1573
            fi
 
1574
        fi
 
1575
        dnl FIXME: I think it would be better to put this into CC, CXX, and LD rather than the flags.
 
1576
        OSX_UNIV_OPTS="-arch ppc -arch i386"
 
1577
        CXXFLAGS="$OSX_UNIV_OPTS $CXXFLAGS"
 
1578
        CFLAGS="$OSX_UNIV_OPTS $CFLAGS"
 
1579
        OBJCXXFLAGS="$OSX_UNIV_OPTS $OBJCXXFLAGS"
 
1580
        OBJCFLAGS="$OSX_UNIV_OPTS $OBJCFLAGS"
 
1581
        LDFLAGS="$OSX_UNIV_OPTS $LDFLAGS"
 
1582
        dnl NOTE: Only the compiler driver needs arch flags.  The link editor
 
1583
        dnl is incapable of using them but the compiler driver (which we use
 
1584
        dnl as LD when building dynamic libraries) uses them to invoke the
 
1585
        dnl real ld multiple times.  If we moved to libtool -dynamic we would
 
1586
        dnl need no arch flags because libtool automatically invokes ld for
 
1587
        dnl every architecture found in the fat input files.
 
1588
        dnl
 
1589
        dnl For static library builds, AR/RANLIB automatically create proper
 
1590
        dnl fat archives although AR is unable to update them once RANLIB has
 
1591
        dnl made them into proper fat archives.  Fortunately, our link process
 
1592
        dnl simply removes the .a file before using ar to create a new one.
 
1593
        dnl If we did move to libtool -static we still wouldn't need arch flags
 
1594
        dnl because libtool automatically figures it out based on input.
 
1595
        retest_macosx_linking=yes
 
1596
 
 
1597
        dnl HACK: PCH could be made to work by precompiling for each architecture into separate directories
 
1598
        dnl and including all architecture directories with each compiler invocation.
 
1599
        dnl That would require a major rework of Bakefile and at the same time it would be nice to have
 
1600
        dnl Objective-C++ precompiled headers.
 
1601
        AC_MSG_WARN([Disabling precompiled headers due to universal binary build.])
 
1602
        bk_use_pch=no
 
1603
    fi
 
1604
#fi
 
1605
 
 
1606
dnl Set up the Mac OS X SDK.  We do this early so configure tests will occur
 
1607
dnl with the SDK in place.
 
1608
dnl NOTE: We clobber wxUSE_MACOSX_SDK with the SDK path
 
1609
if test "x$wxUSE_MACOSX_SDK" = "xno"; then
 
1610
    wxUSE_MACOSX_SDK=
 
1611
elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then
 
1612
    # TODO: Search for most recent SDK and use it.
 
1613
    wxUSE_MACOSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
 
1614
fi
 
1615
 
 
1616
 
 
1617
if test "x$wxUSE_MACOSX_SDK" != "x"; then
 
1618
    AC_MSG_CHECKING([for SDK directory $wxUSE_MACOSX_SDK])
 
1619
    if ! test -d "$wxUSE_MACOSX_SDK"; then
 
1620
        AC_MSG_FAILURE([not found])
 
1621
    else
 
1622
        AC_MSG_RESULT([exists])
 
1623
    fi
 
1624
    MACOSX_SDK_OPTS="-isysroot $wxUSE_MACOSX_SDK"
 
1625
    eval "CC=\"$CC $MACOSX_SDK_OPTS\""
 
1626
    eval "CXX=\"$CXX $MACOSX_SDK_OPTS\""
 
1627
    eval "LD=\"$LD $MACOSX_SDK_OPTS\""
 
1628
    retest_macosx_linking=yes
 
1629
    dnl NOTE: When libtool is used in lieu of AR/RANLIB (i.e. in static mode)
 
1630
    dnl the syslibroot makes no difference.  We aren't using libtool now but
 
1631
    dnl if we ever did, be aware that you don't need to worry about it.
 
1632
fi
 
1633
 
 
1634
dnl Set up the deployment target
 
1635
dnl No   : Don't specify a min version even if using an SDK
 
1636
dnl Yes  : Use the version from the SDK if used, otherwise same as no
 
1637
dnl Param: Use the specified version
 
1638
if test "x$wxUSE_MACOSX_VERSION_MIN" = "xno"; then
 
1639
    wxUSE_MACOSX_VERSION_MIN=
 
1640
elif test "x$wxUSE_MACOSX_VERSION_MIN" = "xyes"; then
 
1641
    if test "x$wxUSE_MACOSX_SDK" != "x"; then
 
1642
        AC_MSG_CHECKING([SDK deployment version])
 
1643
dnl We need to quote the next line where we don't need macros and do need [] in the regex
 
1644
[
 
1645
        MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" buildSettings | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
 
1646
]
 
1647
        # If that failed, try again with the new key
 
1648
        if test "x$MACOSX_SDK_PLIST_VERSION_MIN" == "x"; then
 
1649
[
 
1650
            MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" DefaultProperties | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
 
1651
]
 
1652
        fi
 
1653
 
 
1654
        if test "x$MACOSX_SDK_PLIST_VERSION_MIN" != "x"; then
 
1655
            wxUSE_MACOSX_VERSION_MIN=$MACOSX_SDK_PLIST_VERSION_MIN
 
1656
            AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
 
1657
        else
 
1658
            AC_MSG_WARN([Could not determine deployment target from SDKSettings.plist])
 
1659
            wxUSE_MACOSX_VERSION_MIN=
 
1660
        fi
 
1661
    else
 
1662
        wxUSE_MACOSX_VERSION_MIN=
 
1663
    fi
 
1664
fi
 
1665
 
 
1666
if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then
 
1667
    MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN"
 
1668
    eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\""
 
1669
    eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\""
 
1670
    eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\""
 
1671
    retest_macosx_linking=yes
 
1672
fi
 
1673
 
 
1674
dnl If either an SDK or a version option was added, make sure that we can
 
1675
dnl still compile and link both C and C++.  If we didn't do this, then most
 
1676
dnl of the remaining tests would fail.
 
1677
if test "x$retest_macosx_linking" = "xyes"; then
 
1678
    AC_LANG_PUSH(C)
 
1679
    AC_MSG_CHECKING([if C compiler works with SDK/version options])
 
1680
    AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no.  Try a different SDK]); exit 1])
 
1681
    AC_LANG_POP()
 
1682
 
 
1683
    AC_LANG_PUSH(C++)
 
1684
    AC_MSG_CHECKING([if C++ compiler works with SDK/version options])
 
1685
    AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no.  Try a different SDK]); exit 1])
 
1686
    AC_LANG_POP()
 
1687
fi
 
1688
 
 
1689
 
 
1690
case "${host}" in
 
1691
 
 
1692
    dnl The other BSD's should probably go in here too, since this is
 
1693
    dnl to workaround a strange static lib BSDism.
 
1694
    dnl Mac OS X install seems to ignore -p option...
 
1695
    *-*-darwin* )
 
1696
        INSTALL_PROGRAM="cp -fp"
 
1697
        INSTALL_DATA="cp -fp"
 
1698
        ;;
 
1699
    *)
 
1700
        ;;
 
1701
esac
 
1702
 
 
1703
dnl strip command
 
1704
dnl   defines STRIP as strip or nothing (true) if not found
 
1705
AC_CHECK_TOOL(STRIP, strip, true)
 
1706
 
 
1707
dnl Win32 tools
 
1708
if test "$wxUSE_WINE" = "yes"; then
 
1709
    AC_CHECK_TOOL(WINDRES, wrc)
 
1710
    RESCOMP="$WINDRES"
 
1711
else
 
1712
    case "${host}" in
 
1713
    *-*-cygwin* | *-*-mingw32* )
 
1714
        dnl Bakefile CVS (as of 2005-11-24) now detects windres properly
 
1715
        dnl ... maybe it does, but it does not make it available here
 
1716
        dnl anymore, so do it ourselves still.
 
1717
        AC_CHECK_TOOL(WINDRES, windres)
 
1718
        RESCOMP="$WINDRES"
 
1719
        AC_CHECK_TOOL(DLLTOOL, dlltool)
 
1720
        ;;
 
1721
    esac
 
1722
fi
 
1723
 
 
1724
dnl does make support "-include" (only GNU make does AFAIK)?
 
1725
AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu,
 
1726
[
 
1727
    if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null |
 
1728
            $EGREP -s GNU > /dev/null); then
 
1729
        wx_cv_prog_makeisgnu="yes"
 
1730
    else
 
1731
        wx_cv_prog_makeisgnu="no"
 
1732
    fi
 
1733
])
 
1734
 
 
1735
if test "x$wx_cv_prog_makeisgnu" = "xyes"; then
 
1736
    IF_GNU_MAKE=""
 
1737
else
 
1738
    IF_GNU_MAKE="#"
 
1739
fi
 
1740
 
 
1741
AC_SUBST(IF_GNU_MAKE)
 
1742
 
 
1743
dnl we don't need to check for VPATH support in GNU make - it does have it
 
1744
if test "x$wx_cv_prog_makeisgnu" != "xyes"; then
 
1745
dnl check if VPATH works
 
1746
AC_CACHE_CHECK([if make supports VPATH], wx_cv_prog_makevpath, [
 
1747
dnl create Makefile
 
1748
cat - << EOF > confMake
 
1749
check : file
 
1750
        cp \$? \$@
 
1751
        cp \$? final_file
 
1752
EOF
 
1753
 
 
1754
if test ! -d sub ; then
 
1755
  mkdir sub
 
1756
fi
 
1757
echo dummy > sub/file
 
1758
${MAKE-make} -f confMake VPATH=sub 2>&5 > /dev/null
 
1759
RESULT=$?
 
1760
rm -f sub/file check final_file confMake
 
1761
rmdir sub
 
1762
if test "$RESULT" = 0; then
 
1763
  wx_cv_prog_makevpath="yes"
 
1764
else
 
1765
  wx_cv_prog_makevpath="no"
 
1766
fi
 
1767
])
 
1768
 
 
1769
if test "x$wx_cv_prog_makevpath" != "xyes"; then
 
1770
AC_MSG_ERROR([
 
1771
You need a make-utility that is able to use the variable
 
1772
VPATH correctly.
 
1773
If your version of make does not support VPATH correctly,
 
1774
please install GNU-make (possibly as gmake), and start
 
1775
configure with the following command:
 
1776
export MAKE=gmake; ./configure  for sh-type shells
 
1777
setenv MAKE gmake; ./configure  for csh-type shells
 
1778
Also please do remember to use gmake in this case every time
 
1779
you are trying to compile.
 
1780
])
 
1781
fi dnl make without VPATH
 
1782
fi dnl not GNU make
 
1783
 
 
1784
dnl needed for making link to setup.h
 
1785
AC_PROG_LN_S
 
1786
 
 
1787
 
 
1788
dnl ------------------------------------------------------------------------
 
1789
dnl Platform specific tests
 
1790
dnl ------------------------------------------------------------------------
 
1791
 
 
1792
dnl xlC needs -qunique under AIX so that one source file can be
 
1793
dnl compiled to multiple object files and safely linked together.
 
1794
if test "x$XLCXX" = "xyes" -a "x$USE_AIX" = "x1"; then
 
1795
    CXXFLAGS="-qunique $CXXFLAGS"
 
1796
fi
 
1797
 
 
1798
dnl This case is for PowerPC OS X vs. everything else
 
1799
case "${host}" in
 
1800
  powerpc-*-darwin* )
 
1801
    AC_MSG_CHECKING([if __POWERPC__ is already defined])
 
1802
    AC_TRY_COMPILE([],[#ifndef __POWERPC__
 
1803
        choke me for lack of PowerPC
 
1804
#endif
 
1805
],
 
1806
        [AC_MSG_RESULT([yes])],
 
1807
        [AC_MSG_RESULT([no])
 
1808
        AC_DEFINE(__POWERPC__)
 
1809
    ])
 
1810
  ;;
 
1811
esac
 
1812
 
 
1813
dnl This case is for OS X vs. everything else
 
1814
case "${host}" in
 
1815
  *-*-darwin* )
 
1816
    AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
 
1817
    AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
 
1818
],[],
 
1819
        [AC_MSG_RESULT([yes])],
 
1820
        [AC_MSG_RESULT([no])
 
1821
        AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required])
 
1822
        AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
 
1823
#include <CoreFoundation/CFBase.h>
 
1824
        ],[],
 
1825
        [AC_MSG_RESULT([yes])
 
1826
        dnl We must use -D so source files that don't include wx/setup.h
 
1827
        dnl but do include CFBase will work.
 
1828
        CPPFLAGS="-D__CF_USE_FRAMEWORK_INCLUDES__ $CPPFLAGS"],
 
1829
        [AC_MSG_FAILURE([no.  CoreFoundation not available.])]
 
1830
        )
 
1831
        ]
 
1832
    )
 
1833
  ;;
 
1834
esac
 
1835
 
 
1836
dnl Determine whether we want to use Cygwin as Windows or POSIX platform: the
 
1837
dnl latter makes more sense for wxGTK/Motif/X11 ports
 
1838
wants_win32=0
 
1839
doesnt_want_win32=0
 
1840
case "${host}" in
 
1841
  *-*-cygwin*)
 
1842
      if test "$wxUSE_MSW" = 1 ; then
 
1843
        wants_win32=1
 
1844
      else
 
1845
        dnl when we use cygwin compiler with -mno-cygwin option it uses mingw32
 
1846
        dnl headers and libraries, so it's Windows-like in this case
 
1847
        AC_CACHE_CHECK([if -mno-cygwin is in effect], wx_cv_nocygwin,
 
1848
            [
 
1849
                AC_TRY_COMPILE(
 
1850
                    [],
 
1851
                    [
 
1852
                        #ifdef __MINGW32__
 
1853
                            choke me
 
1854
                        #endif
 
1855
                    ],
 
1856
                    wx_cv_nocygwin=no,
 
1857
                    wx_cv_nocygwin=yes
 
1858
                )
 
1859
            ]
 
1860
        )
 
1861
 
 
1862
        if test "$wx_cv_nocygwin" = "yes"; then
 
1863
            wants_win32=1
 
1864
        else
 
1865
            doesnt_want_win32=1
 
1866
        fi
 
1867
      fi
 
1868
      if test "$wants_win32" = 1 ; then
 
1869
        BAKEFILE_FORCE_PLATFORM=win32
 
1870
      fi
 
1871
  ;;
 
1872
  *-*-mingw*)
 
1873
      wants_win32=1
 
1874
  ;;
 
1875
esac
 
1876
 
 
1877
if test "$wxUSE_WINE" = "yes"; then
 
1878
    wants_win32=1
 
1879
    LDFLAGS_GUI="-mwindows"
 
1880
fi
 
1881
 
 
1882
dnl NB: The two tests bellow are *NOT* mutually exclusive! They should only
 
1883
dnl     take effect on Cygwin/Mingw and not other platforms.
 
1884
if test "$wants_win32" = 1 ; then
 
1885
    USE_UNIX=0
 
1886
    USE_WIN32=1
 
1887
    AC_DEFINE(__WIN32__)
 
1888
    AC_DEFINE(__WIN95__)
 
1889
    AC_DEFINE(__WINDOWS__)
 
1890
    AC_DEFINE(__GNUWIN32__)
 
1891
    AC_DEFINE(STRICT)
 
1892
fi
 
1893
if test "$doesnt_want_win32" = 1 ; then
 
1894
    USE_UNIX=1
 
1895
    USE_WIN32=0
 
1896
fi
 
1897
dnl (end of Windows-only piece)
 
1898
 
 
1899
if test "$USE_UNIX" = 1 ; then
 
1900
    wxUSE_UNIX=yes
 
1901
    AC_DEFINE(__UNIX__)
 
1902
fi
 
1903
 
 
1904
dnl This case is for OS/2 vs. everything else
 
1905
case "${host}" in
 
1906
  *-pc-os2_emx | *-pc-os2-emx )
 
1907
      dnl ---------------------------------------------------------------------
 
1908
      dnl When we are using gcc on OS/2, we want to be either using resources
 
1909
      dnl (PM) or a more complete POSIX emulation for Motif/GTK+/X11.
 
1910
      dnl Moreover we need to link explicitly against either stdcpp.a or
 
1911
      dnl stdcxx.a (depending on compiler version), since we are using "gcc",
 
1912
      dnl not "g++/c++".
 
1913
      dnl ---------------------------------------------------------------------
 
1914
      dnl (OS/2-only piece)
 
1915
      if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
 
1916
          dnl More complete Unix emulation for unix-like ports
 
1917
          dnl by linking in POSIX/2's cExt (if available).
 
1918
          AC_CHECK_LIB(cExt, drand48, LIBS="$LIBS -lcExt")
 
1919
      else
 
1920
          dnl Include resources for the "native" port (wxPM).
 
1921
          RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res"
 
1922
      fi
 
1923
      dnl Check for the gcc version (and thereby for the C runtime library).
 
1924
      dnl wx_cv_gccversion = EMX2 -> Standard EMX environment
 
1925
      dnl wx_cv_gccversion = EMX3 -> EMX with gcc-3.0.3 or gcc-3.2.1
 
1926
      dnl wx_cv_gccversion = Innotek5 -> gcc-3.2.2 with Innotek libc5
 
1927
      dnl wx_cv_gccversion = Innotek6 -> gcc-3.3.5 with Innotek libc6.
 
1928
      AC_CACHE_CHECK([for gcc/libc version], wx_cv_gccversion,[
 
1929
          AC_TRY_RUN(
 
1930
              dnl Check the gcc version macro.
 
1931
              [
 
1932
                  #include <stdio.h>
 
1933
 
 
1934
                  int main()
 
1935
                  {
 
1936
                      FILE *f=fopen("conftestval", "w");
 
1937
                      if (!f) exit(1);
 
1938
                      fprintf(f,
 
1939
                  #if (__GNUC__ < 3)
 
1940
                              "EMX2"
 
1941
                  #elif (__GNUC__==3) && ((__GNUC_MINOR__ < 2) || ((__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__<2)))
 
1942
                              "EMX3"
 
1943
                  #elif (__GNUC__==3) && (__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__==2)
 
1944
                              "Innotek5"
 
1945
                  #else
 
1946
                              "Innotek6"
 
1947
                  #endif
 
1948
                      );
 
1949
                      exit(0);
 
1950
                  }
 
1951
              ],
 
1952
              wx_cv_gccversion=`cat conftestval`,
 
1953
              wx_cv_gccversion="EMX2",
 
1954
              dnl Compilation error: Assuming standard EMX environment
 
1955
              wx_cv_gccversion="EMX2"
 
1956
          )
 
1957
      ])
 
1958
      if test "$wx_cv_gccversion" = "EMX2"; then
 
1959
          LIBS="$LIBS -lstdcpp"
 
1960
          LDFLAGS="$LDFLAGS -Zsysv-signals"
 
1961
      else
 
1962
          if test "$wx_cv_gccversion" = "EMX3"; then
 
1963
              LIBS="$LIBS -lstdcxx -lgcc"
 
1964
              LDFLAGS="$LDFLAGS -Zsysv-signals"
 
1965
          else
 
1966
              LIBS="$LIBS -lstdc++"
 
1967
          fi
 
1968
      fi
 
1969
      if test "$wxUSE_SHARED" = "yes" -a "$wxUSE_OMF" = "no"; then
 
1970
        AC_MSG_WARN([Building DLLs requires OMF mode, enabled])
 
1971
        wxUSE_OMF=yes
 
1972
        enable_omf=yes
 
1973
      fi
 
1974
      dnl (end of OS/2-only piece)
 
1975
  ;;
 
1976
  *)
 
1977
      dnl ---------------------------------------------------------------------
 
1978
      dnl look for strcasecmp() in string.h and then strings.h if it's not
 
1979
      dnl there. Don't do this on OS/2, where "stricmp" is the function to be
 
1980
      dnl used.
 
1981
      dnl ---------------------------------------------------------------------
 
1982
      dnl (non-OS/2-only piece)
 
1983
 
 
1984
      AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
 
1985
          AC_TRY_LINK([
 
1986
              #include <string.h>
 
1987
              ],
 
1988
              [
 
1989
                  strcasecmp("foo", "bar");
 
1990
              ],
 
1991
              ac_cv_string_strcasecmp=yes,
 
1992
              ac_cv_string_strcasecmp=no
 
1993
          )
 
1994
      ])
 
1995
 
 
1996
      if test x"$ac_cv_string_strcasecmp" = "xyes"; then
 
1997
          AC_DEFINE(HAVE_STRCASECMP_IN_STRING_H)
 
1998
      else
 
1999
          AC_CACHE_CHECK([for strcasecmp() in strings.h], ac_cv_strings_strcasecmp, [
 
2000
              AC_TRY_LINK([
 
2001
                  #include <strings.h>
 
2002
                  ],
 
2003
                  [
 
2004
                      strcasecmp("foo", "bar");
 
2005
                  ],
 
2006
                  ac_cv_strings_strcasecmp=yes,
 
2007
                  ac_cv_strings_strcasecmp=no
 
2008
              )
 
2009
          ])
 
2010
 
 
2011
          if test x"$ac_cv_strings_strcasecmp" = "xyes"; then
 
2012
              AC_DEFINE(HAVE_STRCASECMP_IN_STRINGS_H)
 
2013
          else
 
2014
              AC_MSG_ERROR([No case-insensitive string comparison function found.])
 
2015
          fi
 
2016
      fi
 
2017
 
 
2018
      dnl (end of non-OS/2-only piece)
 
2019
  ;;
 
2020
esac
 
2021
 
 
2022
dnl ------------------------------------------------------------------------
 
2023
dnl Check for headers
 
2024
dnl ------------------------------------------------------------------------
 
2025
 
 
2026
dnl Note: non-empty last parameter makes check compile-only,
 
2027
dnl   skipping worthless preprocessing check
 
2028
AC_CHECK_HEADERS(stdlib.h fnmatch.h langinfo.h malloc.h unistd.h wchar.h,,, [AC_INCLUDES_DEFAULT()])
 
2029
 
 
2030
dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
 
2031
if test "$ac_cv_header_wchar_h" != "yes"; then
 
2032
    AC_CHECK_HEADERS(wcstr.h,,, [AC_INCLUDES_DEFAULT()])
 
2033
fi
 
2034
 
 
2035
case "${host}" in
 
2036
  *-pc-os2_emx | *-pc-os2-emx )
 
2037
      dnl Explicitly link -lintl if langinfo.h is available
 
2038
      dnl and intl not yet included in libc
 
2039
      if test $ac_cv_header_langinfo_h = "yes" \
 
2040
                -a \(   "$wx_cv_gccversion" = "EMX2" \
 
2041
                     -o "$wx_cv_gccversion" = "EMX3" \
 
2042
                     -o "$wx_cv_gccversion" = "Innotek5" \); then
 
2043
          LIBS="$LIBS -lintl"
 
2044
      fi
 
2045
  ;;
 
2046
esac
 
2047
 
 
2048
dnl POSIX needs this for select(), but old systems don't have it
 
2049
if test "$USE_UNIX" = 1 ; then
 
2050
    AC_CHECK_HEADERS([sys/select.h],,, [AC_INCLUDES_DEFAULT()])
 
2051
fi
 
2052
 
 
2053
dnl ---------------------------------------------------------------------------
 
2054
dnl Checks for compiler characteristics
 
2055
dnl ---------------------------------------------------------------------------
 
2056
 
 
2057
dnl defines const to be empty if c-compiler does not support const fully
 
2058
AC_C_CONST
 
2059
dnl defines inline to a sensible value for the c-compiler
 
2060
AC_C_INLINE
 
2061
 
 
2062
dnl check the sizes of integral types (give some reasonable default values for
 
2063
dnl cross-compiling)
 
2064
dnl   defines the size of certain types of variables in SIZEOF_<TYPE>
 
2065
AC_CHECK_SIZEOF(char, 1)
 
2066
AC_CHECK_SIZEOF(short, 2)
 
2067
AC_CHECK_SIZEOF(void *, 4)
 
2068
AC_CHECK_SIZEOF(int, 4)
 
2069
AC_CHECK_SIZEOF(long, 4)
 
2070
AC_CHECK_SIZEOF(size_t, 4)
 
2071
 
 
2072
case "${host}" in
 
2073
    arm-*-linux* )
 
2074
        AC_CHECK_SIZEOF(long long, 8)
 
2075
    ;;
 
2076
    *-hp-hpux* )
 
2077
        AC_CHECK_SIZEOF(long long, 0)
 
2078
        if test "$ac_cv_sizeof_long_long" != "0"; then
 
2079
            dnl HPUX 10.20 headers need this define in order to use long long definitions
 
2080
            CPPFLAGS="-D_INCLUDE_LONGLONG $CPPFLAGS"
 
2081
        fi
 
2082
    ;;
 
2083
    * )
 
2084
        AC_CHECK_SIZEOF(long long, 0)
 
2085
esac
 
2086
 
 
2087
dnl SGI/Irix's stdio.h does not include wchar_t. Mac OS X does not provide
 
2088
dnl wchar.h and wchar_t is defined by stdlib.h (GD)
 
2089
AC_CHECK_SIZEOF(wchar_t, 0,
 
2090
    [
 
2091
        /* DJGPP's wchar_t is now a keyword in C++ (still not C though) */
 
2092
        #if defined(__DJGPP__) && !( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 )
 
2093
        #  error "fake wchar_t"
 
2094
        #endif
 
2095
        #ifdef HAVE_WCHAR_H
 
2096
        #  ifdef __CYGWIN__
 
2097
        #    include <stddef.h>
 
2098
        #  endif
 
2099
        #  include <wchar.h>
 
2100
        #endif
 
2101
        #ifdef HAVE_STDLIB_H
 
2102
        #  include <stdlib.h>
 
2103
        #endif
 
2104
        #include <stdio.h>
 
2105
    ]
 
2106
)
 
2107
if test "$ac_cv_sizeof_wchar_t" != "0"; then
 
2108
    wxUSE_WCHAR_T=yes
 
2109
else
 
2110
    wxUSE_WCHAR_T=no
 
2111
fi
 
2112
 
 
2113
dnl checks needed to define wxVaCopy
 
2114
AC_CACHE_CHECK([for va_copy],
 
2115
    wx_cv_func_va_copy,
 
2116
    [
 
2117
        AC_LANG_PUSH(C++)
 
2118
        AC_LINK_IFELSE([
 
2119
            #include <stdarg.h>
 
2120
            void foo(char *f, ...)
 
2121
            {
 
2122
                va_list ap1, ap2;
 
2123
                va_start(ap1, f);
 
2124
                va_copy(ap2, ap1);
 
2125
                va_end(ap2);
 
2126
                va_end(ap1);
 
2127
            }
 
2128
            int main()
 
2129
            {
 
2130
                foo("hi", 17);
 
2131
                return 0;
 
2132
            }],
 
2133
            wx_cv_func_va_copy=yes,
 
2134
            wx_cv_func_va_copy=no
 
2135
        )
 
2136
        AC_LANG_POP()
 
2137
    ]
 
2138
)
 
2139
 
 
2140
if test $wx_cv_func_va_copy = "yes"; then
 
2141
    AC_DEFINE(HAVE_VA_COPY)
 
2142
else
 
2143
    dnl try to understand how can we copy va_lists
 
2144
    AC_CACHE_CHECK([if va_list can be copied by value],
 
2145
        wx_cv_type_va_list_lvalue,
 
2146
        [
 
2147
            AC_RUN_IFELSE([
 
2148
                #include <stdarg.h>
 
2149
                int foo(char *f, ...)
 
2150
                {
 
2151
                    va_list ap1, ap2;
 
2152
                    va_start(ap1, f);
 
2153
                    ap2 = ap1;
 
2154
                    if ( va_arg(ap1, int) != 17 || va_arg(ap2, int) != 17 )
 
2155
                        return 1;
 
2156
                    va_end(ap2);
 
2157
                    va_end(ap1);
 
2158
                    return 0;
 
2159
                }
 
2160
                int main()
 
2161
                {
 
2162
                    return foo("hi", 17);
 
2163
                }],
 
2164
                wx_cv_type_va_list_lvalue=yes,
 
2165
                wx_cv_type_va_list_lvalue=no,
 
2166
                dnl assume most common case for cross-compiling...
 
2167
                wx_cv_type_va_list_lvalue=yes
 
2168
            )
 
2169
        ]
 
2170
    )
 
2171
 
 
2172
    if test $wx_cv_type_va_list_lvalue != "yes"; then
 
2173
        dnl we suppose that the only thing which can't be copied like this
 
2174
        dnl are arrays... only experience will show whether this is really true
 
2175
        AC_DEFINE(VA_LIST_IS_ARRAY)
 
2176
    fi
 
2177
fi
 
2178
 
 
2179
dnl don't check for vararg macros if they're explicitly disabled: this is
 
2180
dnl useful if the user code using the library wants to limit itself to standard
 
2181
dnl C++ only (e.g. is compiled with g++ -std=c++98)
 
2182
if test "$wxUSE_VARARG_MACROS" = "yes"; then
 
2183
 
 
2184
dnl Check if variadic macros (C99 feature) are supported:
 
2185
AC_CACHE_CHECK(
 
2186
    [whether the compiler supports variadic macros],
 
2187
    [wx_cv_have_variadic_macros],
 
2188
    [
 
2189
        dnl C compiler might support variadic macros when C++ one doesn't
 
2190
        dnl (happens with gcc/g++ 2.95.4), so must use C++ one explicitly
 
2191
        AC_LANG_PUSH(C++)
 
2192
        AC_COMPILE_IFELSE(
 
2193
            AC_LANG_PROGRAM(
 
2194
                [
 
2195
                    #include <stdio.h>
 
2196
                    #define test(fmt, ...) printf(fmt, __VA_ARGS__)
 
2197
                ],
 
2198
                [
 
2199
                    test("%s %d %p", "test", 1, 0);
 
2200
                ]
 
2201
            ),
 
2202
            [wx_cv_have_variadic_macros=yes],
 
2203
            [wx_cv_have_variadic_macros=no]
 
2204
            )
 
2205
        AC_LANG_POP()
 
2206
    ]
 
2207
)
 
2208
 
 
2209
if test $wx_cv_have_variadic_macros = "yes"; then
 
2210
    AC_DEFINE(HAVE_VARIADIC_MACROS)
 
2211
fi
 
2212
 
 
2213
fi dnl wxUSE_VARARG_MACROS == yes
 
2214
 
 
2215
dnl check for large file support
 
2216
AC_SYS_LARGEFILE
 
2217
 
 
2218
dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command
 
2219
dnl line because otherwise the system headers risk being included before
 
2220
dnl wx/defs.h which defines these constants leading to inconsistent
 
2221
dnl sizeof(off_t) in different source files of the same program and linking
 
2222
dnl problems
 
2223
if test "x$wx_largefile" = "xyes"; then
 
2224
    if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
 
2225
        WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
 
2226
 
 
2227
        dnl We get "Large Files (ILP32) not supported in strict ANSI mode."
 
2228
        dnl #error from HP standard headers unless __STDC_EXT__ is defined.
 
2229
        dnl The compiler should define it automatically, but some old g++
 
2230
        dnl versions don't define it, so test and add it if necessary. AFAIK
 
2231
        dnl the problem only affects the C++ compiler so it is added to
 
2232
        dnl CXXFLAGS only.
 
2233
        if test "$USE_HPUX" = 1 -a "$GXX" = "yes"; then
 
2234
            AC_CACHE_CHECK(
 
2235
                [if -D__STDC_EXT__ is required],
 
2236
                wx_cv_STDC_EXT_required,
 
2237
                [
 
2238
                    AC_LANG_PUSH(C++)
 
2239
                    AC_TRY_COMPILE(
 
2240
                        [],
 
2241
                        [
 
2242
                            #ifndef __STDC_EXT__
 
2243
                                choke me
 
2244
                            #endif
 
2245
                        ],
 
2246
                        wx_cv_STDC_EXT_required=no,
 
2247
                        wx_cv_STDC_EXT_required=yes
 
2248
                    )
 
2249
                    AC_LANG_POP()
 
2250
                ]
 
2251
            )
 
2252
            if test "x$wx_cv_STDC_EXT_required" = "xyes"; then
 
2253
                WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -D__STDC_EXT__"
 
2254
            fi
 
2255
        fi
 
2256
    else
 
2257
        WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGE_FILES"
 
2258
    fi
 
2259
    dnl AC_FUNC_FSEEKO sets HAVE_FSEEKO and $ac_cv_sys_largefile_source
 
2260
    AC_FUNC_FSEEKO
 
2261
    if test "$ac_cv_sys_largefile_source" != no; then
 
2262
        WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
 
2263
    fi
 
2264
fi
 
2265
 
 
2266
dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
 
2267
WX_C_BIGENDIAN
 
2268
 
 
2269
dnl check for iostream (as opposed to iostream.h) standard header
 
2270
WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
 
2271
 
 
2272
dnl check whether C++ compiler supports bool built-in type
 
2273
WX_CPP_BOOL
 
2274
 
 
2275
dnl check whether C++ compiler supports explicit keyword
 
2276
WX_CPP_EXPLICIT
 
2277
 
 
2278
dnl check whether C++ compiler supports C++ casts
 
2279
AC_CXX_CONST_CAST
 
2280
AC_CXX_REINTERPRET_CAST
 
2281
AC_CXX_STATIC_CAST
 
2282
dnl we don't use HAVE_DYNAMIC_CAST anywhere right now...
 
2283
dnl AC_CXX_DYNAMIC_CAST
 
2284
 
 
2285
dnl With Sun CC, temporaries have block scope by default. This flag is needed
 
2286
dnl to get the expression scope behaviour that conforms to the standard.
 
2287
if test "x$SUNCXX" = xyes; then
 
2288
    CXXFLAGS="-features=tmplife $CXXFLAGS"
 
2289
fi
 
2290
 
 
2291
dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do
 
2292
dnl was to hack their C++ compiler to accept them silently -- but C compiler
 
2293
dnl still spits out dozens of warnings for each X include file, so suppress
 
2294
dnl them
 
2295
if test "x$SUNCC" = xyes; then
 
2296
    CFLAGS="-erroff=E_NO_EXPLICIT_TYPE_GIVEN $CFLAGS"
 
2297
fi
 
2298
 
 
2299
dnl SGI mipsPro compiler version 7.4.4 and later (and maybe some earlier
 
2300
dnl versions too but it's known that 7.4 doesn't give this warning) gives this
 
2301
dnl warning for "conversion from pointer to same-sized integral type" even when
 
2302
dnl there is an explicit cast and as there is no way to turn it off and there
 
2303
dnl are hundreds of these warnings in wx sources, just turn it off for now
 
2304
dnl
 
2305
dnl a better long term solution would be to use #pragma set/reset woff in
 
2306
dnl wxPtrToUInt() and use it instead of casts elsewhere
 
2307
if test "x$SGICC" = "xyes"; then
 
2308
    AC_CACHE_CHECK([if cc version is 7.4.4 or greater],
 
2309
        wx_cv_prog_sgicc744,
 
2310
        [
 
2311
            AC_TRY_COMPILE([],
 
2312
                [
 
2313
                    #if _SGI_COMPILER_VERSION >= 744
 
2314
                    chock me: mipsPro is 7.4.4 or later
 
2315
                    #endif
 
2316
                ],
 
2317
                wx_cv_prog_sgicc744=no,
 
2318
                wx_cv_prog_sgicc744=yes
 
2319
            )
 
2320
        ]
 
2321
    )
 
2322
 
 
2323
    if test "x$wx_cv_prog_sgicc744" = "xyes"; then
 
2324
        CFLAGS="-woff 3970 $CFLAGS"
 
2325
    fi
 
2326
fi
 
2327
if test "x$SGICXX" = "xyes"; then
 
2328
    AC_CACHE_CHECK([if CC version is 7.4.4 or greater],
 
2329
        wx_cv_prog_sgicxx744,
 
2330
        [
 
2331
            AC_LANG_PUSH(C++)
 
2332
            AC_TRY_COMPILE([],
 
2333
                [
 
2334
                    #if _SGI_COMPILER_VERSION >= 744
 
2335
                    chock me: mipsPro is 7.4.4 or later
 
2336
                    #endif
 
2337
                ],
 
2338
                wx_cv_prog_sgicxx744=no,
 
2339
                wx_cv_prog_sgicxx744=yes
 
2340
            )
 
2341
            AC_LANG_POP()
 
2342
        ]
 
2343
    )
 
2344
 
 
2345
    if test "x$wx_cv_prog_sgicxx744" = "xyes"; then
 
2346
        CXXFLAGS="-woff 3970 $CXXFLAGS"
 
2347
    fi
 
2348
fi
 
2349
 
 
2350
dnl HP-UX c89/aCC compiler warnings
 
2351
if test "x$HPCC" = "xyes"; then
 
2352
    dnl 2011: "unrecognized preprocessor directive": nice warning but it's given
 
2353
    dnl       even for directives inside #if which is not true (i.e. which are
 
2354
    dnl       used for other compilers/OS) and so we have no way to get rid of it
 
2355
    dnl 2450: "long long is non standard" -- yes, we know
 
2356
    CFLAGS="+W 2011,2450 $CFLAGS"
 
2357
fi
 
2358
if test "x$HPCXX" = "xyes"; then
 
2359
    dnl 2340: "value copied to temporary, reference to temporary used": very
 
2360
    dnl       painful as triggered by any occurrence of user-defined conversion
 
2361
    CXXFLAGS="+W 2340 $CXXFLAGS"
 
2362
fi
 
2363
 
 
2364
dnl DEC/Compaq/HP cxx warnings
 
2365
if test "x$COMPAQCXX" = "xyes"; then
 
2366
    dnl -w0 enables all warnings, then we disable some of them:
 
2367
    dnl basclsnondto: base class dtor non virtual (sometimes we do want this)
 
2368
    dnl unrimpret:  "end of routine block may be unreachable" is given for
 
2369
    dnl             every "if ( ) return ...; else return ...;"
 
2370
    dnl intconlosbit: "conversion to integral type of smaller size could lose
 
2371
    dnl               data" this is a useful warning but there are too many of
 
2372
    dnl               them for now
 
2373
    CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit $CXXFLAGS"
 
2374
fi
 
2375
 
 
2376
dnl the next few tests are all for C++ features and so need to be done using
 
2377
dnl C++ compiler
 
2378
AC_LANG_PUSH(C++)
 
2379
 
 
2380
dnl check for std::string or std::wstring
 
2381
if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then
 
2382
    if test "$wxUSE_UNICODE" = "yes"; then
 
2383
        std_string="std::wstring"
 
2384
        char_type="wchar_t"
 
2385
    else
 
2386
        std_string="std::string"
 
2387
        char_type="char"
 
2388
    fi
 
2389
 
 
2390
    dnl check if <string> declares std::[w]string
 
2391
    AC_CACHE_CHECK([for $std_string in <string>],
 
2392
        wx_cv_class_stdstring,
 
2393
        [
 
2394
            AC_TRY_COMPILE([#include <string>],
 
2395
                [$std_string foo;],
 
2396
                wx_cv_class_stdstring=yes,
 
2397
                wx_cv_class_stdstring=no
 
2398
            )
 
2399
        ]
 
2400
    )
 
2401
 
 
2402
    if test "$wx_cv_class_stdstring" = yes; then
 
2403
        if test "$wxUSE_UNICODE" = "yes"; then
 
2404
            AC_DEFINE(HAVE_STD_WSTRING)
 
2405
        fi
 
2406
        dnl we don't need HAVE_STD_STRING, we just suppose it's available if
 
2407
        dnl wxUSE_STD_STRING==yes
 
2408
    else
 
2409
        AC_CACHE_CHECK([if std::basic_string<$char_type> works],
 
2410
            wx_cv_class_stdbasicstring,
 
2411
            [
 
2412
                AC_TRY_COMPILE([
 
2413
                    #ifdef HAVE_WCHAR_H
 
2414
                    #  ifdef __CYGWIN__
 
2415
                    #    include <stddef.h>
 
2416
                    #  endif
 
2417
                    #  include <wchar.h>
 
2418
                    #endif
 
2419
                    #ifdef HAVE_STDLIB_H
 
2420
                    #  include <stdlib.h>
 
2421
                    #endif
 
2422
                    #include <stdio.h>
 
2423
                    #include <string>
 
2424
                    ],
 
2425
                    [std::basic_string<$char_type> foo;
 
2426
                     const $char_type* dummy = foo.c_str();],
 
2427
                    wx_cv_class_stdbasicstring=yes,
 
2428
                    wx_cv_class_stdbasicstring=no
 
2429
                )
 
2430
            ]
 
2431
        )
 
2432
 
 
2433
        if test "$wx_cv_class_stdbasicstring" != yes; then
 
2434
            if test "$wxUSE_STL" = "yes"; then
 
2435
                AC_MSG_ERROR([Can't use --enable-stl without $std_string or std::basic_string<$char_type>])
 
2436
            elif grep wxUSE_STD_STRING $wx_arg_cache_file >/dev/null; then
 
2437
                AC_MSG_ERROR([Can't use --enable-std_string without $std_string or std::basic_string<$char_type>])
 
2438
            else
 
2439
                AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string])
 
2440
                wxUSE_STD_STRING=no
 
2441
            fi
 
2442
        fi
 
2443
    fi
 
2444
fi
 
2445
 
 
2446
if test "$wxUSE_STD_IOSTREAM" = "yes"; then
 
2447
    AC_CHECK_TYPES([std::istream, std::ostream],,
 
2448
                   [wxUSE_STD_IOSTREAM=no],
 
2449
                   [#include <iostream>])
 
2450
 
 
2451
    if test "$wxUSE_STD_IOSTREAM" != "yes"; then
 
2452
        if grep wxUSE_STD_IOSTREAM $wx_arg_cache_file >/dev/null; then
 
2453
            AC_MSG_ERROR([Can't use --enable-std_iostreams without std::istream and std::ostream])
 
2454
        else
 
2455
            AC_MSG_WARN([No std::iostreams, switching to --disable-std_iostreams])
 
2456
        fi
 
2457
    fi
 
2458
fi
 
2459
 
 
2460
if test "$wxUSE_STL" = "yes"; then
 
2461
    dnl check for basic STL functionality
 
2462
    AC_CACHE_CHECK([for basic STL functionality],
 
2463
        wx_cv_lib_stl,
 
2464
        [AC_TRY_COMPILE([#include <string>
 
2465
            #include <functional>
 
2466
            #include <algorithm>
 
2467
            #include <vector>
 
2468
            #include <list>],
 
2469
            [std::vector<int> moo;
 
2470
             std::list<int> foo;
 
2471
             std::vector<int>::iterator it =
 
2472
                 std::find_if(moo.begin(), moo.end(),
 
2473
                              std::bind2nd(std::less<int>(), 3));],
 
2474
            wx_cv_lib_stl=yes,
 
2475
            wx_cv_lib_stl=no
 
2476
        )]
 
2477
    )
 
2478
 
 
2479
    if test "$wx_cv_lib_stl" != yes; then
 
2480
         AC_MSG_ERROR([Can't use --enable-stl as basic STL functionality is missing])
 
2481
    fi
 
2482
 
 
2483
    dnl check for compliant std::string::compare
 
2484
    AC_CACHE_CHECK([for compliant std::string::compare],
 
2485
        wx_cv_func_stdstring_compare,
 
2486
        [AC_TRY_COMPILE([#include <string>],
 
2487
            [std::string foo, bar;
 
2488
            foo.compare(bar);
 
2489
            foo.compare(1, 1, bar);
 
2490
            foo.compare(1, 1, bar, 1, 1);
 
2491
            foo.compare("");
 
2492
            foo.compare(1, 1, "");
 
2493
            foo.compare(1, 1, "", 2);],
 
2494
            wx_cv_func_stdstring_compare=yes,
 
2495
            wx_cv_func_stdstring_compare=no
 
2496
        )]
 
2497
    )
 
2498
 
 
2499
    if test "$wx_cv_func_stdstring_compare" = yes; then
 
2500
        AC_DEFINE(HAVE_STD_STRING_COMPARE)
 
2501
    fi
 
2502
 
 
2503
    dnl check for hash_map and hash_set headers
 
2504
    AC_CHECK_HEADER([hash_map],
 
2505
        [AC_CACHE_CHECK([for standard hash_map and hash_set],
 
2506
            wx_cv_class_stdhashmapset,
 
2507
            [AC_TRY_COMPILE([#include <hash_map>
 
2508
                #include <hash_set>],
 
2509
                [std::hash_map<double*, char*, std::hash<double*>, std::equal_to<double*> > test1;
 
2510
                 std::hash_set<char*, std::hash<char*>, std::equal_to<char*> > test2;],
 
2511
                wx_cv_class_stdhashmapset=yes,
 
2512
                wx_cv_class_stdhashmapset=no)
 
2513
            ]
 
2514
        )],
 
2515
        [],
 
2516
        [ ]
 
2517
    )
 
2518
 
 
2519
    if test "$wx_cv_class_stdhashmapset" = yes; then
 
2520
        AC_DEFINE(HAVE_HASH_MAP)
 
2521
        AC_DEFINE(HAVE_STD_HASH_MAP)
 
2522
    fi
 
2523
 
 
2524
    AC_CHECK_HEADER([ext/hash_map],
 
2525
        [AC_CACHE_CHECK([for GNU hash_map and hash_set],
 
2526
            wx_cv_class_gnuhashmapset,
 
2527
            [AC_TRY_COMPILE([#include <ext/hash_map>
 
2528
                #include <ext/hash_set>],
 
2529
                [__gnu_cxx::hash_map<double*, char*, __gnu_cxx::hash<double*>, std::equal_to<double*> > test1;
 
2530
                 __gnu_cxx::hash_set<char*, __gnu_cxx::hash<char*>, std::equal_to<char*> > test2;],
 
2531
                wx_cv_class_gnuhashmapset=yes,
 
2532
                wx_cv_class_gnuhashmapset=no)
 
2533
            ]
 
2534
        )],
 
2535
        [],
 
2536
        [ ]
 
2537
    )
 
2538
 
 
2539
    if test "$wx_cv_class_gnuhashmapset" = yes; then
 
2540
         AC_DEFINE(HAVE_EXT_HASH_MAP)
 
2541
         AC_DEFINE(HAVE_GNU_CXX_HASH_MAP)
 
2542
    fi
 
2543
 
 
2544
    AC_CHECK_HEADER([unordered_map],
 
2545
        [AC_CACHE_CHECK([for unordered_map and unordered_set in std],
 
2546
            wx_cv_class_stdunorderedmapset,
 
2547
            [AC_TRY_COMPILE([#include <unordered_map>
 
2548
                #include <unordered_set>],
 
2549
                [std::unordered_map<double*, char*> test1;
 
2550
                 std::unordered_set<char*> test2;],
 
2551
                wx_cv_class_stdunorderedmapset=yes,
 
2552
                wx_cv_class_stdunorderedmapset=no)
 
2553
            ]
 
2554
        )],
 
2555
        [],
 
2556
        [ ]
 
2557
    )
 
2558
 
 
2559
    if test "$wx_cv_class_stdunorderedmapset" = yes; then
 
2560
         AC_DEFINE(HAVE_STD_UNORDERED_MAP)
 
2561
         AC_DEFINE(HAVE_STD_UNORDERED_SET)
 
2562
    else
 
2563
        AC_CHECK_HEADER([tr1/unordered_map],
 
2564
            [AC_CACHE_CHECK([for unordered_map and unordered_set in std::tr1],
 
2565
                wx_cv_class_tr1unorderedmapset,
 
2566
                [AC_TRY_COMPILE([#include <tr1/unordered_map>
 
2567
                    #include <tr1/unordered_set>],
 
2568
                    [std::tr1::unordered_map<double*, char*> test1;
 
2569
                     std::tr1::unordered_set<char*> test2;
 
2570
            #if defined(__GNUC__) && (__GNUC__==4) && (__GNUC_MINOR__<2)
 
2571
            #error can't use unordered_{map,set} with gcc-4.[01]: http://gcc.gnu.org/PR24389
 
2572
            #endif],
 
2573
                    wx_cv_class_tr1unorderedmapset=yes,
 
2574
                    wx_cv_class_tr1unorderedmapset=no)
 
2575
                ]
 
2576
            )],
 
2577
            [],
 
2578
            [ ]
 
2579
        )
 
2580
 
 
2581
        if test "$wx_cv_class_tr1unorderedmapset" = yes; then
 
2582
            AC_DEFINE(HAVE_TR1_UNORDERED_MAP)
 
2583
            AC_DEFINE(HAVE_TR1_UNORDERED_SET)
 
2584
        else
 
2585
            dnl check for hash_map and hash_set headers
 
2586
            AC_CHECK_HEADER([hash_map],
 
2587
                [AC_CACHE_CHECK([for std::hash_map and hash_set],
 
2588
                    wx_cv_class_stdhashmapset,
 
2589
                    [AC_TRY_COMPILE([#include <hash_map>
 
2590
                        #include <hash_set>],
 
2591
                        [std::hash_map<double*, char*, std::hash<double*>, std::equal_to<double*> > test1;
 
2592
                         std::hash_set<char*, std::hash<char*>, std::equal_to<char*> > test2;],
 
2593
                        wx_cv_class_stdhashmapset=yes,
 
2594
                        wx_cv_class_stdhashmapset=no)
 
2595
                    ]
 
2596
                )],
 
2597
                [],
 
2598
                [ ]
 
2599
            )
 
2600
 
 
2601
            if test "$wx_cv_class_stdhashmapset" = yes; then
 
2602
                AC_DEFINE(HAVE_HASH_MAP)
 
2603
                AC_DEFINE(HAVE_STD_HASH_MAP)
 
2604
            fi
 
2605
 
 
2606
            AC_CHECK_HEADER([ext/hash_map],
 
2607
                [AC_CACHE_CHECK([for GNU hash_map and hash_set],
 
2608
                    wx_cv_class_gnuhashmapset,
 
2609
                    [AC_TRY_COMPILE([#include <ext/hash_map>
 
2610
                        #include <ext/hash_set>],
 
2611
                        [__gnu_cxx::hash_map<double*, char*, __gnu_cxx::hash<double*>, std::equal_to<double*> > test1;
 
2612
                         __gnu_cxx::hash_set<char*, __gnu_cxx::hash<char*>, std::equal_to<char*> > test2;],
 
2613
                        wx_cv_class_gnuhashmapset=yes,
 
2614
                        wx_cv_class_gnuhashmapset=no)
 
2615
                    ]
 
2616
                )],
 
2617
                [],
 
2618
                [ ]
 
2619
            )
 
2620
 
 
2621
        fi
 
2622
    fi
 
2623
fi
 
2624
 
 
2625
dnl pop C++
 
2626
AC_LANG_POP()
 
2627
 
 
2628
dnl ---------------------------------------------------------------------------
 
2629
dnl Define search path for includes and libraries: all headers and libs will be
 
2630
dnl looked for in all directories of this path
 
2631
dnl ---------------------------------------------------------------------------
 
2632
 
 
2633
dnl Notice that /usr/include should *not* be in this list, otherwise it breaks
 
2634
dnl compilation on Solaris/AIX/... with gcc because standard (non ANSI C)
 
2635
dnl headers are included instead of the "fixed" (ANSI-fied) gcc ones.
 
2636
dnl
 
2637
dnl Also try to put all directories which may contain X11R6 before those which
 
2638
dnl may contain X11R5/4 - we want to use R6 on machines which have both!
 
2639
dnl
 
2640
dnl In the same vein. Motif 2.1 should be tried before Motif 1.2 for the
 
2641
dnl systems which have both (AIX 4.x does)
 
2642
SEARCH_INCLUDE="\
 
2643
    /usr/local/include        \
 
2644
    /usr/local/X11/include    \
 
2645
    /usr/local/include/X11    \
 
2646
    /usr/local/X11R6/include  \
 
2647
    /usr/local/include/X11R6  \
 
2648
                              \
 
2649
    /usr/Motif-2.1/include    \
 
2650
    /usr/Motif-1.2/include    \
 
2651
    /usr/include/Motif1.2     \
 
2652
                              \
 
2653
    /usr/dt/include           \
 
2654
    /usr/openwin/include      \
 
2655
                              \
 
2656
    /usr/include/Xm           \
 
2657
                              \
 
2658
    /usr/X11R6/include        \
 
2659
    /usr/X11R6.4/include      \
 
2660
                              \
 
2661
    /usr/include/X11R6        \
 
2662
                              \
 
2663
    /usr/X11/include          \
 
2664
    /usr/include/X11          \
 
2665
                              \
 
2666
    /usr/XFree86/include/X11  \
 
2667
    /usr/pkg/include          \
 
2668
                              \
 
2669
    /usr/local/X1R5/include  \
 
2670
    /usr/local/include/X11R5  \
 
2671
    /usr/X11R5/include        \
 
2672
    /usr/include/X11R5        \
 
2673
                              \
 
2674
    /usr/local/X11R4/include  \
 
2675
    /usr/local/include/X11R4  \
 
2676
    /usr/X11R4/include        \
 
2677
    /usr/include/X11R4        \
 
2678
                              \
 
2679
    /usr/openwin/share/include"
 
2680
 
 
2681
dnl try to find out the standard lib locations for the systems with multiple
 
2682
dnl ABIs
 
2683
AC_MSG_CHECKING([for libraries directory])
 
2684
 
 
2685
case "${host}" in
 
2686
    *-*-irix6* )
 
2687
        AC_CACHE_VAL(
 
2688
            wx_cv_std_libpath,
 
2689
            [
 
2690
                for d in WX_STD_LIBPATH(); do
 
2691
                    for e in a so sl dylib dll.a; do
 
2692
                        libc="$d/libc.$e"
 
2693
                        if test -f $libc; then
 
2694
                            save_LIBS="$LIBS"
 
2695
                            LIBS="$libc"
 
2696
                            AC_LINK_IFELSE([int main() { return 0; }],
 
2697
                                wx_cv_std_libpath=`echo $d | sed s@/usr/@@`)
 
2698
                            LIBS="$save_LIBS"
 
2699
                            if test "x$wx_cv_std_libpath" != "x"; then
 
2700
                                break 2
 
2701
                            fi
 
2702
                        fi
 
2703
                    done
 
2704
                done
 
2705
                if test "x$wx_cv_std_libpath" = "x"; then
 
2706
                    wx_cv_std_libpath="lib"
 
2707
                fi
 
2708
            ]
 
2709
        )
 
2710
        ;;
 
2711
 
 
2712
    *-*-solaris2* )
 
2713
        dnl use ../lib or ../lib/64 depending on the size of void*
 
2714
        if test "$ac_cv_sizeof_void_p" = 8 -a -d "/usr/lib/64"; then
 
2715
            wx_cv_std_libpath="lib/64"
 
2716
        else
 
2717
            wx_cv_std_libpath="lib"
 
2718
        fi
 
2719
        ;;
 
2720
 
 
2721
    *-*-linux* )
 
2722
        dnl use ../lib or ../lib64 depending on the size of void*
 
2723
        if test "$ac_cv_sizeof_void_p" = 8 -a \
 
2724
                -d "/usr/lib64" -a ! -h "/usr/lib64"; then
 
2725
            wx_cv_std_libpath="lib64"
 
2726
        else
 
2727
            wx_cv_std_libpath="lib"
 
2728
        fi
 
2729
        ;;
 
2730
 
 
2731
    *)
 
2732
        wx_cv_std_libpath="lib";
 
2733
        ;;
 
2734
esac
 
2735
 
 
2736
AC_MSG_RESULT($wx_cv_std_libpath)
 
2737
 
 
2738
SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` /usr/$wx_cv_std_libpath"
 
2739
 
 
2740
dnl Cross compiling with gcc?
 
2741
if test "$build" != "$host" -a "$GCC" = yes; then
 
2742
    dnl for gcc cross-compilers "$CC -print-prog-name=ld" prints the path to
 
2743
    dnl the linker. Stripping off the trailing '/bin/ld' gives us a candiate
 
2744
    dnl for a 'root' below which libraries and headers for the target system
 
2745
    dnl might be installed.
 
2746
    if cross_root=`$CC -print-prog-name=ld 2>/dev/null`; then
 
2747
        cross_root=`dirname $cross_root`
 
2748
        cross_root=`dirname $cross_root`
 
2749
 
 
2750
        dnl substitute this candiate root for '^/usr' in the search lists,
 
2751
        dnl strip out any that don't start '^/usr'.
 
2752
        SEARCH_LIB=`for x in $SEARCH_LIB; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"`
 
2753
        SEARCH_INCLUDE=`for x in $SEARCH_INCLUDE; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"`
 
2754
        SEARCH_INCLUDE="$SEARCH_INCLUDE $cross_root/include"
 
2755
 
 
2756
        dnl also have pkg-config search for *.pc files under this 'root'
 
2757
        if test -z "$PKG_CONFIG_PATH"; then
 
2758
            PKG_CONFIG_PATH="$cross_root/local/lib/pkgconfig:$cross_root/lib/pkgconfig"
 
2759
            export PKG_CONFIG_PATH
 
2760
        fi
 
2761
 
 
2762
        dnl AC_PATH_XTRA doesn't work currently unless -x-includes and
 
2763
        dnl -x-libraries are given on the command line. So if they are not
 
2764
        dnl set then set them here to plausible defaults.
 
2765
        if test -z "$x_includes" -o "$x_includes" = NONE; then
 
2766
            WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, X11/Intrinsic.h)
 
2767
            x_includes=$ac_find_includes
 
2768
        fi
 
2769
        if test -z "$x_libraries" -o "$x_libraries" = NONE; then
 
2770
            WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xt)
 
2771
            x_libraries=$ac_find_libraries
 
2772
        fi
 
2773
    fi
 
2774
fi
 
2775
 
 
2776
dnl ------------------------------------------------------------------------
 
2777
dnl Check for libraries
 
2778
dnl ------------------------------------------------------------------------
 
2779
 
 
2780
dnl flush the cache because checking for libraries below might abort
 
2781
AC_CACHE_SAVE
 
2782
 
 
2783
dnl check for glibc version
 
2784
dnl
 
2785
dnl VZ: I have no idea why had this check been there originally, but now
 
2786
dnl     we could probably do without it by just always adding _GNU_SOURCE
 
2787
if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then
 
2788
    AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[
 
2789
        AC_TRY_COMPILE([#include <features.h>],
 
2790
            [
 
2791
                #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1)
 
2792
                not glibc 2.1
 
2793
                #endif
 
2794
            ],
 
2795
            [
 
2796
                wx_cv_lib_glibc21=yes
 
2797
            ],
 
2798
            [
 
2799
                wx_cv_lib_glibc21=no
 
2800
            ]
 
2801
        )
 
2802
    ])
 
2803
    if test "$wx_cv_lib_glibc21" = "yes"; then
 
2804
        AC_DEFINE(wxHAVE_GLIBC2)
 
2805
    fi
 
2806
fi
 
2807
 
 
2808
dnl we may need _GNU_SOURCE for 2 things:
 
2809
dnl
 
2810
dnl  1. to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+ (strictly speaking we
 
2811
dnl  only need _XOPEN_SOURCE=500 but just defining this disables _BSD_SOURCE
 
2812
dnl  which breaks libtiff compilation, so it is simpler to just define
 
2813
dnl  _GNU_SOURCE to get everything)
 
2814
dnl
 
2815
dnl  2. for Unicode functions
 
2816
if test "x$wx_cv_lib_glibc21" = "xyes"; then
 
2817
    if test "$wxUSE_UNICODE" = "yes" -o "$wxUSE_THREADS" = "yes"; then
 
2818
        AC_DEFINE(_GNU_SOURCE)
 
2819
    fi
 
2820
fi
 
2821
 
 
2822
dnl Only add the -lm library if floating point functions cannot be used
 
2823
dnl without it.  This check is important on cygwin because of the bizarre
 
2824
dnl way that they have organized functions into libraries.  On cygwin, both
 
2825
dnl libc.a and libm.a are symbolic links to a single lib libcygwin.a.  This
 
2826
dnl means that
 
2827
dnl   1) linking with -lm is not necessary, and
 
2828
dnl   2) linking with -lm is dangerous if the order of libraries is wrong
 
2829
dnl In particular, if you compile any program with -mno-cygwin and link with
 
2830
dnl -lm, it will crash instantly when it is run.  This happens because the
 
2831
dnl linker incorrectly links the Cygwin libm.a (==libcygwin.a), which replaces
 
2832
dnl the ___main function instead of allowing it to be defined by
 
2833
dnl /usr/lib/mingw/libmingw32.a as it should be.
 
2834
dnl
 
2835
dnl On MacOS X, this test will find that -lm is unnecessary and leave it out.
 
2836
dnl
 
2837
dnl Just check a few floating point functions. If they are all found without
 
2838
dnl -lm, then we must not need -lm.
 
2839
have_cos=0
 
2840
have_floor=0
 
2841
AC_CHECK_FUNCS(cos, have_cos=1)
 
2842
AC_CHECK_FUNCS(floor, have_floor=1)
 
2843
AC_MSG_CHECKING(if floating point functions link without -lm)
 
2844
if test "$have_cos" = 1 -a "$have_floor" = 1; then
 
2845
    AC_MSG_RESULT(yes)
 
2846
else
 
2847
    AC_MSG_RESULT(no)
 
2848
    LIBS="$LIBS -lm"
 
2849
    # use different functions to avoid configure caching
 
2850
    have_sin=0
 
2851
    have_ceil=0
 
2852
    AC_CHECK_FUNCS(sin, have_sin=1)
 
2853
    AC_CHECK_FUNCS(ceil, have_ceil=1)
 
2854
    AC_MSG_CHECKING(if floating point functions link with -lm)
 
2855
    if test "$have_sin" = 1 -a "$have_ceil" = 1; then
 
2856
        AC_MSG_RESULT(yes)
 
2857
    else
 
2858
        AC_MSG_RESULT(no)
 
2859
        # not sure we should warn the user, crash, etc.
 
2860
    fi
 
2861
fi
 
2862
 
 
2863
dnl check for C99 string to long long conversion functions, assume that if we
 
2864
dnl have the unsigned variants, then we have the signed ones as well
 
2865
dnl
 
2866
dnl at least under SGI these functions are only available in C99 code and not
 
2867
dnl in C++ so do these tests using C++ compiler
 
2868
AC_LANG_PUSH(C++)
 
2869
if test "$wxUSE_UNICODE" = "yes"; then
 
2870
    WX_CHECK_FUNCS(wcstoull,,,[#include <wchar.h>])
 
2871
else
 
2872
    WX_CHECK_FUNCS(strtoull)
 
2873
fi
 
2874
AC_LANG_POP()
 
2875
 
 
2876
dnl ---------------------------------------------------------------------------
 
2877
dnl Optional libraries
 
2878
dnl
 
2879
dnl   --with-<lib>=sys
 
2880
dnl       looks for system library and fails if not found
 
2881
dnl
 
2882
dnl   --with-<lib>
 
2883
dnl   --with-<lib>=yes
 
2884
dnl       looks for system library and, if not found, prints a warning,
 
2885
dnl       falls back to the builtin wx version, and continues configuration
 
2886
dnl
 
2887
dnl   --with-<lib>=builtin
 
2888
dnl       uses builtin wx version without searching for system library
 
2889
dnl
 
2890
dnl   --with-<lib>=no
 
2891
dnl   --without-<lib>
 
2892
dnl       do not use library (neither system nor builtin wx version)
 
2893
dnl
 
2894
dnl ---------------------------------------------------------------------------
 
2895
 
 
2896
dnl ------------------------------------------------------------------------
 
2897
dnl Check for regex libraries
 
2898
dnl ------------------------------------------------------------------------
 
2899
 
 
2900
if test "$wxUSE_REGEX" != "no"; then
 
2901
    AC_DEFINE(wxUSE_REGEX)
 
2902
 
 
2903
    if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_REGEX" = "yes"; then
 
2904
        AC_MSG_WARN([Defaulting to the the builtin regex library for Unicode build.])
 
2905
        wxUSE_REGEX=builtin
 
2906
    fi
 
2907
 
 
2908
    if test "$wxUSE_REGEX" = "sys" -o "$wxUSE_REGEX" = "yes" ; then
 
2909
        dnl according to Unix 98 specs, regcomp() is in libc but I believe that
 
2910
        dnl on some old systems it may be in libregex - check for it too?
 
2911
        AC_CHECK_HEADER(regex.h, [AC_CHECK_FUNCS(regcomp re_search)],, [ ])
 
2912
 
 
2913
        if test "x$ac_cv_func_regcomp" != "xyes"; then
 
2914
            if test "$wxUSE_REGEX" = "sys" ; then
 
2915
                AC_MSG_ERROR([system regex library not found! Use --with-regex to use built-in version])
 
2916
            else
 
2917
                AC_MSG_WARN([system regex library not found, will use built-in instead])
 
2918
                wxUSE_REGEX=builtin
 
2919
            fi
 
2920
        else
 
2921
            dnl we are using the system library
 
2922
            wxUSE_REGEX=sys
 
2923
            dnl only the built-in supports advanced REs
 
2924
            AC_DEFINE(WX_NO_REGEX_ADVANCED)
 
2925
        fi
 
2926
    fi
 
2927
fi
 
2928
 
 
2929
dnl ------------------------------------------------------------------------
 
2930
dnl Check for zlib compression library
 
2931
dnl ------------------------------------------------------------------------
 
2932
 
 
2933
ZLIB_LINK=
 
2934
if test "$wxUSE_ZLIB" != "no" ; then
 
2935
    AC_DEFINE(wxUSE_ZLIB)
 
2936
 
 
2937
    if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then
 
2938
        dnl don't test for zlib under Mac -- its verson there is 1.1.3 but we
 
2939
        dnl should still use it because hopefully (can someone confirm this?)
 
2940
        dnl Apple did fix the security problem in it and not using the system
 
2941
        dnl library results in a whole bunch of warnings when linking with
 
2942
        dnl Carbon framework
 
2943
        if test "$USE_DARWIN" = 1; then
 
2944
            system_zlib_h_ok="yes"
 
2945
        else
 
2946
            dnl we have troubles with ancient zlib versions (e.g. 1.0.4 is
 
2947
            dnl known to not work) and although I don't know which is
 
2948
            dnl the minimal required version it's safer to test for 1.1.4 as
 
2949
            dnl it fixes a security problem in 1.1.3 -- and hopefully nobody
 
2950
            dnl has anything more ancient (1.1.3 was released in July 1998)
 
2951
            dnl anyhow
 
2952
            AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h,
 
2953
                [AC_TRY_RUN(
 
2954
                    dnl zlib.h defines ZLIB_VERSION="x.y.z"
 
2955
                    [
 
2956
                        #include <zlib.h>
 
2957
                        #include <stdio.h>
 
2958
 
 
2959
                        int main()
 
2960
                        {
 
2961
                            FILE *f=fopen("conftestval", "w");
 
2962
                            if (!f) exit(1);
 
2963
                            fprintf(f, "%s",
 
2964
                                    ZLIB_VERSION[0] == '1' &&
 
2965
                                    (ZLIB_VERSION[2] > '1' ||
 
2966
                                    (ZLIB_VERSION[2] == '1' &&
 
2967
                                     ZLIB_VERSION[4] >= '4')) ? "yes" : "no");
 
2968
                            exit(0);
 
2969
                        }
 
2970
                    ],
 
2971
                    ac_cv_header_zlib_h=`cat conftestval`,
 
2972
                    ac_cv_header_zlib_h=no,
 
2973
                    dnl cross-compiling: don't have an answer, try later
 
2974
                    unset ac_cv_header_zlib_h
 
2975
                )]
 
2976
            )
 
2977
            dnl If the test above did not come up with a value (e.g. cross
 
2978
            dnl compiling) then this should give a definitive answer
 
2979
            AC_CHECK_HEADER(zlib.h,,, [ ])
 
2980
 
 
2981
            system_zlib_h_ok=$ac_cv_header_zlib_h
 
2982
        fi
 
2983
 
 
2984
        if test "$system_zlib_h_ok" = "yes"; then
 
2985
            AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz")
 
2986
        fi
 
2987
 
 
2988
        if test "x$ZLIB_LINK" = "x" ; then
 
2989
            if test "$wxUSE_ZLIB" = "sys" ; then
 
2990
                AC_MSG_ERROR([zlib library not found or too old! Use --with-zlib=builtin to use built-in version])
 
2991
            else
 
2992
                AC_MSG_WARN([zlib library not found or too old, will use built-in instead])
 
2993
                wxUSE_ZLIB=builtin
 
2994
            fi
 
2995
        else
 
2996
            dnl we are using the system library
 
2997
            wxUSE_ZLIB=sys
 
2998
        fi
 
2999
    fi
 
3000
fi
 
3001
 
 
3002
dnl ------------------------------------------------------------------------
 
3003
dnl Check for png library
 
3004
dnl ------------------------------------------------------------------------
 
3005
 
 
3006
PNG_LINK=
 
3007
if test "$wxUSE_LIBPNG" != "no" ; then
 
3008
    AC_DEFINE(wxUSE_LIBPNG)
 
3009
 
 
3010
    if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBPNG" = "builtin" ; then
 
3011
        AC_MSG_WARN([wxMGL doesn't work with builtin png library, will use MGL one instead])
 
3012
        wxUSE_LIBPNG=sys
 
3013
    fi
 
3014
 
 
3015
    dnl for the check below to have a chance to succeed, we must already have
 
3016
    dnl libz somewhere (don't do this when bulding wxMGL since its libpng
 
3017
    dnl doesn't depend on zlib)
 
3018
    if test "$wxUSE_MGL" != 1 -a "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then
 
3019
        AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead])
 
3020
        wxUSE_LIBPNG=builtin
 
3021
    fi
 
3022
 
 
3023
    if test "$wxUSE_MGL" != 1 ; then
 
3024
        dnl Don't check for libpng when building wxMGL, libmgl contains it
 
3025
        if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then
 
3026
            dnl libpng version 0.9 is known to not work, if an even newer
 
3027
            dnl version is required, just bump it up in the test below
 
3028
            AC_CACHE_CHECK([for png.h > 0.90], ac_cv_header_png_h,
 
3029
                [AC_TRY_RUN(
 
3030
                    dnl png.h defines PNG_LIBPNG_VER=number
 
3031
                    [
 
3032
                        #include <png.h>
 
3033
                        #include <stdio.h>
 
3034
 
 
3035
                        int main()
 
3036
                        {
 
3037
                            FILE *f=fopen("conftestval", "w");
 
3038
                            if (!f) exit(1);
 
3039
                            fprintf(f, "%s",
 
3040
                                     PNG_LIBPNG_VER > 90 ? "yes" : "no");
 
3041
                            exit(0);
 
3042
                        }
 
3043
                    ],
 
3044
                    ac_cv_header_png_h=`cat conftestval`,
 
3045
                    ac_cv_header_png_h=no,
 
3046
                    dnl cross-compiling: test (later) if we have any png.h
 
3047
                    unset ac_cv_header_png_h
 
3048
                )]
 
3049
            )
 
3050
            AC_CHECK_HEADER(png.h,,, [ ])
 
3051
 
 
3052
            if test "$ac_cv_header_png_h" = "yes"; then
 
3053
                AC_CHECK_LIB(png, png_sig_cmp, PNG_LINK=" -lpng -lz", , [-lz -lm])
 
3054
            fi
 
3055
 
 
3056
            if test "x$PNG_LINK" = "x" ; then
 
3057
                if test "$wxUSE_LIBPNG" = "sys" ; then
 
3058
                    AC_MSG_ERROR([system png library not found or too old! Use --with-libpng=builtin to use built-in version])
 
3059
                else
 
3060
                    AC_MSG_WARN([system png library not found or too old, will use built-in instead])
 
3061
                    wxUSE_LIBPNG=builtin
 
3062
                fi
 
3063
            else
 
3064
                dnl we are using the system library
 
3065
                wxUSE_LIBPNG=sys
 
3066
            fi
 
3067
        fi
 
3068
    fi
 
3069
 
 
3070
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png"
 
3071
fi
 
3072
 
 
3073
dnl ------------------------------------------------------------------------
 
3074
dnl Check for jpeg library
 
3075
dnl ------------------------------------------------------------------------
 
3076
 
 
3077
JPEG_LINK=
 
3078
if test "$wxUSE_LIBJPEG" != "no" ; then
 
3079
    AC_DEFINE(wxUSE_LIBJPEG)
 
3080
 
 
3081
    if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBJPEG" = "builtin" ; then
 
3082
        AC_MSG_WARN([wxMGL doesn't work with builtin jpeg library, will use MGL one instead])
 
3083
        wxUSE_LIBJPEG=sys
 
3084
    fi
 
3085
 
 
3086
    if test "$wxUSE_MGL" != 1 ; then
 
3087
        dnl Don't check for libjpeg when building wxMGL, libmgl contains it
 
3088
        if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then
 
3089
            dnl can't use AC_CHECK_HEADER as jconfig.h defines things like
 
3090
            dnl HAVE_STDLIB_H which are already defined and this provokes
 
3091
            dnl a compiler warning which configure considers as an error...
 
3092
            AC_MSG_CHECKING(for jpeglib.h)
 
3093
            AC_CACHE_VAL(ac_cv_header_jpeglib_h,
 
3094
                AC_TRY_COMPILE(
 
3095
                    [
 
3096
                        #undef HAVE_STDLIB_H
 
3097
                        #include <stdio.h>
 
3098
                        #include <jpeglib.h>
 
3099
                    ],
 
3100
                    [
 
3101
                    ],
 
3102
                    ac_cv_header_jpeglib_h=yes,
 
3103
                    ac_cv_header_jpeglib_h=no
 
3104
                )
 
3105
            )
 
3106
            AC_MSG_RESULT($ac_cv_header_jpeglib_h)
 
3107
 
 
3108
            if test "$ac_cv_header_jpeglib_h" = "yes"; then
 
3109
                AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg")
 
3110
            fi
 
3111
 
 
3112
            if test "x$JPEG_LINK" = "x" ; then
 
3113
                if test "$wxUSE_LIBJPEG" = "sys" ; then
 
3114
                    AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version])
 
3115
                else
 
3116
                    AC_MSG_WARN([system jpeg library not found, will use built-in instead])
 
3117
                    wxUSE_LIBJPEG=builtin
 
3118
                fi
 
3119
            else
 
3120
                dnl we are using the system library
 
3121
                wxUSE_LIBJPEG=sys
 
3122
 
 
3123
                if test "$wxUSE_MSW" = 1; then
 
3124
                    dnl boolean is defined by the jpeg headers and also by the
 
3125
                    dnl Windows headers of some compilers. This type has been
 
3126
                    dnl renamed in the builtin, so it is only an issue when
 
3127
                    dnl using an external jpeg lib on Windows.
 
3128
                    AC_CHECK_TYPES(
 
3129
                        [boolean],
 
3130
                        [
 
3131
                            AC_CHECK_SIZEOF(
 
3132
                                [boolean],
 
3133
                                [],
 
3134
                                [
 
3135
                                    #undef HAVE_BOOLEAN
 
3136
                                    #include <stdio.h>
 
3137
                                    #include <jpeglib.h>
 
3138
                                ])
 
3139
                            AC_DEFINE_UNQUOTED(
 
3140
                                [wxHACK_BOOLEAN],
 
3141
                                [wxInt`expr 8 \* $ac_cv_sizeof_boolean`])
 
3142
                        ],
 
3143
                        [],
 
3144
                        [#include <windows.h>])
 
3145
                fi
 
3146
            fi
 
3147
        fi
 
3148
    fi
 
3149
fi
 
3150
 
 
3151
dnl ------------------------------------------------------------------------
 
3152
dnl Check for tiff library
 
3153
dnl ------------------------------------------------------------------------
 
3154
 
 
3155
TIFF_LINK=
 
3156
TIFF_PREREQ_LINKS=-lm
 
3157
if test "$wxUSE_LIBTIFF" != "no" ; then
 
3158
    AC_DEFINE(wxUSE_LIBTIFF)
 
3159
 
 
3160
    if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then
 
3161
        dnl libtiff may depend on libjpeg and libz so use them in the test
 
3162
        dnl below or it would fail
 
3163
        if test "$wxUSE_LIBJPEG" = "sys"; then
 
3164
            TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK"
 
3165
        fi
 
3166
        if test "$wxUSE_ZLIB" = "sys"; then
 
3167
            TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK"
 
3168
        fi
 
3169
        AC_CHECK_HEADER(tiffio.h,
 
3170
                        [
 
3171
                            AC_CHECK_LIB(tiff, TIFFError,
 
3172
                                         TIFF_LINK=" -ltiff",
 
3173
                                         ,
 
3174
                                         $TIFF_PREREQ_LINKS)
 
3175
                        ],
 
3176
                        [],
 
3177
                        [ ]
 
3178
                       )
 
3179
 
 
3180
        if test "x$TIFF_LINK" = "x" ; then
 
3181
            if test "$wxUSE_LIBTIFF" = "sys" ; then
 
3182
                AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version])
 
3183
            else
 
3184
                AC_MSG_WARN([system tiff library not found, will use built-in instead])
 
3185
                wxUSE_LIBTIFF=builtin
 
3186
            fi
 
3187
        else
 
3188
            dnl we are using the system library
 
3189
            wxUSE_LIBTIFF=sys
 
3190
        fi
 
3191
    fi
 
3192
fi
 
3193
 
 
3194
dnl ------------------------------------------------------------------------
 
3195
dnl Check for expat libraries
 
3196
dnl ------------------------------------------------------------------------
 
3197
 
 
3198
if test "$wxUSE_WCHAR_T" != "yes"; then
 
3199
    if test "$wxUSE_EXPAT" != "no"; then
 
3200
        AC_MSG_WARN([wxWidgets requires wchar_t to use expat, disabling])
 
3201
        wxUSE_EXPAT=no
 
3202
    fi
 
3203
    if test "$wxUSE_XML" != "no"; then
 
3204
        AC_MSG_WARN([wxWidgets requires wchar_t to use xml, disabling])
 
3205
        wxUSE_XML=no
 
3206
    fi
 
3207
fi
 
3208
 
 
3209
if test "$wxUSE_EXPAT" != "no"; then
 
3210
    wxUSE_XML=yes
 
3211
    AC_DEFINE(wxUSE_EXPAT)
 
3212
    AC_DEFINE(wxUSE_XML)
 
3213
 
 
3214
    if test "$wxUSE_EXPAT" = "sys" -o "$wxUSE_EXPAT" = "yes" ; then
 
3215
        AC_CHECK_HEADER([expat.h], [found_expat_h=1],, [ ])
 
3216
        if test "x$found_expat_h" = "x1"; then
 
3217
            dnl Expat 1.95.6 comes with broken expat.h:
 
3218
            AC_CACHE_CHECK([if expat.h is valid C++ header],
 
3219
                wx_cv_expat_is_not_broken,
 
3220
                [
 
3221
                AC_LANG_PUSH(C++)
 
3222
                AC_TRY_COMPILE([#include <expat.h>],[],
 
3223
                    wx_cv_expat_is_not_broken=yes,
 
3224
                    wx_cv_expat_is_not_broken=no
 
3225
                )
 
3226
                AC_LANG_POP()
 
3227
                ]
 
3228
            )
 
3229
            if test "$wx_cv_expat_is_not_broken" = "yes" ; then
 
3230
                AC_CHECK_LIB(expat, XML_ParserCreate, EXPAT_LINK=" -lexpat")
 
3231
            fi
 
3232
        fi
 
3233
        if test "x$EXPAT_LINK" = "x" ; then
 
3234
            if test "$wxUSE_EXPAT" = "sys" ; then
 
3235
                AC_MSG_ERROR([system expat library not found! Use --with-expat=builtin to use built-in version])
 
3236
            else
 
3237
                AC_MSG_WARN([system expat library not found, will use built-in instead])
 
3238
                wxUSE_EXPAT=builtin
 
3239
            fi
 
3240
        else
 
3241
            dnl we are using the system library
 
3242
            wxUSE_EXPAT=sys
 
3243
        fi
 
3244
    fi
 
3245
    if test "$wxUSE_EXPAT" = "builtin" ; then
 
3246
        dnl Expat needs this:
 
3247
        AC_CONFIG_SUBDIRS([src/expat])
 
3248
    fi
 
3249
fi
 
3250
 
 
3251
 
 
3252
dnl ------------------------------------------------------------------------
 
3253
dnl Check for libmspack
 
3254
dnl ------------------------------------------------------------------------
 
3255
 
 
3256
if test "$wxUSE_LIBMSPACK" != "no"; then
 
3257
    AC_CHECK_HEADER([mspack.h], [found_mspack_h=1],, [ ])
 
3258
    if test "x$found_mspack_h" = "x1"; then
 
3259
        AC_CHECK_LIB(mspack, mspack_create_chm_decompressor,
 
3260
                     MSPACK_LINK=" -lmspack")
 
3261
    fi
 
3262
    if test "x$MSPACK_LINK" = "x" ; then
 
3263
        wxUSE_LIBMSPACK=no
 
3264
    fi
 
3265
fi
 
3266
 
 
3267
if test "$wxUSE_LIBMSPACK" != "no"; then
 
3268
    AC_DEFINE(wxUSE_LIBMSPACK)
 
3269
fi
 
3270
 
 
3271
 
 
3272
dnl ----------------------------------------------------------------
 
3273
dnl search for toolkit (widget sets)
 
3274
dnl ----------------------------------------------------------------
 
3275
 
 
3276
AFMINSTALL=
 
3277
WIN32INSTALL=
 
3278
 
 
3279
TOOLKIT=
 
3280
TOOLKIT_INCLUDE=
 
3281
WIDGET_SET=
 
3282
 
 
3283
dnl are we building for a win32 target environment?
 
3284
dnl If so, setup common stuff needed for both GUI and Base libs.
 
3285
if test "$USE_WIN32" = 1 ; then
 
3286
    AC_CHECK_HEADERS(w32api.h,,, [ ])
 
3287
    AC_CHECK_HEADER(windows.h,,
 
3288
    [
 
3289
        AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
 
3290
    ],
 
3291
    [ ])
 
3292
 
 
3293
    dnl --- FIXME: This is still a somewhat random list of libs,
 
3294
    dnl ---        some of them should probably be included conditionally.
 
3295
    case "${host}" in
 
3296
        x86_64-*-mingw32* )
 
3297
            dnl --- For mingw-w64 lctl3d32's name has changed
 
3298
            LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lwctl3d32 -ladvapi32 -lwsock32 -lgdi32"
 
3299
        ;;
 
3300
        * )
 
3301
            LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32"
 
3302
        ;;
 
3303
    esac
 
3304
    if test "$wxUSE_ACCESSIBILITY" = "yes" ; then
 
3305
        LIBS="$LIBS -loleacc"
 
3306
    fi
 
3307
 
 
3308
    case "${host}" in
 
3309
        *-*-cygwin* )
 
3310
            dnl Cygwin doesn't include these by default
 
3311
            LIBS="$LIBS -lkernel32 -luser32"
 
3312
    esac
 
3313
 
 
3314
    dnl add extra odbc libs if we have compiled in odbc
 
3315
    if test "$wxUSE_ODBC" = "sys" ; then
 
3316
        wxUSE_ODBC = "yes"
 
3317
    fi
 
3318
    if test "$wxUSE_ODBC" = "yes" ; then
 
3319
        LIBS=" -lodbc32 -lole32 -loleaut32 $LIBS"
 
3320
        AC_DEFINE(wxUSE_ODBC)
 
3321
    fi
 
3322
    dnl We might want to abort here if wxUSE_ODBC="builtin" isn't supported on msw.
 
3323
 
 
3324
    dnl This one is still used by some sample makefiles.
 
3325
    RESFLAGS="--include-dir \$(top_srcdir)/include --include-dir \$(top_srcdir)/\$(program_dir) --define __WIN32__ --define __WIN95__ --define __GNUWIN32__"
 
3326
    RESPROGRAMOBJ="\$(PROGRAM)_resources.o"
 
3327
 
 
3328
    dnl This lot we export to wx-config.  It must add the relevant
 
3329
    dnl include directories at the point when they can be known.
 
3330
    dnl (but are these (still) required anyway?)
 
3331
    WXCONFIG_RESFLAGS="--define __WIN32__ --define __WIN95__ --define __GNUWIN32__"
 
3332
 
 
3333
    dnl install Win32-specific files in "make install"
 
3334
    WIN32INSTALL=win32install
 
3335
 
 
3336
    dnl pbt.h is missing on Wine at least
 
3337
    AC_CHECK_HEADER(pbt.h,, [AC_DEFINE(NEED_PBT_H)], [ ])
 
3338
fi
 
3339
 
 
3340
if test "$wxUSE_GUI" = "yes"; then
 
3341
    USE_GUI=1
 
3342
 
 
3343
    GUI_TK_LIBRARY=
 
3344
 
 
3345
    WXGTK12=
 
3346
    WXGTK127=
 
3347
    WXGTK20=
 
3348
    WXGPE=
 
3349
 
 
3350
    if test "$wxUSE_COCOA" = 1 ; then
 
3351
        if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes"; then
 
3352
            AC_MSG_WARN([Printing not supported under wxCocoa yet, disabled])
 
3353
            wxUSE_PRINTING_ARCHITECTURE=no
 
3354
        fi
 
3355
        if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
 
3356
            AC_MSG_WARN([Drag and Drop not supported under wxCocoa yet, disabled])
 
3357
            wxUSE_DRAG_AND_DROP=no
 
3358
        fi
 
3359
        if test "$wxUSE_DRAGIMAGE" = "yes"; then
 
3360
            AC_MSG_WARN([Drag Image and DandD not supported under wxCocoa yet, disabled])
 
3361
            wxUSE_DRAGIMAGE=no
 
3362
        fi
 
3363
    fi
 
3364
 
 
3365
    if test "$wxUSE_MSW" = 1 ; then
 
3366
        TOOLKIT=MSW
 
3367
        GUIDIST=MSW_DIST
 
3368
 
 
3369
        dnl -mwindows causes a heap of other default gui libs to be linked in.
 
3370
        case "${host}" in
 
3371
            *-*-mingw32* )
 
3372
                WXCONFIG_LDFLAGS_GUI="$LDFLAGS -Wl,--subsystem,windows -mwindows"
 
3373
        esac
 
3374
    fi
 
3375
 
 
3376
    if test "$wxUSE_GTK" = 1; then
 
3377
        dnl GTK+ test program must be compiled with C compiler
 
3378
        AC_MSG_CHECKING([for GTK+ version])
 
3379
 
 
3380
        gtk_version_cached=1
 
3381
        AC_CACHE_VAL(wx_cv_lib_gtk,
 
3382
            [
 
3383
                dnl stupid GTK+ AM macros produce their own messages, so we
 
3384
                dnl have to pass to the next line
 
3385
                gtk_version_cached=0
 
3386
                AC_MSG_RESULT()
 
3387
 
 
3388
                dnl we must link against lgthread unless the user
 
3389
                dnl used --disable-threads
 
3390
                GTK_MODULES=
 
3391
                if test "$wxUSE_THREADS" = "yes"; then
 
3392
                    GTK_MODULES=gthread
 
3393
                fi
 
3394
 
 
3395
                dnl detect GTK2
 
3396
                wx_cv_lib_gtk=
 
3397
                if test "x$wxGTK_VERSION" != "x1"
 
3398
                then
 
3399
                    dnl The gthread.pc that ships with solaris returns '-mt',
 
3400
                    dnl it's correct for Sun CC, but gcc requires '-pthreads'.
 
3401
                    dnl So disable the compile check and remove the -mt below.
 
3402
                    case "${host}" in
 
3403
                        *-*-solaris2* )
 
3404
                            if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then
 
3405
                            enable_gtktest=no
 
3406
                            fi
 
3407
                    esac
 
3408
 
 
3409
                    AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
 
3410
 
 
3411
                    dnl Remove the '-mt' for gcc on solaris
 
3412
                    case "${host}" in
 
3413
                        *-*-solaris2* )
 
3414
                            if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then
 
3415
                                GTK_CFLAGS=`echo $GTK_CFLAGS | sed 's/-mt//'`
 
3416
                                GTK_LIBS=`echo $GTK_LIBS | sed 's/-mt//'`
 
3417
                            fi
 
3418
                            dnl solaris also requires -lX11 for static lib
 
3419
                            if test "$wxUSE_SHARED" != "yes"; then
 
3420
                                GTK_LIBS="$GTK_LIBS -lX11"
 
3421
                            fi
 
3422
                    esac
 
3423
                fi
 
3424
 
 
3425
                dnl detect GTK1.x
 
3426
                if test -z "$wx_cv_lib_gtk"; then
 
3427
                    if test "x$wxGTK_VERSION" = "x1" -o "x$wxGTK_VERSION" = "xany" ; then
 
3428
                        AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
 
3429
 
 
3430
                        if test -z "$wx_cv_lib_gtk"; then
 
3431
                            AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
 
3432
                        fi
 
3433
                    fi
 
3434
                fi
 
3435
 
 
3436
                if test -z "$wx_cv_lib_gtk"; then
 
3437
                    dnl looks better in AC_MSG_RESULT
 
3438
                    wx_cv_lib_gtk=none
 
3439
                else
 
3440
                    dnl we need to cache GTK_CFLAGS and GTK_LIBS for the
 
3441
                    dnl subsequent runs
 
3442
                    wx_cv_cflags_gtk=$GTK_CFLAGS
 
3443
                    wx_cv_libs_gtk=`echo $GTK_LIBS | sed -e 's/ -l[[^ ]]*cairo[[^ ]]*//g'`
 
3444
                fi
 
3445
            ]
 
3446
        )
 
3447
 
 
3448
        dnl if it wasn't cached, the messages from AM_PATH_GTK() above are
 
3449
        dnl enough
 
3450
        if test "$gtk_version_cached" = 1; then
 
3451
            AC_MSG_RESULT($wx_cv_lib_gtk)
 
3452
        fi
 
3453
 
 
3454
        case "$wx_cv_lib_gtk" in
 
3455
            2.0)    WXGTK20=1
 
3456
                    TOOLKIT_VERSION=2
 
3457
                    ;;
 
3458
            1.2.7)  WXGTK127=1
 
3459
                    WXGTK12=1
 
3460
                    ;;
 
3461
            1.2.3)  WXGTK12=1
 
3462
                    ;;
 
3463
            *)      AC_MSG_ERROR([
 
3464
The development files for GTK+ were not found. For GTK+ 2, please
 
3465
ensure that pkg-config is in the path and that gtk+-2.0.pc is
 
3466
installed. For GTK+ 1.2 please check that gtk-config is in the path,
 
3467
and that the version is 1.2.3 or above. Also check that the
 
3468
libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
 
3469
--libs' are in the LD_LIBRARY_PATH or equivalent.
 
3470
                            ])
 
3471
                    ;;
 
3472
        esac
 
3473
 
 
3474
        if test "$WXGTK20" = 1; then
 
3475
            save_CFLAGS="$CFLAGS"
 
3476
            save_LIBS="$LIBS"
 
3477
            CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
 
3478
            LIBS="$LIBS $wx_cv_libs_gtk"
 
3479
 
 
3480
            dnl gtk_icon_size_lookup is not available in the GTK+ headers
 
3481
            dnl that have shipped with some versions of Sun's JDS. Not using
 
3482
            dnl AC_CHECK_FUNCS here since it only checks the function exists
 
3483
            dnl in the lib (not the header).
 
3484
            AC_CHECK_DECLS([gtk_icon_size_lookup], [],
 
3485
                           [AC_DEFINE(NEED_GTK_ICON_SIZE_LOOKUP)],
 
3486
                           [#include <gtk/gtk.h>])
 
3487
 
 
3488
            dnl test if we have at least GTK+ 2.6:
 
3489
            AC_MSG_CHECKING([if GTK+ is version >= 2.6])
 
3490
            AC_TRY_COMPILE([
 
3491
                            #include <gtk/gtk.h>
 
3492
                           ],
 
3493
                           [
 
3494
                            #if !GTK_CHECK_VERSION(2,6,0)
 
3495
                            Not GTK+ 2.6
 
3496
                            #endif
 
3497
                           ],
 
3498
                           [
 
3499
                            AC_DEFINE(__WXGTK26__)
 
3500
                            AC_DEFINE(__WXGTK24__)
 
3501
                            AC_MSG_RESULT([yes])
 
3502
                            ac_wxgtk26=1
 
3503
                           ],
 
3504
                           [
 
3505
                            AC_MSG_RESULT([no])
 
3506
                            ac_wxgtk26=0
 
3507
                           ])
 
3508
 
 
3509
            if test "$ac_wxgtk26" = 0; then
 
3510
            dnl test if we have at least GTK+ 2.4:
 
3511
            AC_MSG_CHECKING([if GTK+ is version >= 2.4])
 
3512
            AC_TRY_COMPILE([
 
3513
                            #include <gtk/gtk.h>
 
3514
                           ],
 
3515
                           [
 
3516
                            #if !GTK_CHECK_VERSION(2,4,0)
 
3517
                            Not GTK+ 2.4
 
3518
                            #endif
 
3519
                           ],
 
3520
                           [
 
3521
                            AC_DEFINE(__WXGTK24__)
 
3522
                            AC_MSG_RESULT([yes])
 
3523
                           ],
 
3524
                           [
 
3525
                            AC_MSG_RESULT([no])
 
3526
                           ])
 
3527
            fi
 
3528
 
 
3529
            CFLAGS="$save_CFLAGS"
 
3530
            LIBS="$save_LIBS"
 
3531
        else
 
3532
            if test "$wxUSE_UNICODE" = "yes"; then
 
3533
                AC_MSG_WARN([Unicode configuration not supported with GTK+ 1.x])
 
3534
                wxUSE_UNICODE=no
 
3535
            fi
 
3536
 
 
3537
            dnl test for XIM support in libgdk
 
3538
            AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
 
3539
 
 
3540
            dnl we need poll() in src/gtk1/app.cpp (we know that Darwin doesn't
 
3541
            dnl have it but we do the check for the others)
 
3542
            if test "$USE_DARWIN" != 1; then
 
3543
                AC_CHECK_FUNCS(poll)
 
3544
            fi
 
3545
        fi
 
3546
 
 
3547
        TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
 
3548
        GUI_TK_LIBRARY="$wx_cv_libs_gtk $GUI_TK_LIBRARY"
 
3549
 
 
3550
        AFMINSTALL=afminstall
 
3551
        TOOLKIT=GTK
 
3552
        GUIDIST=GTK_DIST
 
3553
 
 
3554
        dnl test for external libxpm if we're configured to use it
 
3555
        if test "$wxUSE_GPE" = "yes"; then
 
3556
            AC_MSG_CHECKING(for gpewidget library)
 
3557
            WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpewidget)
 
3558
            if test "$ac_find_libraries" != "" ; then
 
3559
                WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
 
3560
                dnl -lgpewidget must be before all GTK libs and
 
3561
                dnl we guess its path from the prefix
 
3562
                GUI_TK_LIBRARY="-L${prefix}/lib -lgpewidget $GUI_TK_LIBRARY"
 
3563
                WXGPE=1
 
3564
                AC_MSG_RESULT([found in $ac_find_libraries])
 
3565
            else
 
3566
                AC_MSG_RESULT(not found)
 
3567
            fi
 
3568
 
 
3569
            dnl AC_MSG_CHECKING(for gpe library)
 
3570
            dnl WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpe)
 
3571
            dnl if test "$ac_find_libraries" != "" ; then
 
3572
            dnl     WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
 
3573
            dnl     GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lgpe"
 
3574
            dnl     AC_MSG_RESULT(found in $ac_find_libraries)
 
3575
            dnl else
 
3576
            dnl     AC_MSG_RESULT(not found)
 
3577
            dnl fi
 
3578
        fi
 
3579
    fi
 
3580
 
 
3581
    if test "$wxUSE_MGL" = 1; then
 
3582
       AC_MSG_CHECKING(for SciTech MGL library)
 
3583
        if test "x$MGL_ROOT" = x ; then
 
3584
            AC_MSG_RESULT(not found)
 
3585
            AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.])
 
3586
        else
 
3587
            AC_MSG_RESULT($MGL_ROOT)
 
3588
        fi
 
3589
 
 
3590
        AC_MSG_CHECKING(for libmgl location)
 
3591
        dnl Find MGL library that we want
 
3592
        dnl FIXME_MGL - test for MGL variants for freebsd etc.;
 
3593
        dnl             and for non-x86 versions
 
3594
        case "${host}" in
 
3595
            *-*-linux* )
 
3596
              dnl glibc.so, glibc are for older versions of MGL,
 
3597
              dnl x86/a, x86/so are used by >= 5.0 R11
 
3598
              if test "x$wxUSE_SHARED" = xyes ; then
 
3599
                  mgl_os_candidates="linux/gcc/x86/so linux/gcc/x86/a linux/gcc/glibc.so linux/gcc/glibc"
 
3600
              else
 
3601
                  mgl_os_candidates="linux/gcc/x86/a linux/gcc/x86/so linux/gcc/glibc linux/gcc/glibc.so"
 
3602
              fi
 
3603
              ;;
 
3604
            *-pc-msdosdjgpp )
 
3605
              mgl_os_candidates="dos32/dj2"
 
3606
              ;;
 
3607
            *)
 
3608
              AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
 
3609
        esac
 
3610
 
 
3611
        mgl_lib_type=""
 
3612
        mgl_os=""
 
3613
 
 
3614
        for mgl_os_i in $mgl_os_candidates ; do
 
3615
            if test "x$mgl_os" = x ; then
 
3616
                if test "$wxUSE_DEBUG_FLAG" = yes ; then
 
3617
                    if test -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.a -o \
 
3618
                            -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.so; then
 
3619
                        mgl_lib_type=debug
 
3620
                        mgl_os=$mgl_os_i
 
3621
                    fi
 
3622
                fi
 
3623
                if test "x$mgl_lib_type" = x ; then
 
3624
                    if test -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.a -o \
 
3625
                            -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.so; then
 
3626
                        mgl_lib_type=release
 
3627
                        mgl_os=$mgl_os_i
 
3628
                    fi
 
3629
                fi
 
3630
            fi
 
3631
        done
 
3632
 
 
3633
        if test "x$mgl_os" = x ; then
 
3634
            AC_MSG_RESULT(not found)
 
3635
            AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.])
 
3636
        fi
 
3637
        AC_MSG_RESULT("$MGL_ROOT/lib/$mgl_lib_type/$mgl_os")
 
3638
 
 
3639
        wxUSE_UNIVERSAL="yes"
 
3640
 
 
3641
        TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
 
3642
        GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm"
 
3643
 
 
3644
        AFMINSTALL=afminstall
 
3645
        TOOLKIT=MGL
 
3646
        GUIDIST=MGL_DIST
 
3647
    fi
 
3648
 
 
3649
    if test "$wxUSE_DFB" = 1; then
 
3650
       PKG_PROG_PKG_CONFIG()
 
3651
 
 
3652
       PKG_CHECK_MODULES(DIRECTFB,
 
3653
                         [directfb >= 0.9.23],
 
3654
                         [
 
3655
                           wxUSE_UNIVERSAL="yes"
 
3656
                           TOOLKIT_INCLUDE="$DIRECTFB_CFLAGS"
 
3657
                           GUI_TK_LIBRARY="$DIRECTFB_LIBS"
 
3658
                           TOOLKIT=DFB
 
3659
                           GUIDIST=DFB_DIST
 
3660
                         ],
 
3661
                         [
 
3662
                           AC_MSG_ERROR([DirectFB not found.])
 
3663
                         ]
 
3664
                         )
 
3665
    fi
 
3666
 
 
3667
    if test "$wxUSE_MICROWIN" = 1; then
 
3668
        AC_MSG_CHECKING(for MicroWindows)
 
3669
        if test "x$MICROWINDOWS" = x ; then
 
3670
            AC_MSG_RESULT(not found)
 
3671
            AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.])
 
3672
        else
 
3673
            AC_MSG_RESULT($MICROWINDOWS)
 
3674
        fi
 
3675
 
 
3676
        if test -f $MICROWINDOWS/lib/libmwin.a; then
 
3677
            AC_MSG_RESULT(MicroWindows' libraries found.)
 
3678
        else
 
3679
            AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
 
3680
        fi
 
3681
 
 
3682
        TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
 
3683
        GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
 
3684
 
 
3685
        wxUSE_UNIVERSAL="yes"
 
3686
 
 
3687
        AFMINSTALL=afminstall
 
3688
        TOOLKIT=MICROWIN
 
3689
        GUIDIST=MICROWIN_DIST
 
3690
 
 
3691
        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
 
3692
    fi
 
3693
 
 
3694
    dnl common part of X11 and Motif port checks
 
3695
    if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
 
3696
        dnl use standard macros to check for X headers/libs, this brings
 
3697
        dnl support for the standard configure options --x-includes,
 
3698
        dnl --x-libraries and --no-x
 
3699
        AC_PATH_XTRA
 
3700
 
 
3701
        if test "$no_x" = "yes"; then
 
3702
          AC_MSG_ERROR([X11 not found, please use --x-includes and/or --x-libraries options (see config.log for details)])
 
3703
        fi
 
3704
 
 
3705
        dnl for some reason AC_PATH_XTRA seems to add -INONE and -LNONE (and
 
3706
        dnl also sometimes -RNONE) to X_CFLAGS and X_LIBS respectively, filter
 
3707
        dnl this junk out
 
3708
        GUI_TK_LIBRARY=`echo $X_LIBS | sed 's/ -LNONE//' | sed 's/ -RNONE//'`
 
3709
        TOOLKIT_INCLUDE=`echo $X_CFLAGS | sed 's/ -INONE//'`
 
3710
        AFMINSTALL=afminstall
 
3711
        COMPILED_X_PROGRAM=0
 
3712
 
 
3713
    fi
 
3714
 
 
3715
    if test "$wxUSE_X11" = 1; then
 
3716
        if test "$wxUSE_NANOX" = "yes"; then
 
3717
            AC_MSG_CHECKING(for MicroWindows/NanoX distribution)
 
3718
            if test "x$MICROWIN" = x ; then
 
3719
                AC_MSG_RESULT(not found)
 
3720
                AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.])
 
3721
            else
 
3722
                AC_MSG_RESULT($MICROWIN)
 
3723
                AC_DEFINE(wxUSE_NANOX)
 
3724
            fi
 
3725
        fi
 
3726
 
 
3727
        if test "$wxUSE_UNICODE" = "yes"; then
 
3728
            PKG_PROG_PKG_CONFIG()
 
3729
 
 
3730
            PKG_CHECK_MODULES(PANGOX, pangox,
 
3731
                [
 
3732
                    CFLAGS="$PANGOX_CFLAGS $CFLAGS"
 
3733
                    CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS"
 
3734
                    GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS"
 
3735
                ],
 
3736
                [
 
3737
                    AC_MSG_ERROR([pangox library not found, library cannot be compiled in Unicode mode])
 
3738
                ]
 
3739
            )
 
3740
            PKG_CHECK_MODULES(PANGOFT2, pangoft2,
 
3741
                [
 
3742
                    CFLAGS="$PANGOFT2_CFLAGS $CFLAGS"
 
3743
                    CXXFLAGS="$PANGOFT2_CFLAGS $CXXFLAGS"
 
3744
                    GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOFT2_LIBS"
 
3745
                ],
 
3746
                [
 
3747
                    AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support])
 
3748
                    wxUSE_PRINTING_ARCHITECTURE="no"
 
3749
                ]
 
3750
            )
 
3751
            PKG_CHECK_MODULES(PANGOXFT, pangoxft,
 
3752
                [
 
3753
                    AC_DEFINE(HAVE_PANGO_XFT)
 
3754
                    CFLAGS="$PANGOXFT_CFLAGS $CFLAGS"
 
3755
                    CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS"
 
3756
                    GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS"
 
3757
                ],
 
3758
                [
 
3759
                    AC_MSG_WARN([pangoxft library not found, library will be compiled without anti-aliasing support])
 
3760
                ]
 
3761
            )
 
3762
            save_LIBS="$LIBS"
 
3763
            LIBS="$LIBS $PANGOX_LIBS"
 
3764
            AC_CHECK_FUNCS([pango_font_family_is_monospace])
 
3765
            LIBS="$save_LIBS"
 
3766
        fi
 
3767
 
 
3768
        wxUSE_UNIVERSAL="yes"
 
3769
 
 
3770
        if test "$wxUSE_NANOX" = "yes"; then
 
3771
            TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
 
3772
            TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
 
3773
            GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a"
 
3774
        else
 
3775
            GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11"
 
3776
        fi
 
3777
 
 
3778
        TOOLKIT=X11
 
3779
        GUIDIST=X11_DIST
 
3780
    fi
 
3781
 
 
3782
    if test "$wxUSE_MOTIF" = 1; then
 
3783
        if test "$wxUSE_UNICODE" = "yes"; then
 
3784
            AC_MSG_ERROR([Unicode configuration not supported with Motif])
 
3785
        fi
 
3786
 
 
3787
        AC_MSG_CHECKING(for Motif/Lesstif headers)
 
3788
        WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
 
3789
        if test "$ac_find_includes" != "" ; then
 
3790
            AC_MSG_RESULT(found in $ac_find_includes)
 
3791
            WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
 
3792
            TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include"
 
3793
        else
 
3794
            save_CFLAGS=$CFLAGS
 
3795
            CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
3796
 
 
3797
            AC_TRY_COMPILE(
 
3798
                [
 
3799
                    #include <Xm/Xm.h>
 
3800
                ],
 
3801
                [
 
3802
                    int version;
 
3803
                    version = xmUseVersion;
 
3804
                ],
 
3805
                [
 
3806
                    AC_MSG_RESULT(found in default search path)
 
3807
                    COMPILED_X_PROGRAM=1
 
3808
                ],
 
3809
                [
 
3810
                    AC_MSG_RESULT(no)
 
3811
                    AC_MSG_ERROR(please set CPPFLAGS to contain the location of Xm/Xm.h)
 
3812
                ]
 
3813
            )
 
3814
 
 
3815
            CFLAGS=$save_CFLAGS
 
3816
        fi
 
3817
 
 
3818
 
 
3819
        AC_MSG_CHECKING(for Motif/Lesstif library)
 
3820
        WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
 
3821
 
 
3822
        if test "x$ac_find_libraries" != "x" ; then
 
3823
            AC_MSG_RESULT(found in $ac_find_libraries)
 
3824
 
 
3825
            WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
 
3826
            GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
 
3827
        else
 
3828
            dnl it might happen that we found headers in one of the standard
 
3829
            dnl paths but the libs are elsewhere but still in default (linker)
 
3830
            dnl path -- try to compile a test program to check for this
 
3831
            save_CFLAGS=$CFLAGS
 
3832
            CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
3833
            save_LIBS="$LIBS"
 
3834
            LIBS="$GUI_TK_LIBRARY -lXm -lXmu -lXext -lX11"
 
3835
 
 
3836
            AC_TRY_LINK(
 
3837
                [
 
3838
                    #include <Xm/Xm.h>
 
3839
                ],
 
3840
                [
 
3841
                    int version;
 
3842
                    version = xmUseVersion;
 
3843
                ],
 
3844
                [
 
3845
                    AC_MSG_RESULT(found in default search path)
 
3846
                    COMPILED_X_PROGRAM=1
 
3847
                ],
 
3848
                [
 
3849
                    AC_MSG_RESULT(no)
 
3850
                    AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
 
3851
                ]
 
3852
            )
 
3853
 
 
3854
            CFLAGS=$save_CFLAGS
 
3855
            LIBS="$save_LIBS"
 
3856
        fi
 
3857
 
 
3858
        AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE])
 
3859
        libp_link=""
 
3860
        libsm_ice_link=""
 
3861
        libs_found=0
 
3862
        for libp in "" " -lXp"; do
 
3863
            if test "$libs_found" = "0"; then
 
3864
                for libsm_ice in "" " -lSM -lICE"; do
 
3865
                    if test "$libs_found" = "0"; then
 
3866
                        save_LIBS="$LIBS"
 
3867
                        LIBS="$GUI_TK_LIBRARY -lXm ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11"
 
3868
                        save_CFLAGS=$CFLAGS
 
3869
                        CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
3870
 
 
3871
                        AC_TRY_LINK(
 
3872
                            [
 
3873
                                #include <Xm/Xm.h>
 
3874
                                #include <Xm/List.h>
 
3875
                            ],
 
3876
                            [
 
3877
                                XmString string = NULL;
 
3878
                                Widget w = NULL;
 
3879
                                int position = 0;
 
3880
                                XmListAddItem(w, string, position);
 
3881
                            ],
 
3882
                            [
 
3883
                                libp_link="$libp"
 
3884
                                libsm_ice_link="$libsm_ice"
 
3885
                                AC_MSG_RESULT(
 
3886
                                    [need${libp_link}${libsm_ice_link}])
 
3887
                                libs_found=1
 
3888
                            ], []
 
3889
                        )
 
3890
 
 
3891
                        LIBS="$save_LIBS"
 
3892
                        CFLAGS=$save_CFLAGS
 
3893
                    fi
 
3894
                done
 
3895
            fi
 
3896
        done
 
3897
 
 
3898
        if test "$libs_found" = "0"; then
 
3899
            AC_MSG_RESULT([can't find the right libraries])
 
3900
            AC_MSG_ERROR([can't link a simple motif program])
 
3901
        fi
 
3902
 
 
3903
        dnl this seems to be needed under IRIX and shouldn't do any harm
 
3904
        dnl elsewhere
 
3905
        AC_CHECK_LIB(Sgm, [SgCreateList], [libsgm_link=" -lSgm"])
 
3906
 
 
3907
        save_CFLAGS=$CFLAGS
 
3908
        CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
3909
 
 
3910
        AC_CACHE_CHECK([for Motif 2],
 
3911
            wx_cv_lib_motif2,
 
3912
            AC_TRY_COMPILE([
 
3913
                            #include <Xm/Xm.h>
 
3914
                           ],
 
3915
                           [
 
3916
                            #if XmVersion < 2000
 
3917
                            Not Motif 2
 
3918
                            #endif
 
3919
                           ],
 
3920
                           wx_cv_lib_motif2="yes",
 
3921
                           wx_cv_lib_motif2="no"))
 
3922
        if test "$wx_cv_lib_motif2" = "yes"; then
 
3923
            AC_DEFINE(__WXMOTIF20__,1)
 
3924
        else
 
3925
            AC_DEFINE(__WXMOTIF20__,0)
 
3926
        fi
 
3927
 
 
3928
        AC_CACHE_CHECK([whether Motif is Lesstif],
 
3929
            wx_cv_lib_lesstif,
 
3930
            AC_TRY_COMPILE([
 
3931
                            #include <Xm/Xm.h>
 
3932
                           ],
 
3933
                           [
 
3934
                            #if !defined(LesstifVersion) || LesstifVersion <= 0
 
3935
                            Not Lesstif
 
3936
                            #endif
 
3937
                           ],
 
3938
                           wx_cv_lib_lesstif="yes",
 
3939
                           wx_cv_lib_lesstif="no")
 
3940
        )
 
3941
        if test "$wx_cv_lib_lesstif" = "yes"; then
 
3942
            AC_DEFINE(__WXLESSTIF__,1)
 
3943
        else
 
3944
            AC_DEFINE(__WXLESSTIF__,0)
 
3945
        fi
 
3946
 
 
3947
        CFLAGS=$save_CFLAGS
 
3948
 
 
3949
        GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11"
 
3950
        TOOLKIT=MOTIF
 
3951
        GUIDIST=MOTIF_DIST
 
3952
    fi
 
3953
 
 
3954
    dnl more tests common to X11 and Motif:
 
3955
    if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
 
3956
        dnl test for external libxpm if we're configured to use it
 
3957
        if test "$wxUSE_LIBXPM" = "sys"; then
 
3958
            AC_MSG_CHECKING(for Xpm library)
 
3959
            WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
 
3960
            if test "$ac_find_libraries" != "" ; then
 
3961
                WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
 
3962
                GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
 
3963
                AC_MSG_RESULT(found in $ac_find_libraries)
 
3964
 
 
3965
                AC_CACHE_CHECK([for X11/xpm.h],
 
3966
                    wx_cv_x11_xpm_h,
 
3967
                    [
 
3968
                        save_CFLAGS=$CFLAGS
 
3969
                        CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
3970
 
 
3971
                        AC_TRY_COMPILE(
 
3972
                            [
 
3973
                                #include <X11/xpm.h>
 
3974
                            ],
 
3975
                            [
 
3976
                                int version;
 
3977
                                version = XpmLibraryVersion();
 
3978
                            ],
 
3979
                            wx_cv_x11_xpm_h=yes,
 
3980
                            wx_cv_x11_xpm_h=no
 
3981
                        )
 
3982
 
 
3983
                        CFLAGS=$save_CFLAGS
 
3984
                    ]
 
3985
                )
 
3986
 
 
3987
                if test $wx_cv_x11_xpm_h = "yes"; then
 
3988
                    GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXpm"
 
3989
                    AC_DEFINE(wxHAVE_LIB_XPM)
 
3990
                else
 
3991
                    AC_MSG_WARN([built-in less efficient XPM decoder will be used])
 
3992
                fi
 
3993
            fi
 
3994
 
 
3995
        fi
 
3996
 
 
3997
        dnl XShapeQueryExtension checks: first the library, then prototype
 
3998
        AC_CHECK_LIB([Xext], [XShapeQueryExtension],
 
3999
                     [
 
4000
                      GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXext"
 
4001
                      wxHAVE_XEXT_LIB=1
 
4002
                     ],
 
4003
                     [], [$GUI_TK_LIBRARY -lX11])
 
4004
 
 
4005
        if test "$wxHAVE_XEXT_LIB" = 1; then
 
4006
            save_CFLAGS="$CFLAGS"
 
4007
            CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
4008
 
 
4009
            AC_MSG_CHECKING([for X11/extensions/shape.h])
 
4010
            AC_TRY_COMPILE([
 
4011
                            #include <X11/Xlib.h>
 
4012
                            #include <X11/extensions/shape.h>
 
4013
                           ],
 
4014
                           [
 
4015
                            int dummy1, dummy2;
 
4016
                            XShapeQueryExtension((Display*)NULL,
 
4017
                                                 (int*)NULL, (int*)NULL);
 
4018
                           ],
 
4019
                           [
 
4020
                            AC_DEFINE(HAVE_XSHAPE)
 
4021
                            AC_MSG_RESULT([found])
 
4022
                           ],
 
4023
                           [
 
4024
                            AC_MSG_RESULT([not found])
 
4025
                           ])
 
4026
            CFLAGS="$save_CFLAGS"
 
4027
 
 
4028
        fi
 
4029
    fi
 
4030
 
 
4031
    if test "$wxUSE_MAC" = 1; then
 
4032
        AC_MSG_CHECKING([for compiler syntax to enable Pascal strings])
 
4033
        if test "$GCC" = yes; then
 
4034
            AC_MSG_RESULT([gcc])
 
4035
            CPPFLAGS_PASCAL="-fpascal-strings"
 
4036
        elif test "`echo $CXX | sed -e 's@.*/@@'`" = "xlC"; then
 
4037
            AC_MSG_RESULT([xlc])
 
4038
            CPPFLAGS_PASCAL="-qmacpstr"
 
4039
        else
 
4040
            AC_MSG_RESULT([none])
 
4041
        fi
 
4042
 
 
4043
        if test "x$wxUSE_UNIX" = "xyes"; then
 
4044
            CPPFLAGS="$CPPFLAGS_PASCAL -I\${top_srcdir}/src/mac/carbon/morefilex -I/Developer/Headers/FlatCarbon $CPPFLAGS"
 
4045
        else
 
4046
            dnl platform.h needs TARGET_CARBON before setup.h
 
4047
            CPPFLAGS="$CPPFLAGS_PASCAL -I\${top_srcdir}/src/mac/carbon/morefilex -DTARGET_CARBON $CPPFLAGS"
 
4048
        fi
 
4049
 
 
4050
        TOOLKIT=MAC
 
4051
        dnl we can't call this MAC_DIST or autoconf thinks its a macro
 
4052
        GUIDIST=MACX_DIST
 
4053
        dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin
 
4054
        dnl are different, so they need different names:
 
4055
        WXBASEPORT="_carbon"
 
4056
    fi
 
4057
 
 
4058
    if test "$wxUSE_COCOA" = 1; then
 
4059
        TOOLKIT=COCOA
 
4060
        GUIDIST=COCOA_DIST
 
4061
    fi
 
4062
 
 
4063
    if test "$wxUSE_PM" = 1; then
 
4064
        TOOLKIT=PM
 
4065
        GUIDIST=PM_DIST
 
4066
        AC_CACHE_CHECK([for type SPBCDATA],
 
4067
            wx_cv_spbcdata,
 
4068
            [
 
4069
                AC_TRY_COMPILE(
 
4070
                    [
 
4071
                        #define INCL_PM
 
4072
                        #include <os2.h>
 
4073
                    ],
 
4074
                    [
 
4075
                        SPBCDATA test;
 
4076
                    ],
 
4077
                    wx_cv_spbcdata=yes,
 
4078
                    wx_cv_spbcdata=no
 
4079
                )
 
4080
            ]
 
4081
        )
 
4082
 
 
4083
        if test $wx_cv_spbcdata = "yes"; then
 
4084
            AC_DEFINE(HAVE_SPBCDATA)
 
4085
        fi
 
4086
    fi
 
4087
 
 
4088
    dnl the name of the directory where the files for this toolkit live
 
4089
    if test "$TOOLKIT" = "PM" ; then
 
4090
        TOOLKIT_DIR="os2"
 
4091
    else
 
4092
        TOOLKIT_DIR=`echo ${TOOLKIT} | tr '[[A-Z]]' '[[a-z]]'`
 
4093
    fi
 
4094
 
 
4095
    if test "$wxUSE_UNIVERSAL" = "yes"; then
 
4096
        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__"
 
4097
        WIDGET_SET=univ
 
4098
    fi
 
4099
 
 
4100
    dnl distribute samples/demos/utils with GUI versions
 
4101
    GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST"
 
4102
    DISTDIR="wx\$(TOOLKIT)"
 
4103
else
 
4104
    USE_GUI=0
 
4105
 
 
4106
    dnl this doesn't quite work right for wxBase, but the places
 
4107
    dnl where it is wrong aren't fatal (yet) though.
 
4108
    TOOLKIT_DIR="base"
 
4109
 
 
4110
    dnl the sources, their dependenices and the headers
 
4111
    if test "$USE_WIN32" = 1 ; then
 
4112
        dnl yes, the toolkit for wxBase on win32 is actually MSW
 
4113
        dnl wxBase on unix does not need a 'TOOLKIT' defined.
 
4114
        TOOLKIT="MSW"
 
4115
    fi
 
4116
 
 
4117
    dnl distribute only wxBase sources/headers
 
4118
    GUIDIST="BASE_DIST"
 
4119
    DISTDIR="wxBase"
 
4120
fi
 
4121
 
 
4122
dnl ---------------------------------------------------------------------------
 
4123
dnl Optional libraries included when system library is not used
 
4124
dnl ---------------------------------------------------------------------------
 
4125
 
 
4126
dnl do this after test for X11 above so that we have a chance of finding Xlib.h
 
4127
if test "$wxUSE_GUI" = "yes"; then
 
4128
    if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then
 
4129
        dnl defines HAVE_X11_XKBLIB_H
 
4130
        AC_CHECK_HEADERS(X11/Xlib.h,,, [ ])
 
4131
        AC_CHECK_HEADERS([X11/XKBlib.h],,,
 
4132
                         [
 
4133
                          #if HAVE_X11_XLIB_H
 
4134
                            #include <X11/Xlib.h>
 
4135
                          #endif
 
4136
                         ])
 
4137
    fi
 
4138
fi
 
4139
 
 
4140
 
 
4141
dnl ----------------------------------------------------------------
 
4142
dnl iODBC support
 
4143
dnl ----------------------------------------------------------------
 
4144
 
 
4145
IODBC_C_SRC=""
 
4146
 
 
4147
 
 
4148
dnl ODBC is handled separately for MSW
 
4149
if test "$TOOLKIT" != "MSW" ; then
 
4150
 
 
4151
    if test "$wxUSE_ODBC" = "sys" -o "$wxUSE_ODBC" = "yes" ; then
 
4152
        dnl This is not ideal we really ough to use the unixodbc-config
 
4153
        dnl  or iodbc-config if they exist.
 
4154
 
 
4155
        AC_CHECK_HEADER([sql.h], [found_sql_h=1],, [ ])
 
4156
        if test "x$found_sql_h" = "x1" ; then
 
4157
            AC_CHECK_LIB(iodbc, SQLAllocEnv, ODBC_LINK=" -liodbc",
 
4158
            [
 
4159
                AC_CHECK_LIB(unixodbc, SQLAllocEnv, ODBC_LINK=" -lunixodbc",
 
4160
                [
 
4161
                    AC_CHECK_LIB(odbc, SQLAllocEnv, ODBC_LINK=" -lodbc")
 
4162
                ])
 
4163
            ])
 
4164
        fi
 
4165
        if test "x$ODBC_LINK" = "x" ; then
 
4166
            if test "$wxUSE_ODBC" = "sys" ; then
 
4167
                AC_MSG_ERROR([system ODBC library not found! Use --with-odbc=builtin to use built-in version])
 
4168
            else
 
4169
                AC_MSG_WARN([system ODBC library not found, will use built-in instead])
 
4170
                wxUSE_ODBC=builtin
 
4171
            fi
 
4172
        else
 
4173
            dnl we are using the system library
 
4174
            wxUSE_ODBC=sys
 
4175
        fi
 
4176
    fi
 
4177
 
 
4178
    if test "$wxUSE_ODBC" = "builtin" ; then
 
4179
        AC_DEFINE(wxUSE_BUILTIN_IODBC)
 
4180
    fi
 
4181
fi
 
4182
 
 
4183
if test "$wxUSE_ODBC" != "no" ; then
 
4184
    AC_DEFINE(wxUSE_ODBC)
 
4185
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
 
4186
 
 
4187
    dnl is this still necessary?
 
4188
    WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_IODBC_"
 
4189
fi
 
4190
 
 
4191
dnl ---------------------------------------------------------------------------
 
4192
dnl wxDisplay Sanity checks
 
4193
dnl ---------------------------------------------------------------------------
 
4194
 
 
4195
if test "$wxUSE_DISPLAY" = "yes"; then
 
4196
dnl ---------------------------------------------------------------------------
 
4197
dnl Xinerama (for unix ) - Brian Victor
 
4198
dnl ---------------------------------------------------------------------------
 
4199
    if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then
 
4200
        AC_MSG_CHECKING([for Xinerama])
 
4201
        WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xinerama)
 
4202
        if test "$ac_find_libraries" != "" ; then
 
4203
            WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
 
4204
            if test "$ac_path_to_link" != " -L/usr/lib" ; then
 
4205
                LDFLAGS="$LDFLAGS $ac_path_to_link"
 
4206
            fi
 
4207
            GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama"
 
4208
            AC_MSG_RESULT([yes])
 
4209
 
 
4210
            AC_MSG_CHECKING([for Xxf86vm extension])
 
4211
            WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xxf86vm)
 
4212
            if test "$ac_find_libraries" != "" ; then
 
4213
                AC_MSG_RESULT([yes])
 
4214
                AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],
 
4215
                                 [
 
4216
                                  GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm"
 
4217
                                 ],
 
4218
                                 [],
 
4219
                                 [
 
4220
                                      #if HAVE_X11_XLIB_H
 
4221
                                        #include <X11/Xlib.h>
 
4222
                                      #endif
 
4223
                                 ])
 
4224
            else
 
4225
                AC_MSG_RESULT([no])
 
4226
            fi
 
4227
 
 
4228
        else
 
4229
            AC_MSG_RESULT([no])
 
4230
            AC_MSG_WARN([Xinerama not found; disabling wxDisplay])
 
4231
            wxUSE_DISPLAY="no"
 
4232
        fi
 
4233
    elif test "$wxUSE_MSW" = 1; then
 
4234
dnl ---------------------------------------------------------------------------
 
4235
dnl DirectDraw for MSW - optionally used by WxDisplay.
 
4236
dnl ---------------------------------------------------------------------------
 
4237
        AC_CHECK_HEADER([ddraw.h], [], [], [#include <windows.h>])
 
4238
    fi
 
4239
fi
 
4240
 
 
4241
dnl ---------------------------------------------------------------------------
 
4242
dnl X11 session management
 
4243
dnl ---------------------------------------------------------------------------
 
4244
if test "$wxUSE_DETECT_SM" = "yes"; then
 
4245
    if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then
 
4246
        AC_MSG_CHECKING([for -lSM - X11 session management])
 
4247
        WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],SM)
 
4248
        if test "$ac_find_libraries" != "" ; then
 
4249
            WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
 
4250
            if test "$ac_path_to_link" != " -L/usr/lib" ; then
 
4251
                LDFLAGS="$LDFLAGS $ac_path_to_link"
 
4252
            fi
 
4253
            GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lSM"
 
4254
            AC_MSG_RESULT([yes])
 
4255
        else
 
4256
            AC_MSG_RESULT([no])
 
4257
            AC_MSG_WARN([libSM not found; disabling session management detection])
 
4258
            wxUSE_DETECT_SM="no"
 
4259
        fi
 
4260
    else
 
4261
        wxUSE_DETECT_SM="no"
 
4262
    fi
 
4263
fi
 
4264
 
 
4265
 
 
4266
dnl ---------------------------------------------------------------------------
 
4267
dnl OpenGL libraries
 
4268
dnl ---------------------------------------------------------------------------
 
4269
 
 
4270
USE_OPENGL=0
 
4271
if test "$wxUSE_OPENGL" = "yes"; then
 
4272
    if test "$wxUSE_MGL" = 1 -o "$wxUSE_DFB" = "1"; then
 
4273
        AC_MSG_WARN([wxGLCanvas not implemented for this port, library will be compiled without it.])
 
4274
        wxUSE_OPENGL="no"
 
4275
    elif test "$wxUSE_COCOA" = "1"; then
 
4276
        OPENGL_LIBS="-framework OpenGL -framework AGL"
 
4277
    elif test "$wxUSE_MSW" = 1; then
 
4278
        OPENGL_LIBS="-lopengl32 -lglu32"
 
4279
    elif test "$USE_DARWIN" = 1; then
 
4280
        OPENGL_LIBS=""
 
4281
    else
 
4282
        dnl adjust CPPFLAGS to include GL/gl.h location if necessary
 
4283
        dnl (/opt/graphics/OpenGL is for HP-UX systems, bug 925307)
 
4284
        AC_MSG_CHECKING([for OpenGL headers])
 
4285
        WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /opt/graphics/OpenGL/include], GL/gl.h)
 
4286
        if test "$ac_find_includes" != "" ; then
 
4287
            AC_MSG_RESULT(found in $ac_find_includes)
 
4288
            WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS)
 
4289
            CPPFLAGS="$ac_path_to_include $CPPFLAGS"
 
4290
        else
 
4291
            AC_MSG_RESULT([not found])
 
4292
        fi
 
4293
 
 
4294
        AC_CHECK_HEADER(GL/gl.h, [
 
4295
            AC_CHECK_HEADER(GL/glu.h, [
 
4296
                found_gl=0
 
4297
 
 
4298
                AC_MSG_CHECKING([for -lGL])
 
4299
                WX_PATH_FIND_LIBRARIES([$SEARCH_LIB /opt/graphics/OpenGL/lib],GL)
 
4300
                if test "$ac_find_libraries" != "" ; then
 
4301
                    AC_MSG_RESULT([found in $ac_find_libraries])
 
4302
 
 
4303
                    WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
 
4304
                    if test "$ac_path_to_link" != " -L/usr/lib" ; then
 
4305
                        LDFLAGS_GL="$ac_path_to_link"
 
4306
                    fi
 
4307
 
 
4308
                    dnl don't suppose that libGL and libGLU are always in the
 
4309
                    dnl same directory -- this is not true for some common
 
4310
                    dnl distributions
 
4311
                    AC_MSG_CHECKING([for -lGLU])
 
4312
                    WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],GLU)
 
4313
                    if test "$ac_find_libraries" != "" ; then
 
4314
                        WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
 
4315
                        if test "$ac_path_to_link" != " -L/usr/lib" -a \
 
4316
                                    "$ac_path_to_link" != "$LDFLAGS_GL"; then
 
4317
                            LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link"
 
4318
                        fi
 
4319
 
 
4320
                        found_gl=1
 
4321
                        OPENGL_LIBS="-lGL -lGLU"
 
4322
                        AC_MSG_RESULT([yes])
 
4323
                    else
 
4324
                        AC_MSG_RESULT([no])
 
4325
                    fi
 
4326
                else
 
4327
                    AC_MSG_RESULT([no])
 
4328
                fi
 
4329
 
 
4330
                if test "$found_gl" != 1; then
 
4331
                    AC_MSG_CHECKING([for -lMesaGL])
 
4332
                    WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],MesaGL)
 
4333
                    if test "$ac_find_libraries" != "" ; then
 
4334
                        WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
 
4335
                        LDFLAGS_GL="$LDFLAGS$ac_path_to_link"
 
4336
                        OPENGL_LIBS="-lMesaGL -lMesaGLU"
 
4337
                        AC_MSG_RESULT([yes])
 
4338
                    else
 
4339
                        AC_MSG_RESULT([no])
 
4340
                    fi
 
4341
                fi
 
4342
            ])
 
4343
        ],
 
4344
        [],
 
4345
        [ ])
 
4346
 
 
4347
        if test "x$OPENGL_LIBS" = "x"; then
 
4348
            dnl it should be an error and not a warning because OpenGL is not on
 
4349
            dnl by default and so if it had been explicitly requested, we
 
4350
            dnl shouldn't just fall back to compiling the library without it
 
4351
            AC_MSG_ERROR(OpenGL libraries not available)
 
4352
        fi
 
4353
    fi
 
4354
 
 
4355
    if test "$wxUSE_OPENGL" = "yes"; then
 
4356
        USE_OPENGL=1
 
4357
        AC_DEFINE(wxUSE_OPENGL)
 
4358
        AC_DEFINE(wxUSE_GLCANVAS)
 
4359
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf"
 
4360
    fi
 
4361
fi
 
4362
 
 
4363
 
 
4364
dnl the symbol which allows conditional compilation for the given toolkit
 
4365
if test -n "$TOOLKIT" ; then
 
4366
    TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WX${TOOLKIT}__"
 
4367
fi
 
4368
 
 
4369
 
 
4370
dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
 
4371
 
 
4372
if test "$wxUSE_SHARED" = "yes"; then
 
4373
    case "${host}" in
 
4374
      *-pc-msdosdjgpp )
 
4375
        dnl only static for now
 
4376
        wxUSE_SHARED=no
 
4377
        AC_MSG_WARN([Host system doesn't support shared libraries, disabling])
 
4378
      ;;
 
4379
    esac
 
4380
fi
 
4381
 
 
4382
if test "$wxUSE_SHARED" = "yes"; then
 
4383
 
 
4384
    dnl use versioned symbols if available on the platform
 
4385
    WX_VERSIONED_SYMBOLS([\$(wx_top_builddir)/version-script])
 
4386
 
 
4387
    case "${host}" in
 
4388
      *-*-linux* | *-*-gnu* )
 
4389
        SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
 
4390
        WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
 
4391
        ;;
 
4392
 
 
4393
      *-*-solaris2* )
 
4394
        if test "$GCC" = yes ; then
 
4395
            dnl newer versions of gcc need -isystem to compile X headers on
 
4396
            dnl Solaris (which use old style C syntax)
 
4397
            CPPFLAGS="-isystem /usr/openwin/include $CPPFLAGS"
 
4398
 
 
4399
            dnl gcc may use Sun's ld, in which case -rpath gives a confusing
 
4400
            dnl error message. We have to try both -Wl,-rpath and -Wl,-R:
 
4401
            saveLdflags="$LDFLAGS"
 
4402
            LDFLAGS="$saveLdflags -Wl,-rpath,/"
 
4403
            AC_MSG_CHECKING([if the linker accepts -rpath])
 
4404
            AC_TRY_LINK(
 
4405
                [],[],
 
4406
                [
 
4407
                    AC_MSG_RESULT([yes])
 
4408
                    SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
 
4409
                    WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
 
4410
                ],[
 
4411
                    AC_MSG_RESULT([no])
 
4412
                    AC_MSG_CHECKING([if the linker accepts -R])
 
4413
                    LDFLAGS="$saveLdflags -Wl,-R,/"
 
4414
                    AC_TRY_LINK(
 
4415
                        [],[],
 
4416
                        [
 
4417
                            AC_MSG_RESULT([yes])
 
4418
                            SAMPLES_RPATH_FLAG="-Wl,-R,\$(wx_top_builddir)/lib"
 
4419
                            WXCONFIG_RPATH="-Wl,-R,\$libdir"
 
4420
                        ],[
 
4421
                            AC_MSG_RESULT([no])
 
4422
                        ])
 
4423
                ])
 
4424
            LDFLAGS="$saveLdflags"
 
4425
        else
 
4426
            SAMPLES_RPATH_FLAG="-R\$(wx_top_builddir)/lib"
 
4427
            WXCONFIG_RPATH="-R\$libdir"
 
4428
        fi
 
4429
      ;;
 
4430
 
 
4431
      *-*-darwin* )
 
4432
        install_name_tool=`which install_name_tool`
 
4433
        if test "$install_name_tool" -a -x "$install_name_tool"; then
 
4434
            SAMPLES_RPATH_POSTLINK="\$(wx_top_builddir)/change-install-names \$(LIBDIRNAME) \$(prefix) \$@"
 
4435
            cat <<EOF >change-install-names
 
4436
#!/bin/sh
 
4437
libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\`
 
4438
inst_cmd="install_name_tool "
 
4439
for i in \${libnames} ; do
 
4440
    inst_cmd="\${inst_cmd} -change \${2}/lib/\${i} \${1}/\${i}"
 
4441
done
 
4442
\${inst_cmd} \${3}
 
4443
EOF
 
4444
            chmod +x change-install-names
 
4445
        fi
 
4446
      ;;
 
4447
 
 
4448
      *-*-cygwin* | *-*-mingw32* )
 
4449
        dnl this one shouldn't be used for the library build so put it in a
 
4450
        dnl separate variable from WXCONFIG_CPPFLAGS
 
4451
        WXCONFIG_ONLY_CPPFLAGS="$WXCONFIG_ONLY_CPPFLAGS -DWXUSINGDLL"
 
4452
        ;;
 
4453
 
 
4454
      *-*-hpux* )
 
4455
        SAMPLES_RPATH_FLAG="-Wl,+b,\$(wx_top_builddir)/lib"
 
4456
        WXCONFIG_RPATH="-Wl,+b,\$libdir"
 
4457
        ;;
 
4458
 
 
4459
    esac
 
4460
 
 
4461
    if test $wxUSE_RPATH = "no"; then
 
4462
        SAMPLES_RPATH_FLAG=''
 
4463
        SAMPLES_RPATH_POSTLINK=''
 
4464
        WXCONFIG_RPATH=''
 
4465
    fi
 
4466
 
 
4467
    SHARED=1
 
4468
 
 
4469
else
 
4470
 
 
4471
    config_linkage_component="-static"
 
4472
    SHARED=0
 
4473
 
 
4474
fi
 
4475
 
 
4476
 
 
4477
UNICODE=0
 
4478
lib_unicode_suffix=
 
4479
WX_CHARTYPE="ansi"
 
4480
if test "$wxUSE_UNICODE" = "yes"; then
 
4481
    lib_unicode_suffix=u
 
4482
    WX_CHARTYPE="unicode"
 
4483
    UNICODE=1
 
4484
fi
 
4485
 
 
4486
lib_debug_suffix=
 
4487
WX_DEBUGTYPE="release"
 
4488
DEBUG_FLAG=0
 
4489
if test "$wxUSE_DEBUG_FLAG" = "yes"; then
 
4490
    lib_debug_suffix=d
 
4491
    WX_DEBUGTYPE="debug"
 
4492
    DEBUG_FLAG=1
 
4493
fi
 
4494
 
 
4495
WX_FLAVOUR=${WX_FLAVOUR:+-$WX_FLAVOUR}
 
4496
WX_LIB_FLAVOUR=`echo $WX_FLAVOUR | tr '-' '_'`
 
4497
 
 
4498
DEBUG_INFO=0
 
4499
if test "$wxUSE_DEBUG_INFO" = "yes"; then
 
4500
    DEBUG_INFO=1
 
4501
fi
 
4502
 
 
4503
WX_VERSION_TAG=`echo WX${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}_${WX_RELEASE} | tr '[[a-z]]' '[[A-Z]]'`
 
4504
 
 
4505
TOOLCHAIN_NAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}"
 
4506
 
 
4507
TOOLCHAIN_FULLNAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}-${WX_CHARTYPE}-${WX_DEBUGTYPE}${config_linkage_component}-${WX_RELEASE}${WX_FLAVOUR}"
 
4508
 
 
4509
if test "$cross_compiling" = "yes"; then
 
4510
    HOST_SUFFIX="-$host_alias"
 
4511
    TOOLCHAIN_NAME="$TOOLCHAIN_NAME$HOST_SUFFIX"
 
4512
    TOOLCHAIN_FULLNAME="${host_alias}-$TOOLCHAIN_FULLNAME"
 
4513
fi
 
4514
 
 
4515
dnl library link name
 
4516
dnl These just save us from exporting lib_{unicode,debug,flavour}_suffix.
 
4517
dnl If we ever need to do that, we won't need to keep these.
 
4518
WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
 
4519
if test "${TOOLKIT_DIR}" = "os2"; then
 
4520
    WX_LIBRARY_BASENAME_GUI="wx_pm${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
 
4521
else
 
4522
    WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
 
4523
fi
 
4524
 
 
4525
 
 
4526
 
 
4527
if test "$wxUSE_COCOA" = 1; then
 
4528
    AC_LANG_SAVE
 
4529
    AC_WX_LANG_OBJECTIVEC
 
4530
dnl Recent AppKit/NSEvent.h include parts of IOKit which eventually
 
4531
dnl gets IOKit/graphics/IOGraphicsTypes.h included which typedefs
 
4532
dnl Point but only if MacTypes.h was not included first.  Of course,
 
4533
dnl if MacTypes.h is included later then you're screwed when it
 
4534
dnl tries to typedef Point.  Defining __Point__ will cause IOGraphicsTypes.h
 
4535
dnl to not typedef Point and thus fix the problem.
 
4536
    AC_MSG_CHECKING([if AppKit/NSEvent.h conflicts with CoreFoundation])
 
4537
    AC_TRY_COMPILE([#include <AppKit/NSEvent.h>
 
4538
#include <CoreFoundation/CoreFoundation.h>
 
4539
        ],[],
 
4540
        [AC_MSG_RESULT([no])],
 
4541
        [AC_MSG_RESULT([yes])
 
4542
        AC_MSG_CHECKING([if defining __Point__ will fix it])
 
4543
        AC_TRY_COMPILE([#define __Point__ 1
 
4544
#include <AppKit/NSEvent.h>
 
4545
#include <CoreFoundation/CoreFoundation.h>
 
4546
            ],[],
 
4547
            [AC_MSG_RESULT([yes])
 
4548
            AC_DEFINE(__Point__)
 
4549
            ],
 
4550
            [AC_MSG_FAILURE([no])]
 
4551
        )]
 
4552
    )
 
4553
    AC_LANG_RESTORE
 
4554
fi
 
4555
 
 
4556
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then
 
4557
    dnl base name of the resource file for wxMac must be the same
 
4558
    dnl as library installation base name (-install_name)
 
4559
    WX_RESOURCES_MACOSX_ASCII="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.r"
 
4560
    WX_RESOURCES_MACOSX_DATA="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.rsrc"
 
4561
 
 
4562
    dnl add the resources target for wxMac
 
4563
    LIBWXMACRES="\$(wx_top_builddir)/lib/${WX_RESOURCES_MACOSX_ASCII}"
 
4564
 
 
4565
    AC_CHECK_PROG(REZ, Rez, Rez, /Developer/Tools/Rez)
 
4566
    AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
 
4567
    AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile)
 
4568
 
 
4569
    MACSETFILE="\$(SETFILE)"
 
4570
 
 
4571
    dnl resources are bundled both with shared library and applications
 
4572
    dnl since the carb resource *must* be included in the application
 
4573
    if test "$wxUSE_MAC" = 1; then
 
4574
        POSTLINK_COMMAND="\$(REZ) -d __DARWIN__ -t APPL Carbon.r -o"
 
4575
        RESCOMP="$REZ"
 
4576
        WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL Carbon.r -o"
 
4577
    else
 
4578
        POSTLINK_COMMAND="echo -n | \$(REZ) -d __DARWIN__ -t APPL ${LIBWXMACRES}"
 
4579
        RESCOMP="echo -n \| $REZ"
 
4580
        WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL \$libdir/$WX_RESOURCES_MACOSX_ASCII"
 
4581
    fi
 
4582
 
 
4583
else
 
4584
    dnl default value is to (silently) do nothing in the makefile
 
4585
    MACSETFILE="@true"
 
4586
 
 
4587
    if test "$wxUSE_PM" = 1; then
 
4588
        RESCOMP="emxbind"
 
4589
        WXCONFIG_RESFLAGS="-ep"
 
4590
 
 
4591
        dnl Is this one really used anywhere for pm?
 
4592
        POSTLINK_COMMAND="$RESCOMP $WXCONFIG_RESFLAGS"
 
4593
    else
 
4594
        POSTLINK_COMMAND="@true"
 
4595
    fi
 
4596
 
 
4597
fi
 
4598
 
 
4599
 
 
4600
dnl ---------------------------------------------------------------------------
 
4601
dnl Checks for typedefs
 
4602
dnl ---------------------------------------------------------------------------
 
4603
 
 
4604
dnl   defines mode_t if not already defined
 
4605
AC_TYPE_MODE_T
 
4606
dnl   defines off_t if not already defined
 
4607
AC_TYPE_OFF_T
 
4608
dnl   defines pid_t if not already defined
 
4609
AC_TYPE_PID_T
 
4610
dnl   defines size_t if not already defined
 
4611
AC_TYPE_SIZE_T
 
4612
dnl   defines uid_t and gid_t if not already defined
 
4613
AC_TYPE_UID_T
 
4614
 
 
4615
dnl sets HAVE_SSIZE_T if ssize_t is defined
 
4616
AC_CHECK_TYPES(ssize_t)
 
4617
 
 
4618
dnl check what exactly size_t is on this machine - this is necessary to avoid
 
4619
dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h
 
4620
AC_LANG_PUSH(C++) dnl tests below use overloaded functions and so need C++
 
4621
AC_CACHE_CHECK([if size_t is unsigned int],
 
4622
    wx_cv_size_t_is_uint,
 
4623
    [
 
4624
    dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work
 
4625
    dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
 
4626
    dnl methods in a local class (i.e. class inside a function) declaration
 
4627
    dnl without any objections!!
 
4628
    dnl
 
4629
    dnl hence the hack below: we must have Foo at global scope!
 
4630
    AC_TRY_COMPILE([#include <stddef.h>],
 
4631
        [
 
4632
            return 0; }
 
4633
 
 
4634
            struct Foo { void foo(size_t); void foo(unsigned int); };
 
4635
 
 
4636
            int bar() {
 
4637
        ],
 
4638
        wx_cv_size_t_is_uint=no,
 
4639
        wx_cv_size_t_is_uint=yes
 
4640
    )
 
4641
    ]
 
4642
)
 
4643
 
 
4644
if test "$wx_cv_size_t_is_uint" = "yes"; then
 
4645
    AC_DEFINE(wxSIZE_T_IS_UINT)
 
4646
else
 
4647
    AC_CACHE_CHECK([if size_t is unsigned long],
 
4648
        wx_cv_size_t_is_ulong,
 
4649
        AC_TRY_COMPILE([#include <stddef.h>],
 
4650
            [
 
4651
                return 0; }
 
4652
 
 
4653
                struct Foo { void foo(size_t); void foo(unsigned long); };
 
4654
 
 
4655
                int bar() {
 
4656
            ],
 
4657
            wx_cv_size_t_is_ulong=no,
 
4658
            wx_cv_size_t_is_ulong=yes
 
4659
        )
 
4660
    )
 
4661
 
 
4662
    if test "$wx_cv_size_t_is_ulong" = "yes"; then
 
4663
        AC_DEFINE(wxSIZE_T_IS_ULONG)
 
4664
    fi
 
4665
fi
 
4666
 
 
4667
AC_LANG_POP() dnl C++
 
4668
 
 
4669
dnl ---------------------------------------------------------------------------
 
4670
dnl Checks for structures
 
4671
dnl ---------------------------------------------------------------------------
 
4672
 
 
4673
dnl does passwd struct has the pw_gecos field?
 
4674
AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos,
 
4675
    [
 
4676
        AC_TRY_COMPILE([#include <pwd.h>],
 
4677
             [
 
4678
                char *p;
 
4679
                struct passwd *pw;
 
4680
                p = pw->pw_gecos;
 
4681
             ],
 
4682
             [
 
4683
                wx_cv_struct_pw_gecos=yes
 
4684
             ],
 
4685
             [
 
4686
                wx_cv_struct_pw_gecos=no
 
4687
             ]
 
4688
        )
 
4689
    ]
 
4690
)
 
4691
 
 
4692
if test "$wx_cv_struct_pw_gecos" = "yes"; then
 
4693
    AC_DEFINE(HAVE_PW_GECOS)
 
4694
fi
 
4695
 
 
4696
dnl ---------------------------------------------------------------------------
 
4697
dnl Check for functions
 
4698
dnl ---------------------------------------------------------------------------
 
4699
 
 
4700
dnl don't check for wchar_t functions if we haven't got wchar_t itself
 
4701
if test "$wxUSE_WCHAR_T" = "yes"; then
 
4702
    AC_DEFINE(wxUSE_WCHAR_T)
 
4703
 
 
4704
    dnl check for wcslen in all possible places
 
4705
    WCSLEN_FOUND=0
 
4706
    WCHAR_LINK=
 
4707
    AC_CHECK_FUNCS(wcslen, WCSLEN_FOUND=1)
 
4708
 
 
4709
    if test "$WCSLEN_FOUND" = 0; then
 
4710
        if test "$TOOLKIT" = "MSW"; then
 
4711
            AC_CHECK_LIB(msvcrt, wcslen, WCHAR_OK=1)
 
4712
        else
 
4713
            AC_CHECK_LIB(w, wcslen, [
 
4714
                            WCHAR_LINK=" -lw"
 
4715
                            WCSLEN_FOUND=1
 
4716
                        ])
 
4717
        fi
 
4718
    fi
 
4719
 
 
4720
    if test "$WCSLEN_FOUND" = 1; then
 
4721
        AC_DEFINE(HAVE_WCSLEN)
 
4722
    fi
 
4723
 
 
4724
    dnl On HP-UX aCC need this define to find mbstrtowcs() &c
 
4725
    dnl Can't be used for g++ since the mbstate_t in wchar.h can conflict
 
4726
    dnl with g++'s in <cwchar> (unless -D_INCLUDE__STDC_A1_SOURCE is in the
 
4727
    dnl flags when g++ is configured, it will declare it's own).
 
4728
    if test "$USE_HPUX" = 1 -a "$GCC" != "yes"; then
 
4729
        CPPFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CPPFLAGS"
 
4730
    fi
 
4731
 
 
4732
    dnl Try to use wcsrtombs instead of wcstombs which is buggy in old GNU
 
4733
    dnl libc versions if possible. AC_CHECK_FUNCS only checks it's in the
 
4734
    dnl library, not the header, so do a header check for mbstate_t first.
 
4735
    AC_CHECK_TYPES([mbstate_t],
 
4736
                   [AC_CHECK_FUNCS(wcsrtombs)],
 
4737
                   [],
 
4738
                   [#include <wchar.h>])
 
4739
else
 
4740
    AC_MSG_WARN([Wide character support is unavailable])
 
4741
fi
 
4742
 
 
4743
dnl check for vsnprintf() -- a safe version of vsprintf())
 
4744
dnl
 
4745
dnl the trouble here is that on some systems (e.g HP-UX 10) this function is
 
4746
dnl present in libc but not in the system headers and so AC_CHECK_FUNCS (which,
 
4747
dnl stupidly, provides a dummy function declaration inside its extension)
 
4748
dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails
 
4749
dnl
 
4750
dnl so we first check if the function is in the library
 
4751
dnl
 
4752
dnl FIXME: replace this mess with WX_CHECK_FUNCS()
 
4753
AC_CHECK_FUNCS(snprintf vsnprintf)
 
4754
 
 
4755
if test "$ac_cv_func_vsnprintf" = "yes"; then
 
4756
    dnl yes it is -- now check if it is in the headers
 
4757
    AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl,
 
4758
        [
 
4759
            dnl our troubles are not over: HP-UX 11 prototypes vsnprintf() as
 
4760
            dnl taking "char *" and not "const char *" while Metrowerks does
 
4761
            dnl provide a correct vsnprintf declaration but in C++ mode it's
 
4762
            dnl always in std namespace and so we have to bring it in scope
 
4763
            AC_TRY_COMPILE(
 
4764
                [
 
4765
                    #include <stdio.h>
 
4766
                    #include <stdarg.h>
 
4767
                    #ifdef __MSL__
 
4768
                    #if __MSL__ >= 0x6000
 
4769
                    namespace std {}
 
4770
                    using namespace std;
 
4771
                    #endif
 
4772
                    #endif
 
4773
                ],
 
4774
                [
 
4775
                    char *buf;
 
4776
                    va_list ap;
 
4777
                    vsnprintf(buf, 10u, "%s", ap);
 
4778
                ],
 
4779
                wx_cv_func_vsnprintf_decl=yes,
 
4780
                wx_cv_func_vsnprintf_decl=no
 
4781
            )
 
4782
        ]
 
4783
    )
 
4784
 
 
4785
    if test "$wx_cv_func_vsnprintf_decl" = "yes"; then
 
4786
        AC_DEFINE(HAVE_VSNPRINTF_DECL)
 
4787
 
 
4788
        dnl we know there is a vsnprintf declaration, but some old headers
 
4789
        dnl may have one taking a "char *" format instead of "const char *"
 
4790
        AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl,
 
4791
            [
 
4792
                AC_TRY_COMPILE(
 
4793
                    [
 
4794
                        #include <stdio.h>
 
4795
                        #include <stdarg.h>
 
4796
                        #ifdef __MSL__
 
4797
                        #if __MSL__ >= 0x6000
 
4798
                        namespace std {}
 
4799
                        using namespace std;
 
4800
                        #endif
 
4801
                        #endif
 
4802
                    ],
 
4803
                    [
 
4804
                        char *buf;
 
4805
                        va_list ap;
 
4806
                        const char *fmt = "%s";
 
4807
                        vsnprintf(buf, 10u, fmt, ap);
 
4808
                    ],
 
4809
                    wx_cv_func_broken_vsnprintf_decl=no,
 
4810
                    wx_cv_func_broken_vsnprintf_decl=yes
 
4811
                )
 
4812
            ]
 
4813
        )
 
4814
 
 
4815
        if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then
 
4816
            AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL)
 
4817
        fi
 
4818
    fi
 
4819
fi
 
4820
 
 
4821
dnl the same as above but for snprintf() now: it's not present in at least AIX
 
4822
dnl 4.2 headers
 
4823
if test "$ac_cv_func_snprintf" = "yes"; then
 
4824
    AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl,
 
4825
        [
 
4826
            AC_TRY_COMPILE(
 
4827
                [
 
4828
                    #include <stdio.h>
 
4829
                    #include <stdarg.h>
 
4830
                    #ifdef __MSL__
 
4831
                    #if __MSL__ >= 0x6000
 
4832
                    namespace std {}
 
4833
                    using namespace std;
 
4834
                    #endif
 
4835
                    #endif
 
4836
                ],
 
4837
                [
 
4838
                    char *buf;
 
4839
                    snprintf(buf, 10u, "%s", "wx");
 
4840
                ],
 
4841
                wx_cv_func_snprintf_decl=yes,
 
4842
                wx_cv_func_snprintf_decl=no
 
4843
            )
 
4844
        ]
 
4845
    )
 
4846
 
 
4847
    if test "$wx_cv_func_snprintf_decl" = "yes"; then
 
4848
        AC_DEFINE(HAVE_SNPRINTF_DECL)
 
4849
 
 
4850
        dnl we know there is an snprintf declaration, but some old headers
 
4851
        dnl may have one taking a "char *" format instead of "const char *"
 
4852
        AC_CACHE_CHECK([if snprintf declaration is broken], wx_cv_func_broken_snprintf_decl,
 
4853
            [
 
4854
                AC_TRY_COMPILE(
 
4855
                    [
 
4856
                        #include <stdio.h>
 
4857
                        #include <stdarg.h>
 
4858
                        #ifdef __MSL__
 
4859
                        #if __MSL__ >= 0x6000
 
4860
                        namespace std {}
 
4861
                        using namespace std;
 
4862
                        #endif
 
4863
                        #endif
 
4864
                    ],
 
4865
                    [
 
4866
                        char *buf;
 
4867
                        const char *fmt = "%s";
 
4868
                        snprintf(buf, 10u, fmt, "wx");
 
4869
                    ],
 
4870
                    wx_cv_func_broken_snprintf_decl=no,
 
4871
                    wx_cv_func_broken_snprintf_decl=yes
 
4872
                )
 
4873
            ]
 
4874
        )
 
4875
 
 
4876
        if test "$wx_cv_func_broken_snprintf_decl" = "yes"; then
 
4877
            AC_DEFINE(HAVE_BROKEN_SNPRINTF_DECL)
 
4878
        fi
 
4879
    fi
 
4880
 
 
4881
    if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
 
4882
 
 
4883
        dnl check if snprintf() has support for positional arguments
 
4884
        dnl NB: if snprintf() has positional support we can safely suppose that also
 
4885
        dnl     other *printf() functions support them as they all belong to the same
 
4886
        dnl     family and they all fallback to the same implementation
 
4887
        AC_CACHE_CHECK([if snprintf supports positional arguments], wx_cv_func_snprintf_pos_params,
 
4888
            [
 
4889
                AC_TRY_RUN(
 
4890
                    [
 
4891
                        #include <stdio.h>
 
4892
 
 
4893
                        int main (void)
 
4894
                        {
 
4895
                            char buffer[128];
 
4896
                            snprintf (buffer, 128, "%2$d %3$d %1$d", 1, 2, 3);
 
4897
                            if (strcmp ("2 3 1", buffer) == 0)
 
4898
                                exit (0);
 
4899
                            exit (1);
 
4900
                        }
 
4901
                    ],
 
4902
                    wx_cv_func_snprintf_pos_params=no,
 
4903
                    wx_cv_func_snprintf_pos_params=yes,
 
4904
                    dnl be pessimistic when cross-compiling
 
4905
                    [
 
4906
                        AC_MSG_WARN([Assuming Unix98 printf() is not available,
 
4907
define HAVE_UNIX98_PRINTF as 1 in setup.h if it is available.])
 
4908
                        wx_cv_func_snprintf_pos_params=no
 
4909
                    ]
 
4910
                )
 
4911
            ]
 
4912
        )
 
4913
 
 
4914
        if test "$wx_cv_func_snprintf_pos_params" = "yes"; then
 
4915
            AC_DEFINE(HAVE_UNIX98_PRINTF)
 
4916
        fi
 
4917
    fi
 
4918
fi
 
4919
 
 
4920
if test "$wxUSE_UNICODE" = yes; then
 
4921
 
 
4922
    dnl our wxVsnprintf() implementation needs to use the system swprintf() in Unicode
 
4923
    dnl builds so let's check if swprintf() is declared as C99 imposes:
 
4924
    dnl     int swprintf(wchar_t *s, size_t n, const wchar_t *format, ...);
 
4925
    dnl or rather as:
 
4926
    dnl     int swprintf(wchar_t *s, const wchar_t *format, ...);
 
4927
    AC_CHECK_FUNCS(swprintf)
 
4928
 
 
4929
    if test "$ac_cv_func_swprintf" = "yes"; then
 
4930
        AC_CACHE_CHECK([if swprintf declaration is broken], wx_cv_func_broken_swprintf_decl,
 
4931
            [
 
4932
                AC_TRY_COMPILE(
 
4933
                    [
 
4934
                        #include <stdio.h>
 
4935
                        #include <stdarg.h>
 
4936
                        #include <wchar.h>
 
4937
                    ],
 
4938
                    [
 
4939
                        wchar_t *buf;
 
4940
                        const wchar_t *fmt = L"test";
 
4941
                        swprintf(buf, 10u, fmt);
 
4942
                    ],
 
4943
                    wx_cv_func_broken_swprintf_decl=no,
 
4944
                    wx_cv_func_broken_swprintf_decl=yes
 
4945
                )
 
4946
            ]
 
4947
        )
 
4948
 
 
4949
        if test "$wx_cv_func_broken_swprintf_decl" = "yes"; then
 
4950
            AC_DEFINE(HAVE_BROKEN_SWPRINTF_DECL)
 
4951
        fi
 
4952
    fi
 
4953
 
 
4954
    dnl also look if we have wide char IO functions, notice that [f]putws are
 
4955
    dnl declared in special widec.h under Solaris
 
4956
    wchar_headers="#include <stdio.h>
 
4957
#include <wchar.h>"
 
4958
    case "${host}" in
 
4959
        *-*-solaris2* )
 
4960
            AC_CHECK_HEADERS(widec.h,,, [AC_INCLUDES_DEFAULT()])
 
4961
            if test "$ac_cv_header_widec_h" = "yes"; then
 
4962
                wchar_headers="$wchar_headers
 
4963
#include <widec.h>"
 
4964
            fi
 
4965
    esac
 
4966
 
 
4967
    WX_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf,,,
 
4968
                   [$wchar_headers])
 
4969
 
 
4970
    dnl MinGW has a vswprintf with a different prototype, and
 
4971
    dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
 
4972
    dnl finds it even if it is not declared in some versions...
 
4973
    AC_MSG_CHECKING([for _vsnwprintf])
 
4974
    AC_TRY_COMPILE([#include <wchar.h>],
 
4975
                   [&_vsnwprintf;],
 
4976
                   [AC_MSG_RESULT([yes])
 
4977
                    AC_DEFINE(HAVE__VSNWPRINTF)],
 
4978
                   [AC_MSG_RESULT([no])]);
 
4979
fi
 
4980
 
 
4981
if test "x$ac_cv_header_fnmatch_h" = "xyes"; then
 
4982
    WX_CHECK_FUNCS(fnmatch,,,[#include <fnmatch.h>])
 
4983
fi
 
4984
 
 
4985
if test "$wxUSE_FILE" = "yes"; then
 
4986
    WX_CHECK_FUNCS(fsync)
 
4987
fi
 
4988
 
 
4989
dnl at least under IRIX with mipsPro the C99 round() function is available when
 
4990
dnl building using the C compiler but not when using C++ one
 
4991
AC_LANG_PUSH(C++)
 
4992
WX_CHECK_FUNCS(round,,,[#include <math.h>])
 
4993
AC_LANG_POP()
 
4994
 
 
4995
dnl the following tests are for Unix(like) systems only
 
4996
if test "$TOOLKIT" != "MSW"; then
 
4997
 
 
4998
dnl check for available version of iconv()
 
4999
 
 
5000
AM_ICONV
 
5001
LIBS="$LIBICONV $LIBS"
 
5002
 
 
5003
dnl check for POSIX signals if we need them
 
5004
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
 
5005
    AC_CHECK_FUNCS(sigaction)
 
5006
 
 
5007
    if test "$ac_cv_func_sigaction" = "no"; then
 
5008
        AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called])
 
5009
        wxUSE_ON_FATAL_EXCEPTION=no
 
5010
    fi
 
5011
 
 
5012
    if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
 
5013
      AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
 
5014
      [
 
5015
        dnl C compiler happily compiles the code even if there is type mismatch
 
5016
        AC_LANG_PUSH(C++)
 
5017
        AC_TRY_COMPILE([#include <signal.h>],
 
5018
                     [
 
5019
                        extern void testSigHandler(int);
 
5020
 
 
5021
                        struct sigaction sa;
 
5022
                        sa.sa_handler = testSigHandler;
 
5023
                     ], [
 
5024
                        wx_cv_type_sa_handler=int
 
5025
                     ], [
 
5026
                        wx_cv_type_sa_handler=void
 
5027
                     ])
 
5028
        AC_LANG_POP()
 
5029
      ])
 
5030
 
 
5031
      AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
 
5032
    fi
 
5033
fi
 
5034
 
 
5035
dnl backtrace() and backtrace_symbols() for wxStackWalker
 
5036
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
 
5037
    AC_LANG_PUSH(C++)
 
5038
    AC_SEARCH_LIBS(backtrace, execinfo,
 
5039
        [AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
 
5040
            [AC_TRY_LINK([#include <execinfo.h>],
 
5041
                [
 
5042
                    void *trace[1];
 
5043
                    char **messages;
 
5044
                    backtrace(trace, 1);
 
5045
                    messages = backtrace_symbols(trace, 1);
 
5046
                ],
 
5047
                wx_cv_func_backtrace=yes,
 
5048
                wx_cv_func_backtrace=no
 
5049
            )]
 
5050
        )],
 
5051
        wx_cv_func_backtrace=no)
 
5052
 
 
5053
    if test "$wx_cv_func_backtrace" = "no"; then
 
5054
        AC_MSG_WARN([backtrace() is not available, wxStackWalker will not be available])
 
5055
        wxUSE_STACKWALKER=no
 
5056
    else
 
5057
        AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
 
5058
            [
 
5059
                AC_TRY_LINK([#include <cxxabi.h>],
 
5060
                    [
 
5061
                        int rc;
 
5062
                        __cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
 
5063
                    ],
 
5064
                    wx_cv_func_cxa_demangle=yes,
 
5065
                    wx_cv_func_cxa_demangle=no
 
5066
                )
 
5067
            ]
 
5068
        )
 
5069
 
 
5070
        if test "$wx_cv_func_cxa_demangle" = "yes"; then
 
5071
            AC_DEFINE(HAVE_CXA_DEMANGLE)
 
5072
        fi
 
5073
    fi
 
5074
    AC_LANG_POP()
 
5075
fi
 
5076
 
 
5077
if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != "1" -a "$USE_UNIX" != "1"; then
 
5078
    AC_MSG_WARN([wxStackWalker is only available on Win32 and UNIX... disabled])
 
5079
    wxUSE_STACKWALKER=no
 
5080
fi
 
5081
 
 
5082
 
 
5083
dnl check for the function for temp files creation
 
5084
AC_CHECK_FUNCS(mkstemp mktemp, break)
 
5085
 
 
5086
dnl get the library function to use for wxGetDiskSpace(): it is statfs() under
 
5087
dnl Linux and *BSD and statvfs() under Solaris
 
5088
AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
 
5089
    AC_TRY_COMPILE(
 
5090
        [
 
5091
             #if defined(__BSD__)
 
5092
             #include <sys/param.h>
 
5093
             #include <sys/mount.h>
 
5094
             #else
 
5095
             #include <sys/vfs.h>
 
5096
             #endif
 
5097
        ],
 
5098
        [
 
5099
             long l;
 
5100
             struct statfs fs;
 
5101
             statfs("/", &fs);
 
5102
             l = fs.f_bsize;
 
5103
             l += fs.f_blocks;
 
5104
             l += fs.f_bavail;
 
5105
        ],
 
5106
         wx_cv_func_statfs=yes,
 
5107
         wx_cv_func_statfs=no
 
5108
    )
 
5109
)
 
5110
 
 
5111
if test "$wx_cv_func_statfs" = "yes"; then
 
5112
    dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
 
5113
    AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl,
 
5114
        AC_LANG_PUSH(C++)
 
5115
        AC_TRY_COMPILE(
 
5116
            [
 
5117
                 #if defined(__BSD__)
 
5118
                 #include <sys/param.h>
 
5119
                 #include <sys/mount.h>
 
5120
                 #else
 
5121
                 #include <sys/vfs.h>
 
5122
                 #endif
 
5123
            ],
 
5124
            [
 
5125
                struct statfs fs;
 
5126
                statfs("", &fs);
 
5127
            ],
 
5128
            wx_cv_func_statfs_decl=yes,
 
5129
            wx_cv_func_statfs_decl=no
 
5130
        )
 
5131
        AC_LANG_POP()
 
5132
    )
 
5133
 
 
5134
    if test "$wx_cv_func_statfs_decl" = "yes"; then
 
5135
        AC_DEFINE(HAVE_STATFS_DECL)
 
5136
    fi
 
5137
 
 
5138
    wx_cv_type_statvfs_t="struct statfs"
 
5139
    AC_DEFINE(HAVE_STATFS)
 
5140
else
 
5141
    AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs,
 
5142
        AC_TRY_COMPILE(
 
5143
            [
 
5144
                #include <stddef.h>
 
5145
                #include <sys/statvfs.h>
 
5146
            ],
 
5147
            [
 
5148
                statvfs("/", NULL);
 
5149
            ],
 
5150
            wx_cv_func_statvfs=yes,
 
5151
            wx_cv_func_statvfs=no
 
5152
        )
 
5153
    )
 
5154
 
 
5155
    if test "$wx_cv_func_statvfs" = "yes"; then
 
5156
        dnl we also have to check whether we should use statvfs_t (works under
 
5157
        dnl Solaris 8, doesn't work under Solaris 7) or "struct statvfs" (vice
 
5158
        dnl versa) as the argument for statvfs in 64 bit off_t mode (in 32 bit
 
5159
        dnl mode both work fine)
 
5160
        dnl
 
5161
        dnl for this check C++ compiler has to be used as passing incompatible
 
5162
        dnl pointers is just a warning and not an error in C
 
5163
        AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t,
 
5164
            AC_LANG_PUSH(C++)
 
5165
            AC_TRY_COMPILE(
 
5166
                [
 
5167
                    #include <sys/statvfs.h>
 
5168
                ],
 
5169
                [
 
5170
                    long l;
 
5171
                    statvfs_t fs;
 
5172
                    statvfs("/", &fs);
 
5173
                    l = fs.f_bsize;
 
5174
                    l += fs.f_blocks;
 
5175
                    l += fs.f_bavail;
 
5176
                ],
 
5177
                wx_cv_type_statvfs_t=statvfs_t,
 
5178
                [
 
5179
                    AC_TRY_COMPILE(
 
5180
                        [
 
5181
                            #include <sys/statvfs.h>
 
5182
                        ],
 
5183
                        [
 
5184
                            long l;
 
5185
                            struct statvfs fs;
 
5186
                            statvfs("/", &fs);
 
5187
                            l = fs.f_bsize;
 
5188
                            l += fs.f_blocks;
 
5189
                            l += fs.f_bavail;
 
5190
                        ],
 
5191
                        wx_cv_type_statvfs_t="struct statvfs",
 
5192
                        wx_cv_type_statvfs_t="unknown"
 
5193
                    )
 
5194
                ]
 
5195
            )
 
5196
            AC_LANG_POP()
 
5197
        )
 
5198
 
 
5199
        if test "$wx_cv_type_statvfs_t" != "unknown"; then
 
5200
            AC_DEFINE(HAVE_STATVFS)
 
5201
        fi
 
5202
    else
 
5203
        dnl set it for the test below
 
5204
        wx_cv_type_statvfs_t="unknown"
 
5205
    fi
 
5206
fi
 
5207
 
 
5208
if test "$wx_cv_type_statvfs_t" != "unknown"; then
 
5209
    AC_DEFINE_UNQUOTED(WX_STATFS_T, $wx_cv_type_statvfs_t)
 
5210
else
 
5211
    AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()])
 
5212
fi
 
5213
 
 
5214
dnl check for fcntl() or at least flock() needed by Unix implementation of
 
5215
dnl wxSingleInstanceChecker
 
5216
if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
 
5217
    AC_CHECK_FUNCS(fcntl flock, break)
 
5218
 
 
5219
    if test "$ac_cv_func_fcntl" != "yes" -a "$ac_cv_func_flock" != "yes"; then
 
5220
        AC_MSG_WARN(wxSingleInstanceChecker not available)
 
5221
        wxUSE_SNGLINST_CHECKER=no
 
5222
    fi
 
5223
fi
 
5224
 
 
5225
dnl check for timegm() used by datetime.cpp
 
5226
AC_CHECK_FUNCS(timegm)
 
5227
 
 
5228
dnl look for a function to modify the environment
 
5229
AC_CHECK_FUNCS(setenv putenv, break)
 
5230
if test "$ac_cv_func_setenv" = "yes"; then
 
5231
    AC_CHECK_FUNCS(unsetenv)
 
5232
fi
 
5233
 
 
5234
HAVE_SOME_SLEEP_FUNC=0
 
5235
if test "$USE_BEOS" = 1; then
 
5236
    dnl BeOS has its own (wonder where did they get it from) sleep() function
 
5237
    dnl in unistd.h
 
5238
    AC_DEFINE(HAVE_SLEEP)
 
5239
    HAVE_SOME_SLEEP_FUNC=1
 
5240
fi
 
5241
 
 
5242
if test "$USE_DARWIN" = 1; then
 
5243
    dnl Mac OS X/Darwin has both nanosleep and usleep
 
5244
    dnl but only usleep is defined in unistd.h
 
5245
    AC_DEFINE(HAVE_USLEEP)
 
5246
    HAVE_SOME_SLEEP_FUNC=1
 
5247
fi
 
5248
 
 
5249
if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
 
5250
    dnl try nanosleep() in libc and libposix4, if this fails - usleep()
 
5251
    POSIX4_LINK=
 
5252
    AC_CHECK_FUNCS(nanosleep,
 
5253
        AC_DEFINE(HAVE_NANOSLEEP),
 
5254
        [
 
5255
            AC_CHECK_LIB(posix4, nanosleep,
 
5256
                [
 
5257
                    AC_DEFINE(HAVE_NANOSLEEP)
 
5258
                    POSIX4_LINK=" -lposix4"
 
5259
                ],
 
5260
                [
 
5261
                    WX_CHECK_FUNCS(usleep,,
 
5262
                                    AC_MSG_WARN([wxSleep() function will not work])
 
5263
                    )
 
5264
                ]
 
5265
            )
 
5266
        ]
 
5267
    )
 
5268
fi
 
5269
 
 
5270
dnl check for uname (POSIX) and gethostname (BSD)
 
5271
WX_CHECK_FUNCS(uname,,,[#include <sys/utsname.h>])
 
5272
if test "$wx_cv_func_uname" != yes; then
 
5273
    WX_CHECK_FUNCS(gethostname)  
 
5274
fi
 
5275
 
 
5276
WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT])
 
5277
 
 
5278
dnl check for inet_addr and inet_aton (these may live either in libc, or in
 
5279
dnl libnsl or libresolv or libsocket)
 
5280
INET_LINK=
 
5281
AC_CHECK_FUNCS(inet_addr,
 
5282
    AC_DEFINE(HAVE_INET_ADDR),
 
5283
    [
 
5284
        AC_CHECK_LIB(nsl, inet_addr,
 
5285
            INET_LINK="nsl",
 
5286
            [
 
5287
                AC_CHECK_LIB(resolv, inet_addr,
 
5288
                    INET_LINK="resolv",
 
5289
                    [
 
5290
                        AC_CHECK_LIB(socket, inet_addr,
 
5291
                            INET_LINK="socket"
 
5292
                        )
 
5293
                    ]
 
5294
                )
 
5295
            ]
 
5296
        )
 
5297
    ]
 
5298
)
 
5299
 
 
5300
AC_CHECK_FUNCS(inet_aton,
 
5301
        AC_DEFINE(HAVE_INET_ATON),
 
5302
        [
 
5303
            dnl only check it in the same lib
 
5304
            AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
 
5305
        ])
 
5306
 
 
5307
if test "x$INET_LINK" != "x"; then
 
5308
    AC_DEFINE(HAVE_INET_ADDR)
 
5309
    INET_LINK=" -l$INET_LINK"
 
5310
fi
 
5311
 
 
5312
WX_CHECK_FUNCS(fdopen)
 
5313
 
 
5314
if test "$wxUSE_TARSTREAM" = "yes"; then
 
5315
    WX_CHECK_FUNCS(sysconf)
 
5316
 
 
5317
    WX_CHECK_FUNCS(getpwuid_r, [], [],
 
5318
                   [
 
5319
                    #define _REENTRANT
 
5320
                    #include <pwd.h>
 
5321
                   ],
 
5322
                   [[
 
5323
                    struct passwd pw, *ppw;
 
5324
                    char buf[1024];
 
5325
                    getpwuid_r(0, &pw, buf, sizeof(buf), &ppw)
 
5326
                   ]])
 
5327
 
 
5328
    WX_CHECK_FUNCS(getgrgid_r, [], [],
 
5329
                   [
 
5330
                    #define _REENTRANT
 
5331
                    #include <grp.h>
 
5332
                   ],
 
5333
                   [[
 
5334
                    struct group grp, *pgrp;
 
5335
                    char buf[1024];
 
5336
                    getgrgid_r(0, &grp, buf, sizeof(buf), &pgrp)
 
5337
                   ]])
 
5338
fi
 
5339
 
 
5340
fi
 
5341
 
 
5342
dnl if !MSW
 
5343
 
 
5344
 
 
5345
dnl ------------------------------------------
 
5346
dnl Checks specific to contrib libs (MMedia)
 
5347
dnl ------------------------------------------
 
5348
 
 
5349
dnl Check for ESD:
 
5350
EXTRALIBS_ESD=
 
5351
AC_CHECK_LIB(esd, esd_close, [
 
5352
    AC_CHECK_HEADERS([esd.h], [
 
5353
    EXTRALIBS_ESD="-lesd"
 
5354
  ],
 
5355
  [],
 
5356
  [ ])
 
5357
])
 
5358
AC_SUBST(EXTRALIBS_ESD)
 
5359
 
 
5360
dnl check for known CD-ROM interface
 
5361
AC_MSG_CHECKING([for known CD-ROM interface])
 
5362
AC_TRY_COMPILE([#ifdef __linux__
 
5363
                #include <linux/cdrom.h>
 
5364
                #else
 
5365
                /* For Solaris */
 
5366
                #include <sys/cdio.h>
 
5367
                #endif
 
5368
                ],
 
5369
               [struct cdrom_tocentry entry, old_entry;],
 
5370
               [AC_MSG_RESULT([yes])
 
5371
                AC_DEFINE(HAVE_KNOWN_CDROM_INTERFACE)],
 
5372
               [AC_MSG_RESULT([no])])
 
5373
 
 
5374
dnl ===========================================================================
 
5375
dnl Now we have all the info we need - use it!
 
5376
dnl ===========================================================================
 
5377
 
 
5378
dnl flush the cache
 
5379
AC_CACHE_SAVE
 
5380
 
 
5381
dnl ---------------------------------------------------------------------------
 
5382
dnl thread support for Unix (for Win32 and OS/2 see past
 
5383
dnl                          the next matching "else")
 
5384
dnl ---------------------------------------------------------------------------
 
5385
 
 
5386
dnl under MSW (except mingw32) we always have thread support
 
5387
if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
 
5388
 
 
5389
    dnl the code below:
 
5390
    dnl
 
5391
    dnl   defines THREADS_LINK and THREADS_CFLAGS which are the options
 
5392
    dnl   necessary to build the MT programs for the linker and compiler
 
5393
    dnl   respectively
 
5394
    dnl
 
5395
    dnl   sets wxUSE_THREADS=1 if thread support is activated
 
5396
 
 
5397
    THREADS_LINK=
 
5398
    THREADS_CFLAGS=
 
5399
 
 
5400
    if test "$wxUSE_THREADS" = "yes" ; then
 
5401
        if test "$USE_BEOS" = 1; then
 
5402
            AC_MSG_WARN([BeOS threads are not yet supported... disabled])
 
5403
            wxUSE_THREADS="no"
 
5404
        fi
 
5405
    fi
 
5406
 
 
5407
    if test "$wxUSE_THREADS" = "yes" ; then
 
5408
        dnl find if POSIX threads are available
 
5409
        dnl
 
5410
        dnl the tests here are based on ACX_PTHREAD macro from autoconf macro
 
5411
        dnl archive from http://ac-archive.sourceforge.net/
 
5412
        dnl
 
5413
        dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro
 
5414
        dnl Forero Cuervo <bachue@bachue.com> for the original code
 
5415
 
 
5416
        dnl TODO: cache the result
 
5417
 
 
5418
        dnl define the list of the thread options to try in the loop below
 
5419
        dnl with the convention that anything starting with '-' is a cpp flag
 
5420
        dnl while anything else is a library (i.e. there is an implicit "-l")
 
5421
        THREAD_OPTS="-pthread"
 
5422
        case "${host}" in
 
5423
          *-*-solaris2* | *-*-sunos4* )
 
5424
                if test "x$GCC" = "xyes"; then
 
5425
                    dnl Solaris/gcc combination use this one for some reason
 
5426
                    THREAD_OPTS="-pthreads $THREAD_OPTS"
 
5427
                else
 
5428
                    THREAD_OPTS="-mt $THREAD_OPTS"
 
5429
                fi
 
5430
                ;;
 
5431
          *-*-freebsd*)
 
5432
                dnl look, in order, for the kernel threads, then Linux threads
 
5433
                dnl and finally the userland threads
 
5434
                THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
 
5435
                ;;
 
5436
          *-*-darwin* | *-*-cygwin* )
 
5437
                dnl Darwin / Mac OS X just uses -lpthread tested below
 
5438
                dnl and so does Cygwin
 
5439
                THREAD_OPTS=""
 
5440
                ;;
 
5441
          *-*-aix*)
 
5442
                dnl AIX calls the library libpthreads - thanks IBM!
 
5443
                THREAD_OPTS="pthreads"
 
5444
                ;;
 
5445
          *-hp-hpux* )
 
5446
                if test "x$GCC" = "xyes"; then
 
5447
                    dnl g++ versions before 3.3.2 don't support -pthread.
 
5448
                    $CXX -dumpspecs | grep 'pthread:' >/dev/null ||
 
5449
                        THREAD_OPTS=""
 
5450
                else
 
5451
                    dnl HP-UX aCC (tested with version B3910B A.06.05 [Jul 25
 
5452
                    dnl 2005]) supports -mt
 
5453
                    THREAD_OPTS="-mt"
 
5454
                fi
 
5455
                ;;
 
5456
 
 
5457
          *-*-irix* )
 
5458
                dnl gcc under IRIX doesn't seem to like -pthread, but it
 
5459
                dnl doesn't give an error for it neither, just a warning
 
5460
                dnl message -- but this is still very annoying
 
5461
                if test "x$GCC" = "xyes"; then
 
5462
                    THREAD_OPTS=""
 
5463
                fi
 
5464
                ;;
 
5465
 
 
5466
          *-*-*UnixWare*)
 
5467
                dnl flying by man pages here: Caldera online docs use this
 
5468
                if test "x$GCC" != "xyes"; then
 
5469
                    THREAD_OPTS="-Ethread"
 
5470
                fi
 
5471
                ;;
 
5472
        esac
 
5473
 
 
5474
        dnl simply linking with libpthread should make the test below work but
 
5475
        dnl it's far from certain that the threaded programs compiled without
 
5476
        dnl any special switches actually work, so try it after all the others
 
5477
        THREAD_OPTS="$THREAD_OPTS pthread none"
 
5478
 
 
5479
        dnl now test for all possibilities
 
5480
        THREADS_OK=no
 
5481
        for flag in $THREAD_OPTS; do
 
5482
            case $flag in
 
5483
                none)
 
5484
                    AC_MSG_CHECKING([whether pthreads work without any flags])
 
5485
                    ;;
 
5486
 
 
5487
                -*)
 
5488
                    AC_MSG_CHECKING([whether pthreads work with $flag])
 
5489
                    THREADS_CFLAGS="$flag"
 
5490
                    ;;
 
5491
 
 
5492
                *)
 
5493
                    AC_MSG_CHECKING([for the pthreads library -l$flag])
 
5494
                    THREADS_LINK="-l$flag"
 
5495
                    ;;
 
5496
              esac
 
5497
 
 
5498
              save_LIBS="$LIBS"
 
5499
              save_CFLAGS="$CFLAGS"
 
5500
              LIBS="$THREADS_LINK $LIBS"
 
5501
              CFLAGS="$THREADS_CFLAGS $CFLAGS"
 
5502
 
 
5503
              AC_TRY_LINK([#include <pthread.h>],
 
5504
                          [pthread_create(0,0,0,0);],
 
5505
                          THREADS_OK=yes)
 
5506
 
 
5507
              LIBS="$save_LIBS"
 
5508
              CFLAGS="$save_CFLAGS"
 
5509
 
 
5510
              AC_MSG_RESULT($THREADS_OK)
 
5511
              if test "x$THREADS_OK" = "xyes"; then
 
5512
                      break;
 
5513
              fi
 
5514
 
 
5515
              THREADS_LINK=""
 
5516
              THREADS_CFLAGS=""
 
5517
      done
 
5518
 
 
5519
      if test "x$THREADS_OK" != "xyes"; then
 
5520
          wxUSE_THREADS=no
 
5521
          AC_MSG_WARN([No thread support on this system... disabled])
 
5522
      else
 
5523
          dnl yes, these special compiler flags should be used with the
 
5524
          dnl linker as well
 
5525
          LDFLAGS="$THREADS_CFLAGS $LDFLAGS"
 
5526
          LIBS="$THREADS_LINK $LIBS"
 
5527
 
 
5528
          AC_MSG_CHECKING([if more special flags are required for pthreads])
 
5529
          flag=no
 
5530
          case "${host}" in
 
5531
            *-aix*)
 
5532
                dnl again quoting from
 
5533
                dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html:
 
5534
                dnl
 
5535
                dnl     When compiling and linking with -pthread, the library
 
5536
                dnl     search path should include -L/usr/lib/threads at the
 
5537
                dnl     beginning of the path.
 
5538
                LDFLAGS="-L/usr/lib/threads $LDFLAGS"
 
5539
                flag="-D_THREAD_SAFE"
 
5540
                ;;
 
5541
            *-freebsd*)
 
5542
                flag="-D_THREAD_SAFE"
 
5543
                ;;
 
5544
            *-hp-hpux* )
 
5545
                flag="-D_REENTRANT"
 
5546
                if test "x$GCC" != "xyes"; then
 
5547
                    dnl see http://docs.hp.com/hpux/onlinedocs/2213/threads.htm
 
5548
                    flag="$flag -D_RWSTD_MULTI_THREAD"
 
5549
                fi
 
5550
                ;;
 
5551
            *solaris* | alpha*-osf*)
 
5552
                flag="-D_REENTRANT"
 
5553
                ;;
 
5554
          esac
 
5555
          AC_MSG_RESULT(${flag})
 
5556
          if test "x$flag" != xno; then
 
5557
              THREADS_CFLAGS="$THREADS_CFLAGS $flag"
 
5558
          fi
 
5559
 
 
5560
          dnl don't add these options to CPPFLAGS as cpp might not know them
 
5561
          WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS $THREADS_CFLAGS"
 
5562
      fi
 
5563
    fi
 
5564
 
 
5565
    dnl do other tests only if we are using threads
 
5566
    if test "$wxUSE_THREADS" = "yes" ; then
 
5567
      AC_CHECK_FUNCS(thr_setconcurrency)
 
5568
 
 
5569
      dnl can't use AC_CHECK_FUNCS for this one as it's usually a macro and so
 
5570
      dnl wouldn't be found by it
 
5571
      AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup,
 
5572
      [
 
5573
        AC_TRY_COMPILE([#include <pthread.h>
 
5574
               void ThreadCleanupFunc(void *p);
 
5575
            ],
 
5576
            [
 
5577
                void *p;
 
5578
                pthread_cleanup_push(ThreadCleanupFunc, p);
 
5579
                pthread_cleanup_pop(0);
 
5580
            ], [
 
5581
               wx_cv_func_pthread_cleanup=yes
 
5582
            ], [
 
5583
               wx_cv_func_pthread_cleanup=no
 
5584
            ]
 
5585
        )
 
5586
      ])
 
5587
      if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then
 
5588
        AC_DEFINE(wxHAVE_PTHREAD_CLEANUP)
 
5589
      fi
 
5590
 
 
5591
      AC_CHECK_HEADERS(sched.h,,, [AC_INCLUDES_DEFAULT()])
 
5592
      if test "$ac_cv_header_sched_h" = "yes"; then
 
5593
          AC_CHECK_FUNC(sched_yield,
 
5594
            AC_DEFINE(HAVE_SCHED_YIELD),
 
5595
            [
 
5596
                AC_CHECK_LIB(posix4,
 
5597
                    sched_yield,
 
5598
                    [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
 
5599
                    AC_MSG_WARN(wxThread::Yield will not work properly)
 
5600
                )
 
5601
            ]
 
5602
          )
 
5603
      fi
 
5604
 
 
5605
      dnl to be able to set the thread priority, we need to have all of the
 
5606
      dnl following functions:
 
5607
      dnl   1. pthread_attr_getschedpolicy
 
5608
      dnl   2. sched_get_priority_min and sched_get_priority_max
 
5609
      dnl      (this one can be in either libpthread or libposix4 (under Solaris))
 
5610
      dnl   3. pthread_attr_getschedparam and pthread_attr_setschedparam
 
5611
      HAVE_PRIOR_FUNCS=0
 
5612
      AC_CHECK_FUNC(pthread_attr_getschedpolicy,
 
5613
                     [AC_CHECK_FUNC(pthread_attr_setschedparam,
 
5614
                       [AC_CHECK_FUNC(sched_get_priority_max,
 
5615
                           HAVE_PRIOR_FUNCS=1,
 
5616
                           [AC_CHECK_LIB([posix4], sched_get_priority_max,
 
5617
                             [
 
5618
                                HAVE_PRIOR_FUNCS=1
 
5619
                                POSIX4_LINK=" -lposix4"
 
5620
                             ],
 
5621
                           )]
 
5622
                       )]
 
5623
                     )]
 
5624
                   )
 
5625
 
 
5626
      if test "$HAVE_PRIOR_FUNCS" = 1; then
 
5627
        AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
 
5628
      else
 
5629
        AC_MSG_WARN(Setting thread priority will not work)
 
5630
      fi
 
5631
 
 
5632
      AC_CHECK_FUNC(pthread_cancel,
 
5633
                    AC_DEFINE(HAVE_PTHREAD_CANCEL),
 
5634
                    AC_MSG_WARN([wxThread::Kill() will not work properly]))
 
5635
 
 
5636
      AC_CHECK_FUNC(pthread_attr_setstacksize,
 
5637
                    AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE))
 
5638
 
 
5639
      dnl mutexattr_t initialization is done in quite different ways on different
 
5640
      dnl platforms, so check for a few things:
 
5641
      dnl
 
5642
      dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes
 
5643
      dnl HAVE_MUTEXATTR_SETTYPE means that we do it using
 
5644
      dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not
 
5645
      dnl defined, we do it by directly assigned
 
5646
      dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
 
5647
 
 
5648
      AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
 
5649
      [
 
5650
        AC_TRY_COMPILE([#include <pthread.h>],
 
5651
            [
 
5652
               pthread_mutexattr_t attr;
 
5653
               pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 
5654
            ],
 
5655
            wx_cv_type_pthread_mutexattr_t=yes,
 
5656
            wx_cv_type_pthread_mutexattr_t=no
 
5657
        )
 
5658
      ])
 
5659
 
 
5660
      if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
 
5661
        AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
 
5662
 
 
5663
        dnl check if we already have the declaration we need, it is not
 
5664
        dnl present in some systems' headers
 
5665
        AC_CACHE_CHECK([for pthread_mutexattr_settype declaration],
 
5666
                       wx_cv_func_pthread_mutexattr_settype_decl, [
 
5667
                       AC_TRY_COMPILE([#include <pthread.h>],
 
5668
                           [
 
5669
                               pthread_mutexattr_t attr;
 
5670
                               pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 
5671
                           ],
 
5672
                           wx_cv_func_pthread_mutexattr_settype_decl=yes,
 
5673
                           wx_cv_func_pthread_mutexattr_settype_decl=no
 
5674
                       )
 
5675
        ])
 
5676
        if test "$wx_cv_func_pthread_mutexattr_settype_decl" = "yes"; then
 
5677
            AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL)
 
5678
        fi
 
5679
      else
 
5680
        dnl don't despair, there may be another way to do it
 
5681
        AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
 
5682
                       wx_cv_type_pthread_rec_mutex_init,
 
5683
        [
 
5684
            AC_TRY_COMPILE([#include <pthread.h>],
 
5685
                [
 
5686
                    pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 
5687
                ], [
 
5688
                    wx_cv_type_pthread_rec_mutex_init=yes
 
5689
                ], [
 
5690
                    wx_cv_type_pthread_rec_mutex_init=no
 
5691
                ]
 
5692
            )
 
5693
        ])
 
5694
        if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
 
5695
          AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
 
5696
        else
 
5697
          dnl this may break code working elsewhere, so at least warn about it
 
5698
          AC_MSG_WARN([wxMutex won't be recursive on this platform])
 
5699
        fi
 
5700
      fi
 
5701
    fi
 
5702
 
 
5703
dnl from if !MSW
 
5704
else
 
5705
    if test "$wxUSE_THREADS" = "yes" ; then
 
5706
      case "${host}" in
 
5707
        x86_64-*-mingw32* )
 
5708
        ;;
 
5709
        *-*-mingw32* )
 
5710
            dnl check if the compiler accepts -mthreads
 
5711
            AC_CACHE_CHECK([if compiler supports -mthreads],
 
5712
                wx_cv_cflags_mthread,
 
5713
                [
 
5714
                    CFLAGS_OLD="$CFLAGS"
 
5715
                    CFLAGS="-mthreads $CFLAGS"
 
5716
                    AC_TRY_COMPILE([], [],
 
5717
                        wx_cv_cflags_mthread=yes,
 
5718
                        wx_cv_cflags_mthread=no
 
5719
                    )
 
5720
                ]
 
5721
            )
 
5722
 
 
5723
            if test "$wx_cv_cflags_mthread" = "yes"; then
 
5724
                dnl it does, use it
 
5725
                WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mthreads"
 
5726
                LDFLAGS="$LDFLAGS -mthreads"
 
5727
            else
 
5728
                dnl it doesn't
 
5729
                CFLAGS="$CFLAGS_OLD"
 
5730
            fi
 
5731
        ;;
 
5732
        *-pc-os2*emx )
 
5733
            WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -Zmt -D__ST_MT_ERRNO__"
 
5734
            LDFLAGS="$LDFLAGS -Zmt"
 
5735
        ;;
 
5736
      esac
 
5737
    fi
 
5738
fi
 
5739
 
 
5740
AC_CHECK_FUNC(localtime_r, [ AC_DEFINE(HAVE_LOCALTIME_R) ])
 
5741
AC_CHECK_FUNC(gmtime_r, [ AC_DEFINE(HAVE_GMTIME_R) ])
 
5742
AC_CHECK_FUNC(readdir_r, [ AC_DEFINE(HAVE_READDIR_R) ])
 
5743
dnl By preference, we probably should use getaddrinfo which avoids thread
 
5744
dnl safety issues and supports IPv6, however there currently is no code
 
5745
dnl for it, so testing for it is temporarily disabled and we are restricted
 
5746
dnl to gethostbyname_r/gethostbyaddr_r  and getservbyname_r
 
5747
 
 
5748
dnl AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO), [
 
5749
    dnl no getaddrinfo, so check for gethostbyname_r and
 
5750
    dnl related functions (taken from python's configure.in)
 
5751
    dnl sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments
 
5752
      AX_FUNC_WHICH_GETHOSTBYNAME_R
 
5753
      if test "x$ac_cv_func_which_gethostbyname_r" = "xno" -o \
 
5754
              "x$ac_cv_func_which_gethostbyname_r" = "xunknown" ; then
 
5755
          AC_CHECK_FUNC(gethostbyname, [ AC_DEFINE(HAVE_GETHOSTBYNAME) ])
 
5756
      fi
 
5757
      dnl A similar test for getservbyname_r
 
5758
      dnl I'm tempted to just not do this test which is taking much time and
 
5759
      dnl do something similar as for gethostbyaddr_r, but OTOH the macro
 
5760
      dnl doing the test already exists, so using it is easy enough.     - SN
 
5761
      AC_raf_FUNC_WHICH_GETSERVBYNAME_R
 
5762
      if test "x$ac_cv_func_which_getservbyname_r" = "xno" -o \
 
5763
              "x$ac_cv_func_which_getservbyname_r" = "xunknown" ; then
 
5764
          AC_CHECK_FUNCS(getservbyname,[ AC_DEFINE(HAVE_GETSERVBYNAME) ])
 
5765
      fi
 
5766
      dnl For gethostbyaddr_r, we currently do no separate test, instead, we
 
5767
      dnl silently assume it's available exactly if gethostbyname_r is
 
5768
      dnl available and always requires two more arguments than
 
5769
      dnl gethostbyname_r.
 
5770
      dnl (also, I'm lazy and there no m4 file that's ready for use for this
 
5771
      dnl  function, although it should be easy to rewrite the gethostbyname_r
 
5772
      dnl  check to fit this case, if it's really needed.                - SN )
 
5773
dnl    ]
 
5774
dnl )
 
5775
 
 
5776
if test "$wxUSE_THREADS" = "yes"; then
 
5777
  AC_DEFINE(wxUSE_THREADS)
 
5778
 
 
5779
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
 
5780
else
 
5781
  dnl on some systems, _REENTRANT should be defined if we want to use any _r()
 
5782
  dnl functions - add tests for other functions here as well
 
5783
  if test "$wx_cv_func_strtok_r" = "yes"; then
 
5784
    AC_MSG_CHECKING(if -D_REENTRANT is needed)
 
5785
    if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
 
5786
        WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_REENTRANT"
 
5787
        AC_MSG_RESULT(yes)
 
5788
    else
 
5789
        AC_MSG_RESULT(no)
 
5790
    fi
 
5791
  fi
 
5792
fi
 
5793
 
 
5794
if test "$WXGTK20" = 1 ; then
 
5795
  AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK20)
 
5796
  WXGTK12=1
 
5797
fi
 
5798
 
 
5799
if test "$WXGTK12" = 1 ; then
 
5800
  AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
 
5801
fi
 
5802
 
 
5803
if test "$WXGTK127" = 1 ; then
 
5804
  AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127)
 
5805
fi
 
5806
 
 
5807
if test "$WXGPE" = 1 ; then
 
5808
  AC_DEFINE_UNQUOTED(__WXGPE__,$WXGPE)
 
5809
fi
 
5810
 
 
5811
dnl DEBUG_CFLAGS contains debugging options (supposed to be the same for C and C++
 
5812
dnl compilers: we'd need a separate DEBUG_CXXFLAGS if this is ever not the case)
 
5813
DEBUG_CFLAGS=
 
5814
if test "$wxUSE_DEBUG_INFO" = "yes" ; then
 
5815
    DEBUG_CFLAGS="-g"
 
5816
    wxUSE_OPTIMISE=no
 
5817
fi
 
5818
 
 
5819
if test "$wxUSE_DEBUG_GDB" = "yes" ; then
 
5820
    wxUSE_DEBUG_INFO=yes
 
5821
    if test "$GCC" = yes; then
 
5822
        DEBUG_CFLAGS="-ggdb"
 
5823
    fi
 
5824
fi
 
5825
 
 
5826
if test "$wxUSE_DEBUG_FLAG" = "yes" ; then
 
5827
    AC_DEFINE(WXDEBUG)
 
5828
    WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D__WXDEBUG__"
 
5829
else
 
5830
    if test "$wxUSE_GTK" = 1 ; then
 
5831
        if test "x$wxGTK_VERSION" = "x1" ; then
 
5832
            CPPFLAGS="-DGTK_NO_CHECK_CASTS $CPPFLAGS"
 
5833
        fi
 
5834
    fi
 
5835
fi
 
5836
 
 
5837
if test "$wxUSE_MEM_TRACING" = "yes" ; then
 
5838
    AC_DEFINE(wxUSE_MEMORY_TRACING)
 
5839
    AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS)
 
5840
    AC_DEFINE(wxUSE_DEBUG_NEW_ALWAYS)
 
5841
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck"
 
5842
fi
 
5843
 
 
5844
if test "$wxUSE_DMALLOC" = "yes" ; then
 
5845
    DMALLOC_LIBS="-ldmallocthcxx"
 
5846
fi
 
5847
 
 
5848
dnl cc/cxx/ld option for profiling
 
5849
PROFILE_FLAGS=
 
5850
if test "$wxUSE_PROFILE" = "yes" ; then
 
5851
    PROFILE_FLAGS=" -pg"
 
5852
fi
 
5853
 
 
5854
if test "$GCC" = "yes" ; then
 
5855
    if test "$wxUSE_NO_RTTI" = "yes" ; then
 
5856
        WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti"
 
5857
    fi
 
5858
    if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
 
5859
        WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions"
 
5860
    fi
 
5861
    if test "$wxUSE_PERMISSIVE" = "yes" ; then
 
5862
        WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -fpermissive"
 
5863
    fi
 
5864
 
 
5865
    dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before
 
5866
    dnl 3.0 overflow the table of contents on rs6000 as they create an entry
 
5867
    dnl for each subroutine by default -- using the switch below only creates
 
5868
    dnl one entry per file instead at the price of minor performance penalty
 
5869
    dnl
 
5870
    dnl As of wx2.4 a bug in the hppa gcc compiler causes a similar problem
 
5871
    dnl without -ffunction-sections.  No idea how long we'll need to maintain
 
5872
    dnl this, or even the extent of gcc/wx version combinations affected, but
 
5873
    dnl also as above, this 'fix' does not come without side effects.
 
5874
    dnl
 
5875
    dnl TODO: test for the gcc version here (how?)
 
5876
    case "${host}" in
 
5877
      powerpc*-*-aix* )
 
5878
        WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mminimal-toc"
 
5879
        ;;
 
5880
      *-hppa* )
 
5881
        WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -ffunction-sections"
 
5882
        ;;
 
5883
    esac
 
5884
fi
 
5885
 
 
5886
dnl C/C++ compiler option for optimization (supposed to be the same for both)
 
5887
OPTIMISE_CFLAGS=
 
5888
if test "$wxUSE_OPTIMISE" = "no" ; then
 
5889
    if test "$GCC" = yes ; then
 
5890
        dnl use -O0 because compiling with it is faster than compiling with no
 
5891
        dnl optimization options at all (at least with g++ 3.2)
 
5892
        OPTIMISE_CFLAGS="-O0"
 
5893
    fi
 
5894
else
 
5895
    if test "$GCC" = yes ; then
 
5896
        case "${host}" in
 
5897
            *-pc-os2_emx | *-pc-os2-emx )
 
5898
                dnl Not all of the supported gcc versions understand
 
5899
                dnl -fstrict-aliasing and none actually needs it (yet).
 
5900
                OPTIMISE_CFLAGS="-O2"
 
5901
            ;;
 
5902
            *)
 
5903
                dnl Switch on optimisation but keep strict-aliasing off for
 
5904
                dnl now (see -fstrict-aliasing in the gcc manual). When it is
 
5905
                dnl switched back on consider using -Wstrict-aliasing=2.
 
5906
                OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
 
5907
            ;;
 
5908
        esac
 
5909
    else
 
5910
        OPTIMISE_CFLAGS="-O"
 
5911
    fi
 
5912
fi
 
5913
 
 
5914
dnl ---------------------------------------------------------------------------
 
5915
dnl compatibility level
 
5916
dnl ---------------------------------------------------------------------------
 
5917
 
 
5918
if test "x$WXWIN_COMPATIBILITY_2_4" = "xyes"; then
 
5919
    AC_DEFINE(WXWIN_COMPATIBILITY_2_4)
 
5920
 
 
5921
    WXWIN_COMPATIBILITY_2_6="yes"
 
5922
fi
 
5923
 
 
5924
if test "x$WXWIN_COMPATIBILITY_2_6" != "xno"; then
 
5925
    AC_DEFINE(WXWIN_COMPATIBILITY_2_6)
 
5926
fi
 
5927
 
 
5928
dnl ---------------------------------------------------------------------------
 
5929
dnl the library may be built without GUI classes at all
 
5930
dnl ---------------------------------------------------------------------------
 
5931
 
 
5932
if test "$wxUSE_GUI" = "yes"; then
 
5933
    AC_DEFINE(wxUSE_GUI)
 
5934
 
 
5935
    dnl the things we always pull in the GUI version of the library:
 
5936
    dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
 
5937
    dnl    library really can't be built without those)
 
5938
    dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
 
5939
    dnl    almost any program and the first 2 are needed to show a message box
 
5940
    dnl    which want to be always able to do)
 
5941
    dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
 
5942
    dnl    to compile without them (if the app doesn't do any drawing, it doesn't
 
5943
    dnl    need the dcs, pens, brushes, ...), this just can't be done now
 
5944
    dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
 
5945
    dnl 5. misc stuff: timers, settings, message box
 
5946
fi
 
5947
 
 
5948
dnl ---------------------------------------------------------------------------
 
5949
dnl Unix/Windows
 
5950
dnl ---------------------------------------------------------------------------
 
5951
 
 
5952
if test "$wxUSE_UNIX" = "yes"; then
 
5953
  AC_DEFINE(wxUSE_UNIX)
 
5954
fi
 
5955
 
 
5956
dnl ------------------------------------------------------------------------
 
5957
dnl DLL support
 
5958
dnl ------------------------------------------------------------------------
 
5959
 
 
5960
dnl under MSW we always have LoadLibrary/GetProcAddress
 
5961
if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
 
5962
 
 
5963
    HAVE_DL_FUNCS=0
 
5964
    HAVE_SHL_FUNCS=0
 
5965
    if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then
 
5966
        if test "$USE_DOS" = 1; then
 
5967
            HAVE_DL_FUNCS=0
 
5968
        else
 
5969
            dnl the test is a bit complicated because we check for dlopen() both with
 
5970
            dnl and without -ldl and we also try to find shl_load() if there is no
 
5971
            dnl dlopen() on this system
 
5972
            AC_CHECK_FUNCS(dlopen,
 
5973
            [
 
5974
                AC_DEFINE(HAVE_DLOPEN)
 
5975
                HAVE_DL_FUNCS=1
 
5976
            ],
 
5977
            [
 
5978
                AC_CHECK_LIB(dl, dlopen,
 
5979
                            [
 
5980
                                AC_DEFINE(HAVE_DLOPEN)
 
5981
                                HAVE_DL_FUNCS=1
 
5982
                                DL_LINK=" -ldl$DL_LINK"
 
5983
                            ],
 
5984
                            [
 
5985
                                AC_CHECK_FUNCS(shl_load,
 
5986
                                              [
 
5987
                                                AC_DEFINE(HAVE_SHL_LOAD)
 
5988
                                                HAVE_SHL_FUNCS=1
 
5989
                                              ],
 
5990
                                              [
 
5991
                                                AC_CHECK_LIB(shl_load, dld,
 
5992
                                                             [
 
5993
                                                                HAVE_SHL_FUNCS=1
 
5994
                                                                DL_LINK=" -ldld$DL_LINK"
 
5995
                                                             ])
 
5996
                                              ])
 
5997
                            ])
 
5998
            ])
 
5999
 
 
6000
            dnl check also for dlerror()
 
6001
            if test "$HAVE_DL_FUNCS" = 1; then
 
6002
                AC_CHECK_FUNCS(dlerror,
 
6003
                    AC_DEFINE(HAVE_DLERROR),
 
6004
                    [
 
6005
                        AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))
 
6006
                    ]
 
6007
                )
 
6008
            fi
 
6009
        fi
 
6010
 
 
6011
        dnl Force HAVE_DL_FUNCS on for Darwin, even if the tests failed (e.g. pre-10.3)
 
6012
        if test "$USE_DARWIN" = 1; then
 
6013
            dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
 
6014
            HAVE_DL_FUNCS=1
 
6015
        fi
 
6016
 
 
6017
        if test "$HAVE_DL_FUNCS" = 0; then
 
6018
            if test "$HAVE_SHL_FUNCS" = 0; then
 
6019
              if test "$USE_UNIX" = 1 -o "$USE_DOS" = 1; then
 
6020
                  AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
 
6021
                  wxUSE_DYNAMIC_LOADER=no
 
6022
                  wxUSE_DYNLIB_CLASS=no
 
6023
              else
 
6024
                  AC_MSG_WARN([Assuming wxLibrary class works on this platform])
 
6025
              fi
 
6026
            fi
 
6027
        fi
 
6028
    fi
 
6029
fi
 
6030
 
 
6031
if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
 
6032
    AC_DEFINE(wxUSE_DYNAMIC_LOADER)
 
6033
fi
 
6034
if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
 
6035
    AC_DEFINE(wxUSE_DYNLIB_CLASS)
 
6036
fi
 
6037
 
 
6038
 
 
6039
dnl ---------------------------------------------------------------------------
 
6040
dnl Verify consistency of plugins/monolithic/shared settings:
 
6041
dnl ---------------------------------------------------------------------------
 
6042
 
 
6043
if test "$wxUSE_PLUGINS" = "yes" ; then
 
6044
    if test "$wxUSE_SHARED" = "no" ; then
 
6045
        AC_MSG_WARN([plugins supported only in shared build, disabling])
 
6046
        wxUSE_PLUGINS=no
 
6047
    fi
 
6048
    if test "$wxUSE_MONOLITHIC" = "yes" ; then
 
6049
        AC_MSG_WARN([plugins not supported monolithic build, disabling])
 
6050
        wxUSE_PLUGINS=no
 
6051
    fi
 
6052
    if test "$wxUSE_DYNLIB_CLASS" = "no" ; then
 
6053
        AC_MSG_WARN([plugins require wxDynamicLibrary, disabling])
 
6054
        wxUSE_PLUGINS=no
 
6055
    fi
 
6056
    if test "$wxUSE_PLUGINS" = "yes" ; then
 
6057
        AC_DEFINE(wxUSE_PLUGINS)
 
6058
    fi
 
6059
fi
 
6060
 
 
6061
dnl ---------------------------------------------------------------------------
 
6062
dnl Register non-GUI class options for makefiles and setup.h
 
6063
dnl ---------------------------------------------------------------------------
 
6064
 
 
6065
if test "$wxUSE_STL" = "yes"; then
 
6066
  AC_DEFINE(wxUSE_STL)
 
6067
fi
 
6068
 
 
6069
if test "$wxUSE_APPLE_IEEE" = "yes"; then
 
6070
  AC_DEFINE(wxUSE_APPLE_IEEE)
 
6071
fi
 
6072
 
 
6073
if test "$wxUSE_TIMER" = "yes"; then
 
6074
  AC_DEFINE(wxUSE_TIMER)
 
6075
fi
 
6076
 
 
6077
dnl Unix implementation needs additional checks because audio support
 
6078
dnl comes in many favours:
 
6079
if test "$USE_UNIX" = "1" ; then
 
6080
    dnl mmedia doesn't compile with wxMGL, remove this if this is ever fixed
 
6081
    if test "$wxUSE_MGL" != 1; then
 
6082
        dnl it's not enough to check for just the header because OSS under NetBSD
 
6083
        dnl redefines ioctl as oss_ioctrl inside it and so we also need to test
 
6084
        dnl whether we need -lossaudio at link-time
 
6085
        AC_CACHE_CHECK([for SNDCTL_DSP_SPEED in sys/soundcard.h], ac_cv_header_sys_soundcard, [
 
6086
            AC_TRY_LINK([
 
6087
                    #include <sys/ioctl.h>
 
6088
                    #include <sys/soundcard.h>
 
6089
                ],
 
6090
                [
 
6091
                    ioctl(0, SNDCTL_DSP_SPEED, 0);
 
6092
                ],
 
6093
                ac_cv_header_sys_soundcard=yes,
 
6094
                [
 
6095
                    saveLibs="$LIBS"
 
6096
                    LIBS="$saveLibs -lossaudio"
 
6097
                    AC_TRY_LINK([
 
6098
                            #include <sys/ioctl.h>
 
6099
                            #include <sys/soundcard.h>
 
6100
                        ],
 
6101
                        [
 
6102
                            ioctl(0, SNDCTL_DSP_SPEED, 0);
 
6103
                        ],
 
6104
                        ac_cv_header_sys_soundcard=yes,
 
6105
                        [
 
6106
                            LIBS="$saveLibs"
 
6107
                            ac_cv_header_sys_soundcard=no
 
6108
                        ]
 
6109
                    )
 
6110
                ]
 
6111
            )
 
6112
        ])
 
6113
    fi
 
6114
 
 
6115
    if test "$ac_cv_header_sys_soundcard" = "yes"; then
 
6116
        AC_DEFINE(HAVE_SYS_SOUNDCARD_H)
 
6117
    else
 
6118
        DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia"
 
6119
    fi
 
6120
fi
 
6121
 
 
6122
WITH_PLUGIN_SDL=0
 
6123
if test "$wxUSE_SOUND" = "yes"; then
 
6124
  if test "$USE_UNIX" = "1" ; then
 
6125
    if test "$wxUSE_LIBSDL" != "no"; then
 
6126
      AM_PATH_SDL([1.2.0],
 
6127
                  [
 
6128
                    EXTRALIBS_SDL="$SDL_LIBS"
 
6129
                    CFLAGS="$SDL_CFLAGS $CFLAGS"
 
6130
                    CXXFLAGS="$SDL_CFLAGS $CXXFLAGS"
 
6131
                    AC_DEFINE(wxUSE_LIBSDL)
 
6132
                  ],
 
6133
                  [wxUSE_LIBSDL="no"])
 
6134
      if test "$wxUSE_LIBSDL" = "yes" -a "$wxUSE_PLUGINS" = "yes" ; then
 
6135
        WITH_PLUGIN_SDL=1
 
6136
      fi
 
6137
    fi
 
6138
  else
 
6139
    dnl wxMGL doesn't support sound under DOS, only under Unix
 
6140
    if test "$wxUSE_MGL" = 1; then
 
6141
        AC_MSG_WARN([wxSound not supported in MGL under DOS... disabled])
 
6142
        wxUSE_SOUND="no"
 
6143
    fi
 
6144
  fi
 
6145
fi
 
6146
 
 
6147
if test "$wxUSE_SOUND" = "yes"; then
 
6148
  AC_DEFINE(wxUSE_SOUND)
 
6149
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sound"
 
6150
fi
 
6151
 
 
6152
if test "$WXGTK20" = 1; then
 
6153
    PKG_PROG_PKG_CONFIG()
 
6154
 
 
6155
    if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
 
6156
        if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then
 
6157
 
 
6158
                PKG_CHECK_MODULES(LIBGNOMEPRINTUI,
 
6159
                                  [libgnomeprintui-2.2 >= 2.8],
 
6160
                    [
 
6161
                        CFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CFLAGS"
 
6162
                        CXXFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CXXFLAGS"
 
6163
                        AC_DEFINE(wxUSE_LIBGNOMEPRINT)
 
6164
                    ],
 
6165
                    [
 
6166
                        AC_MSG_WARN([libgnomeprintui not found, library will use standard PostScript printing])
 
6167
                        wxUSE_LIBGNOMEPRINT="no"
 
6168
                    ]
 
6169
                )
 
6170
        fi
 
6171
    fi
 
6172
 
 
6173
    if test "$wxUSE_MIMETYPE" = "yes" ; then
 
6174
        if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
 
6175
 
 
6176
                PKG_CHECK_MODULES(GNOMEVFS,
 
6177
                                  [gnome-vfs-2.0 >= 2.0],
 
6178
                    [
 
6179
                        CFLAGS="$GNOMEVFS_CFLAGS $CFLAGS"
 
6180
                        CXXFLAGS="$GNOMEVFS_CFLAGS $CXXFLAGS"
 
6181
                        AC_DEFINE(wxUSE_LIBGNOMEVFS)
 
6182
                    ],
 
6183
                    [
 
6184
                        AC_MSG_WARN([libgnomevfs not found, library won't be able to associate MIME type])
 
6185
                        wxUSE_LIBGNOMEVFS="no"
 
6186
                    ]
 
6187
                )
 
6188
        fi
 
6189
    fi
 
6190
 
 
6191
    if test "$wxUSE_LIBHILDON" = "yes" ; then
 
6192
        PKG_CHECK_MODULES(HILDON,
 
6193
                          [hildon-lgpl >= 0.9],
 
6194
            [
 
6195
                EXTRALIBS_HILDON="$HILDON_LIBS"
 
6196
                CFLAGS="$CFLAGS $HILDON_CFLAGS"
 
6197
                CXXFLAGS="$CXXFLAGS $HILDON_CFLAGS"
 
6198
                AC_DEFINE(wxUSE_LIBHILDON)
 
6199
            ],
 
6200
            [
 
6201
                AC_MSG_WARN([libhildon_lgpl not found])
 
6202
                        wxUSE_LIBHILDON="no"
 
6203
            ]
 
6204
        )
 
6205
    fi
 
6206
fi
 
6207
 
 
6208
if test "$wxUSE_CMDLINE_PARSER" = "yes"; then
 
6209
  AC_DEFINE(wxUSE_CMDLINE_PARSER)
 
6210
fi
 
6211
 
 
6212
if test "$wxUSE_STOPWATCH" = "yes"; then
 
6213
  AC_DEFINE(wxUSE_STOPWATCH)
 
6214
fi
 
6215
 
 
6216
if test "$wxUSE_DATETIME" = "yes"; then
 
6217
  AC_DEFINE(wxUSE_DATETIME)
 
6218
fi
 
6219
 
 
6220
if test "$wxUSE_FILE" = "yes"; then
 
6221
  AC_DEFINE(wxUSE_FILE)
 
6222
fi
 
6223
 
 
6224
if test "$wxUSE_FFILE" = "yes"; then
 
6225
  AC_DEFINE(wxUSE_FFILE)
 
6226
fi
 
6227
 
 
6228
if test "$wxUSE_ARCHIVE_STREAMS" = "yes"; then
 
6229
  if test "$wxUSE_STREAMS" != yes; then
 
6230
    AC_MSG_WARN(wxArchive requires wxStreams... disabled)
 
6231
    wxUSE_ARCHIVE_STREAMS=no
 
6232
  else
 
6233
    AC_DEFINE(wxUSE_ARCHIVE_STREAMS)
 
6234
  fi
 
6235
fi
 
6236
 
 
6237
if test "$wxUSE_ZIPSTREAM" = "yes"; then
 
6238
  if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then
 
6239
    AC_MSG_WARN(wxZip requires wxArchive... disabled)
 
6240
  elif test "$wxUSE_ZLIB" = "no"; then
 
6241
    AC_MSG_WARN(wxZip requires wxZlib... disabled)
 
6242
  else
 
6243
    AC_DEFINE(wxUSE_ZIPSTREAM)
 
6244
  fi
 
6245
fi
 
6246
 
 
6247
if test "$wxUSE_TARSTREAM" = "yes"; then
 
6248
  if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then
 
6249
    AC_MSG_WARN(wxTar requires wxArchive... disabled)
 
6250
  else
 
6251
    AC_DEFINE(wxUSE_TARSTREAM)
 
6252
  fi
 
6253
fi
 
6254
 
 
6255
if test "$wxUSE_FILESYSTEM" = "yes"; then
 
6256
  if test "$wxUSE_STREAMS" != yes -o \( "$wxUSE_FILE" != yes -a "$wxUSE_FFILE" != yes \); then
 
6257
    AC_MSG_WARN(wxFileSystem requires wxStreams and wxFile or wxFFile... disabled)
 
6258
    wxUSE_FILESYSTEM=no
 
6259
  else
 
6260
    AC_DEFINE(wxUSE_FILESYSTEM)
 
6261
  fi
 
6262
fi
 
6263
 
 
6264
if test "$wxUSE_FS_ARCHIVE" = "yes"; then
 
6265
  if test "$wxUSE_FILESYSTEM" != yes -o "$wxUSE_ARCHIVE_STREAMS" != yes; then
 
6266
    AC_MSG_WARN(wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled)
 
6267
  else
 
6268
    AC_DEFINE(wxUSE_FS_ARCHIVE)
 
6269
  fi
 
6270
fi
 
6271
 
 
6272
if test "$wxUSE_FS_ZIP" = "yes"; then
 
6273
  if test "$wxUSE_FS_ARCHIVE" != yes; then
 
6274
    AC_MSG_WARN(wxZipFSHandler requires wxArchiveFSHandler... disabled)
 
6275
  else
 
6276
    AC_DEFINE(wxUSE_FS_ZIP)
 
6277
  fi
 
6278
fi
 
6279
 
 
6280
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
 
6281
  if test "$USE_UNIX" != 1; then
 
6282
    AC_MSG_WARN([Catching fatal exceptions not currently supported on this system, wxApp::OnFatalException will not be called])
 
6283
    wxUSE_ON_FATAL_EXCEPTION=no
 
6284
  else
 
6285
    AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION)
 
6286
  fi
 
6287
fi
 
6288
 
 
6289
if test "$wxUSE_STACKWALKER" = "yes"; then
 
6290
    AC_DEFINE(wxUSE_STACKWALKER)
 
6291
fi
 
6292
 
 
6293
if test "$wxUSE_DEBUGREPORT" = "yes"; then
 
6294
    if test "$USE_UNIX" != "1" -a "$USE_WIN32" != "1"; then
 
6295
        AC_MSG_WARN([Creating debug reports not currently supported on this system, disabled])
 
6296
        wxUSE_DEBUGREPORT=no
 
6297
    else
 
6298
        AC_DEFINE(wxUSE_DEBUGREPORT)
 
6299
        if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
 
6300
            SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS debugrpt"
 
6301
        fi
 
6302
    fi
 
6303
fi
 
6304
 
 
6305
if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
 
6306
  AC_DEFINE(wxUSE_SNGLINST_CHECKER)
 
6307
fi
 
6308
 
 
6309
if test "$wxUSE_BUSYINFO" = "yes"; then
 
6310
  AC_DEFINE(wxUSE_BUSYINFO)
 
6311
fi
 
6312
 
 
6313
if test "$wxUSE_STD_IOSTREAM" = "yes"; then
 
6314
  AC_DEFINE(wxUSE_STD_IOSTREAM)
 
6315
fi
 
6316
 
 
6317
if test "$wxUSE_STD_STRING" = "yes"; then
 
6318
  AC_DEFINE(wxUSE_STD_STRING)
 
6319
fi
 
6320
 
 
6321
if test "$wxUSE_STDPATHS" = "yes"; then
 
6322
  AC_DEFINE(wxUSE_STDPATHS)
 
6323
fi
 
6324
 
 
6325
if test "$wxUSE_TEXTBUFFER" = "yes"; then
 
6326
    AC_DEFINE(wxUSE_TEXTBUFFER)
 
6327
fi
 
6328
 
 
6329
if test "$wxUSE_TEXTFILE" = "yes"; then
 
6330
  if test "$wxUSE_FILE" != "yes" -o "$wxUSE_TEXTBUFFER" != "yes" ; then
 
6331
    AC_MSG_WARN(wxTextFile requires wxFile and wxTextBuffer... disabled)
 
6332
  else
 
6333
    AC_DEFINE(wxUSE_TEXTFILE)
 
6334
  fi
 
6335
fi
 
6336
 
 
6337
if test "$wxUSE_CONFIG" = "yes" ; then
 
6338
  if test "$wxUSE_TEXTFILE" != "yes"; then
 
6339
    AC_MSG_WARN(wxConfig requires wxTextFile... disabled)
 
6340
  else
 
6341
    AC_DEFINE(wxUSE_CONFIG)
 
6342
    AC_DEFINE(wxUSE_CONFIG_NATIVE)
 
6343
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
 
6344
  fi
 
6345
fi
 
6346
 
 
6347
if test "$wxUSE_INTL" = "yes" ; then
 
6348
  if test "$wxUSE_FILE" != "yes"; then
 
6349
    AC_MSG_WARN(I18n code requires wxFile... disabled)
 
6350
  else
 
6351
    AC_DEFINE(wxUSE_INTL)
 
6352
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
 
6353
    GUIDIST="$GUIDIST INTL_DIST"
 
6354
  fi
 
6355
fi
 
6356
 
 
6357
if test "$wxUSE_LOG" = "yes"; then
 
6358
  AC_DEFINE(wxUSE_LOG)
 
6359
 
 
6360
    if test "$wxUSE_LOGGUI" = "yes"; then
 
6361
      AC_DEFINE(wxUSE_LOGGUI)
 
6362
    fi
 
6363
 
 
6364
    if test "$wxUSE_LOGWINDOW" = "yes"; then
 
6365
      AC_DEFINE(wxUSE_LOGWINDOW)
 
6366
    fi
 
6367
 
 
6368
    if test "$wxUSE_LOGDIALOG" = "yes"; then
 
6369
      AC_DEFINE(wxUSE_LOG_DIALOG)
 
6370
    fi
 
6371
 
 
6372
    dnl the keyboard sample requires wxUSE_LOG
 
6373
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
 
6374
fi
 
6375
 
 
6376
if test "$wxUSE_LONGLONG" = "yes"; then
 
6377
  AC_DEFINE(wxUSE_LONGLONG)
 
6378
fi
 
6379
 
 
6380
if test "$wxUSE_GEOMETRY" = "yes"; then
 
6381
  AC_DEFINE(wxUSE_GEOMETRY)
 
6382
fi
 
6383
 
 
6384
if test "$wxUSE_STREAMS" = "yes" ; then
 
6385
  AC_DEFINE(wxUSE_STREAMS)
 
6386
fi
 
6387
 
 
6388
if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
 
6389
  AC_DEFINE(wxUSE_PRINTF_POS_PARAMS)
 
6390
fi
 
6391
 
 
6392
if test "$wxUSE_OBJC_UNIQUIFYING" = "yes"; then
 
6393
  AC_DEFINE(wxUSE_OBJC_UNIQUIFYING)
 
6394
fi
 
6395
 
 
6396
if test "$wxUSE_ABI_INCOMPATIBLE_FEATURES" = "yes"; then
 
6397
  AC_DEFINE(wxUSE_ABI_INCOMPATIBLE_FEATURES)
 
6398
fi
 
6399
 
 
6400
dnl ---------------------------------------------------------------------------
 
6401
dnl time/date functions
 
6402
dnl ---------------------------------------------------------------------------
 
6403
 
 
6404
if test "$wxUSE_DATETIME" = "yes"; then
 
6405
    dnl check for strptime and for its declaration as some systems lack it
 
6406
    AC_CHECK_FUNC(strptime)
 
6407
    if test "$ac_cv_func_strptime" = "yes"; then
 
6408
        AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl,
 
6409
            [
 
6410
                AC_LANG_PUSH(C++)
 
6411
                AC_TRY_COMPILE(
 
6412
                    [
 
6413
                        #include <time.h>
 
6414
                    ],
 
6415
                    [
 
6416
                        struct tm t;
 
6417
                        strptime("foo", "bar", &t);
 
6418
                    ],
 
6419
                    wx_cv_func_strptime_decl=yes,
 
6420
                    wx_cv_func_strptime_decl=no
 
6421
                )
 
6422
                AC_LANG_POP()
 
6423
            ]
 
6424
        )
 
6425
    fi
 
6426
    if test "$wx_cv_func_strptime_decl" = "yes"; then
 
6427
        AC_DEFINE(HAVE_STRPTIME_DECL)
 
6428
    else
 
6429
        wx_strptime_decl="extern char *strptime(const char *, const char *, struct tm *);"
 
6430
    fi
 
6431
    if test "$ac_cv_func_strptime" = "yes"; then
 
6432
        dnl strptime() behaviour doesn't conform to POSIX under Mac OS X <
 
6433
        dnl 10.5 and possibly other BSD variants, check that strptime() we
 
6434
        dnl have fails to parse format when the string doesn't match it instea
 
6435
        dnl of just stopping immediately and returning non-NULL
 
6436
        AC_CACHE_CHECK([whether strptime() fails on invalid strings],
 
6437
            wx_cv_func_strptime_ok,
 
6438
            [AC_RUN_IFELSE(
 
6439
                [
 
6440
                    #include <stdlib.h>
 
6441
                    #include <time.h>
 
6442
                    #include "confdefs.h"
 
6443
 
 
6444
                    $wx_strptime_decl
 
6445
 
 
6446
                    int main()
 
6447
                    {
 
6448
                        struct tm t;
 
6449
                        return !!strptime("", "%x", &t);
 
6450
                    }
 
6451
                ],
 
6452
                wx_cv_func_strptime_ok=yes,
 
6453
                wx_cv_func_strptime_ok=no,
 
6454
                dnl be pessimistic when cross-compiling
 
6455
                wx_cv_func_strptime_ok=no
 
6456
            )]
 
6457
        )
 
6458
 
 
6459
        if test "$wx_cv_func_strptime_ok" = "yes"; then
 
6460
            AC_DEFINE(HAVE_STRPTIME)
 
6461
        fi
 
6462
    fi
 
6463
 
 
6464
    dnl check for timezone variable
 
6465
    dnl   doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead
 
6466
    AC_CACHE_CHECK(for timezone variable in <time.h>,
 
6467
                   wx_cv_var_timezone,
 
6468
                   [
 
6469
                        AC_LANG_PUSH(C++)
 
6470
                        AC_TRY_COMPILE(
 
6471
                            [
 
6472
                                #include <time.h>
 
6473
                            ],
 
6474
                            [
 
6475
                                int tz;
 
6476
                                tz = timezone;
 
6477
                            ],
 
6478
                            [
 
6479
                                wx_cv_var_timezone=timezone
 
6480
                            ],
 
6481
                            [
 
6482
                                AC_TRY_COMPILE(
 
6483
                                    [
 
6484
                                        #include <time.h>
 
6485
                                    ],
 
6486
                                    [
 
6487
                                        int tz;
 
6488
                                        tz = _timezone;
 
6489
                                    ],
 
6490
                                    [
 
6491
                                        wx_cv_var_timezone=_timezone
 
6492
                                    ],
 
6493
                                    [
 
6494
                                        AC_TRY_COMPILE(
 
6495
                                            [
 
6496
                                                #include <time.h>
 
6497
                                            ],
 
6498
                                            [
 
6499
                                                int tz;
 
6500
                                                tz = __timezone;
 
6501
                                            ],
 
6502
                                            [
 
6503
                                                wx_cv_var_timezone=__timezone
 
6504
                                            ],
 
6505
                                            [
 
6506
                                                if test "$USE_DOS" = 0 ; then
 
6507
                                                    AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead)
 
6508
                                                fi
 
6509
                                            ]
 
6510
                                        )
 
6511
                                    ]
 
6512
                                )
 
6513
                            ]
 
6514
                        )
 
6515
                        AC_LANG_POP()
 
6516
                   ]
 
6517
    )
 
6518
 
 
6519
    dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
 
6520
    if test "x$wx_cv_var_timezone" != x ; then
 
6521
        AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
 
6522
    fi
 
6523
 
 
6524
    dnl check for localtime (it's POSIX, but the check can do no harm...)
 
6525
    AC_CHECK_FUNCS(localtime)
 
6526
 
 
6527
    if test "$ac_cv_func_localtime" = "yes"; then
 
6528
        AC_CACHE_CHECK(for tm_gmtoff in struct tm,
 
6529
                       wx_cv_struct_tm_has_gmtoff,
 
6530
        [
 
6531
            AC_TRY_COMPILE(
 
6532
                [
 
6533
                    #include <time.h>
 
6534
                ],
 
6535
                [
 
6536
                    struct tm tm;
 
6537
                    tm.tm_gmtoff++;
 
6538
                ],
 
6539
                [
 
6540
                    wx_cv_struct_tm_has_gmtoff=yes
 
6541
                ],
 
6542
                wx_cv_struct_tm_has_gmtoff=no
 
6543
            )
 
6544
        ])
 
6545
    fi
 
6546
 
 
6547
    if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then
 
6548
        AC_DEFINE(WX_GMTOFF_IN_TM)
 
6549
    fi
 
6550
 
 
6551
    dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the
 
6552
    dnl function to be used for high resolution timers
 
6553
    AC_CHECK_FUNCS(gettimeofday ftime, break)
 
6554
 
 
6555
    if test "$ac_cv_func_gettimeofday" = "yes"; then
 
6556
        AC_CACHE_CHECK([whether gettimeofday takes two arguments],
 
6557
                       wx_cv_func_gettimeofday_has_2_args,
 
6558
        [
 
6559
            dnl on some _really_ old systems it takes only 1 argument
 
6560
            AC_TRY_COMPILE(
 
6561
                [
 
6562
                    #include <sys/time.h>
 
6563
                    #include <unistd.h>
 
6564
                ],
 
6565
                [
 
6566
                    struct timeval tv;
 
6567
                    gettimeofday(&tv, NULL);
 
6568
                ],
 
6569
                wx_cv_func_gettimeofday_has_2_args=yes,
 
6570
                AC_TRY_COMPILE(
 
6571
                    [
 
6572
                        #include <sys/time.h>
 
6573
                        #include <unistd.h>
 
6574
                    ],
 
6575
                    [
 
6576
                        struct timeval tv;
 
6577
                        gettimeofday(&tv);
 
6578
                    ],
 
6579
                    wx_cv_func_gettimeofday_has_2_args=no,
 
6580
                    [
 
6581
                        AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
 
6582
                        wx_cv_func_gettimeofday_has_2_args=unknown
 
6583
                    ]
 
6584
                )
 
6585
            )
 
6586
        ])
 
6587
 
 
6588
        if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
 
6589
            AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
 
6590
        fi
 
6591
    fi
 
6592
 
 
6593
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
 
6594
fi
 
6595
 
 
6596
dnl ------------------------------------------------------------------------
 
6597
dnl wxSocket
 
6598
dnl ------------------------------------------------------------------------
 
6599
 
 
6600
dnl VZ: the GUI hooks wxSocket needs are not implemented yet in some toolkits
 
6601
if test "$wxUSE_SOCKETS" = "yes"; then
 
6602
    if test "$wxUSE_MGL" = "1"; then
 
6603
        AC_MSG_WARN([wxSocket not yet supported under MGL... disabled])
 
6604
        wxUSE_SOCKETS="no"
 
6605
    fi
 
6606
fi
 
6607
 
 
6608
if test "$wxUSE_SOCKETS" = "yes"; then
 
6609
    dnl under MSW we always have sockets
 
6610
    if test "$TOOLKIT" != "MSW"; then
 
6611
        dnl under Solaris and OS/2, socket functions live in -lsocket
 
6612
        AC_CHECK_FUNC(socket,,
 
6613
            [
 
6614
                AC_CHECK_LIB(socket, socket,
 
6615
                    if test "$INET_LINK" != " -lsocket"; then
 
6616
                        INET_LINK="$INET_LINK -lsocket"
 
6617
                    fi,
 
6618
                    [
 
6619
                        AC_MSG_WARN([socket library not found - sockets will be disabled])
 
6620
                        wxUSE_SOCKETS=no
 
6621
                    ]
 
6622
                )
 
6623
            ]
 
6624
        )
 
6625
    fi
 
6626
fi
 
6627
 
 
6628
if test "$wxUSE_SOCKETS" = "yes" ; then
 
6629
    dnl this test may be appropriate if building under cygwin
 
6630
    dnl right now I'm assuming it also uses the winsock stuff
 
6631
    dnl like mingw does..  -- RL
 
6632
    if test "$TOOLKIT" != "MSW"; then
 
6633
        dnl determine the type of third argument for getsockname
 
6634
        dnl This test needs to be done in C++ mode since gsocket.cpp now
 
6635
        dnl is C++ code and pointer cast that are possible even without
 
6636
        dnl warning in C still fail in C++.
 
6637
        AC_CACHE_CHECK([what is the type of the third argument of getsockname],
 
6638
                       wx_cv_type_getsockname3,
 
6639
            [
 
6640
                AC_LANG_PUSH(C++)
 
6641
                AC_TRY_COMPILE(
 
6642
                    [
 
6643
                        #include <sys/types.h>
 
6644
                        #include <sys/socket.h>
 
6645
                    ],
 
6646
                    [
 
6647
                        socklen_t len;
 
6648
                        getsockname(0, 0, &len);
 
6649
                    ],
 
6650
                    wx_cv_type_getsockname3=socklen_t,
 
6651
                    [
 
6652
                        dnl the compiler will compile the version with size_t
 
6653
                        dnl even if the real type of the last parameter is int
 
6654
                        dnl but it should give at least a warning about
 
6655
                        dnl converting between incompatible pointer types, so
 
6656
                        dnl try to use it to get the correct behaviour at
 
6657
                        dnl least with gcc (otherwise we'd always use size_t)
 
6658
                        CFLAGS_OLD="$CFLAGS"
 
6659
                        if test "$GCC" = yes ; then
 
6660
                            CFLAGS="-Werror $CFLAGS"
 
6661
                        fi
 
6662
 
 
6663
                        AC_TRY_COMPILE(
 
6664
                            [
 
6665
                                #include <sys/types.h>
 
6666
                                #include <sys/socket.h>
 
6667
                            ],
 
6668
                            [
 
6669
                                size_t len;
 
6670
                                getsockname(0, 0, &len);
 
6671
                            ],
 
6672
                            wx_cv_type_getsockname3=size_t,
 
6673
                            AC_TRY_COMPILE(
 
6674
                                [
 
6675
                                    #include <sys/types.h>
 
6676
                                    #include <sys/socket.h>
 
6677
                                ],
 
6678
                                [
 
6679
                                    int len;
 
6680
                                    getsockname(0, 0, &len);
 
6681
                                ],
 
6682
                                wx_cv_type_getsockname3=int,
 
6683
                                wx_cv_type_getsockname3=unknown
 
6684
                            )
 
6685
                        )
 
6686
 
 
6687
                        CFLAGS="$CFLAGS_OLD"
 
6688
                    ]
 
6689
                )
 
6690
                AC_LANG_POP()
 
6691
            ])
 
6692
 
 
6693
        if test "$wx_cv_type_getsockname3" = "unknown"; then
 
6694
            wxUSE_SOCKETS=no
 
6695
            AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
 
6696
        else
 
6697
            AC_DEFINE_UNQUOTED(WX_SOCKLEN_T, $wx_cv_type_getsockname3)
 
6698
        fi
 
6699
        dnl Do this again for getsockopt as it may be different
 
6700
        AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt],
 
6701
                       wx_cv_type_getsockopt5,
 
6702
            [
 
6703
                AC_LANG_PUSH(C++)
 
6704
                AC_TRY_COMPILE(
 
6705
                    [
 
6706
                        #include <sys/types.h>
 
6707
                        #include <sys/socket.h>
 
6708
                    ],
 
6709
                    [
 
6710
                        socklen_t len;
 
6711
                        getsockopt(0, 0, 0, 0, &len);
 
6712
                    ],
 
6713
                    wx_cv_type_getsockopt5=socklen_t,
 
6714
                    [
 
6715
                        dnl Note that the rules for compatibility of pointers
 
6716
                        dnl are somewhat different between C and C++, so code 
 
6717
                        dnl that fails in C++ may not even give a warning about
 
6718
                        dnl converting between incompatible pointer types in C.
 
6719
                        dnl So this test needs to be done in C++ mode.
 
6720
                        AC_LANG_PUSH(C++)
 
6721
                        AC_TRY_COMPILE(
 
6722
                            [
 
6723
                                #include <sys/types.h>
 
6724
                                #include <sys/socket.h>
 
6725
                            ],
 
6726
                            [
 
6727
                                size_t len;
 
6728
                                getsockopt(0, 0, 0, 0, &len);
 
6729
                            ],
 
6730
                            wx_cv_type_getsockopt5=size_t,
 
6731
                            AC_TRY_COMPILE(
 
6732
                                [
 
6733
                                    #include <sys/types.h>
 
6734
                                    #include <sys/socket.h>
 
6735
                                ],
 
6736
                                [
 
6737
                                    int len;
 
6738
                                    getsockopt(0, 0, 0, 0, &len);
 
6739
                                ],
 
6740
                                wx_cv_type_getsockopt5=int,
 
6741
                                wx_cv_type_getsockopt5=unknown
 
6742
                            )
 
6743
                        )
 
6744
                        AC_LANG_POP()
 
6745
                    ]
 
6746
                )
 
6747
                AC_LANG_POP()
 
6748
            ])
 
6749
 
 
6750
        if test "$wx_cv_type_getsockopt5" = "unknown"; then
 
6751
            wxUSE_SOCKETS=no
 
6752
            AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
 
6753
        else
 
6754
            AC_DEFINE_UNQUOTED(SOCKOPTLEN_T, $wx_cv_type_getsockopt5)
 
6755
        fi
 
6756
    fi
 
6757
fi
 
6758
 
 
6759
if test "$wxUSE_SOCKETS" = "yes" ; then
 
6760
    AC_DEFINE(wxUSE_SOCKETS)
 
6761
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
 
6762
fi
 
6763
 
 
6764
if test "$wxUSE_PROTOCOL" = "yes"; then
 
6765
    if test "$wxUSE_SOCKETS" != "yes"; then
 
6766
        AC_MSG_WARN(Protocol classes require sockets... disabled)
 
6767
        wxUSE_PROTOCOL=no
 
6768
    fi
 
6769
fi
 
6770
 
 
6771
if test "$wxUSE_PROTOCOL" = "yes"; then
 
6772
    AC_DEFINE(wxUSE_PROTOCOL)
 
6773
 
 
6774
    if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then
 
6775
        AC_DEFINE(wxUSE_PROTOCOL_HTTP)
 
6776
    fi
 
6777
    if test "$wxUSE_PROTOCOL_FTP" = "yes"; then
 
6778
        AC_DEFINE(wxUSE_PROTOCOL_FTP)
 
6779
    fi
 
6780
    if test "$wxUSE_PROTOCOL_FILE" = "yes"; then
 
6781
        AC_DEFINE(wxUSE_PROTOCOL_FILE)
 
6782
    fi
 
6783
else
 
6784
    if test "$wxUSE_FS_INET" = "yes"; then
 
6785
        AC_MSG_WARN([HTTP filesystem require protocol classes... disabled])
 
6786
        wxUSE_FS_INET="no"
 
6787
    fi
 
6788
fi
 
6789
 
 
6790
if test "$wxUSE_URL" = "yes"; then
 
6791
    if test "$wxUSE_PROTOCOL" != "yes"; then
 
6792
        AC_MSG_WARN(wxURL class requires wxProtocol... disabled)
 
6793
        wxUSE_URL=no
 
6794
    fi
 
6795
    if test "$wxUSE_URL" = "yes"; then
 
6796
        AC_DEFINE(wxUSE_URL)
 
6797
    fi
 
6798
fi
 
6799
 
 
6800
if test "$wxUSE_VARIANT" = "yes"; then
 
6801
    AC_DEFINE(wxUSE_VARIANT)
 
6802
fi
 
6803
 
 
6804
if test "$wxUSE_FS_INET" = "yes"; then
 
6805
  AC_DEFINE(wxUSE_FS_INET)
 
6806
fi
 
6807
 
 
6808
dnl ---------------------------------------------------------------------------
 
6809
dnl Joystick support
 
6810
dnl ---------------------------------------------------------------------------
 
6811
 
 
6812
if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then
 
6813
    wxUSE_JOYSTICK=no
 
6814
 
 
6815
    dnl under MSW we always have joystick support
 
6816
    if test "$TOOLKIT" = "MSW"; then
 
6817
        wxUSE_JOYSTICK=yes
 
6818
 
 
6819
    dnl mac only available on darwin
 
6820
    elif test "$TOOLKIT" = "MAC" -o "$TOOLKIT" = "COCOA"; then
 
6821
        if test "$USE_DARWIN" = 1; then
 
6822
            dnl check for a bug in the headers, some have bad setEventCallout
 
6823
            AC_MSG_CHECKING([headers have declarations needed for joystick support])
 
6824
            AC_LANG_PUSH(C++)
 
6825
            AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ],
 
6826
                            [ IOHIDQueueInterface *qi = NULL;
 
6827
                              IOHIDCallbackFunction cb = NULL;
 
6828
                              qi->setEventCallout(NULL, cb, NULL, NULL); ],
 
6829
                            [ wxUSE_JOYSTICK=yes ]
 
6830
                          )
 
6831
            AC_LANG_POP()
 
6832
            AC_MSG_RESULT($wxUSE_JOYSTICK)
 
6833
        fi
 
6834
 
 
6835
    dnl joystick support is only for Linux 2.1.x or greater
 
6836
    else
 
6837
        dnl wxJoystick not supported by wxMGL at all
 
6838
        if test "$wxUSE_MGL" != "1"; then
 
6839
            dnl notice the dummy includes argument: without it, AC_CHECK_HEADER
 
6840
            dnl checks only whether the header can be preprocessed, not that it
 
6841
            dnl can be compiled and in Linux 2.6.16 joystick.h is present but
 
6842
            dnl can't be compiled because of an error and with the default
 
6843
            dnl AC_CHECK_HEADER semantics we'd still detect it in this case and
 
6844
            dnl build would fail later
 
6845
            AC_CHECK_HEADERS(linux/joystick.h, [wxUSE_JOYSTICK=yes],, [AC_INCLUDES_DEFAULT()])
 
6846
        fi
 
6847
    fi
 
6848
 
 
6849
    if test "$wxUSE_JOYSTICK" = "yes"; then
 
6850
        AC_DEFINE(wxUSE_JOYSTICK)
 
6851
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
 
6852
    else
 
6853
        AC_MSG_WARN(Joystick not supported by this system... disabled)
 
6854
    fi
 
6855
fi
 
6856
 
 
6857
 
 
6858
dnl ---------------------------------------------------------------------------
 
6859
dnl String stuff
 
6860
dnl ---------------------------------------------------------------------------
 
6861
 
 
6862
if test "$wxUSE_FONTMAP" = "yes" ; then
 
6863
  AC_DEFINE(wxUSE_FONTMAP)
 
6864
fi
 
6865
 
 
6866
if test "$wxUSE_UNICODE" = "yes" ; then
 
6867
  AC_DEFINE(wxUSE_UNICODE)
 
6868
 
 
6869
  if test "$USE_WIN32" != 1; then
 
6870
      wxUSE_UNICODE_MSLU=no
 
6871
  fi
 
6872
 
 
6873
  if test "$USE_WIN32" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
 
6874
        AC_CHECK_LIB(unicows,main,
 
6875
            [
 
6876
                AC_DEFINE(wxUSE_UNICODE_MSLU)
 
6877
            ],
 
6878
            [
 
6879
                AC_MSG_WARN([Compiler doesn't support MSLU (libunicows.a), disabled.
 
6880
                             Applications will only run on Windows NT/2000/XP!])
 
6881
                wxUSE_UNICODE_MSLU=no
 
6882
            ])
 
6883
    fi
 
6884
fi
 
6885
 
 
6886
if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
 
6887
  AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
 
6888
fi
 
6889
 
 
6890
dnl ----------------------------------------------------------------
 
6891
dnl Register PostScript options for makefiles and setup.h
 
6892
dnl ----------------------------------------------------------------
 
6893
 
 
6894
if test "$wxUSE_POSTSCRIPT" = "yes" ; then
 
6895
  AC_DEFINE(wxUSE_POSTSCRIPT)
 
6896
fi
 
6897
 
 
6898
AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
 
6899
 
 
6900
AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS)
 
6901
 
 
6902
dnl ---------------------------------------------------------------------------
 
6903
dnl big GUI components: MDI, doc/view, printing, help, ...
 
6904
dnl ---------------------------------------------------------------------------
 
6905
 
 
6906
if test "$wxUSE_CONSTRAINTS" = "yes"; then
 
6907
    AC_DEFINE(wxUSE_CONSTRAINTS)
 
6908
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
 
6909
fi
 
6910
 
 
6911
if test "$wxUSE_MDI" = "yes"; then
 
6912
    AC_DEFINE(wxUSE_MDI)
 
6913
 
 
6914
    if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
 
6915
        AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
 
6916
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
 
6917
    fi
 
6918
fi
 
6919
 
 
6920
if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
 
6921
    AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE)
 
6922
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview"
 
6923
    if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
 
6924
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi"
 
6925
    fi
 
6926
fi
 
6927
 
 
6928
if test "$wxUSE_HELP" = "yes"; then
 
6929
    AC_DEFINE(wxUSE_HELP)
 
6930
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
 
6931
 
 
6932
    if test "$wxUSE_MSW" = 1; then
 
6933
      if test "$wxUSE_MS_HTML_HELP" = "yes"; then
 
6934
        AC_DEFINE(wxUSE_MS_HTML_HELP)
 
6935
      fi
 
6936
    fi
 
6937
 
 
6938
    if test "$wxUSE_WXHTML_HELP" = "yes"; then
 
6939
      if test "$wxUSE_HTML" = "yes"; then
 
6940
        AC_DEFINE(wxUSE_WXHTML_HELP)
 
6941
      else
 
6942
        AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled)
 
6943
        wxUSE_WXHTML_HELP=no
 
6944
      fi
 
6945
    fi
 
6946
fi
 
6947
 
 
6948
if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
 
6949
    if test "$wxUSE_CONSTRAINTS" != "yes"; then
 
6950
        AC_MSG_WARN(Printing support cannot be used without constraints so it won't be compiled without it)
 
6951
    else
 
6952
        AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
 
6953
    fi
 
6954
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
 
6955
fi
 
6956
 
 
6957
if test "$wxUSE_PROLOGIO" = "yes" -o  "$wxUSE_RESOURCES" = "yes"; then
 
6958
    AC_MSG_ERROR([wxExpr and old-style resources are now available in contrib only])
 
6959
fi
 
6960
 
 
6961
dnl ---------------------------------------------------------------------------
 
6962
dnl wxMetafile availability
 
6963
dnl ---------------------------------------------------------------------------
 
6964
 
 
6965
if test "$wxUSE_METAFILE" = "yes"; then
 
6966
    if test "$wxUSE_MSW" != 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_PM" != 1; then
 
6967
        AC_MSG_WARN([wxMetafile is not available on this system... disabled])
 
6968
        wxUSE_METAFILE=no
 
6969
    fi
 
6970
fi
 
6971
 
 
6972
dnl ---------------------------------------------------------------------------
 
6973
dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
 
6974
dnl ---------------------------------------------------------------------------
 
6975
 
 
6976
dnl check for ole headers and disable a few features requiring it if not
 
6977
dnl present (earlier versions of mingw32 don't have ole2.h)
 
6978
if test "$USE_WIN32" = 1 -a \( "$wxUSE_DATAOBJ"       = "yes" \
 
6979
                          -o "$wxUSE_CLIPBOARD"     = "yes" \
 
6980
                          -o "$wxUSE_OLE"     = "yes" \
 
6981
                          -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then
 
6982
    AC_CHECK_HEADERS(ole2.h,,, [ ])
 
6983
 
 
6984
    if test "$ac_cv_header_ole2_h" = "yes" ; then
 
6985
        if test "$GCC" = yes ; then
 
6986
            AC_MSG_CHECKING([if g++ requires -fvtable-thunks])
 
6987
            AC_TRY_COMPILE([#include <windows.h>
 
6988
                            #include <ole2.h>],
 
6989
                           [],
 
6990
                           [AC_MSG_RESULT(no)],
 
6991
                           [AC_MSG_RESULT(yes)
 
6992
                            WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fvtable-thunks"])
 
6993
            LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS"
 
6994
            if test "$wxUSE_OLE" = "yes" ; then
 
6995
                AC_DEFINE(wxUSE_OLE)
 
6996
                AC_DEFINE(wxUSE_OLE_AUTOMATION)
 
6997
                AC_DEFINE(wxUSE_ACTIVEX)
 
6998
                SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS oleauto"
 
6999
            fi
 
7000
        fi
 
7001
 
 
7002
        dnl for OLE clipboard and dnd
 
7003
        if test "$wxUSE_DATAOBJ" = "yes" ; then
 
7004
            AC_DEFINE(wxUSE_DATAOBJ)
 
7005
        fi
 
7006
    else
 
7007
        AC_MSG_WARN([Some features disabled because OLE headers not found])
 
7008
 
 
7009
        wxUSE_CLIPBOARD=no
 
7010
        wxUSE_DRAG_AND_DROP=no
 
7011
        wxUSE_DATAOBJ=no
 
7012
        wxUSE_OLE=no
 
7013
    fi
 
7014
 
 
7015
    if test "$wxUSE_METAFILE" = "yes"; then
 
7016
        AC_DEFINE(wxUSE_METAFILE)
 
7017
 
 
7018
        dnl this one should probably be made separately configurable
 
7019
        AC_DEFINE(wxUSE_ENH_METAFILE)
 
7020
    fi
 
7021
fi
 
7022
 
 
7023
if test "$wxUSE_IPC" = "yes"; then
 
7024
    if test "$wxUSE_SOCKETS" != "yes" -a "$USE_WIN32" != 1; then
 
7025
        AC_MSG_WARN(wxWidgets IPC classes require sockets... disabled)
 
7026
        wxUSE_IPC=no
 
7027
    fi
 
7028
 
 
7029
    if test "$wxUSE_IPC" = "yes"; then
 
7030
        AC_DEFINE(wxUSE_IPC)
 
7031
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ipc"
 
7032
    fi
 
7033
fi
 
7034
 
 
7035
if test "$wxUSE_DATAOBJ" = "yes"; then
 
7036
    if test "$wxUSE_MGL" = 1 -o "$wxUSE_DFB" = 1; then
 
7037
        AC_MSG_WARN([wxDataObject not yet supported under $TOOLKIT... disabled])
 
7038
        wxUSE_DATAOBJ=no
 
7039
    else
 
7040
        AC_DEFINE(wxUSE_DATAOBJ)
 
7041
    fi
 
7042
else
 
7043
    AC_MSG_WARN([Clipboard and drag-and-drop require wxDataObject -- disabled])
 
7044
    wxUSE_CLIPBOARD=no
 
7045
    wxUSE_DRAG_AND_DROP=no
 
7046
fi
 
7047
 
 
7048
if test "$wxUSE_CLIPBOARD" = "yes"; then
 
7049
    if test "$wxUSE_MGL" = 1 -o "$wxUSE_DFB" = 1; then
 
7050
        AC_MSG_WARN([Clipboard not yet supported under $TOOLKIT... disabled])
 
7051
        wxUSE_CLIPBOARD=no
 
7052
    fi
 
7053
 
 
7054
    if test "$wxUSE_CLIPBOARD" = "yes"; then
 
7055
        AC_DEFINE(wxUSE_CLIPBOARD)
 
7056
    fi
 
7057
fi
 
7058
 
 
7059
if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
 
7060
    if test "$wxUSE_GTK" = 1; then
 
7061
        if test "$WXGTK12" != 1; then
 
7062
            AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2... disabled])
 
7063
            wxUSE_DRAG_AND_DROP=no
 
7064
        fi
 
7065
    fi
 
7066
 
 
7067
    if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$wxUSE_MGL" = 1 -o \
 
7068
            "$wxUSE_DFB" = 1; then
 
7069
        AC_MSG_WARN([Drag and drop not yet supported under $TOOLKIT... disabled])
 
7070
        wxUSE_DRAG_AND_DROP=no
 
7071
    fi
 
7072
 
 
7073
    if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
 
7074
        AC_DEFINE(wxUSE_DRAG_AND_DROP)
 
7075
    fi
 
7076
 
 
7077
fi
 
7078
 
 
7079
if test "$wxUSE_DRAG_AND_DROP" = "yes" -o "$wxUSE_CLIPBOARD" = "yes"; then
 
7080
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
 
7081
fi
 
7082
 
 
7083
if test "$wxUSE_SPLINES" = "yes" ; then
 
7084
  AC_DEFINE(wxUSE_SPLINES)
 
7085
fi
 
7086
 
 
7087
if test "$wxUSE_MOUSEWHEEL" = "yes" ; then
 
7088
  AC_DEFINE(wxUSE_MOUSEWHEEL)
 
7089
fi
 
7090
 
 
7091
dnl ---------------------------------------------------------------------------
 
7092
dnl GUI controls
 
7093
dnl ---------------------------------------------------------------------------
 
7094
 
 
7095
USES_CONTROLS=0
 
7096
if test "$wxUSE_CONTROLS" = "yes"; then
 
7097
  USES_CONTROLS=1
 
7098
fi
 
7099
 
 
7100
if test "$wxUSE_ACCEL" = "yes"; then
 
7101
  AC_DEFINE(wxUSE_ACCEL)
 
7102
  USES_CONTROLS=1
 
7103
fi
 
7104
 
 
7105
if test "$wxUSE_ANIMATIONCTRL" = "yes"; then
 
7106
  AC_DEFINE(wxUSE_ANIMATIONCTRL)
 
7107
  USES_CONTROLS=1
 
7108
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS animate"
 
7109
fi
 
7110
 
 
7111
if test "$wxUSE_BUTTON" = "yes"; then
 
7112
  AC_DEFINE(wxUSE_BUTTON)
 
7113
  USES_CONTROLS=1
 
7114
fi
 
7115
 
 
7116
if test "$wxUSE_BMPBUTTON" = "yes"; then
 
7117
  AC_DEFINE(wxUSE_BMPBUTTON)
 
7118
  USES_CONTROLS=1
 
7119
fi
 
7120
 
 
7121
if test "$wxUSE_CALCTRL" = "yes"; then
 
7122
  AC_DEFINE(wxUSE_CALENDARCTRL)
 
7123
  USES_CONTROLS=1
 
7124
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar"
 
7125
fi
 
7126
 
 
7127
if test "$wxUSE_CARET" = "yes"; then
 
7128
  AC_DEFINE(wxUSE_CARET)
 
7129
  USES_CONTROLS=1
 
7130
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
 
7131
fi
 
7132
 
 
7133
if test "$wxUSE_COLLPANE" = "yes"; then
 
7134
    AC_DEFINE(wxUSE_COLLPANE)
 
7135
    USES_CONTROLS=1
 
7136
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS collpane"
 
7137
fi
 
7138
 
 
7139
if test "$wxUSE_COMBOBOX" = "yes"; then
 
7140
  AC_DEFINE(wxUSE_COMBOBOX)
 
7141
  USES_CONTROLS=1
 
7142
fi
 
7143
 
 
7144
if test "$wxUSE_COMBOCTRL" = "yes"; then
 
7145
  AC_DEFINE(wxUSE_COMBOCTRL)
 
7146
  USES_CONTROLS=1
 
7147
fi
 
7148
 
 
7149
if test "$wxUSE_CHOICE" = "yes"; then
 
7150
  AC_DEFINE(wxUSE_CHOICE)
 
7151
  USES_CONTROLS=1
 
7152
fi
 
7153
 
 
7154
if test "$wxUSE_CHOICEBOOK" = "yes"; then
 
7155
    AC_DEFINE(wxUSE_CHOICEBOOK)
 
7156
    USES_CONTROLS=1
 
7157
fi
 
7158
 
 
7159
if test "$wxUSE_CHECKBOX" = "yes"; then
 
7160
  AC_DEFINE(wxUSE_CHECKBOX)
 
7161
  USES_CONTROLS=1
 
7162
fi
 
7163
 
 
7164
if test "$wxUSE_CHECKLST" = "yes"; then
 
7165
  AC_DEFINE(wxUSE_CHECKLISTBOX)
 
7166
  USES_CONTROLS=1
 
7167
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst"
 
7168
fi
 
7169
 
 
7170
if test "$wxUSE_COLOURPICKERCTRL" = "yes"; then
 
7171
  AC_DEFINE(wxUSE_COLOURPICKERCTRL)
 
7172
  USES_CONTROLS=1
 
7173
fi
 
7174
 
 
7175
if test "$wxUSE_DATEPICKCTRL" = "yes"; then
 
7176
  AC_DEFINE(wxUSE_DATEPICKCTRL)
 
7177
  USES_CONTROLS=1
 
7178
fi
 
7179
 
 
7180
if test "$wxUSE_DIRPICKERCTRL" = "yes"; then
 
7181
  AC_DEFINE(wxUSE_DIRPICKERCTRL)
 
7182
  USES_CONTROLS=1
 
7183
fi
 
7184
 
 
7185
if test "$wxUSE_FILEPICKERCTRL" = "yes"; then
 
7186
  AC_DEFINE(wxUSE_FILEPICKERCTRL)
 
7187
  USES_CONTROLS=1
 
7188
fi
 
7189
 
 
7190
if test "$wxUSE_FONTPICKERCTRL" = "yes"; then
 
7191
  AC_DEFINE(wxUSE_FONTPICKERCTRL)
 
7192
  USES_CONTROLS=1
 
7193
fi
 
7194
 
 
7195
if test "$wxUSE_DISPLAY" = "yes"; then
 
7196
    if test "$wxUSE_DFB" = 1 -o "$wxUSE_MGL" = 1; then
 
7197
        AC_MSG_WARN([wxDisplay not yet supported under $TOOLKIT... disabled])
 
7198
        wxUSE_DISPLAY=no
 
7199
    else
 
7200
        AC_DEFINE(wxUSE_DISPLAY)
 
7201
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS display multimon"
 
7202
    fi
 
7203
fi
 
7204
 
 
7205
if test "$wxUSE_DETECT_SM" = "yes"; then
 
7206
    AC_DEFINE(wxUSE_DETECT_SM)
 
7207
fi
 
7208
 
 
7209
if test "$wxUSE_GAUGE" = "yes"; then
 
7210
  AC_DEFINE(wxUSE_GAUGE)
 
7211
  USES_CONTROLS=1
 
7212
fi
 
7213
 
 
7214
if test "$wxUSE_GRID" = "yes"; then
 
7215
  AC_DEFINE(wxUSE_GRID)
 
7216
  USES_CONTROLS=1
 
7217
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
 
7218
fi
 
7219
 
 
7220
if test "$wxUSE_HYPERLINKCTRL" = "yes"; then
 
7221
  AC_DEFINE(wxUSE_HYPERLINKCTRL)
 
7222
  USES_CONTROLS=1
 
7223
fi
 
7224
 
 
7225
if test "$wxUSE_BITMAPCOMBOBOX" = "yes"; then
 
7226
  AC_DEFINE(wxUSE_BITMAPCOMBOBOX)
 
7227
  USES_CONTROLS=1
 
7228
fi
 
7229
 
 
7230
if test "$wxUSE_DATAVIEWCTRL" = "yes"; then
 
7231
  AC_DEFINE(wxUSE_DATAVIEWCTRL)
 
7232
  USES_CONTROLS=1
 
7233
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dataview"
 
7234
fi
 
7235
 
 
7236
if test "$wxUSE_IMAGLIST" = "yes"; then
 
7237
    AC_DEFINE(wxUSE_IMAGLIST)
 
7238
fi
 
7239
 
 
7240
if test "$wxUSE_LISTBOOK" = "yes"; then
 
7241
    AC_DEFINE(wxUSE_LISTBOOK)
 
7242
    USES_CONTROLS=1
 
7243
fi
 
7244
 
 
7245
if test "$wxUSE_LISTBOX" = "yes"; then
 
7246
    AC_DEFINE(wxUSE_LISTBOX)
 
7247
    USES_CONTROLS=1
 
7248
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listbox"
 
7249
fi
 
7250
 
 
7251
if test "$wxUSE_LISTCTRL" = "yes"; then
 
7252
    if test "$wxUSE_IMAGLIST" = "yes"; then
 
7253
        AC_DEFINE(wxUSE_LISTCTRL)
 
7254
        USES_CONTROLS=1
 
7255
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
 
7256
    else
 
7257
        AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
 
7258
    fi
 
7259
fi
 
7260
 
 
7261
if test "$wxUSE_NOTEBOOK" = "yes"; then
 
7262
    AC_DEFINE(wxUSE_NOTEBOOK)
 
7263
    USES_CONTROLS=1
 
7264
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
 
7265
fi
 
7266
 
 
7267
if test "$wxUSE_ODCOMBOBOX" = "yes"; then
 
7268
  AC_DEFINE(wxUSE_ODCOMBOBOX)
 
7269
  USES_CONTROLS=1
 
7270
  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS combo"
 
7271
fi
 
7272
 
 
7273
dnl if test "$wxUSE_PROPSHEET" = "yes"; then
 
7274
dnl     AC_DEFINE(wxUSE_PROPSHEET)
 
7275
dnl     USES_CONTROLS=1
 
7276
dnl     SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS proplist"
 
7277
dnl fi
 
7278
 
 
7279
if test "$wxUSE_RADIOBOX" = "yes"; then
 
7280
    AC_DEFINE(wxUSE_RADIOBOX)
 
7281
    USES_CONTROLS=1
 
7282
fi
 
7283
 
 
7284
if test "$wxUSE_RADIOBTN" = "yes"; then
 
7285
    AC_DEFINE(wxUSE_RADIOBTN)
 
7286
    USES_CONTROLS=1
 
7287
fi
 
7288
 
 
7289
if test "$wxUSE_SASH" = "yes"; then
 
7290
    AC_DEFINE(wxUSE_SASH)
 
7291
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
 
7292
fi
 
7293
 
 
7294
if test "$wxUSE_SCROLLBAR" = "yes"; then
 
7295
    AC_DEFINE(wxUSE_SCROLLBAR)
 
7296
    USES_CONTROLS=1
 
7297
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll scrollsub"
 
7298
fi
 
7299
 
 
7300
if test "$wxUSE_SEARCHCTRL" = "yes"; then
 
7301
    AC_DEFINE(wxUSE_SEARCHCTRL)
 
7302
    USES_CONTROLS=1
 
7303
fi
 
7304
 
 
7305
if test "$wxUSE_SLIDER" = "yes"; then
 
7306
    AC_DEFINE(wxUSE_SLIDER)
 
7307
    USES_CONTROLS=1
 
7308
fi
 
7309
 
 
7310
if test "$wxUSE_SPINBTN" = "yes"; then
 
7311
    AC_DEFINE(wxUSE_SPINBTN)
 
7312
    USES_CONTROLS=1
 
7313
fi
 
7314
 
 
7315
if test "$wxUSE_SPINCTRL" = "yes"; then
 
7316
    AC_DEFINE(wxUSE_SPINCTRL)
 
7317
    USES_CONTROLS=1
 
7318
fi
 
7319
 
 
7320
if test "$wxUSE_SPLITTER" = "yes"; then
 
7321
    AC_DEFINE(wxUSE_SPLITTER)
 
7322
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
 
7323
fi
 
7324
 
 
7325
if test "$wxUSE_STATBMP" = "yes"; then
 
7326
    AC_DEFINE(wxUSE_STATBMP)
 
7327
    USES_CONTROLS=1
 
7328
fi
 
7329
 
 
7330
if test "$wxUSE_STATBOX" = "yes"; then
 
7331
    AC_DEFINE(wxUSE_STATBOX)
 
7332
    USES_CONTROLS=1
 
7333
fi
 
7334
 
 
7335
if test "$wxUSE_STATTEXT" = "yes"; then
 
7336
    AC_DEFINE(wxUSE_STATTEXT)
 
7337
    USES_CONTROLS=1
 
7338
fi
 
7339
 
 
7340
if test "$wxUSE_STATLINE" = "yes"; then
 
7341
    AC_DEFINE(wxUSE_STATLINE)
 
7342
    USES_CONTROLS=1
 
7343
fi
 
7344
 
 
7345
if test "$wxUSE_STATUSBAR" = "yes"; then
 
7346
    dnl this will get undefined in wx/chkconf.h if it's not supported
 
7347
    AC_DEFINE(wxUSE_NATIVE_STATUSBAR)
 
7348
    AC_DEFINE(wxUSE_STATUSBAR)
 
7349
    USES_CONTROLS=1
 
7350
 
 
7351
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar"
 
7352
fi
 
7353
 
 
7354
if test "$wxUSE_TAB_DIALOG" = "yes"; then
 
7355
    AC_DEFINE(wxUSE_TAB_DIALOG)
 
7356
fi
 
7357
 
 
7358
if test "$wxUSE_TEXTCTRL" = "yes"; then
 
7359
    AC_DEFINE(wxUSE_TEXTCTRL)
 
7360
    USES_CONTROLS=1
 
7361
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text"
 
7362
 
 
7363
    dnl we don't have special switches to disable wxUSE_RICHEDIT[2], it doesn't
 
7364
    dnl seem useful to allow disabling them
 
7365
    AC_DEFINE(wxUSE_RICHEDIT)
 
7366
    AC_DEFINE(wxUSE_RICHEDIT2)
 
7367
fi
 
7368
 
 
7369
if test "$wxUSE_TOGGLEBTN" = "yes"; then
 
7370
    if test "$wxUSE_COCOA" = 1 ; then
 
7371
        AC_MSG_WARN([Toggle button not yet supported under Mac OS X... disabled])
 
7372
        wxUSE_TOGGLEBTN=no
 
7373
    fi
 
7374
 
 
7375
    if test "$wxUSE_TOGGLEBTN" = "yes"; then
 
7376
        AC_DEFINE(wxUSE_TOGGLEBTN)
 
7377
        USES_CONTROLS=1
 
7378
    fi
 
7379
fi
 
7380
 
 
7381
if test "$wxUSE_TOOLBAR" = "yes"; then
 
7382
    AC_DEFINE(wxUSE_TOOLBAR)
 
7383
    USES_CONTROLS=1
 
7384
 
 
7385
    if test "$wxUSE_UNIVERSAL" = "yes"; then
 
7386
        wxUSE_TOOLBAR_NATIVE="no"
 
7387
    else
 
7388
        wxUSE_TOOLBAR_NATIVE="yes"
 
7389
        AC_DEFINE(wxUSE_TOOLBAR_NATIVE)
 
7390
    fi
 
7391
 
 
7392
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
 
7393
fi
 
7394
 
 
7395
if test "$wxUSE_TOOLTIPS" = "yes"; then
 
7396
    if test "$wxUSE_MOTIF" = 1; then
 
7397
        AC_MSG_WARN([wxTooltip not supported yet under Motif... disabled])
 
7398
    else
 
7399
        if test "$wxUSE_UNIVERSAL" = "yes"; then
 
7400
            AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled])
 
7401
        else
 
7402
            AC_DEFINE(wxUSE_TOOLTIPS)
 
7403
        fi
 
7404
    fi
 
7405
fi
 
7406
 
 
7407
if test "$wxUSE_TREEBOOK" = "yes"; then
 
7408
    AC_DEFINE(wxUSE_TREEBOOK)
 
7409
    USES_CONTROLS=1
 
7410
fi
 
7411
 
 
7412
if test "$wxUSE_TOOLBOOK" = "yes"; then
 
7413
    AC_DEFINE(wxUSE_TOOLBOOK)
 
7414
    USES_CONTROLS=1
 
7415
fi
 
7416
 
 
7417
if test "$wxUSE_TREECTRL" = "yes"; then
 
7418
    if test "$wxUSE_IMAGLIST" = "yes"; then
 
7419
        AC_DEFINE(wxUSE_TREECTRL)
 
7420
        USES_CONTROLS=1
 
7421
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
 
7422
    else
 
7423
        AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
 
7424
    fi
 
7425
fi
 
7426
 
 
7427
if test "$wxUSE_POPUPWIN" = "yes"; then
 
7428
    if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 -o "$wxUSE_PM" = 1 \
 
7429
            -o "$wxUSE_DFB" = 1; then
 
7430
        AC_MSG_WARN([Popup window not yet supported on this platform... disabled])
 
7431
    else
 
7432
        AC_DEFINE(wxUSE_POPUPWIN)
 
7433
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS popup"
 
7434
 
 
7435
        USES_CONTROLS=1
 
7436
    fi
 
7437
fi
 
7438
 
 
7439
if test "$wxUSE_DIALUP_MANAGER" = "yes"; then
 
7440
    if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 -o "$wxUSE_MGL" = 1; then
 
7441
        AC_MSG_WARN([Dialup manager not supported on this platform... disabled])
 
7442
    else
 
7443
        AC_DEFINE(wxUSE_DIALUP_MANAGER)
 
7444
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup"
 
7445
    fi
 
7446
fi
 
7447
 
 
7448
if test "$wxUSE_TIPWINDOW" = "yes"; then
 
7449
    if test "$wxUSE_PM" = 1; then
 
7450
        AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled])
 
7451
    else
 
7452
        AC_DEFINE(wxUSE_TIPWINDOW)
 
7453
    fi
 
7454
fi
 
7455
 
 
7456
if test "$USES_CONTROLS" = 1; then
 
7457
    AC_DEFINE(wxUSE_CONTROLS)
 
7458
fi
 
7459
 
 
7460
dnl ---------------------------------------------------------------------------
 
7461
dnl misc options
 
7462
dnl ---------------------------------------------------------------------------
 
7463
 
 
7464
dnl please keep the settings below in alphabetical order
 
7465
if test "$wxUSE_ACCESSIBILITY" = "yes"; then
 
7466
    AC_DEFINE(wxUSE_ACCESSIBILITY)
 
7467
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access"
 
7468
fi
 
7469
 
 
7470
if test "$wxUSE_DC_CACHEING" = "yes"; then
 
7471
    AC_DEFINE(wxUSE_DC_CACHEING)
 
7472
fi
 
7473
 
 
7474
if test "$wxUSE_DRAGIMAGE" = "yes"; then
 
7475
    AC_DEFINE(wxUSE_DRAGIMAGE)
 
7476
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag"
 
7477
fi
 
7478
 
 
7479
if test "$wxUSE_EXCEPTIONS" = "yes"; then
 
7480
    if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
 
7481
        AC_MSG_WARN([--enable-exceptions can't be used with --enable-no_exceptions])
 
7482
    else
 
7483
        AC_DEFINE(wxUSE_EXCEPTIONS)
 
7484
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS except"
 
7485
    fi
 
7486
fi
 
7487
 
 
7488
USE_HTML=0
 
7489
if test "$wxUSE_HTML" = "yes"; then
 
7490
    AC_DEFINE(wxUSE_HTML)
 
7491
    USE_HTML=1
 
7492
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox"
 
7493
    if test "$wxUSE_MAC" = 1; then
 
7494
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/htmlctrl"
 
7495
    fi
 
7496
fi
 
7497
if test "$wxUSE_WEBKIT" = "yes"; then
 
7498
    if test "$wxUSE_MAC" = 1 -a "$USE_DARWIN" = 1; then
 
7499
        old_CPPFLAGS="$CPPFLAGS"
 
7500
        CPPFLAGS="-x objective-c++ $CPPFLAGS"
 
7501
        AC_CHECK_HEADER([WebKit/HIWebView.h],
 
7502
                        [
 
7503
                           AC_DEFINE(wxUSE_WEBKIT)
 
7504
                           WEBKIT_LINK="-framework WebKit"
 
7505
                        ],
 
7506
                        [
 
7507
                           AC_MSG_WARN([WebKit headers not found; disabling wxWebKit])
 
7508
                           wxUSE_WEBKIT=no
 
7509
                        ],
 
7510
                        [
 
7511
                           #include <Carbon/Carbon.h>
 
7512
                           #include <WebKit/WebKit.h>
 
7513
                        ])
 
7514
        CPPFLAGS="$old_CPPFLAGS"
 
7515
    elif test "$wxUSE_COCOA" = 1; then
 
7516
        AC_DEFINE(wxUSE_WEBKIT)
 
7517
    else
 
7518
        wxUSE_WEBKIT=no
 
7519
    fi
 
7520
fi
 
7521
 
 
7522
USE_XRC=0
 
7523
if test "$wxUSE_XRC" = "yes"; then
 
7524
    if test "$wxUSE_XML" != "yes"; then
 
7525
        AC_MSG_WARN([XML library not built, XRC resources disabled])
 
7526
        wxUSE_XRC=no
 
7527
    else
 
7528
        AC_DEFINE(wxUSE_XRC)
 
7529
        USE_XRC=1
 
7530
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS xrc"
 
7531
    fi
 
7532
fi
 
7533
 
 
7534
USE_AUI=0
 
7535
if test "$wxUSE_AUI" = "yes"; then
 
7536
   AC_DEFINE(wxUSE_AUI)
 
7537
   USE_AUI=1
 
7538
   SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS aui"
 
7539
fi
 
7540
 
 
7541
if test "$wxUSE_MENUS" = "yes"; then
 
7542
    AC_DEFINE(wxUSE_MENUS)
 
7543
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu"
 
7544
fi
 
7545
 
 
7546
if test "$wxUSE_METAFILE" = "yes"; then
 
7547
    AC_DEFINE(wxUSE_METAFILE)
 
7548
fi
 
7549
 
 
7550
if test "$wxUSE_MIMETYPE" = "yes"; then
 
7551
    AC_DEFINE(wxUSE_MIMETYPE)
 
7552
fi
 
7553
 
 
7554
if test "$wxUSE_MINIFRAME" = "yes"; then
 
7555
    AC_DEFINE(wxUSE_MINIFRAME)
 
7556
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram"
 
7557
fi
 
7558
 
 
7559
if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
 
7560
    AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
 
7561
fi
 
7562
 
 
7563
if test "$wxUSE_VALIDATORS" = "yes"; then
 
7564
    AC_DEFINE(wxUSE_VALIDATORS)
 
7565
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
 
7566
fi
 
7567
 
 
7568
if test "$wxUSE_PALETTE" = "yes" ; then
 
7569
    if test "$wxUSE_DFB" = 1; then
 
7570
        AC_MSG_WARN([wxPalette not yet supported under DFB... disabled])
 
7571
        wxUSE_PALETTE=no
 
7572
    else
 
7573
        AC_DEFINE(wxUSE_PALETTE)
 
7574
    fi
 
7575
fi
 
7576
 
 
7577
if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_MSLU" = "yes" ; then
 
7578
  dnl Must be done this late because -lunicows must be before all the other libs
 
7579
  LIBS=" -lunicows $LIBS"
 
7580
fi
 
7581
 
 
7582
USE_RICHTEXT=0
 
7583
if test "$wxUSE_RICHTEXT" = "yes"; then
 
7584
    AC_DEFINE(wxUSE_RICHTEXT)
 
7585
    USE_RICHTEXT=1
 
7586
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS richtext"
 
7587
fi
 
7588
 
 
7589
dnl ---------------------------------------------------------------------------
 
7590
dnl wxImage options
 
7591
dnl ---------------------------------------------------------------------------
 
7592
 
 
7593
if test "$wxUSE_IMAGE" = "yes" ; then
 
7594
    AC_DEFINE(wxUSE_IMAGE)
 
7595
 
 
7596
    if test "$wxUSE_GIF" = "yes" ; then
 
7597
      AC_DEFINE(wxUSE_GIF)
 
7598
    fi
 
7599
 
 
7600
    if test "$wxUSE_PCX" = "yes" ; then
 
7601
      AC_DEFINE(wxUSE_PCX)
 
7602
    fi
 
7603
 
 
7604
    if test "$wxUSE_TGA" = "yes" ; then
 
7605
      AC_DEFINE(wxUSE_TGA)
 
7606
    fi
 
7607
 
 
7608
    if test "$wxUSE_IFF" = "yes" ; then
 
7609
      AC_DEFINE(wxUSE_IFF)
 
7610
    fi
 
7611
 
 
7612
    if test "$wxUSE_PNM" = "yes" ; then
 
7613
      AC_DEFINE(wxUSE_PNM)
 
7614
    fi
 
7615
 
 
7616
    if test "$wxUSE_XPM" = "yes" ; then
 
7617
      AC_DEFINE(wxUSE_XPM)
 
7618
    fi
 
7619
 
 
7620
    if test "$wxUSE_ICO_CUR" = "yes" ; then
 
7621
      AC_DEFINE(wxUSE_ICO_CUR)
 
7622
    fi
 
7623
fi
 
7624
 
 
7625
dnl ---------------------------------------------------------------------------
 
7626
dnl common dialogs
 
7627
dnl ---------------------------------------------------------------------------
 
7628
 
 
7629
if test "$wxUSE_ABOUTDLG" = "yes"; then
 
7630
    AC_DEFINE(wxUSE_ABOUTDLG)
 
7631
fi
 
7632
 
 
7633
if test "$wxUSE_CHOICEDLG" = "yes"; then
 
7634
    AC_DEFINE(wxUSE_CHOICEDLG)
 
7635
fi
 
7636
 
 
7637
if test "$wxUSE_COLOURDLG" = "yes"; then
 
7638
    AC_DEFINE(wxUSE_COLOURDLG)
 
7639
fi
 
7640
 
 
7641
if test "$wxUSE_FILEDLG" = "yes"; then
 
7642
    AC_DEFINE(wxUSE_FILEDLG)
 
7643
fi
 
7644
 
 
7645
if test "$wxUSE_FINDREPLDLG" = "yes"; then
 
7646
    AC_DEFINE(wxUSE_FINDREPLDLG)
 
7647
fi
 
7648
 
 
7649
if test "$wxUSE_FONTDLG" = "yes"; then
 
7650
    AC_DEFINE(wxUSE_FONTDLG)
 
7651
fi
 
7652
 
 
7653
if test "$wxUSE_DIRDLG" = "yes"; then
 
7654
    if test "$wxUSE_TREECTRL" != "yes"; then
 
7655
        AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it)
 
7656
    else
 
7657
        AC_DEFINE(wxUSE_DIRDLG)
 
7658
    fi
 
7659
fi
 
7660
 
 
7661
if test "$wxUSE_MSGDLG" = "yes"; then
 
7662
    AC_DEFINE(wxUSE_MSGDLG)
 
7663
fi
 
7664
 
 
7665
if test "$wxUSE_NUMBERDLG" = "yes"; then
 
7666
    AC_DEFINE(wxUSE_NUMBERDLG)
 
7667
fi
 
7668
 
 
7669
if test "$wxUSE_PROGRESSDLG" = "yes"; then
 
7670
    if test "$wxUSE_CONSTRAINTS" != "yes"; then
 
7671
       AC_MSG_WARN(wxProgressDialog requires constraints so it won't be compiled without them)
 
7672
    else
 
7673
        AC_DEFINE(wxUSE_PROGRESSDLG)
 
7674
    fi
 
7675
fi
 
7676
 
 
7677
if test "$wxUSE_SPLASH" = "yes"; then
 
7678
    AC_DEFINE(wxUSE_SPLASH)
 
7679
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splash"
 
7680
fi
 
7681
 
 
7682
if test "$wxUSE_STARTUP_TIPS" = "yes"; then
 
7683
    if test "$wxUSE_CONSTRAINTS" != "yes"; then
 
7684
       AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them)
 
7685
    else
 
7686
        AC_DEFINE(wxUSE_STARTUP_TIPS)
 
7687
    fi
 
7688
fi
 
7689
 
 
7690
if test "$wxUSE_TEXTDLG" = "yes"; then
 
7691
    AC_DEFINE(wxUSE_TEXTDLG)
 
7692
fi
 
7693
 
 
7694
if test "$wxUSE_WIZARDDLG" = "yes"; then
 
7695
    AC_DEFINE(wxUSE_WIZARDDLG)
 
7696
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard"
 
7697
fi
 
7698
 
 
7699
dnl ---------------------------------------------------------------------------
 
7700
dnl wxGraphicsContext
 
7701
dnl ---------------------------------------------------------------------------
 
7702
 
 
7703
if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then
 
7704
   if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = "1"; then
 
7705
      AC_DEFINE(wxUSE_GRAPHICS_CONTEXT)
 
7706
   elif test "$wxUSE_GTK" != 1; then
 
7707
      dnl for other builds we'll just wing it for now...
 
7708
      AC_DEFINE(wxUSE_GRAPHICS_CONTEXT)
 
7709
   else
 
7710
      dnl ...but let's check for cairo availability for wxGTK builds
 
7711
      PKG_CHECK_MODULES(CAIRO, cairo,
 
7712
          [AC_DEFINE(wxUSE_GRAPHICS_CONTEXT)],
 
7713
          [AC_MSG_WARN([Cairo library not found, unable to set wxUSE_GRAPHICS_CONTEXT])]
 
7714
      )
 
7715
   fi
 
7716
fi
 
7717
 
 
7718
dnl ---------------------------------------------------------------------------
 
7719
dnl wxMediaCtrl
 
7720
dnl ---------------------------------------------------------------------------
 
7721
 
 
7722
USE_MEDIA=0
 
7723
 
 
7724
if test "$wxUSE_MEDIACTRL" = "yes"; then
 
7725
    USE_MEDIA=1
 
7726
 
 
7727
    dnl -----------------------------------------------------------------------
 
7728
    dnl GStreamer
 
7729
    dnl -----------------------------------------------------------------------
 
7730
    if test "$wxUSE_GTK" = 1; then
 
7731
        wxUSE_GSTREAMER="no"
 
7732
 
 
7733
        dnl -------------------------------------------------------------------
 
7734
        dnl Test for at least 0.8 gstreamer module from pkg-config
 
7735
        dnl Even totem doesn't accept 0.9 evidently.
 
7736
        dnl
 
7737
        dnl So, we first check to see if 0.10 if available - if not we
 
7738
        dnl try the older 0.8 version
 
7739
        dnl -------------------------------------------------------------------
 
7740
        GST_VERSION_MAJOR=0
 
7741
        GST_VERSION_MINOR=10
 
7742
        GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
 
7743
 
 
7744
        if test "$wxUSE_GSTREAMER8" = "no"; then
 
7745
            PKG_CHECK_MODULES(GST,
 
7746
                [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION gconf-2.0],
 
7747
                [
 
7748
                    wxUSE_GSTREAMER="yes"
 
7749
                    GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
 
7750
                ],
 
7751
                [
 
7752
                    AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
 
7753
                    GST_VERSION_MINOR=8
 
7754
                ]
 
7755
            )
 
7756
        else
 
7757
            dnl check only for 0.8
 
7758
            GST_VERSION_MINOR=8
 
7759
        fi
 
7760
 
 
7761
        if test $GST_VERSION_MINOR = "8"; then
 
7762
            GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
 
7763
            PKG_CHECK_MODULES(GST,
 
7764
                [gstreamer-$GST_VERSION gstreamer-interfaces-$GST_VERSION gstreamer-gconf-$GST_VERSION],
 
7765
                wxUSE_GSTREAMER="yes",
 
7766
                [
 
7767
                    AC_MSG_WARN([GStreamer 0.8/0.10 not available.])
 
7768
                ])
 
7769
        fi
 
7770
 
 
7771
 
 
7772
        if test "$wxUSE_GSTREAMER" = "yes"; then
 
7773
            dnl system gstreamer package is compiled with Sun CC and outputs
 
7774
            dnl CC-specific "-mt" in its flags, remove it for gcc compilation
 
7775
            case "${host}" in
 
7776
                *-*-solaris2* )
 
7777
                    if test "$GCC" = yes; then
 
7778
                        GST_CFLAGS=`echo $GST_CFLAGS | sed 's/-mt//'`
 
7779
                        GST_LIBS=`echo $GST_LIBS | sed 's/-mt//'`
 
7780
                    fi
 
7781
            esac
 
7782
 
 
7783
            CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
 
7784
            EXTRALIBS_MEDIA="$GST_LIBS"
 
7785
 
 
7786
            AC_DEFINE(wxUSE_GSTREAMER)
 
7787
        else
 
7788
            USE_MEDIA=0
 
7789
        fi
 
7790
    fi
 
7791
 
 
7792
    if test $USE_MEDIA = 1; then
 
7793
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
 
7794
        AC_DEFINE(wxUSE_MEDIACTRL)
 
7795
    fi
 
7796
fi
 
7797
 
 
7798
dnl ---------------------------------------------------------------------------
 
7799
dnl get the string with OS info - used by wxGetOsDescription() on MacOS X
 
7800
dnl ---------------------------------------------------------------------------
 
7801
 
 
7802
if test "$cross_compiling" = "yes"; then
 
7803
    dnl Use best guess from host as we can't use uname when cross compiling
 
7804
    OSINFO="\"$host\""
 
7805
else
 
7806
    dnl attualy work out OS version
 
7807
    OSINFO=`uname -s -r -m`
 
7808
    OSINFO="\"$OSINFO\""
 
7809
fi
 
7810
 
 
7811
AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
 
7812
 
 
7813
dnl ---------------------------------------------------------------------------
 
7814
dnl define the variable containing the installation prefix (used in dcpsg.cpp)
 
7815
dnl ---------------------------------------------------------------------------
 
7816
 
 
7817
if test "x$prefix" != "xNONE"; then
 
7818
    wxPREFIX=$prefix
 
7819
else
 
7820
    wxPREFIX=$ac_default_prefix
 
7821
fi
 
7822
 
 
7823
AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
 
7824
 
 
7825
 
 
7826
dnl ---------------------------------------------------------------------------
 
7827
dnl define variables with all built libraries for wx-config
 
7828
dnl ---------------------------------------------------------------------------
 
7829
 
 
7830
CORE_BASE_LIBS="net base"
 
7831
CORE_GUI_LIBS="adv core"
 
7832
 
 
7833
if test "$wxUSE_XML" = "yes" ; then
 
7834
    CORE_BASE_LIBS="xml $CORE_BASE_LIBS"
 
7835
fi
 
7836
if test "$wxUSE_ODBC" != "no" ; then
 
7837
    CORE_BASE_LIBS="odbc $CORE_BASE_LIBS"
 
7838
    CORE_GUI_LIBS="dbgrid $CORE_GUI_LIBS"
 
7839
fi
 
7840
if test "$wxUSE_HTML" = "yes" ; then
 
7841
    CORE_GUI_LIBS="html $CORE_GUI_LIBS"
 
7842
fi
 
7843
if test "$wxUSE_DEBUGREPORT" = "yes" ; then
 
7844
    CORE_GUI_LIBS="qa $CORE_GUI_LIBS"
 
7845
fi
 
7846
if test "$wxUSE_XRC" = "yes" ; then
 
7847
    CORE_GUI_LIBS="xrc $CORE_GUI_LIBS"
 
7848
fi
 
7849
if test "$wxUSE_AUI" = "yes" ; then
 
7850
    CORE_GUI_LIBS="aui $CORE_GUI_LIBS"
 
7851
fi
 
7852
if test "$wxUSE_RICHTEXT" = "yes" ; then
 
7853
    CORE_GUI_LIBS="richtext $CORE_GUI_LIBS"
 
7854
fi
 
7855
 
 
7856
if test "$wxUSE_GUI" != "yes"; then
 
7857
    CORE_GUI_LIBS=""
 
7858
fi
 
7859
 
 
7860
AC_SUBST(CORE_BASE_LIBS)
 
7861
AC_SUBST(CORE_GUI_LIBS)
 
7862
 
 
7863
dnl ---------------------------------------------------------------------------
 
7864
dnl Output the makefiles and such from the results found above
 
7865
dnl ---------------------------------------------------------------------------
 
7866
 
 
7867
dnl all additional libraries (except wxWidgets itself) we link with
 
7868
 
 
7869
if test "$wxUSE_MAC" = 1 ; then
 
7870
    if test "$wxUSE_SOUND" = "yes" || test "$wxUSE_MEDIACTRL" = "yes"; then
 
7871
        if test "$USE_DARWIN" != 1; then
 
7872
            LDFLAGS="$LDFLAGS -lQuickTimeLib"
 
7873
        fi
 
7874
    fi
 
7875
    if test "$USE_DARWIN" = 1; then
 
7876
        LDFLAGS="$LDFLAGS -framework IOKit -framework Carbon -framework Cocoa -framework System -framework QuickTime -framework OpenGL -framework AGL"
 
7877
    else
 
7878
        LDFLAGS="$LDFLAGS -lCarbonLib"
 
7879
    fi
 
7880
fi
 
7881
if test "$wxUSE_COCOA" = 1 ; then
 
7882
    LDFLAGS="$LDFLAGS -framework IOKit -framework Cocoa"
 
7883
    if test "$wxUSE_MEDIACTRL" = "yes"; then
 
7884
        LDFLAGS="$LDFLAGS -framework QuickTime"
 
7885
    fi
 
7886
fi
 
7887
if test "$USE_DARWIN" = 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1 ; then
 
7888
    LDFLAGS="$LDFLAGS -framework IOKit -framework CoreServices -framework System -framework ApplicationServices"
 
7889
fi
 
7890
 
 
7891
LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS"
 
7892
 
 
7893
if test "$wxUSE_GUI" = "yes"; then
 
7894
 
 
7895
    dnl TODO add checks that these samples will really compile (i.e. all the
 
7896
    dnl      library features they need are present)
 
7897
 
 
7898
    dnl TODO some samples are never built so far: mfc (requires VC++)
 
7899
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs drawing \
 
7900
                     dynamic erase event exec font image minimal mobile \
 
7901
                     mobile/wxedit mobile/styles propsize render \
 
7902
                     rotate shaped taskbar vscroll widgets"
 
7903
 
 
7904
    if test "$wxUSE_MONOLITHIC" != "yes"; then
 
7905
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console"
 
7906
    fi
 
7907
    if test "$TOOLKIT" = "MSW"; then
 
7908
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS regtest"
 
7909
        if test "$wxUSE_UNIVERSAL" != "yes"; then
 
7910
            SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw nativdlg"
 
7911
        fi
 
7912
    fi
 
7913
    if test "$TOOLKIT" = "PM" -a "$wxUSE_UNIVERSAL" != "yes"; then
 
7914
        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw"
 
7915
    fi
 
7916
else
 
7917
    SAMPLES_SUBDIRS="console"
 
7918
fi
 
7919
 
 
7920
 
 
7921
dnl C/C++ compiler options used to compile wxWidgets
 
7922
dnl
 
7923
dnl check for icc before gcc as icc is also recognized as gcc
 
7924
if test "x$INTELCC" = "xyes" ; then
 
7925
    dnl Warnings which can't be easily suppressed in C code are disabled:
 
7926
    dnl
 
7927
    dnl     remark #810: conversion from "x" to "y" may lose significant bits
 
7928
    dnl     remark #869: parameter "foo" was never referenced
 
7929
    dnl     remark #1572: floating-point equality and inequality comparisons
 
7930
    dnl                   are unreliable
 
7931
    dnl     remark #1684: conversion from pointer to same-sized integral type
 
7932
    dnl
 
7933
    dnl (for others see below)
 
7934
    CWARNINGS="-Wall -wd810,869,981,1418,1572,1684"
 
7935
elif test "$GCC" = yes ; then
 
7936
    CWARNINGS="-Wall -Wundef"
 
7937
fi
 
7938
 
 
7939
if test "x$INTELCXX" = "xyes" ; then
 
7940
    dnl Intel compiler gives some warnings which simply can't be worked
 
7941
    dnl around or of which we have too many (810, 869) so it's impractical to
 
7942
    dnl keep them enabled even if in theory it would be nice and some others
 
7943
    dnl (279) are generated for standard macros and so there is nothing we can
 
7944
    dnl do about them
 
7945
    dnl
 
7946
    dnl     remark #279: controlling expression is constant
 
7947
    dnl     remark #383: value copied to temporary, reference to temporary used
 
7948
    dnl     remark #444: destructor for base class "xxx" is not virtual
 
7949
    dnl     remark #810: conversion from "x" to "y" may lose significant bits
 
7950
    dnl     remark #869: parameter "foo" was never referenced
 
7951
    dnl     remark #981: operands are evaluated in unspecified order
 
7952
    dnl     remark #1418: external definition with no prior declaration
 
7953
    dnl     remark #1419: external declaration in primary source file
 
7954
    CXXWARNINGS="-Wall -wd279,383,444,810,869,981,1418,1419"
 
7955
elif test "$GXX" = yes ; then
 
7956
    dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
 
7957
    CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy"
 
7958
fi
 
7959
 
 
7960
 
 
7961
dnl combine everything together and remove the extra white space while doing it
 
7962
WXCONFIG_CFLAGS=`echo $WXCONFIG_CFLAGS`
 
7963
WXCONFIG_CXXFLAGS=`echo $WXCONFIG_CFLAGS $WXCONFIG_CXXFLAGS`
 
7964
 
 
7965
 
 
7966
dnl add -I options we use during library compilation
 
7967
dnl
 
7968
dnl note that the order is somewhat important: wxWidgets headers should
 
7969
dnl come first and the one with setup.h should be before $(top_srcdir)/include
 
7970
dnl in case the latter contains setup.h used by non-autoconf makefiles (e.g.
 
7971
dnl CodeWarrior):
 
7972
CPPFLAGS=`echo $WXCONFIG_CPPFLAGS \
 
7973
 -I\\${wx_top_builddir}/lib/wx/include/${TOOLCHAIN_FULLNAME} \
 
7974
 -I\\${top_srcdir}/include $TOOLKIT_INCLUDE \
 
7975
 $CPPFLAGS `
 
7976
 
 
7977
C_AND_CXX_FLAGS="$DEBUG_CFLAGS $PROFILE_FLAGS $OPTIMISE_CFLAGS"
 
7978
CFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $CFLAGS `
 
7979
CXXFLAGS=`echo $WXCONFIG_CXXFLAGS $CXXWARNINGS $C_AND_CXX_FLAGS $CXXFLAGS `
 
7980
OBJCFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $OBJCFLAGS `
 
7981
OBJCXXFLAGS=`echo $WXCONFIG_CXXFLAGS $CXXWARNINGS $C_AND_CXX_FLAGS $OBJCXXFLAGS `
 
7982
 
 
7983
dnl now that we added WXCONFIG_CPPFLAGS to CPPFLAGS we can add the wx-config
 
7984
dnl only stuff to it
 
7985
WXCONFIG_CPPFLAGS=`echo $WXCONFIG_CPPFLAGS $WXCONFIG_ONLY_CPPFLAGS`
 
7986
 
 
7987
 
 
7988
if test "x$MWCC" = "xyes"; then
 
7989
    dnl Correct MW 8.3 to be more similar to GCC.  In particular we
 
7990
    dnl must use <regex.h> from system not our local copy on OS X,
 
7991
    dnl but must use local not system on OS 9.
 
7992
    dnl The following should make all -I paths usable for <> includes
 
7993
    dnl while first checking in real system paths.  With 8.3 using
 
7994
    dnl -gccincludes it will actually check local paths before system
 
7995
    dnl even for <> which is totally wrong.
 
7996
 
 
7997
    dnl Note that because this absolutely needs to be before any -I
 
7998
    dnl that we have to tack it on to the end of the compiler commandline.
 
7999
    CC="$CC -cwd source -I-"
 
8000
    CXX="$CXX -cwd source -I-"
 
8001
fi
 
8002
 
 
8003
 
 
8004
LIBS=`echo $LIBS`
 
8005
EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS"
 
8006
EXTRALIBS_XML="$EXPAT_LINK"
 
8007
EXTRALIBS_HTML="$MSPACK_LINK"
 
8008
EXTRALIBS_MEDIA="$GST_LIBS"
 
8009
EXTRALIBS_ODBC="$ODBC_LINK"
 
8010
if test "$wxUSE_GUI" = "yes"; then
 
8011
    EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $WEBKIT_LINK $EXTRALIBS_HILDON $EXTRALIBS_GNOMEVFS $EXTRALIBS_GNOMEPRINT`
 
8012
fi
 
8013
if test "$wxUSE_OPENGL" = "yes"; then
 
8014
    EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS"
 
8015
fi
 
8016
 
 
8017
LDFLAGS="$LDFLAGS $PROFILE_FLAGS"
 
8018
 
 
8019
WXCONFIG_LIBS="$LIBS"
 
8020
 
 
8021
dnl wx-config must output builtin 3rd party libs in --libs in static build:
 
8022
if test "$wxUSE_REGEX" = "builtin" ; then
 
8023
    wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty"
 
8024
fi
 
8025
if test "$wxUSE_EXPAT" = "builtin" ; then
 
8026
    wxconfig_3rdparty="expat $wxconfig_3rdparty"
 
8027
fi
 
8028
if test "$wxUSE_ODBC" = "builtin" ; then
 
8029
    wxconfig_3rdparty="odbc $wxconfig_3rdparty"
 
8030
fi
 
8031
if test "$wxUSE_LIBTIFF" = "builtin" ; then
 
8032
    wxconfig_3rdparty="tiff $wxconfig_3rdparty"
 
8033
fi
 
8034
if test "$wxUSE_LIBJPEG" = "builtin" ; then
 
8035
    wxconfig_3rdparty="jpeg $wxconfig_3rdparty"
 
8036
fi
 
8037
if test "$wxUSE_LIBPNG" = "builtin" ; then
 
8038
    wxconfig_3rdparty="png $wxconfig_3rdparty"
 
8039
fi
 
8040
if test "$wxUSE_ZLIB" = "builtin" ; then
 
8041
    wxconfig_3rdparty="zlib $wxconfig_3rdparty"
 
8042
fi
 
8043
 
 
8044
for i in $wxconfig_3rdparty ; do
 
8045
    WXCONFIG_LIBS="-lwx${i}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS"
 
8046
done
 
8047
 
 
8048
 
 
8049
if test "x$wxUSE_UNIVERSAL" = "xyes" ; then
 
8050
    WXUNIV=1
 
8051
 
 
8052
    case "$wxUNIV_THEMES" in
 
8053
        ''|all)
 
8054
            AC_DEFINE(wxUSE_ALL_THEMES)
 
8055
            ;;
 
8056
 
 
8057
        *)
 
8058
            for t in `echo $wxUNIV_THEMES | tr , ' ' | tr '[[a-z]]' '[[A-Z]]'`; do
 
8059
                AC_DEFINE_UNQUOTED(wxUSE_THEME_$t)
 
8060
            done
 
8061
    esac
 
8062
else
 
8063
    WXUNIV=0
 
8064
fi
 
8065
 
 
8066
AC_SUBST(wxUSE_ZLIB)
 
8067
AC_SUBST(wxUSE_REGEX)
 
8068
AC_SUBST(wxUSE_EXPAT)
 
8069
AC_SUBST(wxUSE_ODBC)
 
8070
AC_SUBST(wxUSE_LIBJPEG)
 
8071
AC_SUBST(wxUSE_LIBPNG)
 
8072
AC_SUBST(wxUSE_LIBTIFF)
 
8073
 
 
8074
if test $wxUSE_MONOLITHIC = "yes" ; then
 
8075
    MONOLITHIC=1
 
8076
else
 
8077
    MONOLITHIC=0
 
8078
fi
 
8079
 
 
8080
if test $wxUSE_PLUGINS = "yes" ; then
 
8081
    USE_PLUGINS=1
 
8082
else
 
8083
    USE_PLUGINS=0
 
8084
fi
 
8085
 
 
8086
if test $wxUSE_ODBC != "no" ; then
 
8087
    USE_ODBC=1
 
8088
else
 
8089
    USE_ODBC=0
 
8090
fi
 
8091
 
 
8092
if test "$wxUSE_DEBUGREPORT" = "yes" ; then
 
8093
    USE_QA=1
 
8094
else
 
8095
    USE_QA=0
 
8096
fi
 
8097
 
 
8098
if test $wxUSE_OFFICIAL_BUILD = "yes" ; then
 
8099
    OFFICIAL_BUILD=1
 
8100
else
 
8101
    OFFICIAL_BUILD=0
 
8102
fi
 
8103
 
 
8104
AC_SUBST(VENDOR)
 
8105
AC_SUBST(OFFICIAL_BUILD)
 
8106
AC_SUBST(WX_FLAVOUR)
 
8107
AC_SUBST(WX_LIB_FLAVOUR)
 
8108
 
 
8109
AC_SUBST(WXUNIV)
 
8110
AC_SUBST(MONOLITHIC)
 
8111
AC_SUBST(USE_PLUGINS)
 
8112
AC_SUBST(LIBS)
 
8113
AC_SUBST(EXTRALIBS)
 
8114
AC_SUBST(EXTRALIBS_XML)
 
8115
AC_SUBST(EXTRALIBS_HTML)
 
8116
AC_SUBST(EXTRALIBS_MEDIA)
 
8117
AC_SUBST(EXTRALIBS_ODBC)
 
8118
AC_SUBST(EXTRALIBS_GUI)
 
8119
AC_SUBST(EXTRALIBS_OPENGL)
 
8120
AC_SUBST(EXTRALIBS_SDL)
 
8121
AC_SUBST(WITH_PLUGIN_SDL)
 
8122
AC_SUBST(EXTRALIBS_GNOMEPRINT)
 
8123
AC_SUBST(EXTRALIBS_GNOMEVFS)
 
8124
AC_SUBST(EXTRALIBS_HILDON)
 
8125
AC_SUBST(UNICODE)
 
8126
AC_SUBST(BUILD)
 
8127
AC_SUBST(DEBUG_INFO)
 
8128
AC_SUBST(DEBUG_FLAG)
 
8129
TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr '[[A-Z]]' '[[a-z]]'`
 
8130
AC_SUBST(TOOLKIT_LOWERCASE)
 
8131
AC_SUBST(TOOLKIT_VERSION)
 
8132
AC_SUBST(SAMPLES_RPATH_FLAG)
 
8133
AC_SUBST(SAMPLES_RPATH_POSTLINK)
 
8134
AC_SUBST(HOST_SUFFIX)
 
8135
AC_SUBST(CPPUNIT_CFLAGS)
 
8136
AC_SUBST(CPPUNIT_LIBS)
 
8137
 
 
8138
dnl Cocoa sets this, but no other port does. As a result, we run into problems when compiling
 
8139
dnl webkit.mm, or other Objective-C sources. This line can be removed when we move to Bakefile 0.2.4
 
8140
dnl which adds this call to bakefile.m4.
 
8141
AC_SUBST(OBJCXXFLAGS)
 
8142
 
 
8143
case "$TOOLKIT" in
 
8144
    GTK)
 
8145
        TOOLKIT_DESC="GTK+"
 
8146
        if test "$WXGTK20" = 1; then
 
8147
            TOOLKIT_DESC="$TOOLKIT_DESC 2"
 
8148
            if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then
 
8149
                TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomeprint";
 
8150
            fi
 
8151
            if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
 
8152
                TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomevfs"
 
8153
            fi
 
8154
            if test "$wxUSE_LIBHILDON" = "yes"; then
 
8155
                TOOLKIT_EXTRA="$TOOLKIT_EXTRA hildon"
 
8156
            fi
 
8157
 
 
8158
            if test "$TOOLKIT_EXTRA" != ""; then
 
8159
                TOOLKIT_DESC="$TOOLKIT_DESC with support for `echo $TOOLKIT_EXTRA | tr -s ' '`"
 
8160
            fi
 
8161
        fi
 
8162
        ;;
 
8163
 
 
8164
    ?*)
 
8165
        TOOLKIT_DESC=$TOOLKIT_LOWERCASE
 
8166
        ;;
 
8167
 
 
8168
    *)
 
8169
        TOOLKIT_DESC="base only"
 
8170
        ;;
 
8171
esac
 
8172
 
 
8173
if test "$wxUSE_WINE" = "yes"; then
 
8174
    BAKEFILE_FORCE_PLATFORM=win32
 
8175
fi
 
8176
 
 
8177
dnl gcc 3.4 has a pch bug which truncates wide character constants in headers.
 
8178
dnl Hopefully for a non-unicode build there aren't any wide constants in
 
8179
dnl headers, but for a unicode build it's best to disable pch.
 
8180
if test "$wxUSE_UNICODE" = yes -a "$GCC" = yes -a "$bk_use_pch" != no
 
8181
then
 
8182
    AC_CACHE_CHECK(
 
8183
        [for gcc precompiled header bug],
 
8184
        [wx_cv_gcc_pch_bug],
 
8185
        [[
 
8186
            echo '#include <stdio.h>
 
8187
                  const wchar_t test_var[] = L"awidetest";' > conftest.h
 
8188
 
 
8189
            echo '#include "conftest.h"
 
8190
                  int main()
 
8191
                  {
 
8192
                     printf("%ls", test_var);
 
8193
                     return 0;
 
8194
                  }' > conftest.cpp
 
8195
 
 
8196
            wx_cv_gcc_pch_bug="pch not supported"
 
8197
 
 
8198
            if $CXX conftest.h >/dev/null 2>&1
 
8199
            then
 
8200
                wx_cv_gcc_pch_bug=
 
8201
 
 
8202
                if $CXX -o conftest$PROGRAM_EXT conftest.cpp >/dev/null 2>&1
 
8203
                then
 
8204
                    if tr -dc '[a-z]' < conftest$PROGRAM_EXT |
 
8205
                        grep awidetest >/dev/null
 
8206
                    then
 
8207
                        wx_cv_gcc_pch_bug=no
 
8208
                    else
 
8209
                        wx_cv_gcc_pch_bug=yes
 
8210
                    fi
 
8211
                fi
 
8212
            fi
 
8213
 
 
8214
            rm -f conftest.h conftest.gch conftest.cpp conftest$PROGRAM_EXT
 
8215
        ]])
 
8216
 
 
8217
    if test "$wx_cv_gcc_pch_bug" = yes; then
 
8218
        dnl make the default for pch 'no'
 
8219
        dnl further below check whether the user overrode and warn them
 
8220
        bk_use_pch=no
 
8221
    fi
 
8222
fi
 
8223
 
 
8224
AC_BAKEFILE([m4_include(autoconf_inc.m4)])
 
8225
 
 
8226
dnl find out if the compiler supports PCH
 
8227
dnl
 
8228
dnl TODO: this should be in bakefile
 
8229
if test $GCC_PCH = 1
 
8230
then
 
8231
    if test "$wx_cv_gcc_pch_bug" = yes; then
 
8232
        AC_MSG_WARN([*** Precompiled header support is broken on this compiler])
 
8233
        AC_MSG_WARN([*** --enable-precomp-headers is not recommended])
 
8234
        AC_MSG_WARN([*** see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13361])
 
8235
    fi
 
8236
 
 
8237
    # Our WX_PRECOMP flag does not make sense for any language except C++ because
 
8238
    # the headers that benefit from precompilation are mostly C++ headers.
 
8239
    CXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
 
8240
    # When Bakefile can do multi-language PCH (e.g. C++ and Objective-C++) enable this:
 
8241
    #OBJCXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
 
8242
fi
 
8243
 
 
8244
dnl HACK ALERT!!
 
8245
dnl For now, we need to alter bk-deps not to generate deps
 
8246
dnl when we've configured a Universal binary build.
 
8247
dnl The next version of Bakefile will have the correct fix for this
 
8248
dnl at which time, this hack can be removed.
 
8249
 
 
8250
if test "$wxUSE_MAC" = 1 ; then
 
8251
    if test "x$wxUSE_UNIVERSAL_BINARY" != "xno" ; then
 
8252
        sed "s/DEPSMODE=gcc/DEPSMODE=none/" < bk-deps > temp
 
8253
        mv temp bk-deps
 
8254
        chmod +x bk-deps
 
8255
    fi
 
8256
fi
 
8257
 
 
8258
if test "$wxUSE_SHARED" = "yes"; then
 
8259
 
 
8260
    dnl We get the shared build linker from bakefile, since it
 
8261
    dnl moved all the logic for this out of this file and into
 
8262
    dnl its own macro.  But it can't decide on whether to return
 
8263
    dnl us $(VAR), ${VAR}, or the present expansion of VAR.
 
8264
    dnl So normalise and expand everything here now, because its
 
8265
    dnl not going to change inside wx-config anyway.
 
8266
    sanitised_bakefile_mess=`echo "$SHARED_LD_CXX" | tr -d '()'`
 
8267
    EXE_LINKER=`eval echo "$sanitised_bakefile_mess"`
 
8268
 
 
8269
    dnl Need addtional flag on OS/2, so override bakefiles value
 
8270
    dnl (there currently is no suitable variable to which the
 
8271
    dnl  missing flags could be added, AFAICS. SN, 18.12.2004. )
 
8272
    case "${host}" in
 
8273
      *-pc-os2_emx | *-pc-os2-emx )
 
8274
        SHARED_LD_CC="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
 
8275
        SHARED_LD_CXX="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
 
8276
        cp -p ${srcdir}/src/os2/dllnames.sh .
 
8277
        cp -p ${srcdir}/src/os2/dllar.sh .
 
8278
      ;;
 
8279
    esac
 
8280
else
 
8281
 
 
8282
    dnl No bakefile support for static builds, but this should be ok for most.
 
8283
    EXE_LINKER="$CXX -o"
 
8284
 
 
8285
fi
 
8286
if test "$wxUSE_OMF" = "yes"; then
 
8287
    case "${host}" in
 
8288
      *-pc-os2_emx | *-pc-os2-emx )
 
8289
        LDFLAGS="$LDFLAGS -Zlinker /EXEPACK"
 
8290
        LDFLAGS_GUI="-Zlinker /PMTYPE:PM"
 
8291
        WXCONFIG_LDFLAGS_GUI="-Zlinker /PMTYPE:PM"
 
8292
      ;;
 
8293
    esac
 
8294
fi
 
8295
 
 
8296
dnl TOOLCHAIN_DEFS should be used for both wx and client code
 
8297
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $TOOLCHAIN_DEFS"
 
8298
 
 
8299
dnl for convenience, sort the samples in alphabetical order
 
8300
dnl
 
8301
dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
 
8302
dnl       in this list - hence uniq. But normally, this shouldn't be needed!
 
8303
dnl
 
8304
dnl       Unfortunately, there is a bug in OS/2's tr, such that
 
8305
dnl       tr ' ' '\n' introduces DOS-like line breaks, whereas tr '\n' ' '
 
8306
dnl       only removes the Unix-like part of the introduced line break.
 
8307
SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`"
 
8308
 
 
8309
dnl subtle bakefile goop.
 
8310
dnl Used in wx-config now too, as its STATIC_FLAG with different makeup.
 
8311
dnl I wish we would have called it something less likely to clash with
 
8312
dnl things though.
 
8313
AC_SUBST(SHARED)
 
8314
 
 
8315
dnl global options
 
8316
AC_SUBST(WX_LIBRARY_BASENAME_NOGUI)
 
8317
AC_SUBST(WX_LIBRARY_BASENAME_GUI)
 
8318
 
 
8319
dnl toolkit options
 
8320
AC_SUBST(USE_GUI)
 
8321
AC_SUBST(AFMINSTALL)
 
8322
AC_SUBST(WIN32INSTALL)
 
8323
AC_SUBST(TOOLKIT)
 
8324
AC_SUBST(TOOLKIT_DIR)
 
8325
AC_SUBST(TOOLCHAIN_NAME)
 
8326
AC_SUBST(TOOLCHAIN_FULLNAME)
 
8327
 
 
8328
dnl wx-config options
 
8329
AC_SUBST(host_alias)
 
8330
AC_SUBST(cross_compiling)
 
8331
AC_SUBST(WIDGET_SET)
 
8332
AC_SUBST(WX_RELEASE)
 
8333
AC_SUBST(WX_VERSION)
 
8334
AC_SUBST(WX_SUBVERSION)
 
8335
AC_SUBST(WX_CHARTYPE)
 
8336
AC_SUBST(WX_DEBUGTYPE)
 
8337
 
 
8338
dnl note that in addition to the usual CPP/C/CXXFLAGS which are used for
 
8339
dnl building the library itself, we also have WXCONFIG_-prefixed variants which
 
8340
dnl are used when building the libraries using the library
 
8341
dnl
 
8342
dnl so put anything which should be used only during the library build in, e.g.
 
8343
dnl CXXFLAGS, but put everything else (by default) into WXCONFIG_CXXFLAGS
 
8344
dnl
 
8345
dnl and, finally, for some things which should be only used by wx-config but
 
8346
dnl not during the library compilation, use WXCONFIG_ONLY_CPPFLAGS which is
 
8347
dnl added to WXCONFIG_CPPFLAGS after adding the latter to CPPFLAGS
 
8348
AC_SUBST(WXCONFIG_CPPFLAGS)
 
8349
AC_SUBST(WXCONFIG_CFLAGS)
 
8350
AC_SUBST(WXCONFIG_CXXFLAGS)
 
8351
 
 
8352
AC_SUBST(WXCONFIG_LIBS)
 
8353
AC_SUBST(WXCONFIG_RPATH)
 
8354
AC_SUBST(WXCONFIG_LDFLAGS_GUI)
 
8355
AC_SUBST(WXCONFIG_RESFLAGS)
 
8356
AC_SUBST(EXE_LINKER)
 
8357
 
 
8358
dnl distribution vars
 
8359
AC_SUBST(GUIDIST)
 
8360
AC_SUBST(DISTDIR)
 
8361
 
 
8362
dnl additional subdirectories where we will build
 
8363
AC_SUBST(SAMPLES_SUBDIRS)
 
8364
 
 
8365
dnl additional libraries and linker settings
 
8366
AC_SUBST(LDFLAGS)
 
8367
AC_SUBST(LDFLAGS_GL)
 
8368
AC_SUBST(OPENGL_LIBS)
 
8369
AC_SUBST(DMALLOC_LIBS)
 
8370
AC_SUBST(WX_VERSION_TAG)
 
8371
 
 
8372
dnl additional resurces settings
 
8373
AC_SUBST(RESCOMP)
 
8374
AC_SUBST(WINDRES)
 
8375
AC_SUBST(REZ)
 
8376
AC_SUBST(RESFLAGS)
 
8377
AC_SUBST(RESPROGRAMOBJ)
 
8378
AC_SUBST(WX_RESOURCES_MACOSX_ASCII)
 
8379
AC_SUBST(WX_RESOURCES_MACOSX_DATA)
 
8380
 
 
8381
dnl additional for Mac OS X
 
8382
AC_SUBST(DEREZ)
 
8383
AC_SUBST(LIBWXMACRES)
 
8384
AC_SUBST(POSTLINK_COMMAND)
 
8385
AC_SUBST(MACSETFILE)
 
8386
 
 
8387
dnl other tools
 
8388
AC_SUBST(GCC)
 
8389
AC_SUBST(DLLTOOL)
 
8390
 
 
8391
 
 
8392
dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE
 
8393
dnl itself (this macro is required if SUBDIRS variable is used in Makefile.am
 
8394
dnl - and we do use it)
 
8395
AC_PROG_MAKE_SET
 
8396
 
 
8397
 
 
8398
AC_CONFIG_HEADERS([lib/wx/include/${TOOLCHAIN_FULLNAME}/wx/setup.h:setup.h.in])
 
8399
 
 
8400
if test "$USE_WIN32" = 1; then
 
8401
    AC_CONFIG_COMMANDS(
 
8402
        [
 
8403
            rcdefs.h
 
8404
        ],
 
8405
        [
 
8406
            mkdir -p $outdir &&
 
8407
            $CPP $infile | sed 's/^# *[1-9].*//;s/^ *//;/./,/^$/!d' > $outdir/rcdefs.h
 
8408
        ],
 
8409
        [
 
8410
            CPP="$CPP"
 
8411
            infile="$srcdir/include/wx/msw/genrcdefs.h"
 
8412
            outdir="lib/wx/include/$TOOLCHAIN_FULLNAME/wx/msw"
 
8413
        ]
 
8414
    )
 
8415
fi
 
8416
 
 
8417
AC_CONFIG_FILES([ lib/wx/config/${TOOLCHAIN_FULLNAME}:wx-config.in ],
 
8418
                [ chmod +x lib/wx/config/${TOOLCHAIN_FULLNAME} ],
 
8419
                [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ])
 
8420
 
 
8421
AC_CONFIG_FILES([ lib/wx/config/inplace-${TOOLCHAIN_FULLNAME}:wx-config-inplace.in ],
 
8422
                [ chmod +x lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} ],
 
8423
                [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ])
 
8424
 
 
8425
if test "$wx_cv_version_script" = "yes"; then
 
8426
    AC_CONFIG_FILES(version-script)
 
8427
fi
 
8428
AC_CONFIG_FILES(Makefile)
 
8429
 
 
8430
AC_CONFIG_COMMANDS([wx-config],
 
8431
                   [ rm -f wx-config
 
8432
                     ${LN_S} lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} wx-config
 
8433
                   ],
 
8434
                   [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}"
 
8435
                     LN_S="${LN_S}"
 
8436
                   ])
 
8437
 
 
8438
dnl This would give us us build dir that in every significant way
 
8439
dnl resembles an installed wx in prefix=$builddir.  It is troublesome
 
8440
dnl though in this form because AC_CONFIG_LINKS will fail for directories
 
8441
dnl on platforms that do not have symlinks.
 
8442
dnl AC_CONFIG_LINKS([ include/wx-$WX_RELEASE$WX_FLAVOUR:include ])
 
8443
dnl AC_CONFIG_LINKS([ contrib/include ])
 
8444
 
 
8445
if test "$wxWITH_SUBDIRS" != "no"; then
 
8446
dnl Configure samples, contrib etc. directories, but only if they are present:
 
8447
if test "$wxUSE_GUI" = "yes"; then
 
8448
    SUBDIRS="samples demos utils contrib"
 
8449
else dnl we build wxBase only
 
8450
    dnl there are no wxBase programs in contrib nor demos
 
8451
    SUBDIRS="samples utils"
 
8452
fi
 
8453
dnl Add tests to the list of subdirs if cppunit 1.8.0+ is detected
 
8454
AM_PATH_CPPUNIT(1.8.0, [SUBDIRS="$SUBDIRS tests"])
 
8455
 
 
8456
if test "$USE_UNIX" != "1" -a "$USE_WIN32" != "1"; then
 
8457
    DISABLED_CONTRIB="$DISABLED_CONTRIB net"
 
8458
fi
 
8459
 
 
8460
for subdir in `echo $SUBDIRS`; do
 
8461
    if test -d ${srcdir}/${subdir} ; then
 
8462
        if test "$wxUSE_GUI" = "yes"; then
 
8463
            if test ${subdir} = "samples"; then
 
8464
                dnl only take those samples which compile in the current
 
8465
                dnl configuration and which exist
 
8466
                makefiles="samples/Makefile.in $makefiles"
 
8467
                for sample in `echo $SAMPLES_SUBDIRS`; do
 
8468
                    if test -d $srcdir/samples/$sample; then
 
8469
                        makefiles="samples/$sample/Makefile.in $makefiles"
 
8470
                    fi
 
8471
                done
 
8472
            else
 
8473
                dnl assume that everything compiles for utils &c
 
8474
                dnl any that shouldn't be built can be added to
 
8475
                dnl DISABLED_UTILS, DISABLED_CONTRIB or DISABLED_DEMOS
 
8476
                disabled_var=DISABLED_`echo $subdir | tr '[[a-z]]' '[[A-Z]]'`
 
8477
                eval "disabled=\$$disabled_var"
 
8478
                disabled=/`echo X $disabled | sed 's@ @/|/@g'`/
 
8479
                makefiles=`(cd $srcdir ; find $subdir -name Makefile.in) | $EGREP -v "$disabled"`
 
8480
            fi
 
8481
        else dnl we build wxBase only
 
8482
            dnl don't take all samples/utils, just those which build with
 
8483
            dnl wxBase
 
8484
            if test ${subdir} = "samples"; then
 
8485
                makefiles="samples/Makefile.in samples/console/Makefile.in"
 
8486
            elif test ${subdir} = "utils"; then
 
8487
                makefiles=""
 
8488
                for util in HelpGen tex2rtf ; do
 
8489
                    if test -d $srcdir/utils/$util ; then
 
8490
                        makefiles="utils/$util/Makefile.in \
 
8491
                                   utils/$util/src/Makefile.in \
 
8492
                                   $makefiles"
 
8493
                    fi
 
8494
                done
 
8495
            else dnl assume that everything compiles for tests
 
8496
                makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)`
 
8497
            fi
 
8498
        fi
 
8499
 
 
8500
        for mkin in $makefiles ; do
 
8501
            mk=`echo $mkin | sed 's/Makefile\.in/Makefile/g'`
 
8502
            AC_CONFIG_FILES([$mk])
 
8503
        done
 
8504
    fi
 
8505
done
 
8506
fi dnl wxWITH_SUBDIRS
 
8507
 
 
8508
AC_OUTPUT
 
8509
 
 
8510
dnl report how we have been configured
 
8511
echo
 
8512
echo "Configured wxWidgets ${WX_VERSION} for \`${host}'"
 
8513
echo ""
 
8514
echo "  Which GUI toolkit should wxWidgets use?                 ${TOOLKIT_DESC}"
 
8515
echo "  Should wxWidgets be compiled into single library?       ${wxUSE_MONOLITHIC:-yes}"
 
8516
 
 
8517
echo "  Should wxWidgets be compiled in debug mode?             ${wxUSE_DEBUG:-no}"
 
8518
echo "  Should wxWidgets be linked as a shared library?         ${wxUSE_SHARED:-no}"
 
8519
echo "  Should wxWidgets be compiled in Unicode mode?           ${wxUSE_UNICODE:-no}"
 
8520
 
 
8521
echo "  What level of wxWidgets compatibility should be enabled?"
 
8522
echo "                                       wxWidgets 2.4      ${WXWIN_COMPATIBILITY_2_4:-no}"
 
8523
echo "                                       wxWidgets 2.6      ${WXWIN_COMPATIBILITY_2_6:-yes}"
 
8524
 
 
8525
echo "  Which libraries should wxWidgets use?"
 
8526
echo "                                       jpeg               ${wxUSE_LIBJPEG-none}"
 
8527
echo "                                       png                ${wxUSE_LIBPNG-none}"
 
8528
echo "                                       regex              ${wxUSE_REGEX}"
 
8529
echo "                                       tiff               ${wxUSE_LIBTIFF-none}"
 
8530
if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
 
8531
echo "                                       xpm                ${wxUSE_LIBXPM-none}"
 
8532
fi
 
8533
echo "                                       zlib               ${wxUSE_ZLIB}"
 
8534
echo "                                       odbc               ${wxUSE_ODBC}"
 
8535
echo "                                       expat              ${wxUSE_EXPAT}"
 
8536
echo "                                       libmspack          ${wxUSE_LIBMSPACK}"
 
8537
echo "                                       sdl                ${wxUSE_LIBSDL}"
 
8538
 
 
8539
echo ""
 
8540
 
 
8541
dnl vi: set et sts=4 sw=4 com=\:dnl: