]>
Commit | Line | Data |
---|---|---|
9a98a854 VZ |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | AC_REVISION($Id$)dnl | |
3 | ||
e6cc62c6 VS |
4 | AC_PREREQ(2.57) |
5 | ||
9a98a854 VZ |
6 | dnl --------------------------------------------------------------------------- |
7 | dnl | |
3a922bb4 RL |
8 | dnl Top-level configure.in for wxWindows by Robert Roebling, Phil Blecker, |
9 | dnl Vadim Zeitlin and Ron Lee | |
9a98a854 VZ |
10 | dnl |
11 | dnl This script is under the wxWindows licence. | |
12 | dnl | |
13 | dnl Version: $Id$ | |
bcd2b961 | 14 | dnl --------------------------------------------------------------------------- |
9a98a854 VZ |
15 | |
16 | dnl --------------------------------------------------------------------------- | |
17 | dnl initialization | |
18 | dnl --------------------------------------------------------------------------- | |
19 | ||
e6cc62c6 VS |
20 | AC_INIT([wxWindows], [2.5.0], [wx-dev@lists.wxwindows.org]) |
21 | ||
22 | dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package | |
23 | AC_CONFIG_SRCDIR([wx-config.in]) | |
9a98a854 | 24 | |
e59890c3 | 25 | dnl sets build, host, target variables and the same with _alias |
e6cc62c6 VS |
26 | AC_CANONICAL_BUILD |
27 | AC_CANONICAL_HOST | |
28 | AC_CANONICAL_TARGET | |
29 | ||
7c66a493 VZ |
30 | |
31 | dnl When making releases do: | |
32 | dnl | |
33 | dnl WX_RELEASE_NUMBER += 1 | |
2b6f061f | 34 | dnl |
6426998c RL |
35 | dnl ..and update WX_CURRENT, WX_RELEASE and WX_AGE according to the |
36 | dnl following rules: | |
2b6f061f | 37 | dnl |
6426998c RL |
38 | dnl If any changes have been made to the public interface, that is if any |
39 | dnl exported class, method, global or global type has been added, removed | |
40 | dnl or changed in any way, then do: WX_CURRENT += 1 | |
41 | dnl | |
42 | dnl If source changes have been made that *do not* alter the public | |
43 | dnl interface then do: WX_REVISION += 1 | |
44 | dnl If WX_CURRENT was incremented (as above) instead do: WX_REVISION = 0 | |
45 | dnl | |
46 | dnl If any public interface was added, do: WX_AGE += 1 | |
47 | dnl If any public interface was removed (or altered in a way effectively | |
48 | dnl removing the previous definition), instead do: WX_AGE = 0 | |
49 | dnl | |
50 | dnl When the major or minor version numbers are incremented, all the above | |
51 | dnl variables should be reset to 0. | |
52 | dnl | |
53 | dnl The resulting library name will be of the form: | |
54 | dnl libwx_$(TOOLKIT)-$(WX_RELEASE).so.$(WX_CURRENT).$(WX_REVISION).$(WX_AGE) | |
9a98a854 VZ |
55 | |
56 | WX_MAJOR_VERSION_NUMBER=2 | |
34bed6d9 VZ |
57 | WX_MINOR_VERSION_NUMBER=5 |
58 | WX_RELEASE_NUMBER=0 | |
9a98a854 | 59 | |
2b6f061f | 60 | WX_VERSION=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER.$WX_RELEASE_NUMBER |
2aa88730 | 61 | WX_RELEASE=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER |
6426998c | 62 | |
978f1259 RL |
63 | WX_MSW_VERSION=$WX_MAJOR_VERSION_NUMBER$WX_MINOR_VERSION_NUMBER$WX_RELEASE_NUMBER |
64 | ||
34bed6d9 | 65 | WX_CURRENT=0 |
6426998c RL |
66 | WX_REVISION=0 |
67 | WX_AGE=0 | |
68 | ||
9a98a854 VZ |
69 | |
70 | dnl ------------------------------------------------------------------------ | |
71 | dnl Check platform (host system) | |
72 | dnl ------------------------------------------------------------------------ | |
73 | ||
4a8900f2 | 74 | dnl OS (assume Unix) |
9a98a854 | 75 | USE_UNIX=1 |
4882bf1b | 76 | USE_WIN32=0 |
f9bc1684 | 77 | USE_DOS=0 |
b12915c1 | 78 | USE_BEOS=0 |
1216f52d | 79 | USE_MAC=0 |
b12915c1 | 80 | |
4a8900f2 | 81 | dnl Unix kind |
9a98a854 | 82 | USE_AIX= |
32b38f99 VZ |
83 | USE_BSD= dnl any BSD |
84 | USE_DARWIN= dnl a.k.a. Mac OS X | |
9a98a854 | 85 | USE_FREEBSD= |
32b38f99 | 86 | USE_GNU= dnl GNU/Hurd |
4a8900f2 VZ |
87 | USE_HPUX= |
88 | USE_LINUX= | |
f6bcfd97 | 89 | USE_NETBSD= |
4a8900f2 | 90 | USE_OPENBSD= |
32b38f99 | 91 | USE_OSF= dnl OSF/1 (obsolete?) |
4a8900f2 | 92 | USE_SGI= |
32b38f99 VZ |
93 | USE_SOLARIS= dnl Solaris ("SunOS" >= 5) |
94 | USE_SUN= dnl SunOS or Solaris | |
95 | USE_SUNOS= dnl old/real SunOS (obsolete) | |
96 | USE_SVR4= dnl SysV R4 | |
97 | USE_SYSV= dnl any System V | |
9a98a854 VZ |
98 | USE_VMS= |
99 | USE_ULTRIX= | |
4a8900f2 VZ |
100 | USE_UNIXWARE= |
101 | ||
102 | dnl hardware platform | |
103 | USE_ALPHA= | |
9a98a854 | 104 | |
ab9b9eab VZ |
105 | dnl on some platforms xxx_r() functions are declared inside "#ifdef |
106 | dnl _REENTRANT" and it's easier to just define this symbol for these platforms | |
107 | dnl than checking it during run-time | |
108 | NEEDS_D_REENTRANT_FOR_R_FUNCS=0 | |
109 | ||
ced859c3 | 110 | dnl the list of all available toolkits |
1e6feb95 VZ |
111 | dnl |
112 | dnl update NUM_TOOLKITS calculation below when adding a new toolkit here! | |
ac0c4cc3 | 113 | ALL_TOOLKITS="COCOA GTK MAC MGL MICROWIN MOTIF MSW PM X11" |
ced859c3 | 114 | |
9a98a854 VZ |
115 | dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones |
116 | dnl which are either yes or no | |
ac0c4cc3 | 117 | DEFAULT_wxUSE_COCOA=0 |
9a98a854 | 118 | DEFAULT_wxUSE_GTK=0 |
1e6feb95 VZ |
119 | DEFAULT_wxUSE_MAC=0 |
120 | DEFAULT_wxUSE_MGL=0 | |
1725144d | 121 | DEFAULT_wxUSE_MICROWIN=0 |
9a98a854 VZ |
122 | DEFAULT_wxUSE_MOTIF=0 |
123 | DEFAULT_wxUSE_MSW=0 | |
e07802fc | 124 | DEFAULT_wxUSE_PM=0 |
7f5c07ab | 125 | DEFAULT_wxUSE_X11=0 |
9a98a854 | 126 | |
143121c5 VZ |
127 | dnl these are the values which are really default for the given platform - |
128 | dnl they're not cached and are only used if no --with-toolkit was given *and* | |
129 | dnl nothing was found in the cache | |
ac0c4cc3 | 130 | DEFAULT_DEFAULT_wxUSE_COCOA=0 |
143121c5 | 131 | DEFAULT_DEFAULT_wxUSE_GTK=0 |
1e6feb95 VZ |
132 | DEFAULT_DEFAULT_wxUSE_MAC=0 |
133 | DEFAULT_DEFAULT_wxUSE_MGL=0 | |
1725144d | 134 | DEFAULT_DEFAULT_wxUSE_MICROWIN=0 |
143121c5 VZ |
135 | DEFAULT_DEFAULT_wxUSE_MOTIF=0 |
136 | DEFAULT_DEFAULT_wxUSE_MSW=0 | |
e07802fc | 137 | DEFAULT_DEFAULT_wxUSE_PM=0 |
7f5c07ab | 138 | DEFAULT_DEFAULT_wxUSE_X11=0 |
143121c5 | 139 | |
d6a55c4b | 140 | PROGRAM_EXT= |
3a922bb4 | 141 | SO_SUFFIX=so |
fe0895cf | 142 | SAMPLES_RPATH_FLAG= |
d6a55c4b | 143 | |
b12915c1 VZ |
144 | dnl to support a new system, you need to add its canonical name (as determined |
145 | dnl by config.sub or specified by the configure command line) to this "case" | |
146 | dnl and also define the shared library flags below - search for | |
147 | dnl SHARED_LIB_SETUP to find the exact place | |
9a98a854 VZ |
148 | case "${host}" in |
149 | *-hp-hpux* ) | |
150 | USE_HPUX=1 | |
143121c5 | 151 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
ab9b9eab | 152 | NEEDS_D_REENTRANT_FOR_R_FUNCS=1 |
3a922bb4 | 153 | SO_SUFFIX=sl |
9a98a854 VZ |
154 | AC_DEFINE(__HPUX__) |
155 | ;; | |
156 | *-*-linux* ) | |
157 | USE_LINUX=1 | |
158 | AC_DEFINE(__LINUX__) | |
159 | TMP=`uname -m` | |
160 | if test "x$TMP" = "xalpha"; then | |
161 | USE_ALPHA=1 | |
162 | AC_DEFINE(__ALPHA__) | |
163 | fi | |
143121c5 | 164 | DEFAULT_DEFAULT_wxUSE_GTK=1 |
9a98a854 | 165 | ;; |
32b38f99 VZ |
166 | *-*-gnu* ) |
167 | USE_GNU=1 | |
168 | AC_DEFINE(__GNU__) | |
169 | TMP=`uname -m` | |
170 | if test "x$TMP" = "xalpha"; then | |
171 | USE_ALPHA=1 | |
172 | AC_DEFINE(__ALPHA__) | |
173 | fi | |
174 | DEFAULT_DEFAULT_wxUSE_GTK=1 | |
175 | ;; | |
9a98a854 VZ |
176 | *-*-irix5* | *-*-irix6* ) |
177 | USE_SGI=1 | |
178 | USE_SVR4=1 | |
179 | AC_DEFINE(__SGI__) | |
180 | AC_DEFINE(__SVR4__) | |
143121c5 | 181 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
9a98a854 VZ |
182 | ;; |
183 | *-*-solaris2* ) | |
184 | USE_SUN=1 | |
185 | USE_SOLARIS=1 | |
186 | USE_SVR4=1 | |
187 | AC_DEFINE(__SUN__) | |
188 | AC_DEFINE(__SOLARIS__) | |
189 | AC_DEFINE(__SVR4__) | |
143121c5 | 190 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
ab9b9eab | 191 | NEEDS_D_REENTRANT_FOR_R_FUNCS=1 |
9a98a854 VZ |
192 | ;; |
193 | *-*-sunos4* ) | |
194 | USE_SUN=1 | |
195 | USE_SUNOS=1 | |
196 | USE_BSD=1 | |
197 | AC_DEFINE(__SUN__) | |
198 | AC_DEFINE(__SUNOS__) | |
199 | AC_DEFINE(__BSD__) | |
143121c5 | 200 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
9a98a854 | 201 | ;; |
f6bcfd97 | 202 | *-*-freebsd*) |
9a98a854 VZ |
203 | USE_BSD=1 |
204 | USE_FREEBSD=1 | |
205 | AC_DEFINE(__FREEBSD__) | |
206 | AC_DEFINE(__BSD__) | |
143121c5 | 207 | DEFAULT_DEFAULT_wxUSE_GTK=1 |
9a98a854 | 208 | ;; |
1cf8c0a9 VZ |
209 | *-*-openbsd*) |
210 | USE_BSD=1 | |
211 | USE_OPENBSD=1 | |
1cf8c0a9 | 212 | AC_DEFINE(__OPENBSD__) |
2b5f62a0 | 213 | AC_DEFINE(__BSD__) |
1cf8c0a9 VZ |
214 | DEFAULT_DEFAULT_wxUSE_GTK=1 |
215 | ;; | |
f6bcfd97 BP |
216 | *-*-netbsd*) |
217 | USE_BSD=1 | |
218 | USE_NETBSD=1 | |
f6bcfd97 | 219 | AC_DEFINE(__NETBSD__) |
2b5f62a0 | 220 | AC_DEFINE(__BSD__) |
f6bcfd97 BP |
221 | DEFAULT_DEFAULT_wxUSE_GTK=1 |
222 | ;; | |
9a98a854 VZ |
223 | *-*-osf* ) |
224 | USE_ALPHA=1 | |
225 | USE_OSF=1 | |
226 | AC_DEFINE(__ALPHA__) | |
227 | AC_DEFINE(__OSF__) | |
143121c5 | 228 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
f6bcfd97 | 229 | NEEDS_D_REENTRANT_FOR_R_FUNCS=1 |
9a98a854 VZ |
230 | ;; |
231 | *-*-dgux5* ) | |
232 | USE_ALPHA=1 | |
233 | USE_SVR4=1 | |
234 | AC_DEFINE(__ALPHA__) | |
235 | AC_DEFINE(__SVR4__) | |
143121c5 | 236 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
9a98a854 VZ |
237 | ;; |
238 | *-*-sysv5* ) | |
239 | USE_SYSV=1 | |
240 | USE_SVR4=1 | |
241 | AC_DEFINE(__SYSV__) | |
242 | AC_DEFINE(__SVR4__) | |
143121c5 | 243 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
9a98a854 VZ |
244 | ;; |
245 | *-*-aix* ) | |
246 | USE_AIX=1 | |
247 | USE_SYSV=1 | |
248 | USE_SVR4=1 | |
2b5f62a0 VZ |
249 | dnl quoting from http://www-1.ibm.com/servers/esdd/articles/gnu.html: |
250 | dnl | |
251 | dnl Both archive libraries and shared libraries on AIX have an .a | |
252 | dnl extension. This will explain why you can't link with an .so and | |
1542ea39 | 253 | dnl why it works with the name changed to .a. |
321d2b14 | 254 | SO_SUFFIX=a |
9a98a854 VZ |
255 | AC_DEFINE(__AIX__) |
256 | AC_DEFINE(__SYSV__) | |
257 | AC_DEFINE(__SVR4__) | |
143121c5 | 258 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 |
9a98a854 | 259 | ;; |
a9b5e89f | 260 | |
4a8900f2 VZ |
261 | *-*-*UnixWare*) |
262 | USE_SYSV=1 | |
263 | USE_SVR4=1 | |
264 | USE_UNIXWARE=1 | |
265 | AC_DEFINE(__UNIXWARE__) | |
266 | ;; | |
267 | ||
1c8183e2 | 268 | *-*-cygwin* | *-*-mingw32* ) |
17234b26 MB |
269 | dnl MBN: some of the defines have been moved after toolkit detection |
270 | dnl because for wxMotif/wxGTK/wxX11 to build on Cygwin | |
271 | dnl USE_UNIX must be set and not USE_WIN32 | |
3a922bb4 | 272 | SO_SUFFIX=dll |
cf27ef00 | 273 | PROGRAM_EXT=".exe" |
7b7a7637 | 274 | RESCOMP=windres |
a9b5e89f VZ |
275 | DEFAULT_DEFAULT_wxUSE_MSW=1 |
276 | ;; | |
277 | ||
f9bc1684 VS |
278 | *-pc-msdosdjgpp ) |
279 | USE_UNIX=0 | |
280 | USE_DOS=1 | |
281 | AC_DEFINE(__DOS__) | |
282 | PROGRAM_EXT=".exe" | |
283 | DEFAULT_DEFAULT_wxUSE_MGL=1 | |
24f5e003 VS |
284 | dnl DJGPP needs explicit -lstdc++ for some reason (VS: mayb some versions only?) |
285 | LIBS="$LIBS -lstdc++" | |
f9bc1684 VS |
286 | ;; |
287 | ||
9829f277 | 288 | *-pc-os2_emx | *-pc-os2-emx ) |
91b8de8d | 289 | AC_DEFINE(__EMX__) |
cf27ef00 | 290 | PROGRAM_EXT=".exe" |
e07802fc | 291 | DEFAULT_DEFAULT_wxUSE_PM=1 |
91b8de8d | 292 | ;; |
a9b5e89f | 293 | |
d08b457b GD |
294 | powerpc-*-darwin* ) |
295 | dnl PowerPC Darwin based distributions (including Mac OS X) | |
b4085ce6 | 296 | USE_BSD=1 |
f11bdd03 | 297 | USE_DARWIN=1 |
3a922bb4 | 298 | SO_SUFFIX=dylib |
b4085ce6 | 299 | AC_DEFINE(__BSD__) |
f11bdd03 | 300 | AC_DEFINE(__DARWIN__) |
d08b457b | 301 | AC_DEFINE(__POWERPC__) |
82d43113 | 302 | AC_DEFINE(TARGET_CARBON) |
b4085ce6 GD |
303 | DEFAULT_DEFAULT_wxUSE_MAC=1 |
304 | ;; | |
305 | ||
b12915c1 VZ |
306 | *-*-beos* ) |
307 | dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this | |
308 | USE_BEOS=1 | |
309 | AC_DEFINE(__BEOS__) | |
310 | ;; | |
311 | ||
9a98a854 | 312 | *) |
a9b5e89f | 313 | AC_MSG_ERROR(unknown system type ${host}.) |
9a98a854 VZ |
314 | esac |
315 | ||
9a98a854 VZ |
316 | dnl --------------------------------------------------------------------------- |
317 | dnl command line options for configure | |
318 | dnl --------------------------------------------------------------------------- | |
319 | ||
320 | dnl the default values for all options - we collect them all here to simplify | |
321 | dnl modification of the default values (for example, if the defaults for some | |
322 | dnl platform should be changed, it can be done here too) | |
323 | dnl | |
324 | dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above | |
325 | ||
143121c5 VZ |
326 | WX_ARG_CACHE_INIT |
327 | ||
9a98a854 VZ |
328 | dnl useful to test the compilation with minimum options, define as 0 for normal |
329 | dnl usage | |
330 | DEBUG_CONFIGURE=0 | |
331 | if test $DEBUG_CONFIGURE = 1; then | |
1e6feb95 VZ |
332 | DEFAULT_wxUSE_UNIVERSAL=no |
333 | ||
6ec507fd JS |
334 | DEFAULT_wxUSE_NANOX=no |
335 | ||
9a98a854 VZ |
336 | DEFAULT_wxUSE_THREADS=yes |
337 | ||
2aa88730 | 338 | DEFAULT_wxUSE_SHARED=yes |
1e6feb95 | 339 | DEFAULT_wxUSE_OPTIMISE=no |
9a98a854 | 340 | DEFAULT_wxUSE_PROFILE=no |
5586805b | 341 | DEFAULT_wxUSE_NO_DEPS=no |
8f4a9a10 RR |
342 | DEFAULT_wxUSE_NO_RTTI=no |
343 | DEFAULT_wxUSE_NO_EXCEPTIONS=no | |
5586805b | 344 | DEFAULT_wxUSE_PERMISSIVE=no |
9a98a854 VZ |
345 | DEFAULT_wxUSE_DEBUG_FLAG=yes |
346 | DEFAULT_wxUSE_DEBUG_INFO=yes | |
347 | DEFAULT_wxUSE_DEBUG_GDB=yes | |
348 | DEFAULT_wxUSE_MEM_TRACING=no | |
143121c5 | 349 | DEFAULT_wxUSE_DEBUG_CONTEXT=no |
9a98a854 | 350 | DEFAULT_wxUSE_DMALLOC=no |
a7ae7112 | 351 | DEFAULT_wxUSE_PRECOMP=no |
9a98a854 VZ |
352 | DEFAULT_wxUSE_APPLE_IEEE=no |
353 | ||
354 | DEFAULT_wxUSE_LOG=yes | |
1e6feb95 VZ |
355 | DEFAULT_wxUSE_LOGWINDOW=no |
356 | DEFAULT_wxUSE_LOGGUI=no | |
69d27ff7 | 357 | DEFAULT_wxUSE_LOGDIALOG=no |
9a98a854 VZ |
358 | |
359 | DEFAULT_wxUSE_GUI=yes | |
1e6feb95 | 360 | DEFAULT_wxUSE_CONTROLS=no |
9a98a854 | 361 | |
3e44f09d | 362 | DEFAULT_wxUSE_REGEX=no |
9a98a854 VZ |
363 | DEFAULT_wxUSE_ZLIB=no |
364 | DEFAULT_wxUSE_LIBPNG=no | |
9a98a854 | 365 | DEFAULT_wxUSE_LIBJPEG=no |
c7a2bf27 | 366 | DEFAULT_wxUSE_LIBTIFF=no |
9a98a854 | 367 | DEFAULT_wxUSE_ODBC=no |
bdad4e7e | 368 | DEFAULT_wxUSE_OPENGL=no |
9a98a854 | 369 | |
eb4efbdc | 370 | DEFAULT_wxUSE_ON_FATAL_EXCEPTION=no |
4f3c5f06 | 371 | DEFAULT_wxUSE_SNGLINST_CHECKER=no |
fd15d8f1 | 372 | DEFAULT_wxUSE_STD_IOSTREAM=no |
1e6feb95 VZ |
373 | DEFAULT_wxUSE_CMDLINE_PARSER=no |
374 | DEFAULT_wxUSE_DATETIME=no | |
1e6feb95 VZ |
375 | DEFAULT_wxUSE_TIMER=no |
376 | DEFAULT_wxUSE_STOPWATCH=no | |
9a98a854 | 377 | DEFAULT_wxUSE_FILE=no |
1e6feb95 | 378 | DEFAULT_wxUSE_FFILE=no |
a3a584a7 | 379 | DEFAULT_wxUSE_TEXTBUFFER=no |
9a98a854 | 380 | DEFAULT_wxUSE_TEXTFILE=no |
2749089a | 381 | DEFAULT_wxUSE_WAVE=no |
9a98a854 VZ |
382 | DEFAULT_wxUSE_INTL=no |
383 | DEFAULT_wxUSE_CONFIG=no | |
1e6feb95 | 384 | DEFAULT_wxUSE_FONTMAP=no |
9a98a854 VZ |
385 | DEFAULT_wxUSE_STREAMS=no |
386 | DEFAULT_wxUSE_SOCKETS=no | |
3bce6687 JS |
387 | DEFAULT_wxUSE_OLE=no |
388 | DEFAULT_wxUSE_DATAOBJ=no | |
1c8515f9 | 389 | DEFAULT_wxUSE_DIALUP_MANAGER=no |
9a98a854 | 390 | DEFAULT_wxUSE_JOYSTICK=no |
6bff71f8 | 391 | DEFAULT_wxUSE_DYNLIB_CLASS=no |
0b9ab0bd | 392 | DEFAULT_wxUSE_DYNAMIC_LOADER=no |
9a98a854 | 393 | DEFAULT_wxUSE_LONGLONG=no |
e8f65ba6 | 394 | DEFAULT_wxUSE_GEOMETRY=no |
9a98a854 VZ |
395 | |
396 | DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no | |
397 | DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no | |
398 | DEFAULT_wxUSE_POSTSCRIPT=no | |
399 | ||
9a98a854 VZ |
400 | DEFAULT_wxUSE_CLIPBOARD=no |
401 | DEFAULT_wxUSE_TOOLTIPS=no | |
402 | DEFAULT_wxUSE_DRAG_AND_DROP=no | |
24fd6d87 | 403 | DEFAULT_wxUSE_DRAGIMAGE=no |
9a98a854 VZ |
404 | DEFAULT_wxUSE_SPLINES=no |
405 | ||
406 | DEFAULT_wxUSE_MDI_ARCHITECTURE=no | |
407 | DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no | |
408 | DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no | |
409 | ||
9a98a854 VZ |
410 | DEFAULT_wxUSE_RESOURCES=no |
411 | DEFAULT_wxUSE_CONSTRAINTS=no | |
412 | DEFAULT_wxUSE_IPC=no | |
413 | DEFAULT_wxUSE_HELP=no | |
29fd3c0c | 414 | DEFAULT_wxUSE_MS_HTML_HELP=no |
3379ed37 | 415 | DEFAULT_wxUSE_WXHTML_HELP=no |
24176f2c | 416 | DEFAULT_wxUSE_TREELAYOUT=no |
9a98a854 | 417 | DEFAULT_wxUSE_METAFILE=no |
1e6feb95 | 418 | DEFAULT_wxUSE_MIMETYPE=no |
4cdb0ab0 VS |
419 | DEFAULT_wxUSE_SYSTEM_OPTIONS=no |
420 | DEFAULT_wxUSE_PROTOCOL=no | |
421 | DEFAULT_wxUSE_PROTOCOL_HTTP=no | |
422 | DEFAULT_wxUSE_PROTOCOL_FTP=no | |
423 | DEFAULT_wxUSE_PROTOCOL_FILE=no | |
424 | DEFAULT_wxUSE_URL=no | |
3bd8fb5f | 425 | |
9a98a854 | 426 | DEFAULT_wxUSE_COMMONDLGS=no |
1e6feb95 VZ |
427 | DEFAULT_wxUSE_CHOICEDLG=no |
428 | DEFAULT_wxUSE_COLOURDLG=no | |
ce4169a4 | 429 | DEFAULT_wxUSE_DIRDLG=no |
1e6feb95 | 430 | DEFAULT_wxUSE_FILEDLG=no |
8db37e06 | 431 | DEFAULT_wxUSE_FINDREPLDLG=no |
1e6feb95 VZ |
432 | DEFAULT_wxUSE_FONTDLG=no |
433 | DEFAULT_wxUSE_MSGDLG=no | |
434 | DEFAULT_wxUSE_NUMBERDLG=no | |
c11584af | 435 | DEFAULT_wxUSE_TEXTDLG=no |
cbca9943 | 436 | DEFAULT_wxUSE_SPLASH=no |
a641505f | 437 | DEFAULT_wxUSE_STARTUP_TIPS=no |
ce4169a4 | 438 | DEFAULT_wxUSE_PROGRESSDLG=no |
b1f5d087 VZ |
439 | DEFAULT_wxUSE_WIZARDDLG=no |
440 | ||
1e6feb95 | 441 | DEFAULT_wxUSE_MENUS=no |
9a98a854 | 442 | DEFAULT_wxUSE_MINIFRAME=no |
5526e819 | 443 | DEFAULT_wxUSE_HTML=no |
24528b0c | 444 | DEFAULT_wxUSE_FILESYSTEM=no |
e3e717ec VZ |
445 | DEFAULT_wxUSE_FS_INET=no |
446 | DEFAULT_wxUSE_FS_ZIP=no | |
d78b3d64 VS |
447 | DEFAULT_wxUSE_BUSYINFO=no |
448 | DEFAULT_wxUSE_ZIPSTREAM=no | |
1e6feb95 | 449 | DEFAULT_wxUSE_VALIDATORS=no |
9a98a854 VZ |
450 | |
451 | DEFAULT_wxUSE_ACCEL=no | |
1e6feb95 | 452 | DEFAULT_wxUSE_BUTTON=no |
9a98a854 | 453 | DEFAULT_wxUSE_BMPBUTTON=no |
1e6feb95 VZ |
454 | DEFAULT_wxUSE_CALCTRL=no |
455 | DEFAULT_wxUSE_CARET=no | |
9a98a854 VZ |
456 | DEFAULT_wxUSE_CHECKBOX=no |
457 | DEFAULT_wxUSE_CHECKLST=no | |
1e6feb95 | 458 | DEFAULT_wxUSE_CHOICE=no |
9a98a854 | 459 | DEFAULT_wxUSE_COMBOBOX=no |
ddb4769e | 460 | DEFAULT_wxUSE_DISPLAY=no |
9a98a854 VZ |
461 | DEFAULT_wxUSE_GAUGE=no |
462 | DEFAULT_wxUSE_GRID=no | |
463 | DEFAULT_wxUSE_IMAGLIST=no | |
464 | DEFAULT_wxUSE_LISTBOX=no | |
465 | DEFAULT_wxUSE_LISTCTRL=no | |
466 | DEFAULT_wxUSE_NOTEBOOK=no | |
467 | DEFAULT_wxUSE_RADIOBOX=no | |
468 | DEFAULT_wxUSE_RADIOBTN=no | |
e602002e | 469 | DEFAULT_wxUSE_SASH=no |
9a98a854 VZ |
470 | DEFAULT_wxUSE_SCROLLBAR=no |
471 | DEFAULT_wxUSE_SLIDER=no | |
472 | DEFAULT_wxUSE_SPINBTN=no | |
66f38406 | 473 | DEFAULT_wxUSE_SPINCTRL=no |
9a98a854 VZ |
474 | DEFAULT_wxUSE_SPLITTER=no |
475 | DEFAULT_wxUSE_STATBMP=no | |
476 | DEFAULT_wxUSE_STATBOX=no | |
477 | DEFAULT_wxUSE_STATLINE=no | |
1e6feb95 | 478 | DEFAULT_wxUSE_STATTEXT=no |
9a98a854 VZ |
479 | DEFAULT_wxUSE_STATUSBAR=yes |
480 | DEFAULT_wxUSE_TABDIALOG=no | |
1e6feb95 | 481 | DEFAULT_wxUSE_TEXTCTRL=no |
1db8dc4a | 482 | DEFAULT_wxUSE_TOGGLEBTN=no |
9a98a854 | 483 | DEFAULT_wxUSE_TOOLBAR=no |
360d6699 VZ |
484 | DEFAULT_wxUSE_TOOLBAR_NATIVE=no |
485 | DEFAULT_wxUSE_TOOLBAR_SIMPLE=no | |
9a98a854 | 486 | DEFAULT_wxUSE_TREECTRL=no |
9f41d601 | 487 | DEFAULT_wxUSE_POPUPWIN=no |
0b01706f | 488 | DEFAULT_wxUSE_TIPWINDOW=no |
9a98a854 VZ |
489 | |
490 | DEFAULT_wxUSE_UNICODE=no | |
a72a4bfa | 491 | DEFAULT_wxUSE_UNICODE_MSLU=no |
9a98a854 | 492 | DEFAULT_wxUSE_WCSRTOMBS=no |
e90c1d2a | 493 | |
d275c7eb | 494 | DEFAULT_wxUSE_PALETTE=no |
0046ff7c | 495 | DEFAULT_wxUSE_IMAGE=no |
0940bcf7 HH |
496 | DEFAULT_wxUSE_GIF=no |
497 | DEFAULT_wxUSE_PCX=no | |
498 | DEFAULT_wxUSE_PNM=no | |
4b6b4dfc | 499 | DEFAULT_wxUSE_IFF=no |
0046ff7c | 500 | DEFAULT_wxUSE_XPM=no |
658974ae | 501 | DEFAULT_wxUSE_ICO_CUR=no |
7bb2947d | 502 | DEFAULT_wxUSE_ACCESSIBILITY=no |
08b3ac36 VS |
503 | |
504 | DEFAULT_wxUSE_MONOLITHIC=yes | |
9a98a854 | 505 | else |
1e6feb95 VZ |
506 | DEFAULT_wxUSE_UNIVERSAL=no |
507 | ||
6ec507fd JS |
508 | DEFAULT_wxUSE_NANOX=no |
509 | ||
9a98a854 VZ |
510 | DEFAULT_wxUSE_THREADS=yes |
511 | ||
2aa88730 | 512 | DEFAULT_wxUSE_SHARED=yes |
9a98a854 VZ |
513 | DEFAULT_wxUSE_OPTIMISE=yes |
514 | DEFAULT_wxUSE_PROFILE=no | |
5586805b | 515 | DEFAULT_wxUSE_NO_DEPS=no |
8f4a9a10 RR |
516 | DEFAULT_wxUSE_NO_RTTI=no |
517 | DEFAULT_wxUSE_NO_EXCEPTIONS=no | |
5586805b | 518 | DEFAULT_wxUSE_PERMISSIVE=no |
9a98a854 VZ |
519 | DEFAULT_wxUSE_DEBUG_FLAG=no |
520 | DEFAULT_wxUSE_DEBUG_INFO=no | |
521 | DEFAULT_wxUSE_DEBUG_GDB=no | |
522 | DEFAULT_wxUSE_MEM_TRACING=no | |
143121c5 | 523 | DEFAULT_wxUSE_DEBUG_CONTEXT=no |
9a98a854 | 524 | DEFAULT_wxUSE_DMALLOC=no |
a7ae7112 | 525 | DEFAULT_wxUSE_PRECOMP=no |
9a98a854 VZ |
526 | DEFAULT_wxUSE_APPLE_IEEE=yes |
527 | ||
528 | DEFAULT_wxUSE_LOG=yes | |
d73be714 VZ |
529 | DEFAULT_wxUSE_LOGWINDOW=yes |
530 | DEFAULT_wxUSE_LOGGUI=yes | |
69d27ff7 | 531 | DEFAULT_wxUSE_LOGDIALOG=yes |
9a98a854 VZ |
532 | |
533 | DEFAULT_wxUSE_GUI=yes | |
534 | ||
831b3152 | 535 | DEFAULT_wxUSE_REGEX=yes |
9a98a854 VZ |
536 | DEFAULT_wxUSE_ZLIB=yes |
537 | DEFAULT_wxUSE_LIBPNG=yes | |
9a98a854 | 538 | DEFAULT_wxUSE_LIBJPEG=yes |
b47c832e | 539 | DEFAULT_wxUSE_LIBTIFF=yes |
16b52fa1 | 540 | DEFAULT_wxUSE_ODBC=no |
bdad4e7e | 541 | DEFAULT_wxUSE_OPENGL=no |
9a98a854 | 542 | |
eb4efbdc | 543 | DEFAULT_wxUSE_ON_FATAL_EXCEPTION=yes |
4f3c5f06 | 544 | DEFAULT_wxUSE_SNGLINST_CHECKER=yes |
073478b3 | 545 | DEFAULT_wxUSE_STD_IOSTREAM=no |
1e6feb95 VZ |
546 | DEFAULT_wxUSE_CMDLINE_PARSER=yes |
547 | DEFAULT_wxUSE_DATETIME=yes | |
1e6feb95 VZ |
548 | DEFAULT_wxUSE_TIMER=yes |
549 | DEFAULT_wxUSE_STOPWATCH=yes | |
9a98a854 | 550 | DEFAULT_wxUSE_FILE=yes |
1e6feb95 | 551 | DEFAULT_wxUSE_FFILE=yes |
a3a584a7 | 552 | DEFAULT_wxUSE_TEXTBUFFER=yes |
9a98a854 | 553 | DEFAULT_wxUSE_TEXTFILE=yes |
2749089a | 554 | DEFAULT_wxUSE_WAVE=no |
9a98a854 VZ |
555 | DEFAULT_wxUSE_INTL=yes |
556 | DEFAULT_wxUSE_CONFIG=yes | |
1e6feb95 | 557 | DEFAULT_wxUSE_FONTMAP=yes |
9a98a854 VZ |
558 | DEFAULT_wxUSE_STREAMS=yes |
559 | DEFAULT_wxUSE_SOCKETS=yes | |
3bce6687 JS |
560 | DEFAULT_wxUSE_OLE=yes |
561 | DEFAULT_wxUSE_DATAOBJ=yes | |
1c8515f9 | 562 | DEFAULT_wxUSE_DIALUP_MANAGER=yes |
9a98a854 | 563 | DEFAULT_wxUSE_JOYSTICK=yes |
6bff71f8 | 564 | DEFAULT_wxUSE_DYNLIB_CLASS=yes |
9337b578 | 565 | DEFAULT_wxUSE_DYNAMIC_LOADER=yes |
b685cd9b | 566 | DEFAULT_wxUSE_LONGLONG=yes |
e8f65ba6 | 567 | DEFAULT_wxUSE_GEOMETRY=yes |
9a98a854 VZ |
568 | |
569 | DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes | |
570 | DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes | |
571 | DEFAULT_wxUSE_POSTSCRIPT=yes | |
572 | ||
9a98a854 VZ |
573 | DEFAULT_wxUSE_CLIPBOARD=yes |
574 | DEFAULT_wxUSE_TOOLTIPS=yes | |
575 | DEFAULT_wxUSE_DRAG_AND_DROP=yes | |
24fd6d87 | 576 | DEFAULT_wxUSE_DRAGIMAGE=yes |
9a98a854 VZ |
577 | DEFAULT_wxUSE_SPLINES=yes |
578 | ||
579 | DEFAULT_wxUSE_MDI_ARCHITECTURE=yes | |
580 | DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes | |
581 | DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes | |
582 | ||
2b5f62a0 | 583 | DEFAULT_wxUSE_RESOURCES=no |
9a98a854 VZ |
584 | DEFAULT_wxUSE_CONSTRAINTS=yes |
585 | DEFAULT_wxUSE_IPC=yes | |
586 | DEFAULT_wxUSE_HELP=yes | |
29fd3c0c | 587 | DEFAULT_wxUSE_MS_HTML_HELP=yes |
3379ed37 | 588 | DEFAULT_wxUSE_WXHTML_HELP=yes |
24176f2c | 589 | DEFAULT_wxUSE_TREELAYOUT=yes |
9a98a854 | 590 | DEFAULT_wxUSE_METAFILE=yes |
1e6feb95 | 591 | DEFAULT_wxUSE_MIMETYPE=yes |
0cbff120 | 592 | DEFAULT_wxUSE_SYSTEM_OPTIONS=yes |
4cdb0ab0 VS |
593 | DEFAULT_wxUSE_PROTOCOL=yes |
594 | DEFAULT_wxUSE_PROTOCOL_HTTP=yes | |
595 | DEFAULT_wxUSE_PROTOCOL_FTP=yes | |
596 | DEFAULT_wxUSE_PROTOCOL_FILE=yes | |
597 | DEFAULT_wxUSE_URL=yes | |
9a98a854 VZ |
598 | |
599 | DEFAULT_wxUSE_COMMONDLGS=yes | |
1e6feb95 VZ |
600 | DEFAULT_wxUSE_CHOICEDLG=yes |
601 | DEFAULT_wxUSE_COLOURDLG=yes | |
ce4169a4 | 602 | DEFAULT_wxUSE_DIRDLG=yes |
1e6feb95 | 603 | DEFAULT_wxUSE_FILEDLG=yes |
8db37e06 | 604 | DEFAULT_wxUSE_FINDREPLDLG=yes |
1e6feb95 VZ |
605 | DEFAULT_wxUSE_FONTDLG=yes |
606 | DEFAULT_wxUSE_MSGDLG=yes | |
607 | DEFAULT_wxUSE_NUMBERDLG=yes | |
c11584af | 608 | DEFAULT_wxUSE_TEXTDLG=yes |
cbca9943 | 609 | DEFAULT_wxUSE_SPLASH=yes |
a641505f | 610 | DEFAULT_wxUSE_STARTUP_TIPS=yes |
ce4169a4 | 611 | DEFAULT_wxUSE_PROGRESSDLG=yes |
f33f19dd VZ |
612 | DEFAULT_wxUSE_WIZARDDLG=yes |
613 | ||
1e6feb95 | 614 | DEFAULT_wxUSE_MENUS=yes |
9a98a854 | 615 | DEFAULT_wxUSE_MINIFRAME=yes |
d4c241b9 | 616 | DEFAULT_wxUSE_HTML=yes |
24528b0c | 617 | DEFAULT_wxUSE_FILESYSTEM=yes |
d4c241b9 RR |
618 | DEFAULT_wxUSE_FS_INET=yes |
619 | DEFAULT_wxUSE_FS_ZIP=yes | |
620 | DEFAULT_wxUSE_BUSYINFO=yes | |
621 | DEFAULT_wxUSE_ZIPSTREAM=yes | |
9a98a854 VZ |
622 | DEFAULT_wxUSE_VALIDATORS=yes |
623 | ||
624 | DEFAULT_wxUSE_ACCEL=yes | |
1e6feb95 | 625 | DEFAULT_wxUSE_BUTTON=yes |
9a98a854 | 626 | DEFAULT_wxUSE_BMPBUTTON=yes |
1e6feb95 VZ |
627 | DEFAULT_wxUSE_CALCTRL=yes |
628 | DEFAULT_wxUSE_CARET=yes | |
9a98a854 VZ |
629 | DEFAULT_wxUSE_CHECKBOX=yes |
630 | DEFAULT_wxUSE_CHECKLST=yes | |
ce4169a4 | 631 | DEFAULT_wxUSE_CHOICE=yes |
9a98a854 | 632 | DEFAULT_wxUSE_COMBOBOX=yes |
ddb4769e | 633 | DEFAULT_wxUSE_DISPLAY=no |
9a98a854 VZ |
634 | DEFAULT_wxUSE_GAUGE=yes |
635 | DEFAULT_wxUSE_GRID=yes | |
636 | DEFAULT_wxUSE_IMAGLIST=yes | |
637 | DEFAULT_wxUSE_LISTBOX=yes | |
638 | DEFAULT_wxUSE_LISTCTRL=yes | |
639 | DEFAULT_wxUSE_NOTEBOOK=yes | |
640 | DEFAULT_wxUSE_RADIOBOX=yes | |
641 | DEFAULT_wxUSE_RADIOBTN=yes | |
e602002e | 642 | DEFAULT_wxUSE_SASH=yes |
9a98a854 VZ |
643 | DEFAULT_wxUSE_SCROLLBAR=yes |
644 | DEFAULT_wxUSE_SLIDER=yes | |
645 | DEFAULT_wxUSE_SPINBTN=yes | |
66f38406 | 646 | DEFAULT_wxUSE_SPINCTRL=yes |
9a98a854 VZ |
647 | DEFAULT_wxUSE_SPLITTER=yes |
648 | DEFAULT_wxUSE_STATBMP=yes | |
649 | DEFAULT_wxUSE_STATBOX=yes | |
650 | DEFAULT_wxUSE_STATLINE=yes | |
1e6feb95 | 651 | DEFAULT_wxUSE_STATTEXT=yes |
9a98a854 VZ |
652 | DEFAULT_wxUSE_STATUSBAR=yes |
653 | DEFAULT_wxUSE_TABDIALOG=no | |
1e6feb95 | 654 | DEFAULT_wxUSE_TEXTCTRL=yes |
1db8dc4a | 655 | DEFAULT_wxUSE_TOGGLEBTN=yes |
9a98a854 | 656 | DEFAULT_wxUSE_TOOLBAR=yes |
360d6699 VZ |
657 | DEFAULT_wxUSE_TOOLBAR_NATIVE=yes |
658 | DEFAULT_wxUSE_TOOLBAR_SIMPLE=yes | |
9a98a854 | 659 | DEFAULT_wxUSE_TREECTRL=yes |
9f41d601 | 660 | DEFAULT_wxUSE_POPUPWIN=yes |
0b01706f | 661 | DEFAULT_wxUSE_TIPWINDOW=yes |
9a98a854 VZ |
662 | |
663 | DEFAULT_wxUSE_UNICODE=no | |
a72a4bfa | 664 | DEFAULT_wxUSE_UNICODE_MSLU=yes |
9a98a854 | 665 | DEFAULT_wxUSE_WCSRTOMBS=no |
e90c1d2a | 666 | |
d275c7eb | 667 | DEFAULT_wxUSE_PALETTE=yes |
0046ff7c | 668 | DEFAULT_wxUSE_IMAGE=yes |
0940bcf7 HH |
669 | DEFAULT_wxUSE_GIF=yes |
670 | DEFAULT_wxUSE_PCX=yes | |
cc0e8480 | 671 | DEFAULT_wxUSE_IFF=no |
0940bcf7 | 672 | DEFAULT_wxUSE_PNM=yes |
0046ff7c | 673 | DEFAULT_wxUSE_XPM=yes |
658974ae | 674 | DEFAULT_wxUSE_ICO_CUR=yes |
7bb2947d | 675 | DEFAULT_wxUSE_ACCESSIBILITY=no |
08b3ac36 VS |
676 | |
677 | DEFAULT_wxUSE_MONOLITHIC=yes | |
9a98a854 VZ |
678 | fi |
679 | ||
143121c5 | 680 | dnl WX_ARG_WITH should be used to select whether an external package will be |
9a98a854 | 681 | dnl used or not, to configure compile-time features of this package itself, |
143121c5 | 682 | dnl use WX_ARG_ENABLE instead |
9a98a854 VZ |
683 | |
684 | dnl ============================ | |
685 | dnl external package dependecies | |
686 | dnl ============================ | |
687 | ||
143121c5 VZ |
688 | dnl these options use AC_ARG_WITH and not WX_ARG_WITH on purpose - we cache |
689 | dnl these values manually | |
ced859c3 | 690 | for toolkit in `echo $ALL_TOOLKITS`; do |
d74f4b5a VZ |
691 | LINE=`grep "wxUSE_$toolkit=" ${wx_arg_cache_file}` |
692 | if test "x$LINE" != "x" ; then | |
143121c5 VZ |
693 | has_toolkit_in_cache=1 |
694 | eval "DEFAULT_$LINE" | |
ced859c3 | 695 | eval "CACHE_$toolkit=1" |
143121c5 VZ |
696 | fi |
697 | done | |
698 | ||
e90c1d2a VZ |
699 | dnl --------------------------------------------------------------------------- |
700 | dnl --disable-gui will build only non-GUI part of wxWindows: check for this | |
701 | dnl first to disable many other switches if it's given | |
702 | dnl | |
703 | dnl NB: this is still in testing stage, don't use if you don't know what you're | |
704 | dnl doing | |
705 | dnl --------------------------------------------------------------------------- | |
706 | ||
707 | WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI) | |
08b3ac36 | 708 | WX_ARG_ENABLE(monolithic, [ --disable-monolithic don't build wxWindows as single library], wxUSE_MONOLITHIC) |
e90c1d2a | 709 | |
b12915c1 | 710 | if test "$wxUSE_GUI" = "yes"; then |
e90c1d2a | 711 | |
1e6feb95 | 712 | WX_ARG_ENABLE(universal, [ --enable-universal use wxWindows GUI controls instead of native ones], wxUSE_UNIVERSAL) |
ced859c3 VZ |
713 | AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) |
714 | AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) | |
b4085ce6 | 715 | AC_ARG_WITH(mac, [ --with-mac use Mac OS X], [wxUSE_MAC="$withval" TOOLKIT_GIVEN=1]) |
ac0c4cc3 | 716 | AC_ARG_WITH(cocoa, [ --with-cocoa use Cocoa], [wxUSE_COCOA="$withval" TOOLKIT_GIVEN=1]) |
d1188635 | 717 | AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1]) |
b4efce5e | 718 | AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1]) |
e07802fc | 719 | AC_ARG_WITH(pm, [ --with-pm use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1]) |
6c657b52 | 720 | AC_ARG_WITH(mgl, [ --with-mgl use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1]) |
1725144d | 721 | AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1]) |
3c011993 | 722 | AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) |
ba875e66 | 723 | WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) |
143121c5 | 724 | |
d74f4b5a | 725 | WX_ARG_ENABLE(gtk2, [ --enable-gtk2 use GTK+ 2.0 if available (EXPERIMENTAL)], wxUSE_GTK2) |
a9b5e89f | 726 | |
422107f9 VZ |
727 | WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG) |
728 | WX_ARG_SYS_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG) | |
0dcf9893 | 729 | WX_ARG_SYS_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF) |
143121c5 | 730 | WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL) |
b12915c1 VZ |
731 | |
732 | fi | |
733 | dnl for GUI only | |
734 | ||
d0e9b150 | 735 | WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (http://dmalloc.com/)], wxUSE_DMALLOC) |
3e44f09d | 736 | WX_ARG_SYS_WITH(regex, [ --with-regex enable support for wxRegEx class], wxUSE_REGEX) |
422107f9 | 737 | WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB) |
8647bec6 | 738 | WX_ARG_SYS_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], wxUSE_ODBC) |
9a98a854 | 739 | |
9a98a854 VZ |
740 | dnl --------------------------------------------------------------------------- |
741 | dnl compile options | |
742 | dnl --------------------------------------------------------------------------- | |
743 | ||
2aa88730 | 744 | WX_ARG_ENABLE(shared, [ --enable-shared create shared library code], wxUSE_SHARED) |
143121c5 | 745 | WX_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], wxUSE_OPTIMISE) |
143121c5 | 746 | WX_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], wxUSE_DEBUG) |
70d1b3cf | 747 | |
b2fee376 GD |
748 | dnl allow the precompiled header option to be disabled under Mac OS X/Darwin |
749 | WX_ARG_ENABLE(precomp, [ --enable-precomp enable use of precompiled headers (Mac OS X/Darwin)], wxUSE_PRECOMP) | |
683dccda | 750 | |
70d1b3cf VZ |
751 | if test "$wxUSE_DEBUG" = "yes"; then |
752 | DEFAULT_wxUSE_DEBUG_FLAG=yes | |
753 | DEFAULT_wxUSE_DEBUG_INFO=yes | |
754 | elif test "$wxUSE_DEBUG" = "no"; then | |
755 | DEFAULT_wxUSE_DEBUG_FLAG=no | |
756 | DEFAULT_wxUSE_DEBUG_INFO=no | |
757 | fi | |
758 | ||
f7bdcdd7 RR |
759 | WX_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)], wxUSE_DEBUG_FLAG) |
760 | WX_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information], wxUSE_DEBUG_INFO) | |
761 | WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB) | |
762 | WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT) | |
763 | WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING) | |
764 | WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE) | |
765 | WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI) | |
b3e8d00a | 766 | WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS) |
5586805b RR |
767 | WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE) |
768 | WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS) | |
9a98a854 | 769 | |
b3e8d00a | 770 | WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2) |
65d8ef1e VS |
771 | WX_ARG_ENABLE(compat22, [ --enable-compat22 enable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2) |
772 | WX_ARG_ENABLE(compat24, [ --disable-compat24 disable wxWindows 2.4 compatibility], WXWIN_COMPATIBILITY_2_4, disable) | |
54276ccf | 773 | |
3bd8fb5f RD |
774 | AC_ARG_ENABLE(rpath, [ --enable-rpath=DIR output the rpath flag from wx-config], [wxRPATH_DIR="$enableval"]) |
775 | ||
776 | if test "$wxRPATH_DIR" != "" -a "$wxRPATH_DIR" != "disable"; then | |
777 | WXCONFIG_RPATH="-Wl,-rpath -Wl,$wxRPATH_DIR" | |
778 | fi | |
779 | ||
780 | ||
9a98a854 VZ |
781 | dnl --------------------------------------------------------------------------- |
782 | dnl (small) optional non GUI classes | |
783 | dnl --------------------------------------------------------------------------- | |
784 | ||
fd15d8f1 RR |
785 | WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL) |
786 | WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG) | |
b12915c1 | 787 | |
a5d46b73 VZ |
788 | WX_ARG_ENABLE(protocols, [ --enable-protocols use wxProtocol and derived classes], wxUSE_PROTOCOL) |
789 | WX_ARG_ENABLE(ftp, [ --enable-ftp use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP) | |
790 | WX_ARG_ENABLE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP) | |
791 | WX_ARG_ENABLE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE) | |
fd15d8f1 | 792 | WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS) |
3bce6687 JS |
793 | WX_ARG_ENABLE(ole, [ --enable-ole use OLE classes], wxUSE_OLE) |
794 | WX_ARG_ENABLE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ) | |
b12915c1 | 795 | |
fd15d8f1 | 796 | WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) |
eb4efbdc | 797 | |
1e6feb95 VZ |
798 | WX_ARG_ENABLE(cmdline, [ --enable-cmdline use wxCmdLineParser class], wxUSE_CMDLINE_PARSER) |
799 | WX_ARG_ENABLE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME) | |
1e6feb95 | 800 | WX_ARG_ENABLE(stopwatch, [ --enable-stopwatch use wxStopWatch class], wxUSE_STOPWATCH) |
eb4efbdc | 801 | WX_ARG_ENABLE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER) |
fd15d8f1 | 802 | WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE) |
1e6feb95 | 803 | WX_ARG_ENABLE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER) |
fd15d8f1 RR |
804 | WX_ARG_ENABLE(wave, [ --enable-wave use wxWave class], wxUSE_WAVE) |
805 | WX_ARG_ENABLE(fraction, [ --enable-fraction use wxFraction class], wxUSE_FRACTION) | |
806 | WX_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS) | |
0b9ab0bd | 807 | WX_ARG_ENABLE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER) |
fd15d8f1 | 808 | WX_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG) |
e8f65ba6 | 809 | WX_ARG_ENABLE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY) |
fd15d8f1 RR |
810 | WX_ARG_ENABLE(log, [ --enable-log use logging system], wxUSE_LOG) |
811 | WX_ARG_ENABLE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS) | |
812 | WX_ARG_ENABLE(file, [ --enable-file use wxFile classes], wxUSE_FILE) | |
1e6feb95 | 813 | WX_ARG_ENABLE(ffile, [ --enable-ffile use wxFFile classes], wxUSE_FFILE) |
a3a584a7 VZ |
814 | WX_ARG_ENABLE(textbuf, [ --enable-textbuf use wxTextBuffer class], wxUSE_TEXTBUFFER) |
815 | WX_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE) | |
1e6feb95 | 816 | WX_ARG_ENABLE(fontmap, [ --enable-fontmap use font encodings conversion classes], wxUSE_FONTMAP) |
fd15d8f1 | 817 | WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], wxUSE_UNICODE) |
a72a4bfa | 818 | WX_ARG_ENABLE(mslu, [ --enable-mslu use MS Layer for Unicode on Windows 9x (win32 only)], wxUSE_UNICODE_MSLU) |
fd15d8f1 | 819 | WX_ARG_ENABLE(wxprintfv, [ --enable-wxprintfv use wxWindows implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF) |
fd15d8f1 | 820 | WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM) |
24528b0c | 821 | WX_ARG_ENABLE(filesystem, [ --enable-filesystem use virtual file systems classes], wxUSE_FILESYSTEM) |
e3e717ec VZ |
822 | WX_ARG_ENABLE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET) |
823 | WX_ARG_ENABLE(fs_zip, [ --enable-fs_zip use virtual ZIP filesystems], wxUSE_FS_ZIP) | |
d78b3d64 | 824 | WX_ARG_ENABLE(zipstream, [ --enable-zipstream use wxZipInputStream], wxUSE_ZIPSTREAM) |
9a98a854 | 825 | |
eb4efbdc | 826 | WX_ARG_ENABLE(catch_segvs, [ --enable-catch_segvs catch signals and pass them to wxApp::OnFatalException], wxUSE_ON_FATAL_EXCEPTION) |
4f3c5f06 | 827 | WX_ARG_ENABLE(snglinst, [ --enable-snglinst use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER) |
eb4efbdc | 828 | |
69d27ff7 | 829 | WX_ARG_ENABLE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE) |
b3e8d00a | 830 | WX_ARG_ENABLE(system_options,[ --enable-sysoptions use wxSystemOptions], wxUSE_SYSTEM_OPTIONS) |
1e6feb95 | 831 | |
4cdb0ab0 VS |
832 | WX_ARG_ENABLE(url, [ --enable-url use wxURL class], wxUSE_URL) |
833 | WX_ARG_ENABLE(protocol, [ --enable-protocol use wxProtocol class], wxUSE_PROTOCOL) | |
834 | WX_ARG_ENABLE(protocol_http, [ --enable-protocol-http HTTP support in wxProtocol], wxUSE_PROTOCOL_HTTP) | |
835 | WX_ARG_ENABLE(protocol_ftp, [ --enable-protocol-ftp FTP support in wxProtocol], wxUSE_PROTOCOL_FTP) | |
836 | WX_ARG_ENABLE(protocol_file, [ --enable-protocol-file FILE support in wxProtocol], wxUSE_PROTOCOL_FILE) | |
837 | ||
838 | ||
9a98a854 VZ |
839 | dnl --------------------------------------------------------------------------- |
840 | dnl "big" options (i.e. those which change a lot of things throughout the library) | |
841 | dnl --------------------------------------------------------------------------- | |
842 | ||
143121c5 | 843 | WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS) |
9a98a854 | 844 | |
b12915c1 VZ |
845 | if test "$wxUSE_GUI" = "yes"; then |
846 | ||
9a98a854 VZ |
847 | dnl --------------------------------------------------------------------------- |
848 | dnl "big" GUI options | |
849 | dnl --------------------------------------------------------------------------- | |
850 | ||
143121c5 | 851 | WX_ARG_ENABLE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE) |
3379ed37 | 852 | WX_ARG_ENABLE(help, [ --enable-help use help subsystem], wxUSE_HELP) |
29fd3c0c | 853 | WX_ARG_ENABLE(mshtmlhelp, [ --enable-mshtmlhelp use MS HTML Help (win32)], wxUSE_MS_HTML_HELP) |
3379ed37 VZ |
854 | WX_ARG_ENABLE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML) |
855 | WX_ARG_ENABLE(htmlhelp, [ --enable-htmlhelp use wxHTML-based help], wxUSE_WXHTML_HELP) | |
143121c5 VZ |
856 | WX_ARG_ENABLE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS) |
857 | WX_ARG_ENABLE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE) | |
858 | WX_ARG_ENABLE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI_ARCHITECTURE) | |
1e6feb95 VZ |
859 | WX_ARG_ENABLE(loggui, [ --enable-loggui use standard GUI logger], wxUSE_LOGGUI) |
860 | WX_ARG_ENABLE(logwin, [ --enable-logwin use wxLogWindow], wxUSE_LOGWINDOW) | |
69d27ff7 | 861 | WX_ARG_ENABLE(logdialog, [ --enable-logdialog use wxLogDialog], wxUSE_LOGDIALOG) |
9a98a854 VZ |
862 | |
863 | dnl --------------------------------------------------------------------------- | |
864 | dnl PostScript options | |
865 | dnl --------------------------------------------------------------------------- | |
143121c5 | 866 | WX_ARG_ENABLE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT) |
9a98a854 VZ |
867 | |
868 | dnl VZ: these options seem to be always on, if someone wants to change it please do | |
143121c5 VZ |
869 | dnl WX_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], dnl wxUSE_NORMALIZED_PS_FONTS) |
870 | dnl WX_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], dnl wxUSE_AFM_FOR_POSTSCRIPT) | |
9a98a854 VZ |
871 | |
872 | dnl --------------------------------------------------------------------------- | |
873 | dnl resources | |
874 | dnl --------------------------------------------------------------------------- | |
1e6feb95 | 875 | |
1b86c3ac VZ |
876 | WX_ARG_ENABLE(prologio, [ --enable-prologio not available; see contrib], wxUSE_PROLOGIO) |
877 | WX_ARG_ENABLE(resources, [ --enable-resources not available; see contrib], wxUSE_RESOURCES) | |
143121c5 | 878 | |
9a98a854 VZ |
879 | dnl --------------------------------------------------------------------------- |
880 | dnl IPC &c | |
881 | dnl --------------------------------------------------------------------------- | |
9a98a854 | 882 | |
ddb4769e | 883 | WX_ARG_ENABLE(clipboard, [ --enable-clipboard use wxClipboard class], wxUSE_CLIPBOARD) |
143121c5 | 884 | WX_ARG_ENABLE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP) |
b64f0a5f | 885 | WX_ARG_ENABLE(metafile, [ --enable-metafile use win32 metafiles], wxUSE_METAFILE) |
143121c5 | 886 | |
2fc9385a | 887 | dnl WX_ARG_ENABLE(treelayout, [ --enable-treelayout use wxTreeLayout class], wxUSE_TREELAYOUT) |
9a98a854 VZ |
888 | |
889 | dnl --------------------------------------------------------------------------- | |
890 | dnl optional GUI controls (in alphabetical order except the first one) | |
891 | dnl --------------------------------------------------------------------------- | |
892 | ||
143121c5 | 893 | WX_ARG_ENABLE(controls, [ --enable-controls use all usual controls], wxUSE_CONTROLS) |
9a98a854 VZ |
894 | |
895 | dnl even with --enable-controls, some may be disabled by giving | |
896 | dnl --disable-<control> later on the command line - but by default all will be | |
897 | dnl used (and vice versa) | |
898 | if test "$wxUSE_CONTROLS" = "yes"; then | |
899 | DEFAULT_wxUSE_ACCEL=yes | |
1e6feb95 VZ |
900 | DEFAULT_wxUSE_BMPBUTTON=yes |
901 | DEFAULT_wxUSE_BUTTON=yes | |
902 | DEFAULT_wxUSE_CALCTRL=no | |
9a98a854 VZ |
903 | DEFAULT_wxUSE_CARET=yes |
904 | DEFAULT_wxUSE_COMBOBOX=yes | |
9a98a854 VZ |
905 | DEFAULT_wxUSE_CHECKBOX=yes |
906 | DEFAULT_wxUSE_CHECKLISTBOX=yes | |
ce4169a4 | 907 | DEFAULT_wxUSE_CHOICE=yes |
9a98a854 VZ |
908 | DEFAULT_wxUSE_GAUGE=yes |
909 | DEFAULT_wxUSE_GRID=yes | |
910 | DEFAULT_wxUSE_IMAGLIST=yes | |
911 | DEFAULT_wxUSE_LISTBOX=yes | |
912 | DEFAULT_wxUSE_LISTCTRL=yes | |
913 | DEFAULT_wxUSE_NOTEBOOK=yes | |
914 | DEFAULT_wxUSE_RADIOBOX=yes | |
915 | DEFAULT_wxUSE_RADIOBTN=yes | |
916 | DEFAULT_wxUSE_SASH=yes | |
917 | DEFAULT_wxUSE_SCROLLBAR=yes | |
918 | DEFAULT_wxUSE_SLIDER=yes | |
919 | DEFAULT_wxUSE_SPINBTN=yes | |
66f38406 | 920 | DEFAULT_wxUSE_SPINCTRL=yes |
9a98a854 VZ |
921 | DEFAULT_wxUSE_SPLITTER=yes |
922 | DEFAULT_wxUSE_STATBMP=yes | |
923 | DEFAULT_wxUSE_STATBOX=yes | |
924 | DEFAULT_wxUSE_STATLINE=yes | |
925 | DEFAULT_wxUSE_STATUSBAR=yes | |
926 | DEFAULT_wxUSE_TAB_DIALOG=yes | |
1db8dc4a | 927 | DEFAULT_wxUSE_TOGGLEBTN=yes |
9a98a854 | 928 | DEFAULT_wxUSE_TOOLBAR=yes |
360d6699 VZ |
929 | DEFAULT_wxUSE_TOOLBAR_NATIVE=yes |
930 | DEFAULT_wxUSE_TOOLBAR_SIMPLE=yes | |
9a98a854 VZ |
931 | DEFAULT_wxUSE_TOOLTIPS=yes |
932 | DEFAULT_wxUSE_TREECTRL=yes | |
9f41d601 | 933 | DEFAULT_wxUSE_POPUPWIN=yes |
0b01706f | 934 | DEFAULT_wxUSE_TIPWINDOW=yes |
9a98a854 VZ |
935 | elif test "$wxUSE_CONTROLS" = "no"; then |
936 | DEFAULT_wxUSE_ACCEL=no | |
1e6feb95 VZ |
937 | DEFAULT_wxUSE_BMPBUTTON=no |
938 | DEFAULT_wxUSE_BUTTON=no | |
939 | DEFAULT_wxUSE_CALCTRL=no | |
9a98a854 VZ |
940 | DEFAULT_wxUSE_CARET=no |
941 | DEFAULT_wxUSE_COMBOBOX=no | |
9a98a854 VZ |
942 | DEFAULT_wxUSE_CHECKBOX=no |
943 | DEFAULT_wxUSE_CHECKLISTBOX=no | |
ce4169a4 | 944 | DEFAULT_wxUSE_CHOICE=no |
9a98a854 VZ |
945 | DEFAULT_wxUSE_GAUGE=no |
946 | DEFAULT_wxUSE_GRID=no | |
947 | DEFAULT_wxUSE_IMAGLIST=no | |
948 | DEFAULT_wxUSE_LISTBOX=no | |
949 | DEFAULT_wxUSE_LISTCTRL=no | |
950 | DEFAULT_wxUSE_NOTEBOOK=no | |
951 | DEFAULT_wxUSE_RADIOBOX=no | |
952 | DEFAULT_wxUSE_RADIOBTN=no | |
953 | DEFAULT_wxUSE_SASH=no | |
954 | DEFAULT_wxUSE_SCROLLBAR=no | |
955 | DEFAULT_wxUSE_SLIDER=no | |
956 | DEFAULT_wxUSE_SPINBTN=no | |
66f38406 | 957 | DEFAULT_wxUSE_SPINCTRL=no |
9a98a854 VZ |
958 | DEFAULT_wxUSE_SPLITTER=no |
959 | DEFAULT_wxUSE_STATBMP=no | |
960 | DEFAULT_wxUSE_STATBOX=no | |
961 | DEFAULT_wxUSE_STATLINE=no | |
962 | DEFAULT_wxUSE_STATUSBAR=no | |
963 | DEFAULT_wxUSE_TAB_DIALOG=no | |
1db8dc4a | 964 | DEFAULT_wxUSE_TOGGLEBTN=no |
9a98a854 | 965 | DEFAULT_wxUSE_TOOLBAR=no |
360d6699 VZ |
966 | DEFAULT_wxUSE_TOOLBAR_NATIVE=no |
967 | DEFAULT_wxUSE_TOOLBAR_SIMPLE=no | |
9a98a854 VZ |
968 | DEFAULT_wxUSE_TOOLTIPS=no |
969 | DEFAULT_wxUSE_TREECTRL=no | |
9f41d601 | 970 | DEFAULT_wxUSE_POPUPWIN=no |
0b01706f | 971 | DEFAULT_wxUSE_TIPWINDOW=no |
9a98a854 VZ |
972 | fi |
973 | ||
ac0c4cc3 DE |
974 | ## FIXME: This is a blatant hack |
975 | if test "x$wxUSE_COCOA" != "x" -a "$wxUSE_COCOA" != "0" ; then | |
976 | wxUSE_PRINTING_ARCHITECTURE=no | |
977 | wxUSE_HELP=no | |
978 | wxUSE_CLIPBOARD=no | |
979 | wxUSE_DRAG_AND_DROP=no | |
980 | wxUSE_DATAOBJ=no | |
8b389fab DE |
981 | # Generic notebook requires tab dialog |
982 | DEFAULT_wxUSE_TABDIALOG=yes | |
ac0c4cc3 | 983 | DEFAULT_wxUSE_TOOLBAR_NATIVE=no |
ac0c4cc3 DE |
984 | DEFAULT_wxUSE_GAUGE=no |
985 | DEFAULT_wxUSE_SCROLLBAR=no | |
ac0c4cc3 DE |
986 | DEFAULT_wxUSE_COMBOBOX=no |
987 | DEFAULT_wxUSE_CALCTRL=no | |
988 | DEFAULT_wxUSE_SPINBTN=no | |
989 | DEFAULT_wxUSE_SPINCTRL=no | |
990 | DEFAULT_wxUSE_TOOLTIPS=no | |
ac0c4cc3 DE |
991 | DEFAULT_wxUSE_DRAGIMAGE=no |
992 | DEFAULT_wxUSE_FINDREPLDLG=no | |
993 | DEFAULT_wxUSE_FONTDLG=no | |
994 | DEFAULT_wxUSE_GRID=no | |
ac0c4cc3 DE |
995 | DEFAULT_wxUSE_NUMBERDLG=no |
996 | DEFAULT_wxUSE_PROGRESSDLG=no | |
ac0c4cc3 DE |
997 | DEFAULT_wxUSE_SASH=no |
998 | DEFAULT_wxUSE_SPLITTER=no | |
999 | DEFAULT_wxUSE_WIZARDDLG=no | |
1000 | DEFAULT_wxUSE_SPLITTER=no | |
1001 | DEFAULT_wxUSE_STARTUP_TIPS=no | |
ac0c4cc3 DE |
1002 | fi |
1003 | ||
143121c5 | 1004 | WX_ARG_ENABLE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL) |
1e6feb95 | 1005 | WX_ARG_ENABLE(button, [ --enable-button use wxButton class], wxUSE_BUTTON) |
143121c5 | 1006 | WX_ARG_ENABLE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON) |
1e6feb95 VZ |
1007 | WX_ARG_ENABLE(calendar, [ --enable-calendar use wxCalendarCtrl class], wxUSE_CALCTRL) |
1008 | WX_ARG_ENABLE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET) | |
143121c5 VZ |
1009 | WX_ARG_ENABLE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX) |
1010 | WX_ARG_ENABLE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST) | |
ce4169a4 | 1011 | WX_ARG_ENABLE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE) |
ddb4769e VZ |
1012 | WX_ARG_ENABLE(combobox, [ --enable-combobox use wxComboBox class], wxUSE_COMBOBOX) |
1013 | WX_ARG_ENABLE(display, [ --enable-display use wxDisplay class], wxUSE_DISPLAY) | |
143121c5 VZ |
1014 | WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE) |
1015 | WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID) | |
1016 | WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST) | |
1017 | WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX) | |
1018 | WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL) | |
1019 | WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK) | |
1020 | WX_ARG_ENABLE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX) | |
1021 | WX_ARG_ENABLE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN) | |
1022 | WX_ARG_ENABLE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH) | |
1023 | WX_ARG_ENABLE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR) | |
1024 | WX_ARG_ENABLE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER) | |
1025 | WX_ARG_ENABLE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN) | |
66f38406 | 1026 | WX_ARG_ENABLE(spinctrl, [ --enable-spinctrl use wxSpinCtrl class], wxUSE_SPINCTRL) |
143121c5 VZ |
1027 | WX_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER) |
1028 | WX_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP) | |
1029 | WX_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX) | |
1030 | WX_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE) | |
1e6feb95 | 1031 | WX_ARG_ENABLE(stattext, [ --enable-stattext use wxStaticText class], wxUSE_STATTEXT) |
143121c5 VZ |
1032 | WX_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR) |
1033 | WX_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], wxUSE_TABDIALOG) | |
1e6feb95 | 1034 | WX_ARG_ENABLE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL) |
1db8dc4a | 1035 | WX_ARG_ENABLE(togglebtn, [ --enable-togglebtn use wxToggleButton class], wxUSE_TOGGLEBTN) |
143121c5 | 1036 | WX_ARG_ENABLE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR) |
360d6699 VZ |
1037 | WX_ARG_ENABLE(tbarnative, [ --enable-tbarnative use native wxToolBar class], wxUSE_TOOLBAR_NATIVE) |
1038 | WX_ARG_ENABLE(tbarsmpl, [ --enable-tbarsmpl use wxToolBarSimple class], wxUSE_TOOLBAR_SIMPLE) | |
143121c5 | 1039 | WX_ARG_ENABLE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL) |
0b01706f | 1040 | WX_ARG_ENABLE(tipwindow, [ --enable-tipwindow use wxTipWindow class], wxUSE_TIPWINDOW) |
9f41d601 | 1041 | WX_ARG_ENABLE(popupwin, [ --enable-popupwin use wxPopUpWindow class], wxUSE_POPUPWIN) |
9a98a854 VZ |
1042 | |
1043 | dnl --------------------------------------------------------------------------- | |
b1f5d087 | 1044 | dnl common dialogs |
9a98a854 VZ |
1045 | dnl --------------------------------------------------------------------------- |
1046 | ||
b3e8d00a | 1047 | WX_ARG_ENABLE(commondlg, [ --enable-commondlg use all common dialogs], wxUSE_COMMONDLGS) |
1e6feb95 VZ |
1048 | WX_ARG_ENABLE(choicedlg, [ --enable-choicedlg use wxChoiceDialog], wxUSE_CHOICEDLG) |
1049 | WX_ARG_ENABLE(coldlg, [ --enable-coldlg use wxColourDialog], wxUSE_COLOURDLG) | |
1050 | WX_ARG_ENABLE(filedlg, [ --enable-filedlg use wxFileDialog], wxUSE_FILEDLG) | |
69d27ff7 | 1051 | WX_ARG_ENABLE(finddlg, [ --enable-finddlg use wxFindReplaceDialog], wxUSE_FINDREPLDLG) |
1e6feb95 | 1052 | WX_ARG_ENABLE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_FONTDLG) |
ce4169a4 | 1053 | WX_ARG_ENABLE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG) |
1e6feb95 VZ |
1054 | WX_ARG_ENABLE(msgdlg, [ --enable-msgdlg use wxMessageDialog], wxUSE_MSGDLG) |
1055 | WX_ARG_ENABLE(numberdlg, [ --enable-numberdlg use wxNumberEntryDialog], wxUSE_NUMBERDLG) | |
cbca9943 | 1056 | WX_ARG_ENABLE(splash, [ --enable-splash use wxSplashScreen], wxUSE_SPLASH) |
c11584af | 1057 | WX_ARG_ENABLE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG) |
a641505f | 1058 | WX_ARG_ENABLE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS) |
ce4169a4 | 1059 | WX_ARG_ENABLE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG) |
b1f5d087 VZ |
1060 | WX_ARG_ENABLE(wizarddlg, [ --enable-wizarddlg use wxWizard], wxUSE_WIZARDDLG) |
1061 | ||
1062 | dnl --------------------------------------------------------------------------- | |
1063 | dnl misc GUI options | |
1064 | dnl --------------------------------------------------------------------------- | |
1065 | ||
1e6feb95 | 1066 | WX_ARG_ENABLE(menus, [ --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS) |
143121c5 VZ |
1067 | WX_ARG_ENABLE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME) |
1068 | WX_ARG_ENABLE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS) | |
1069 | WX_ARG_ENABLE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES) | |
1070 | WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS) | |
d78b3d64 | 1071 | WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO) |
b3e8d00a | 1072 | WX_ARG_ENABLE(joystick, [ --enable-joystick use wxJoystick (Linux only)], wxUSE_JOYSTICK) |
1e6feb95 | 1073 | WX_ARG_ENABLE(metafile, [ --enable-metafiles use wxMetaFile (Windows only)], wxUSE_METAFILE) |
24fd6d87 | 1074 | WX_ARG_ENABLE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE) |
7bb2947d | 1075 | WX_ARG_ENABLE(accessibility,[ --enable-accessibility enable accessibility support], wxUSE_ACCESSIBILITY) |
143121c5 | 1076 | |
0940bcf7 HH |
1077 | dnl --------------------------------------------------------------------------- |
1078 | dnl support for image formats that do not rely on external library | |
1079 | dnl --------------------------------------------------------------------------- | |
1080 | ||
d275c7eb | 1081 | WX_ARG_ENABLE(palette, [ --enable-palette use wxPalette class], wxUSE_PALETTE) |
0046ff7c | 1082 | WX_ARG_ENABLE(image, [ --enable-image use wxImage class], wxUSE_IMAGE) |
6b5286d1 HH |
1083 | WX_ARG_ENABLE(gif, [ --enable-gif use gif images (GIF file format)], wxUSE_GIF) |
1084 | WX_ARG_ENABLE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX) | |
4b6b4dfc | 1085 | WX_ARG_ENABLE(iff, [ --enable-iff use iff images (IFF file format)], wxUSE_IFF) |
6b5286d1 | 1086 | WX_ARG_ENABLE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM) |
69d27ff7 | 1087 | WX_ARG_ENABLE(xpm, [ --enable-xpm use xpm images (XPM file format)], wxUSE_XPM) |
c7206e64 | 1088 | WX_ARG_ENABLE(ico_cur, [ --enable-icocur use Windows ICO and CUR formats], wxUSE_ICO_CUR) |
0940bcf7 | 1089 | |
b12915c1 | 1090 | fi |
590b1a4d SN |
1091 | |
1092 | dnl General settings (needed for GUI and non-GUI compilations alike). | |
1093 | dnl Path separator; ':' for unix, ';' for OS/2 | |
1094 | dnl Stem for flex output; lexyy for OS/2, lex.yy otherwise | |
1095 | case "${host}" in | |
1096 | *-pc-os2_emx | *-pc-os2-emx ) | |
d8f591c4 SN |
1097 | PATH_IFS=';' |
1098 | dnl Really ought to text for this as meanwhile there are flex versions using | |
1099 | dnl lex.yy as well due to FAT support being more and more dropped... | |
590b1a4d SN |
1100 | LEX_STEM="lexyy" |
1101 | ;; | |
1102 | *) | |
1103 | PATH_IFS=':' | |
1104 | LEX_STEM="lex.yy" | |
1105 | ;; | |
1106 | esac | |
1107 | ||
b12915c1 VZ |
1108 | dnl for GUI only |
1109 | ||
143121c5 VZ |
1110 | dnl cache the options values before (may be) aborting below |
1111 | WX_ARG_CACHE_FLUSH | |
9a98a854 VZ |
1112 | |
1113 | dnl check that no more than one toolkit is given and that if none are given that | |
1114 | dnl we have a default one | |
efeb0365 | 1115 | |
143121c5 VZ |
1116 | AC_MSG_CHECKING(for toolkit) |
1117 | ||
d1188635 JS |
1118 | # In Wine, we need to default to MSW, not GTK or MOTIF |
1119 | if test "$wxUSE_WINE" = "yes"; then | |
1120 | DEFAULT_DEFAULT_wxUSE_GTK=0 | |
1121 | DEFAULT_DEFAULT_wxUSE_MOTIF=0 | |
1122 | DEFAULT_DEFAULT_wxUSE_MSW=1 | |
1123 | fi | |
1124 | ||
e90c1d2a VZ |
1125 | if test "$wxUSE_GUI" = "yes"; then |
1126 | ||
3a922bb4 RL |
1127 | if test "$USE_BEOS" = 1; then |
1128 | AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui]) | |
1129 | fi | |
b12915c1 | 1130 | |
3a922bb4 RL |
1131 | if test "$TOOLKIT_GIVEN" = 1; then |
1132 | dnl convert "yes" to 1 and "no" to 0 | |
1133 | for toolkit in `echo $ALL_TOOLKITS`; do | |
1134 | var=wxUSE_$toolkit | |
1135 | eval "value=\$${var}" | |
1136 | eval "$var=`echo \$value | sed -e "s/yes/1/" -e "s/no/0/"`" | |
1137 | done | |
143121c5 | 1138 | else |
3a922bb4 RL |
1139 | dnl try to guess the most apropriate toolkit for this platform |
1140 | for toolkit in `echo $ALL_TOOLKITS`; do | |
1141 | if test "$has_toolkit_in_cache" != 1; then | |
1142 | var=DEFAULT_DEFAULT_wxUSE_$toolkit | |
1143 | else | |
1144 | var=DEFAULT_wxUSE_$toolkit | |
1145 | fi | |
1146 | eval "wxUSE_$toolkit=\$${var}" | |
1147 | done | |
143121c5 | 1148 | fi |
4c0ed911 | 1149 | |
3a922bb4 RL |
1150 | dnl we suppose that expr is available (maybe there is a better way to do |
1151 | dnl this? what about using ALL_TOOLKITS? TODO) | |
ac0c4cc3 DE |
1152 | NUM_TOOLKITS=`expr ${wxUSE_COCOA:-0} + ${wxUSE_GTK:-0} + ${wxUSE_MAC:-0} \ |
1153 | + ${wxUSE_MGL:-0} + ${wxUSE_MICROWIN:-0} \ | |
1154 | + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} + ${wxUSE_X11:-0}` | |
9a98a854 | 1155 | |
3a922bb4 | 1156 | dnl Allow wxUSE_PM only for OS/2 with EMX. |
3a922bb4 | 1157 | case "${host}" in |
9829f277 | 1158 | *-pc-os2_emx | *-pc-os2-emx ) |
3a922bb4 | 1159 | NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}` |
3a922bb4 | 1160 | esac |
9a98a854 | 1161 | |
3a922bb4 RL |
1162 | case "$NUM_TOOLKITS" in |
1163 | 1) | |
1164 | ;; | |
1165 | 0) | |
d74f4b5a | 1166 | AC_MSG_ERROR(Please specify a toolkit -- cannot determine the default for ${host}) |
3a922bb4 RL |
1167 | ;; |
1168 | *) | |
d74f4b5a | 1169 | AC_MSG_ERROR(Please specify at most one toolkit (maybe some are cached in configarg.cache?)) |
3a922bb4 | 1170 | esac |
143121c5 | 1171 | |
3a922bb4 RL |
1172 | dnl cache the wxUSE_<TOOLKIT> values too |
1173 | for toolkit in `echo $ALL_TOOLKITS`; do | |
1174 | var=wxUSE_$toolkit | |
1175 | eval "value=\$${var}" | |
1176 | if test "x$value" != x; then | |
1177 | cache_var=CACHE_$toolkit | |
1178 | eval "cache=\$${cache_var}" | |
1179 | if test "$cache" = 1; then | |
1180 | echo "$var=$value" >> ${wx_arg_cache_file} | |
1181 | fi | |
1182 | if test "$value" = 1; then | |
1183 | toolkit_echo=`echo $toolkit | tr [[A-Z]] [[a-z]]` | |
1184 | AC_MSG_RESULT($toolkit_echo) | |
1185 | fi | |
1186 | fi | |
1187 | done | |
e90c1d2a | 1188 | else |
9de9b8f0 VZ |
1189 | if test "x$host_alias" != "x"; then |
1190 | AC_MSG_RESULT(base ($host_alias hosted) only) | |
1191 | else | |
1192 | AC_MSG_RESULT(base only) | |
1193 | fi | |
e90c1d2a VZ |
1194 | fi |
1195 | ||
17234b26 MB |
1196 | dnl --------------------------------------------------------------------------- |
1197 | dnl When we are using Cygwin with Motif/GTK+, we want it to appear like | |
1198 | dnl 'just' a POSIX platform, so the Win32 API must not be available | |
1199 | dnl --------------------------------------------------------------------------- | |
43d99b6d VS |
1200 | dnl (Windows-only piece) |
1201 | wants_win32=0 | |
1202 | doesnt_want_win32=0 | |
17234b26 MB |
1203 | case "${host}" in |
1204 | *-*-cygwin*) | |
1205 | if test "$wxUSE_MSW" = 1 ; then | |
43d99b6d VS |
1206 | wants_win32=1 |
1207 | else | |
1208 | doesnt_want_win32=1 | |
17234b26 MB |
1209 | fi |
1210 | ;; | |
1211 | *-*-mingw*) | |
43d99b6d | 1212 | wants_win32=1 |
17234b26 MB |
1213 | ;; |
1214 | esac | |
1215 | ||
d1188635 JS |
1216 | dnl --------------------------------------------------------------------------- |
1217 | dnl Wine is a virtual platform, we need to patch things up a bit | |
1218 | dnl --------------------------------------------------------------------------- | |
1219 | if test "$wxUSE_WINE" = "yes"; then | |
1220 | wants_win32=1 | |
1221 | dnl FIXME: we should do a better job of testing for these | |
1222 | CC=winegcc | |
1223 | CXX=wineg++ | |
1224 | RESCOMP=wrc | |
1225 | fi | |
1226 | ||
43d99b6d VS |
1227 | dnl NB: The two tests bellow are *NOT* mutually exclusive! They should only |
1228 | dnl take effect on Cygwin/Mingw and not other platforms. | |
1229 | if test "$wants_win32" = 1 ; then | |
17234b26 MB |
1230 | USE_UNIX=0 |
1231 | USE_WIN32=1 | |
1232 | AC_DEFINE(__WIN32__) | |
1233 | AC_DEFINE(__WIN95__) | |
1234 | AC_DEFINE(__WINDOWS__) | |
1235 | AC_DEFINE(__GNUWIN32__) | |
1236 | AC_DEFINE(STRICT) | |
1237 | AC_DEFINE(WINVER, 0x0400) | |
43d99b6d VS |
1238 | fi |
1239 | if test "$doesnt_want_win32" = 1 ; then | |
17234b26 MB |
1240 | USE_UNIX=1 |
1241 | USE_WIN32=0 | |
1242 | fi | |
43d99b6d | 1243 | dnl (end of Windows-only piece) |
17234b26 MB |
1244 | |
1245 | if test "$USE_UNIX" = 1 ; then | |
1246 | wxUSE_UNIX=yes | |
1247 | AC_DEFINE(__UNIX__) | |
1248 | fi | |
1249 | ||
9a98a854 VZ |
1250 | dnl --------------------------------------------------------------------------- |
1251 | dnl Checks for programs | |
1252 | dnl --------------------------------------------------------------------------- | |
1253 | ||
1254 | dnl flush the cache because checking for programs might abort | |
1255 | AC_CACHE_SAVE | |
1256 | ||
1257 | dnl cross-compiling support: we're cross compiling if the build system is | |
1258 | dnl different from the target one (assume host and target be always the same) | |
e59890c3 | 1259 | if test "$build" != "$host" ; then |
9d353d4a | 1260 | if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 -o "$USE_UNIX"; then |
3a922bb4 RL |
1261 | CC=$host_alias-gcc |
1262 | CXX=$host_alias-c++ | |
1263 | AR=$host_alias-ar | |
1264 | RANLIB=$host_alias-ranlib | |
1265 | DLLTOOL=$host_alias-dlltool | |
1266 | RESCOMP=$host_alias-windres | |
1267 | LD=$host_alias-ld | |
1268 | NM=$host_alias-nm | |
1269 | STRIP=$host_alias-strip | |
1270 | else | |
1271 | AC_MSG_ERROR($build_alias -> $host_alias cross compilation not supported yet.) | |
1272 | fi | |
9a98a854 VZ |
1273 | fi |
1274 | ||
1275 | dnl C-compiler checks | |
1276 | dnl defines CC with the compiler to use | |
1277 | dnl defines GCC with yes if using gcc | |
1278 | dnl defines GCC empty if not using gcc | |
1279 | dnl defines CFLAGS | |
04727afd VZ |
1280 | dnl |
1281 | dnl this magic incantation is needed to prevent AC_PROG_CC from setting the | |
2b5f62a0 | 1282 | dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add |
04727afd | 1283 | dnl -g and -O flags ourselves below |
ec603395 | 1284 | CFLAGS=${CFLAGS:=} |
9a98a854 VZ |
1285 | AC_PROG_CC |
1286 | ||
9a98a854 VZ |
1287 | dnl is -traditional needed for correct compilations |
1288 | dnl adds -traditional for gcc if needed | |
1289 | AC_PROG_GCC_TRADITIONAL | |
1290 | ||
1291 | AC_LANG_SAVE | |
1292 | AC_LANG_CPLUSPLUS | |
1293 | ||
1294 | dnl C++-compiler checks | |
1295 | dnl defines CXX with the compiler to use | |
1296 | dnl defines GXX with yes if using gxx | |
1297 | dnl defines GXX empty if not using gxx | |
1298 | dnl defines CXXFLAGS | |
04727afd VZ |
1299 | dnl |
1300 | dnl see CFLAGS line above | |
ec603395 | 1301 | CXXFLAGS=${CXXFLAGS:=} |
9a98a854 VZ |
1302 | AC_PROG_CXX |
1303 | ||
9a98a854 VZ |
1304 | AC_LANG_RESTORE |
1305 | ||
1306 | dnl ranlib command | |
1307 | dnl defines RANLIB with the appropriate command | |
1308 | AC_PROG_RANLIB | |
1309 | ||
1310 | dnl ar command | |
1311 | dnl defines AR with the appropriate command | |
1312 | AC_CHECK_PROG(AR, ar, ar, ar) | |
1313 | ||
1314 | dnl install checks | |
1315 | dnl defines INSTALL with the appropriate command | |
6054113a | 1316 | AC_PROG_INSTALL |
2e033fd1 | 1317 | |
ab9f788e SN |
1318 | dnl make install path absolute (if not already); |
1319 | dnl will fail with (some) MSDOS paths | |
2e033fd1 CE |
1320 | case ${INSTALL} in |
1321 | /* ) # Absolute | |
1322 | ;; | |
ab9f788e SN |
1323 | ?:* ) # Drive letter, considered as absolute. |
1324 | ;; | |
3bd8fb5f | 1325 | *) |
2e033fd1 CE |
1326 | INSTALL=`pwd`/${INSTALL} ;; |
1327 | esac | |
1328 | ||
4f5a7f74 VZ |
1329 | dnl HP-UX install doesn't handle the "-d" switch so don't use it there |
1330 | case ${host} in | |
1331 | *-hp-hpux* ) | |
1332 | INSTALL_DIR="mkdir" | |
1333 | ;; | |
1334 | ||
1335 | *) INSTALL_DIR="$INSTALL -d" | |
1336 | ;; | |
1337 | esac | |
1338 | ||
2e033fd1 | 1339 | |
d6853540 RL |
1340 | case "${host}" in |
1341 | ||
b5853384 GD |
1342 | dnl The other BSD's should probably go in here too, since this is |
1343 | dnl to workaround a strange static lib BSDism. | |
1344 | dnl Mac OS X install seems to ignore -p option... | |
d6853540 | 1345 | powerpc-*-darwin* ) |
eb99ae0b GD |
1346 | INSTALL_PROGRAM="cp -fp" |
1347 | INSTALL_DATA="cp -fp" | |
d6853540 RL |
1348 | ;; |
1349 | *) | |
6054113a | 1350 | ;; |
d6853540 | 1351 | esac |
9a98a854 | 1352 | |
9a98a854 VZ |
1353 | dnl strip command |
1354 | dnl defines STRIP as strip or nothing if not found | |
1355 | AC_CHECK_PROG(STRIP, strip, strip, true) | |
1356 | ||
414eab6d VZ |
1357 | dnl does make support "-include" (only GNU make does AFAIK)? |
1358 | AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu, | |
1359 | [ | |
1360 | if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null | | |
c13b1125 | 1361 | egrep -s GNU > /dev/null); then |
414eab6d VZ |
1362 | wx_cv_prog_makeisgnu="yes" |
1363 | else | |
1364 | wx_cv_prog_makeisgnu="no" | |
1365 | fi | |
1366 | ]) | |
1367 | ||
1368 | if test "x$wx_cv_prog_makeisgnu" = "xyes"; then | |
1369 | IF_GNU_MAKE="" | |
1370 | else | |
1371 | IF_GNU_MAKE="#" | |
1372 | fi | |
1373 | ||
1374 | AC_SUBST(IF_GNU_MAKE) | |
1375 | ||
1376 | dnl we don't need to check for VPATH support in GNU make - it does have it | |
1377 | if test "x$wx_cv_prog_makeisgnu" != "xyes"; then | |
9a98a854 | 1378 | dnl check if VPATH works |
04e7a216 | 1379 | AC_CACHE_CHECK([if make supports VPATH], wx_cv_prog_makevpath, [ |
9a98a854 VZ |
1380 | dnl create Makefile |
1381 | cat - << EOF > confMake | |
1382 | check : file | |
1383 | cp \$? \$@ | |
1384 | cp \$? final_file | |
1385 | EOF | |
1386 | ||
1387 | if test ! -d sub ; then | |
1388 | mkdir sub | |
1389 | fi | |
1390 | echo dummy > sub/file | |
f6bcfd97 | 1391 | ${MAKE-make} -f confMake VPATH=sub 2>&5 > /dev/null |
9a98a854 VZ |
1392 | RESULT=$? |
1393 | rm -f sub/file check final_file confMake | |
1394 | rmdir sub | |
1395 | if test "$RESULT" = 0; then | |
04e7a216 | 1396 | wx_cv_prog_makevpath="yes" |
9a98a854 | 1397 | else |
04e7a216 VZ |
1398 | wx_cv_prog_makevpath="no" |
1399 | fi | |
1400 | ]) | |
1401 | ||
1402 | if test "x$wx_cv_prog_makevpath" != "xyes"; then | |
1403 | AC_MSG_ERROR([ | |
9a98a854 VZ |
1404 | You need a make-utility that is able to use the variable |
1405 | VPATH correctly. | |
1406 | If your version of make does not support VPATH correctly, | |
1407 | please install GNU-make (possibly as gmake), and start | |
1408 | configure with the following command: | |
1409 | export MAKE=gmake; ./configure for sh-type shells | |
1410 | setenv MAKE gmake; ./configure for csh-type shells | |
1411 | Also please do remember to use gmake in this case every time | |
1412 | you are trying to compile. | |
1e487827 | 1413 | ]) |
414eab6d VZ |
1414 | fi dnl make without VPATH |
1415 | fi dnl not GNU make | |
613d0995 | 1416 | |
9a98a854 VZ |
1417 | dnl YACC checks |
1418 | dnl defines YACC with the appropriate command | |
1419 | AC_PROG_YACC | |
1420 | ||
1421 | dnl LEX checks | |
1422 | dnl defines LEX with the appropriate command | |
1423 | dnl defines LEXLIB with the appropriate library | |
2aa88730 | 1424 | AC_PROG_LEX |
9a98a854 | 1425 | |
c7114f59 VZ |
1426 | dnl needed for making link to setup.h |
1427 | AC_PROG_LN_S | |
1428 | ||
2b5f62a0 VZ |
1429 | dnl --------------------------------------------------------------------------- |
1430 | dnl When we are using gcc on OS/2, we want to be either using resources (PM) | |
1431 | dnl or a more complete POSIX emulation for Motif/GTK+/X11 | |
1432 | dnl --------------------------------------------------------------------------- | |
1433 | dnl (OS/2-only piece) | |
1434 | case "${host}" in | |
1435 | *-pc-os2_emx | *-pc-os2-emx ) | |
1436 | dnl Explicitly link -lstdcpp, since we are using "gcc" not "g++"/"c++". | |
1437 | LIBS="$LIBS -lstdcpp" | |
1438 | if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then | |
1439 | dnl More complete Unix emulation for unix-like ports | |
1440 | dnl by linking in POSIX/2's cExt (if available). | |
1441 | AC_CHECK_LIB(cExt, drand48, LIBS="$LIBS -lcExt") | |
1442 | else | |
1443 | dnl Include resources for the "native" port (wxPM). | |
1444 | RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res" | |
1445 | fi | |
1446 | ;; | |
1447 | esac | |
1448 | dnl (end of OS/2-only piece) | |
1449 | ||
21d1c967 GD |
1450 | dnl ------------------------------------------------------------------------ |
1451 | dnl Check for headers | |
1452 | dnl ------------------------------------------------------------------------ | |
1453 | ||
1454 | dnl test for strings.h needed under AIX, but do not check for it wxMac as | |
1455 | dnl it exists but is only a simple redirection to string.h and it is in | |
1456 | dnl conflict with Strings.h in FlatCarbon headers | |
01aa5863 VS |
1457 | dnl |
1458 | dnl Autoconf 2.5 tends to check for strings.h on its own, so avoiding the | |
1459 | dnl test (as the current configure script does) is not possible. Instead, | |
1460 | dnl you must remind autoconf that strings.h is NOT valid. The autoconf | |
1461 | dnl test succeeds because there is a strings.h file that simply includes | |
1462 | dnl string.h. Unfortunately, there is also a strings.h as part of the | |
1463 | dnl FlatCarbon headers. -- David Elliott | |
1464 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then | |
1465 | AC_CACHE_CHECK([for strings.h], ac_cv_header_strings_h, | |
1466 | [ac_cv_header_strings_h=no]) | |
1467 | if test "$ac_cv_header_strings_h" = "no"; then | |
1468 | AC_MSG_RESULT([forced no into cache]) | |
1469 | else | |
1470 | AC_MSG_WARN([strings.h is not compatible with Mac OS X]) | |
1471 | fi | |
21d1c967 | 1472 | fi |
01aa5863 VS |
1473 | dnl defines HAVE_STRINGS_H |
1474 | AC_CHECK_HEADERS(strings.h) | |
21d1c967 GD |
1475 | |
1476 | dnl defines HAVE_STDLIB_H | |
1477 | AC_CHECK_HEADERS(stdlib.h) | |
1478 | dnl defines HAVE_MALLOC_H | |
1479 | AC_CHECK_HEADERS(malloc.h) | |
1480 | dnl defines HAVE_UNISTD_H | |
1481 | AC_CHECK_HEADERS(unistd.h) | |
1482 | dnl defines HAVE_WCHAR_H | |
1483 | AC_CHECK_HEADERS(wchar.h) | |
1484 | ||
1485 | dnl maybe wchar_t is in wcstr.h if we don't have wchar.h? | |
1486 | if test "$ac_cv_header_wchar_h" != "yes"; then | |
1487 | dnl defines HAVE_WCSTR_H | |
1488 | AC_CHECK_HEADERS(wcstr.h) | |
1489 | fi | |
1490 | ||
21d1c967 GD |
1491 | dnl defines HAVE_FNMATCH_H |
1492 | AC_CHECK_HEADERS(fnmatch.h) | |
1493 | ||
1494 | if test "x$ac_cv_header_fnmatch_h" = "xyes"; then | |
1495 | AC_CHECK_FUNCS(fnmatch) | |
1496 | fi | |
1497 | ||
1498 | dnl defines HAVE_LANGINFO_H (GNU libc locale parameters) | |
1499 | AC_CHECK_HEADERS(langinfo.h) | |
1500 | ||
ab9f788e SN |
1501 | case "${host}" in |
1502 | *-pc-os2_emx | *-pc-os2-emx ) | |
1503 | dnl Explicitly link -lintl if langinfo.h is available. | |
1504 | if test $ac_cv_header_langinfo_h = "yes"; then | |
1505 | LIBS="$LIBS -lintl" | |
1506 | fi | |
1507 | ;; | |
1508 | esac | |
1542ea39 | 1509 | |
21d1c967 GD |
1510 | if test "$wxUSE_GUI" = "yes"; then |
1511 | if test "$wxUSE_UNIX" = "yes"; then | |
1512 | dnl defines HAVE_X11_XKBLIB_H | |
1513 | AC_CHECK_HEADERS(X11/XKBlib.h) | |
1514 | fi | |
1515 | fi | |
1516 | ||
90dd450c VZ |
1517 | dnl --------------------------------------------------------------------------- |
1518 | dnl Checks for compiler characteristics | |
1519 | dnl --------------------------------------------------------------------------- | |
1520 | ||
1521 | dnl defines const to be empty if c-compiler does not support const fully | |
1522 | AC_C_CONST | |
1523 | dnl defines inline to a sensible value for the c-compiler | |
1524 | AC_C_INLINE | |
1525 | ||
1526 | dnl check the sizes of integral types (give some reasonable default values for | |
1527 | dnl cross-compiling) | |
1528 | dnl defines the size of certain types of variables in SIZEOF_<TYPE> | |
1529 | AC_CHECK_SIZEOF(char, 1) | |
1530 | AC_CHECK_SIZEOF(short, 2) | |
1531 | AC_CHECK_SIZEOF(void *, 4) | |
1532 | AC_CHECK_SIZEOF(int, 4) | |
1533 | AC_CHECK_SIZEOF(long, 4) | |
1534 | ||
1535 | case "${host}" in | |
1536 | arm-*-linux* ) | |
1537 | AC_CHECK_SIZEOF(long long, 8) | |
1538 | ;; | |
4f57cf11 GD |
1539 | *-hp-hpux* ) |
1540 | AC_CHECK_SIZEOF(long long, 0) | |
1541 | if test "$ac_cv_sizeof_long_long" != "0"; then | |
1542 | dnl HPUX 10.20 headers need this define in order to use long long definitions | |
1543 | CPPFLAGS="$CPPFLAGS -D_INCLUDE_LONGLONG" | |
1544 | fi | |
1545 | ;; | |
90dd450c VZ |
1546 | * ) |
1547 | AC_CHECK_SIZEOF(long long, 0) | |
1548 | esac | |
1549 | ||
90dd450c VZ |
1550 | dnl we have to do it ourselves because SGI/Irix's stdio.h does not include |
1551 | dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h | |
1552 | dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD) | |
1553 | AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t, | |
1554 | [ | |
1555 | AC_TRY_RUN( | |
1556 | [ | |
2b5f62a0 VZ |
1557 | /* DJGPP only has fake wchar_t: */ |
1558 | #ifdef __DJGPP__ | |
1559 | # error "fake wchar_t" | |
1560 | #endif | |
90dd450c VZ |
1561 | #ifdef HAVE_WCHAR_H |
1562 | # ifdef __CYGWIN__ | |
1563 | # include <stddef.h> | |
1564 | # endif | |
1565 | # include <wchar.h> | |
1566 | #endif | |
1567 | #ifdef HAVE_STDLIB_H | |
1568 | # include <stdlib.h> | |
1569 | #endif | |
1570 | #include <stdio.h> | |
1571 | int main() | |
1572 | { | |
1573 | FILE *f=fopen("conftestval", "w"); | |
1574 | if (!f) exit(1); | |
1575 | fprintf(f, "%i", sizeof(wchar_t)); | |
1576 | exit(0); | |
1577 | } | |
1578 | ], | |
1579 | wx_cv_sizeof_wchar_t=`cat conftestval`, | |
1580 | wx_cv_sizeof_wchar_t=0, | |
2b5f62a0 VZ |
1581 | [ |
1582 | case "${host}" in | |
1583 | *-pc-msdosdjgpp ) | |
1584 | wx_cv_sizeof_wchar_t=0 | |
1585 | ;; | |
1586 | * ) | |
1587 | wx_cv_sizeof_wchar_t=4 | |
1588 | ;; | |
1589 | esac | |
1590 | ] | |
90dd450c VZ |
1591 | ) |
1592 | ]) | |
1593 | ||
1594 | AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t) | |
1595 | ||
1596 | dnl check for large file support | |
1597 | AC_SYS_LARGEFILE | |
1598 | ||
f02444d0 VZ |
1599 | dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command |
1600 | dnl line because otherwise the system headers risk being included before | |
1601 | dnl wx/defs.h which defines these constants leading to inconsistent | |
1602 | dnl sizeof(off_t) in different source files of the same program and linking | |
1603 | dnl problems | |
1604 | if test "x$wx_largefile" = "xyes"; then | |
e26c13cf RD |
1605 | if test "x$ac_cv_sys_file_offset_bits" = "x64"; then |
1606 | WX_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" | |
f02444d0 | 1607 | else |
e26c13cf | 1608 | WX_LARGEFILE_FLAGS="-D_LARGE_FILES" |
f02444d0 | 1609 | fi |
e26c13cf | 1610 | CPPFLAGS="$CPPFLAGS $WX_LARGEFILE_FLAGS" |
f02444d0 VZ |
1611 | fi |
1612 | ||
90dd450c VZ |
1613 | dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling) |
1614 | WX_C_BIGENDIAN | |
1615 | ||
1616 | dnl check for iostream (as opposed to iostream.h) standard header | |
1617 | WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH)) | |
1618 | ||
1619 | dnl check whether C++ compiler supports bool built-in type | |
1620 | WX_CPP_BOOL | |
1621 | ||
986ecc86 VZ |
1622 | dnl check whether C++ compiler supports explicit keyword |
1623 | WX_CPP_EXPLICIT | |
1624 | ||
521196a2 MB |
1625 | dnl check whether C++ compiler supports C++ casts |
1626 | AC_CXX_CONST_CAST | |
1627 | ||
9a98a854 VZ |
1628 | dnl --------------------------------------------------------------------------- |
1629 | dnl Define search path for includes and libraries: all headers and libs will be | |
1630 | dnl looked for in all directories of this path | |
1631 | dnl --------------------------------------------------------------------------- | |
1632 | ||
2b5f62a0 VZ |
1633 | dnl Notice that /usr/include should *not* be in this list, otherwise it breaks |
1634 | dnl compilation on Solaris/AIX/... with gcc because standard (non ANSI C) | |
1635 | dnl headers are included instead of the "fixed" (ANSI-fied) gcc ones. | |
afc31813 VZ |
1636 | dnl |
1637 | dnl Also try to put all directories which may contain X11R6 before those which | |
1638 | dnl may contain X11R5/4 - we want to use R6 on machines which have both! | |
9a98a854 | 1639 | SEARCH_INCLUDE="\ |
ee31c269 VZ |
1640 | /usr/local/include \ |
1641 | \ | |
9a98a854 VZ |
1642 | /usr/Motif-1.2/include \ |
1643 | /usr/Motif-2.1/include \ | |
1644 | \ | |
1645 | /usr/include/Motif1.2 \ | |
1646 | /opt/xpm/include/X11 \ | |
8636aed8 RR |
1647 | /opt/GBxpm/include/ \ |
1648 | /opt/GBxpm/X11/include/ \ | |
9a98a854 VZ |
1649 | \ |
1650 | /usr/Motif1.2/include \ | |
1651 | /usr/dt/include \ | |
afc31813 VZ |
1652 | /usr/openwin/include \ |
1653 | \ | |
9a98a854 VZ |
1654 | /usr/include/Xm \ |
1655 | \ | |
1656 | /usr/X11R6/include \ | |
afc31813 | 1657 | /usr/X11R6.4/include \ |
9a98a854 VZ |
1658 | /usr/X11R5/include \ |
1659 | /usr/X11R4/include \ | |
1660 | \ | |
9a98a854 VZ |
1661 | /usr/include/X11R6 \ |
1662 | /usr/include/X11R5 \ | |
1663 | /usr/include/X11R4 \ | |
1664 | \ | |
1665 | /usr/local/X11R6/include \ | |
1666 | /usr/local/X11R5/include \ | |
1667 | /usr/local/X11R4/include \ | |
1668 | \ | |
1669 | /usr/local/include/X11R6 \ | |
1670 | /usr/local/include/X11R5 \ | |
1671 | /usr/local/include/X11R4 \ | |
1672 | \ | |
1673 | /usr/X11/include \ | |
1674 | /usr/include/X11 \ | |
1675 | /usr/local/X11/include \ | |
1676 | /usr/local/include/X11 \ | |
1677 | \ | |
1678 | /usr/X386/include \ | |
1679 | /usr/x386/include \ | |
1680 | /usr/XFree86/include/X11 \ | |
1681 | \ | |
4c0ed911 | 1682 | X:/XFree86/include \ |
d51e8205 SN |
1683 | X:/XFree86/include/X11 \ |
1684 | \ | |
9a98a854 | 1685 | /usr/include/gtk \ |
5a92d200 | 1686 | /usr/local/include/gtk \ |
9a98a854 | 1687 | /usr/include/glib \ |
5a92d200 RR |
1688 | /usr/local/include/glib \ |
1689 | \ | |
1690 | /usr/include/qt \ | |
1691 | /usr/local/include/qt \ | |
1692 | \ | |
a9b5e89f | 1693 | /usr/include/windows \ |
5a92d200 RR |
1694 | /usr/include/wine \ |
1695 | /usr/local/include/wine \ | |
1696 | \ | |
9a98a854 VZ |
1697 | /usr/unsupported/include \ |
1698 | /usr/athena/include \ | |
1699 | /usr/local/x11r5/include \ | |
1700 | /usr/lpp/Xamples/include \ | |
1701 | \ | |
2b5f62a0 | 1702 | /usr/openwin/share/include" |
9a98a854 VZ |
1703 | |
1704 | SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` " | |
1705 | ||
1706 | dnl ------------------------------------------------------------------------ | |
1707 | dnl Check for libraries | |
1708 | dnl ------------------------------------------------------------------------ | |
1709 | ||
143121c5 | 1710 | dnl flush the cache because checking for libraries below might abort |
9a98a854 VZ |
1711 | AC_CACHE_SAVE |
1712 | ||
19bc6aad | 1713 | dnl check for glibc version |
efdc61a6 VZ |
1714 | dnl |
1715 | dnl VZ: I have no idea why had this check been there originally, but now | |
5c0a20c3 | 1716 | dnl we could probably do without it by just always adding _GNU_SOURCE |
32b38f99 | 1717 | if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then |
19bc6aad VZ |
1718 | AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[ |
1719 | AC_TRY_COMPILE([#include <features.h>], | |
1720 | [ | |
efdc61a6 | 1721 | #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1) |
19bc6aad VZ |
1722 | #error not glibc2.1 |
1723 | #endif | |
1724 | ], | |
1725 | [ | |
1726 | wx_cv_lib_glibc21=yes | |
1727 | ], | |
1728 | [ | |
1729 | wx_cv_lib_glibc21=no | |
1730 | ] | |
1731 | ) | |
1732 | ]) | |
1733 | if test "$wx_cv_lib_glibc21" = "yes"; then | |
1734 | AC_DEFINE(wxHAVE_GLIBC2) | |
1735 | fi | |
1736 | fi | |
1737 | ||
5c0a20c3 VZ |
1738 | dnl we may need _GNU_SOURCE for 2 things: |
1739 | dnl | |
1740 | dnl 1. to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+ (strictly speaking we | |
1741 | dnl only need _XOPEN_SOURCE=500 but just defining this disables _BSD_SOURCE | |
1742 | dnl which breaks libtiff compilation, so it is simpler to just define | |
1743 | dnl _GNU_SOURCE to get everything) | |
1744 | dnl | |
1745 | dnl 2. for Unicode functions | |
1746 | if test "x$wx_cv_lib_glibc21" = "xyes"; then | |
1747 | if test "$wxUSE_UNICODE" = "yes" -o "$wxUSE_THREADS" = "yes"; then | |
1748 | AC_DEFINE(_GNU_SOURCE) | |
1749 | fi | |
1750 | fi | |
1751 | ||
4f14bcd8 GD |
1752 | dnl --------------------------------------------------------------------------- |
1753 | dnl Optional libraries | |
1754 | dnl | |
1755 | dnl --with-<lib>=sys | |
1756 | dnl looks for system library and fails if not found | |
1757 | dnl | |
1758 | dnl --with-<lib> | |
1759 | dnl --with-<lib>=yes | |
1760 | dnl looks for system library and, if not found, prints a warning, | |
1761 | dnl falls back to the builtin wx version, and continues configuration | |
1762 | dnl | |
1763 | dnl --with-<lib>=builtin | |
1764 | dnl uses builtin wx version without searching for system library | |
1765 | dnl | |
1766 | dnl --with-<lib>=no | |
1767 | dnl --without-<lib> | |
1768 | dnl do not use library (neither system nor builtin wx version) | |
1769 | dnl | |
1770 | dnl --------------------------------------------------------------------------- | |
1771 | ||
18dbb1f6 VZ |
1772 | dnl ------------------------------------------------------------------------ |
1773 | dnl Check for regex libraries | |
1774 | dnl ------------------------------------------------------------------------ | |
1775 | ||
1776 | REGEX_INCLUDE= | |
1777 | if test "$wxUSE_REGEX" != "no"; then | |
4f14bcd8 GD |
1778 | AC_DEFINE(wxUSE_REGEX) |
1779 | ||
1780 | if test "$wxUSE_REGEX" = "sys" -o "$wxUSE_REGEX" = "yes" ; then | |
1781 | dnl according to Unix 98 specs, regcomp() is in libc but I believe that | |
1782 | dnl on some old systems it may be in libregex - check for it too? | |
ef33c576 | 1783 | AC_CHECK_HEADER(regex.h, [AC_CHECK_FUNCS(regcomp)]) |
4f14bcd8 GD |
1784 | |
1785 | if test "x$ac_cv_func_regcomp" != "xyes"; then | |
1786 | if test "$wxUSE_REGEX" = "sys" ; then | |
1787 | AC_MSG_ERROR([system regex library not found! Use --with-regex to use built-in version]) | |
1788 | else | |
a3df447d | 1789 | AC_MSG_WARN([system regex library not found, will use built-in instead]) |
4f14bcd8 GD |
1790 | wxUSE_REGEX=builtin |
1791 | fi | |
1792 | else | |
1793 | dnl we are using the system library | |
1794 | wxUSE_REGEX=sys | |
18dbb1f6 | 1795 | fi |
4f14bcd8 | 1796 | fi |
18dbb1f6 | 1797 | |
4f14bcd8 | 1798 | if test "$wxUSE_REGEX" = "builtin" ; then |
18dbb1f6 VZ |
1799 | REGEX_INCLUDE="-I\${top_srcdir}/src/regex" |
1800 | fi | |
4f14bcd8 | 1801 | fi |
18dbb1f6 | 1802 | |
4f14bcd8 GD |
1803 | dnl ------------------------------------------------------------------------ |
1804 | dnl Check for zlib compression library | |
1805 | dnl ------------------------------------------------------------------------ | |
1806 | ||
1807 | ZLIB_INCLUDE= | |
1808 | ZLIB_LINK= | |
1809 | if test "$wxUSE_ZLIB" != "no" ; then | |
1810 | AC_DEFINE(wxUSE_ZLIB) | |
1811 | ||
1812 | if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then | |
d775acfa VZ |
1813 | dnl don't test for zlib under Mac -- its verson there is 1.1.3 but we |
1814 | dnl should still use it because hopefully (can someone confirm this?) | |
1815 | dnl Apple did fix the security problem in it and not using the system | |
1816 | dnl library results in a whole bunch of warnings when linking with | |
1817 | dnl Carbon framework | |
1818 | if test "$USE_DARWIN" = 1; then | |
1819 | system_zlib_h_ok="yes" | |
1820 | else | |
1821 | dnl we have troubles with ancient zlib versions (e.g. 1.0.4 is | |
1822 | dnl known to not work) and although I don't know which is | |
1823 | dnl the minimal required version it's safer to test for 1.1.4 as | |
1824 | dnl it fixes a security problem in 1.1.3 -- and hopefully nobody | |
1825 | dnl has anything more ancient (1.1.3 was released in July 1998) | |
1826 | dnl anyhow | |
1827 | AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h, | |
ef33c576 VZ |
1828 | [AC_TRY_RUN( |
1829 | dnl zlib.h defines ZLIB_VERSION="x.y.z" | |
d775acfa | 1830 | [ |
d775acfa VZ |
1831 | #include <zlib.h> |
1832 | #include <stdio.h> | |
1833 | ||
d775acfa VZ |
1834 | int main() |
1835 | { | |
1836 | FILE *f=fopen("conftestval", "w"); | |
1837 | if (!f) exit(1); | |
1838 | fprintf(f, "%s", | |
1839 | ZLIB_VERSION[0] == '1' && | |
1840 | (ZLIB_VERSION[2] > '1' || | |
1841 | (ZLIB_VERSION[2] == '1' && | |
1842 | ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); | |
1843 | exit(0); | |
1844 | } | |
d775acfa VZ |
1845 | ], |
1846 | ac_cv_header_zlib_h=`cat conftestval`, | |
1847 | ac_cv_header_zlib_h=no, | |
d1188635 JS |
1848 | dnl cross-compiling: don't have an answer, try later |
1849 | unset ac_cv_header_zlib_h | |
ef33c576 | 1850 | )] |
d643b80e | 1851 | ) |
d1188635 JS |
1852 | dnl If the test above did not come up with a value (e.g. cross |
1853 | dnl compiling) then this should give a definitive answer | |
1854 | AC_CHECK_HEADER(zlib.h) | |
d643b80e | 1855 | |
d775acfa VZ |
1856 | system_zlib_h_ok=$ac_cv_header_zlib_h |
1857 | fi | |
1858 | ||
1859 | if test "$system_zlib_h_ok" = "yes"; then | |
d643b80e VZ |
1860 | AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz") |
1861 | fi | |
4f14bcd8 GD |
1862 | |
1863 | if test "x$ZLIB_LINK" = "x" ; then | |
1864 | if test "$wxUSE_ZLIB" = "sys" ; then | |
d643b80e | 1865 | AC_MSG_ERROR([zlib library not found or too old! Use --with-zlib=builtin to use built-in version]) |
4f14bcd8 | 1866 | else |
d643b80e | 1867 | AC_MSG_WARN([zlib library not found or too old, will use built-in instead]) |
4f14bcd8 GD |
1868 | wxUSE_ZLIB=builtin |
1869 | fi | |
1870 | else | |
1871 | dnl we are using the system library | |
1872 | wxUSE_ZLIB=sys | |
1873 | fi | |
1874 | fi | |
1875 | ||
1876 | if test "$wxUSE_ZLIB" = "builtin" ; then | |
1877 | ZLIB_INCLUDE="-I\${top_srcdir}/src/zlib" | |
1878 | fi | |
1879 | fi | |
1880 | ||
1881 | dnl ------------------------------------------------------------------------ | |
1882 | dnl Check for png library | |
1883 | dnl ------------------------------------------------------------------------ | |
1884 | ||
1885 | PNG_INCLUDE= | |
1886 | PNG_LINK= | |
1887 | if test "$wxUSE_LIBPNG" != "no" ; then | |
1888 | AC_DEFINE(wxUSE_LIBPNG) | |
3bd8fb5f | 1889 | |
81809c07 VS |
1890 | if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBPNG" = "builtin" ; then |
1891 | AC_MSG_WARN([wxMGL doesn't work with builtin png library, will use MGL one instead]) | |
1892 | wxUSE_LIBPNG=sys | |
1893 | fi | |
4f14bcd8 GD |
1894 | |
1895 | dnl for the check below to have a chance to succeed, we must already have | |
81809c07 VS |
1896 | dnl libz somewhere (don't do this when bulding wxMGL since its libpng |
1897 | dnl doesn't depend on zlib) | |
1898 | if test "$wxUSE_MGL" != 1 -a "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then | |
a3df447d | 1899 | AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead]) |
4f14bcd8 GD |
1900 | wxUSE_LIBPNG=builtin |
1901 | fi | |
1902 | ||
81809c07 VS |
1903 | if test "$wxUSE_MGL" != 1 ; then |
1904 | dnl Don't check for libpng when building wxMGL, libmgl contains it | |
1905 | if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then | |
5d3f766d VZ |
1906 | dnl libpng version 0.9 is known to not work, if an even newer |
1907 | dnl version is required, just bump it up in the test below | |
1908 | AC_CACHE_CHECK([for png.h > 0.90], ac_cv_header_png_h, | |
ef33c576 VZ |
1909 | [AC_TRY_RUN( |
1910 | dnl png.h defines PNG_LIBPNG_VER=number | |
5d3f766d | 1911 | [ |
5d3f766d VZ |
1912 | #include <png.h> |
1913 | #include <stdio.h> | |
1914 | ||
1915 | int main() | |
1916 | { | |
1917 | FILE *f=fopen("conftestval", "w"); | |
1918 | if (!f) exit(1); | |
1919 | fprintf(f, "%s", | |
1920 | PNG_LIBPNG_VER > 90 ? "yes" : "no"); | |
1921 | exit(0); | |
1922 | } | |
1923 | ], | |
1924 | ac_cv_header_png_h=`cat conftestval`, | |
1925 | ac_cv_header_png_h=no, | |
d1188635 JS |
1926 | dnl cross-compiling: test (later) if we have any png.h |
1927 | unset ac_cv_header_png_h | |
ef33c576 | 1928 | )] |
5d3f766d | 1929 | ) |
d1188635 | 1930 | AC_CHECK_HEADER(png.h) |
5d3f766d VZ |
1931 | |
1932 | if test "$ac_cv_header_png_h" = "yes"; then | |
1933 | AC_CHECK_LIB(png, png_check_sig, PNG_LINK=" -lpng", , [-lz -lm]) | |
1934 | fi | |
81809c07 VS |
1935 | |
1936 | if test "x$PNG_LINK" = "x" ; then | |
1937 | if test "$wxUSE_LIBPNG" = "sys" ; then | |
0c98a14e | 1938 | AC_MSG_ERROR([system png library not found or too old! Use --with-libpng=builtin to use built-in version]) |
81809c07 | 1939 | else |
0c98a14e | 1940 | AC_MSG_WARN([system png library not found or too old, will use built-in instead]) |
81809c07 VS |
1941 | wxUSE_LIBPNG=builtin |
1942 | fi | |
4f14bcd8 | 1943 | else |
81809c07 | 1944 | dnl we are using the system library |
2b5f62a0 | 1945 | wxUSE_LIBPNG=sys |
4f14bcd8 | 1946 | fi |
4f14bcd8 GD |
1947 | fi |
1948 | fi | |
1949 | ||
1950 | if test "$wxUSE_LIBPNG" = "builtin" ; then | |
1951 | PNG_INCLUDE="-I\${top_srcdir}/src/png" | |
1952 | fi | |
1953 | ||
1954 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png" | |
1955 | fi | |
1956 | ||
1957 | dnl ------------------------------------------------------------------------ | |
1958 | dnl Check for jpeg library | |
1959 | dnl ------------------------------------------------------------------------ | |
1960 | ||
1961 | JPEG_INCLUDE= | |
1962 | JPEG_LINK= | |
1963 | if test "$wxUSE_LIBJPEG" != "no" ; then | |
1964 | AC_DEFINE(wxUSE_LIBJPEG) | |
1965 | ||
81809c07 VS |
1966 | if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBJPEG" = "builtin" ; then |
1967 | AC_MSG_WARN([wxMGL doesn't work with builtin jpeg library, will use MGL one instead]) | |
1968 | wxUSE_LIBJPEG=sys | |
1969 | fi | |
1970 | ||
1971 | if test "$wxUSE_MGL" != 1 ; then | |
1972 | dnl Don't check for libjpeg when building wxMGL, libmgl contains it | |
1973 | if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then | |
1974 | dnl can't use AC_CHECK_HEADER as jconfig.h defines things like | |
1975 | dnl HAVE_STDLIB_H which are already defined and this provokes | |
1976 | dnl a compiler warning which configure considers as an error... | |
1977 | AC_MSG_CHECKING(for jpeglib.h) | |
1978 | AC_CACHE_VAL(ac_cv_header_jpeglib_h, | |
1979 | AC_TRY_COMPILE( | |
1980 | [ | |
1981 | #undef HAVE_STDLIB_H | |
1982 | #include <stdio.h> | |
1983 | #include <jpeglib.h> | |
1984 | ], | |
1985 | [ | |
1986 | ], | |
1987 | ac_cv_header_jpeglib_h=yes, | |
1988 | ac_cv_header_jpeglib_h=no | |
1989 | ) | |
4f14bcd8 | 1990 | ) |
81809c07 | 1991 | AC_MSG_RESULT($ac_cv_header_jpeglib_h) |
4f14bcd8 | 1992 | |
81809c07 VS |
1993 | if test "$ac_cv_header_jpeglib_h" = "yes"; then |
1994 | AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg") | |
1995 | fi | |
4f14bcd8 | 1996 | |
81809c07 VS |
1997 | if test "x$JPEG_LINK" = "x" ; then |
1998 | if test "$wxUSE_LIBJPEG" = "sys" ; then | |
1999 | AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version]) | |
2000 | else | |
2001 | AC_MSG_WARN([system jpeg library not found, will use built-in instead]) | |
2002 | wxUSE_LIBJPEG=builtin | |
2003 | fi | |
4f14bcd8 | 2004 | else |
81809c07 VS |
2005 | dnl we are using the system library |
2006 | wxUSE_LIBJPEG=sys | |
4f14bcd8 | 2007 | fi |
4f14bcd8 GD |
2008 | fi |
2009 | fi | |
2010 | ||
2011 | if test "$wxUSE_LIBJPEG" = "builtin" ; then | |
2012 | JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg" | |
2013 | fi | |
2014 | fi | |
2015 | ||
2016 | dnl ------------------------------------------------------------------------ | |
2017 | dnl Check for tiff library | |
2018 | dnl ------------------------------------------------------------------------ | |
2019 | ||
2020 | TIFF_INCLUDE= | |
2021 | TIFF_LINK= | |
2b5f62a0 | 2022 | TIFF_PREREQ_LINKS=-lm |
4f14bcd8 GD |
2023 | if test "$wxUSE_LIBTIFF" != "no" ; then |
2024 | AC_DEFINE(wxUSE_LIBTIFF) | |
2025 | ||
2026 | if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then | |
2b5f62a0 VZ |
2027 | dnl libtiff may depend on libjpeg and libz so use them in the test |
2028 | dnl below or it would fail | |
2029 | if test "$wxUSE_LIBJPEG" = "sys"; then | |
2030 | TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK" | |
2031 | fi | |
2032 | if test "$wxUSE_ZLIB" = "sys"; then | |
2033 | TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" | |
2034 | fi | |
4f14bcd8 GD |
2035 | AC_CHECK_HEADER(tiffio.h, |
2036 | AC_CHECK_LIB(tiff, TIFFError, | |
3d63bc3a | 2037 | TIFF_LINK=" -ltiff", |
4f14bcd8 | 2038 | , |
2b5f62a0 | 2039 | $TIFF_PREREQ_LINKS) |
4f14bcd8 GD |
2040 | ) |
2041 | ||
2042 | if test "x$TIFF_LINK" = "x" ; then | |
2043 | if test "$wxUSE_LIBTIFF" = "sys" ; then | |
2044 | AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version]) | |
2045 | else | |
a3df447d | 2046 | AC_MSG_WARN([system tiff library not found, will use built-in instead]) |
4f14bcd8 GD |
2047 | wxUSE_LIBTIFF=builtin |
2048 | fi | |
2049 | else | |
2050 | dnl we are using the system library | |
2051 | wxUSE_LIBTIFF=sys | |
2052 | fi | |
2053 | fi | |
2054 | ||
2055 | if test "$wxUSE_LIBTIFF" = "builtin" ; then | |
2056 | TIFF_INCLUDE="-I\${top_srcdir}/src/tiff" | |
2057 | fi | |
2058 | fi | |
2059 | ||
9a98a854 VZ |
2060 | dnl ---------------------------------------------------------------- |
2061 | dnl search for toolkit (widget sets) | |
2062 | dnl ---------------------------------------------------------------- | |
2063 | ||
dad6c0ea | 2064 | AFMINSTALL= |
2b5f62a0 | 2065 | WIN32INSTALL= |
dad6c0ea | 2066 | |
3a922bb4 RL |
2067 | TOOLKIT= |
2068 | TOOLKIT_INCLUDE= | |
2069 | WIDGET_SET= | |
e90c1d2a | 2070 | |
3a922bb4 RL |
2071 | dnl are we building for a win32 target environment? |
2072 | dnl If so, setup common stuff needed for both GUI and Base libs. | |
2073 | if test "$USE_WIN32" = 1 ; then | |
2074 | AC_CHECK_HEADERS(w32api.h) | |
2075 | AC_CHECK_HEADER(windows.h, [], | |
2076 | [ | |
2077 | AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h) | |
2078 | ]) | |
dad6c0ea | 2079 | |
ea7682f0 VS |
2080 | dnl check if can use _WIN32_IE macro |
2081 | AC_CACHE_CHECK([if w32api has good enough MSIE support], wx_cv_w32api_win32_ie, | |
3a922bb4 RL |
2082 | [ |
2083 | AC_TRY_COMPILE([#include <w32api.h>], | |
2084 | [ | |
2085 | #define wxCHECK_W32API_VERSION( major, minor ) \ | |
2086 | ( defined( __W32API_MAJOR_VERSION ) && defined( __W32API_MINOR_VERSION ) \ | |
2087 | && ( ( __W32API_MAJOR_VERSION > (major) ) \ | |
2088 | || ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor)))) | |
2089 | ||
2090 | #if !wxCHECK_W32API_VERSION(1,1) | |
2091 | #error You need w32api 1.1 or newer | |
2092 | #endif | |
2093 | ], [ | |
ea7682f0 | 2094 | wx_cv_w32api_win32_ie=yes |
3a922bb4 | 2095 | ], [ |
ea7682f0 | 2096 | wx_cv_w32api_win32_ie=no |
3a922bb4 RL |
2097 | ]) |
2098 | ]) | |
ea7682f0 VS |
2099 | if test "$wx_cv_w32api_win32_ie" = "yes" ; then |
2100 | CPPFLAGS="$CPPFLAGS -D_WIN32_IE=0x400" | |
2101 | fi | |
9a98a854 | 2102 | |
3a922bb4 RL |
2103 | dnl --- FIXME: This is still a somewhat random list of libs, |
2104 | dnl --- some of them should probably be included conditionally. | |
b3dfbbc9 | 2105 | LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32" |
9a98a854 | 2106 | |
7bb2947d MB |
2107 | if test "$wxUSE_ACCESSIBILITY" = "yes" ; then |
2108 | LIBS="$LIBS -loleacc" | |
2109 | fi | |
2110 | ||
77e13408 RL |
2111 | case "${host}" in |
2112 | *-*-cygwin* ) | |
2113 | dnl Cygwin doesn't include these by default | |
b3dfbbc9 | 2114 | LIBS="$LIBS -lkernel32 -luser32" |
77e13408 RL |
2115 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WIN95__" |
2116 | esac | |
7b7a7637 | 2117 | |
3a922bb4 | 2118 | dnl add extra odbc libs if we have compiled in odbc |
8647bec6 RG |
2119 | if test "$wxUSE_ODBC" = "sys" ; then |
2120 | wxUSE_ODBC = "yes" | |
2121 | fi | |
3a922bb4 | 2122 | if test "$wxUSE_ODBC" = "yes" ; then |
a72a4bfa | 2123 | LIBS=" -lodbc32 -lole32 -loleaut32 $LIBS" |
8647bec6 | 2124 | AC_DEFINE(wxUSE_ODBC) |
3a922bb4 | 2125 | fi |
8647bec6 | 2126 | dnl We might want to abort here if wxUSE_ODBC="builtin" isn't supported on msw. |
9a98a854 | 2127 | |
3a922bb4 RL |
2128 | RESFLAGS="--include-dir \$(top_srcdir)/include --include-dir \$(top_srcdir)/\$(program_dir) --define __WIN32__ --define __WIN95__ --define __GNUWIN32__" |
2129 | RESPROGRAMOBJ="\$(PROGRAM)_resources.o" | |
2b5f62a0 VZ |
2130 | |
2131 | dnl install Win32-specific files in "make install" | |
2132 | WIN32INSTALL=win32install | |
3a922bb4 | 2133 | fi |
3f0f0161 | 2134 | |
b2fee376 | 2135 | if test "$USE_DARWIN" = 1; then |
50bcbd3d GD |
2136 | dnl Mac OS X/Darwin GCC uses precompiled headers by default |
2137 | dnl this can cause problems both when compiling wxMac and wxBase | |
b2fee376 GD |
2138 | if test "$wxUSE_PRECOMP" = "yes"; then |
2139 | CPPFLAGS="$CPPFLAGS -cpp-precomp" | |
2140 | else | |
2141 | CPPFLAGS="$CPPFLAGS -no-cpp-precomp" | |
2142 | fi | |
2143 | fi | |
2144 | ||
3a922bb4 RL |
2145 | if test "$wxUSE_GUI" = "yes"; then |
2146 | USE_GUI=1 | |
a9b5e89f | 2147 | |
3a922bb4 | 2148 | GUI_TK_LIBRARY= |
32832908 | 2149 | |
3a922bb4 RL |
2150 | WXGTK12= |
2151 | WXGTK127= | |
2152 | WXGTK20= | |
32832908 | 2153 | |
77e13408 | 2154 | if test "$wxUSE_MSW" = 1 ; then |
1e6feb95 VZ |
2155 | TOOLKIT=MSW |
2156 | GUIDIST=MSW_DIST | |
7e99ad86 VZ |
2157 | fi |
2158 | ||
1e6feb95 | 2159 | if test "$wxUSE_GTK" = 1; then |
8168de4c | 2160 | AC_MSG_CHECKING([for GTK+ version]) |
b9fa850d | 2161 | |
8168de4c VZ |
2162 | gtk_version_cached=1 |
2163 | AC_CACHE_VAL(wx_cv_lib_gtk, | |
2164 | [ | |
2165 | dnl stupid GTK+ AM macros produce their own messages, so we | |
2166 | dnl have to pass to the next line | |
2167 | gtk_version_cached=0 | |
d48ad9bd | 2168 | AC_MSG_RESULT() |
8168de4c | 2169 | |
3f345b47 VZ |
2170 | dnl we must link against lgthread unless the user |
2171 | dnl used --disable-threads | |
2172 | GTK_MODULES= | |
2173 | if test "$wxUSE_THREADS" = "yes"; then | |
2174 | GTK_MODULES=gthread | |
2175 | fi | |
2176 | ||
2b5f62a0 VZ |
2177 | dnl note that if we fail to find GTK2 we abort and don't fall |
2178 | dnl back to GTK1.x | |
8168de4c VZ |
2179 | wx_cv_lib_gtk= |
2180 | if test "x$wxUSE_GTK2" = "xyes"; then | |
1ae7bd02 | 2181 | AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES) |
2b5f62a0 | 2182 | else |
3f345b47 | 2183 | AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES) |
8168de4c | 2184 | |
2b5f62a0 VZ |
2185 | if test -z "$wx_cv_lib_gtk"; then |
2186 | AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES) | |
2187 | fi | |
8168de4c VZ |
2188 | fi |
2189 | ||
2190 | if test -z "$wx_cv_lib_gtk"; then | |
2191 | dnl looks better in AC_MSG_RESULT | |
2192 | wx_cv_lib_gtk=none | |
138be253 VZ |
2193 | else |
2194 | dnl we need to cache GTK_CFLAGS and GTK_LIBS for the | |
2195 | dnl subsequent runs | |
2196 | wx_cv_cflags_gtk=$GTK_CFLAGS | |
2197 | wx_cv_libs_gtk=$GTK_LIBS | |
8168de4c VZ |
2198 | fi |
2199 | ] | |
2200 | ) | |
b9fa850d | 2201 | |
8168de4c VZ |
2202 | dnl if it wasn't cached, the messages from AM_PATH_GTK() above are |
2203 | dnl enough | |
2204 | if test "$gtk_version_cached" = 1; then | |
2205 | AC_MSG_RESULT($wx_cv_lib_gtk) | |
2206 | fi | |
b9fa850d | 2207 | |
8168de4c VZ |
2208 | case "$wx_cv_lib_gtk" in |
2209 | 2.0) WXGTK20=1 | |
2b5f62a0 | 2210 | TOOLKIT_VERSION=2 |
8168de4c VZ |
2211 | ;; |
2212 | 1.2.7) WXGTK127=1 | |
d1a8d972 | 2213 | WXGTK12=1 |
8168de4c VZ |
2214 | ;; |
2215 | 1.2.3) WXGTK12=1 | |
2216 | ;; | |
2217 | *) AC_MSG_ERROR([ | |
2218 | Please check that gtk-config is in path, the directory | |
2219 | where GTK+ libraries are installed (returned by | |
2220 | 'gtk-config --libs' command) is in LD_LIBRARY_PATH or | |
2221 | equivalent variable and GTK+ is version 1.2.3 or above. | |
2222 | ]) | |
2223 | ;; | |
2224 | esac | |
c596875e | 2225 | |
b13cd66e VZ |
2226 | if test "$WXGTK20" = 1; then |
2227 | if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then | |
2228 | PKG_CHECK_MODULES(PANGOFT2, pangoft2, | |
2229 | [ | |
2230 | CXXFLAGS="$CXXFLAGS $PANGOFT2_CFLAGS" | |
2231 | LIBS="$LIBS $PANGOFT2_LIBS" | |
2232 | ], | |
2233 | [ | |
2234 | AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support]) | |
2235 | wxUSE_PRINTING_ARCHITECTURE="no" | |
2236 | ] | |
2237 | ) | |
2238 | fi | |
2b5f62a0 VZ |
2239 | else |
2240 | if test "$wxUSE_UNICODE" = "yes"; then | |
2241 | AC_MSG_WARN([Unicode configuration not supported with GTK+ 1.x]) | |
2242 | wxUSE_UNICODE=no | |
2243 | fi | |
2244 | fi | |
2245 | ||
2246 | dnl we need poll() in src/gtk/app.cpp (we know that Darwin doesn't | |
2247 | dnl have it but we do the check for the others) | |
2248 | if test "$USE_DARWIN" != 1; then | |
2249 | AC_CHECK_FUNCS(poll) | |
f09359cf VS |
2250 | fi |
2251 | ||
138be253 | 2252 | TOOLKIT_INCLUDE="$wx_cv_cflags_gtk" |
11dfaa5f | 2253 | GUI_TK_LIBRARY="$wx_cv_libs_gtk" |
7799a2d7 | 2254 | |
1e6feb95 VZ |
2255 | AFMINSTALL=afminstall |
2256 | TOOLKIT=GTK | |
2257 | GUIDIST=GTK_DIST | |
9a98a854 | 2258 | |
1e6feb95 VZ |
2259 | dnl test for XIM support in libgdk |
2260 | AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM)) | |
5a92d200 RR |
2261 | fi |
2262 | ||
1e6feb95 | 2263 | if test "$wxUSE_MGL" = 1; then |
63a76696 | 2264 | AC_MSG_CHECKING(for SciTech MGL library) |
1e6feb95 VZ |
2265 | if test "x$MGL_ROOT" = x ; then |
2266 | AC_MSG_RESULT(not found) | |
2267 | AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.]) | |
2268 | else | |
2269 | AC_MSG_RESULT($MGL_ROOT) | |
2270 | fi | |
5a92d200 | 2271 | |
63a76696 | 2272 | AC_MSG_CHECKING(for libmgl location) |
f9bc1684 VS |
2273 | dnl Find MGL library that we want |
2274 | dnl FIXME_MGL - test for MGL variants for freebsd etc. | |
2275 | case "${host}" in | |
2276 | *-*-linux* ) | |
63a76696 VS |
2277 | if test "x$wxUSE_SHARED" = xyes ; then |
2278 | mgl_os_candidates="linux/gcc/glibc.so linux/gcc/glibc" | |
2279 | else | |
2280 | mgl_os_candidates="linux/gcc/glibc linux/gcc/glibc.so" | |
2281 | fi | |
f9bc1684 VS |
2282 | ;; |
2283 | *-pc-msdosdjgpp ) | |
63a76696 | 2284 | mgl_os_candidates="dos32/dj2" |
f9bc1684 VS |
2285 | ;; |
2286 | *) | |
2287 | AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.) | |
2288 | esac | |
2289 | ||
3a922bb4 | 2290 | mgl_lib_type="" |
63a76696 VS |
2291 | mgl_os="" |
2292 | ||
2293 | for mgl_os_i in $mgl_os_candidates ; do | |
2294 | if test "x$mgl_os" = x ; then | |
2295 | if test "$wxUSE_DEBUG_FLAG" = yes ; then | |
2296 | if test -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.a -o \ | |
2297 | -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.so; then | |
2298 | mgl_lib_type=debug | |
2299 | mgl_os=$mgl_os_i | |
2300 | fi | |
2301 | fi | |
2302 | if test "x$mgl_lib_type" = x ; then | |
2303 | if test -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.a -o \ | |
2304 | -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.so; then | |
2305 | mgl_lib_type=release | |
2306 | mgl_os=$mgl_os_i | |
2307 | fi | |
2308 | fi | |
1e6feb95 | 2309 | fi |
63a76696 | 2310 | done |
264de0cc | 2311 | |
63a76696 VS |
2312 | if test "x$mgl_os" = x ; then |
2313 | AC_MSG_RESULT(not found) | |
2314 | AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.]) | |
2315 | fi | |
2316 | AC_MSG_RESULT("$MGL_ROOT/lib/$mgl_lib_type/$mgl_os") | |
1542ea39 | 2317 | |
1d1b75ac VZ |
2318 | wxUSE_UNIVERSAL="yes" |
2319 | ||
1e6feb95 | 2320 | TOOLKIT_INCLUDE="-I$MGL_ROOT/include" |
3a922bb4 | 2321 | GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm" |
d607e6c3 | 2322 | |
1e6feb95 VZ |
2323 | AFMINSTALL=afminstall |
2324 | TOOLKIT=MGL | |
2325 | GUIDIST=MGL_DIST | |
d607e6c3 | 2326 | fi |
143121c5 | 2327 | |
1725144d RR |
2328 | if test "$wxUSE_MICROWIN" = 1; then |
2329 | AC_MSG_CHECKING(for MicroWindows) | |
2330 | if test "x$MICROWINDOWS" = x ; then | |
2331 | AC_MSG_RESULT(not found) | |
2332 | AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.]) | |
2333 | else | |
2334 | AC_MSG_RESULT($MICROWINDOWS) | |
2335 | fi | |
2336 | ||
2337 | if test -f $MICROWINDOWS/lib/libmwin.a; then | |
2338 | AC_MSG_RESULT(MicroWindows' libraries found.) | |
2339 | else | |
2340 | AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.]) | |
2341 | fi | |
2342 | ||
2343 | TOOLKIT_INCLUDE="-I$MICROWINDOWS/include" | |
2344 | GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib" | |
2345 | ||
1d1b75ac VZ |
2346 | wxUSE_UNIVERSAL="yes" |
2347 | ||
1725144d RR |
2348 | AFMINSTALL=afminstall |
2349 | TOOLKIT=MICROWIN | |
2350 | GUIDIST=MICROWIN_DIST | |
1d1b75ac VZ |
2351 | |
2352 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1" | |
1725144d RR |
2353 | fi |
2354 | ||
7f5c07ab JS |
2355 | if test "$wxUSE_X11" = 1; then |
2356 | dnl use standard macros to check for X headers/libs, this brings support | |
2357 | dnl for the standard configure options --x-includes and --x-libraries | |
2358 | AC_PATH_XTRA | |
2359 | ||
2360 | if test "$no_x" = "yes"; then | |
2361 | AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options) | |
2362 | fi | |
2363 | ||
2364 | GUI_TK_LIBRARY="$X_LIBS" | |
2365 | TOOLKIT_INCLUDE="$X_CFLAGS" | |
2366 | AFMINSTALL=afminstall | |
2367 | COMPILED_X_PROGRAM=0 | |
2368 | ||
256d631a | 2369 | if test "$wxUSE_NANOX" = "yes"; then |
6ec507fd JS |
2370 | AC_MSG_CHECKING(for MicroWindows/NanoX distribution) |
2371 | if test "x$MICROWIN" = x ; then | |
2372 | AC_MSG_RESULT(not found) | |
2373 | AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.]) | |
2374 | else | |
2375 | AC_MSG_RESULT($MICROWIN) | |
c79a329d | 2376 | AC_DEFINE(wxUSE_NANOX) |
6ec507fd JS |
2377 | fi |
2378 | fi | |
2379 | ||
7f5c07ab JS |
2380 | xpm_link= |
2381 | AC_MSG_CHECKING(for Xpm library) | |
2382 | WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm) | |
2383 | if test "$ac_find_libraries" != "" ; then | |
2384 | WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) | |
2385 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" | |
2386 | xpm_link=" -lXpm" | |
2387 | AC_DEFINE(wxHAVE_LIB_XPM) | |
2388 | AC_MSG_RESULT(found at $ac_find_libraries) | |
2389 | else | |
2390 | AC_TRY_COMPILE( | |
2391 | [ | |
2392 | #include <X11/xpm.h> | |
2393 | ], | |
2394 | [ | |
2395 | int version; | |
2396 | version = XpmLibraryVersion(); | |
2397 | ], | |
2398 | [ | |
2399 | xpm_link=" -lXpm" | |
2400 | AC_DEFINE(wxHAVE_LIB_XPM) | |
2401 | AC_MSG_RESULT(found in default search path) | |
2402 | COMPILED_X_PROGRAM=0 | |
2403 | ], | |
2404 | [ | |
2405 | AC_MSG_RESULT(no) | |
2406 | AC_MSG_WARN(library will be compiled without support for images in XPM format) | |
2407 | ] | |
2408 | ) | |
2409 | fi | |
2410 | ||
f7f78039 MB |
2411 | AC_CHECK_LIB([Xext], [XShapeQueryExtension], |
2412 | [ | |
2413 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXext" | |
2414 | wxHAVE_XEXT_LIB=1 | |
2415 | ], | |
2416 | [], [$GUI_TK_LIBRARY -lX11]) | |
2417 | ||
2b5f62a0 VZ |
2418 | if test "$wxUSE_UNICODE" = "yes"; then |
2419 | PKG_CHECK_MODULES(PANGOX, pangox, | |
2420 | [ | |
2421 | CXXFLAGS="$CXXFLAGS $PANGOX_CFLAGS" | |
2422 | LIBS="$LIBS $PANGOX_LIBS" | |
2423 | ], | |
2424 | [ | |
2425 | AC_MSG_ERROR([pangox library not found, library cannot be compiled in Unicode mode]) | |
2426 | ] | |
2427 | ) | |
2428 | PKG_CHECK_MODULES(PANGOFT2, pangoft2, | |
2429 | [ | |
2430 | CXXFLAGS="$CXXFLAGS $PANGOFT2_CFLAGS" | |
2431 | LIBS="$LIBS $PANGOFT2_LIBS" | |
2432 | ], | |
2433 | [ | |
2434 | AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support]) | |
2435 | wxUSE_PRINTING_ARCHITECTURE="no" | |
2436 | ] | |
2437 | ) | |
2438 | PKG_CHECK_MODULES(PANGOXFT, pangoxft, | |
2439 | [ | |
2440 | CXXFLAGS="$CXXFLAGS $PANGOXFT_CFLAGS" | |
2441 | LIBS="$LIBS $PANGOXFT_LIBS" | |
2442 | ], | |
2443 | [ | |
2444 | AC_MSG_WARN([pangoxft library not found, library will be compiled without anti-aliasing support]) | |
2445 | ] | |
2446 | ) | |
2447 | fi | |
2448 | ||
1d1b75ac VZ |
2449 | wxUSE_UNIVERSAL="yes" |
2450 | ||
256d631a | 2451 | if test "$wxUSE_NANOX" = "yes"; then |
4e5a4800 | 2452 | TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE" |
32b38f99 | 2453 | 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 | 2454 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a" |
6ec507fd | 2455 | else |
0feee163 | 2456 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11$xpm_link" |
6ec507fd JS |
2457 | fi |
2458 | ||
3c011993 | 2459 | TOOLKIT_VPATH="\${top_srcdir}/src/x11" |
7f5c07ab JS |
2460 | TOOLKIT=X11 |
2461 | GUIDIST=X11_DIST | |
7f5c07ab JS |
2462 | fi |
2463 | ||
1e6feb95 | 2464 | if test "$wxUSE_MOTIF" = 1; then |
d714471b VZ |
2465 | dnl use standard macros to check for X headers/libs, this brings support |
2466 | dnl for the standard configure options --x-includes and --x-libraries | |
2467 | AC_PATH_XTRA | |
2468 | ||
1e6feb95 VZ |
2469 | if test "$no_x" = "yes"; then |
2470 | AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options) | |
2471 | fi | |
2472 | ||
2b5f62a0 VZ |
2473 | dnl for some reason AC_PATH_XTRA seems to add -INONE and -LNONE to |
2474 | dnl X_LIBS and X_CFLAGS respectively -- what for?? | |
2475 | GUI_TK_LIBRARY=`echo $X_LIBS | sed 's/ -LNONE//'` | |
2476 | TOOLKIT_INCLUDE=`echo $X_CFLAGS | sed 's/ -INONE//'` | |
1e6feb95 | 2477 | AFMINSTALL=afminstall |
1e6feb95 VZ |
2478 | COMPILED_X_PROGRAM=0 |
2479 | ||
2480 | AC_MSG_CHECKING(for Motif/Lesstif headers) | |
2481 | WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h) | |
2482 | if test "$ac_find_includes" != "" ; then | |
dd0e4a90 VZ |
2483 | AC_MSG_RESULT(found in $ac_find_includes) |
2484 | WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE) | |
2485 | TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include" | |
cd6d6d5b | 2486 | else |
cd6d6d5b VZ |
2487 | AC_TRY_COMPILE( |
2488 | [ | |
2489 | #include <Xm/Xm.h> | |
2490 | ], | |
2491 | [ | |
2492 | int version; | |
cd6d6d5b VZ |
2493 | version = xmUseVersion; |
2494 | ], | |
2495 | [ | |
2496 | AC_MSG_RESULT(found in default search path) | |
2497 | COMPILED_X_PROGRAM=1 | |
2498 | ], | |
2499 | [ | |
2500 | AC_MSG_RESULT(no) | |
1e6feb95 | 2501 | AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h) |
cd6d6d5b VZ |
2502 | ] |
2503 | ) | |
2504 | fi | |
9a98a854 | 2505 | |
1e6feb95 VZ |
2506 | if test "$COMPILED_X_PROGRAM" = 0; then |
2507 | AC_MSG_CHECKING(for Motif/Lesstif library) | |
2508 | WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) | |
2509 | if test "$ac_find_libraries" != "" ; then | |
dd0e4a90 | 2510 | AC_MSG_RESULT(found at $ac_find_libraries) |
1e6feb95 | 2511 | |
dd0e4a90 | 2512 | WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) |
62d0491b | 2513 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" |
1e6feb95 | 2514 | else |
dd0e4a90 VZ |
2515 | dnl it might happen that we found headers in one of the |
2516 | dnl standard paths but the libs are elsewhere - we do need to | |
2517 | dnl try to compile a sample program then here | |
2518 | save_CFLAGS=$CFLAGS | |
2519 | CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" | |
2520 | ||
1e6feb95 VZ |
2521 | AC_TRY_COMPILE( |
2522 | [ | |
2523 | #include <Xm/Xm.h> | |
2524 | ], | |
2525 | [ | |
2526 | int version; | |
1e6feb95 VZ |
2527 | version = xmUseVersion; |
2528 | ], | |
2529 | [ | |
2530 | AC_MSG_RESULT(found in default search path) | |
2531 | COMPILED_X_PROGRAM=1 | |
2532 | ], | |
2533 | [ | |
2534 | AC_MSG_RESULT(no) | |
2535 | AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm) | |
2536 | ] | |
2537 | ) | |
dd0e4a90 VZ |
2538 | |
2539 | CFLAGS=$save_CFLAGS | |
1e6feb95 VZ |
2540 | fi |
2541 | fi | |
2542 | ||
3d63bc3a | 2543 | xpm_link= |
1e6feb95 VZ |
2544 | AC_MSG_CHECKING(for Xpm library) |
2545 | WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm) | |
2546 | if test "$ac_find_libraries" != "" ; then | |
2547 | WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) | |
62d0491b | 2548 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" |
dd0e4a90 | 2549 | |
3d63bc3a | 2550 | xpm_link=" -lXpm" |
f6bcfd97 | 2551 | AC_DEFINE(wxHAVE_LIB_XPM) |
1e6feb95 VZ |
2552 | AC_MSG_RESULT(found at $ac_find_libraries) |
2553 | else | |
dd0e4a90 VZ |
2554 | save_CFLAGS=$CFLAGS |
2555 | CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" | |
2556 | ||
1e6feb95 VZ |
2557 | AC_TRY_COMPILE( |
2558 | [ | |
2559 | #include <X11/xpm.h> | |
2560 | ], | |
2561 | [ | |
2562 | int version; | |
1e6feb95 VZ |
2563 | version = XpmLibraryVersion(); |
2564 | ], | |
2565 | [ | |
3d63bc3a | 2566 | xpm_link=" -lXpm" |
3a922bb4 | 2567 | AC_DEFINE(wxHAVE_LIB_XPM) |
1e6feb95 VZ |
2568 | AC_MSG_RESULT(found in default search path) |
2569 | COMPILED_X_PROGRAM=0 | |
2570 | ], | |
2571 | [ | |
2572 | AC_MSG_RESULT(no) | |
2573 | AC_MSG_WARN(library will be compiled without support for images in XPM format) | |
2574 | ] | |
2575 | ) | |
dd0e4a90 VZ |
2576 | |
2577 | CFLAGS=$save_CFLAGS | |
1e6feb95 | 2578 | fi |
9a98a854 | 2579 | |
6a30f1c8 MB |
2580 | AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE]) |
2581 | libp_link="" | |
2582 | libsm_ice_link="" | |
2583 | libs_found=0 | |
2584 | for libp in "" " -lXp"; do | |
2585 | if test "$libs_found" = "0"; then | |
2586 | for libsm_ice in " -lSM -lICE"; do | |
e26c13cf | 2587 | if test "$libs_found" = "0"; then |
6a30f1c8 MB |
2588 | save_LIBS="$LIBS" |
2589 | LIBS="$GUI_TK_LIBRARY -lXm${xpm_link} ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11" | |
dd0e4a90 VZ |
2590 | save_CFLAGS=$CFLAGS |
2591 | CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" | |
2592 | ||
6a30f1c8 MB |
2593 | AC_TRY_LINK( |
2594 | [ | |
2595 | #include <Xm/Xm.h> | |
2596 | #include <Xm/List.h> | |
2597 | ], | |
2598 | [ | |
2599 | XmString string = NULL; | |
2600 | Widget w = NULL; | |
2601 | int position = 0; | |
2602 | XmListAddItem(w, string, position); | |
2603 | ], | |
2604 | [ | |
2605 | libp_link="$libp" | |
2606 | libsm_ice_link="$libsm_ice" | |
2607 | AC_MSG_RESULT( | |
2608 | [need${libp_link}${libsm_ice_link}]) | |
2609 | libs_found=1 | |
2610 | ], [] | |
2611 | ) | |
dd0e4a90 | 2612 | |
6a30f1c8 | 2613 | LIBS="$save_LIBS" |
dd0e4a90 | 2614 | CFLAGS=$save_CFLAGS |
6a30f1c8 MB |
2615 | fi |
2616 | done | |
2617 | fi | |
2618 | done | |
2619 | ||
2620 | if test "$libs_found" = "0"; then | |
2621 | AC_MSG_RESULT([can't find the right libraries]) | |
2622 | AC_MSG_ERROR([can't link a simple motif program]) | |
2623 | fi | |
17234b26 | 2624 | |
da494b40 MB |
2625 | save_CFLAGS=$CFLAGS |
2626 | CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" | |
2627 | AC_MSG_CHECKING([for Motif 2]) | |
2628 | AC_TRY_COMPILE([ | |
2629 | #include <Xm/Xm.h> | |
2630 | ], | |
2631 | [ | |
2632 | #if XmVersion < 2000 | |
2633 | #error "Not Motif 2" | |
2634 | #endif | |
2635 | ], | |
2636 | [ | |
2637 | AC_DEFINE(__WXMOTIF20__,1) | |
2638 | AC_MSG_RESULT([found]) | |
2639 | ], | |
2640 | [ | |
2641 | AC_DEFINE(__WXMOTIF20__,0) | |
2642 | AC_MSG_RESULT([not found]) | |
2643 | ]) | |
2644 | CFLAGS=$save_CFLAGS | |
2645 | ||
6a30f1c8 | 2646 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11" |
69c44812 | 2647 | TOOLKIT_VPATH="\${top_srcdir}/src/motif${PATH_IFS}\${top_srcdir}/src/motif/xmcombo${PATH_IFS}\${top_srcdir}/src/x11" |
1e6feb95 VZ |
2648 | TOOLKIT=MOTIF |
2649 | GUIDIST=MOTIF_DIST | |
f7f78039 MB |
2650 | wxHAVE_XEXT_LIB=1 |
2651 | fi | |
2652 | ||
2653 | if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1 && | |
2654 | test "$wxHAVE_XEXT_LIB" = 1; then | |
2655 | save_CFLAGS="$CFLAGS" | |
2656 | CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" | |
2657 | ||
2658 | AC_MSG_CHECKING([for X11/extensions/shape.h]) | |
2659 | AC_TRY_COMPILE([ | |
2660 | #include <X11/Xlib.h> | |
2661 | #include <X11/extensions/shape.h> | |
2662 | ], | |
2663 | [ | |
2664 | int dummy1, dummy2; | |
2665 | XShapeQueryExtension((Display*)NULL, | |
2666 | (int*)NULL, (int*)NULL); | |
2667 | ], | |
2668 | [ | |
2669 | AC_DEFINE(HAVE_XSHAPE) | |
2670 | AC_MSG_RESULT([found]) | |
2671 | ], | |
2672 | [ | |
2673 | AC_MSG_RESULT([not found]) | |
2674 | ]) | |
2675 | CFLAGS="$save_CFLAGS" | |
1e6feb95 | 2676 | fi |
b4085ce6 | 2677 | |
1e6feb95 | 2678 | if test "$wxUSE_MAC" = 1; then |
0c98a14e | 2679 | CPPFLAGS="$CPPFLAGS -fpascal-strings -I\${top_srcdir}/src/mac/morefilex -I/Developer/Headers/FlatCarbon" |
d08b457b | 2680 | |
0c98a14e | 2681 | TOOLKIT_VPATH="\${top_srcdir}/src/mac${PATH_IFS}\${top_srcdir}/src/mac/morefilex" |
1e6feb95 | 2682 | TOOLKIT=MAC |
683dccda | 2683 | dnl we can't call this MAC_DIST or autoconf thinks its a macro |
1e6feb95 VZ |
2684 | GUIDIST=MACX_DIST |
2685 | fi | |
e07802fc | 2686 | |
ac0c4cc3 DE |
2687 | if test "$wxUSE_COCOA" = 1; then |
2688 | TOOLKIT_VPATH="\${top_srcdir}/src/cocoa" | |
2689 | TOOLKIT=COCOA | |
2690 | GUIDIST=COCOA_DIST | |
2691 | fi | |
2692 | ||
1e6feb95 VZ |
2693 | if test "$wxUSE_PM" = 1; then |
2694 | TOOLKIT=PM | |
2695 | GUIDIST=GTK_DIST | |
2b5f62a0 | 2696 | AC_MSG_WARN([OS/2 threads are not yet supported... disabled]) |
f657dbe7 | 2697 | wxUSE_THREADS="no" |
1e6feb95 VZ |
2698 | fi |
2699 | ||
2700 | dnl the name of the directory where the files for this toolkit live | |
3a922bb4 | 2701 | if test "$TOOLKIT" = "PM" ; then |
1e6feb95 | 2702 | TOOLKIT_DIR="os2" |
f6bcfd97 | 2703 | else |
3a922bb4 | 2704 | TOOLKIT_DIR=`echo ${TOOLKIT} | tr "[[A-Z]]" "[[a-z]]"` |
1e6feb95 | 2705 | fi |
9a98a854 | 2706 | |
3a922bb4 RL |
2707 | dnl misc other files depending on the port |
2708 | PORT_FILES="\${top_srcdir}/src/\$(TOOLKITDIR)/files.lst" | |
517a619d | 2709 | |
1e6feb95 VZ |
2710 | if test "$wxUSE_UNIVERSAL" = "yes"; then |
2711 | ALL_OBJECTS="\$(GUI_LOWLEVEL_OBJS) \${UNIVOBJS}" | |
9b695262 VZ |
2712 | |
2713 | dnl ALL_SOURCES and ALL_HEADERS shouldn't include really all sources | |
2714 | dnl and headers as some/most are not needed for wxUniv but I don't | |
2715 | dnl have time to add GUI_LOWLEVEL_SOURCES/HEADERS stuff now (TODO!) | |
2716 | ALL_SOURCES="\$(ALL_SOURCES) \${UNIV_SOURCES}" | |
2717 | ALL_HEADERS="\$(ALL_HEADERS) \${UNIV_HEADERS}" | |
2718 | ||
3a922bb4 | 2719 | PORT_FILES="${PORT_FILES} \${top_srcdir}/src/univ/files.lst" |
4175e952 RR |
2720 | if test "$wxUSE_X11" = 1; then |
2721 | TOOLKIT_VPATH="\${top_srcdir}/src/${TOOLKIT_DIR}${PATH_IFS}\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes" | |
2722 | else | |
2723 | TOOLKIT_VPATH="\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes${PATH_IFS}\${top_srcdir}/src/${TOOLKIT_DIR}" | |
2724 | fi | |
3a922bb4 RL |
2725 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__" |
2726 | WIDGET_SET=univ | |
1e6feb95 VZ |
2727 | else |
2728 | ALL_OBJECTS="\$(GUIOBJS)" | |
9b695262 VZ |
2729 | ALL_SOURCES="\$(ALL_SOURCES)" |
2730 | ALL_HEADERS="\$(ALL_HEADERS)" | |
1e6feb95 VZ |
2731 | fi |
2732 | ||
ba0e650c | 2733 | ALL_OBJECTS="${ALL_OBJECTS} \$(COMMONOBJS) \$(GENERICOBJS)" |
1e6feb95 | 2734 | |
f9bc1684 | 2735 | if test "$TOOLKIT" != "MSW" -a "$USE_DOS" != 1; then |
1e6feb95 VZ |
2736 | ALL_OBJECTS="${ALL_OBJECTS} \$(UNIXOBJS)" |
2737 | fi | |
2738 | ||
2739 | if test "$wxUSE_HTML" = "yes"; then | |
2740 | ALL_OBJECTS="${ALL_OBJECTS} \$(HTMLOBJS)" | |
2741 | fi | |
3fcdd07b | 2742 | |
4f14bcd8 | 2743 | if test "$wxUSE_LIBJPEG" = "builtin" ; then |
2224580a | 2744 | ALL_OBJECTS="${ALL_OBJECTS} \$(JPEGOBJS)" |
d9d8273d | 2745 | fi |
4f14bcd8 | 2746 | if test "$wxUSE_LIBTIFF" = "builtin" ; then |
d9d8273d RR |
2747 | ALL_OBJECTS="${ALL_OBJECTS} \$(TIFFOBJS)" |
2748 | fi | |
4f14bcd8 | 2749 | if test "$wxUSE_LIBPNG" = "builtin" ; then |
d9d8273d RR |
2750 | ALL_OBJECTS="${ALL_OBJECTS} \$(PNGOBJS)" |
2751 | fi | |
2224580a | 2752 | |
2224580a VZ |
2753 | dnl distribute samples/demos/utils with GUI versions |
2754 | GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST" | |
2755 | DISTDIR="wx\$(TOOLKIT)" | |
e90c1d2a | 2756 | else |
dad6c0ea VZ |
2757 | USE_GUI=0 |
2758 | ||
3a922bb4 RL |
2759 | dnl this doesn't quite work right for wxBase, but the places |
2760 | dnl where it is wrong aren't fatal (yet) though. | |
07eb77a6 | 2761 | TOOLKIT_DIR="base" |
f6bcfd97 | 2762 | |
e90c1d2a | 2763 | dnl the sources, their dependenices and the headers |
3a922bb4 RL |
2764 | if test "$USE_WIN32" = 1 ; then |
2765 | ALL_OBJECTS="\${BASE_OBJS} \${BASE_MSW_OBJS}" | |
2766 | TOOLKIT_VPATH="\${top_srcdir}/src/msw" | |
e90c1d2a | 2767 | |
3a922bb4 RL |
2768 | dnl yes, the toolkit for wxBase on win32 is actually MSW |
2769 | dnl wxBase on unix does not need a 'TOOLKIT' defined. | |
2770 | TOOLKIT="MSW" | |
2771 | else | |
2772 | ALL_OBJECTS="\${BASE_OBJS} \${BASE_UNIX_OBJS}" | |
2773 | TOOLKIT_VPATH="\${top_srcdir}/src/unix" | |
a20b6d3a VZ |
2774 | fi |
2775 | ||
d8356fa3 VZ |
2776 | ALL_SOURCES="\$(ALL_SOURCES)" |
2777 | ALL_HEADERS="\$(ALL_HEADERS)" | |
2778 | ||
831b3152 | 2779 | PORT_FILES="\${top_srcdir}/src/files.lst" |
2224580a VZ |
2780 | |
2781 | dnl distribute only wxBase sources/headers | |
2782 | GUIDIST="BASE_DIST" | |
2783 | DISTDIR="wxBase" | |
e90c1d2a VZ |
2784 | fi |
2785 | ||
4f14bcd8 GD |
2786 | dnl --------------------------------------------------------------------------- |
2787 | dnl Optional libraries included when system library is not used | |
2788 | dnl --------------------------------------------------------------------------- | |
e45387bf | 2789 | |
8647bec6 RG |
2790 | |
2791 | dnl ---------------------------------------------------------------- | |
2792 | dnl iODBC support | |
2793 | dnl ---------------------------------------------------------------- | |
2794 | ||
2795 | IODBC_C_SRC="" | |
2796 | ||
2797 | ||
2798 | dnl ODBC is handled seperately for MSW | |
2799 | if test "$TOOLKIT" != "MSW" ; then | |
2800 | ||
2801 | if test "$wxUSE_ODBC" != "no" ; then | |
2802 | AC_DEFINE(wxUSE_ODBC) | |
2803 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db" | |
2804 | ||
2805 | dnl is this still necessary in 2.5? | |
2806 | WXODBCFLAG="-D_IODBC_" | |
2807 | ||
2808 | ||
2809 | if test "$wxUSE_ODBC" = "sys" ; then | |
2810 | dnl This is not ideal we really ough to use the unixodbc-config | |
2811 | dnl or iodbc-config if they exist. | |
2812 | ||
2813 | AC_CHECK_HEADER(sql.h) | |
fd3d7534 RG |
2814 | AC_SEARCH_LIBS(SQLAllocEnv,iodbc unixodbc odbc , , [ |
2815 | wxUSE_ODBC=builtin; | |
2816 | AC_MSG_WARN( [ can't find system Odbc library falling back to builtin ]) | |
2817 | ] ) | |
2818 | fi | |
2819 | dnl Not "no" either... | |
2820 | if test "$wxUSE_ODBC" != "sys" ; then | |
2821 | ALL_OBJECTS="${ALL_OBJECTS} \$(IODBCOBJS)" | |
8647bec6 RG |
2822 | fi |
2823 | ||
2824 | fi | |
2825 | ||
e45387bf VZ |
2826 | fi |
2827 | ||
4f14bcd8 | 2828 | if test "$wxUSE_REGEX" = "builtin" ; then |
3a922bb4 RL |
2829 | ALL_OBJECTS="${ALL_OBJECTS} \$(REGEXOBJS)" |
2830 | fi | |
4f14bcd8 | 2831 | if test "$wxUSE_ZLIB" = "builtin" ; then |
3a922bb4 RL |
2832 | ALL_OBJECTS="${ALL_OBJECTS} \$(ZLIBOBJS)" |
2833 | fi | |
2834 | ||
4f14bcd8 GD |
2835 | dnl --------------------------------------------------------------------------- |
2836 | dnl OpenGL libraries | |
2837 | dnl --------------------------------------------------------------------------- | |
be505a65 | 2838 | |
3a922bb4 | 2839 | if test "$wxUSE_OPENGL" = "yes"; then |
ac0c4cc3 | 2840 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = "1"; then |
62d0491b | 2841 | OPENGL_LIBS="-framework OpenGL -framework AGL" |
be505a65 VZ |
2842 | elif test "$wxUSE_MSW" = 1; then |
2843 | OPENGL_LIBS="-lopengl32 -lglu32" | |
62d0491b | 2844 | else |
01aa5863 VS |
2845 | dnl David Elliott: Without this snippet AC_CHECK_HEADER fails to find |
2846 | dnl GL/gl.h on Mac OS X where it is located in | |
2847 | dnl /usr/X11R6/include/GL/gl.h: | |
2848 | ||
2849 | WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, GL/gl.h) | |
2850 | if test "$ac_find_includes" != "" ; then | |
2851 | AC_MSG_RESULT(found in $ac_find_includes) | |
2852 | set -x | |
2853 | WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS) | |
2854 | CPPFLAGS="$CPPFLAGS$ac_path_to_include" | |
2855 | set +x | |
2856 | fi | |
2857 | ||
62d0491b RL |
2858 | AC_CHECK_HEADER(GL/gl.h, |
2859 | [ | |
021fde89 VZ |
2860 | found_gl=0 |
2861 | ||
1352efdf | 2862 | AC_MSG_CHECKING([for -lGL]) |
021fde89 | 2863 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],GL) |
62d0491b RL |
2864 | if test "$ac_find_libraries" != "" ; then |
2865 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
021fde89 VZ |
2866 | if test "$ac_path_to_link" != " -L/usr/lib" ; then |
2867 | LDFLAGS_GL="$ac_path_to_link" | |
4b6b4dfc | 2868 | fi |
021fde89 VZ |
2869 | |
2870 | dnl don't suppose that libGL and libGLU are always in the | |
2871 | dnl same directory -- this is not true for some common | |
2872 | dnl distributions | |
2873 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],GLU) | |
2874 | if test "$ac_find_libraries" != "" ; then | |
2875 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
2876 | if test "$ac_path_to_link" != " -L/usr/lib" -a \ | |
2877 | "$ac_path_to_link" != "$LDFLAGS_GL"; then | |
2878 | LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link" | |
2879 | fi | |
2880 | ||
2881 | found_gl=1 | |
2882 | OPENGL_LIBS="-lGL -lGLU" | |
2883 | AC_MSG_RESULT([yes]) | |
2884 | fi | |
2885 | fi | |
2886 | ||
2887 | if "$found_gl" != 1; then | |
1352efdf RL |
2888 | AC_MSG_RESULT([no]) |
2889 | AC_MSG_CHECKING([for -lMesaGL]) | |
021fde89 | 2890 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],MesaGL) |
62d0491b RL |
2891 | if test "$ac_find_libraries" != "" ; then |
2892 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
2893 | LDFLAGS_GL="$LDFLAGS$ac_path_to_link" | |
2894 | OPENGL_LIBS="-lMesaGL -lMesaGLU" | |
1352efdf RL |
2895 | AC_MSG_RESULT([yes]) |
2896 | else | |
2897 | AC_MSG_RESULT([no]) | |
62d0491b RL |
2898 | fi |
2899 | fi | |
2900 | ]) | |
fb56368a | 2901 | |
62d0491b RL |
2902 | if test "x$OPENGL_LIBS" = "x"; then |
2903 | dnl it should be an error and not a warning because OpenGL is not on | |
2904 | dnl by default and so if it had been explicitely requested, we | |
2905 | dnl shouldn't just fall back to compiling the library without it | |
2906 | AC_MSG_ERROR(OpenGL libraries not available) | |
2907 | fi | |
6f754473 | 2908 | fi |
6f754473 | 2909 | |
62d0491b RL |
2910 | if test "$wxUSE_OPENGL" = "yes"; then |
2911 | AC_DEFINE(wxUSE_OPENGL) | |
2912 | AC_DEFINE(wxUSE_GLCANVAS) | |
2913 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl" | |
2914 | fi | |
3a922bb4 RL |
2915 | fi |
2916 | ||
2917 | if test -z "$TOOLKIT_VPATH" ; then | |
2918 | TOOLKIT_VPATH="\${top_srcdir}/src/${TOOLKIT_DIR}" | |
2919 | fi | |
2920 | ||
2921 | dnl the symbol which allows conditional compilation for the given toolkit | |
2922 | if test -n "$TOOLKIT" ; then | |
2923 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WX${TOOLKIT}__" | |
2924 | fi | |
2925 | ||
fe0895cf | 2926 | UNICODE=0 |
f676c7ff MB |
2927 | lib_unicode_suffix= |
2928 | if test "$wxUSE_UNICODE" = "yes"; then | |
2929 | lib_unicode_suffix=u | |
fe0895cf | 2930 | UNICODE=1 |
f676c7ff MB |
2931 | fi |
2932 | ||
3a922bb4 | 2933 | lib_debug_suffix= |
fe0895cf | 2934 | BUILD=release |
3a922bb4 RL |
2935 | if test "$wxUSE_DEBUG_FLAG" = "yes"; then |
2936 | lib_debug_suffix=d | |
fe0895cf | 2937 | BUILD=debug |
3a922bb4 RL |
2938 | fi |
2939 | ||
2b5f62a0 VZ |
2940 | WX_VERSION_TAG=`echo WX${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}_${WX_RELEASE} | tr "[[a-z]]" "[[A-Z]]"` |
2941 | ||
2942 | TOOLCHAIN_NAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}-${WX_RELEASE}" | |
2943 | TOOLCHAIN_NAME_GL="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}_gl-${WX_RELEASE}" | |
3a922bb4 RL |
2944 | |
2945 | if test "$cross_compiling" = "yes"; then | |
2946 | TOOLCHAIN_NAME="${TOOLCHAIN_NAME}-${host_alias}" | |
2947 | TOOLCHAIN_NAME_GL="${TOOLCHAIN_NAME_GL}-${host_alias}" | |
2948 | fi | |
2949 | ||
2950 | dnl library link name | |
2951 | WX_LIBRARY="wx_${TOOLCHAIN_NAME}" | |
2952 | WX_LIBRARY_GL="wx_${TOOLCHAIN_NAME_GL}" | |
2b5f62a0 | 2953 | WX_LIBRARY_BASENAME="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}" |
3a922bb4 | 2954 | |
3a922bb4 RL |
2955 | dnl the name of the shared library |
2956 | WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}" | |
2957 | WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}" | |
b12915c1 | 2958 | |
3a922bb4 RL |
2959 | dnl the name of the links to the shared library |
2960 | WX_LIBRARY_LINK1="lib${WX_LIBRARY}.${SO_SUFFIX}.${WX_CURRENT}" | |
2961 | WX_LIBRARY_LINK2="lib${WX_LIBRARY}.${SO_SUFFIX}" | |
2962 | WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}" | |
2963 | WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}" | |
55e80573 | 2964 | |
978f1259 RL |
2965 | case "${host}" in |
2966 | *-*-cygwin* | *-*-mingw32* ) | |
2967 | ||
2968 | dnl If we are cross compiling we want to use the 'full' unix type name for the | |
2969 | dnl lib, but for a native install use the windows style naming convention. | |
2da4f892 | 2970 | dnl (excepting again that we strip the ELF style version numbers off it). |
978f1259 RL |
2971 | |
2972 | dnl FIXME: is this GL stuff actually even used for wxMSW? should it be?? | |
2973 | ||
17234b26 | 2974 | if test "$cross_compiling" != "yes" -a "$TOOLKIT_DIR" = "msw"; then |
978f1259 RL |
2975 | WX_LIBRARY="wxmsw${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}" |
2976 | WX_LIBRARY_GL="wxmsw_gl${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}" | |
2977 | WX_LIBRARY_NAME_SHARED="${WX_LIBRARY}.${SO_SUFFIX}" | |
2978 | WX_LIBRARY_NAME_SHARED_GL="${WX_LIBRARY_GL}.${SO_SUFFIX}" | |
2da4f892 RL |
2979 | else |
2980 | WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}" | |
2981 | WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}" | |
978f1259 | 2982 | fi |
e95edd8d | 2983 | ;; |
978f1259 | 2984 | |
e95edd8d | 2985 | *-*-darwin* ) |
05159a27 GD |
2986 | dnl Under Mac OS X, the naming conventions for shared libraries |
2987 | dnl are different: the number precedes the suffix. | |
1542ea39 | 2988 | |
05159a27 GD |
2989 | WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}.${SO_SUFFIX}" |
2990 | WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}.${SO_SUFFIX}" | |
2991 | ||
2992 | WX_LIBRARY_LINK1="lib${WX_LIBRARY}.${WX_CURRENT}.${SO_SUFFIX}" | |
2993 | WX_LIBRARY_LINK2="lib${WX_LIBRARY}.${SO_SUFFIX}" | |
2994 | WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY_GL}.${WX_CURRENT}.${SO_SUFFIX}" | |
2995 | WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}" | |
2996 | ||
e95edd8d GD |
2997 | dnl Under Mac OS X, we should build real frameworks instead of simple |
2998 | dnl dynamic shared libraries (in order to embed the resources) | |
2999 | if test "$wxUSE_MAC" = 1; then | |
f346733b GD |
3000 | dnl base name of the resource file for wxMac must be the same |
3001 | dnl as library installation base name (-install_name) | |
3002 | WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.${WX_CURRENT}.r" | |
3003 | WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.${WX_CURRENT}.rsrc" | |
e95edd8d GD |
3004 | fi |
3005 | ;; | |
978f1259 RL |
3006 | esac |
3007 | ||
3008 | dnl the name of the static library | |
3009 | WX_LIBRARY_NAME_STATIC="lib${WX_LIBRARY}.a" | |
3010 | WX_LIBRARY_NAME_STATIC_GL="lib${WX_LIBRARY_GL}.a" | |
3011 | ||
3012 | dnl define which libs wx-config should link. | |
3013 | WXCONFIG_LIBS="-l${WX_LIBRARY}" | |
885d4bf5 | 3014 | WXCONFIG_LIBS_STATIC="lib${WX_LIBRARY}.a" |
978f1259 RL |
3015 | |
3016 | if test "$wxUSE_OPENGL" = "yes"; then | |
885d4bf5 VS |
3017 | WXCONFIG_LIBS_GL="-l${WX_LIBRARY_GL} ${OPENGL_LIBS}" |
3018 | WXCONFIG_LIBS_STATIC_GL="lib${WX_LIBRARY_GL}.a ${OPENGL_LIBS}" | |
978f1259 RL |
3019 | fi |
3020 | ||
3021 | ||
3a922bb4 | 3022 | dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP --- |
55e80573 | 3023 | |
4222829b VS |
3024 | if test "$wxUSE_SHARED" = "yes"; then |
3025 | case "${host}" in | |
3026 | *-pc-os2_emx | *-pc-os2-emx | \ | |
3027 | *-pc-msdosdjgpp ) | |
3028 | dnl only static for now | |
3029 | wxUSE_SHARED=no | |
3030 | AC_MSG_WARN([Host system doesn't support shared libraries, disabling]) | |
3031 | ;; | |
3032 | esac | |
3033 | fi | |
3034 | ||
fe0895cf | 3035 | SHARED=0 |
3a922bb4 | 3036 | if test "$wxUSE_SHARED" = "yes"; then |
fe0895cf | 3037 | SHARED=1 |
55e80573 VZ |
3038 | |
3039 | dnl install targets | |
3040 | if test "$wxUSE_OPENGL" = "yes"; then | |
3041 | WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS CREATE_INSTALLED_LINKS_GL" | |
3a922bb4 | 3042 | WX_ALL="\$(build_libdir)/${WX_LIBRARY_LINK1} \$(build_libdir)/${WX_LIBRARY_LINK1_GL}" |
55e80573 VZ |
3043 | else |
3044 | WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS" | |
3a922bb4 | 3045 | WX_ALL="\$(build_libdir)/${WX_LIBRARY_LINK1}" |
55e80573 VZ |
3046 | fi |
3047 | ||
3048 | dnl the extra compiler flags needed for compilation of shared library | |
dd4f7467 VZ |
3049 | if test "$GCC" = "yes"; then |
3050 | dnl the switch for gcc is the same under all platforms | |
3051 | PIC_FLAG="-fPIC" | |
3052 | fi | |
55e80573 | 3053 | |
2b5f62a0 VZ |
3054 | |
3055 | dnl use versioned symbols if available on the platform | |
e6cc62c6 | 3056 | WX_VERSIONED_SYMBOLS([\$(top_builddir)version-script]) |
2b5f62a0 | 3057 | |
55e80573 VZ |
3058 | dnl the command to use for creating the shared library |
3059 | SHARED_LD="${CXX} -shared -o" | |
3060 | ||
3061 | case "${host}" in | |
3062 | *-hp-hpux* ) | |
3063 | dnl default settings are good for gcc but not for the native HP-UX | |
ad2622f1 | 3064 | if test "$GCC" = "yes"; then |
85d5e282 GD |
3065 | dnl -o flag must be after PIC flag |
3066 | SHARED_LD="${CXX} -shared ${PIC_FLAG} -o" | |
d569ea8d | 3067 | else |
f6bcfd97 | 3068 | dnl no idea why it wants it, but it does |
3d63bc3a | 3069 | LDFLAGS="$LDFLAGS -L/usr/lib" |
f6bcfd97 | 3070 | |
be087207 RR |
3071 | SHARED_LD="${CXX} -b -o" |
3072 | PIC_FLAG="+Z" | |
3073 | fi | |
55e80573 | 3074 | |
7b7a7637 RL |
3075 | dnl install shared libs without symlinks |
3076 | if test "$wxUSE_OPENGL" = "yes"; then | |
3077 | WX_ALL_INSTALLED="preinstall_gl" | |
3078 | WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED} \$(build_libdir)/${WX_LIBRARY_NAME_SHARED_GL}" | |
3079 | else | |
3080 | WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED}" | |
3081 | fi | |
de87c353 | 3082 | ;; |
b12915c1 | 3083 | |
32b38f99 | 3084 | *-*-linux* | *-*-gnu* ) |
55e80573 VZ |
3085 | if test "$GCC" != "yes"; then |
3086 | AC_CACHE_CHECK([for Intel compiler], wx_cv_prog_icc, | |
3087 | [ | |
3088 | AC_TRY_COMPILE([], | |
3089 | [ | |
3090 | #ifndef __INTEL_COMPILER | |
dd4f7467 | 3091 | #error Not icc |
55e80573 VZ |
3092 | #endif |
3093 | ], | |
3094 | wx_cv_prog_icc=yes, | |
3095 | wx_cv_prog_icc=no | |
3096 | ) | |
3097 | ]) | |
55e80573 VZ |
3098 | if test "$wx_cv_prog_icc" = "yes"; then |
3099 | PIC_FLAG="-KPIC" | |
3100 | fi | |
3101 | fi | |
3102 | ||
e6cc62c6 | 3103 | SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib" |
de87c353 | 3104 | ;; |
55e80573 | 3105 | |
de87c353 RR |
3106 | *-*-solaris2* ) |
3107 | if test "$GCC" = yes ; then | |
f6bcfd97 BP |
3108 | dnl newer versions of gcc need -isystem to compile X headers on |
3109 | dnl Solaris (which use old style C syntax) | |
3110 | CPPFLAGS="$CPPFLAGS -isystem /usr/openwin/include" | |
fe0895cf VS |
3111 | |
3112 | dnl gcc may use Sun's ld, in which case -rpath gives a confusing | |
3113 | dnl error message. We have to try both -Wl,-rpath and -Wl,-R: | |
3114 | saveLdflags="$LDFLAGS" | |
3115 | LDFLAGS="$saveLdflags -Wl,-rpath,/" | |
3116 | AC_MSG_CHECKING([if the linker accepts -rpath]) | |
3117 | AC_TRY_LINK( | |
3118 | [],[], | |
3119 | [ | |
3120 | AC_MSG_RESULT([yes]) | |
e6cc62c6 | 3121 | SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib" |
fe0895cf VS |
3122 | ], |
3123 | [ | |
3124 | AC_MSG_RESULT([no]) | |
3125 | AC_MSG_CHECKING([if the linker accepts -R]) | |
3126 | LDFLAGS="$saveLdflags -Wl,-R,/" | |
3127 | AC_TRY_LINK( | |
3128 | [],[], | |
3129 | [ | |
3130 | AC_MSG_RESULT([yes]) | |
e6cc62c6 | 3131 | SAMPLES_RPATH_FLAG="-Wl,-R,\$(top_builddir)lib"], |
fe0895cf VS |
3132 | [ |
3133 | AC_MSG_RESULT([no]) | |
3134 | ]) | |
3135 | ]) | |
3136 | LDFLAGS="$saveLdflags" | |
de87c353 RR |
3137 | else |
3138 | SHARED_LD="${CXX} -G -o" | |
10f2d63a | 3139 | PIC_FLAG="-KPIC" |
e6cc62c6 | 3140 | SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib" |
de87c353 | 3141 | fi |
de87c353 | 3142 | ;; |
55e80573 | 3143 | |
b4085ce6 | 3144 | *-*-darwin* ) |
90f3fe56 GD |
3145 | dnl For Unix to MacOS X porting instructions, see: |
3146 | dnl http://fink.sourceforge.net/doc/porting/porting.html | |
b2fee376 GD |
3147 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -DWXMAKINGDLL" |
3148 | CFLAGS="$CFLAGS -fno-common" | |
3149 | CXXFLAGS="$CXXFLAGS -fno-common" | |
fe0d8518 GD |
3150 | dnl wxWindows must be fully binded (lazy binding breaks RTTI classinfo) |
3151 | dnl this can be done either with the exe linker flag -Wl,-bind_at_load | |
3152 | dnl or with a double stage link in order to create a single module | |
3153 | dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved | |
3154 | SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace -o" | |
ea5999b9 | 3155 | PIC_FLAG="-dynamic -fPIC" |
de87c353 | 3156 | ;; |
55e80573 | 3157 | |
de87c353 | 3158 | *-*-aix* ) |
2b5f62a0 VZ |
3159 | dnl default settings are ok for gcc |
3160 | if test "$GCC" != "yes"; then | |
3161 | dnl the abs path below used to be hardcoded here so I guess it must | |
3162 | dnl be some sort of standard location under AIX? | |
3163 | AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib, | |
3164 | makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib) | |
321d2b14 | 3165 | |
2b5f62a0 VZ |
3166 | SHARED_LD="$(AIX_CXX_LD) -p 0 -o" |
3167 | fi | |
de87c353 | 3168 | ;; |
55e80573 | 3169 | |
7b7a7637 | 3170 | *-*-cygwin* | *-*-mingw32* ) |
2da4f892 | 3171 | WX_LIBRARY_IMPORTLIB="${WX_LIBRARY_NAME_SHARED}.a" |
77e13408 | 3172 | |
77e13408 | 3173 | SHARED_LD="${CXX} -shared -Wl,--out-implib,lib/${WX_LIBRARY_IMPORTLIB} -o" |
00c81359 | 3174 | TOOLCHAIN_DLL_DEFS="${TOOLCHAIN_DLL_DEFS} -DWXUSINGDLL=1" |
25d0687a RL |
3175 | |
3176 | PIC_FLAG="-UWXUSINGDLL -DWXMAKINGDLL=1 -D_DLL=1 -D_WINDLL=1" | |
7b7a7637 | 3177 | |
f657dbe7 MB |
3178 | dnl Don't build seperate GL library |
3179 | WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED}" | |
3180 | WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS" | |
3181 | ||
f6bcfd97 | 3182 | if test "$wxUSE_OPENGL" = "yes"; then |
f657dbe7 | 3183 | LIBS="${LIBS} ${OPENGL_LIBS}" |
f6bcfd97 | 3184 | fi |
de87c353 | 3185 | ;; |
55e80573 | 3186 | |
b12915c1 VZ |
3187 | *-*-beos* ) |
3188 | dnl can't use gcc under BeOS for shared library creation because it | |
3189 | dnl complains about missing 'main' | |
3190 | SHARED_LD="${LD} -shared -o" | |
b12915c1 | 3191 | ;; |
55e80573 | 3192 | |
2b5f62a0 VZ |
3193 | *-*-irix* ) |
3194 | dnl default settings are ok for gcc | |
3195 | if test "$GCC" != "yes"; then | |
3196 | PIC_FLAG="-KPIC" | |
3197 | fi | |
3198 | ;; | |
3199 | ||
55e80573 VZ |
3200 | *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | \ |
3201 | *-*-sunos4* | \ | |
55e80573 VZ |
3202 | *-*-osf* | \ |
3203 | *-*-dgux5* | \ | |
3204 | *-*-sysv5* ) | |
3205 | dnl defaults are ok | |
3206 | ;; | |
3207 | ||
de87c353 | 3208 | *) |
7b7a7637 | 3209 | AC_MSG_ERROR(unknown system type $host.) |
de87c353 | 3210 | esac |
9a98a854 | 3211 | |
72dd34b5 VZ |
3212 | dnl set target to shared if not explicitly chose static before |
3213 | if test "x$WX_TARGET_LIBRARY" = "x"; then | |
3214 | WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}" | |
bdad4e7e | 3215 | WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_SHARED_GL}" |
72dd34b5 | 3216 | fi |
55e80573 | 3217 | |
3711412e RL |
3218 | dnl do not alter the LIBRARY_TYPE strings "so" and "a", they are magic |
3219 | WX_TARGET_LIBRARY_TYPE="so" | |
885d4bf5 | 3220 | INSTALL_LIBRARY='$(INSTALL_PROGRAM)' |
3a922bb4 | 3221 | fi |
f6bcfd97 | 3222 | |
3a922bb4 RL |
3223 | dnl do not 'else' this, it may be changed in the above conditional. |
3224 | if test "$wxUSE_SHARED" = "no"; then | |
f6bcfd97 | 3225 | |
3a922bb4 RL |
3226 | dnl give static wxBase and wxMSW build a working install target |
3227 | if test "$wxUSE_GUI" = "no" -o "$USE_WIN32" = 1 ; then | |
f6bcfd97 BP |
3228 | dnl we're here because WX_ALL_INSTALLED is empty, but play safe anyway |
3229 | WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall" | |
3230 | fi | |
3231 | ||
ac0c4cc3 | 3232 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then |
6fa882bd RR |
3233 | WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall" |
3234 | fi | |
3235 | ||
3a922bb4 RL |
3236 | if test "$wxUSE_OPENGL" = "yes"; then |
3237 | WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_gl" | |
3238 | WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_STATIC} \$(build_libdir)/${WX_LIBRARY_NAME_STATIC_GL}" | |
3239 | else | |
3240 | WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_STATIC}" | |
3241 | fi | |
3242 | ||
3243 | WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}" | |
3244 | WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_STATIC_GL}" | |
3245 | ||
3711412e | 3246 | WX_TARGET_LIBRARY_TYPE="a" |
885d4bf5 | 3247 | INSTALL_LIBRARY='$(INSTALL_DATA)' |
2bffed64 VZ |
3248 | |
3249 | dnl wx-config should assume the --static flag by default if we don't have | |
3250 | dnl any shared libs anyhow | |
3251 | STATIC_FLAG="yes" | |
3252 | else | |
3253 | STATIC_FLAG="no" | |
517a619d RR |
3254 | fi |
3255 | ||
93fac604 VZ |
3256 | dnl default value is to (silently) do nothing in the makefile |
3257 | MACRESCOMP="@#" | |
3258 | MACSETFILE="@#" | |
36825681 | 3259 | MACRESWXCONFIG="#" |
d08b457b GD |
3260 | if test "$wxUSE_MAC" = 1; then |
3261 | dnl add the resources target for wxMac | |
e6cc62c6 | 3262 | LIBWXMACRES="\$(top_builddir)lib/${WX_RESOURCES_MACOSX_ASCII}" |
336e99e2 | 3263 | WX_ALL="${WX_ALL} ${LIBWXMACRES}" |
e23081de | 3264 | WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_res" |
d08b457b | 3265 | AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez) |
9f8148b1 | 3266 | AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez) |
36825681 | 3267 | AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile) |
ef7f2189 | 3268 | MACOSX_BUNDLE="bundle" |
2b5f62a0 VZ |
3269 | dnl resources are bundled both with shared library and applications |
3270 | dnl since the carb resource *must* be included in the application | |
36825681 GD |
3271 | MACRESCOMP="\$(RESCOMP) -d __DARWIN__ -t APPL Carbon.r ${LIBWXMACRES} -o" |
3272 | MACSETFILE="\$(SETFILE)" | |
9711d31e | 3273 | MACRESWXCONFIG="${RESCOMP} -d __DARWIN__ -t APPL Carbon.r \${exec_prefix}/lib/${WX_RESOURCES_MACOSX_ASCII} -o" |
64440d77 DE |
3274 | elif test "$wxUSE_COCOA" = 1; then |
3275 | AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez) | |
3276 | AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez) | |
3277 | AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile) | |
3278 | MACRESCOMP="echo -n | \$(RESCOMP) -d __DARWIN__ -t APPL ${LIBWXMACRES} -o" | |
3279 | MACSETFILE="\$(SETFILE)" | |
9711d31e | 3280 | MACRESWXCONFIG="echo -n | ${RESCOMP} -d __DARWIN__ -t APPL \${exec_prefix}/lib/${WX_RESOURCES_MACOSX_ASCII} -o" |
590b1a4d SN |
3281 | else |
3282 | if test "$wxUSE_PM" = 1; then | |
36825681 | 3283 | MACRESCOMP="emxbind -ep" |
590b1a4d | 3284 | fi |
d08b457b GD |
3285 | fi |
3286 | ||
9a98a854 VZ |
3287 | dnl --------------------------------------------------------------------------- |
3288 | dnl Checks for typedefs | |
3289 | dnl --------------------------------------------------------------------------- | |
3290 | ||
3291 | dnl defines mode_t if not already defined | |
3292 | AC_TYPE_MODE_T | |
3293 | dnl defines off_t if not already defined | |
3294 | AC_TYPE_OFF_T | |
3295 | dnl defines pid_t if not already defined | |
3296 | AC_TYPE_PID_T | |
3297 | dnl defines size_t if not already defined | |
3298 | AC_TYPE_SIZE_T | |
3299 | dnl defines uid_t and gid_t if not already defined | |
3300 | AC_TYPE_UID_T | |
3301 | ||
d836ee96 | 3302 | dnl check what exactly size_t is on this machine - this is necessary to avoid |
ef33c576 | 3303 | dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h |
19af3b06 VZ |
3304 | AC_LANG_SAVE |
3305 | AC_LANG_CPLUSPLUS | |
d836ee96 VZ |
3306 | AC_CACHE_CHECK([if size_t is unsigned int], |
3307 | wx_cv_size_t_is_uint, | |
ef33c576 | 3308 | [ |
dd2c8b7c VZ |
3309 | dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work |
3310 | dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate | |
3311 | dnl methods in a local class (i.e. class inside a function) declaration | |
3312 | dnl without any objections!! | |
3313 | dnl | |
3314 | dnl hence the hack below: we must have Foo at global scope! | |
d836ee96 VZ |
3315 | AC_TRY_COMPILE([#include <stddef.h>], |
3316 | [ | |
dd2c8b7c VZ |
3317 | return 0; } |
3318 | ||
d836ee96 | 3319 | struct Foo { void foo(size_t); void foo(unsigned int); }; |
dd2c8b7c VZ |
3320 | |
3321 | int bar() { | |
d836ee96 VZ |
3322 | ], |
3323 | wx_cv_size_t_is_uint=no, | |
3324 | wx_cv_size_t_is_uint=yes | |
3325 | ) | |
ef33c576 | 3326 | ] |
d836ee96 VZ |
3327 | ) |
3328 | ||
3329 | if test "$wx_cv_size_t_is_uint" = "yes"; then | |
3330 | AC_DEFINE(wxSIZE_T_IS_UINT) | |
3331 | else | |
3332 | AC_CACHE_CHECK([if size_t is unsigned long], | |
3333 | wx_cv_size_t_is_ulong, | |
3334 | AC_TRY_COMPILE([#include <stddef.h>], | |
3335 | [ | |
dd2c8b7c VZ |
3336 | return 0; } |
3337 | ||
d836ee96 | 3338 | struct Foo { void foo(size_t); void foo(unsigned long); }; |
dd2c8b7c VZ |
3339 | |
3340 | int bar() { | |
d836ee96 VZ |
3341 | ], |
3342 | wx_cv_size_t_is_ulong=no, | |
3343 | wx_cv_size_t_is_ulong=yes | |
3344 | ) | |
3345 | ) | |
3346 | ||
3347 | if test "$wx_cv_size_t_is_ulong" = "yes"; then | |
3348 | AC_DEFINE(wxSIZE_T_IS_ULONG) | |
3349 | fi | |
3350 | fi | |
3351 | ||
19af3b06 VZ |
3352 | AC_LANG_RESTORE |
3353 | ||
9a98a854 VZ |
3354 | dnl --------------------------------------------------------------------------- |
3355 | dnl Checks for structures | |
3356 | dnl --------------------------------------------------------------------------- | |
3357 | ||
b12915c1 VZ |
3358 | dnl does passwd struct has the pw_gecos field? |
3359 | AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos, | |
3360 | [ | |
3361 | AC_TRY_COMPILE([#include <pwd.h>], | |
3362 | [ | |
3363 | char *p; | |
3364 | struct passwd *pw; | |
3365 | p = pw->pw_gecos; | |
3366 | ], | |
3367 | [ | |
3368 | wx_cv_struct_pw_gecos=yes | |
b12915c1 VZ |
3369 | ], |
3370 | [ | |
3371 | wx_cv_struct_pw_gecos=no | |
3372 | ] | |
3373 | ) | |
3374 | ] | |
3375 | ) | |
3376 | ||
bd3277fe VZ |
3377 | if test "$wx_cv_struct_pw_gecos" = "yes"; then |
3378 | AC_DEFINE(HAVE_PW_GECOS) | |
3379 | fi | |
3380 | ||
9a98a854 | 3381 | dnl --------------------------------------------------------------------------- |
9a98a854 VZ |
3382 | dnl Check for functions |
3383 | dnl --------------------------------------------------------------------------- | |
3384 | ||
d29b553b | 3385 | dnl don't check for wchar_t functions if we haven't got wchar_t itself |
d29b553b | 3386 | if test "$wx_cv_sizeof_wchar_t" != "0"; then |
d74f4b5a VZ |
3387 | AC_DEFINE(wxUSE_WCHAR_T) |
3388 | ||
3389 | dnl check for wcslen in all possible places | |
3390 | WCSLEN_FOUND=0 | |
d29b553b | 3391 | WCHAR_LINK= |
d74f4b5a | 3392 | AC_CHECK_FUNCS(wcslen, WCSLEN_FOUND=1) |
d29b553b | 3393 | |
d74f4b5a | 3394 | if test "$WCSLEN_FOUND" = 0; then |
7a30264c | 3395 | if test "$TOOLKIT" = "MSW"; then |
d74f4b5a | 3396 | AC_CHECK_LIB(msvcrt, wcslen, WCHAR_OK=1) |
7a30264c VZ |
3397 | else |
3398 | AC_CHECK_LIB(w, wcslen, [ | |
7a30264c | 3399 | WCHAR_LINK=" -lw" |
d74f4b5a | 3400 | WCSLEN_FOUND=1 |
7a30264c VZ |
3401 | ]) |
3402 | fi | |
d29b553b | 3403 | fi |
9a98a854 | 3404 | |
d74f4b5a VZ |
3405 | if test "$WCSLEN_FOUND" = 1; then |
3406 | AC_DEFINE(HAVE_WCSLEN) | |
3407 | fi | |
d29b553b | 3408 | |
d74f4b5a | 3409 | dnl try to use wcsrtombs instead of wcstombs which is buggy in old GNU |
d29b553b VZ |
3410 | dnl libc versions if possible |
3411 | AC_CHECK_FUNCS(wcsrtombs) | |
3412 | else | |
d74f4b5a | 3413 | AC_MSG_WARN([Wide character support is unavailable]) |
d29b553b | 3414 | fi |
b3e8d00a | 3415 | |
247f5006 VZ |
3416 | dnl *printf() functions sometimes are available in the library but not |
3417 | dnl prototyped -- if this is the case, we can't use them from C++ code, but to | |
3418 | dnl detect this we have to use C++ compiler for testing | |
3419 | AC_LANG_SAVE | |
3420 | AC_LANG_CPLUSPLUS | |
aea02638 | 3421 | |
247f5006 | 3422 | dnl check for vsnprintf() -- a safe version of vsprintf()) |
ec0d6da3 VZ |
3423 | dnl |
3424 | dnl the trouble here is that on some systems (notable HP-UX) this function is | |
3425 | dnl present in libc but not in the system headers and so AC_CHECK_FUNCS (which, | |
3426 | dnl stupidly, provides a dummy function declaration inside its extension) | |
3427 | dnl succeeds, even with C++ compiler, but the compilation of wxWindows fails | |
3428 | dnl | |
3429 | dnl so we first check if the function is in the library | |
247f5006 | 3430 | AC_CHECK_FUNCS(vsnprintf) |
9d8deca0 | 3431 | |
ec0d6da3 VZ |
3432 | if test "$ac_cv_func_vsnprintf" = "yes"; then |
3433 | dnl yes it is -- now check if it is in the headers | |
3434 | AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl, | |
3435 | [ | |
3436 | AC_TRY_COMPILE( | |
3437 | [ | |
3438 | #include <stdio.h> | |
3439 | #include <stdarg.h> | |
3440 | ], | |
3441 | [ | |
3442 | char *buf; | |
3443 | va_list ap; | |
3444 | vsnprintf(buf, 10u, "%s", ap); | |
3445 | ], | |
3446 | wx_cv_func_vsnprintf_decl=yes, | |
3447 | wx_cv_func_vsnprintf_decl=no | |
3448 | ) | |
3449 | ] | |
3450 | ) | |
3451 | ||
3452 | if test "$wx_cv_func_vsnprintf_decl" = "yes"; then | |
3453 | AC_DEFINE(HAVE_VSNPRINTF_DECL) | |
3454 | fi | |
3455 | fi | |
3456 | ||
d74f4b5a | 3457 | if test "$wxUSE_UNICODE" = yes; then |
247f5006 | 3458 | dnl also look if we have wide char IO functions |
5c6fa7d2 | 3459 | AC_CHECK_FUNCS(fputwc wprintf vswprintf) |
ec0d6da3 | 3460 | |
79668cae MB |
3461 | dnl MinGW has a vswprintf with a different prototype, and |
3462 | dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS | |
3463 | dnl finds it even if it is not declared in some versions... | |
3464 | AC_MSG_CHECKING([for _vsnwprintf]) | |
3465 | AC_TRY_COMPILE([#include <wchar.h>], | |
3466 | [&_vsnwprintf;], | |
3467 | [AC_MSG_RESULT([yes]) | |
3468 | AC_DEFINE(HAVE__VSNWPRINTF)], | |
3469 | [AC_MSG_RESULT([no])]); | |
d74f4b5a VZ |
3470 | fi |
3471 | ||
247f5006 VZ |
3472 | AC_LANG_RESTORE |
3473 | ||
3474 | ||
3475 | ||
f6bcfd97 | 3476 | dnl the following tests are for Unix(like) systems only |
b089607b | 3477 | if test "$TOOLKIT" != "MSW"; then |
a0c79abb | 3478 | |
95c8801c VS |
3479 | dnl check for available version of iconv() |
3480 | ||
3481 | AC_LANG_SAVE | |
3482 | AC_LANG_CPLUSPLUS | |
b040e242 VS |
3483 | AM_ICONV |
3484 | LIBS="$LIBICONV $LIBS" | |
95c8801c | 3485 | AC_LANG_RESTORE |
95c8801c | 3486 | |
eb4efbdc VZ |
3487 | dnl check for POSIX signals if we need them |
3488 | if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then | |
3489 | AC_CHECK_FUNCS(sigaction) | |
3490 | ||
3491 | if test "$ac_cv_func_sigaction" = "no"; then | |
3492 | AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called]) | |
3493 | wxUSE_ON_FATAL_EXCEPTION=no | |
3494 | fi | |
f6bcfd97 BP |
3495 | |
3496 | if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then | |
3497 | AC_LANG_SAVE | |
3498 | AC_LANG_CPLUSPLUS | |
3499 | ||
3500 | AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler, | |
3501 | [ | |
3502 | AC_TRY_COMPILE([#include <signal.h>], | |
3503 | [ | |
3504 | extern void testSigHandler(int); | |
3505 | ||
3506 | struct sigaction sa; | |
3507 | sa.sa_handler = testSigHandler; | |
3508 | ], [ | |
3509 | wx_cv_type_sa_handler=int | |
3510 | ], [ | |
3511 | wx_cv_type_sa_handler=void | |
3512 | ]) | |
3513 | ]) | |
3514 | ||
3515 | AC_LANG_RESTORE | |
3516 | ||
3517 | AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler) | |
3518 | fi | |
eb4efbdc VZ |
3519 | fi |
3520 | ||
ade35f11 VZ |
3521 | dnl check for the function for temp files creation |
3522 | AC_CHECK_FUNCS(mkstemp mktemp, break) | |
3523 | ||
9952adac VZ |
3524 | dnl get the library function to use for wxGetDiskSpace(): it is statfs() under |
3525 | dnl Linux and *BSD and statvfs() under Solaris | |
52e8b690 VZ |
3526 | AC_CACHE_CHECK(for statfs, wx_cv_func_statfs, |
3527 | AC_TRY_COMPILE( | |
3528 | [ | |
9952adac | 3529 | #if defined(__BSD__) |
d08b457b GD |
3530 | #include <sys/param.h> |
3531 | #include <sys/mount.h> | |
3532 | #else | |
3533 | #include <sys/vfs.h> | |
3534 | #endif | |
52e8b690 VZ |
3535 | ], |
3536 | [ | |
3537 | long l; | |
3538 | struct statfs fs; | |
3539 | statfs("/", &fs); | |
3540 | l = fs.f_bsize; | |
3541 | l += fs.f_blocks; | |
3542 | l += fs.f_bavail; | |
3543 | ], | |
3544 | [ | |
3545 | wx_cv_func_statfs=yes | |
3546 | ], | |
3547 | [ | |
3548 | wx_cv_func_statfs=no | |
3549 | ] | |
3550 | ) | |
3551 | ) | |
3552 | ||
3553 | if test "$wx_cv_func_statfs" = "yes"; then | |
54ab82b3 | 3554 | wx_cv_type_statvfs_t="struct statfs" |
52e8b690 VZ |
3555 | AC_DEFINE(HAVE_STATFS) |
3556 | else | |
9952adac VZ |
3557 | AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs, |
3558 | AC_TRY_COMPILE( | |
3559 | [ | |
54ab82b3 VZ |
3560 | #include <stddef.h> |
3561 | #include <sys/statvfs.h> | |
9952adac VZ |
3562 | ], |
3563 | [ | |
54ab82b3 | 3564 | statvfs("/", NULL); |
9952adac | 3565 | ], |
54ab82b3 VZ |
3566 | wx_cv_func_statvfs=yes, |
3567 | wx_cv_func_statvfs=no | |
9952adac | 3568 | ) |
af15babd | 3569 | ) |
9952adac VZ |
3570 | |
3571 | if test "$wx_cv_func_statvfs" = "yes"; then | |
54ab82b3 VZ |
3572 | dnl we also have to check whether we should use statvfs_t (works under |
3573 | dnl Solaris 8, doesn't work under Solaris 7) or "struct statvfs" (vice | |
3574 | dnl versa) as the argument for statvfs in 64 bit off_t mode (in 32 bit | |
3575 | dnl mode both work fine) | |
3576 | dnl | |
3577 | dnl for this check C++ compiler has to be used as passing incompatible | |
3578 | dnl pointers is just a warning and not an error in C | |
3579 | AC_LANG_SAVE | |
3580 | AC_LANG_CPLUSPLUS | |
3581 | ||
3582 | AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t, | |
3583 | AC_TRY_COMPILE( | |
3584 | [ | |
3585 | #include <sys/statvfs.h> | |
3586 | ], | |
3587 | [ | |
3588 | long l; | |
3589 | statvfs_t fs; | |
3590 | statvfs("/", &fs); | |
3591 | l = fs.f_bsize; | |
3592 | l += fs.f_blocks; | |
3593 | l += fs.f_bavail; | |
3594 | ], | |
3595 | wx_cv_type_statvfs_t=statvfs_t, | |
3596 | [ | |
3597 | AC_TRY_COMPILE( | |
3598 | [ | |
3599 | #include <sys/statvfs.h> | |
3600 | ], | |
3601 | [ | |
3602 | long l; | |
e107213f | 3603 | struct statvfs fs; |
54ab82b3 VZ |
3604 | statvfs("/", &fs); |
3605 | l = fs.f_bsize; | |
3606 | l += fs.f_blocks; | |
3607 | l += fs.f_bavail; | |
3608 | ], | |
3609 | wx_cv_type_statvfs_t="struct statvfs", | |
3610 | wx_cv_type_statvfs_t="unknown" | |
3611 | ) | |
3612 | ] | |
3613 | ) | |
3614 | ) | |
3615 | ||
3616 | AC_LANG_RESTORE | |
3617 | ||
3618 | if test "$wx_cv_type_statvfs_t" != "unknown"; then | |
3619 | AC_DEFINE(HAVE_STATVFS) | |
3620 | fi | |
9952adac | 3621 | else |
54ab82b3 VZ |
3622 | dnl set it for the test below |
3623 | wx_cv_type_statvfs_t="unknown" | |
9952adac | 3624 | fi |
52e8b690 VZ |
3625 | fi |
3626 | ||
54ab82b3 VZ |
3627 | if test "$wx_cv_type_statvfs_t" != "unknown"; then |
3628 | AC_DEFINE_UNQUOTED(WX_STATFS_T, $wx_cv_type_statvfs_t) | |
3629 | else | |
3630 | AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()]) | |
3631 | fi | |
3632 | ||
4f3c5f06 VZ |
3633 | dnl check for fcntl() or at least flock() needed by Unix implementation of |
3634 | dnl wxSingleInstanceChecker | |
3635 | if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then | |
3636 | AC_CHECK_FUNCS(fcntl flock, break) | |
3637 | ||
3638 | if test "$ac_cv_func_fcntl" != "yes" -a "$ac_cv_func_flock" != "yes"; then | |
3639 | AC_MSG_WARN(wxSingleInstanceChecker not available) | |
3640 | wxUSE_SNGLINST_CHECKER=no | |
3641 | fi | |
3642 | fi | |
3643 | ||
270a909e VZ |
3644 | dnl check for timegm() used by datetime.cpp |
3645 | AC_CHECK_FUNCS(timegm) | |
3646 | ||
4f3c5f06 | 3647 | dnl look for a function to modify the environment |
8fd0d89b VZ |
3648 | AC_CHECK_FUNCS(putenv setenv, break) |
3649 | ||
b12915c1 VZ |
3650 | HAVE_SOME_SLEEP_FUNC=0 |
3651 | if test "$USE_BEOS" = 1; then | |
3652 | dnl BeOS has its own (wonder where did they get it from) sleep() function | |
3653 | dnl in unistd.h | |
3654 | AC_DEFINE(HAVE_SLEEP) | |
3655 | HAVE_SOME_SLEEP_FUNC=1 | |
3656 | fi | |
3657 | ||
f11bdd03 | 3658 | if test "$USE_DARWIN" = 1; then |
b2fee376 | 3659 | dnl Mac OS X/Darwin has both nanosleep and usleep |
b4085ce6 GD |
3660 | dnl but only usleep is defined in unistd.h |
3661 | AC_DEFINE(HAVE_USLEEP) | |
3662 | HAVE_SOME_SLEEP_FUNC=1 | |
3663 | fi | |
3664 | ||
b12915c1 VZ |
3665 | if test "$HAVE_SOME_SLEEP_FUNC" != 1; then |
3666 | dnl try nanosleep() in libc and libposix4, if this fails - usleep() | |
3667 | POSIX4_LINK= | |
3668 | AC_CHECK_FUNCS(nanosleep, | |
3669 | AC_DEFINE(HAVE_NANOSLEEP), | |
3670 | [ | |
3671 | AC_CHECK_LIB(posix4, nanosleep, | |
3672 | [ | |
3673 | AC_DEFINE(HAVE_NANOSLEEP) | |
3d63bc3a | 3674 | POSIX4_LINK=" -lposix4" |
b12915c1 VZ |
3675 | ], |
3676 | [ | |
b4085ce6 | 3677 | AC_CHECK_FUNCS(usleep, |
4f3c5f06 VZ |
3678 | AC_DEFINE(HAVE_USLEEP), |
3679 | AC_MSG_WARN([wxSleep() function will not work]) | |
3680 | ) | |
b12915c1 VZ |
3681 | ] |
3682 | ) | |
3683 | ] | |
3684 | ) | |
3685 | fi | |
9a98a854 VZ |
3686 | |
3687 | dnl check for uname (POSIX) and gethostname (BSD) | |
3688 | AC_CHECK_FUNCS(uname gethostname, break) | |
3689 | ||
6098c7f9 VZ |
3690 | dnl check for MT-safe version of strtok (on DEC Alpha, it's ok for C compiler |
3691 | dnl but not for C++ one - hence change language) | |
3692 | AC_LANG_SAVE | |
3693 | AC_LANG_CPLUSPLUS | |
3694 | ||
e90c1d2a VZ |
3695 | AC_CHECK_FUNCS(strtok_r) |
3696 | ||
6098c7f9 VZ |
3697 | AC_LANG_RESTORE |
3698 | ||
c63c7106 | 3699 | dnl check for inet_addr and inet_aton (these may live either in libc, or in |
c6712985 | 3700 | dnl libnsl or libresolv or libsocket) |
c63c7106 VZ |
3701 | INET_LINK= |
3702 | AC_CHECK_FUNCS(inet_addr, | |
3703 | AC_DEFINE(HAVE_INET_ADDR), | |
3704 | [ | |
3705 | AC_CHECK_LIB(nsl, inet_addr, | |
270a909e | 3706 | INET_LINK="nsl", |
c63c7106 | 3707 | AC_CHECK_LIB(resolv, inet_addr, |
c6712985 SN |
3708 | INET_LINK="resolv", |
3709 | AC_CHECK_LIB(socket, inet_addr, | |
3710 | INET_LINK="socket" | |
3711 | ) | |
c63c7106 VZ |
3712 | ) |
3713 | ) | |
3714 | ] | |
3715 | ) | |
3716 | ||
3717 | AC_CHECK_FUNCS(inet_aton, | |
3718 | AC_DEFINE(HAVE_INET_ATON), | |
3719 | [ | |
3720 | dnl only check it in the same lib | |
3721 | AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON)) | |
3722 | ]) | |
3723 | ||
3724 | if test "x$INET_LINK" != "x"; then | |
3725 | AC_DEFINE(HAVE_INET_ADDR) | |
3d63bc3a | 3726 | INET_LINK=" -l$INET_LINK" |
c63c7106 | 3727 | fi |
e96ac54e | 3728 | |
a0c79abb | 3729 | fi |
b089607b | 3730 | dnl if !MSW |
a0c79abb | 3731 | |
e6cc62c6 VS |
3732 | |
3733 | dnl ------------------------------------------ | |
3734 | dnl Checks specific to contrib libs (MMedia) | |
3735 | dnl ------------------------------------------ | |
3736 | ||
3737 | dnl Check for ESD: | |
3738 | ESD_LINK= | |
3739 | AC_CHECK_HEADER([esd.h], [ | |
3740 | AC_CHECK_LIB(esd, esd_close, [ | |
3741 | ESD_LINK="-lesd" | |
3742 | ]) | |
3743 | ]) | |
3744 | ||
3745 | ||
9a98a854 VZ |
3746 | dnl =========================================================================== |
3747 | dnl Now we have all the info we need - use it! | |
3748 | dnl =========================================================================== | |
3749 | ||
3750 | dnl flush the cache | |
3751 | AC_CACHE_SAVE | |
3752 | ||
3753 | dnl --------------------------------------------------------------------------- | |
a0b9e27f | 3754 | dnl thread support for Unix (for Win32 see past the next matching "else") |
9a98a854 VZ |
3755 | dnl --------------------------------------------------------------------------- |
3756 | ||
a0b9e27f | 3757 | dnl under MSW (except mingw32) we always have thread support |
009fead0 | 3758 | CPP_MT_FLAG= |
b089607b | 3759 | if test "$TOOLKIT" != "MSW"; then |
a9b5e89f | 3760 | |
7274f1c7 | 3761 | dnl the code below: |
009fead0 VZ |
3762 | dnl |
3763 | dnl defines THREADS_LINK and THREADS_CFLAGS which are the options | |
3764 | dnl necessary to build the MT programs for the linker and compiler | |
3765 | dnl respectively | |
3766 | dnl | |
3767 | dnl sets wxUSE_THREADS=1 if thread support is activated | |
7274f1c7 RL |
3768 | |
3769 | THREADS_LINK= | |
009fead0 | 3770 | THREADS_CFLAGS= |
7274f1c7 RL |
3771 | |
3772 | if test "$wxUSE_THREADS" = "yes" ; then | |
d1188635 | 3773 | if test "$USE_BEOS" = 1; then |
156b2523 | 3774 | AC_MSG_WARN([BeOS threads are not yet supported... disabled]) |
7274f1c7 RL |
3775 | wxUSE_THREADS="no" |
3776 | fi | |
77c85c2b | 3777 | fi |
39c9d5ac | 3778 | |
7274f1c7 RL |
3779 | if test "$wxUSE_THREADS" = "yes" ; then |
3780 | dnl find if POSIX threads are available | |
009fead0 VZ |
3781 | dnl |
3782 | dnl the tests here are based on ACX_PTHREAD macro from autoconf macro | |
3783 | dnl archive from http://ac-archive.sourceforge.net/ | |
3784 | dnl | |
3785 | dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro | |
3786 | dnl Forero Cuervo <bachue@bachue.com> for the original code | |
3787 | ||
3788 | dnl TODO: cache the result | |
3789 | ||
3790 | dnl define the list of the thread options to try in the loop below | |
3791 | dnl with the convention that anything starting with '-' is a cpp flag | |
3792 | dnl while anything else is a library (i.e. there is an implicit "-l") | |
3793 | THREAD_OPTS="-pthread" | |
3794 | case "${host}" in | |
3795 | *-*-solaris2* | *-*-sunos4* ) | |
3796 | if test "x$GCC" = "xyes"; then | |
126be6b4 VZ |
3797 | dnl Solaris/gcc combination use this one for some reason |
3798 | THREAD_OPTS="-pthreads $THREAD_OPTS" | |
009fead0 VZ |
3799 | else |
3800 | THREAD_OPTS="-mt $THREAD_OPTS" | |
3801 | fi | |
3802 | ;; | |
3803 | *-*-freebsd*) | |
3804 | dnl look, in order, for the kernel threads, then Linux threads | |
3805 | dnl and finally the userland threads | |
3806 | THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r" | |
3807 | ;; | |
17234b26 | 3808 | *-*-darwin* | *-*-cygwin* ) |
4101db81 | 3809 | dnl Darwin / Mac OS X just uses -lpthread tested below |
17234b26 | 3810 | dnl and so does Cygwin |
4101db81 GD |
3811 | THREAD_OPTS="" |
3812 | ;; | |
3813 | *-*-aix*) | |
009fead0 VZ |
3814 | dnl AIX calls the library libpthreads - thanks IBM! |
3815 | THREAD_OPTS="pthreads" | |
3816 | ;; | |
4f5a7f74 VZ |
3817 | *-hp-hpux* ) |
3818 | dnl HP-UX aCC only gives a warning, not an error about | |
3819 | dnl -pthread but it doesn't work and we have to use -lpthread | |
3820 | dnl there | |
3821 | if test "x$GCC" != "xyes"; then | |
3822 | THREAD_OPTS="" | |
3823 | fi | |
89e3b3e4 | 3824 | ;; |
260d6849 VZ |
3825 | |
3826 | *-*-irix* ) | |
3827 | dnl gcc under IRIX doesn't seem to like -pthread, but it | |
3828 | dnl doesn't give an error for it neither, just a warning | |
3829 | dnl message -- but this is still very annoying | |
3830 | if test "x$GCC" = "xyes"; then | |
3831 | THREAD_OPTS="" | |
3832 | fi | |
3833 | ;; | |
3834 | ||
3835 | *-*-*UnixWare*) | |
3836 | dnl flying by man pages here: Caldera online docs use this | |
3837 | if test "x$GCC" != "xyes"; then | |
3838 | THREAD_OPTS="-Ethread" | |
3839 | fi | |
3840 | ;; | |
009fead0 | 3841 | esac |
c596875e | 3842 | |
595e0e44 VZ |
3843 | dnl simply linking with libpthread should make the test below work but |
3844 | dnl it's far from certain that the threaded programs compiled without | |
3845 | dnl any special switches actually work, so try it after all the others | |
02a1dfba | 3846 | THREAD_OPTS="$THREAD_OPTS pthread none" |
595e0e44 | 3847 | |
009fead0 VZ |
3848 | dnl now test for all possibilities |
3849 | THREADS_OK=no | |
3850 | for flag in $THREAD_OPTS; do | |
3851 | case $flag in | |
3852 | none) | |
3853 | AC_MSG_CHECKING([whether pthreads work without any flags]) | |
3854 | ;; | |
f6bcfd97 | 3855 | |
009fead0 VZ |
3856 | -*) |
3857 | AC_MSG_CHECKING([whether pthreads work with $flag]) | |
3858 | THREADS_CFLAGS="$flag" | |
3859 | ;; | |
9a98a854 | 3860 | |
009fead0 VZ |
3861 | *) |
3862 | AC_MSG_CHECKING([for the pthreads library -l$flag]) | |
3863 | THREADS_LINK="-l$flag" | |
3864 | ;; | |
3865 | esac | |
3866 | ||
3867 | save_LIBS="$LIBS" | |
3868 | save_CFLAGS="$CFLAGS" | |
3869 | LIBS="$THREADS_LINK $LIBS" | |
04727afd | 3870 | CFLAGS="$THREADS_CFLAGS $CFLAGS" |
009fead0 VZ |
3871 | |
3872 | AC_TRY_LINK([#include <pthread.h>], | |
3873 | [pthread_create(0,0,0,0);], | |
3874 | THREADS_OK=yes) | |
3875 | ||
3876 | LIBS="$save_LIBS" | |
3877 | CFLAGS="$save_CFLAGS" | |
3878 | ||
3879 | AC_MSG_RESULT($THREADS_OK) | |
3880 | if test "x$THREADS_OK" = "xyes"; then | |
3881 | break; | |
3882 | fi | |
3883 | ||
3884 | THREADS_LINK="" | |
3885 | THREADS_CFLAGS="" | |
3886 | done | |
3887 | ||
3888 | if test "x$THREADS_OK" != "xyes"; then | |
3889 | wxUSE_THREADS=no | |
3890 | AC_MSG_WARN([No thread support on this system... disabled]) | |
3891 | else | |
fe5a9cab VZ |
3892 | dnl yes, these special compiler flags should be used with the |
3893 | dnl linker as well | |
db82f09e VZ |
3894 | LDFLAGS="$THREADS_CFLAGS $LDFLAGS" |
3895 | LIBS="$THREADS_LINK $LIBS" | |
fe5a9cab | 3896 | |
009fead0 VZ |
3897 | AC_MSG_CHECKING([if more special flags are required for pthreads]) |
3898 | flag=no | |
3899 | case "${host}" in | |
2b5f62a0 VZ |
3900 | *-aix*) |
3901 | dnl again quoting from | |
3902 | dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html: | |
3903 | dnl | |
3904 | dnl When compiling and linking with -pthread, the library | |
3905 | dnl search path should include -L/usr/lib/threads at the | |
3906 | dnl beginning of the path. | |
3907 | LDFLAGS="-L/usr/lib/threads $LDFLAGS" | |
3908 | flag="-D_THREAD_SAFE" | |
3909 | ;; | |
3910 | *-freebsd*) | |
009fead0 VZ |
3911 | flag="-D_THREAD_SAFE" |
3912 | ;; | |
06313569 GD |
3913 | *-hp-hpux* ) |
3914 | flag="-D_REENTRANT" | |
4f5a7f74 VZ |
3915 | if test "x$GCC" != "xyes"; then |
3916 | dnl see http://docs.hp.com/hpux/onlinedocs/2213/threads.htm | |
3917 | flag="$flag -D_RWSTD_MULTI_THREAD" | |
3918 | fi | |
06313569 | 3919 | ;; |
009fead0 VZ |
3920 | *solaris* | alpha*-osf*) |
3921 | flag="-D_REENTRANT" | |
3922 | ;; | |
3923 | esac | |
3924 | AC_MSG_RESULT(${flag}) | |
3925 | if test "x$flag" != xno; then | |
04727afd | 3926 | THREADS_CFLAGS="$THREADS_CFLAGS $flag" |
009fead0 VZ |
3927 | fi |
3928 | ||
009fead0 | 3929 | if test "x$THREADS_CFLAGS" != "x"; then |
fe5a9cab | 3930 | dnl don't add these options to CPPFLAGS as cpp might not know them |
009fead0 VZ |
3931 | CFLAGS="$CFLAGS $THREADS_CFLAGS" |
3932 | CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS" | |
3933 | fi | |
3934 | fi | |
aea02638 | 3935 | fi |
9a98a854 | 3936 | |
7274f1c7 RL |
3937 | dnl do other tests only if we are using threads |
3938 | if test "$wxUSE_THREADS" = "yes" ; then | |
3939 | AC_CHECK_FUNCS(thr_setconcurrency) | |
3940 | ||
7274f1c7 | 3941 | AC_CHECK_HEADERS(sched.h) |
009fead0 VZ |
3942 | if test "$ac_cv_header_sched_h" = "yes"; then |
3943 | AC_CHECK_FUNC(sched_yield, | |
3944 | AC_DEFINE(HAVE_SCHED_YIELD), | |
3945 | [ | |
3946 | AC_CHECK_LIB(posix4, | |
3947 | sched_yield, | |
3948 | [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"], | |
3949 | AC_MSG_WARN(wxThread::Yield will not work properly) | |
3950 | ) | |
3951 | ] | |
3952 | ) | |
3953 | fi | |
9a98a854 | 3954 | |
7274f1c7 RL |
3955 | dnl to be able to set the thread priority, we need to have all of the |
3956 | dnl following functions: | |
3957 | dnl 1. pthread_attr_getschedpolicy | |
3958 | dnl 2. sched_get_priority_min and sched_get_priority_max | |
3959 | dnl (this one can be in either libpthread or libposix4 (under Solaris)) | |
3960 | dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam | |
3961 | HAVE_PRIOR_FUNCS=0 | |
009fead0 | 3962 | AC_CHECK_FUNC(pthread_attr_getschedpolicy, |
ef33c576 VZ |
3963 | [AC_CHECK_FUNC(pthread_attr_setschedparam, |
3964 | [AC_CHECK_FUNC(sched_get_priority_max, | |
7274f1c7 | 3965 | HAVE_PRIOR_FUNCS=1, |
ef33c576 | 3966 | [AC_CHECK_LIB([posix4], sched_get_priority_max, |
7274f1c7 RL |
3967 | [ |
3968 | HAVE_PRIOR_FUNCS=1 | |
3969 | POSIX4_LINK=" -lposix4" | |
3970 | ], | |
ef33c576 VZ |
3971 | )] |
3972 | )] | |
3973 | )] | |
7274f1c7 | 3974 | ) |
f6bcfd97 | 3975 | |
7274f1c7 RL |
3976 | if test "$HAVE_PRIOR_FUNCS" = 1; then |
3977 | AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) | |
3978 | else | |
3979 | AC_MSG_WARN(Setting thread priority will not work) | |
3980 | fi | |
9a98a854 | 3981 | |
009fead0 VZ |
3982 | AC_CHECK_FUNC(pthread_cancel, |
3983 | AC_DEFINE(HAVE_PTHREAD_CANCEL), | |
3984 | AC_MSG_WARN([wxThread::Kill() will not work properly])) | |
9a98a854 | 3985 | |
7274f1c7 RL |
3986 | AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push, |
3987 | [ | |
3988 | AC_TRY_COMPILE([#include <pthread.h>], | |
3989 | [ | |
3990 | pthread_cleanup_push(NULL, NULL); | |
3991 | pthread_cleanup_pop(0); | |
3992 | ], [ | |
3993 | wx_cv_func_pthread_cleanup_push=yes | |
3994 | ], [ | |
3995 | wx_cv_func_pthread_cleanup_push=no | |
3996 | ]) | |
3997 | ]) | |
d9b9876f | 3998 | |
7274f1c7 RL |
3999 | if test "$wx_cv_func_pthread_cleanup_push" = "yes"; then |
4000 | AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS) | |
4001 | fi | |
ab252f7b | 4002 | |
7274f1c7 RL |
4003 | dnl mutexattr_t initialization is done in quite different ways on different |
4004 | dnl platforms, so check for a few things: | |
4005 | dnl | |
4006 | dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes | |
4007 | dnl HAVE_MUTEXATTR_SETTYPE means that we do it using | |
4008 | dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not | |
4009 | dnl defined, we do it by directly assigned | |
4010 | dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr | |
4011 | ||
7274f1c7 RL |
4012 | AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t, |
4013 | [ | |
d9b9876f VZ |
4014 | AC_TRY_COMPILE([#include <pthread.h>], |
4015 | [ | |
7274f1c7 RL |
4016 | pthread_mutexattr_t attr; |
4017 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); | |
d9b9876f | 4018 | ], [ |
7274f1c7 | 4019 | wx_cv_type_pthread_mutexattr_t=yes |
d9b9876f | 4020 | ], [ |
7274f1c7 | 4021 | wx_cv_type_pthread_mutexattr_t=no |
d9b9876f VZ |
4022 | ] |
4023 | ) | |
7274f1c7 | 4024 | ]) |
d9b9876f | 4025 | |
7274f1c7 RL |
4026 | if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then |
4027 | AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T) | |
4028 | else | |
4029 | dnl don't despair, there may be another way to do it | |
4030 | AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER], | |
4031 | wx_cv_type_pthread_rec_mutex_init, | |
4032 | [ | |
4033 | AC_TRY_COMPILE([#include <pthread.h>], | |
4034 | [ | |
4035 | pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; | |
4036 | ], [ | |
4037 | wx_cv_type_pthread_rec_mutex_init=yes | |
4038 | ], [ | |
4039 | wx_cv_type_pthread_rec_mutex_init=no | |
4040 | ] | |
4041 | ) | |
4042 | ]) | |
4043 | if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then | |
4044 | AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER) | |
4045 | else | |
4046 | dnl this may break code working elsewhere, so at least warn about it | |
4047 | AC_MSG_WARN([wxMutex won't be recursive on this platform]) | |
4048 | fi | |
4049 | fi | |
7274f1c7 | 4050 | fi |
9a98a854 | 4051 | |
b089607b | 4052 | dnl from if !MSW |
a0b9e27f MB |
4053 | else |
4054 | if test "$wxUSE_THREADS" = "yes" ; then | |
4055 | case "${host}" in | |
4056 | *-*-mingw32* ) | |
ca8e52b3 VZ |
4057 | dnl check if the compiler accepts -mthreads |
4058 | AC_CACHE_CHECK([if compiler supports -mthreads], | |
4059 | wx_cv_cflags_mthread, | |
4060 | [ | |
4061 | CFLAGS_OLD="$CFLAGS" | |
4062 | CFLAGS="$CFLAGS -mthreads" | |
4063 | AC_TRY_COMPILE([], [], | |
4064 | wx_cv_cflags_mthread=yes, | |
4065 | wx_cv_cflags_mthread=no | |
4066 | ) | |
4067 | ] | |
4068 | ) | |
4069 | ||
4070 | if test "$wx_cv_cflags_mthread" = "yes"; then | |
4071 | dnl it does, use it | |
4072 | CXXFLAGS="$CXXFLAGS -mthreads" | |
4073 | TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -mthreads" | |
4074 | LDFLAGS="$LDFLAGS -mthreads" | |
4075 | else | |
4076 | dnl it doesn't | |
4077 | CFLAGS="$CFLAGS_OLD" | |
4078 | fi | |
a0b9e27f MB |
4079 | ;; |
4080 | esac | |
4081 | fi | |
a9b5e89f VZ |
4082 | fi |
4083 | ||
4084 | if test "$wxUSE_THREADS" = "yes"; then | |
4085 | AC_DEFINE(wxUSE_THREADS) | |
4086 | ||
a9b5e89f | 4087 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread" |
d64af447 | 4088 | else |
b12915c1 | 4089 | dnl on some systems, _REENTRANT should be defined if we want to use any _r() |
d64af447 VZ |
4090 | dnl functions - add tests for other functions here as well |
4091 | if test "$ac_cv_func_strtok_r" = "yes"; then | |
ab9b9eab VZ |
4092 | AC_MSG_CHECKING(if -D_REENTRANT is needed) |
4093 | if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then | |
3a922bb4 | 4094 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D_REENTRANT" |
ab9b9eab VZ |
4095 | AC_MSG_RESULT(yes) |
4096 | else | |
4097 | AC_MSG_RESULT(no) | |
ee31c269 | 4098 | fi |
d64af447 | 4099 | fi |
a9b5e89f VZ |
4100 | fi |
4101 | ||
6f72b082 OK |
4102 | if test "$WXGTK20" = 1 ; then |
4103 | AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK20) | |
13111b2a VZ |
4104 | WXGTK12=1 |
4105 | fi | |
4106 | ||
9a98a854 VZ |
4107 | if test "$WXGTK12" = 1 ; then |
4108 | AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12) | |
4109 | fi | |
4110 | ||
f6bcfd97 BP |
4111 | if test "$WXGTK127" = 1 ; then |
4112 | AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127) | |
4113 | fi | |
4114 | ||
9a98a854 | 4115 | WXDEBUG= |
9a98a854 VZ |
4116 | |
4117 | if test "$wxUSE_DEBUG_INFO" = "yes" ; then | |
4118 | WXDEBUG="-g" | |
4119 | wxUSE_OPTIMISE=no | |
4120 | fi | |
4121 | ||
5586805b RR |
4122 | if test "$wxUSE_DEBUG_GDB" = "yes" ; then |
4123 | wxUSE_DEBUG_INFO=yes | |
4124 | WXDEBUG="-ggdb" | |
4125 | fi | |
4126 | ||
9a98a854 | 4127 | if test "$wxUSE_DEBUG_FLAG" = "yes" ; then |
77c85c2b RR |
4128 | AC_DEFINE(WXDEBUG) |
4129 | WXDEBUG_DEFINE="-D__WXDEBUG__" | |
9a98a854 | 4130 | else |
04338f96 RR |
4131 | if test "$wxUSE_GTK" = 1 ; then |
4132 | WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS" | |
4133 | fi | |
9a98a854 VZ |
4134 | fi |
4135 | ||
4136 | if test "$wxUSE_MEM_TRACING" = "yes" ; then | |
77c85c2b RR |
4137 | AC_DEFINE(wxUSE_MEMORY_TRACING) |
4138 | AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS) | |
47c13eb7 | 4139 | AC_DEFINE(wxUSE_DEBUG_NEW_ALWAYS) |
77c85c2b | 4140 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck" |
9a98a854 VZ |
4141 | fi |
4142 | ||
4143 | if test "$wxUSE_DMALLOC" = "yes" ; then | |
3d63bc3a | 4144 | DMALLOC_LIBS="-ldmalloc" |
9a98a854 VZ |
4145 | fi |
4146 | ||
4147 | PROFILE= | |
4148 | if test "$wxUSE_PROFILE" = "yes" ; then | |
3d63bc3a | 4149 | PROFILE=" -pg" |
9a98a854 VZ |
4150 | fi |
4151 | ||
009fead0 VZ |
4152 | CODE_GEN_FLAGS= |
4153 | CODE_GEN_FLAGS_CXX= | |
88e30f2b | 4154 | if test "$GCC" = "yes" ; then |
f7bdcdd7 | 4155 | if test "$wxUSE_NO_RTTI" = "yes" ; then |
3a922bb4 | 4156 | CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-rtti" |
f7bdcdd7 RR |
4157 | fi |
4158 | if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then | |
3a922bb4 | 4159 | CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-exceptions" |
f7bdcdd7 | 4160 | fi |
5586805b | 4161 | if test "$wxUSE_PERMISSIVE" = "yes" ; then |
d08b457b | 4162 | CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fpermissive" |
5586805b | 4163 | fi |
3a922bb4 RL |
4164 | if test "$USE_WIN32" = 1 ; then |
4165 | # I'm not even really sure what this was ever added to solve, | |
4166 | # but someone added it for mingw native builds, so I guess | |
4167 | # they had a reason, right?? | |
4168 | CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fno-pcc-struct-return" | |
5586805b | 4169 | fi |
1d1b75ac VZ |
4170 | |
4171 | dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before | |
4172 | dnl 3.0 overflow the table of contents on rs6000 as they create an entry | |
4173 | dnl for each subroutine by default -- using the switch below only creates | |
4174 | dnl one entry per file instead at the price of minor performance penalty | |
4175 | dnl | |
2b5f62a0 VZ |
4176 | dnl As of wx2.4 a bug in the hppa gcc compiler causes a similar problem |
4177 | dnl without -ffunction-sections. No idea how long we'll need to maintain | |
4178 | dnl this, or even the extent of gcc/wx version combinations affected, but | |
4179 | dnl also as above, this 'fix' does not come without side effects. | |
4180 | dnl | |
1d1b75ac VZ |
4181 | dnl TODO: test for the gcc version here (how?) |
4182 | case "${host}" in | |
4183 | powerpc*-*-aix* ) | |
4184 | CODE_GEN_FLAGS="$CODE_GEN_FLAGS -mminimal-toc" | |
4185 | ;; | |
2b5f62a0 VZ |
4186 | *-hppa* ) |
4187 | CODE_GEN_FLAGS="$CODE_GEN_FLAGS -ffunction-sections" | |
4188 | ;; | |
1d1b75ac | 4189 | esac |
c596875e RD |
4190 | fi |
4191 | ||
af7b5345 | 4192 | OPTIMISE= |
9a98a854 | 4193 | if test "$wxUSE_OPTIMISE" = "no" ; then |
af7b5345 VZ |
4194 | if test "$GCC" = yes ; then |
4195 | dnl use -O0 because compiling with it is faster than compiling with no | |
4196 | dnl optimization options at all (at least with g++ 3.2) | |
4197 | OPTIMISE="-O0" | |
4198 | fi | |
9a98a854 | 4199 | else |
77c85c2b | 4200 | if test "$GCC" = yes ; then |
04338f96 | 4201 | OPTIMISE="-O2" |
af7b5345 VZ |
4202 | |
4203 | dnl VZ: does anybody know what does this do?? | |
77c85c2b RR |
4204 | case "${host}" in |
4205 | i586-*-*|i686-*-* ) | |
4206 | OPTIMISE="${OPTIMISE} " | |
4207 | ;; | |
4208 | esac | |
4209 | else | |
4210 | OPTIMISE="-O" | |
4211 | fi | |
9a98a854 VZ |
4212 | fi |
4213 | ||
677eb52d VZ |
4214 | dnl --------------------------------------------------------------------------- |
4215 | dnl compatibility level | |
4216 | dnl --------------------------------------------------------------------------- | |
4217 | ||
54276ccf VZ |
4218 | if test "$WXWIN_COMPATIBILITY_2" = "yes"; then |
4219 | AC_DEFINE(WXWIN_COMPATIBILITY_2) | |
4220 | ||
4221 | WXWIN_COMPATIBILITY_2_2="yes" | |
4222 | fi | |
4223 | ||
65d8ef1e | 4224 | if test "x$WXWIN_COMPATIBILITY_2_2" = "xyes"; then |
54276ccf | 4225 | AC_DEFINE(WXWIN_COMPATIBILITY_2_2) |
677eb52d VZ |
4226 | |
4227 | WXWIN_COMPATIBILITY_2_4="yes" | |
54276ccf VZ |
4228 | fi |
4229 | ||
65d8ef1e VS |
4230 | if test "x$WXWIN_COMPATIBILITY_2_4" != "xno"; then |
4231 | AC_DEFINE(WXWIN_COMPATIBILITY_2_4) | |
4232 | fi | |
4233 | ||
9a98a854 VZ |
4234 | dnl --------------------------------------------------------------------------- |
4235 | dnl the library may be built without GUI classes at all | |
4236 | dnl --------------------------------------------------------------------------- | |
4237 | ||
4238 | if test "$wxUSE_GUI" = "yes"; then | |
4239 | AC_DEFINE(wxUSE_GUI) | |
4240 | ||
4241 | dnl the things we always pull in the GUI version of the library: | |
4242 | dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the | |
4243 | dnl library really can't be built without those) | |
4244 | dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in | |
4245 | dnl almost any program and the first 2 are needed to show a message box | |
4246 | dnl which want to be always able to do) | |
4247 | dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice | |
4248 | dnl to compile without them (if the app doesn't do any drawing, it doesn't | |
4249 | dnl need the dcs, pens, brushes, ...), this just can't be done now | |
4250 | dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem | |
4251 | dnl 5. misc stuff: timers, settings, message box | |
9a98a854 VZ |
4252 | else |
4253 | AC_DEFINE(wxUSE_NOGUI) | |
4254 | fi | |
4255 | ||
4256 | dnl --------------------------------------------------------------------------- | |
4257 | dnl Unix/Windows | |
4258 | dnl --------------------------------------------------------------------------- | |
4259 | ||
4260 | if test "$wxUSE_UNIX" = "yes"; then | |
4261 | AC_DEFINE(wxUSE_UNIX) | |
9a98a854 VZ |
4262 | fi |
4263 | ||
4264 | dnl --------------------------------------------------------------------------- | |
4265 | dnl Register non-GUI class options for makefiles and setup.h | |
4266 | dnl --------------------------------------------------------------------------- | |
4267 | ||
4268 | if test "$wxUSE_APPLE_IEEE" = "yes"; then | |
4269 | AC_DEFINE(wxUSE_APPLE_IEEE) | |
9a98a854 VZ |
4270 | fi |
4271 | ||
1e6feb95 VZ |
4272 | if test "$wxUSE_TIMER" = "yes"; then |
4273 | AC_DEFINE(wxUSE_TIMER) | |
4274 | fi | |
4275 | ||
2749089a KB |
4276 | if test "$wxUSE_WAVE" = "yes"; then |
4277 | AC_DEFINE(wxUSE_WAVE) | |
4278 | fi | |
4279 | ||
1e6feb95 VZ |
4280 | if test "$wxUSE_CMDLINE_PARSER" = "yes"; then |
4281 | AC_DEFINE(wxUSE_CMDLINE_PARSER) | |
4282 | fi | |
4283 | ||
4284 | if test "$wxUSE_STOPWATCH" = "yes"; then | |
4285 | AC_DEFINE(wxUSE_STOPWATCH) | |
4286 | fi | |
4287 | ||
4288 | if test "$wxUSE_DATETIME" = "yes"; then | |
4289 | AC_DEFINE(wxUSE_DATETIME) | |
4290 | fi | |
4291 | ||
9a98a854 VZ |
4292 | if test "$wxUSE_FILE" = "yes"; then |
4293 | AC_DEFINE(wxUSE_FILE) | |
9a98a854 VZ |
4294 | fi |
4295 | ||
1e6feb95 VZ |
4296 | if test "$wxUSE_FFILE" = "yes"; then |
4297 | AC_DEFINE(wxUSE_FFILE) | |
4298 | fi | |
4299 | ||
24528b0c VS |
4300 | if test "$wxUSE_FILESYSTEM" = "yes"; then |
4301 | AC_DEFINE(wxUSE_FILESYSTEM) | |
4302 | fi | |
4303 | ||
e3e717ec VZ |
4304 | if test "$wxUSE_FS_INET" = "yes"; then |
4305 | AC_DEFINE(wxUSE_FS_INET) | |
4306 | fi | |
4307 | ||
4308 | if test "$wxUSE_FS_ZIP" = "yes"; then | |
4309 | AC_DEFINE(wxUSE_FS_ZIP) | |
4310 | fi | |
4311 | ||
d78b3d64 VS |
4312 | if test "$wxUSE_ZIPSTREAM" = "yes"; then |
4313 | AC_DEFINE(wxUSE_ZIPSTREAM) | |
4314 | fi | |
4315 | ||
eb4efbdc VZ |
4316 | if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then |
4317 | AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION) | |
4318 | fi | |
4319 | ||
4f3c5f06 VZ |
4320 | if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then |
4321 | AC_DEFINE(wxUSE_SNGLINST_CHECKER) | |
4322 | fi | |
4323 | ||
d78b3d64 VS |
4324 | if test "$wxUSE_BUSYINFO" = "yes"; then |
4325 | AC_DEFINE(wxUSE_BUSYINFO) | |
4326 | fi | |
4327 | ||
fd15d8f1 RR |
4328 | if test "$wxUSE_STD_IOSTREAM" = "yes"; then |
4329 | AC_DEFINE(wxUSE_STD_IOSTREAM) | |
4330 | fi | |
4331 | ||
a3a584a7 VZ |
4332 | if test "$wxUSE_TEXTBUFFER" = "yes"; then |
4333 | AC_DEFINE(wxUSE_TEXTBUFFER) | |
4334 | fi | |
4335 | ||
9a98a854 | 4336 | if test "$wxUSE_TEXTFILE" = "yes"; then |
a3a584a7 | 4337 | if test "$wxUSE_FILE" != "yes" -o "$wxUSE_TEXTBUFFER" != "yes" ; then |
156b2523 | 4338 | AC_MSG_WARN(wxTextFile requires wxFile and wxTextBuffer... disabled) |
9a98a854 VZ |
4339 | else |
4340 | AC_DEFINE(wxUSE_TEXTFILE) | |
9a98a854 VZ |
4341 | fi |
4342 | fi | |
4343 | ||
4344 | if test "$wxUSE_CONFIG" = "yes" ; then | |
4345 | if test "$wxUSE_TEXTFILE" != "yes"; then | |
156b2523 | 4346 | AC_MSG_WARN(wxConfig requires wxTextFile... disabled) |
9a98a854 VZ |
4347 | else |
4348 | AC_DEFINE(wxUSE_CONFIG) | |
9a98a854 VZ |
4349 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config" |
4350 | fi | |
4351 | fi | |
4352 | ||
4353 | if test "$wxUSE_INTL" = "yes" ; then | |
4354 | if test "$wxUSE_FILE" != "yes"; then | |
156b2523 | 4355 | AC_MSG_WARN(I18n code requires wxFile... disabled) |
9a98a854 VZ |
4356 | else |
4357 | AC_DEFINE(wxUSE_INTL) | |
9a98a854 | 4358 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat" |
f6bcfd97 | 4359 | GUIDIST="$GUIDIST INTL_DIST" |
9a98a854 VZ |
4360 | fi |
4361 | fi | |
4362 | ||
4363 | if test "$wxUSE_LOG" = "yes"; then | |
4364 | AC_DEFINE(wxUSE_LOG) | |
d73be714 VZ |
4365 | |
4366 | if test "$wxUSE_LOGGUI" = "yes"; then | |
4367 | AC_DEFINE(wxUSE_LOGGUI) | |
4368 | fi | |
4369 | ||
4370 | if test "$wxUSE_LOGWINDOW" = "yes"; then | |
4371 | AC_DEFINE(wxUSE_LOGWINDOW) | |
4372 | fi | |
69d27ff7 MB |
4373 | |
4374 | if test "$wxUSE_LOGDIALOG" = "yes"; then | |
4375 | AC_DEFINE(wxUSE_LOG_DIALOG) | |
4376 | fi | |
9a98a854 VZ |
4377 | fi |
4378 | ||
4379 | if test "$wxUSE_LONGLONG" = "yes"; then | |
4380 | AC_DEFINE(wxUSE_LONGLONG) | |
9a98a854 VZ |
4381 | fi |
4382 | ||
e8f65ba6 RR |
4383 | if test "$wxUSE_GEOMETRY" = "yes"; then |
4384 | AC_DEFINE(wxUSE_GEOMETRY) | |
4385 | fi | |
4386 | ||
1c8515f9 KB |
4387 | if test "$wxUSE_DIALUP_MANAGER" = "yes" ; then |
4388 | AC_DEFINE(wxUSE_DIALUP_MANAGER) | |
70f7a477 | 4389 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup" |
1c8515f9 KB |
4390 | fi |
4391 | ||
9a98a854 VZ |
4392 | if test "$wxUSE_STREAMS" = "yes" ; then |
4393 | AC_DEFINE(wxUSE_STREAMS) | |
9a98a854 VZ |
4394 | fi |
4395 | ||
52e8b690 | 4396 | dnl --------------------------------------------------------------------------- |
afc31813 VZ |
4397 | dnl time/date functions |
4398 | dnl ------------------------------------------------------------------------ | |
4399 | ||
1e6feb95 | 4400 | if test "$wxUSE_DATETIME" = "yes"; then |
83307f33 VZ |
4401 | dnl check for strptime |
4402 | AC_CHECK_FUNCS(strptime) | |
4403 | ||
360d6699 | 4404 | dnl check for timezone variable |
62cc730f | 4405 | dnl doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead |
360d6699 VZ |
4406 | AC_CACHE_CHECK(for timezone variable in <time.h>, |
4407 | wx_cv_var_timezone, | |
4408 | [ | |
4409 | AC_TRY_COMPILE( | |
4410 | [ | |
4411 | #include <time.h> | |
4412 | ], | |
4413 | [ | |
4414 | int tz; | |
4f11a343 | 4415 | tz = timezone; |
360d6699 VZ |
4416 | ], |
4417 | [ | |
4f11a343 | 4418 | wx_cv_var_timezone=timezone |
360d6699 VZ |
4419 | ], |
4420 | [ | |
4421 | AC_TRY_COMPILE( | |
4422 | [ | |
4423 | #include <time.h> | |
4424 | ], | |
4425 | [ | |
4426 | int tz; | |
4427 | tz = _timezone; | |
4428 | ], | |
4429 | [ | |
4430 | wx_cv_var_timezone=_timezone | |
4431 | ], | |
5357c8e8 VZ |
4432 | [ |
4433 | AC_TRY_COMPILE( | |
4434 | [ | |
4435 | #include <time.h> | |
4436 | ], | |
4437 | [ | |
4438 | int tz; | |
4f11a343 | 4439 | tz = __timezone; |
5357c8e8 VZ |
4440 | ], |
4441 | [ | |
4f11a343 | 4442 | wx_cv_var_timezone=__timezone |
5357c8e8 | 4443 | ], |
f9bc1684 VS |
4444 | [ |
4445 | if test "$USE_DOS" = 0 ; then | |
62cc730f | 4446 | AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead) |
f9bc1684 VS |
4447 | fi |
4448 | ] | |
5357c8e8 VZ |
4449 | ) |
4450 | ] | |
360d6699 VZ |
4451 | ) |
4452 | ] | |
4453 | ) | |
4454 | ] | |
4455 | ) | |
4456 | ||
4457 | dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED | |
f9bc1684 VS |
4458 | if test "x$wx_cv_var_timezone" != x ; then |
4459 | AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone) | |
4460 | fi | |
360d6699 | 4461 | |
3fcdd07b VZ |
4462 | dnl check for localtime (it's POSIX, but the check can do no harm...) |
4463 | AC_CHECK_FUNCS(localtime) | |
afc31813 | 4464 | |
0470b1e6 VZ |
4465 | if test "$ac_cv_func_localtime" = "yes"; then |
4466 | AC_CACHE_CHECK(for tm_gmtoff in struct tm, | |
4467 | wx_cv_struct_tm_has_gmtoff, | |
4468 | [ | |
4469 | AC_TRY_COMPILE( | |
4470 | [ | |
4471 | #include <time.h> | |
4472 | ], | |
4473 | [ | |
4474 | struct tm tm; | |
4475 | tm.tm_gmtoff++; | |
4476 | ], | |
4477 | [ | |
f03a98d8 | 4478 | wx_cv_struct_tm_has_gmtoff=yes |
0470b1e6 VZ |
4479 | ], |
4480 | wx_cv_struct_tm_has_gmtoff=no | |
4481 | ) | |
4482 | ]) | |
3fcdd07b VZ |
4483 | fi |
4484 | ||
6232543b VS |
4485 | if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then |
4486 | AC_DEFINE(WX_GMTOFF_IN_TM) | |
4487 | fi | |
4488 | ||
3fcdd07b VZ |
4489 | dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the |
4490 | dnl function to be used for high resolution timers | |
4491 | AC_CHECK_FUNCS(gettimeofday ftime, break) | |
4492 | ||
4493 | if test "$ac_cv_func_gettimeofday" = "yes"; then | |
afc31813 VZ |
4494 | AC_CACHE_CHECK([whether gettimeofday takes two arguments], |
4495 | wx_cv_func_gettimeofday_has_2_args, | |
4496 | [ | |
4497 | dnl on some _really_ old systems it takes only 1 argument | |
4498 | AC_LANG_SAVE | |
4499 | AC_LANG_CPLUSPLUS | |
4500 | ||
4501 | AC_TRY_COMPILE( | |
4502 | [ | |
4503 | #include <sys/time.h> | |
4504 | #include <unistd.h> | |
4505 | ], | |
4506 | [ | |
4507 | struct timeval tv; | |
776862b4 | 4508 | gettimeofday(&tv, NULL); |
afc31813 VZ |
4509 | ], |
4510 | wx_cv_func_gettimeofday_has_2_args=yes, | |
4511 | AC_TRY_COMPILE( | |
4512 | [ | |
4513 | #include <sys/time.h> | |
4514 | #include <unistd.h> | |
4515 | ], | |
4516 | [ | |
4517 | struct timeval tv; | |
4518 | gettimeofday(&tv); | |
4519 | ], | |
4520 | wx_cv_func_gettimeofday_has_2_args=no, | |
776862b4 VZ |
4521 | [ |
4522 | AC_MSG_WARN([failed to determine number of gettimeofday() arguments]) | |
4523 | wx_cv_func_gettimeofday_has_2_args=unknown | |
4524 | ] | |
afc31813 VZ |
4525 | ) |
4526 | ) | |
4527 | AC_LANG_RESTORE | |
4528 | ]) | |
4529 | ||
4530 | if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then | |
4531 | AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ) | |
4532 | fi | |
4533 | fi | |
4534 | ||
afc31813 VZ |
4535 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest" |
4536 | fi | |
4537 | ||
9a98a854 VZ |
4538 | dnl ------------------------------------------------------------------------ |
4539 | dnl wxSocket | |
4540 | dnl ------------------------------------------------------------------------ | |
4541 | ||
3bce6687 | 4542 | dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxMGL |
0feee163 | 4543 | if test "$wxUSE_SOCKETS" = "yes"; then |
6c657b52 VS |
4544 | if test "$wxUSE_MGL" = "1"; then |
4545 | AC_MSG_WARN([wxSocket not yet supported under MGL... disabled]) | |
4546 | wxUSE_SOCKETS="no" | |
4547 | fi | |
0feee163 | 4548 | fi |
b089607b | 4549 | |
0feee163 VZ |
4550 | if test "$wxUSE_SOCKETS" = "yes"; then |
4551 | dnl under MSW we always have sockets | |
4552 | if test "$TOOLKIT" != "MSW"; then | |
590b1a4d | 4553 | dnl under Solaris and OS/2, socket functions live in -lsocket |
3a922bb4 RL |
4554 | AC_CHECK_FUNC(socket,, |
4555 | AC_CHECK_LIB(socket, socket, | |
590b1a4d | 4556 | if test "$INET_LINK" != " -lsocket"; then |
e5ee4c90 SN |
4557 | INET_LINK="$INET_LINK -lsocket" |
4558 | fi, | |
3a922bb4 RL |
4559 | [ |
4560 | AC_MSG_WARN([socket library not found - sockets will be disabled]) | |
4561 | wxUSE_SOCKETS=no | |
4562 | ] | |
4563 | ) | |
afc31813 | 4564 | ) |
3a922bb4 | 4565 | fi |
0feee163 | 4566 | fi |
afc31813 | 4567 | |
0feee163 | 4568 | if test "$wxUSE_SOCKETS" = "yes" ; then |
3a922bb4 RL |
4569 | dnl this test may be appropriate if building under cygwin |
4570 | dnl right now I'm assuming it also uses the winsock stuff | |
4571 | dnl like mingw does.. -- RL | |
0feee163 | 4572 | if test "$TOOLKIT" != "MSW"; then |
3a922bb4 RL |
4573 | dnl determine the type of third argument for getsockname |
4574 | AC_CACHE_CHECK([what is the type of the third argument of getsockname], | |
4575 | wx_cv_type_getsockname3, | |
4576 | [ | |
51a9faba VZ |
4577 | AC_TRY_COMPILE( |
4578 | [ | |
4370c5b2 | 4579 | #include <sys/types.h> |
51a9faba VZ |
4580 | #include <sys/socket.h> |
4581 | ], | |
4582 | [ | |
3a922bb4 | 4583 | socklen_t len; |
51a9faba VZ |
4584 | getsockname(0, 0, &len); |
4585 | ], | |
3a922bb4 | 4586 | wx_cv_type_getsockname3=socklen_t, |
210c92a3 VZ |
4587 | [ |
4588 | dnl the compiler will compile the version with size_t | |
4589 | dnl even if the real type of the last parameter is int | |
4590 | dnl but it should give at least a warning about | |
4591 | dnl converting between incompatible pointer types, so | |
4592 | dnl try to use it to get the correct behaviour at | |
4593 | dnl least with gcc (otherwise we'd always use size_t) | |
4594 | CFLAGS_OLD="$CFLAGS" | |
4595 | if test "$GCC" = yes ; then | |
4596 | CFLAGS="$CFLAGS -Werror" | |
4597 | fi | |
4598 | ||
3a922bb4 RL |
4599 | AC_TRY_COMPILE( |
4600 | [ | |
4601 | #include <sys/types.h> | |
4602 | #include <sys/socket.h> | |
4603 | ], | |
4604 | [ | |
210c92a3 | 4605 | size_t len; |
3a922bb4 RL |
4606 | getsockname(0, 0, &len); |
4607 | ], | |
210c92a3 VZ |
4608 | wx_cv_type_getsockname3=size_t, |
4609 | AC_TRY_COMPILE( | |
4610 | [ | |
4611 | #include <sys/types.h> | |
4612 | #include <sys/socket.h> | |
4613 | ], | |
4614 | [ | |
4615 | int len; | |
4616 | getsockname(0, 0, &len); | |
4617 | ], | |
4618 | wx_cv_type_getsockname3=int, | |
4619 | wx_cv_type_getsockname3=unknown | |
4620 | ) | |
3a922bb4 | 4621 | ) |
c63c7106 | 4622 | |
210c92a3 VZ |
4623 | CFLAGS="$CFLAGS_OLD" |
4624 | ] | |
4625 | ) | |
3a922bb4 | 4626 | ]) |
51a9faba | 4627 | |
3a922bb4 RL |
4628 | if test "$wx_cv_type_getsockname3" = "unknown"; then |
4629 | wxUSE_SOCKETS=no | |
4630 | AC_MSG_WARN([Couldn't find socklen_t synonym for this system]) | |
4631 | else | |
4632 | AC_DEFINE_UNQUOTED(SOCKLEN_T, $wx_cv_type_getsockname3) | |
4633 | fi | |
51a9faba VZ |
4634 | fi |
4635 | fi | |
c521c494 | 4636 | |
51a9faba | 4637 | if test "$wxUSE_SOCKETS" = "yes" ; then |
afc31813 | 4638 | AC_DEFINE(wxUSE_SOCKETS) |
70f7a477 | 4639 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets" |
9a98a854 VZ |
4640 | fi |
4641 | ||
4642 | dnl --------------------------------------------------------------------------- | |
4643 | dnl Joystick support | |
4644 | dnl --------------------------------------------------------------------------- | |
4645 | ||
dc3d889d VZ |
4646 | if test "$wxUSE_GUI" = "yes"; then |
4647 | ||
ac0c4cc3 | 4648 | if test "$TOOLKIT" = "MAC" -o "$TOOLKIT" = "COCOA"; then |
156b2523 GD |
4649 | AC_MSG_WARN([Joystick not yet supported under Mac OS X... disabled]) |
4650 | wxUSE_JOYSTICK=no | |
4651 | fi | |
4652 | if test "$TOOLKIT" = "MOTIF"; then | |
4653 | AC_MSG_WARN([Joystick not yet supported under Motif... disabled]) | |
4654 | wxUSE_JOYSTICK=no | |
4655 | fi | |
7f5c07ab JS |
4656 | if test "$TOOLKIT" = "X11"; then |
4657 | AC_MSG_WARN([Joystick not yet supported under X11... disabled]) | |
4658 | wxUSE_JOYSTICK=no | |
4659 | fi | |
156b2523 | 4660 | |
3a922bb4 RL |
4661 | dnl under MSW we always have joystick support |
4662 | if test "$TOOLKIT" != "MSW"; then | |
4663 | if test "$wxUSE_JOYSTICK" = "yes"; then | |
4664 | dnl joystick support is only for Linux 2.1.x or greater | |
4665 | AC_CHECK_HEADERS(linux/joystick.h) | |
4666 | if test "$ac_cv_header_linux_joystick_h" != "yes"; then | |
4667 | wxUSE_JOYSTICK=no | |
156b2523 | 4668 | AC_MSG_WARN(Joystick not supported by this system... disabled) |
3a922bb4 RL |
4669 | fi |
4670 | fi | |
4671 | fi | |
9a98a854 | 4672 | |
3a922bb4 RL |
4673 | if test "$wxUSE_JOYSTICK" = "yes"; then |
4674 | AC_DEFINE(wxUSE_JOYSTICK) | |
4675 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest" | |
4676 | fi | |
dc3d889d | 4677 | fi |
dc3d889d | 4678 | |
9a98a854 VZ |
4679 | dnl ------------------------------------------------------------------------ |
4680 | dnl DLL support | |
4681 | dnl ------------------------------------------------------------------------ | |
4682 | ||
b089607b VZ |
4683 | dnl under MSW we always have LoadLibrary/GetProcAddress |
4684 | if test "$TOOLKIT" != "MSW"; then | |
4685 | ||
3a922bb4 RL |
4686 | HAVE_DL_FUNCS=0 |
4687 | HAVE_SHL_FUNCS=0 | |
0b9ab0bd | 4688 | if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then |
3a922bb4 RL |
4689 | if test "$USE_DARWIN" = 1; then |
4690 | dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X | |
37667812 | 4691 | HAVE_DL_FUNCS=1 |
3a922bb4 RL |
4692 | else |
4693 | dnl the test is a bit complicated because we check for dlopen() both with | |
4694 | dnl and without -ldl and we also try to find shl_load() if there is no | |
4695 | dnl dlopen() on this system | |
4696 | AC_CHECK_FUNCS(dlopen, | |
4697 | [ | |
4698 | AC_DEFINE(HAVE_DLOPEN) | |
4699 | HAVE_DL_FUNCS=1 | |
4700 | ], | |
4701 | [ | |
4702 | AC_CHECK_LIB(dl, dlopen, | |
4703 | [ | |
4704 | AC_DEFINE(HAVE_DLOPEN) | |
4705 | HAVE_DL_FUNCS=1 | |
3d63bc3a | 4706 | DL_LINK=" -ldl$DL_LINK" |
3a922bb4 RL |
4707 | ], |
4708 | [ | |
4709 | AC_CHECK_FUNCS(shl_load, | |
4710 | [ | |
4711 | AC_DEFINE(HAVE_SHL_LOAD) | |
4712 | HAVE_SHL_FUNCS=1 | |
4713 | ], | |
4714 | [ | |
4715 | AC_CHECK_LIB(shl_load, dld, | |
4716 | [ | |
4717 | HAVE_SHL_FUNCS=1 | |
3d63bc3a | 4718 | DL_LINK=" -ldld$DL_LINK" |
3a922bb4 RL |
4719 | ]) |
4720 | ]) | |
4721 | ]) | |
4722 | ]) | |
9a98a854 | 4723 | |
3a922bb4 RL |
4724 | dnl check also for dlerror() |
4725 | if test "$HAVE_DL_FUNCS" = 1; then | |
4726 | AC_CHECK_FUNCS(dlerror, | |
4727 | AC_DEFINE(HAVE_DLERROR), | |
4728 | AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))) | |
4729 | fi | |
4730 | fi | |
f6bcfd97 | 4731 | |
3a922bb4 RL |
4732 | if test "$HAVE_DL_FUNCS" = 0; then |
4733 | if test "$HAVE_SHL_FUNCS" = 0; then | |
4734 | if test "$USE_UNIX" = 1; then | |
4735 | AC_MSG_WARN([Missing dynamic loading support, several features will be disabled]) | |
0b9ab0bd | 4736 | wxUSE_DYNAMIC_LOADER=no |
3a922bb4 RL |
4737 | wxUSE_DYNLIB_CLASS=no |
4738 | else | |
4739 | AC_MSG_WARN([Assuming wxLibrary class works on this platform]) | |
4740 | fi | |
4741 | fi | |
e90c1d2a | 4742 | fi |
9a98a854 VZ |
4743 | fi |
4744 | fi | |
4745 | ||
0b9ab0bd RL |
4746 | if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then |
4747 | AC_DEFINE(wxUSE_DYNAMIC_LOADER) | |
4748 | elif test "$wxUSE_DYNLIB_CLASS" = "yes" ; then | |
b12915c1 | 4749 | AC_DEFINE(wxUSE_DYNLIB_CLASS) |
9a98a854 VZ |
4750 | fi |
4751 | ||
4752 | dnl --------------------------------------------------------------------------- | |
ced859c3 | 4753 | dnl String stuff |
9a98a854 VZ |
4754 | dnl --------------------------------------------------------------------------- |
4755 | ||
1e6feb95 VZ |
4756 | if test "$wxUSE_FONTMAP" = "yes" ; then |
4757 | AC_DEFINE(wxUSE_FONTMAP) | |
4758 | fi | |
4759 | ||
9a98a854 VZ |
4760 | if test "$wxUSE_UNICODE" = "yes" ; then |
4761 | AC_DEFINE(wxUSE_UNICODE) | |
3bd8fb5f | 4762 | |
bbc3925a VS |
4763 | if test "$wxUSE_MSW" != 1; then |
4764 | wxUSE_UNICODE_MSLU=no | |
4765 | fi | |
a72a4bfa VS |
4766 | |
4767 | if test "$wxUSE_MSW" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then | |
4768 | AC_CHECK_LIB(unicows,main, | |
4769 | [ | |
4770 | AC_DEFINE(wxUSE_UNICODE_MSLU) | |
4771 | ], | |
4772 | [ | |
4773 | AC_MSG_WARN([Compiler doesn't support MSLU (libunicows.a), disabled. | |
4774 | Applications will only run on Windows NT/2000/XP!]) | |
4775 | wxUSE_UNICODE_MSLU=no | |
4776 | ]) | |
4777 | fi | |
9a98a854 VZ |
4778 | fi |
4779 | ||
ced859c3 VZ |
4780 | if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then |
4781 | AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF) | |
4782 | fi | |
4783 | ||
9a98a854 VZ |
4784 | dnl ---------------------------------------------------------------- |
4785 | dnl Register PostScript options for makefiles and setup.h | |
4786 | dnl ---------------------------------------------------------------- | |
4787 | ||
4788 | if test "$wxUSE_POSTSCRIPT" = "yes" ; then | |
4789 | AC_DEFINE(wxUSE_POSTSCRIPT) | |
9a98a854 VZ |
4790 | fi |
4791 | ||
4792 | AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT) | |
4793 | ||
4794 | AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS) | |
4795 | ||
4796 | dnl --------------------------------------------------------------------------- | |
4797 | dnl big GUI components: MDI, doc/view, printing, help, ... | |
4798 | dnl --------------------------------------------------------------------------- | |
4799 | ||
4800 | if test "$wxUSE_CONSTRAINTS" = "yes"; then | |
ce4169a4 RR |
4801 | AC_DEFINE(wxUSE_CONSTRAINTS) |
4802 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout" | |
9a98a854 VZ |
4803 | fi |
4804 | ||
4805 | if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then | |
fc26f4ab | 4806 | |
e26c13cf | 4807 | dnl There is now experimental generic MDI support |
b9f933ab JS |
4808 | dnl if test "$wxUSE_UNIVERSAL" = "yes"; then |
4809 | dnl AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled) | |
4810 | dnl wxUSE_MDI_ARCHITECTURE=no | |
4811 | dnl fi | |
4812 | ||
4813 | if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then | |
4814 | AC_DEFINE(wxUSE_MDI_ARCHITECTURE) | |
4815 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi" | |
4816 | fi | |
9a98a854 VZ |
4817 | fi |
4818 | ||
4819 | if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then | |
ce4169a4 RR |
4820 | AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE) |
4821 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview" | |
4822 | if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then | |
4823 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi" | |
4824 | fi | |
9a98a854 VZ |
4825 | fi |
4826 | ||
4827 | if test "$wxUSE_HELP" = "yes"; then | |
ce4169a4 RR |
4828 | AC_DEFINE(wxUSE_HELP) |
4829 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help" | |
3379ed37 | 4830 | |
77e13408 | 4831 | if test "$wxUSE_MSW" = 1; then |
031d8228 | 4832 | if test "$wxUSE_MS_HTML_HELP" = "yes"; then |
3b7bc64a | 4833 | AC_DEFINE(wxUSE_MS_HTML_HELP) |
29fd3c0c | 4834 | fi |
3379ed37 | 4835 | fi |
031d8228 VS |
4836 | |
4837 | if test "$wxUSE_WXHTML_HELP" = "yes"; then | |
4838 | if test "$wxUSE_HTML" = "yes"; then | |
4839 | AC_DEFINE(wxUSE_WXHTML_HELP) | |
4840 | else | |
4841 | AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled) | |
4842 | wxUSE_WXHTML_HELP=no | |
4843 | fi | |
4844 | fi | |
9a98a854 VZ |
4845 | fi |
4846 | ||
4847 | if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then | |
ce4169a4 RR |
4848 | if test "$wxUSE_CONSTRAINTS" != "yes"; then |
4849 | AC_MSG_WARN(Printing support cannot be used without constraints so it won't be compiled without it) | |
4850 | else | |
4851 | AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE) | |
4852 | fi | |
4853 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing" | |
9a98a854 VZ |
4854 | fi |
4855 | ||
fd3d7534 | 4856 | if test "$wxUSE_PROLOGIO" = "yes" -o "$wxUSE_RESOURCES" = "yes"; then |
1b86c3ac VZ |
4857 | AC_MSG_ERROR([wxExpr and old-style resources are now available in contrib only]) |
4858 | fi | |
9a98a854 | 4859 | |
9a98a854 | 4860 | dnl --------------------------------------------------------------------------- |
77c85c2b | 4861 | dnl IPC: IPC, Drag'n'Drop, Clipboard, ... |
9a98a854 VZ |
4862 | dnl --------------------------------------------------------------------------- |
4863 | ||
2b9bdf71 VZ |
4864 | dnl check for ole headers and disable a few features requiring it if not |
4865 | dnl present (earlier versions of mingw32 don't have ole2.h) | |
77e13408 RL |
4866 | if test "$wxUSE_MSW" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \ |
4867 | -o "$wxUSE_CLIPBOARD" = "yes" \ | |
3bce6687 | 4868 | -o "$wxUSE_OLE" = "yes" \ |
77e13408 | 4869 | -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then |
2b9bdf71 VZ |
4870 | AC_CHECK_HEADERS(ole2.h) |
4871 | ||
4872 | if test "$ac_cv_header_ole2_h" = "yes" ; then | |
4873 | if test "$GCC" = yes ; then | |
8284b0c5 MB |
4874 | AC_LANG_SAVE |
4875 | AC_LANG_CPLUSPLUS | |
4876 | ||
4877 | AC_MSG_CHECKING([if g++ requires -fvtable-thunks]) | |
4878 | AC_TRY_COMPILE([#include <windows.h> | |
4879 | #include <ole2.h>], | |
4880 | [], | |
4881 | [AC_MSG_RESULT(no)], | |
4882 | [AC_MSG_RESULT(yes) | |
4883 | CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fvtable-thunks"]) | |
4884 | AC_LANG_RESTORE | |
2b9bdf71 | 4885 | ALL_OBJECTS="$ALL_OBJECTS \$(OLEOBJS)" |
3d63bc3a | 4886 | LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS" |
2b9bdf71 VZ |
4887 | AC_DEFINE(wxUSE_OLE) |
4888 | ||
4889 | fi | |
4890 | ||
4891 | dnl for OLE clipboard and dnd | |
4892 | AC_DEFINE(wxUSE_DATAOBJ) | |
4893 | else | |
4894 | AC_MSG_WARN([Some features disabled because OLE headers not found]) | |
4895 | ||
4896 | wxUSE_CLIPBOARD=no | |
4897 | wxUSE_DRAG_AND_DROP=no | |
4898 | wxUSE_DATAOBJ=no | |
3bce6687 JS |
4899 | wxUSE_OLE=no |
4900 | fi | |
4901 | ||
4902 | if test "$wxUSE_METAFILE" = "yes"; then | |
4903 | AC_DEFINE(wxUSE_METAFILE) | |
4904 | ||
4905 | dnl this one should probably be made separately configurable | |
4906 | AC_DEFINE(wxUSE_ENH_METAFILE) | |
4907 | fi | |
4908 | fi | |
4909 | ||
9a98a854 | 4910 | if test "$wxUSE_IPC" = "yes"; then |
eb4efbdc | 4911 | if test "$wxUSE_SOCKETS" != "yes"; then |
156b2523 | 4912 | AC_MSG_WARN(wxWindows IPC classes require sockets... disabled) |
eb4efbdc VZ |
4913 | fi |
4914 | ||
ce4169a4 | 4915 | AC_DEFINE(wxUSE_IPC) |
9a98a854 VZ |
4916 | fi |
4917 | ||
4918 | if test "$wxUSE_CLIPBOARD" = "yes"; then | |
6c657b52 VS |
4919 | if test "$wxUSE_MGL" = 1; then |
4920 | AC_MSG_WARN([Clipboard not yet supported under MGL... disabled]) | |
4921 | wxUSE_CLIPBOARD=no | |
4922 | fi | |
178572bb | 4923 | |
6c657b52 VS |
4924 | if test "$wxUSE_CLIPBOARD" = "yes"; then |
4925 | AC_DEFINE(wxUSE_CLIPBOARD) | |
4926 | ||
4927 | dnl required by clipboard code in configuration check | |
4928 | AC_DEFINE(wxUSE_DATAOBJ) | |
4929 | fi | |
9a98a854 VZ |
4930 | fi |
4931 | ||
39c9d5ac | 4932 | if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then |
ce4169a4 RR |
4933 | if test "$wxUSE_GTK" = 1; then |
4934 | if test "$WXGTK12" != 1; then | |
156b2523 | 4935 | AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2... disabled]) |
e90c1d2a | 4936 | wxUSE_DRAG_AND_DROP=no |
ce4169a4 | 4937 | fi |
a9b5e89f | 4938 | fi |
a9b5e89f | 4939 | |
ce4169a4 | 4940 | if test "$wxUSE_MOTIF" = 1; then |
156b2523 | 4941 | AC_MSG_WARN([Drag and drop not yet supported under Motif... disabled]) |
e90c1d2a | 4942 | wxUSE_DRAG_AND_DROP=no |
ce4169a4 | 4943 | fi |
a9b5e89f | 4944 | |
7f5c07ab JS |
4945 | if test "$wxUSE_X11" = 1; then |
4946 | AC_MSG_WARN([Drag and drop not yet supported under X11... disabled]) | |
4947 | wxUSE_DRAG_AND_DROP=no | |
4948 | fi | |
4949 | ||
6c657b52 VS |
4950 | if test "$wxUSE_MGL" = 1; then |
4951 | AC_MSG_WARN([Drag and drop not yet supported under MGL... disabled]) | |
4952 | wxUSE_DRAG_AND_DROP=no | |
4953 | fi | |
4954 | ||
ce4169a4 RR |
4955 | if test "$wxUSE_DRAG_AND_DROP" = "yes"; then |
4956 | AC_DEFINE(wxUSE_DRAG_AND_DROP) | |
4957 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd" | |
4958 | fi | |
4882bf1b | 4959 | |
9a98a854 VZ |
4960 | fi |
4961 | ||
4962 | if test "$wxUSE_SPLINES" = "yes" ; then | |
4963 | AC_DEFINE(wxUSE_SPLINES) | |
4964 | fi | |
4965 | ||
4966 | dnl --------------------------------------------------------------------------- | |
4967 | dnl GUI controls | |
4968 | dnl --------------------------------------------------------------------------- | |
4969 | ||
1e6feb95 VZ |
4970 | USES_CONTROLS=0 |
4971 | if test "$wxUSE_CONTROLS" = "yes"; then | |
4972 | USES_CONTROLS=1 | |
4973 | fi | |
4974 | ||
9a98a854 VZ |
4975 | if test "$wxUSE_ACCEL" = "yes"; then |
4976 | AC_DEFINE(wxUSE_ACCEL) | |
1e6feb95 VZ |
4977 | USES_CONTROLS=1 |
4978 | fi | |
4979 | ||
4980 | if test "$wxUSE_BUTTON" = "yes"; then | |
4981 | AC_DEFINE(wxUSE_BUTTON) | |
4982 | USES_CONTROLS=1 | |
4983 | fi | |
4984 | ||
4985 | if test "$wxUSE_BMPBUTTON" = "yes"; then | |
4986 | AC_DEFINE(wxUSE_BMPBUTTON) | |
4987 | USES_CONTROLS=1 | |
4988 | fi | |
4989 | ||
4990 | if test "$wxUSE_CALCTRL" = "yes"; then | |
4991 | AC_DEFINE(wxUSE_CALENDARCTRL) | |
4992 | USES_CONTROLS=1 | |
4993 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar" | |
9a98a854 VZ |
4994 | fi |
4995 | ||
4996 | if test "$wxUSE_CARET" = "yes"; then | |
4997 | AC_DEFINE(wxUSE_CARET) | |
1e6feb95 | 4998 | USES_CONTROLS=1 |
9a98a854 VZ |
4999 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret" |
5000 | fi | |
5001 | ||
5002 | if test "$wxUSE_COMBOBOX" = "yes"; then | |
5003 | AC_DEFINE(wxUSE_COMBOBOX) | |
1e6feb95 | 5004 | USES_CONTROLS=1 |
9a98a854 VZ |
5005 | fi |
5006 | ||
ce4169a4 RR |
5007 | if test "$wxUSE_CHOICE" = "yes"; then |
5008 | AC_DEFINE(wxUSE_CHOICE) | |
1e6feb95 | 5009 | USES_CONTROLS=1 |
9a98a854 VZ |
5010 | fi |
5011 | ||
5012 | if test "$wxUSE_CHECKBOX" = "yes"; then | |
5013 | AC_DEFINE(wxUSE_CHECKBOX) | |
1e6feb95 | 5014 | USES_CONTROLS=1 |
9a98a854 VZ |
5015 | fi |
5016 | ||
5017 | if test "$wxUSE_CHECKLST" = "yes"; then | |
5018 | AC_DEFINE(wxUSE_CHECKLISTBOX) | |
1e6feb95 | 5019 | USES_CONTROLS=1 |
9a98a854 VZ |
5020 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst" |
5021 | fi | |
5022 | ||
ddb4769e VZ |
5023 | if test "$wxUSE_DISPLAY" = "yes"; then |
5024 | AC_DEFINE(wxUSE_DISPLAY) | |
5025 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS display" | |
5026 | fi | |
5027 | ||
9a98a854 VZ |
5028 | if test "$wxUSE_GAUGE" = "yes"; then |
5029 | AC_DEFINE(wxUSE_GAUGE) | |
1e6feb95 | 5030 | USES_CONTROLS=1 |
9a98a854 VZ |
5031 | fi |
5032 | ||
d6a55c4b VZ |
5033 | if test "$wxUSE_GRID" = "yes"; then |
5034 | AC_DEFINE(wxUSE_GRID) | |
1e6feb95 | 5035 | USES_CONTROLS=1 |
d6a55c4b VZ |
5036 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid" |
5037 | fi | |
5038 | ||
9a98a854 | 5039 | if test "$wxUSE_IMAGLIST" = "yes"; then |
ce4169a4 | 5040 | AC_DEFINE(wxUSE_IMAGLIST) |
9a98a854 VZ |
5041 | fi |
5042 | ||
5043 | if test "$wxUSE_LISTBOX" = "yes"; then | |
ce4169a4 | 5044 | AC_DEFINE(wxUSE_LISTBOX) |
1e6feb95 | 5045 | USES_CONTROLS=1 |
9a98a854 VZ |
5046 | fi |
5047 | ||
5048 | if test "$wxUSE_LISTCTRL" = "yes"; then | |
ce4169a4 RR |
5049 | if test "$wxUSE_IMAGLIST" = "yes"; then |
5050 | AC_DEFINE(wxUSE_LISTCTRL) | |
1e6feb95 | 5051 | USES_CONTROLS=1 |
ce4169a4 RR |
5052 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl" |
5053 | else | |
5054 | AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it]) | |
5055 | fi | |
9a98a854 VZ |
5056 | fi |
5057 | ||
5058 | if test "$wxUSE_NOTEBOOK" = "yes"; then | |
ce4169a4 | 5059 | AC_DEFINE(wxUSE_NOTEBOOK) |
1e6feb95 | 5060 | USES_CONTROLS=1 |
ce4169a4 | 5061 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook" |
9a98a854 VZ |
5062 | fi |
5063 | ||
2fc9385a JS |
5064 | dnl if test "$wxUSE_PROPSHEET" = "yes"; then |
5065 | dnl AC_DEFINE(wxUSE_PROPSHEET) | |
5066 | dnl USES_CONTROLS=1 | |
5067 | dnl SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS proplist" | |
5068 | dnl fi | |
24176f2c | 5069 | |
9a98a854 | 5070 | if test "$wxUSE_RADIOBOX" = "yes"; then |
ce4169a4 | 5071 | AC_DEFINE(wxUSE_RADIOBOX) |
1e6feb95 | 5072 | USES_CONTROLS=1 |
9a98a854 VZ |
5073 | fi |
5074 | ||
5075 | if test "$wxUSE_RADIOBTN" = "yes"; then | |
ce4169a4 | 5076 | AC_DEFINE(wxUSE_RADIOBTN) |
1e6feb95 | 5077 | USES_CONTROLS=1 |
9a98a854 VZ |
5078 | fi |
5079 | ||
79b00c62 | 5080 | if test "$wxUSE_SASH" = "yes"; then |
ce4169a4 RR |
5081 | AC_DEFINE(wxUSE_SASH) |
5082 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest" | |
9a98a854 VZ |
5083 | fi |
5084 | ||
5085 | if test "$wxUSE_SCROLLBAR" = "yes"; then | |
ce4169a4 | 5086 | AC_DEFINE(wxUSE_SCROLLBAR) |
1e6feb95 | 5087 | USES_CONTROLS=1 |
678b92a9 | 5088 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll scrollsub" |
9a98a854 VZ |
5089 | fi |
5090 | ||
5091 | if test "$wxUSE_SLIDER" = "yes"; then | |
ce4169a4 | 5092 | AC_DEFINE(wxUSE_SLIDER) |
1e6feb95 | 5093 | USES_CONTROLS=1 |
9a98a854 VZ |
5094 | fi |
5095 | ||
5096 | if test "$wxUSE_SPINBTN" = "yes"; then | |
ce4169a4 | 5097 | AC_DEFINE(wxUSE_SPINBTN) |
1e6feb95 | 5098 | USES_CONTROLS=1 |
9a98a854 VZ |
5099 | fi |
5100 | ||
66f38406 RR |
5101 | if test "$wxUSE_SPINCTRL" = "yes"; then |
5102 | AC_DEFINE(wxUSE_SPINCTRL) | |
1e6feb95 | 5103 | USES_CONTROLS=1 |
66f38406 RR |
5104 | fi |
5105 | ||
9a98a854 | 5106 | if test "$wxUSE_SPLITTER" = "yes"; then |
ce4169a4 RR |
5107 | AC_DEFINE(wxUSE_SPLITTER) |
5108 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter" | |
9a98a854 VZ |
5109 | fi |
5110 | ||
5111 | if test "$wxUSE_STATBMP" = "yes"; then | |
ce4169a4 | 5112 | AC_DEFINE(wxUSE_STATBMP) |
1e6feb95 | 5113 | USES_CONTROLS=1 |
9a98a854 VZ |
5114 | fi |
5115 | ||
5116 | if test "$wxUSE_STATBOX" = "yes"; then | |
ce4169a4 | 5117 | AC_DEFINE(wxUSE_STATBOX) |
1e6feb95 VZ |
5118 | USES_CONTROLS=1 |
5119 | fi | |
5120 | ||
5121 | if test "$wxUSE_STATTEXT" = "yes"; then | |
5122 | AC_DEFINE(wxUSE_STATTEXT) | |
5123 | USES_CONTROLS=1 | |
9a98a854 VZ |
5124 | fi |
5125 | ||
5126 | if test "$wxUSE_STATLINE" = "yes"; then | |
d1188635 JS |
5127 | AC_DEFINE(wxUSE_STATLINE) |
5128 | USES_CONTROLS=1 | |
9a98a854 VZ |
5129 | fi |
5130 | ||
5131 | if test "$wxUSE_STATUSBAR" = "yes"; then | |
ce4169a4 | 5132 | AC_DEFINE(wxUSE_STATUSBAR) |
1e6feb95 | 5133 | USES_CONTROLS=1 |
2286341c VZ |
5134 | |
5135 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar" | |
9a98a854 VZ |
5136 | fi |
5137 | ||
5138 | if test "$wxUSE_TABDIALOG" = "yes"; then | |
ce4169a4 RR |
5139 | AC_DEFINE(wxUSE_TAB_DIALOG) |
5140 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS tab" | |
9a98a854 VZ |
5141 | fi |
5142 | ||
1e6feb95 VZ |
5143 | if test "$wxUSE_TEXTCTRL" = "yes"; then |
5144 | AC_DEFINE(wxUSE_TEXTCTRL) | |
5145 | USES_CONTROLS=1 | |
5146 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text" | |
5147 | fi | |
5148 | ||
1db8dc4a | 5149 | if test "$wxUSE_TOGGLEBTN" = "yes"; then |
ac0c4cc3 | 5150 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then |
156b2523 GD |
5151 | AC_MSG_WARN([Toggle button not yet supported under Mac OS X... disabled]) |
5152 | wxUSE_TOGGLEBTN=no | |
5153 | fi | |
5154 | if test "$wxUSE_UNIVERSAL" = "yes"; then | |
3c011993 | 5155 | AC_MSG_WARN([Toggle button not yet supported under wxUniversal... disabled]) |
a45d7ab7 GD |
5156 | wxUSE_TOGGLEBTN=no |
5157 | fi | |
5158 | ||
5159 | if test "$wxUSE_TOGGLEBTN" = "yes"; then | |
5160 | AC_DEFINE(wxUSE_TOGGLEBTN) | |
1e6feb95 | 5161 | USES_CONTROLS=1 |
a45d7ab7 | 5162 | fi |
1db8dc4a VZ |
5163 | fi |
5164 | ||
360d6699 VZ |
5165 | if test "$wxUSE_TOOLBAR_SIMPLE" = "yes"; then |
5166 | AC_DEFINE(wxUSE_TOOLBAR_SIMPLE) | |
5167 | wxUSE_TOOLBAR="yes" | |
1e6feb95 | 5168 | USES_CONTROLS=1 |
360d6699 VZ |
5169 | fi |
5170 | ||
9a98a854 | 5171 | if test "$wxUSE_TOOLBAR" = "yes"; then |
ce4169a4 | 5172 | AC_DEFINE(wxUSE_TOOLBAR) |
1e6feb95 | 5173 | USES_CONTROLS=1 |
360d6699 VZ |
5174 | |
5175 | dnl if wxUSE_TOOLBAR and !wxUSE_TOOLBAR_SIMPLE => wxUSE_TOOLBAR_NATIVE | |
5176 | if test "$wxUSE_TOOLBAR_SIMPLE" != "yes"; then | |
5177 | wxUSE_TOOLBAR_NATIVE="yes" | |
5178 | fi | |
5179 | ||
1e6feb95 VZ |
5180 | if test "$wxUSE_TOOLBAR_NATIVE" = "yes"; then |
5181 | AC_DEFINE(wxUSE_TOOLBAR_NATIVE) | |
5182 | USES_CONTROLS=1 | |
5183 | fi | |
9a98a854 | 5184 | |
1e6feb95 | 5185 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar" |
360d6699 VZ |
5186 | fi |
5187 | ||
39c9d5ac | 5188 | if test "$wxUSE_TOOLTIPS" = "yes"; then |
ced859c3 | 5189 | if test "$wxUSE_MOTIF" = 1; then |
156b2523 | 5190 | AC_MSG_WARN([wxTooltip not supported yet under Motif... disabled]) |
9a98a854 | 5191 | else |
d1188635 JS |
5192 | if test "$wxUSE_UNIVERSAL" = "yes"; then |
5193 | AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled]) | |
ce4169a4 | 5194 | else |
d1188635 | 5195 | AC_DEFINE(wxUSE_TOOLTIPS) |
ce4169a4 | 5196 | fi |
9a98a854 VZ |
5197 | fi |
5198 | fi | |
5199 | ||
5200 | if test "$wxUSE_TREECTRL" = "yes"; then | |
ce4169a4 RR |
5201 | if test "$wxUSE_IMAGLIST" = "yes"; then |
5202 | AC_DEFINE(wxUSE_TREECTRL) | |
1e6feb95 | 5203 | USES_CONTROLS=1 |
ce4169a4 RR |
5204 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl" |
5205 | else | |
5206 | AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it]) | |
5207 | fi | |
9a98a854 VZ |
5208 | fi |
5209 | ||
9f41d601 | 5210 | if test "$wxUSE_POPUPWIN" = "yes"; then |
ac0c4cc3 | 5211 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then |
156b2523 | 5212 | AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled]) |
6abe4b65 | 5213 | else |
485cf710 VZ |
5214 | if test "$wxUSE_MOTIF" = 1; then |
5215 | AC_MSG_WARN([wxPopupWindow not yet supported under Motif... disabled]) | |
5216 | else | |
c6712985 SN |
5217 | if test "$wxUSE_PM" = 1; then |
5218 | AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled]) | |
3bd8fb5f | 5219 | else |
c6712985 | 5220 | AC_DEFINE(wxUSE_POPUPWIN) |
0b01706f | 5221 | |
c6712985 SN |
5222 | USES_CONTROLS=1 |
5223 | fi | |
485cf710 | 5224 | fi |
6abe4b65 | 5225 | fi |
9f41d601 RR |
5226 | fi |
5227 | ||
dd964dcc | 5228 | if test "$wxUSE_TIPWINDOW" = "yes"; then |
c6712985 SN |
5229 | if test "$wxUSE_PM" = 1; then |
5230 | AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled]) | |
3bd8fb5f | 5231 | else |
c6712985 SN |
5232 | AC_DEFINE(wxUSE_TIPWINDOW) |
5233 | fi | |
dd964dcc VZ |
5234 | fi |
5235 | ||
1e6feb95 VZ |
5236 | if test "$USES_CONTROLS" = 1; then |
5237 | AC_DEFINE(wxUSE_CONTROLS) | |
5238 | fi | |
5239 | ||
9a98a854 VZ |
5240 | dnl --------------------------------------------------------------------------- |
5241 | dnl misc options | |
5242 | dnl --------------------------------------------------------------------------- | |
5243 | ||
2fc9385a JS |
5244 | dnl if test "$wxUSE_TREELAYOUT" = "yes"; then |
5245 | dnl AC_DEFINE(wxUSE_TREELAYOUT) | |
5246 | dnl SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treelay" | |
5247 | dnl fi | |
9a98a854 | 5248 | |
24fd6d87 VZ |
5249 | if test "$wxUSE_DRAGIMAGE" = "yes"; then |
5250 | AC_DEFINE(wxUSE_DRAGIMAGE) | |
5251 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag" | |
5252 | fi | |
5253 | ||
7bb2947d MB |
5254 | if test "$wxUSE_ACCESSIBILITY" = "yes"; then |
5255 | AC_DEFINE(wxUSE_ACCESSIBILITY) | |
5256 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access" | |
5257 | fi | |
5258 | ||
1e6feb95 VZ |
5259 | if test "$wxUSE_MENUS" = "yes"; then |
5260 | AC_DEFINE(wxUSE_MENUS) | |
5261 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu" | |
ce4169a4 | 5262 | fi |
9a98a854 | 5263 | |
1e6feb95 VZ |
5264 | if test "$wxUSE_METAFILE" = "yes"; then |
5265 | AC_DEFINE(wxUSE_METAFILE) | |
c11584af RR |
5266 | fi |
5267 | ||
1e6feb95 VZ |
5268 | if test "$wxUSE_MIMETYPE" = "yes"; then |
5269 | AC_DEFINE(wxUSE_MIMETYPE) | |
9a98a854 VZ |
5270 | fi |
5271 | ||
0cbff120 JS |
5272 | if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then |
5273 | AC_DEFINE(wxUSE_SYSTEM_OPTIONS) | |
b2261c5b JS |
5274 | if test "$TOOLKIT" = "MSW"; then |
5275 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar" | |
5276 | fi | |
5277 | ||
0cbff120 JS |
5278 | fi |
5279 | ||
4cdb0ab0 | 5280 | if test "$wxUSE_PROTOCOL" = "yes"; then |
3954f9ca VS |
5281 | if test "$wxUSE_SOCKETS" != "yes"; then |
5282 | AC_MSG_WARN(Protocol classes require sockets... disabled) | |
5283 | wxUSE_PROTOCOL=no | |
5284 | fi | |
5285 | ||
5286 | if test "$wxUSE_PROTOCOL" = "yes"; then | |
5287 | AC_DEFINE(wxUSE_PROTOCOL) | |
4cdb0ab0 | 5288 | |
3954f9ca VS |
5289 | if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then |
5290 | AC_DEFINE(wxUSE_PROTOCOL_HTTP) | |
5291 | fi | |
5292 | if test "$wxUSE_PROTOCOL_FTP" = "yes"; then | |
5293 | AC_DEFINE(wxUSE_PROTOCOL_FTP) | |
5294 | fi | |
5295 | if test "$wxUSE_PROTOCOL_FILE" = "yes"; then | |
5296 | AC_DEFINE(wxUSE_PROTOCOL_FILE) | |
5297 | fi | |
4cdb0ab0 | 5298 | fi |
3954f9ca VS |
5299 | fi |
5300 | ||
5301 | if test "$wxUSE_URL" = "yes"; then | |
5302 | if test "$wxUSE_PROTOCOL" != "yes"; then | |
5303 | AC_MSG_WARN(wxURL class requires wxProtocol... disabled) | |
5304 | wxUSE_URL=no | |
4cdb0ab0 | 5305 | fi |
3954f9ca VS |
5306 | if test "$wxUSE_URL" = "yes"; then |
5307 | AC_DEFINE(wxUSE_URL) | |
4cdb0ab0 VS |
5308 | fi |
5309 | fi | |
5310 | ||
9a98a854 | 5311 | if test "$wxUSE_MINIFRAME" = "yes"; then |
ce4169a4 RR |
5312 | AC_DEFINE(wxUSE_MINIFRAME) |
5313 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram" | |
9a98a854 VZ |
5314 | fi |
5315 | ||
5526e819 VS |
5316 | if test "$wxUSE_HTML" = "yes"; then |
5317 | AC_DEFINE(wxUSE_HTML) | |
d2739ea6 | 5318 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html htlbox" |
5526e819 VS |
5319 | fi |
5320 | ||
9a98a854 | 5321 | if test "$wxUSE_VALIDATORS" = "yes"; then |
ce4169a4 RR |
5322 | AC_DEFINE(wxUSE_VALIDATORS) |
5323 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate" | |
9a98a854 VZ |
5324 | fi |
5325 | ||
d275c7eb VZ |
5326 | if test "$wxUSE_PALETTE" = "yes" ; then |
5327 | AC_DEFINE(wxUSE_PALETTE) | |
5328 | fi | |
5329 | ||
0046ff7c VS |
5330 | if test "$wxUSE_IMAGE" = "yes" ; then |
5331 | AC_DEFINE(wxUSE_IMAGE) | |
5332 | fi | |
5333 | ||
0940bcf7 HH |
5334 | if test "$wxUSE_GIF" = "yes" ; then |
5335 | AC_DEFINE(wxUSE_GIF) | |
5336 | fi | |
5337 | ||
5338 | if test "$wxUSE_PCX" = "yes" ; then | |
5339 | AC_DEFINE(wxUSE_PCX) | |
5340 | fi | |
5341 | ||
4b6b4dfc RR |
5342 | if test "$wxUSE_IFF" = "yes" ; then |
5343 | AC_DEFINE(wxUSE_IFF) | |
5344 | fi | |
5345 | ||
0940bcf7 HH |
5346 | if test "$wxUSE_PNM" = "yes" ; then |
5347 | AC_DEFINE(wxUSE_PNM) | |
5348 | fi | |
5349 | ||
0046ff7c VS |
5350 | if test "$wxUSE_XPM" = "yes" ; then |
5351 | AC_DEFINE(wxUSE_XPM) | |
5352 | fi | |
5353 | ||
658974ae VS |
5354 | if test "$wxUSE_ICO_CUR" = "yes" ; then |
5355 | AC_DEFINE(wxUSE_ICO_CUR) | |
5356 | fi | |
5357 | ||
a72a4bfa VS |
5358 | if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_MSLU" = "yes" ; then |
5359 | dnl Must be done this late because -lunicows must be before all the other libs | |
5360 | LIBS=" -lunicows $LIBS" | |
5361 | fi | |
5362 | ||
1e6feb95 VZ |
5363 | dnl --------------------------------------------------------------------------- |
5364 | dnl common dialog | |
5365 | dnl --------------------------------------------------------------------------- | |
5366 | ||
5367 | if test "$wxUSE_CHOICEDLG" = "yes"; then | |
5368 | AC_DEFINE(wxUSE_CHOICEDLG) | |
5369 | fi | |
5370 | ||
5371 | if test "$wxUSE_COLOURDLG" = "yes"; then | |
5372 | AC_DEFINE(wxUSE_COLOURDLG) | |
5373 | fi | |
5374 | ||
5375 | if test "$wxUSE_FILEDLG" = "yes"; then | |
5376 | AC_DEFINE(wxUSE_FILEDLG) | |
5377 | fi | |
5378 | ||
8db37e06 VZ |
5379 | if test "$wxUSE_FINDREPLDLG" = "yes"; then |
5380 | AC_DEFINE(wxUSE_FINDREPLDLG) | |
5381 | fi | |
5382 | ||
1e6feb95 VZ |
5383 | if test "$wxUSE_FONTDLG" = "yes"; then |
5384 | AC_DEFINE(wxUSE_FONTDLG) | |
5385 | fi | |
5386 | ||
5387 | if test "$wxUSE_DIRDLG" = "yes"; then | |
ae1daed0 JS |
5388 | if test "$wxUSE_TREECTRL" != "yes"; then |
5389 | AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it) | |
1e6feb95 | 5390 | else |
ae1daed0 | 5391 | AC_DEFINE(wxUSE_DIRDLG) |
1e6feb95 VZ |
5392 | fi |
5393 | fi | |
5394 | ||
5395 | if test "$wxUSE_MSGDLG" = "yes"; then | |
5396 | AC_DEFINE(wxUSE_MSGDLG) | |
5397 | fi | |
5398 | ||
5399 | if test "$wxUSE_NUMBERDLG" = "yes"; then | |
5400 | AC_DEFINE(wxUSE_NUMBERDLG) | |
5401 | fi | |
5402 | ||
5403 | if test "$wxUSE_PROGRESSDLG" = "yes"; then | |
5404 | if test "$wxUSE_CONSTRAINTS" != "yes"; then | |
5405 | AC_MSG_WARN(wxProgressDialog requires constraints so it won't be compiled without them) | |
5406 | else | |
5407 | AC_DEFINE(wxUSE_PROGRESSDLG) | |
5408 | fi | |
5409 | fi | |
5410 | ||
cbca9943 VZ |
5411 | if test "$wxUSE_SPLASH" = "yes"; then |
5412 | AC_DEFINE(wxUSE_SPLASH) | |
5413 | fi | |
5414 | ||
1e6feb95 VZ |
5415 | if test "$wxUSE_STARTUP_TIPS" = "yes"; then |
5416 | if test "$wxUSE_CONSTRAINTS" != "yes"; then | |
5417 | AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them) | |
5418 | else | |
5419 | AC_DEFINE(wxUSE_STARTUP_TIPS) | |
5420 | fi | |
5421 | fi | |
5422 | ||
5423 | if test "$wxUSE_TEXTDLG" = "yes"; then | |
5424 | AC_DEFINE(wxUSE_TEXTDLG) | |
5425 | fi | |
5426 | ||
b1f5d087 VZ |
5427 | if test "$wxUSE_WIZARDDLG" = "yes"; then |
5428 | AC_DEFINE(wxUSE_WIZARDDLG) | |
5429 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard" | |
5430 | fi | |
5431 | ||
bdc72a22 VZ |
5432 | dnl --------------------------------------------------------------------------- |
5433 | dnl get the string with OS info - used by wxGetOsDescription() | |
5434 | dnl --------------------------------------------------------------------------- | |
5435 | ||
32832908 VZ |
5436 | if test "$cross_compiling" = "yes"; then |
5437 | dnl Use best guess from host as we can't use uname when cross compiling | |
5438 | OSINFO="\"$host\"" | |
5439 | else | |
5440 | dnl attualy work out OS version | |
5441 | OSINFO=`uname -s -r -m` | |
5442 | OSINFO="\"$OSINFO\"" | |
5443 | fi | |
5444 | ||
bdc72a22 VZ |
5445 | AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO) |
5446 | ||
7e67ed0d VZ |
5447 | dnl --------------------------------------------------------------------------- |
5448 | dnl define the variable containing the installation prefix (used in dcpsg.cpp) | |
5449 | dnl --------------------------------------------------------------------------- | |
5450 | ||
06dda230 VZ |
5451 | if test "x$prefix" != "xNONE"; then |
5452 | wxPREFIX=$prefix | |
5453 | else | |
5454 | wxPREFIX=$ac_default_prefix | |
5455 | fi | |
5456 | ||
5457 | AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX") | |
7e67ed0d | 5458 | |
52c71b80 | 5459 | dnl define the variables used in wx-config |
e6cc62c6 | 5460 | top_builddir_wxconfig=`pwd` |
52c71b80 | 5461 | |
9a98a854 VZ |
5462 | dnl --------------------------------------------------------------------------- |
5463 | dnl Output the makefiles and such from the results found above | |
5464 | dnl --------------------------------------------------------------------------- | |
5465 | ||
9a98a854 | 5466 | dnl all additional libraries (except wxWindows itself) we link with |
3d63bc3a | 5467 | |
b4085ce6 GD |
5468 | dnl note that we always link with -lm except for Mac OS X |
5469 | dnl extended.c uses floor() and is always linked in | |
3a922bb4 | 5470 | |
f11bdd03 | 5471 | if test "$wxUSE_MAC" = 1 ; then |
3d63bc3a | 5472 | LDFLAGS="$LDFLAGS -framework Carbon -framework System" |
b4085ce6 | 5473 | fi |
ac0c4cc3 DE |
5474 | if test "$wxUSE_COCOA" = 1 ; then |
5475 | LDFLAGS="$LDFLAGS -framework Cocoa -framework System" | |
5476 | fi | |
3a922bb4 | 5477 | |
3d63bc3a RL |
5478 | dnl FIXME: should this be covered by the conditional above |
5479 | dnl given the -lm comment there? Or should that comment (and | |
5480 | dnl this one) be removed.. [ 7 Nov 2001 ] | |
5481 | ||
2b5f62a0 VZ |
5482 | LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS" |
5483 | ||
5484 | dnl Only add the -lm library if floating point functions cannot be used | |
5485 | dnl without it. This check is important on cygwin because of the bizarre | |
5486 | dnl way that they have organized functions into libraries. On cygwin, both | |
5487 | dnl libc.a and libm.a are symbolic links to a single lib libcygwin.a. This | |
5488 | dnl means that | |
5489 | dnl 1) linking with -lm is not necessary, and | |
5490 | dnl 2) linking with -lm is dangerous if the order of libraries is wrong | |
5491 | dnl In particular, if you compile any program with -mno-cygwin and link with | |
5492 | dnl -lm, it will crash instantly when it is run. This happens because the | |
5493 | dnl linker incorrectly links the Cygwin libm.a (==libcygwin.a), which replaces | |
5494 | dnl the ___main function instead of allowing it to be defined by | |
5495 | dnl /usr/lib/mingw/libmingw32.a as it should be. | |
5496 | dnl | |
5497 | dnl On MacOS X, this test will find that -lm is unnecessary and leave it out. | |
5498 | dnl | |
5499 | dnl Just check a few floating point functions. If they are all found without | |
5500 | dnl -lm, then we must not need -lm. | |
5501 | have_cos=0 | |
5502 | have_floor=0 | |
5503 | AC_CHECK_FUNCS(cos, have_cos=1) | |
5504 | AC_CHECK_FUNCS(floor, have_floor=1) | |
5505 | AC_MSG_CHECKING(if floating point functions link without -lm) | |
5506 | if test "$have_cos" = 1 -a "$have_floor" = 1; then | |
5507 | AC_MSG_RESULT(yes) | |
5508 | else | |
5509 | AC_MSG_RESULT(no) | |
5510 | LIBS="$LIBS -lm" | |
5511 | # use different functions to avoid configure caching | |
5512 | have_sin=0 | |
5513 | have_ceil=0 | |
5514 | AC_CHECK_FUNCS(sin, have_sin=1) | |
5515 | AC_CHECK_FUNCS(ceil, have_ceil=1) | |
5516 | AC_MSG_CHECKING(if floating point functions link with -lm) | |
5517 | if test "$have_sin" = 1 -a "$have_ceil" = 1; then | |
5518 | AC_MSG_RESULT(yes) | |
5519 | else | |
5520 | AC_MSG_RESULT(no) | |
5521 | # not sure we should warn the user, crash, etc. | |
5522 | fi | |
5523 | fi | |
3d63bc3a | 5524 | |
e90c1d2a | 5525 | if test "$wxUSE_GUI" = "yes"; then |
3d63bc3a | 5526 | |
cb61c62d | 5527 | LIBS="$GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $LIBS" |
3a922bb4 RL |
5528 | |
5529 | dnl TODO add checks that these samples will really compile (i.e. all the | |
5530 | dnl library features they need are present) | |
5531 | ||
5532 | dnl TODO some samples are never built so far: | |
5533 | dnl ipc, mfc, nativdlg, oleauto, ownerdrw | |
867a54b6 | 5534 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs \ |
3a922bb4 | 5535 | drawing dynamic erase event exec font image \ |
1542ea39 | 5536 | minimal propsize rotate shaped widgets" |
b625909c VS |
5537 | |
5538 | if test "$wxUSE_MONOLITHIC" != "yes"; then | |
5539 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console" | |
5540 | fi | |
3a922bb4 RL |
5541 | else |
5542 | SAMPLES_SUBDIRS="console" | |
e90c1d2a | 5543 | fi |
9a98a854 | 5544 | |
8e877c19 | 5545 | |
9a98a854 | 5546 | dnl all -I options we must pass to the compiler |
44a5856d VZ |
5547 | dnl |
5548 | dnl note that the order is somewhat important, in particular the ZLIB_INCLUDE | |
5549 | dnl and other stuff for the built in libraries should come first to avoid | |
5550 | dnl including the system headers with the same name (it is particularly | |
5551 | dnl important for zlib because XFree 4.2.0 has its own, horribly old and | |
5552 | dnl incompatible, zlib.h) and the wxWindows headers should come first anyhow | |
e6cc62c6 | 5553 | INCLUDES="-I\${top_builddir}lib/wx/include/${TOOLCHAIN_NAME} \ |
44a5856d VZ |
5554 | -I\${top_srcdir}/include \ |
5555 | $REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE \ | |
5556 | $TOOLKIT_INCLUDE" | |
9a98a854 | 5557 | |
fddeb06b VS |
5558 | dnl C/C++ compiler options used to compile wxWindows |
5559 | if test "$GXX" = yes ; then | |
5560 | dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" | |
5561 | CXXWARNINGS="-Wall" | |
5562 | dnl should enable this one day... | |
5563 | dnl CXXWARNINGS="-Wall -Werror" | |
5564 | fi | |
5565 | ||
5566 | EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE" | |
5567 | ||
5568 | dnl remove the extra white space from the cc/c++/ld options | |
5569 | CPPFLAGS=`echo $INCLUDES $CPPFLAGS | sed 's/ \\+/ /g'` | |
5570 | CFLAGS=`echo $CODE_GEN_FLAGS $EXTRA_CFLAGS $CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'` | |
5571 | CXXFLAGS=`echo $CODE_GEN_FLAGS $CODE_GEN_FLAGS_CXX $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS | sed 's/ \+/ /g'` | |
5572 | LIBS=`echo $LIBS | sed 's/ \+/ /g'` | |
5573 | ||
5574 | LDFLAGS="$LDFLAGS $PROFILE" | |
5575 | ||
f6bcfd97 | 5576 | dnl wxGTK does not need TOOLKIT includes in wx-config |
63e7762e | 5577 | if test "$wxUSE_GTK" = 1; then |
3d63bc3a | 5578 | WXCONFIG_INCLUDE= |
f6bcfd97 BP |
5579 | else |
5580 | WXCONFIG_INCLUDE="$TOOLKIT_INCLUDE" | |
5581 | fi | |
5582 | ||
fe0895cf VS |
5583 | if test "x$wxUSE_UNIVERSAL" = "xyes" ; then |
5584 | WXUNIV=1 | |
5585 | else | |
5586 | WXUNIV=0 | |
5587 | fi | |
5588 | ||
5589 | AC_SUBST(wxUSE_ZLIB) | |
5590 | AC_SUBST(wxUSE_REGEX) | |
5591 | AC_SUBST(wxUSE_ODBC) | |
5592 | AC_SUBST(wxUSE_LIBJPEG) | |
5593 | AC_SUBST(wxUSE_LIBPNG) | |
5594 | AC_SUBST(wxUSE_LIBTIFF) | |
5595 | ||
5596 | EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS" | |
5597 | ||
08b3ac36 VS |
5598 | if test $wxUSE_MONOLITHIC = "yes" ; then |
5599 | MONOLITHIC=1 | |
5600 | else | |
5601 | MONOLITHIC=0 | |
5602 | fi | |
fe0895cf | 5603 | |
8ee2dd05 VS |
5604 | dnl FIXME -- make configurable! |
5605 | VENDOR="custom" | |
5606 | OFFICIAL_BUILD=0 | |
5607 | AC_SUBST(VENDOR) | |
5608 | AC_SUBST(OFFICIAL_BUILD) | |
5609 | ||
fe0895cf VS |
5610 | AC_SUBST(WXUNIV) |
5611 | AC_SUBST(MONOLITHIC) | |
5612 | AC_SUBST(EXTRALIBS) | |
5613 | AC_SUBST(UNICODE) | |
5614 | AC_SUBST(BUILD) | |
5615 | AC_SUBST(SHARED) | |
5616 | TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr [[A-Z]] [[a-z]]` | |
5617 | AC_SUBST(TOOLKIT_LOWERCASE) | |
5618 | AC_SUBST(TOOLKIT_VERSION) | |
5619 | AC_SUBST(SAMPLES_RPATH_FLAG) | |
5620 | ||
5621 | AC_BAKEFILE | |
5622 | ||
88e30f2b | 5623 | |
e694c22c | 5624 | |
70d1b3cf VZ |
5625 | dnl for convenience, sort the samples in alphabetical order |
5626 | dnl | |
5627 | dnl FIXME For some mysterious reasons, sometimes the directories are duplicated | |
5628 | dnl in this list - hence uniq. But normally, this shouldn't be needed! | |
d6a55c4b VZ |
5629 | dnl |
5630 | dnl Unfortunately, there is a bug in OS/2's tr, such that | |
d51e8205 SN |
5631 | dnl tr ' ' '\n' introduces DOS-like line breaks, whereas tr '\n' ' ' |
5632 | dnl only removes the Unix-like part of the introduced line break. | |
5633 | SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`" | |
5634 | ||
5635 | dnl makefile variables | |
5636 | AC_SUBST(LEX_STEM) | |
5637 | AC_SUBST(PATH_IFS) | |
70d1b3cf | 5638 | |
9a98a854 VZ |
5639 | dnl global options |
5640 | AC_SUBST(WX_MAJOR_VERSION_NUMBER) | |
5641 | AC_SUBST(WX_MINOR_VERSION_NUMBER) | |
5642 | AC_SUBST(WX_RELEASE_NUMBER) | |
48b1d0ff RR |
5643 | AC_SUBST(WX_LIBRARY_NAME_STATIC) |
5644 | AC_SUBST(WX_LIBRARY_NAME_SHARED) | |
2b5f62a0 | 5645 | AC_SUBST(WX_LIBRARY_BASENAME) |
77e13408 | 5646 | AC_SUBST(WX_LIBRARY_IMPORTLIB) |
48b1d0ff RR |
5647 | AC_SUBST(WX_TARGET_LIBRARY) |
5648 | AC_SUBST(WX_LIBRARY_LINK1) | |
5649 | AC_SUBST(WX_LIBRARY_LINK2) | |
80d895cd | 5650 | AC_SUBST(PROGRAM_EXT) |
48b1d0ff | 5651 | |
bdad4e7e | 5652 | dnl global gl options |
bdad4e7e RR |
5653 | AC_SUBST(WX_LIBRARY_NAME_STATIC_GL) |
5654 | AC_SUBST(WX_LIBRARY_NAME_SHARED_GL) | |
bdad4e7e RR |
5655 | AC_SUBST(WX_TARGET_LIBRARY_GL) |
5656 | AC_SUBST(WX_LIBRARY_LINK1_GL) | |
5657 | AC_SUBST(WX_LIBRARY_LINK2_GL) | |
bdad4e7e | 5658 | |
48b1d0ff | 5659 | dnl are we supposed to create the links? |
de87c353 RR |
5660 | AC_SUBST(WX_ALL) |
5661 | AC_SUBST(WX_ALL_INSTALLED) | |
9a98a854 | 5662 | |
48b1d0ff RR |
5663 | AC_SUBST(SHARED_LD) |
5664 | AC_SUBST(PIC_FLAG) | |
3a922bb4 | 5665 | |
3711412e | 5666 | AC_SUBST(WX_TARGET_LIBRARY_TYPE) |
48b1d0ff | 5667 | |
2bffed64 VZ |
5668 | AC_SUBST(STATIC_FLAG) |
5669 | ||
9a98a854 VZ |
5670 | dnl debugging options |
5671 | AC_SUBST(WXDEBUG_DEFINE) | |
5672 | ||
5673 | dnl toolkit options | |
dad6c0ea VZ |
5674 | AC_SUBST(USE_GUI) |
5675 | AC_SUBST(AFMINSTALL) | |
2b5f62a0 | 5676 | AC_SUBST(WIN32INSTALL) |
9a98a854 | 5677 | AC_SUBST(TOOLKIT) |
9a98a854 | 5678 | AC_SUBST(TOOLKIT_DIR) |
1e6feb95 | 5679 | AC_SUBST(TOOLKIT_VPATH) |
3a922bb4 RL |
5680 | AC_SUBST(TOOLCHAIN_NAME) |
5681 | AC_SUBST(TOOLCHAIN_DEFS) | |
00c81359 | 5682 | AC_SUBST(TOOLCHAIN_DLL_DEFS) |
3a922bb4 RL |
5683 | |
5684 | dnl wx-config options | |
e6cc62c6 | 5685 | AC_SUBST(top_builddir_wxconfig) |
77e13408 | 5686 | AC_SUBST(host_alias) |
3a922bb4 RL |
5687 | AC_SUBST(cross_compiling) |
5688 | AC_SUBST(WXCONFIG_LIBS) | |
5689 | AC_SUBST(WXCONFIG_LIBS_GL) | |
885d4bf5 VS |
5690 | AC_SUBST(WXCONFIG_LIBS_STATIC) |
5691 | AC_SUBST(WXCONFIG_LIBS_STATIC_GL) | |
f6bcfd97 | 5692 | AC_SUBST(WXCONFIG_INCLUDE) |
3bd8fb5f | 5693 | AC_SUBST(WXCONFIG_RPATH) |
e26c13cf | 5694 | AC_SUBST(WX_LARGEFILE_FLAGS) |
f0290fca VS |
5695 | AC_SUBST(CODE_GEN_FLAGS) |
5696 | AC_SUBST(CODE_GEN_FLAGS_CXX) | |
9a98a854 | 5697 | |
9b695262 | 5698 | dnl the list of files to compile/install |
e90c1d2a | 5699 | AC_SUBST(ALL_OBJECTS) |
9b695262 VZ |
5700 | AC_SUBST(ALL_HEADERS) |
5701 | AC_SUBST(ALL_SOURCES) | |
2224580a VZ |
5702 | |
5703 | dnl distribution vars | |
a4aad961 | 5704 | AC_SUBST(GUIDIST) |
2224580a VZ |
5705 | AC_SUBST(PORT_FILES) |
5706 | AC_SUBST(DISTDIR) | |
073478b3 | 5707 | |
9a98a854 | 5708 | dnl additional subdirectories where we will build |
9a98a854 | 5709 | AC_SUBST(SAMPLES_SUBDIRS) |
9a98a854 | 5710 | |
e694c22c VZ |
5711 | dnl additional libraries and linker settings |
5712 | AC_SUBST(LDFLAGS) | |
62d0491b | 5713 | AC_SUBST(LDFLAGS_GL) |
2b5f62a0 | 5714 | AC_SUBST(LDFLAGS_VERSIONING) |
40f7145c | 5715 | AC_SUBST(LDFLAGS_EXE) |
f6bcfd97 | 5716 | AC_SUBST(OPENGL_LIBS) |
3d63bc3a | 5717 | AC_SUBST(DMALLOC_LIBS) |
2b5f62a0 | 5718 | AC_SUBST(WX_VERSION_TAG) |
9a98a854 | 5719 | |
32832908 | 5720 | dnl additional resurces settings |
32832908 VZ |
5721 | AC_SUBST(RESCOMP) |
5722 | AC_SUBST(RESFLAGS) | |
3a922bb4 | 5723 | AC_SUBST(RESPROGRAMOBJ) |
e95edd8d GD |
5724 | AC_SUBST(WX_RESOURCES_MACOSX_ASCII) |
5725 | AC_SUBST(WX_RESOURCES_MACOSX_DATA) | |
3a922bb4 | 5726 | |
2f51a9ec | 5727 | dnl additional for Mac OS X |
2f51a9ec | 5728 | AC_SUBST(DEREZ) |
ef7f2189 | 5729 | AC_SUBST(MACOSX_BUNDLE) |
2f51a9ec | 5730 | AC_SUBST(LIBWXMACRES) |
36825681 GD |
5731 | AC_SUBST(MACRESCOMP) |
5732 | AC_SUBST(MACSETFILE) | |
5733 | AC_SUBST(MACRESWXCONFIG) | |
32832908 | 5734 | |
2b5f62a0 VZ |
5735 | dnl other tools |
5736 | AC_SUBST(GCC) | |
32832908 VZ |
5737 | AC_SUBST(DLLTOOL) |
5738 | AC_SUBST(AS) | |
5739 | AC_SUBST(NM) | |
5740 | AC_SUBST(LD) | |
5741 | AC_SUBST(MAKEINFO) | |
885d4bf5 | 5742 | AC_SUBST(INSTALL_LIBRARY) |
4f5a7f74 | 5743 | AC_SUBST(INSTALL_DIR) |
885d4bf5 | 5744 | |
e6cc62c6 VS |
5745 | dnl contrib tests results: |
5746 | AC_SUBST(ESD_LINK) | |
5747 | ||
5748 | ||
9a98a854 | 5749 | dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE |
156b2523 | 5750 | dnl itself (this macro is required if SUBDIRS variable is used in Makefile.am |
9a98a854 VZ |
5751 | dnl - and we do use it) |
5752 | AC_PROG_MAKE_SET | |
5753 | ||
00cf1208 | 5754 | dnl move setup.h back if available |
3a922bb4 RL |
5755 | if test -f lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h; then |
5756 | mv -f lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h setup.h | |
00cf1208 | 5757 | fi |
014e19de | 5758 | |
e6cc62c6 | 5759 | AC_CONFIG_HEADERS([setup.h]) |
2aa88730 | 5760 | |
9a98a854 VZ |
5761 | dnl create each of the files in the space separated list from the file.in |
5762 | dnl (the original file name may be overriden by appending another name after a | |
5763 | dnl colon) | |
e6cc62c6 | 5764 | AC_CONFIG_FILES([ |
ff684c98 | 5765 | wx-config |
2b5f62a0 | 5766 | version-script |
bcd2b961 | 5767 | Makefile |
e6cc62c6 VS |
5768 | ]) |
5769 | ||
5770 | AC_CONFIG_COMMANDS([default], | |
a2cddd63 | 5771 | [ |
3a922bb4 RL |
5772 | dnl This test is required to make the following idempotent. |
5773 | dnl Otherwise running config.status or rerunning configure | |
5774 | dnl would stomp the wx-config link or try to move it onto | |
5775 | dnl itself. | |
652d930d GD |
5776 | dnl Use -h instead of -L to test for link (GD) |
5777 | dnl -h is documented as obsolete under Mac OS X but works | |
5778 | dnl -L is obsolete under Solaris8 | |
5779 | if test ! -h wx-config; then | |
991a5759 | 5780 | chmod +x wx-config |
3a922bb4 RL |
5781 | mv wx-config wx${TOOLCHAIN_NAME}-config |
5782 | ${LN_S} wx${TOOLCHAIN_NAME}-config wx-config | |
991a5759 | 5783 | fi |
014e19de | 5784 | |
00cf1208 RR |
5785 | if test ! -d lib; then |
5786 | mkdir lib | |
5787 | fi | |
5788 | if test ! -d lib/wx; then | |
5789 | mkdir lib/wx | |
5790 | fi | |
5791 | if test ! -d lib/wx/include; then | |
5792 | mkdir lib/wx/include | |
5793 | fi | |
3a922bb4 RL |
5794 | if test ! -d lib/wx/include/${TOOLCHAIN_NAME}; then |
5795 | mkdir lib/wx/include/${TOOLCHAIN_NAME} | |
e90c1d2a | 5796 | fi |
3a922bb4 RL |
5797 | if test ! -d lib/wx/include/${TOOLCHAIN_NAME}/wx; then |
5798 | mkdir lib/wx/include/${TOOLCHAIN_NAME}/wx | |
e90c1d2a | 5799 | fi |
afc31813 | 5800 | if test -f setup.h; then |
3a922bb4 | 5801 | mv -f setup.h lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h |
afc31813 | 5802 | fi |
a2cddd63 VZ |
5803 | ], |
5804 | [ | |
3a922bb4 | 5805 | TOOLCHAIN_NAME="${TOOLCHAIN_NAME}" |
07eb77a6 | 5806 | LN_S="${LN_S}" |
a2cddd63 VZ |
5807 | ] |
5808 | ) | |
9a98a854 | 5809 | |
e6cc62c6 | 5810 | |
08b3ac36 | 5811 | dnl Configure samples, contrib etc. directories, but only if they are present: |
6c3e36af VZ |
5812 | if test "$wxUSE_GUI" = "yes"; then |
5813 | SUBDIRS="samples demos utils contrib" | |
5814 | else dnl we build wxBase only | |
5815 | dnl there are no wxBase programs in contrib nor demos | |
5816 | SUBDIRS="samples utils" | |
5817 | fi | |
5818 | ||
166263e6 | 5819 | for subdir in `echo $SUBDIRS`; do |
08b3ac36 | 5820 | if test -d ${srcdir}/${subdir} ; then |
6c3e36af | 5821 | if test "$wxUSE_GUI" = "yes"; then |
166263e6 VZ |
5822 | if test ${subdir} = "samples"; then |
5823 | dnl only take those samples which compile in the current | |
5824 | dnl configuration and which exist | |
5825 | for sample in `echo $SAMPLES_SUBDIRS`; do | |
5826 | if test -d $srcdir/samples/$sample; then | |
5827 | makefiles="samples/$sample/Makefile.in $makefiles" | |
5828 | fi | |
5829 | done | |
5830 | else dnl assume that everything compiles for utils &c | |
5831 | makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)` | |
5832 | fi | |
6c3e36af VZ |
5833 | else dnl we build wxBase only |
5834 | dnl don't take all samples/utils, just those which build with | |
5835 | dnl wxBase | |
5836 | if test ${subdir} = "samples"; then | |
5837 | makefiles="samples/console/Makefile.in" | |
5838 | else dnl utils | |
5839 | makefiles="utils/HelpGen/Makefile.in \ | |
5840 | utils/HelpGen/src/Makefile.in \ | |
5841 | utils/makegen/Makefile.in" | |
5842 | fi | |
5843 | fi | |
5844 | ||
08b3ac36 VS |
5845 | for mkin in $makefiles ; do |
5846 | mk=`echo $mkin | sed 's/Makefile\.in/Makefile/g'` | |
5847 | AC_CONFIG_FILES([$mk]) | |
5848 | done | |
5849 | fi | |
5850 | done | |
e6cc62c6 VS |
5851 | |
5852 | ||
5853 | AC_OUTPUT | |
5854 | ||
2b5f62a0 VZ |
5855 | dnl report on what we decided to do |
5856 | echo | |
5857 | echo "Configured wxWindows ${WX_VERSION} for \`${host}'" | |
5858 | echo "" | |
5859 | echo " Which GUI toolkit should wxWindows use? ${TOOLKIT:-base only}" | |
08b3ac36 | 5860 | echo " Should wxWindows be compiled into single library? ${wxUSE_MONOLITHIC:-yes}" |
2b5f62a0 VZ |
5861 | |
5862 | echo " Should wxWindows be compiled in debug mode? ${wxUSE_DEBUG:-no}" | |
5863 | echo " Should wxWindows be linked as a shared library? ${wxUSE_SHARED:-no}" | |
5864 | echo " Should wxWindows be compiled in Unicode mode? ${wxUSE_UNICODE:-no}" | |
5865 | ||
0c98a14e GD |
5866 | echo " What level of wxWindows compatibility should be enabled?" |
5867 | echo " wxWindows 2.0 ${WXWIN_COMPATIBILITY_2:-no}" | |
65d8ef1e VS |
5868 | echo " wxWindows 2.2 ${WXWIN_COMPATIBILITY_2_2:-no}" |
5869 | echo " wxWindows 2.4 ${WXWIN_COMPATIBILITY_2_4:-yes}" | |
0c98a14e | 5870 | |
2b5f62a0 VZ |
5871 | echo " Which libraries should wxWindows use?" |
5872 | echo " jpeg ${wxUSE_LIBJPEG-none}" | |
5873 | echo " png ${wxUSE_LIBPNG-none}" | |
5874 | echo " regex ${wxUSE_REGEX}" | |
5875 | echo " tiff ${wxUSE_LIBTIFF-none}" | |
5876 | echo " zlib ${wxUSE_ZLIB}" | |
fd3d7534 | 5877 | echo " odbc ${wxUSE_ODBC}" |
2b5f62a0 VZ |
5878 | |
5879 | echo "" | |
5880 | ||
5881 | dnl vi: set et sts=4 sw=4 com=\:dnl: |