~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmithContribItems/wxthings/wxthings/build/aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2
 
 
3
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
 
# 2005  Free Software Foundation, Inc.
5
 
# This file is free software; the Free Software Foundation
6
 
# gives unlimited permission to copy and/or distribute it,
7
 
# with or without modifications, as long as this notice is preserved.
8
 
 
9
 
# This program is distributed in the hope that it will be useful,
10
 
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11
 
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
 
# PARTICULAR PURPOSE.
13
 
 
14
 
dnl ---------------------------------------------------------------------------
15
 
dnl Support macros for makefiles generated by BAKEFILE.
16
 
dnl ---------------------------------------------------------------------------
17
 
 
18
 
dnl Lots of compiler & linker detection code contained here was taken from
19
 
dnl wxWindows configure.in script (see http://www.wxwindows.org)
20
 
 
21
 
 
22
 
 
23
 
dnl ---------------------------------------------------------------------------
24
 
dnl AC_BAKEFILE_GNUMAKE
25
 
dnl
26
 
dnl Detects GNU make
27
 
dnl ---------------------------------------------------------------------------
28
 
 
29
 
AC_DEFUN([AC_BAKEFILE_GNUMAKE],
30
 
[
31
 
    dnl does make support "-include" (only GNU make does AFAIK)?
32
 
    AC_CACHE_CHECK([if make is GNU make], bakefile_cv_prog_makeisgnu,
33
 
    [
34
 
        if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null |
35
 
                egrep -s GNU > /dev/null); then
36
 
            bakefile_cv_prog_makeisgnu="yes"
37
 
        else
38
 
            bakefile_cv_prog_makeisgnu="no"
39
 
        fi
40
 
    ])
41
 
 
42
 
    if test "x$bakefile_cv_prog_makeisgnu" = "xyes"; then
43
 
        IF_GNU_MAKE=""
44
 
    else
45
 
        IF_GNU_MAKE="#"
46
 
    fi
47
 
    AC_SUBST(IF_GNU_MAKE)
48
 
])
49
 
 
50
 
dnl ---------------------------------------------------------------------------
51
 
dnl AC_BAKEFILE_PLATFORM
52
 
dnl
53
 
dnl Detects platform and sets PLATFORM_XXX variables accordingly
54
 
dnl ---------------------------------------------------------------------------
55
 
 
56
 
AC_DEFUN([AC_BAKEFILE_PLATFORM],
57
 
[
58
 
    PLATFORM_UNIX=0
59
 
    PLATFORM_WIN32=0
60
 
    PLATFORM_MSDOS=0
61
 
    PLATFORM_MAC=0
62
 
    PLATFORM_MACOS=0
63
 
    PLATFORM_MACOSX=0
64
 
    PLATFORM_OS2=0
65
 
    PLATFORM_BEOS=0
66
 
 
67
 
    if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then 
68
 
        case "${BAKEFILE_HOST}" in
69
 
            *-*-mingw32* )
70
 
                PLATFORM_WIN32=1
71
 
            ;;
72
 
            *-pc-msdosdjgpp )
73
 
                PLATFORM_MSDOS=1
74
 
            ;;
75
 
            *-pc-os2_emx | *-pc-os2-emx )
76
 
                PLATFORM_OS2=1
77
 
            ;;
78
 
            *-*-darwin* )
79
 
                PLATFORM_MAC=1
80
 
                PLATFORM_MACOSX=1
81
 
            ;; 
82
 
            *-*-beos* )
83
 
                PLATFORM_BEOS=1
84
 
            ;;
85
 
            powerpc-apple-macos* )
86
 
                PLATFORM_MAC=1
87
 
                PLATFORM_MACOS=1
88
 
            ;;
89
 
            * )
90
 
                PLATFORM_UNIX=1
91
 
            ;;
92
 
        esac
93
 
    else
94
 
        case "$BAKEFILE_FORCE_PLATFORM" in
95
 
            win32 )
96
 
                PLATFORM_WIN32=1
97
 
            ;;
98
 
            msdos )
99
 
                PLATFORM_MSDOS=1
100
 
            ;;
101
 
            os2 )
102
 
                PLATFORM_OS2=1
103
 
            ;;
104
 
            darwin )
105
 
                PLATFORM_MAC=1
106
 
                PLATFORM_MACOSX=1
107
 
            ;;
108
 
            unix )
109
 
                PLATFORM_UNIX=1
110
 
            ;;
111
 
            beos )
112
 
                PLATFORM_BEOS=1
113
 
            ;;
114
 
            * )
115
 
                AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM])
116
 
            ;;
117
 
        esac
118
 
    fi
119
 
 
120
 
    AC_SUBST(PLATFORM_UNIX)
121
 
    AC_SUBST(PLATFORM_WIN32)
122
 
    AC_SUBST(PLATFORM_MSDOS)
123
 
    AC_SUBST(PLATFORM_MAC)
124
 
    AC_SUBST(PLATFORM_MACOS)
125
 
    AC_SUBST(PLATFORM_MACOSX)
126
 
    AC_SUBST(PLATFORM_OS2)
127
 
    AC_SUBST(PLATFORM_BEOS)
128
 
])
129
 
 
130
 
 
131
 
dnl ---------------------------------------------------------------------------
132
 
dnl AC_BAKEFILE_PLATFORM_SPECIFICS
133
 
dnl
134
 
dnl Sets misc platform-specific settings
135
 
dnl ---------------------------------------------------------------------------
136
 
 
137
 
AC_DEFUN([AC_BAKEFILE_PLATFORM_SPECIFICS],
138
 
[
139
 
    AC_ARG_ENABLE([omf], AS_HELP_STRING([--enable-omf],
140
 
                                        [use OMF object format (OS/2)]),
141
 
                  [bk_os2_use_omf="$enableval"])
142
 
    
143
 
    case "${BAKEFILE_HOST}" in
144
 
      *-*-darwin* )
145
 
        dnl For Unix to MacOS X porting instructions, see:
146
 
        dnl http://fink.sourceforge.net/doc/porting/porting.html
147
 
        if test "x$GCC" = "xyes"; then
148
 
            CFLAGS="$CFLAGS -fno-common"
149
 
            CXXFLAGS="$CXXFLAGS -fno-common"
150
 
        fi
151
 
        if test "x$XLCC" = "xyes"; then
152
 
            CFLAGS="$CFLAGS -qnocommon"
153
 
            CXXFLAGS="$CXXFLAGS -qnocommon"
154
 
        fi
155
 
        ;;
156
 
 
157
 
      *-pc-os2_emx | *-pc-os2-emx )
158
 
        if test "x$bk_os2_use_omf" = "xyes" ; then
159
 
            AR=emxomfar
160
 
            RANLIB=:
161
 
            LDFLAGS="-Zomf $LDFLAGS"
162
 
            CFLAGS="-Zomf $CFLAGS"
163
 
            CXXFLAGS="-Zomf $CXXFLAGS"
164
 
            OS2_LIBEXT="lib"
165
 
        else
166
 
            OS2_LIBEXT="a"
167
 
        fi
168
 
        ;;
169
 
      
170
 
      i*86-*-beos* )
171
 
        LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS"
172
 
        ;;
173
 
    esac
174
 
])
175
 
 
176
 
dnl ---------------------------------------------------------------------------
177
 
dnl AC_BAKEFILE_SUFFIXES
178
 
dnl
179
 
dnl Detects shared various suffixes for shared libraries, libraries, programs,
180
 
dnl plugins etc.
181
 
dnl ---------------------------------------------------------------------------
182
 
 
183
 
AC_DEFUN([AC_BAKEFILE_SUFFIXES],
184
 
[
185
 
    SO_SUFFIX="so"
186
 
    SO_SUFFIX_MODULE="so"
187
 
    EXEEXT=""
188
 
    LIBPREFIX="lib"
189
 
    LIBEXT=".a"
190
 
    DLLPREFIX="lib"
191
 
    DLLPREFIX_MODULE=""
192
 
    DLLIMP_SUFFIX=""
193
 
    dlldir="$libdir"
194
 
    
195
 
    case "${BAKEFILE_HOST}" in
196
 
        *-hp-hpux* )
197
 
            SO_SUFFIX="sl"
198
 
            SO_SUFFIX_MODULE="sl"
199
 
        ;;
200
 
        *-*-aix* )
201
 
            dnl quoting from
202
 
            dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html:
203
 
            dnl     Both archive libraries and shared libraries on AIX have an
204
 
            dnl     .a extension. This will explain why you can't link with an
205
 
            dnl     .so and why it works with the name changed to .a.
206
 
            SO_SUFFIX="a"
207
 
            SO_SUFFIX_MODULE="a"
208
 
        ;;
209
 
        *-*-cygwin* )
210
 
            SO_SUFFIX="dll"
211
 
            SO_SUFFIX_MODULE="dll"
212
 
            DLLIMP_SUFFIX="dll.a"
213
 
            EXEEXT=".exe"
214
 
            DLLPREFIX="cyg"
215
 
            dlldir="$bindir"
216
 
        ;;
217
 
        *-*-mingw32* )
218
 
            SO_SUFFIX="dll"
219
 
            SO_SUFFIX_MODULE="dll"
220
 
            DLLIMP_SUFFIX="dll.a"
221
 
            EXEEXT=".exe"
222
 
            DLLPREFIX=""
223
 
            dlldir="$bindir"
224
 
        ;;
225
 
        *-pc-msdosdjgpp )
226
 
            EXEEXT=".exe"
227
 
            DLLPREFIX=""
228
 
            dlldir="$bindir"
229
 
        ;;
230
 
        *-pc-os2_emx | *-pc-os2-emx )
231
 
            SO_SUFFIX="dll"
232
 
            SO_SUFFIX_MODULE="dll"
233
 
            DLLIMP_SUFFIX=$OS2_LIBEXT
234
 
            EXEEXT=".exe"
235
 
            DLLPREFIX=""
236
 
            LIBPREFIX=""
237
 
            LIBEXT=".$OS2_LIBEXT"
238
 
            dlldir="$bindir"
239
 
        ;;
240
 
        *-*-darwin* )
241
 
            SO_SUFFIX="dylib"
242
 
            SO_SUFFIX_MODULE="bundle"
243
 
        ;;
244
 
    esac
245
 
 
246
 
    if test "x$DLLIMP_SUFFIX" = "x" ; then
247
 
        DLLIMP_SUFFIX="$SO_SUFFIX"
248
 
    fi
249
 
 
250
 
    AC_SUBST(SO_SUFFIX)
251
 
    AC_SUBST(SO_SUFFIX_MODULE)
252
 
    AC_SUBST(DLLIMP_SUFFIX)
253
 
    AC_SUBST(EXEEXT)
254
 
    AC_SUBST(LIBPREFIX)
255
 
    AC_SUBST(LIBEXT)
256
 
    AC_SUBST(DLLPREFIX)
257
 
    AC_SUBST(DLLPREFIX_MODULE)
258
 
    AC_SUBST(dlldir)
259
 
])
260
 
 
261
 
 
262
 
dnl ---------------------------------------------------------------------------
263
 
dnl AC_BAKEFILE_SHARED_LD
264
 
dnl
265
 
dnl Detects command for making shared libraries, substitutes SHARED_LD_CC
266
 
dnl and SHARED_LD_CXX.
267
 
dnl ---------------------------------------------------------------------------
268
 
 
269
 
AC_DEFUN([AC_BAKEFILE_SHARED_LD],
270
 
[
271
 
    dnl the extra compiler flags needed for compilation of shared library
272
 
    PIC_FLAG=""
273
 
    if test "x$GCC" = "xyes"; then
274
 
        dnl the switch for gcc is the same under all platforms
275
 
        PIC_FLAG="-fPIC"
276
 
    fi
277
 
    
278
 
    dnl Defaults for GCC and ELF .so shared libs:
279
 
    SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o"
280
 
    SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o"
281
 
    WINDOWS_IMPLIB=0
282
 
 
283
 
    case "${BAKEFILE_HOST}" in
284
 
      *-hp-hpux* )
285
 
        dnl default settings are good for gcc but not for the native HP-UX
286
 
        if test "x$GCC" != "xyes"; then
287
 
            dnl no idea why it wants it, but it does
288
 
            LDFLAGS="$LDFLAGS -L/usr/lib"
289
 
 
290
 
            SHARED_LD_CC="${CC} -b -o"
291
 
            SHARED_LD_CXX="${CXX} -b -o"
292
 
            PIC_FLAG="+Z"
293
 
        fi
294
 
      ;;
295
 
 
296
 
      *-*-linux* )
297
 
        if test "x$GCC" != "xyes"; then
298
 
            AC_CACHE_CHECK([for Intel compiler], bakefile_cv_prog_icc,
299
 
            [
300
 
                AC_TRY_COMPILE([],
301
 
                    [
302
 
                        #ifndef __INTEL_COMPILER
303
 
                        #error Not icc
304
 
                        #endif
305
 
                    ],
306
 
                    bakefile_cv_prog_icc=yes,
307
 
                    bakefile_cv_prog_icc=no
308
 
                )
309
 
            ])
310
 
            if test "$bakefile_cv_prog_icc" = "yes"; then
311
 
                PIC_FLAG="-KPIC"
312
 
            fi
313
 
        fi
314
 
      ;;
315
 
 
316
 
      *-*-solaris2* )
317
 
        if test "x$GCC" != xyes ; then
318
 
            SHARED_LD_CC="${CC} -G -o"
319
 
            SHARED_LD_CXX="${CXX} -G -o"
320
 
            PIC_FLAG="-KPIC"
321
 
        fi
322
 
      ;;
323
 
 
324
 
      *-*-darwin* )
325
 
        dnl Most apps benefit from being fully binded (its faster and static
326
 
        dnl variables initialized at startup work).
327
 
        dnl This can be done either with the exe linker flag -Wl,-bind_at_load
328
 
        dnl or with a double stage link in order to create a single module
329
 
        dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
330
 
 
331
 
        dnl If using newer dev tools then there is a -single_module flag that
332
 
        dnl we can use to do this, otherwise we'll need to use a helper
333
 
        dnl script.  Check the version of gcc to see which way we can go:
334
 
        AC_CACHE_CHECK([for gcc 3.1 or later], bakefile_cv_gcc31, [
335
 
           AC_TRY_COMPILE([],
336
 
               [
337
 
                   #if (__GNUC__ < 3) || \
338
 
                       ((__GNUC__ == 3) && (__GNUC_MINOR__ < 1))
339
 
                       #error old gcc
340
 
                   #endif
341
 
               ],
342
 
               [
343
 
                   bakefile_cv_gcc31=yes
344
 
               ],
345
 
               [
346
 
                   bakefile_cv_gcc31=no
347
 
               ]
348
 
           )
349
 
        ])
350
 
        if test "$bakefile_cv_gcc31" = "no"; then
351
 
            AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH
352
 
            chmod +x shared-ld-sh
353
 
 
354
 
            dnl Use the shared-ld-sh helper script
355
 
            SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o"
356
 
            SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o"
357
 
            SHARED_LD_CXX="$SHARED_LD_CC"
358
 
            SHARED_LD_MODULE_CXX="$SHARED_LD_MODULE_CC"
359
 
        else
360
 
            dnl Use the -single_module flag and let the linker do it for us
361
 
            SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o"
362
 
            SHARED_LD_MODULE_CC="\${CC} -bundle -single_module -headerpad_max_install_names -o"
363
 
            SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o"
364
 
            SHARED_LD_MODULE_CXX="\${CXX} -bundle -single_module -headerpad_max_install_names -o"
365
 
        fi
366
 
 
367
 
        if test "x$GCC" == "xyes"; then
368
 
            PIC_FLAG="-dynamic -fPIC"
369
 
        fi
370
 
        if test "x$XLCC" = "xyes"; then
371
 
            PIC_FLAG="-dynamic -DPIC"
372
 
        fi
373
 
      ;;
374
 
 
375
 
      *-*-aix* )
376
 
        if test "x$GCC" = "xyes"; then
377
 
            dnl at least gcc 2.95 warns that -fPIC is ignored when
378
 
            dnl compiling each and every file under AIX which is annoying,
379
 
            dnl so don't use it there (it's useless as AIX runs on
380
 
            dnl position-independent architectures only anyhow)
381
 
            PIC_FLAG=""
382
 
 
383
 
            dnl -bexpfull is needed by AIX linker to export all symbols (by
384
 
            dnl default it doesn't export any and even with -bexpall it
385
 
            dnl doesn't export all C++ support symbols, e.g. vtable
386
 
            dnl pointers) but it's only available starting from 5.1 (with
387
 
            dnl maintenance pack 2, whatever this is), see
388
 
            dnl http://www-128.ibm.com/developerworks/eserver/articles/gnu.html
389
 
            case "${BAKEFILE_HOST}" in
390
 
                *-*-aix5* )
391
 
                    LD_EXPFULL="-Wl,-bexpfull"
392
 
                    ;;
393
 
            esac
394
 
 
395
 
            SHARED_LD_CC="\$(CC) -shared $LD_EXPFULL -o"
396
 
            SHARED_LD_CXX="\$(CXX) -shared $LD_EXPFULL -o"
397
 
        else
398
 
            dnl FIXME: makeC++SharedLib is obsolete, what should we do for
399
 
            dnl        recent AIX versions?
400
 
            AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib,
401
 
                          makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib)
402
 
            SHARED_LD_CC="$AIX_CC_LD -p 0 -o"
403
 
            SHARED_LD_CXX="$AIX_CXX_LD -p 0 -o"
404
 
        fi
405
 
      ;;
406
 
 
407
 
      *-*-beos* )
408
 
        dnl can't use gcc under BeOS for shared library creation because it
409
 
        dnl complains about missing 'main'
410
 
        SHARED_LD_CC="${LD} -nostart -o"
411
 
        SHARED_LD_CXX="${LD} -nostart -o"
412
 
      ;;
413
 
 
414
 
      *-*-irix* )
415
 
        dnl default settings are ok for gcc
416
 
        if test "x$GCC" != "xyes"; then
417
 
            PIC_FLAG="-KPIC"
418
 
        fi
419
 
      ;;
420
 
      
421
 
      *-*-cygwin* | *-*-mingw32* )
422
 
        PIC_FLAG=""
423
 
        SHARED_LD_CC="\$(CC) -shared -o"
424
 
        SHARED_LD_CXX="\$(CXX) -shared -o"
425
 
        WINDOWS_IMPLIB=1
426
 
      ;;
427
 
 
428
 
      *-pc-os2_emx | *-pc-os2-emx )
429
 
        SHARED_LD_CC="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
430
 
        SHARED_LD_CXX="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
431
 
        PIC_FLAG=""
432
 
        AC_BAKEFILE_CREATE_FILE_DLLAR_SH
433
 
        chmod +x dllar.sh
434
 
      ;;
435
 
      
436
 
      powerpc-apple-macos* | \
437
 
      *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-k*bsd*-gnu | \
438
 
      *-*-sunos4* | \
439
 
      *-*-osf* | \
440
 
      *-*-dgux5* | \
441
 
      *-*-sysv5* | \
442
 
      *-pc-msdosdjgpp )
443
 
        dnl defaults are ok
444
 
      ;;
445
 
 
446
 
      *)
447
 
        AC_MSG_ERROR(unknown system type $BAKEFILE_HOST.)
448
 
    esac
449
 
 
450
 
    if test "x$PIC_FLAG" != "x" ; then
451
 
        PIC_FLAG="$PIC_FLAG -DPIC"
452
 
    fi
453
 
 
454
 
    if test "x$SHARED_LD_MODULE_CC" = "x" ; then
455
 
        SHARED_LD_MODULE_CC="$SHARED_LD_CC"
456
 
    fi
457
 
    if test "x$SHARED_LD_MODULE_CXX" = "x" ; then
458
 
        SHARED_LD_MODULE_CXX="$SHARED_LD_CXX"
459
 
    fi
460
 
 
461
 
    AC_SUBST(SHARED_LD_CC)
462
 
    AC_SUBST(SHARED_LD_CXX)
463
 
    AC_SUBST(SHARED_LD_MODULE_CC)
464
 
    AC_SUBST(SHARED_LD_MODULE_CXX)
465
 
    AC_SUBST(PIC_FLAG)
466
 
    AC_SUBST(WINDOWS_IMPLIB)
467
 
])
468
 
 
469
 
 
470
 
dnl ---------------------------------------------------------------------------
471
 
dnl AC_BAKEFILE_SHARED_VERSIONS
472
 
dnl
473
 
dnl Detects linker options for attaching versions (sonames) to shared  libs.
474
 
dnl ---------------------------------------------------------------------------
475
 
 
476
 
AC_DEFUN([AC_BAKEFILE_SHARED_VERSIONS],
477
 
[
478
 
    USE_SOVERSION=0
479
 
    USE_SOVERLINUX=0
480
 
    USE_SOVERSOLARIS=0
481
 
    USE_SOVERCYGWIN=0
482
 
    USE_SOSYMLINKS=0
483
 
    USE_MACVERSION=0
484
 
    SONAME_FLAG=
485
 
 
486
 
    case "${BAKEFILE_HOST}" in
487
 
      *-*-linux* | *-*-freebsd* | *-*-k*bsd*-gnu )
488
 
        SONAME_FLAG="-Wl,-soname,"
489
 
        USE_SOVERSION=1
490
 
        USE_SOVERLINUX=1
491
 
        USE_SOSYMLINKS=1
492
 
      ;;
493
 
 
494
 
      *-*-solaris2* )
495
 
        SONAME_FLAG="-h "
496
 
        USE_SOVERSION=1
497
 
        USE_SOVERSOLARIS=1
498
 
        USE_SOSYMLINKS=1
499
 
      ;;
500
 
 
501
 
      *-*-darwin* )
502
 
        USE_MACVERSION=1
503
 
        USE_SOVERSION=1
504
 
        USE_SOSYMLINKS=1
505
 
      ;;
506
 
 
507
 
      *-*-cygwin* )
508
 
        USE_SOVERSION=1
509
 
        USE_SOVERCYGWIN=1
510
 
      ;;
511
 
    esac
512
 
 
513
 
    AC_SUBST(USE_SOVERSION)
514
 
    AC_SUBST(USE_SOVERLINUX)
515
 
    AC_SUBST(USE_SOVERSOLARIS)
516
 
    AC_SUBST(USE_SOVERCYGWIN)
517
 
    AC_SUBST(USE_MACVERSION)
518
 
    AC_SUBST(USE_SOSYMLINKS)
519
 
    AC_SUBST(SONAME_FLAG)
520
 
])
521
 
 
522
 
 
523
 
dnl ---------------------------------------------------------------------------
524
 
dnl AC_BAKEFILE_DEPS
525
 
dnl
526
 
dnl Detects available C/C++ dependency tracking options
527
 
dnl ---------------------------------------------------------------------------
528
 
 
529
 
AC_DEFUN([AC_BAKEFILE_DEPS],
530
 
[
531
 
    AC_MSG_CHECKING([for dependency tracking method])
532
 
    DEPS_TRACKING=1
533
 
 
534
 
    if test "x$GCC" = "xyes"; then
535
 
        DEPSMODE=gcc
536
 
        case "${BAKEFILE_HOST}" in
537
 
            *-*-darwin* )
538
 
                dnl -cpp-precomp (the default) conflicts with -MMD option
539
 
                dnl used by bk-deps (see also http://developer.apple.com/documentation/Darwin/Conceptual/PortingUnix/compiling/chapter_4_section_3.html)
540
 
                DEPSFLAG="-no-cpp-precomp -MMD"
541
 
            ;;
542
 
            * )
543
 
                DEPSFLAG="-MMD"
544
 
            ;;
545
 
        esac
546
 
        AC_MSG_RESULT([gcc])
547
 
    elif test "x$MWCC" = "xyes"; then
548
 
        DEPSMODE=mwcc
549
 
        DEPSFLAG="-MM"
550
 
        AC_MSG_RESULT([mwcc])
551
 
    elif test "x$SUNCC" = "xyes"; then
552
 
        DEPSMODE=unixcc
553
 
        DEPSFLAG="-xM1"
554
 
        AC_MSG_RESULT([Sun cc])
555
 
    elif test "x$SGICC" = "xyes"; then
556
 
        DEPSMODE=unixcc
557
 
        DEPSFLAG="-M"
558
 
        AC_MSG_RESULT([SGI cc])
559
 
    elif test "x$HPCC" = "xyes"; then
560
 
        DEPSMODE=unixcc
561
 
        DEPSFLAG="+make"
562
 
        AC_MSG_RESULT([HP cc])
563
 
    elif test "x$COMPAQCC" = "xyes"; then
564
 
        DEPSMODE=gcc
565
 
        DEPSFLAG="-MD"
566
 
        AC_MSG_RESULT([Compaq cc])
567
 
    else
568
 
        DEPS_TRACKING=0
569
 
        AC_MSG_RESULT([none])
570
 
    fi
571
 
 
572
 
    if test $DEPS_TRACKING = 1 ; then
573
 
        AC_BAKEFILE_CREATE_FILE_BK_DEPS
574
 
        chmod +x bk-deps
575
 
    fi
576
 
 
577
 
    AC_SUBST(DEPS_TRACKING)
578
 
])
579
 
 
580
 
dnl ---------------------------------------------------------------------------
581
 
dnl AC_BAKEFILE_CHECK_BASIC_STUFF
582
 
dnl
583
 
dnl Checks for presence of basic programs, such as C and C++ compiler, "ranlib"
584
 
dnl or "install"
585
 
dnl ---------------------------------------------------------------------------
586
 
 
587
 
AC_DEFUN([AC_BAKEFILE_CHECK_BASIC_STUFF],
588
 
[
589
 
    AC_PROG_RANLIB
590
 
    AC_PROG_INSTALL
591
 
    AC_PROG_LN_S
592
 
 
593
 
    AC_PROG_MAKE_SET
594
 
    AC_SUBST(MAKE_SET)
595
 
    
596
 
    AC_CHECK_TOOL(AR, ar, ar)
597
 
    AC_CHECK_TOOL(STRIP, strip, :)
598
 
    AC_CHECK_TOOL(NM, nm, :)
599
 
 
600
 
    case ${BAKEFILE_HOST} in
601
 
        *-hp-hpux* )
602
 
            dnl HP-UX install doesn't handle the "-d" switch so don't
603
 
            dnl use it there
604
 
            INSTALL_DIR="mkdir -p"
605
 
            ;;
606
 
        *)  INSTALL_DIR="$INSTALL -d"
607
 
            ;;
608
 
    esac
609
 
    AC_SUBST(INSTALL_DIR)
610
 
 
611
 
    LDFLAGS_GUI=
612
 
    case ${BAKEFILE_HOST} in
613
 
        *-*-cygwin* | *-*-mingw32* )
614
 
        LDFLAGS_GUI="-mwindows"
615
 
    esac
616
 
    AC_SUBST(LDFLAGS_GUI)
617
 
])
618
 
 
619
 
 
620
 
dnl ---------------------------------------------------------------------------
621
 
dnl AC_BAKEFILE_RES_COMPILERS
622
 
dnl
623
 
dnl Checks for presence of resource compilers for win32 or mac
624
 
dnl ---------------------------------------------------------------------------
625
 
 
626
 
AC_DEFUN([AC_BAKEFILE_RES_COMPILERS],
627
 
[
628
 
    RESCOMP=
629
 
    SETFILE=
630
 
 
631
 
    case ${BAKEFILE_HOST} in 
632
 
        *-*-cygwin* | *-*-mingw32* )
633
 
            dnl Check for win32 resources compiler:
634
 
            if test "$build" != "$host" ; then
635
 
                RESCOMP=$host_alias-windres
636
 
            else
637
 
                AC_CHECK_PROG(RESCOMP, windres, windres, windres)
638
 
            fi
639
 
         ;;
640
 
 
641
 
      *-*-darwin* | powerpc-apple-macos* )
642
 
            AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez)
643
 
            AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile)
644
 
        ;;
645
 
    esac
646
 
 
647
 
    AC_SUBST(RESCOMP)
648
 
    AC_SUBST(SETFILE)
649
 
])
650
 
 
651
 
dnl ---------------------------------------------------------------------------
652
 
dnl AC_BAKEFILE_PRECOMP_HEADERS
653
 
dnl
654
 
dnl Check for precompiled headers support (GCC >= 3.4)
655
 
dnl ---------------------------------------------------------------------------
656
 
 
657
 
AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS],
658
 
[
659
 
 
660
 
    AC_ARG_ENABLE([precomp-headers],
661
 
                  AS_HELP_STRING([--disable-precomp-headers],
662
 
                                 [don't use precompiled headers even if compiler can]),
663
 
                  [bk_use_pch="$enableval"])
664
 
 
665
 
    GCC_PCH=0
666
 
 
667
 
    if test "x$bk_use_pch" = "x" -o "x$bk_use_pch" = "xyes" ; then
668
 
        if test "x$GCC" = "xyes"; then
669
 
            dnl test if we have gcc-3.4:
670
 
            AC_MSG_CHECKING([if the compiler supports precompiled headers])
671
 
            AC_TRY_COMPILE([],
672
 
                [
673
 
                    #if !defined(__GNUC__) || !defined(__GNUC_MINOR__)
674
 
                        #error "no pch support"
675
 
                    #endif
676
 
                    #if (__GNUC__ < 3)
677
 
                        #error "no pch support"
678
 
                    #endif
679
 
                    #if (__GNUC__ == 3) && \
680
 
                       ((!defined(__APPLE_CC__) && (__GNUC_MINOR__ < 4)) || \
681
 
                       ( defined(__APPLE_CC__) && (__GNUC_MINOR__ < 3)))
682
 
                        #error "no pch support"
683
 
                    #endif
684
 
                ],
685
 
                [
686
 
                    AC_MSG_RESULT([yes])
687
 
                    GCC_PCH=1
688
 
                ],
689
 
                [
690
 
                    AC_MSG_RESULT([no])
691
 
                ])
692
 
            if test $GCC_PCH = 1 ; then
693
 
                AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH
694
 
                chmod +x bk-make-pch
695
 
            fi
696
 
        fi
697
 
    fi
698
 
 
699
 
    AC_SUBST(GCC_PCH)
700
 
])
701
 
 
702
 
 
703
 
 
704
 
dnl ---------------------------------------------------------------------------
705
 
dnl AC_BAKEFILE([autoconf_inc.m4 inclusion])
706
 
dnl
707
 
dnl To be used in configure.in of any project using Bakefile-generated mks
708
 
dnl
709
 
dnl Behaviour can be modified by setting following variables:
710
 
dnl    BAKEFILE_CHECK_BASICS    set to "no" if you don't want bakefile to
711
 
dnl                             to perform check for basic tools like ranlib
712
 
dnl    BAKEFILE_HOST            set this to override host detection, defaults
713
 
dnl                             to ${host}
714
 
dnl    BAKEFILE_FORCE_PLATFORM  set to override platform detection
715
 
dnl
716
 
dnl Example usage:
717
 
dnl
718
 
dnl   AC_BAKEFILE([FOO(autoconf_inc.m4)])
719
 
dnl
720
 
dnl (replace FOO with m4_include above, aclocal would die otherwise)
721
 
dnl (yes, it's ugly, but thanks to a bug in aclocal, it's the only thing
722
 
dnl we can do...)
723
 
dnl ---------------------------------------------------------------------------
724
 
 
725
 
AC_DEFUN([AC_BAKEFILE],
726
 
[
727
 
    AC_PREREQ(2.58)
728
 
 
729
 
    if test "x$BAKEFILE_HOST" = "x"; then
730
 
        BAKEFILE_HOST="${host}"
731
 
    fi
732
 
 
733
 
    if test "x$BAKEFILE_CHECK_BASICS" != "xno"; then
734
 
        AC_BAKEFILE_CHECK_BASIC_STUFF
735
 
    fi
736
 
    AC_BAKEFILE_GNUMAKE
737
 
    AC_BAKEFILE_PLATFORM
738
 
    AC_BAKEFILE_PLATFORM_SPECIFICS
739
 
    AC_BAKEFILE_SUFFIXES
740
 
    AC_BAKEFILE_SHARED_LD
741
 
    AC_BAKEFILE_SHARED_VERSIONS
742
 
    AC_BAKEFILE_DEPS
743
 
    AC_BAKEFILE_RES_COMPILERS
744
 
 
745
 
    BAKEFILE_BAKEFILE_M4_VERSION="0.1.9"
746
 
   
747
 
    dnl includes autoconf_inc.m4:
748
 
    $1
749
 
    
750
 
    if test "$BAKEFILE_AUTOCONF_INC_M4_VERSION" = "" ; then
751
 
        AC_MSG_ERROR([No version found in autoconf_inc.m4 - bakefile macro was changed to take additional argument, perhaps configure.in wasn't updated (see the documentation)?])
752
 
    fi
753
 
    
754
 
    if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then
755
 
        AC_MSG_ERROR([Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match.])
756
 
    fi
757
 
])
758
 
        
759
 
 
760
 
dnl ---------------------------------------------------------------------------
761
 
dnl              Embedded copies of helper scripts follow:
762
 
dnl ---------------------------------------------------------------------------
763
 
 
764
 
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_DLLAR_SH],
765
 
[
766
 
dnl ===================== dllar.sh begins here =====================
767
 
dnl    (Created by merge-scripts.py from dllar.sh
768
 
dnl     file do not edit here!)
769
 
D='$'
770
 
cat <<EOF >dllar.sh
771
 
#!/bin/sh
772
 
#
773
 
# dllar - a tool to build both a .dll and an .a file
774
 
# from a set of object (.o) files for EMX/OS2.
775
 
#
776
 
#  Written by Andrew Zabolotny, bit@freya.etu.ru
777
 
#  Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de
778
 
#
779
 
#  This script will accept a set of files on the command line.
780
 
#  All the public symbols from the .o files will be exported into
781
 
#  a .DEF file, then linker will be run (through gcc) against them to
782
 
#  build a shared library consisting of all given .o files. All libraries
783
 
#  (.a) will be first decompressed into component .o files then act as
784
 
#  described above. You can optionally give a description (-d "description")
785
 
#  which will be put into .DLL. To see the list of accepted options (as well
786
 
#  as command-line format) simply run this program without options. The .DLL
787
 
#  is built to be imported by name (there is no guarantee that new versions
788
 
#  of the library you build will have same ordinals for same symbols).
789
 
#
790
 
#  dllar is free software; you can redistribute it and/or modify
791
 
#  it under the terms of the GNU General Public License as published by
792
 
#  the Free Software Foundation; either version 2, or (at your option)
793
 
#  any later version.
794
 
#
795
 
#  dllar is distributed in the hope that it will be useful,
796
 
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
797
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
798
 
#  GNU General Public License for more details.
799
 
#
800
 
#  You should have received a copy of the GNU General Public License
801
 
#  along with dllar; see the file COPYING.  If not, write to the Free
802
 
#  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
803
 
#  02111-1307, USA.
804
 
 
805
 
# To successfuly run this program you will need:
806
 
#  - Current drive should have LFN support (HPFS, ext2, network, etc)
807
 
#    (Sometimes dllar generates filenames which won't fit 8.3 scheme)
808
 
#  - gcc
809
 
#    (used to build the .dll)
810
 
#  - emxexp
811
 
#    (used to create .def file from .o files)
812
 
#  - emximp
813
 
#    (used to create .a file from .def file)
814
 
#  - GNU text utilites (cat, sort, uniq)
815
 
#    used to process emxexp output
816
 
#  - GNU file utilities (mv, rm)
817
 
#  - GNU sed
818
 
#  - lxlite (optional, see flag below)
819
 
#    (used for general .dll cleanup)
820
 
#
821
 
 
822
 
flag_USE_LXLITE=1;
823
 
 
824
 
#
825
 
# helper functions
826
 
# basnam, variant of basename, which does _not_ remove the path, _iff_
827
 
#                              second argument (suffix to remove) is given
828
 
basnam(){
829
 
    case ${D}# in
830
 
    1)
831
 
        echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//'
832
 
        ;;
833
 
    2)
834
 
        echo ${D}1 | sed 's/'${D}2'${D}//'
835
 
        ;;
836
 
    *)
837
 
        echo "error in basnam ${D}*"
838
 
        exit 8
839
 
        ;;
840
 
    esac
841
 
}
842
 
 
843
 
# Cleanup temporary files and output
844
 
CleanUp() {
845
 
    cd ${D}curDir
846
 
    for i in ${D}inputFiles ; do
847
 
        case ${D}i in
848
 
        *!)
849
 
            rm -rf \`basnam ${D}i !\`
850
 
            ;;
851
 
        *)
852
 
            ;;
853
 
        esac
854
 
    done
855
 
 
856
 
    # Kill result in case of failure as there is just to many stupid make/nmake
857
 
    # things out there which doesn't do this.
858
 
    if @<:@ ${D}# -eq 0 @:>@; then
859
 
        rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile
860
 
    fi
861
 
}
862
 
 
863
 
# Print usage and exit script with rc=1.
864
 
PrintHelp() {
865
 
 echo 'Usage: dllar.sh @<:@-o@<:@utput@:>@ output_file@:>@ @<:@-i@<:@mport@:>@ importlib_name@:>@'
866
 
 echo '       @<:@-name-mangler-script script.sh@:>@'
867
 
 echo '       @<:@-d@<:@escription@:>@ "dll descrption"@:>@ @<:@-cc "CC"@:>@ @<:@-f@<:@lags@:>@ "CFLAGS"@:>@'
868
 
 echo '       @<:@-ord@<:@inals@:>@@:>@ -ex@<:@clude@:>@ "symbol(s)"'
869
 
 echo '       @<:@-libf@<:@lags@:>@ "{INIT|TERM}{GLOBAL|INSTANCE}"@:>@ @<:@-nocrt@<:@dll@:>@@:>@ @<:@-nolxl@<:@ite@:>@@:>@'
870
 
 echo '       @<:@*.o@:>@ @<:@*.a@:>@'
871
 
 echo '*> "output_file" should have no extension.'
872
 
 echo '   If it has the .o, .a or .dll extension, it is automatically removed.'
873
 
 echo '   The import library name is derived from this and is set to "name".a,'
874
 
 echo '   unless overridden by -import'
875
 
 echo '*> "importlib_name" should have no extension.'
876
 
 echo '   If it has the .o, or .a extension, it is automatically removed.'
877
 
 echo '   This name is used as the import library name and may be longer and'
878
 
 echo '   more descriptive than the DLL name which has to follow the old '
879
 
 echo '   8.3 convention of FAT.'
880
 
 echo '*> "script.sh may be given to override the output_file name by a'
881
 
 echo '   different name. It is mainly useful if the regular make process'
882
 
 echo '   of some package does not take into account OS/2 restriction of'
883
 
 echo '   DLL name lengths. It takes the importlib name as input and is'
884
 
 echo '   supposed to procude a shorter name as output. The script should'
885
 
 echo '   expect to get importlib_name without extension and should produce'
886
 
 echo '   a (max.) 8 letter name without extension.'
887
 
 echo '*> "cc" is used to use another GCC executable.   (default: gcc.exe)'
888
 
 echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)'
889
 
 echo '   These flags will be put at the start of GCC command line.'
890
 
 echo '*> -ord@<:@inals@:>@ tells dllar to export entries by ordinals. Be careful.'
891
 
 echo '*> -ex@<:@clude@:>@ defines symbols which will not be exported. You can define'
892
 
 echo '   multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".'
893
 
 echo '   If the last character of a symbol is "*", all symbols beginning'
894
 
 echo '   with the prefix before "*" will be exclude, (see _GLOBAL* above).'
895
 
 echo '*> -libf@<:@lags@:>@ can be used to add INITGLOBAL/INITINSTANCE and/or'
896
 
 echo '   TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.'
897
 
 echo '*> -nocrt@<:@dll@:>@ switch will disable linking the library against emx''s'
898
 
 echo '   C runtime DLLs.'
899
 
 echo '*> -nolxl@<:@ite@:>@ switch will disable running lxlite on the resulting DLL.'
900
 
 echo '*> All other switches (for example -L./ or -lmylib) will be passed'
901
 
 echo '   unchanged to GCC at the end of command line.'
902
 
 echo '*> If you create a DLL from a library and you do not specify -o,'
903
 
 echo '   the basename for DLL and import library will be set to library name,'
904
 
 echo '   the initial library will be renamed to 'name'_s.a (_s for static)'
905
 
 echo '   i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial'
906
 
 echo '   library will be renamed into gcc_s.a.'
907
 
 echo '--------'
908
 
 echo 'Example:'
909
 
 echo '   dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord'
910
 
 echo '    -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"'
911
 
 CleanUp
912
 
 exit 1
913
 
}
914
 
 
915
 
# Execute a command.
916
 
# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script.
917
 
# @Uses    Whatever CleanUp() uses.
918
 
doCommand() {
919
 
    echo "${D}*"
920
 
    eval ${D}*
921
 
    rcCmd=${D}?
922
 
 
923
 
    if @<:@ ${D}rcCmd -ne 0 @:>@; then
924
 
        echo "command failed, exit code="${D}rcCmd
925
 
        CleanUp
926
 
        exit ${D}rcCmd
927
 
    fi
928
 
}
929
 
 
930
 
# main routine
931
 
# setup globals
932
 
cmdLine=${D}*
933
 
outFile=""
934
 
outimpFile=""
935
 
inputFiles=""
936
 
renameScript=""
937
 
description=""
938
 
CC=gcc.exe
939
 
CFLAGS="-s -Zcrtdll"
940
 
EXTRA_CFLAGS=""
941
 
EXPORT_BY_ORDINALS=0
942
 
exclude_symbols=""
943
 
library_flags=""
944
 
curDir=\`pwd\`
945
 
curDirS=curDir
946
 
case ${D}curDirS in
947
 
*/)
948
 
  ;;
949
 
*)
950
 
  curDirS=${D}{curDirS}"/"
951
 
  ;;
952
 
esac
953
 
# Parse commandline
954
 
libsToLink=0
955
 
omfLinking=0
956
 
while @<:@ ${D}1 @:>@; do
957
 
    case ${D}1 in
958
 
    -ord*)
959
 
        EXPORT_BY_ORDINALS=1;
960
 
        ;;
961
 
    -o*)
962
 
        shift
963
 
        outFile=${D}1
964
 
        ;;
965
 
    -i*)
966
 
        shift
967
 
        outimpFile=${D}1
968
 
        ;;
969
 
    -name-mangler-script)
970
 
        shift
971
 
        renameScript=${D}1
972
 
        ;;
973
 
    -d*)
974
 
        shift
975
 
        description=${D}1
976
 
        ;;
977
 
    -f*)
978
 
        shift
979
 
        CFLAGS=${D}1
980
 
        ;;
981
 
    -c*)
982
 
        shift
983
 
        CC=${D}1
984
 
        ;;
985
 
    -h*)
986
 
        PrintHelp
987
 
        ;;
988
 
    -ex*)
989
 
        shift
990
 
        exclude_symbols=${D}{exclude_symbols}${D}1" "
991
 
        ;;
992
 
    -libf*)
993
 
        shift
994
 
        library_flags=${D}{library_flags}${D}1" "
995
 
        ;;
996
 
    -nocrt*)
997
 
        CFLAGS="-s"
998
 
        ;;
999
 
    -nolxl*)
1000
 
        flag_USE_LXLITE=0
1001
 
        ;;
1002
 
    -* | /*)
1003
 
        case ${D}1 in
1004
 
        -L* | -l*)
1005
 
            libsToLink=1
1006
 
            ;;
1007
 
        -Zomf)
1008
 
            omfLinking=1
1009
 
            ;;
1010
 
        *)
1011
 
            ;;
1012
 
        esac
1013
 
        EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
1014
 
        ;;
1015
 
    *.dll)
1016
 
        EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`"
1017
 
        if @<:@ ${D}omfLinking -eq 1 @:>@; then
1018
 
            EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib"
1019
 
        else
1020
 
            EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a"
1021
 
        fi
1022
 
        ;;
1023
 
    *)
1024
 
        found=0;
1025
 
        if @<:@ ${D}libsToLink -ne 0 @:>@; then
1026
 
            EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
1027
 
        else
1028
 
            for file in ${D}1 ; do
1029
 
                if @<:@ -f ${D}file @:>@; then
1030
 
                    inputFiles="${D}{inputFiles} ${D}file"
1031
 
                    found=1
1032
 
                fi
1033
 
            done
1034
 
            if @<:@ ${D}found -eq 0 @:>@; then
1035
 
                echo "ERROR: No file(s) found: "${D}1
1036
 
                exit 8
1037
 
            fi
1038
 
        fi
1039
 
      ;;
1040
 
    esac
1041
 
    shift
1042
 
done # iterate cmdline words
1043
 
 
1044
 
#
1045
 
if @<:@ -z "${D}inputFiles" @:>@; then
1046
 
    echo "dllar: no input files"
1047
 
    PrintHelp
1048
 
fi
1049
 
 
1050
 
# Now extract all .o files from .a files
1051
 
newInputFiles=""
1052
 
for file in ${D}inputFiles ; do
1053
 
    case ${D}file in
1054
 
    *.a | *.lib)
1055
 
        case ${D}file in
1056
 
        *.a)
1057
 
            suffix=".a"
1058
 
            AR="ar"
1059
 
            ;;
1060
 
        *.lib)
1061
 
            suffix=".lib"
1062
 
            AR="emxomfar"
1063
 
            EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf"
1064
 
            ;;
1065
 
        *)
1066
 
            ;;
1067
 
        esac
1068
 
        dirname=\`basnam ${D}file ${D}suffix\`"_%"
1069
 
        mkdir ${D}dirname
1070
 
        if @<:@ ${D}? -ne 0 @:>@; then
1071
 
            echo "Failed to create subdirectory ./${D}dirname"
1072
 
            CleanUp
1073
 
            exit 8;
1074
 
        fi
1075
 
        # Append '!' to indicate archive
1076
 
        newInputFiles="${D}newInputFiles ${D}{dirname}!"
1077
 
        doCommand "cd ${D}dirname; ${D}AR x ../${D}file"
1078
 
        cd ${D}curDir
1079
 
        found=0;
1080
 
        for subfile in ${D}dirname/*.o* ; do
1081
 
            if @<:@ -f ${D}subfile @:>@; then
1082
 
                found=1
1083
 
                if @<:@ -s ${D}subfile @:>@; then
1084
 
                    # FIXME: This should be: is file size > 32 byte, _not_ > 0!
1085
 
                    newInputFiles="${D}newInputFiles ${D}subfile"
1086
 
                fi
1087
 
            fi
1088
 
        done
1089
 
        if @<:@ ${D}found -eq 0 @:>@; then
1090
 
            echo "WARNING: there are no files in archive \\'${D}file\\'"
1091
 
        fi
1092
 
        ;;
1093
 
    *)
1094
 
        newInputFiles="${D}{newInputFiles} ${D}file"
1095
 
        ;;
1096
 
    esac
1097
 
done
1098
 
inputFiles="${D}newInputFiles"
1099
 
 
1100
 
# Output filename(s).
1101
 
do_backup=0;
1102
 
if @<:@ -z ${D}outFile @:>@; then
1103
 
    do_backup=1;
1104
 
    set outFile ${D}inputFiles; outFile=${D}2
1105
 
fi
1106
 
 
1107
 
# If it is an archive, remove the '!' and the '_%' suffixes
1108
 
case ${D}outFile in
1109
 
*_%!)
1110
 
    outFile=\`basnam ${D}outFile _%!\`
1111
 
    ;;
1112
 
*)
1113
 
    ;;
1114
 
esac
1115
 
case ${D}outFile in
1116
 
*.dll)
1117
 
    outFile=\`basnam ${D}outFile .dll\`
1118
 
    ;;
1119
 
*.DLL)
1120
 
    outFile=\`basnam ${D}outFile .DLL\`
1121
 
    ;;
1122
 
*.o)
1123
 
    outFile=\`basnam ${D}outFile .o\`
1124
 
    ;;
1125
 
*.obj)
1126
 
    outFile=\`basnam ${D}outFile .obj\`
1127
 
    ;;
1128
 
*.a)
1129
 
    outFile=\`basnam ${D}outFile .a\`
1130
 
    ;;
1131
 
*.lib)
1132
 
    outFile=\`basnam ${D}outFile .lib\`
1133
 
    ;;
1134
 
*)
1135
 
    ;;
1136
 
esac
1137
 
case ${D}outimpFile in
1138
 
*.a)
1139
 
    outimpFile=\`basnam ${D}outimpFile .a\`
1140
 
    ;;
1141
 
*.lib)
1142
 
    outimpFile=\`basnam ${D}outimpFile .lib\`
1143
 
    ;;
1144
 
*)
1145
 
    ;;
1146
 
esac
1147
 
if @<:@ -z ${D}outimpFile @:>@; then
1148
 
    outimpFile=${D}outFile
1149
 
fi
1150
 
defFile="${D}{outFile}.def"
1151
 
arcFile="${D}{outimpFile}.a"
1152
 
arcFile2="${D}{outimpFile}.lib"
1153
 
 
1154
 
#create ${D}dllFile as something matching 8.3 restrictions,
1155
 
if @<:@ -z ${D}renameScript @:>@ ; then
1156
 
    dllFile="${D}outFile"
1157
 
else
1158
 
    dllFile=\`${D}renameScript ${D}outimpFile\`
1159
 
fi
1160
 
 
1161
 
if @<:@ ${D}do_backup -ne 0 @:>@ ; then
1162
 
    if @<:@ -f ${D}arcFile @:>@ ; then
1163
 
        doCommand "mv ${D}arcFile ${D}{outFile}_s.a"
1164
 
    fi
1165
 
    if @<:@ -f ${D}arcFile2 @:>@ ; then
1166
 
        doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib"
1167
 
    fi
1168
 
fi
1169
 
 
1170
 
# Extract public symbols from all the object files.
1171
 
tmpdefFile=${D}{defFile}_%
1172
 
rm -f ${D}tmpdefFile
1173
 
for file in ${D}inputFiles ; do
1174
 
    case ${D}file in
1175
 
    *!)
1176
 
        ;;
1177
 
    *)
1178
 
        doCommand "emxexp -u ${D}file >> ${D}tmpdefFile"
1179
 
        ;;
1180
 
    esac
1181
 
done
1182
 
 
1183
 
# Create the def file.
1184
 
rm -f ${D}defFile
1185
 
echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile
1186
 
dllFile="${D}{dllFile}.dll"
1187
 
if @<:@ ! -z ${D}description @:>@; then
1188
 
    echo "DESCRIPTION  \\"${D}{description}\\"" >> ${D}defFile
1189
 
fi
1190
 
echo "EXPORTS" >> ${D}defFile
1191
 
 
1192
 
doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%"
1193
 
grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile
1194
 
 
1195
 
# Checks if the export is ok or not.
1196
 
for word in ${D}exclude_symbols; do
1197
 
    grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}%
1198
 
    mv ${D}{tmpdefFile}% ${D}tmpdefFile
1199
 
done
1200
 
 
1201
 
 
1202
 
if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
1203
 
    sed "=" < ${D}tmpdefFile | \\
1204
 
    sed '
1205
 
      N
1206
 
      : loop
1207
 
      s/^\\(@<:@0-9@:>@\\+\\)\\(@<:@^;@:>@*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/
1208
 
      t loop
1209
 
    ' > ${D}{tmpdefFile}%
1210
 
    grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile
1211
 
else
1212
 
    rm -f ${D}{tmpdefFile}%
1213
 
fi
1214
 
cat ${D}tmpdefFile >> ${D}defFile
1215
 
rm -f ${D}tmpdefFile
1216
 
 
1217
 
# Do linking, create implib, and apply lxlite.
1218
 
gccCmdl="";
1219
 
for file in ${D}inputFiles ; do
1220
 
    case ${D}file in
1221
 
    *!)
1222
 
        ;;
1223
 
    *)
1224
 
        gccCmdl="${D}gccCmdl ${D}file"
1225
 
        ;;
1226
 
    esac
1227
 
done
1228
 
doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS"
1229
 
touch "${D}{outFile}.dll"
1230
 
 
1231
 
doCommand "emximp -o ${D}arcFile ${D}defFile"
1232
 
if @<:@ ${D}flag_USE_LXLITE -ne 0 @:>@; then
1233
 
    add_flags="";
1234
 
    if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
1235
 
        add_flags="-ynd"
1236
 
    fi
1237
 
    doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile"
1238
 
fi
1239
 
doCommand "emxomf -s -l ${D}arcFile"
1240
 
 
1241
 
# Successful exit.
1242
 
CleanUp 1
1243
 
exit 0
1244
 
EOF
1245
 
dnl ===================== dllar.sh ends here =====================
1246
 
])
1247
 
 
1248
 
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_DEPS],
1249
 
[
1250
 
dnl ===================== bk-deps begins here =====================
1251
 
dnl    (Created by merge-scripts.py from bk-deps
1252
 
dnl     file do not edit here!)
1253
 
D='$'
1254
 
cat <<EOF >bk-deps
1255
 
#!/bin/sh
1256
 
 
1257
 
# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
1258
 
# script. It is used to track C/C++ files dependencies in portable way.
1259
 
#
1260
 
# Permission is given to use this file in any way.
1261
 
 
1262
 
DEPSMODE=${DEPSMODE}
1263
 
DEPSDIR=.deps
1264
 
DEPSFLAG="${DEPSFLAG}"
1265
 
 
1266
 
mkdir -p ${D}DEPSDIR
1267
 
 
1268
 
if test ${D}DEPSMODE = gcc ; then
1269
 
    ${D}* ${D}{DEPSFLAG}
1270
 
    status=${D}?
1271
 
    if test ${D}{status} != 0 ; then
1272
 
        exit ${D}{status}
1273
 
    fi
1274
 
    # move created file to the location we want it in:
1275
 
    while test ${D}# -gt 0; do
1276
 
        case "${D}1" in
1277
 
            -o )
1278
 
                shift
1279
 
                objfile=${D}1
1280
 
            ;;
1281
 
            -* )
1282
 
            ;;
1283
 
            * )
1284
 
                srcfile=${D}1
1285
 
            ;;
1286
 
        esac
1287
 
        shift
1288
 
    done
1289
 
    depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\`
1290
 
    depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\`
1291
 
    if test -f ${D}depfile ; then
1292
 
        sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d
1293
 
        rm -f ${D}depfile
1294
 
    else
1295
 
        # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d
1296
 
        depfile=\`basename ${D}objfile | sed -e 's/\\..*${D}/.d/g'\`
1297
 
        if test ! -f ${D}depfile ; then
1298
 
            # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++)
1299
 
            depfile="${D}objfile.d"
1300
 
        fi
1301
 
        if test -f ${D}depfile ; then
1302
 
            sed -e "/^${D}objfile/!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d
1303
 
            rm -f ${D}depfile
1304
 
        fi
1305
 
    fi
1306
 
    exit 0
1307
 
elif test ${D}DEPSMODE = mwcc ; then
1308
 
    ${D}* || exit ${D}?
1309
 
    # Run mwcc again with -MM and redirect into the dep file we want
1310
 
    # NOTE: We can't use shift here because we need ${D}* to be valid
1311
 
    prevarg=
1312
 
    for arg in ${D}* ; do
1313
 
        if test "${D}prevarg" = "-o"; then
1314
 
            objfile=${D}arg
1315
 
        else
1316
 
            case "${D}arg" in
1317
 
                -* )
1318
 
                ;;
1319
 
                * )
1320
 
                    srcfile=${D}arg
1321
 
                ;;
1322
 
            esac
1323
 
        fi
1324
 
        prevarg="${D}arg"
1325
 
    done
1326
 
    ${D}* ${D}DEPSFLAG >${D}{DEPSDIR}/${D}{objfile}.d
1327
 
    exit 0
1328
 
elif test ${D}DEPSMODE = unixcc; then
1329
 
    ${D}* || exit ${D}?
1330
 
    # Run compiler again with deps flag and redirect into the dep file.
1331
 
    # It doesn't work if the '-o FILE' option is used, but without it the
1332
 
    # dependency file will contain the wrong name for the object. So it is
1333
 
    # removed from the command line, and the dep file is fixed with sed.
1334
 
    cmd=""
1335
 
    while test ${D}# -gt 0; do
1336
 
        case "${D}1" in
1337
 
            -o )
1338
 
                shift
1339
 
                objfile=${D}1
1340
 
            ;;
1341
 
            * )
1342
 
                eval arg${D}#=\\${D}1
1343
 
                cmd="${D}cmd \\${D}arg${D}#"
1344
 
            ;;
1345
 
        esac
1346
 
        shift
1347
 
    done
1348
 
    eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{DEPSDIR}/${D}{objfile}.d
1349
 
    exit 0
1350
 
else
1351
 
    ${D}*
1352
 
    exit ${D}?
1353
 
fi
1354
 
EOF
1355
 
dnl ===================== bk-deps ends here =====================
1356
 
])
1357
 
 
1358
 
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH],
1359
 
[
1360
 
dnl ===================== shared-ld-sh begins here =====================
1361
 
dnl    (Created by merge-scripts.py from shared-ld-sh
1362
 
dnl     file do not edit here!)
1363
 
D='$'
1364
 
cat <<EOF >shared-ld-sh
1365
 
#!/bin/sh
1366
 
#-----------------------------------------------------------------------------
1367
 
#-- Name:        distrib/mac/shared-ld-sh
1368
 
#-- Purpose:     Link a mach-o dynamic shared library for Darwin / Mac OS X
1369
 
#-- Author:      Gilles Depeyrot
1370
 
#-- Copyright:   (c) 2002 Gilles Depeyrot
1371
 
#-- Licence:     any use permitted
1372
 
#-----------------------------------------------------------------------------
1373
 
 
1374
 
verbose=0
1375
 
args=""
1376
 
objects=""
1377
 
linking_flag="-dynamiclib"
1378
 
ldargs="-r -keep_private_externs -nostdlib"
1379
 
 
1380
 
while test ${D}# -gt 0; do
1381
 
    case ${D}1 in
1382
 
 
1383
 
       -v)
1384
 
        verbose=1
1385
 
        ;;
1386
 
 
1387
 
       -o|-compatibility_version|-current_version|-framework|-undefined|-install_name)
1388
 
        # collect these options and values
1389
 
        args="${D}{args} ${D}1 ${D}2"
1390
 
        shift
1391
 
        ;;
1392
 
       
1393
 
       -s|-Wl,*)
1394
 
        # collect these load args
1395
 
        ldargs="${D}{ldargs} ${D}1"
1396
 
        ;;
1397
 
 
1398
 
       -l*|-L*|-flat_namespace|-headerpad_max_install_names)
1399
 
        # collect these options
1400
 
        args="${D}{args} ${D}1"
1401
 
        ;;
1402
 
 
1403
 
       -dynamiclib|-bundle)
1404
 
        linking_flag="${D}1"
1405
 
        ;;
1406
 
 
1407
 
       -*)
1408
 
        echo "shared-ld: unhandled option '${D}1'"
1409
 
        exit 1
1410
 
        ;;
1411
 
 
1412
 
        *.o | *.a | *.dylib)
1413
 
        # collect object files
1414
 
        objects="${D}{objects} ${D}1"
1415
 
        ;;
1416
 
 
1417
 
        *)
1418
 
        echo "shared-ld: unhandled argument '${D}1'"
1419
 
        exit 1
1420
 
        ;;
1421
 
 
1422
 
    esac
1423
 
    shift
1424
 
done
1425
 
 
1426
 
status=0
1427
 
 
1428
 
#
1429
 
# Link one module containing all the others
1430
 
#
1431
 
if test ${D}{verbose} = 1; then
1432
 
    echo "c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o"
1433
 
fi
1434
 
c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o
1435
 
status=${D}?
1436
 
 
1437
 
#
1438
 
# Link the shared library from the single module created, but only if the
1439
 
# previous command didn't fail:
1440
 
#
1441
 
if test ${D}{status} = 0; then
1442
 
    if test ${D}{verbose} = 1; then
1443
 
        echo "c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}"
1444
 
    fi
1445
 
    c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}
1446
 
    status=${D}?
1447
 
fi
1448
 
 
1449
 
#
1450
 
# Remove intermediate module
1451
 
#
1452
 
rm -f master.${D}${D}.o
1453
 
 
1454
 
exit ${D}status
1455
 
EOF
1456
 
dnl ===================== shared-ld-sh ends here =====================
1457
 
])
1458
 
 
1459
 
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH],
1460
 
[
1461
 
dnl ===================== bk-make-pch begins here =====================
1462
 
dnl    (Created by merge-scripts.py from bk-make-pch
1463
 
dnl     file do not edit here!)
1464
 
D='$'
1465
 
cat <<EOF >bk-make-pch
1466
 
#!/bin/sh
1467
 
 
1468
 
# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
1469
 
# script. It is used to generated precompiled headers.
1470
 
#
1471
 
# Permission is given to use this file in any way.
1472
 
 
1473
 
outfile="${D}{1}"
1474
 
header="${D}{2}"
1475
 
shift
1476
 
shift
1477
 
 
1478
 
compiler=
1479
 
headerfile=
1480
 
while test ${D}{#} -gt 0; do
1481
 
    case "${D}{1}" in
1482
 
        -I* )
1483
 
            incdir=\`echo ${D}{1} | sed -e 's/-I\\(.*\\)/\\1/g'\`
1484
 
            if test "x${D}{headerfile}" = "x" -a -f "${D}{incdir}/${D}{header}" ; then
1485
 
                headerfile="${D}{incdir}/${D}{header}"
1486
 
            fi
1487
 
        ;;
1488
 
    esac
1489
 
    compiler="${D}{compiler} ${D}{1}"
1490
 
    shift
1491
 
done
1492
 
 
1493
 
if test "x${D}{headerfile}" = "x" ; then
1494
 
    echo "error: can't find header ${D}{header} in include paths" >2
1495
 
else
1496
 
    if test -f ${D}{outfile} ; then
1497
 
        rm -f ${D}{outfile}
1498
 
    else
1499
 
        mkdir -p \`dirname ${D}{outfile}\`
1500
 
    fi
1501
 
    depsfile=".deps/\`echo ${D}{outfile} | tr '/.' '__'\`.d"
1502
 
    mkdir -p .deps
1503
 
    # can do this because gcc is >= 3.4:
1504
 
    ${D}{compiler} -o ${D}{outfile} -MMD -MF "${D}{depsfile}" "${D}{headerfile}"
1505
 
    exit ${D}{?}
1506
 
fi
1507
 
EOF
1508
 
dnl ===================== bk-make-pch ends here =====================
1509
 
])
1510
 
 
1511
 
# Configure paths for LIBXML2
1512
 
# Mike Hommey 2004-06-19
1513
 
# use CPPFLAGS instead of CFLAGS
1514
 
# Toshio Kuratomi 2001-04-21
1515
 
# Adapted from:
1516
 
# Configure paths for GLIB
1517
 
# Owen Taylor     97-11-3
1518
 
 
1519
 
dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1520
 
dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
1521
 
dnl
1522
 
AC_DEFUN([AM_PATH_XML2],[ 
1523
 
AC_ARG_WITH(xml-prefix,
1524
 
            [  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)],
1525
 
            xml_config_prefix="$withval", xml_config_prefix="")
1526
 
AC_ARG_WITH(xml-exec-prefix,
1527
 
            [  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
1528
 
            xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
1529
 
AC_ARG_ENABLE(xmltest,
1530
 
              [  --disable-xmltest       Do not try to compile and run a test LIBXML program],,
1531
 
              enable_xmltest=yes)
1532
 
 
1533
 
  if test x$xml_config_exec_prefix != x ; then
1534
 
     xml_config_args="$xml_config_args"
1535
 
     if test x${XML2_CONFIG+set} != xset ; then
1536
 
        XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
1537
 
     fi
1538
 
  fi
1539
 
  if test x$xml_config_prefix != x ; then
1540
 
     xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
1541
 
     if test x${XML2_CONFIG+set} != xset ; then
1542
 
        XML2_CONFIG=$xml_config_prefix/bin/xml2-config
1543
 
     fi
1544
 
  fi
1545
 
 
1546
 
  AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
1547
 
  min_xml_version=ifelse([$1], ,2.0.0,[$1])
1548
 
  AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
1549
 
  no_xml=""
1550
 
  if test "$XML2_CONFIG" = "no" ; then
1551
 
    no_xml=yes
1552
 
  else
1553
 
    XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
1554
 
    XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
1555
 
    xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
1556
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1557
 
    xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
1558
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1559
 
    xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
1560
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1561
 
    if test "x$enable_xmltest" = "xyes" ; then
1562
 
      ac_save_CPPFLAGS="$CPPFLAGS"
1563
 
      ac_save_LIBS="$LIBS"
1564
 
      CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
1565
 
      LIBS="$XML_LIBS $LIBS"
1566
 
dnl
1567
 
dnl Now check if the installed libxml is sufficiently new.
1568
 
dnl (Also sanity checks the results of xml2-config to some extent)
1569
 
dnl
1570
 
      rm -f conf.xmltest
1571
 
      AC_TRY_RUN([
1572
 
#include <stdlib.h>
1573
 
#include <stdio.h>
1574
 
#include <string.h>
1575
 
#include <libxml/xmlversion.h>
1576
 
 
1577
 
int 
1578
 
main()
1579
 
{
1580
 
  int xml_major_version, xml_minor_version, xml_micro_version;
1581
 
  int major, minor, micro;
1582
 
  char *tmp_version;
1583
 
 
1584
 
  system("touch conf.xmltest");
1585
 
 
1586
 
  /* Capture xml2-config output via autoconf/configure variables */
1587
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
1588
 
  tmp_version = (char *)strdup("$min_xml_version");
1589
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1590
 
     printf("%s, bad version string from xml2-config\n", "$min_xml_version");
1591
 
     exit(1);
1592
 
   }
1593
 
   free(tmp_version);
1594
 
 
1595
 
   /* Capture the version information from the header files */
1596
 
   tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
1597
 
   if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
1598
 
     printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
1599
 
     exit(1);
1600
 
   }
1601
 
   free(tmp_version);
1602
 
 
1603
 
 /* Compare xml2-config output to the libxml headers */
1604
 
  if ((xml_major_version != $xml_config_major_version) ||
1605
 
      (xml_minor_version != $xml_config_minor_version) ||
1606
 
      (xml_micro_version != $xml_config_micro_version))
1607
 
    {
1608
 
      printf("*** libxml header files (version %d.%d.%d) do not match\n",
1609
 
         xml_major_version, xml_minor_version, xml_micro_version);
1610
 
      printf("*** xml2-config (version %d.%d.%d)\n",
1611
 
         $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
1612
 
      return 1;
1613
 
    } 
1614
 
/* Compare the headers to the library to make sure we match */
1615
 
  /* Less than ideal -- doesn't provide us with return value feedback, 
1616
 
   * only exits if there's a serious mismatch between header and library.
1617
 
   */
1618
 
    LIBXML_TEST_VERSION;
1619
 
 
1620
 
    /* Test that the library is greater than our minimum version */
1621
 
    if ((xml_major_version > major) ||
1622
 
        ((xml_major_version == major) && (xml_minor_version > minor)) ||
1623
 
        ((xml_major_version == major) && (xml_minor_version == minor) &&
1624
 
        (xml_micro_version >= micro)))
1625
 
      {
1626
 
        return 0;
1627
 
       }
1628
 
     else
1629
 
      {
1630
 
        printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
1631
 
               xml_major_version, xml_minor_version, xml_micro_version);
1632
 
        printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
1633
 
           major, minor, micro);
1634
 
        printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
1635
 
        printf("***\n");
1636
 
        printf("*** If you have already installed a sufficiently new version, this error\n");
1637
 
        printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
1638
 
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
1639
 
        printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
1640
 
        printf("*** correct copy of xml2-config. (In this case, you will have to\n");
1641
 
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1642
 
        printf("*** so that the correct libraries are found at run-time))\n");
1643
 
    }
1644
 
  return 1;
1645
 
}
1646
 
],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1647
 
       CPPFLAGS="$ac_save_CPPFLAGS"
1648
 
       LIBS="$ac_save_LIBS"
1649
 
     fi
1650
 
  fi
1651
 
 
1652
 
  if test "x$no_xml" = x ; then
1653
 
     AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
1654
 
     ifelse([$2], , :, [$2])     
1655
 
  else
1656
 
     AC_MSG_RESULT(no)
1657
 
     if test "$XML2_CONFIG" = "no" ; then
1658
 
       echo "*** The xml2-config script installed by LIBXML could not be found"
1659
 
       echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
1660
 
       echo "*** your path, or set the XML2_CONFIG environment variable to the"
1661
 
       echo "*** full path to xml2-config."
1662
 
     else
1663
 
       if test -f conf.xmltest ; then
1664
 
        :
1665
 
       else
1666
 
          echo "*** Could not run libxml test program, checking why..."
1667
 
          CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
1668
 
          LIBS="$LIBS $XML_LIBS"
1669
 
          AC_TRY_LINK([
1670
 
#include <libxml/xmlversion.h>
1671
 
#include <stdio.h>
1672
 
],      [ LIBXML_TEST_VERSION; return 0;],
1673
 
        [ echo "*** The test program compiled, but did not run. This usually means"
1674
 
          echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
1675
 
          echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
1676
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1677
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1678
 
          echo "*** is required on your system"
1679
 
          echo "***"
1680
 
          echo "*** If you have an old version installed, it is best to remove it, although"
1681
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1682
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1683
 
          echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
1684
 
          echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
1685
 
          echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
1686
 
          CPPFLAGS="$ac_save_CPPFLAGS"
1687
 
          LIBS="$ac_save_LIBS"
1688
 
       fi
1689
 
     fi
1690
 
 
1691
 
     XML_CPPFLAGS=""
1692
 
     XML_LIBS=""
1693
 
     ifelse([$3], , :, [$3])
1694
 
  fi
1695
 
  AC_SUBST(XML_CPPFLAGS)
1696
 
  AC_SUBST(XML_LIBS)
1697
 
  rm -f conf.xmltest
1698
 
])
1699
 
 
1700
 
dnl ---------------------------------------------------------------------------
1701
 
dnl Macros for wxWidgets detection. Typically used in configure.in as:
1702
 
dnl
1703
 
dnl     AC_ARG_ENABLE(...)
1704
 
dnl     AC_ARG_WITH(...)
1705
 
dnl        ...
1706
 
dnl     AM_OPTIONS_WXCONFIG
1707
 
dnl        ...
1708
 
dnl        ...
1709
 
dnl     AM_PATH_WXCONFIG(2.6.0, wxWin=1)
1710
 
dnl     if test "$wxWin" != 1; then
1711
 
dnl        AC_MSG_ERROR([
1712
 
dnl                wxWidgets must be installed on your system
1713
 
dnl                but wx-config script couldn't be found.
1714
 
dnl
1715
 
dnl                Please check that wx-config is in path, the directory
1716
 
dnl                where wxWidgets libraries are installed (returned by
1717
 
dnl                'wx-config --libs' command) is in LD_LIBRARY_PATH or
1718
 
dnl                equivalent variable and wxWidgets version is 2.3.4 or above.
1719
 
dnl        ])
1720
 
dnl     fi
1721
 
dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
1722
 
dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
1723
 
dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
1724
 
dnl
1725
 
dnl     LIBS="$LIBS $WX_LIBS"
1726
 
dnl ---------------------------------------------------------------------------
1727
 
 
1728
 
dnl ---------------------------------------------------------------------------
1729
 
dnl AM_OPTIONS_WXCONFIG
1730
 
dnl
1731
 
dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
1732
 
dnl --wx-config command line options
1733
 
dnl ---------------------------------------------------------------------------
1734
 
 
1735
 
AC_DEFUN([AM_OPTIONS_WXCONFIG],
1736
 
[
1737
 
    AC_ARG_WITH(wxdir,
1738
 
                [  --with-wxdir=PATH       Use uninstalled version of wxWidgets in PATH],
1739
 
                [ wx_config_name="$withval/wx-config"
1740
 
                  wx_config_args="--inplace"])
1741
 
    AC_ARG_WITH(wx-config,
1742
 
                [  --with-wx-config=CONFIG wx-config script to use (optional)],
1743
 
                wx_config_name="$withval" )
1744
 
    AC_ARG_WITH(wx-prefix,
1745
 
                [  --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
1746
 
                wx_config_prefix="$withval", wx_config_prefix="")
1747
 
    AC_ARG_WITH(wx-exec-prefix,
1748
 
                [  --with-wx-exec-prefix=PREFIX
1749
 
                          Exec prefix where wxWidgets is installed (optional)],
1750
 
                wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
1751
 
])
1752
 
 
1753
 
dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
1754
 
dnl wx_ver_ok=yes if it is:
1755
 
AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
1756
 
[
1757
 
    wx_ver_ok=""
1758
 
    if test "x$WX_VERSION" != x ; then
1759
 
      if test $wx_config_major_version -gt $1; then
1760
 
        wx_ver_ok=yes
1761
 
      else
1762
 
        if test $wx_config_major_version -eq $1; then
1763
 
           if test $wx_config_minor_version -gt $2; then
1764
 
              wx_ver_ok=yes
1765
 
           else
1766
 
              if test $wx_config_minor_version -eq $2; then
1767
 
                 if test $wx_config_micro_version -ge $3; then
1768
 
                    wx_ver_ok=yes
1769
 
                 fi
1770
 
              fi
1771
 
           fi
1772
 
        fi
1773
 
      fi
1774
 
    fi
1775
 
])
1776
 
 
1777
 
dnl ---------------------------------------------------------------------------
1778
 
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
1779
 
dnl                  [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
1780
 
dnl
1781
 
dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
1782
 
dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
1783
 
dnl environment variable to override the default name of the wx-config script
1784
 
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
1785
 
dnl case the macro won't even waste time on tests for its existence.
1786
 
dnl
1787
 
dnl Optional WX-LIBS argument contains comma- or space-separated list of
1788
 
dnl wxWidgets libraries to link against (it may include contrib libraries). If
1789
 
dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
1790
 
dnl link with all of the core wxWidgets libraries.
1791
 
dnl
1792
 
dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
1793
 
dnl invocation command in present. It can be used to fine-tune lookup of
1794
 
dnl best wxWidgets build available.
1795
 
dnl
1796
 
dnl Example use:
1797
 
dnl   AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
1798
 
dnl                    [--unicode --debug])
1799
 
dnl ---------------------------------------------------------------------------
1800
 
 
1801
 
dnl
1802
 
dnl Get the cflags and libraries from the wx-config script
1803
 
dnl
1804
 
AC_DEFUN([AM_PATH_WXCONFIG],
1805
 
[
1806
 
  dnl do we have wx-config name: it can be wx-config or wxd-config or ...
1807
 
  if test x${WX_CONFIG_NAME+set} != xset ; then
1808
 
     WX_CONFIG_NAME=wx-config
1809
 
  fi
1810
 
 
1811
 
  if test "x$wx_config_name" != x ; then
1812
 
     WX_CONFIG_NAME="$wx_config_name"
1813
 
  fi
1814
 
 
1815
 
  dnl deal with optional prefixes
1816
 
  if test x$wx_config_exec_prefix != x ; then
1817
 
     wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
1818
 
     WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
1819
 
  fi
1820
 
  if test x$wx_config_prefix != x ; then
1821
 
     wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
1822
 
     WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
1823
 
  fi
1824
 
  if test "$cross_compiling" = "yes"; then
1825
 
     wx_config_args="$wx_config_args --host=$host_alias"
1826
 
  fi
1827
 
 
1828
 
  dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
1829
 
  if test -x "$WX_CONFIG_NAME" ; then
1830
 
     AC_MSG_CHECKING(for wx-config)
1831
 
     WX_CONFIG_PATH="$WX_CONFIG_NAME"
1832
 
     AC_MSG_RESULT($WX_CONFIG_PATH)
1833
 
  else
1834
 
     AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
1835
 
  fi
1836
 
 
1837
 
  if test "$WX_CONFIG_PATH" != "no" ; then
1838
 
    WX_VERSION=""
1839
 
 
1840
 
    min_wx_version=ifelse([$1], ,2.2.1,$1)
1841
 
    if test -z "$5" ; then
1842
 
      AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
1843
 
    else
1844
 
      AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
1845
 
    fi
1846
 
 
1847
 
    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
1848
 
 
1849
 
    WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
1850
 
    wx_config_major_version=`echo $WX_VERSION | \
1851
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1852
 
    wx_config_minor_version=`echo $WX_VERSION | \
1853
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1854
 
    wx_config_micro_version=`echo $WX_VERSION | \
1855
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1856
 
 
1857
 
    wx_requested_major_version=`echo $min_wx_version | \
1858
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1859
 
    wx_requested_minor_version=`echo $min_wx_version | \
1860
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1861
 
    wx_requested_micro_version=`echo $min_wx_version | \
1862
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1863
 
 
1864
 
    _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
1865
 
                              [$wx_requested_minor_version],
1866
 
                              [$wx_requested_micro_version])
1867
 
 
1868
 
    if test -n "$wx_ver_ok"; then
1869
 
 
1870
 
      AC_MSG_RESULT(yes (version $WX_VERSION))
1871
 
      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
1872
 
 
1873
 
      dnl is this even still appropriate?  --static is a real option now
1874
 
      dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
1875
 
      dnl what the user actually wants, making this redundant at best.
1876
 
      dnl For now keep it in case anyone actually used it in the past.
1877
 
      AC_MSG_CHECKING([for wxWidgets static library])
1878
 
      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
1879
 
      if test "x$WX_LIBS_STATIC" = "x"; then
1880
 
        AC_MSG_RESULT(no)
1881
 
      else
1882
 
        AC_MSG_RESULT(yes)
1883
 
      fi
1884
 
 
1885
 
      dnl starting with version 2.2.6 wx-config has --cppflags argument
1886
 
      wx_has_cppflags=""
1887
 
      if test $wx_config_major_version -gt 2; then
1888
 
        wx_has_cppflags=yes
1889
 
      else
1890
 
        if test $wx_config_major_version -eq 2; then
1891
 
           if test $wx_config_minor_version -gt 2; then
1892
 
              wx_has_cppflags=yes
1893
 
           else
1894
 
              if test $wx_config_minor_version -eq 2; then
1895
 
                 if test $wx_config_micro_version -ge 6; then
1896
 
                    wx_has_cppflags=yes
1897
 
                 fi
1898
 
              fi
1899
 
           fi
1900
 
        fi
1901
 
      fi
1902
 
 
1903
 
      if test "x$wx_has_cppflags" = x ; then
1904
 
         dnl no choice but to define all flags like CFLAGS
1905
 
         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
1906
 
         WX_CPPFLAGS=$WX_CFLAGS
1907
 
         WX_CXXFLAGS=$WX_CFLAGS
1908
 
 
1909
 
         WX_CFLAGS_ONLY=$WX_CFLAGS
1910
 
         WX_CXXFLAGS_ONLY=$WX_CFLAGS
1911
 
      else
1912
 
         dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
1913
 
         WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
1914
 
         WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
1915
 
         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
1916
 
 
1917
 
         WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
1918
 
         WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
1919
 
      fi
1920
 
 
1921
 
      ifelse([$2], , :, [$2])
1922
 
 
1923
 
    else
1924
 
 
1925
 
       if test "x$WX_VERSION" = x; then
1926
 
          dnl no wx-config at all
1927
 
          AC_MSG_RESULT(no)
1928
 
       else
1929
 
          AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
1930
 
       fi
1931
 
 
1932
 
       WX_CFLAGS=""
1933
 
       WX_CPPFLAGS=""
1934
 
       WX_CXXFLAGS=""
1935
 
       WX_LIBS=""
1936
 
       WX_LIBS_STATIC=""
1937
 
       ifelse([$3], , :, [$3])
1938
 
 
1939
 
    fi
1940
 
  else
1941
 
 
1942
 
    WX_CFLAGS=""
1943
 
    WX_CPPFLAGS=""
1944
 
    WX_CXXFLAGS=""
1945
 
    WX_LIBS=""
1946
 
    WX_LIBS_STATIC=""
1947
 
    ifelse([$3], , :, [$3])
1948
 
 
1949
 
  fi
1950
 
 
1951
 
  AC_SUBST(WX_CPPFLAGS)
1952
 
  AC_SUBST(WX_CFLAGS)
1953
 
  AC_SUBST(WX_CXXFLAGS)
1954
 
  AC_SUBST(WX_CFLAGS_ONLY)
1955
 
  AC_SUBST(WX_CXXFLAGS_ONLY)
1956
 
  AC_SUBST(WX_LIBS)
1957
 
  AC_SUBST(WX_LIBS_STATIC)
1958
 
  AC_SUBST(WX_VERSION)
1959
 
])
1960
 
 
1961
 
dnl ---------------------------------------------------------------------------
1962
 
dnl Get information on the wxrc program for making C++, Python and xrs
1963
 
dnl resource files.
1964
 
dnl
1965
 
dnl     AC_ARG_ENABLE(...)
1966
 
dnl     AC_ARG_WITH(...)
1967
 
dnl        ...
1968
 
dnl     AM_OPTIONS_WXCONFIG
1969
 
dnl     AM_OPTIONS_WXRC
1970
 
dnl        ...
1971
 
dnl     AM_PATH_WXCONFIG(2.6.0, wxWin=1)
1972
 
dnl     if test "$wxWin" != 1; then
1973
 
dnl        AC_MSG_ERROR([
1974
 
dnl                wxWidgets must be installed on your system
1975
 
dnl                but wx-config script couldn't be found.
1976
 
dnl
1977
 
dnl                Please check that wx-config is in path, the directory
1978
 
dnl                where wxWidgets libraries are installed (returned by
1979
 
dnl                'wx-config --libs' command) is in LD_LIBRARY_PATH or
1980
 
dnl                equivalent variable and wxWidgets version is 2.6.0 or above.
1981
 
dnl        ])
1982
 
dnl     fi
1983
 
dnl
1984
 
dnl     AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0])
1985
 
dnl     if test "x$HAVE_WXRC" != x1; then
1986
 
dnl         AC_MSG_ERROR([
1987
 
dnl                The wxrc program was not installed or not found.
1988
 
dnl     
1989
 
dnl                Please check the wxWidgets installation.
1990
 
dnl         ])
1991
 
dnl     fi
1992
 
dnl
1993
 
dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
1994
 
dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
1995
 
dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
1996
 
dnl
1997
 
dnl     LDFLAGS="$LDFLAGS $WX_LIBS"
1998
 
dnl ---------------------------------------------------------------------------
1999
 
 
2000
 
 
2001
 
 
2002
 
dnl ---------------------------------------------------------------------------
2003
 
dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
2004
 
dnl
2005
 
dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
2006
 
dnl resources.  The variable WXRC will be set and substituted in the configure
2007
 
dnl script and Makefiles.
2008
 
dnl
2009
 
dnl Example use:
2010
 
dnl   AM_PATH_WXRC([wxrc=1], [wxrc=0])
2011
 
dnl ---------------------------------------------------------------------------
2012
 
 
2013
 
dnl
2014
 
dnl wxrc program from the wx-config script
2015
 
dnl
2016
 
AC_DEFUN([AM_PATH_WXRC],
2017
 
[
2018
 
  AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
2019
 
    
2020
 
  if test "x$WX_CONFIG_NAME" = x; then
2021
 
    AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
2022
 
  else
2023
 
    
2024
 
    AC_MSG_CHECKING([for wxrc])
2025
 
    
2026
 
    if test "x$WXRC" = x ; then
2027
 
      dnl wx-config --utility is a new addition to wxWidgets:
2028
 
      _WX_PRIVATE_CHECK_VERSION(2,5,3)
2029
 
      if test -n "$wx_ver_ok"; then
2030
 
        WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
2031
 
      fi
2032
 
    fi
2033
 
 
2034
 
    if test "x$WXRC" = x ; then
2035
 
      AC_MSG_RESULT([not found])
2036
 
      ifelse([$2], , :, [$2])
2037
 
    else
2038
 
      AC_MSG_RESULT([$WXRC])
2039
 
      ifelse([$1], , :, [$1])
2040
 
    fi
2041
 
    
2042
 
    AC_SUBST(WXRC)
2043
 
  fi
2044
 
])
2045