1
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
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.
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
14
dnl ---------------------------------------------------------------------------
15
dnl Support macros for makefiles generated by BAKEFILE.
16
dnl ---------------------------------------------------------------------------
18
dnl Lots of compiler & linker detection code contained here was taken from
19
dnl wxWindows configure.in script (see http://www.wxwindows.org)
23
dnl ---------------------------------------------------------------------------
24
dnl AC_BAKEFILE_GNUMAKE
27
dnl ---------------------------------------------------------------------------
29
AC_DEFUN([AC_BAKEFILE_GNUMAKE],
31
dnl does make support "-include" (only GNU make does AFAIK)?
32
AC_CACHE_CHECK([if make is GNU make], bakefile_cv_prog_makeisgnu,
34
if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null |
35
egrep -s GNU > /dev/null); then
36
bakefile_cv_prog_makeisgnu="yes"
38
bakefile_cv_prog_makeisgnu="no"
42
if test "x$bakefile_cv_prog_makeisgnu" = "xyes"; then
50
dnl ---------------------------------------------------------------------------
51
dnl AC_BAKEFILE_PLATFORM
53
dnl Detects platform and sets PLATFORM_XXX variables accordingly
54
dnl ---------------------------------------------------------------------------
56
AC_DEFUN([AC_BAKEFILE_PLATFORM],
67
if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then
68
case "${BAKEFILE_HOST}" in
75
*-pc-os2_emx | *-pc-os2-emx )
85
powerpc-apple-macos* )
94
case "$BAKEFILE_FORCE_PLATFORM" in
115
AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM])
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)
131
dnl ---------------------------------------------------------------------------
132
dnl AC_BAKEFILE_PLATFORM_SPECIFICS
134
dnl Sets misc platform-specific settings
135
dnl ---------------------------------------------------------------------------
137
AC_DEFUN([AC_BAKEFILE_PLATFORM_SPECIFICS],
139
AC_ARG_ENABLE([omf], AS_HELP_STRING([--enable-omf],
140
[use OMF object format (OS/2)]),
141
[bk_os2_use_omf="$enableval"])
143
case "${BAKEFILE_HOST}" in
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"
151
if test "x$XLCC" = "xyes"; then
152
CFLAGS="$CFLAGS -qnocommon"
153
CXXFLAGS="$CXXFLAGS -qnocommon"
157
*-pc-os2_emx | *-pc-os2-emx )
158
if test "x$bk_os2_use_omf" = "xyes" ; then
161
LDFLAGS="-Zomf $LDFLAGS"
162
CFLAGS="-Zomf $CFLAGS"
163
CXXFLAGS="-Zomf $CXXFLAGS"
171
LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS"
176
dnl ---------------------------------------------------------------------------
177
dnl AC_BAKEFILE_SUFFIXES
179
dnl Detects shared various suffixes for shared libraries, libraries, programs,
181
dnl ---------------------------------------------------------------------------
183
AC_DEFUN([AC_BAKEFILE_SUFFIXES],
186
SO_SUFFIX_MODULE="so"
195
case "${BAKEFILE_HOST}" in
198
SO_SUFFIX_MODULE="sl"
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.
211
SO_SUFFIX_MODULE="dll"
212
DLLIMP_SUFFIX="dll.a"
219
SO_SUFFIX_MODULE="dll"
220
DLLIMP_SUFFIX="dll.a"
230
*-pc-os2_emx | *-pc-os2-emx )
232
SO_SUFFIX_MODULE="dll"
233
DLLIMP_SUFFIX=$OS2_LIBEXT
237
LIBEXT=".$OS2_LIBEXT"
242
SO_SUFFIX_MODULE="bundle"
246
if test "x$DLLIMP_SUFFIX" = "x" ; then
247
DLLIMP_SUFFIX="$SO_SUFFIX"
251
AC_SUBST(SO_SUFFIX_MODULE)
252
AC_SUBST(DLLIMP_SUFFIX)
257
AC_SUBST(DLLPREFIX_MODULE)
262
dnl ---------------------------------------------------------------------------
263
dnl AC_BAKEFILE_SHARED_LD
265
dnl Detects command for making shared libraries, substitutes SHARED_LD_CC
266
dnl and SHARED_LD_CXX.
267
dnl ---------------------------------------------------------------------------
269
AC_DEFUN([AC_BAKEFILE_SHARED_LD],
271
dnl the extra compiler flags needed for compilation of shared library
273
if test "x$GCC" = "xyes"; then
274
dnl the switch for gcc is the same under all platforms
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"
283
case "${BAKEFILE_HOST}" in
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"
290
SHARED_LD_CC="${CC} -b -o"
291
SHARED_LD_CXX="${CXX} -b -o"
297
if test "x$GCC" != "xyes"; then
298
AC_CACHE_CHECK([for Intel compiler], bakefile_cv_prog_icc,
302
#ifndef __INTEL_COMPILER
306
bakefile_cv_prog_icc=yes,
307
bakefile_cv_prog_icc=no
310
if test "$bakefile_cv_prog_icc" = "yes"; then
317
if test "x$GCC" != xyes ; then
318
SHARED_LD_CC="${CC} -G -o"
319
SHARED_LD_CXX="${CXX} -G -o"
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
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, [
337
#if (__GNUC__ < 3) || \
338
((__GNUC__ == 3) && (__GNUC_MINOR__ < 1))
343
bakefile_cv_gcc31=yes
350
if test "$bakefile_cv_gcc31" = "no"; then
351
AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH
352
chmod +x shared-ld-sh
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"
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"
367
if test "x$GCC" == "xyes"; then
368
PIC_FLAG="-dynamic -fPIC"
370
if test "x$XLCC" = "xyes"; then
371
PIC_FLAG="-dynamic -DPIC"
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)
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
391
LD_EXPFULL="-Wl,-bexpfull"
395
SHARED_LD_CC="\$(CC) -shared $LD_EXPFULL -o"
396
SHARED_LD_CXX="\$(CXX) -shared $LD_EXPFULL -o"
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"
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"
415
dnl default settings are ok for gcc
416
if test "x$GCC" != "xyes"; then
421
*-*-cygwin* | *-*-mingw32* )
423
SHARED_LD_CC="\$(CC) -shared -o"
424
SHARED_LD_CXX="\$(CXX) -shared -o"
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"
432
AC_BAKEFILE_CREATE_FILE_DLLAR_SH
436
powerpc-apple-macos* | \
437
*-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-k*bsd*-gnu | \
447
AC_MSG_ERROR(unknown system type $BAKEFILE_HOST.)
450
if test "x$PIC_FLAG" != "x" ; then
451
PIC_FLAG="$PIC_FLAG -DPIC"
454
if test "x$SHARED_LD_MODULE_CC" = "x" ; then
455
SHARED_LD_MODULE_CC="$SHARED_LD_CC"
457
if test "x$SHARED_LD_MODULE_CXX" = "x" ; then
458
SHARED_LD_MODULE_CXX="$SHARED_LD_CXX"
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)
466
AC_SUBST(WINDOWS_IMPLIB)
470
dnl ---------------------------------------------------------------------------
471
dnl AC_BAKEFILE_SHARED_VERSIONS
473
dnl Detects linker options for attaching versions (sonames) to shared libs.
474
dnl ---------------------------------------------------------------------------
476
AC_DEFUN([AC_BAKEFILE_SHARED_VERSIONS],
486
case "${BAKEFILE_HOST}" in
487
*-*-linux* | *-*-freebsd* | *-*-k*bsd*-gnu )
488
SONAME_FLAG="-Wl,-soname,"
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)
523
dnl ---------------------------------------------------------------------------
526
dnl Detects available C/C++ dependency tracking options
527
dnl ---------------------------------------------------------------------------
529
AC_DEFUN([AC_BAKEFILE_DEPS],
531
AC_MSG_CHECKING([for dependency tracking method])
534
if test "x$GCC" = "xyes"; then
536
case "${BAKEFILE_HOST}" in
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"
547
elif test "x$MWCC" = "xyes"; then
550
AC_MSG_RESULT([mwcc])
551
elif test "x$SUNCC" = "xyes"; then
554
AC_MSG_RESULT([Sun cc])
555
elif test "x$SGICC" = "xyes"; then
558
AC_MSG_RESULT([SGI cc])
559
elif test "x$HPCC" = "xyes"; then
562
AC_MSG_RESULT([HP cc])
563
elif test "x$COMPAQCC" = "xyes"; then
566
AC_MSG_RESULT([Compaq cc])
569
AC_MSG_RESULT([none])
572
if test $DEPS_TRACKING = 1 ; then
573
AC_BAKEFILE_CREATE_FILE_BK_DEPS
577
AC_SUBST(DEPS_TRACKING)
580
dnl ---------------------------------------------------------------------------
581
dnl AC_BAKEFILE_CHECK_BASIC_STUFF
583
dnl Checks for presence of basic programs, such as C and C++ compiler, "ranlib"
585
dnl ---------------------------------------------------------------------------
587
AC_DEFUN([AC_BAKEFILE_CHECK_BASIC_STUFF],
596
AC_CHECK_TOOL(AR, ar, ar)
597
AC_CHECK_TOOL(STRIP, strip, :)
598
AC_CHECK_TOOL(NM, nm, :)
600
case ${BAKEFILE_HOST} in
602
dnl HP-UX install doesn't handle the "-d" switch so don't
604
INSTALL_DIR="mkdir -p"
606
*) INSTALL_DIR="$INSTALL -d"
609
AC_SUBST(INSTALL_DIR)
612
case ${BAKEFILE_HOST} in
613
*-*-cygwin* | *-*-mingw32* )
614
LDFLAGS_GUI="-mwindows"
616
AC_SUBST(LDFLAGS_GUI)
620
dnl ---------------------------------------------------------------------------
621
dnl AC_BAKEFILE_RES_COMPILERS
623
dnl Checks for presence of resource compilers for win32 or mac
624
dnl ---------------------------------------------------------------------------
626
AC_DEFUN([AC_BAKEFILE_RES_COMPILERS],
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
637
AC_CHECK_PROG(RESCOMP, windres, windres, windres)
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)
651
dnl ---------------------------------------------------------------------------
652
dnl AC_BAKEFILE_PRECOMP_HEADERS
654
dnl Check for precompiled headers support (GCC >= 3.4)
655
dnl ---------------------------------------------------------------------------
657
AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS],
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"])
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])
673
#if !defined(__GNUC__) || !defined(__GNUC_MINOR__)
674
#error "no pch support"
677
#error "no pch support"
679
#if (__GNUC__ == 3) && \
680
((!defined(__APPLE_CC__) && (__GNUC_MINOR__ < 4)) || \
681
( defined(__APPLE_CC__) && (__GNUC_MINOR__ < 3)))
682
#error "no pch support"
692
if test $GCC_PCH = 1 ; then
693
AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH
704
dnl ---------------------------------------------------------------------------
705
dnl AC_BAKEFILE([autoconf_inc.m4 inclusion])
707
dnl To be used in configure.in of any project using Bakefile-generated mks
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
714
dnl BAKEFILE_FORCE_PLATFORM set to override platform detection
718
dnl AC_BAKEFILE([FOO(autoconf_inc.m4)])
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
723
dnl ---------------------------------------------------------------------------
725
AC_DEFUN([AC_BAKEFILE],
729
if test "x$BAKEFILE_HOST" = "x"; then
730
BAKEFILE_HOST="${host}"
733
if test "x$BAKEFILE_CHECK_BASICS" != "xno"; then
734
AC_BAKEFILE_CHECK_BASIC_STUFF
738
AC_BAKEFILE_PLATFORM_SPECIFICS
740
AC_BAKEFILE_SHARED_LD
741
AC_BAKEFILE_SHARED_VERSIONS
743
AC_BAKEFILE_RES_COMPILERS
745
BAKEFILE_BAKEFILE_M4_VERSION="0.1.9"
747
dnl includes autoconf_inc.m4:
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)?])
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.])
760
dnl ---------------------------------------------------------------------------
761
dnl Embedded copies of helper scripts follow:
762
dnl ---------------------------------------------------------------------------
764
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_DLLAR_SH],
766
dnl ===================== dllar.sh begins here =====================
767
dnl (Created by merge-scripts.py from dllar.sh
768
dnl file do not edit here!)
773
# dllar - a tool to build both a .dll and an .a file
774
# from a set of object (.o) files for EMX/OS2.
776
# Written by Andrew Zabolotny, bit@freya.etu.ru
777
# Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de
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).
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)
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.
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
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)
809
# (used to build the .dll)
811
# (used to create .def file from .o files)
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)
818
# - lxlite (optional, see flag below)
819
# (used for general .dll cleanup)
826
# basnam, variant of basename, which does _not_ remove the path, _iff_
827
# second argument (suffix to remove) is given
831
echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//'
834
echo ${D}1 | sed 's/'${D}2'${D}//'
837
echo "error in basnam ${D}*"
843
# Cleanup temporary files and output
846
for i in ${D}inputFiles ; do
849
rm -rf \`basnam ${D}i !\`
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
863
# Print usage and exit script with rc=1.
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.'
909
echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord'
910
echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"'
916
# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script.
917
# @Uses Whatever CleanUp() uses.
923
if @<:@ ${D}rcCmd -ne 0 @:>@; then
924
echo "command failed, exit code="${D}rcCmd
950
curDirS=${D}{curDirS}"/"
956
while @<:@ ${D}1 @:>@; do
959
EXPORT_BY_ORDINALS=1;
969
-name-mangler-script)
990
exclude_symbols=${D}{exclude_symbols}${D}1" "
994
library_flags=${D}{library_flags}${D}1" "
1013
EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
1016
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`"
1017
if @<:@ ${D}omfLinking -eq 1 @:>@; then
1018
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib"
1020
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a"
1025
if @<:@ ${D}libsToLink -ne 0 @:>@; then
1026
EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
1028
for file in ${D}1 ; do
1029
if @<:@ -f ${D}file @:>@; then
1030
inputFiles="${D}{inputFiles} ${D}file"
1034
if @<:@ ${D}found -eq 0 @:>@; then
1035
echo "ERROR: No file(s) found: "${D}1
1042
done # iterate cmdline words
1045
if @<:@ -z "${D}inputFiles" @:>@; then
1046
echo "dllar: no input files"
1050
# Now extract all .o files from .a files
1052
for file in ${D}inputFiles ; do
1063
EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf"
1068
dirname=\`basnam ${D}file ${D}suffix\`"_%"
1070
if @<:@ ${D}? -ne 0 @:>@; then
1071
echo "Failed to create subdirectory ./${D}dirname"
1075
# Append '!' to indicate archive
1076
newInputFiles="${D}newInputFiles ${D}{dirname}!"
1077
doCommand "cd ${D}dirname; ${D}AR x ../${D}file"
1080
for subfile in ${D}dirname/*.o* ; do
1081
if @<:@ -f ${D}subfile @:>@; then
1083
if @<:@ -s ${D}subfile @:>@; then
1084
# FIXME: This should be: is file size > 32 byte, _not_ > 0!
1085
newInputFiles="${D}newInputFiles ${D}subfile"
1089
if @<:@ ${D}found -eq 0 @:>@; then
1090
echo "WARNING: there are no files in archive \\'${D}file\\'"
1094
newInputFiles="${D}{newInputFiles} ${D}file"
1098
inputFiles="${D}newInputFiles"
1100
# Output filename(s).
1102
if @<:@ -z ${D}outFile @:>@; then
1104
set outFile ${D}inputFiles; outFile=${D}2
1107
# If it is an archive, remove the '!' and the '_%' suffixes
1110
outFile=\`basnam ${D}outFile _%!\`
1117
outFile=\`basnam ${D}outFile .dll\`
1120
outFile=\`basnam ${D}outFile .DLL\`
1123
outFile=\`basnam ${D}outFile .o\`
1126
outFile=\`basnam ${D}outFile .obj\`
1129
outFile=\`basnam ${D}outFile .a\`
1132
outFile=\`basnam ${D}outFile .lib\`
1137
case ${D}outimpFile in
1139
outimpFile=\`basnam ${D}outimpFile .a\`
1142
outimpFile=\`basnam ${D}outimpFile .lib\`
1147
if @<:@ -z ${D}outimpFile @:>@; then
1148
outimpFile=${D}outFile
1150
defFile="${D}{outFile}.def"
1151
arcFile="${D}{outimpFile}.a"
1152
arcFile2="${D}{outimpFile}.lib"
1154
#create ${D}dllFile as something matching 8.3 restrictions,
1155
if @<:@ -z ${D}renameScript @:>@ ; then
1156
dllFile="${D}outFile"
1158
dllFile=\`${D}renameScript ${D}outimpFile\`
1161
if @<:@ ${D}do_backup -ne 0 @:>@ ; then
1162
if @<:@ -f ${D}arcFile @:>@ ; then
1163
doCommand "mv ${D}arcFile ${D}{outFile}_s.a"
1165
if @<:@ -f ${D}arcFile2 @:>@ ; then
1166
doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib"
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
1178
doCommand "emxexp -u ${D}file >> ${D}tmpdefFile"
1183
# Create the def file.
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
1190
echo "EXPORTS" >> ${D}defFile
1192
doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%"
1193
grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile
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
1202
if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
1203
sed "=" < ${D}tmpdefFile | \\
1207
s/^\\(@<:@0-9@:>@\\+\\)\\(@<:@^;@:>@*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/
1209
' > ${D}{tmpdefFile}%
1210
grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile
1212
rm -f ${D}{tmpdefFile}%
1214
cat ${D}tmpdefFile >> ${D}defFile
1215
rm -f ${D}tmpdefFile
1217
# Do linking, create implib, and apply lxlite.
1219
for file in ${D}inputFiles ; do
1224
gccCmdl="${D}gccCmdl ${D}file"
1228
doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS"
1229
touch "${D}{outFile}.dll"
1231
doCommand "emximp -o ${D}arcFile ${D}defFile"
1232
if @<:@ ${D}flag_USE_LXLITE -ne 0 @:>@; then
1234
if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
1237
doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile"
1239
doCommand "emxomf -s -l ${D}arcFile"
1245
dnl ===================== dllar.sh ends here =====================
1248
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_DEPS],
1250
dnl ===================== bk-deps begins here =====================
1251
dnl (Created by merge-scripts.py from bk-deps
1252
dnl file do not edit here!)
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.
1260
# Permission is given to use this file in any way.
1262
DEPSMODE=${DEPSMODE}
1264
DEPSFLAG="${DEPSFLAG}"
1266
mkdir -p ${D}DEPSDIR
1268
if test ${D}DEPSMODE = gcc ; then
1269
${D}* ${D}{DEPSFLAG}
1271
if test ${D}{status} != 0 ; then
1274
# move created file to the location we want it in:
1275
while test ${D}# -gt 0; do
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
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"
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
1307
elif test ${D}DEPSMODE = mwcc ; then
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
1312
for arg in ${D}* ; do
1313
if test "${D}prevarg" = "-o"; then
1326
${D}* ${D}DEPSFLAG >${D}{DEPSDIR}/${D}{objfile}.d
1328
elif test ${D}DEPSMODE = unixcc; then
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.
1335
while test ${D}# -gt 0; do
1342
eval arg${D}#=\\${D}1
1343
cmd="${D}cmd \\${D}arg${D}#"
1348
eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{DEPSDIR}/${D}{objfile}.d
1355
dnl ===================== bk-deps ends here =====================
1358
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH],
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!)
1364
cat <<EOF >shared-ld-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
#-----------------------------------------------------------------------------
1377
linking_flag="-dynamiclib"
1378
ldargs="-r -keep_private_externs -nostdlib"
1380
while test ${D}# -gt 0; do
1387
-o|-compatibility_version|-current_version|-framework|-undefined|-install_name)
1388
# collect these options and values
1389
args="${D}{args} ${D}1 ${D}2"
1394
# collect these load args
1395
ldargs="${D}{ldargs} ${D}1"
1398
-l*|-L*|-flat_namespace|-headerpad_max_install_names)
1399
# collect these options
1400
args="${D}{args} ${D}1"
1403
-dynamiclib|-bundle)
1404
linking_flag="${D}1"
1408
echo "shared-ld: unhandled option '${D}1'"
1412
*.o | *.a | *.dylib)
1413
# collect object files
1414
objects="${D}{objects} ${D}1"
1418
echo "shared-ld: unhandled argument '${D}1'"
1429
# Link one module containing all the others
1431
if test ${D}{verbose} = 1; then
1432
echo "c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o"
1434
c++ ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o
1438
# Link the shared library from the single module created, but only if the
1439
# previous command didn't fail:
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}"
1445
c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}
1450
# Remove intermediate module
1452
rm -f master.${D}${D}.o
1456
dnl ===================== shared-ld-sh ends here =====================
1459
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH],
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!)
1465
cat <<EOF >bk-make-pch
1468
# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
1469
# script. It is used to generated precompiled headers.
1471
# Permission is given to use this file in any way.
1480
while test ${D}{#} -gt 0; do
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}"
1489
compiler="${D}{compiler} ${D}{1}"
1493
if test "x${D}{headerfile}" = "x" ; then
1494
echo "error: can't find header ${D}{header} in include paths" >2
1496
if test -f ${D}{outfile} ; then
1499
mkdir -p \`dirname ${D}{outfile}\`
1501
depsfile=".deps/\`echo ${D}{outfile} | tr '/.' '__'\`.d"
1503
# can do this because gcc is >= 3.4:
1504
${D}{compiler} -o ${D}{outfile} -MMD -MF "${D}{depsfile}" "${D}{headerfile}"
1508
dnl ===================== bk-make-pch ends here =====================
1511
# Configure paths for LIBXML2
1512
# Mike Hommey 2004-06-19
1513
# use CPPFLAGS instead of CFLAGS
1514
# Toshio Kuratomi 2001-04-21
1516
# Configure paths for GLIB
1517
# Owen Taylor 97-11-3
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
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],,
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
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
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)
1550
if test "$XML2_CONFIG" = "no" ; then
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"
1567
dnl Now check if the installed libxml is sufficiently new.
1568
dnl (Also sanity checks the results of xml2-config to some extent)
1575
#include <libxml/xmlversion.h>
1580
int xml_major_version, xml_minor_version, xml_micro_version;
1581
int major, minor, micro;
1584
system("touch conf.xmltest");
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, µ) != 3) {
1590
printf("%s, bad version string from xml2-config\n", "$min_xml_version");
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");
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))
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);
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.
1618
LIBXML_TEST_VERSION;
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)))
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");
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");
1646
],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1647
CPPFLAGS="$ac_save_CPPFLAGS"
1648
LIBS="$ac_save_LIBS"
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])
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."
1663
if test -f conf.xmltest ; then
1666
echo "*** Could not run libxml test program, checking why..."
1667
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
1668
LIBS="$LIBS $XML_LIBS"
1670
#include <libxml/xmlversion.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"
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"
1693
ifelse([$3], , :, [$3])
1695
AC_SUBST(XML_CPPFLAGS)
1700
dnl ---------------------------------------------------------------------------
1701
dnl Macros for wxWidgets detection. Typically used in configure.in as:
1703
dnl AC_ARG_ENABLE(...)
1704
dnl AC_ARG_WITH(...)
1706
dnl AM_OPTIONS_WXCONFIG
1709
dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)
1710
dnl if test "$wxWin" != 1; then
1712
dnl wxWidgets must be installed on your system
1713
dnl but wx-config script couldn't be found.
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.
1721
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
1722
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
1723
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
1725
dnl LIBS="$LIBS $WX_LIBS"
1726
dnl ---------------------------------------------------------------------------
1728
dnl ---------------------------------------------------------------------------
1729
dnl AM_OPTIONS_WXCONFIG
1731
dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
1732
dnl --wx-config command line options
1733
dnl ---------------------------------------------------------------------------
1735
AC_DEFUN([AM_OPTIONS_WXCONFIG],
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="")
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],
1758
if test "x$WX_VERSION" != x ; then
1759
if test $wx_config_major_version -gt $1; then
1762
if test $wx_config_major_version -eq $1; then
1763
if test $wx_config_minor_version -gt $2; then
1766
if test $wx_config_minor_version -eq $2; then
1767
if test $wx_config_micro_version -ge $3; then
1777
dnl ---------------------------------------------------------------------------
1778
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
1779
dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
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.
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.
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.
1797
dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
1798
dnl [--unicode --debug])
1799
dnl ---------------------------------------------------------------------------
1802
dnl Get the cflags and libraries from the wx-config script
1804
AC_DEFUN([AM_PATH_WXCONFIG],
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
1811
if test "x$wx_config_name" != x ; then
1812
WX_CONFIG_NAME="$wx_config_name"
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"
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"
1824
if test "$cross_compiling" = "yes"; then
1825
wx_config_args="$wx_config_args --host=$host_alias"
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)
1834
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
1837
if test "$WX_CONFIG_PATH" != "no" ; then
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])
1844
AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
1847
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
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/'`
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/'`
1864
_WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
1865
[$wx_requested_minor_version],
1866
[$wx_requested_micro_version])
1868
if test -n "$wx_ver_ok"; then
1870
AC_MSG_RESULT(yes (version $WX_VERSION))
1871
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
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
1885
dnl starting with version 2.2.6 wx-config has --cppflags argument
1887
if test $wx_config_major_version -gt 2; then
1890
if test $wx_config_major_version -eq 2; then
1891
if test $wx_config_minor_version -gt 2; then
1894
if test $wx_config_minor_version -eq 2; then
1895
if test $wx_config_micro_version -ge 6; then
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
1909
WX_CFLAGS_ONLY=$WX_CFLAGS
1910
WX_CXXFLAGS_ONLY=$WX_CFLAGS
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`
1917
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
1918
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
1921
ifelse([$2], , :, [$2])
1925
if test "x$WX_VERSION" = x; then
1926
dnl no wx-config at all
1929
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
1937
ifelse([$3], , :, [$3])
1947
ifelse([$3], , :, [$3])
1951
AC_SUBST(WX_CPPFLAGS)
1953
AC_SUBST(WX_CXXFLAGS)
1954
AC_SUBST(WX_CFLAGS_ONLY)
1955
AC_SUBST(WX_CXXFLAGS_ONLY)
1957
AC_SUBST(WX_LIBS_STATIC)
1958
AC_SUBST(WX_VERSION)
1961
dnl ---------------------------------------------------------------------------
1962
dnl Get information on the wxrc program for making C++, Python and xrs
1965
dnl AC_ARG_ENABLE(...)
1966
dnl AC_ARG_WITH(...)
1968
dnl AM_OPTIONS_WXCONFIG
1971
dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)
1972
dnl if test "$wxWin" != 1; then
1974
dnl wxWidgets must be installed on your system
1975
dnl but wx-config script couldn't be found.
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.
1984
dnl AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0])
1985
dnl if test "x$HAVE_WXRC" != x1; then
1987
dnl The wxrc program was not installed or not found.
1989
dnl Please check the wxWidgets installation.
1993
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
1994
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
1995
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
1997
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
1998
dnl ---------------------------------------------------------------------------
2002
dnl ---------------------------------------------------------------------------
2003
dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
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.
2010
dnl AM_PATH_WXRC([wxrc=1], [wxrc=0])
2011
dnl ---------------------------------------------------------------------------
2014
dnl wxrc program from the wx-config script
2016
AC_DEFUN([AM_PATH_WXRC],
2018
AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
2020
if test "x$WX_CONFIG_NAME" = x; then
2021
AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
2024
AC_MSG_CHECKING([for wxrc])
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`
2034
if test "x$WXRC" = x ; then
2035
AC_MSG_RESULT([not found])
2036
ifelse([$2], , :, [$2])
2038
AC_MSG_RESULT([$WXRC])
2039
ifelse([$1], , :, [$1])