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