1 # aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # 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 ---------------------------------------------------------------------------
16 dnl Macros for configure.in for wxWindows by Robert Roebling, Phil Blecker,
17 dnl Vadim Zeitlin and Ron Lee
19 dnl This script is under the wxWindows licence.
22 dnl ---------------------------------------------------------------------------
24 dnl ===========================================================================
25 dnl macros to find the a file in the list of include/lib paths
26 dnl ===========================================================================
28 dnl ---------------------------------------------------------------------------
29 dnl call WX_PATH_FIND_INCLUDES(search path, header name), sets ac_find_includes
30 dnl to the full name of the file that was found or leaves it empty if not found
31 dnl ---------------------------------------------------------------------------
32 AC_DEFUN([WX_PATH_FIND_INCLUDES],
35 for ac_dir in $1 /usr/include;
37 if test -f "$ac_dir/$2"; then
38 ac_find_includes=$ac_dir
44 dnl ---------------------------------------------------------------------------
45 dnl call WX_PATH_FIND_LIBRARIES(search path, header name), sets ac_find_libraries
46 dnl to the full name of the file that was found or leaves it empty if not found
47 dnl ---------------------------------------------------------------------------
48 AC_DEFUN([WX_PATH_FIND_LIBRARIES],
51 for ac_dir in $1 /usr/lib;
53 for ac_extension in a so sl dylib; do
54 if test -f "$ac_dir/lib$2.$ac_extension"; then
55 ac_find_libraries=$ac_dir
62 dnl ---------------------------------------------------------------------------
63 dnl Path to include, already defined
64 dnl ---------------------------------------------------------------------------
65 AC_DEFUN([WX_INCLUDE_PATH_EXIST],
67 dnl never add -I/usr/include to the CPPFLAGS
68 if test "x$1" = "x/usr/include"; then
71 echo "$2" | grep "\-I$1" > /dev/null
73 if test $result = 0; then
76 ac_path_to_include=" -I$1"
81 dnl ---------------------------------------------------------------------------
82 dnl Path to link, already defined
83 dnl ---------------------------------------------------------------------------
84 AC_DEFUN([WX_LINK_PATH_EXIST],
86 echo "$2" | grep "\-L$1" > /dev/null
88 if test $result = 0; then
91 ac_path_to_link=" -L$1"
95 dnl ===========================================================================
97 dnl ===========================================================================
99 dnl ---------------------------------------------------------------------------
100 dnl WX_CPP_NEW_HEADERS checks whether the compiler has "new" <iostream> header
101 dnl or only the old <iostream.h> one - it may be generally assumed that if
102 dnl <iostream> exists, the other "new" headers (without .h) exist too.
104 dnl call WX_CPP_NEW_HEADERS(actiof-if-true, action-if-false)
105 dnl ---------------------------------------------------------------------------
107 AC_DEFUN([WX_CPP_NEW_HEADERS],
112 AC_CHECK_HEADERS(iostream)
114 if test "$ac_cv_header_iostream" = "yes" ; then
115 ifelse([$1], , :, [$1])
117 ifelse([$2], , :, [$2])
123 dnl ---------------------------------------------------------------------------
124 dnl WX_CPP_BOOL checks whether the C++ compiler has a built in bool type
126 dnl call WX_CPP_BOOL - will define HAVE_BOOL if the compiler supports bool
127 dnl ---------------------------------------------------------------------------
129 AC_DEFUN([WX_CPP_BOOL],
131 AC_CACHE_CHECK([if C++ compiler supports bool], wx_cv_cpp_bool,
155 if test "$wx_cv_cpp_bool" = "yes"; then
160 dnl ---------------------------------------------------------------------------
161 dnl WX_CPP_EXPLICIT checks whether the C++ compiler support the explicit
162 dnl keyword and defines HAVE_EXPLICIT if this is the case
163 dnl ---------------------------------------------------------------------------
165 AC_DEFUN([WX_CPP_EXPLICIT],
167 AC_CACHE_CHECK([if C++ compiler supports the explicit keyword],
173 dnl do the test in 2 steps: first check that the compiler knows about the
174 dnl explicit keyword at all and then verify that it really honours it
177 class Foo { public: explicit Foo(int) {} };
185 class Foo { public: explicit Foo(int) {} };
186 static void TakeFoo(const Foo& foo) { }
202 if test "$wx_cv_explicit" = "yes"; then
203 AC_DEFINE(HAVE_EXPLICIT)
207 dnl ---------------------------------------------------------------------------
208 dnl a slightly better AC_C_BIGENDIAN macro which allows cross-compiling
209 dnl ---------------------------------------------------------------------------
211 AC_DEFUN([WX_C_BIGENDIAN],
212 [AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian,
213 [ac_cv_c_bigendian=unknown
214 # See if sys/param.h defines the BYTE_ORDER macro.
215 AC_TRY_COMPILE([#include <sys/types.h>
216 #include <sys/param.h>], [
217 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
219 #endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
220 AC_TRY_COMPILE([#include <sys/types.h>
221 #include <sys/param.h>], [
222 #if BYTE_ORDER != BIG_ENDIAN
224 #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
225 if test $ac_cv_c_bigendian = unknown; then
226 AC_TRY_RUN([main () {
227 /* Are we little or big endian? From Harbison&Steele. */
231 char c[sizeof (long)];
234 exit (u.c[sizeof (long) - 1] == 1);
235 }], [ac_cv_c_bigendian=no], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian=unknown])
237 if test $ac_cv_c_bigendian = unknown; then
238 AC_MSG_WARN([Assuming little-endian target machine - this may be overriden by adding the line "ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}" to config.cache file])
240 if test $ac_cv_c_bigendian = yes; then
241 AC_DEFINE(WORDS_BIGENDIAN)
245 dnl ---------------------------------------------------------------------------
246 dnl override AC_ARG_ENABLE/WITH to cache the results in .cache file
247 dnl ---------------------------------------------------------------------------
249 AC_DEFUN([WX_ARG_CACHE_INIT],
251 wx_arg_cache_file="configarg.cache"
252 echo "loading argument cache $wx_arg_cache_file"
253 rm -f ${wx_arg_cache_file}.tmp
254 touch ${wx_arg_cache_file}.tmp
255 touch ${wx_arg_cache_file}
258 AC_DEFUN([WX_ARG_CACHE_FLUSH],
260 echo "saving argument cache $wx_arg_cache_file"
261 mv ${wx_arg_cache_file}.tmp ${wx_arg_cache_file}
264 dnl this macro checks for a three-valued command line --with argument:
265 dnl possible arguments are 'yes', 'no', 'sys', or 'builtin'
266 dnl usage: WX_ARG_SYS_WITH(option, helpmessage, variable-name)
267 AC_DEFUN([WX_ARG_SYS_WITH],
269 AC_MSG_CHECKING([for --with-$1])
271 AC_ARG_WITH($1, [$2],
273 if test "$withval" = yes; then
274 ac_cv_use_$1='$3=yes'
275 elif test "$withval" = no; then
277 elif test "$withval" = sys; then
278 ac_cv_use_$1='$3=sys'
279 elif test "$withval" = builtin; then
280 ac_cv_use_$1='$3=builtin'
282 AC_MSG_ERROR([Invalid value for --with-$1: should be yes, no, sys, or builtin])
286 LINE=`grep "$3" ${wx_arg_cache_file}`
287 if test "x$LINE" != x ; then
293 ac_cv_use_$1='$3='$DEFAULT_$3
297 if test "$no_cache" != 1; then
298 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
301 if test "$$3" = yes; then
303 elif test "$$3" = no; then
305 elif test "$$3" = sys; then
306 AC_MSG_RESULT([system version])
307 elif test "$$3" = builtin; then
308 AC_MSG_RESULT([builtin version])
310 AC_MSG_ERROR([Invalid value for --with-$1: should be yes, no, sys, or builtin])
314 dnl this macro checks for a command line argument and caches the result
315 dnl usage: WX_ARG_WITH(option, helpmessage, variable-name)
316 AC_DEFUN([WX_ARG_WITH],
318 AC_MSG_CHECKING([for --with-$1])
320 AC_ARG_WITH($1, [$2],
322 if test "$withval" = yes; then
323 ac_cv_use_$1='$3=yes'
329 LINE=`grep "$3" ${wx_arg_cache_file}`
330 if test "x$LINE" != x ; then
336 ac_cv_use_$1='$3='$DEFAULT_$3
340 if test "$no_cache" != 1; then
341 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
344 if test "$$3" = yes; then
351 dnl like WX_ARG_WITH but uses AC_ARG_ENABLE instead of AC_ARG_WITH
352 dnl usage: WX_ARG_ENABLE(option, helpmessage, variable-name, enablestring)
354 dnl enablestring is a hack and allows to show "checking for --disable-foo"
355 dnl message when running configure instead of the default "checking for
356 dnl --enable-foo" one whih is useful for the options enabled by default
357 AC_DEFUN([WX_ARG_ENABLE],
360 AC_MSG_CHECKING([for --${enablestring:-enable}-$1])
362 AC_ARG_ENABLE($1, [$2],
364 if test "$enableval" = yes; then
365 ac_cv_use_$1='$3=yes'
371 LINE=`grep "$3" ${wx_arg_cache_file}`
372 if test "x$LINE" != x ; then
378 ac_cv_use_$1='$3='$DEFAULT_$3
382 if test "$no_cache" != 1; then
383 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
386 if test "$$3" = yes; then
394 dnl ===========================================================================
395 dnl Linker features test
396 dnl ===========================================================================
398 dnl ---------------------------------------------------------------------------
399 dnl WX_VERSIONED_SYMBOLS checks whether the linker can create versioned
400 dnl symbols. If it can, sets LDFLAGS_VERSIONING to $CXX flags needed to use
401 dnl version script file named versionfile
403 dnl call WX_VERSIONED_SYMBOLS(versionfile)
404 dnl ---------------------------------------------------------------------------
405 AC_DEFUN([WX_VERSIONED_SYMBOLS],
409 dnl FIXME - doesn't work, Solaris linker doesn't accept wildcards
411 dnl dnl Check for known non-gcc cases:
412 dnl case "${host}" in
414 dnl if test "x$GCC" != "xyes" ; then
415 dnl LDFLAGS_VERSIONING="-M $1"
416 dnl found_versioning=yes
421 dnl Generic check for GCC or GCC-like behaviour (Intel C++, GCC):
422 if test $found_versioning = no ; then
423 AC_CACHE_CHECK([if the linker accepts --version-script], wx_cv_version_script,
425 echo "VER_1 { *; };" >conftest.sym
426 echo "int main() { return 0; }" >conftest.cpp
429 $CXX -o conftest.output $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.cpp
430 -Wl,--version-script,conftest.sym >/dev/null 2>conftest.stderr]) ; then
431 if test -s conftest.stderr ; then
432 wx_cv_version_script=no
434 wx_cv_version_script=yes
437 wx_cv_version_script=no
439 rm -f conftest.output conftest.stderr conftest.sym conftest.cpp
441 if test $wx_cv_version_script = yes ; then
442 LDFLAGS_VERSIONING="-Wl,--version-script,$1"
448 dnl ===========================================================================
449 dnl "3rd party" macros included here because they are not widely available
450 dnl ===========================================================================
452 dnl ---------------------------------------------------------------------------
453 dnl test for availability of iconv()
454 dnl ---------------------------------------------------------------------------
456 dnl From Bruno Haible.
460 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
461 dnl those with the standalone portable GNU libiconv installed).
463 AC_ARG_WITH([libiconv-prefix],
464 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
465 for dir in `echo "$withval" | tr : ' '`; do
466 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
467 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
471 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
472 am_cv_func_iconv="no, consider installing GNU libiconv"
474 AC_TRY_LINK([#include <stdlib.h>
476 [iconv_t cd = iconv_open("","");
477 iconv(cd,NULL,NULL,NULL,NULL);
479 am_cv_func_iconv=yes)
480 if test "$am_cv_func_iconv" != yes; then
483 AC_TRY_LINK([#include <stdlib.h>
485 [iconv_t cd = iconv_open("","");
486 iconv(cd,NULL,NULL,NULL,NULL);
489 am_cv_func_iconv=yes)
493 if test "$am_cv_func_iconv" = yes; then
494 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
495 AC_CACHE_CHECK([if iconv needs const], wx_cv_func_iconv_const,
503 #if defined(__STDC__) || defined(__cplusplus)
504 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
510 wx_cv_func_iconv_const="no",
511 wx_cv_func_iconv_const="yes"
516 if test "x$wx_cv_func_iconv_const" = "xyes"; then
520 AC_DEFINE_UNQUOTED(ICONV_CONST, $iconv_const,
521 [Define as const if the declaration of iconv() needs const.])
524 if test "$am_cv_lib_iconv" = yes; then
530 dnl ---------------------------------------------------------------------------
531 dnl AC_SYS_LARGEFILE (partly based on the code from autoconf 2.5x)
532 dnl ---------------------------------------------------------------------------
534 dnl WX_SYS_LARGEFILE_TEST
536 dnl NB: original autoconf test was checking if compiler supported 6 bit off_t
537 dnl arithmetic properly but this failed miserably with gcc under Linux
538 dnl whereas the system still supports 64 bit files, so now simply check
539 dnl that off_t is big enough
540 define(WX_SYS_LARGEFILE_TEST,
542 unsigned int field: sizeof(off_t) == 8;
547 dnl WX_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR)
548 define(WX_SYS_LARGEFILE_MACRO_VALUE,
550 AC_CACHE_CHECK([for $1 value needed for large files], [$3],
552 AC_TRY_COMPILE([#define $1 $2
553 #include <sys/types.h>],
554 WX_SYS_LARGEFILE_TEST,
560 if test "$$3" != no; then
562 AC_DEFINE_UNQUOTED([$1], [$$3])
569 dnl By default, many hosts won't let programs access large files;
570 dnl one must use special compiler options to get large-file access to work.
571 dnl For more details about this brain damage please see:
572 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
573 AC_DEFUN([AC_SYS_LARGEFILE],
574 [AC_ARG_ENABLE(largefile,
575 [ --disable-largefile omit support for large files])
576 if test "$enable_largefile" != no; then
577 dnl _FILE_OFFSET_BITS==64 is needed for Linux, Solaris, ...
578 dnl _LARGE_FILES -- for AIX
580 WX_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ac_cv_sys_file_offset_bits)
581 if test "x$wx_largefile" != "xyes"; then
582 WX_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ac_cv_sys_large_files)
585 AC_MSG_CHECKING(if large file support is available)
586 if test "x$wx_largefile" = "xyes"; then
587 AC_DEFINE(HAVE_LARGEFILE_SUPPORT)
589 AC_MSG_RESULT($wx_largefile)
594 dnl Available from the GNU Autoconf Macro Archive at:
595 dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_const_cast.html
597 AC_DEFUN([AC_CXX_CONST_CAST],
598 [AC_CACHE_CHECK(whether the compiler supports const_cast<>,
599 ac_cv_cxx_const_cast,
602 AC_TRY_COMPILE(,[int x = 0;const int& y = x;int& z = const_cast<int&>(y);return z;],
603 ac_cv_cxx_const_cast=yes, ac_cv_cxx_const_cast=no)
606 if test "$ac_cv_cxx_const_cast" = yes; then
607 AC_DEFINE(HAVE_CONST_CAST,,[define if the compiler supports const_cast<>])
611 dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_reinterpret_cast.html
612 AC_DEFUN([AC_CXX_REINTERPRET_CAST],
613 [AC_CACHE_CHECK(whether the compiler supports reinterpret_cast<>,
614 ac_cv_cxx_reinterpret_cast,
617 AC_TRY_COMPILE([#include <typeinfo>
618 class Base { public : Base () {} virtual void f () = 0;};
619 class Derived : public Base { public : Derived () {} virtual void f () {} };
620 class Unrelated { public : Unrelated () {} };
621 int g (Unrelated&) { return 0; }],[
622 Derived d;Base& b=d;Unrelated& e=reinterpret_cast<Unrelated&>(b);return g(e);],
623 ac_cv_cxx_reinterpret_cast=yes, ac_cv_cxx_reinterpret_cast=no)
626 if test "$ac_cv_cxx_reinterpret_cast" = yes; then
627 AC_DEFINE(HAVE_REINTERPRET_CAST,,
628 [define if the compiler supports reinterpret_cast<>])
632 dnl and http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_static_cast.html
633 AC_DEFUN([AC_CXX_STATIC_CAST],
634 [AC_CACHE_CHECK(whether the compiler supports static_cast<>,
635 ac_cv_cxx_static_cast,
638 AC_TRY_COMPILE([#include <typeinfo>
639 class Base { public : Base () {} virtual void f () = 0; };
640 class Derived : public Base { public : Derived () {} virtual void f () {} };
641 int g (Derived&) { return 0; }],[
642 Derived d; Base& b = d; Derived& s = static_cast<Derived&> (b); return g (s);],
643 ac_cv_cxx_static_cast=yes, ac_cv_cxx_static_cast=no)
646 if test "$ac_cv_cxx_static_cast" = yes; then
647 AC_DEFINE(HAVE_STATIC_CAST,, [define if the compiler supports static_cast<>])
651 dnl ---------------------------------------------------------------------------
652 dnl Support macros for makefiles generated by BAKEFILE.
653 dnl ---------------------------------------------------------------------------
655 dnl Lots of compiler & linker detection code contained here was taken from
656 dnl wxWindows configure.in script (see http://www.wxwindows.org)
658 dnl Based on autoconf _AC_LANG_COMPILER_GNU
659 AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_MWERKS],
660 [AC_CACHE_CHECK([whether we are using the Metrowerks _AC_LANG compiler],
661 [bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks],
662 [AC_TRY_COMPILE([],[#ifndef __MWERKS__
666 [bakefile_compiler_mwerks=yes],
667 [bakefile_compiler_mwerks=no])
668 bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks=$bakefile_compiler_mwerks
672 dnl Loosely based on autoconf AC_PROG_CC
673 dnl TODO: Maybe this should wrap the call to AC_PROG_CC and be used instead.
674 AC_DEFUN([AC_BAKEFILE_PROG_MWCC],
676 _AC_BAKEFILE_LANG_COMPILER_MWERKS
677 MWCC=`test $bakefile_compiler_mwerks = yes && echo yes`
681 dnl Loosely based on autoconf AC_PROG_CXX
682 dnl TODO: Maybe this should wrap the call to AC_PROG_CXX and be used instead.
683 AC_DEFUN([AC_BAKEFILE_PROG_MWCXX],
685 _AC_BAKEFILE_LANG_COMPILER_MWERKS
686 MWCXX=`test $bakefile_compiler_mwerks = yes && echo yes`
690 dnl ---------------------------------------------------------------------------
691 dnl AC_BAKEFILE_GNUMAKE
694 dnl ---------------------------------------------------------------------------
696 AC_DEFUN([AC_BAKEFILE_GNUMAKE],
698 dnl does make support "-include" (only GNU make does AFAIK)?
699 AC_CACHE_CHECK([if make is GNU make], bakefile_cv_prog_makeisgnu,
701 if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null |
702 egrep -s GNU > /dev/null); then
703 bakefile_cv_prog_makeisgnu="yes"
705 bakefile_cv_prog_makeisgnu="no"
709 if test "x$bakefile_cv_prog_makeisgnu" = "xyes"; then
714 AC_SUBST(IF_GNU_MAKE)
717 dnl ---------------------------------------------------------------------------
718 dnl AC_BAKEFILE_PLATFORM
720 dnl Detects platform and sets PLATFORM_XXX variables accordingly
721 dnl ---------------------------------------------------------------------------
723 AC_DEFUN([AC_BAKEFILE_PLATFORM],
734 if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then
735 case "${BAKEFILE_HOST}" in
736 *-*-cygwin* | *-*-mingw32* )
742 *-pc-os2_emx | *-pc-os2-emx )
752 powerpc-apple-macos* )
761 case "$BAKEFILE_FORCE_PLATFORM" in
782 AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM])
787 AC_SUBST(PLATFORM_UNIX)
788 AC_SUBST(PLATFORM_WIN32)
789 AC_SUBST(PLATFORM_MSDOS)
790 AC_SUBST(PLATFORM_MAC)
791 AC_SUBST(PLATFORM_MACOS)
792 AC_SUBST(PLATFORM_MACOSX)
793 AC_SUBST(PLATFORM_OS2)
794 AC_SUBST(PLATFORM_BEOS)
798 dnl ---------------------------------------------------------------------------
799 dnl AC_BAKEFILE_PLATFORM_SPECIFICS
801 dnl Sets misc platform-specific settings
802 dnl ---------------------------------------------------------------------------
804 AC_DEFUN([AC_BAKEFILE_PLATFORM_SPECIFICS],
806 AC_ARG_ENABLE([omf], AS_HELP_STRING([--enable-omf],
807 [use OMF object format (OS/2)]),
808 [bk_os2_use_omf="$enableval"])
810 case "${BAKEFILE_HOST}" in
812 dnl For Unix to MacOS X porting instructions, see:
813 dnl http://fink.sourceforge.net/doc/porting/porting.html
814 CFLAGS="$CFLAGS -fno-common"
815 CXXFLAGS="$CXXFLAGS -fno-common"
818 *-pc-os2_emx | *-pc-os2-emx )
819 if test "x$bk_os2_use_omf" = "xyes" ; then
822 LDFLAGS="-Zomf $LDFLAGS"
823 CFLAGS="-Zomf $CFLAGS"
824 CXXFLAGS="-Zomf $CXXFLAGS"
832 LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS"
837 dnl ---------------------------------------------------------------------------
838 dnl AC_BAKEFILE_SUFFIXES
840 dnl Detects shared various suffixes for shared libraries, libraries, programs,
842 dnl ---------------------------------------------------------------------------
844 AC_DEFUN([AC_BAKEFILE_SUFFIXES],
847 SO_SUFFIX_MODULE="so"
855 case "${BAKEFILE_HOST}" in
858 SO_SUFFIX_MODULE="sl"
862 dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html:
863 dnl Both archive libraries and shared libraries on AIX have an
864 dnl .a extension. This will explain why you can't link with an
865 dnl .so and why it works with the name changed to .a.
869 *-*-cygwin* | *-*-mingw32* )
871 SO_SUFFIX_MODULE="dll"
872 DLLIMP_SUFFIX="dll.a"
880 *-pc-os2_emx | *-pc-os2-emx )
882 SO_SUFFIX_MODULE="dll"
883 DLLIMP_SUFFIX=$OS2_LIBEXT
887 LIBEXT=".$OS2_LIBEXT"
891 SO_SUFFIX_MODULE="bundle"
895 if test "x$DLLIMP_SUFFIX" = "x" ; then
896 DLLIMP_SUFFIX="$SO_SUFFIX"
900 AC_SUBST(SO_SUFFIX_MODULE)
901 AC_SUBST(DLLIMP_SUFFIX)
906 AC_SUBST(DLLPREFIX_MODULE)
910 dnl ---------------------------------------------------------------------------
911 dnl AC_BAKEFILE_SHARED_LD
913 dnl Detects command for making shared libraries, substitutes SHARED_LD_CC
914 dnl and SHARED_LD_CXX.
915 dnl ---------------------------------------------------------------------------
917 AC_DEFUN([AC_BAKEFILE_SHARED_LD],
919 dnl the extra compiler flags needed for compilation of shared library
921 if test "x$GCC" = "xyes"; then
922 dnl the switch for gcc is the same under all platforms
926 dnl Defaults for GCC and ELF .so shared libs:
927 SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o"
928 SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o"
930 case "${BAKEFILE_HOST}" in
932 dnl default settings are good for gcc but not for the native HP-UX
933 if test "x$GCC" != "xyes"; then
934 dnl no idea why it wants it, but it does
935 LDFLAGS="$LDFLAGS -L/usr/lib"
937 SHARED_LD_CC="${CC} -b -o"
938 SHARED_LD_CXX="${CXX} -b -o"
944 if test "x$GCC" != "xyes"; then
945 AC_CACHE_CHECK([for Intel compiler], bakefile_cv_prog_icc,
949 #ifndef __INTEL_COMPILER
953 bakefile_cv_prog_icc=yes,
954 bakefile_cv_prog_icc=no
957 if test "$bakefile_cv_prog_icc" = "yes"; then
964 if test "x$GCC" != xyes ; then
965 SHARED_LD_CC="${CC} -G -o"
966 SHARED_LD_CXX="${CXX} -G -o"
972 dnl Most apps benefit from being fully binded (its faster and static
973 dnl variables initialized at startup work).
974 dnl This can be done either with the exe linker flag -Wl,-bind_at_load
975 dnl or with a double stage link in order to create a single module
976 dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
978 dnl If using newer dev tools then there is a -single_module flag that
979 dnl we can use to do this, otherwise we'll need to use a helper
980 dnl script. Check the version of gcc to see which way we can go:
981 AC_CACHE_CHECK([for gcc 3.1 or later], wx_cv_gcc31, [
984 #if (__GNUC__ < 3) || \
985 ((__GNUC__ == 3) && (__GNUC_MINOR__ < 1))
997 if test "$wx_cv_gcc31" = "no"; then
998 AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH
999 chmod +x shared-ld-sh
1001 dnl Use the shared-ld-sh helper script
1002 SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o"
1003 SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o"
1004 SHARED_LD_CXX="$SHARED_LD_CC"
1005 SHARED_LD_MODULE_CXX="$SHARED_LD_MODULE_CC"
1007 dnl Use the -single_module flag and let the linker do it for us
1008 SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o"
1009 SHARED_LD_MODULE_CC="\${CC} -bundle -single_module -headerpad_max_install_names -o"
1010 SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o"
1011 SHARED_LD_MODULE_CXX="\${CXX} -bundle -single_module -headerpad_max_install_names -o"
1014 PIC_FLAG="-dynamic -fPIC"
1018 dnl default settings are ok for gcc
1019 if test "x$GCC" != "xyes"; then
1020 dnl the abs path below used to be hardcoded here so I guess it must
1021 dnl be some sort of standard location under AIX?
1022 AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib,
1023 makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib)
1024 dnl FIXME - what about makeCSharedLib?
1025 SHARED_LD_CC="$AIX_CC_LD -p 0 -o"
1026 SHARED_LD_CXX="$AIX_CXX_LD -p 0 -o"
1031 dnl can't use gcc under BeOS for shared library creation because it
1032 dnl complains about missing 'main'
1033 SHARED_LD_CC="${LD} -nostart -o"
1034 SHARED_LD_CXX="${LD} -nostart -o"
1038 dnl default settings are ok for gcc
1039 if test "x$GCC" != "xyes"; then
1044 *-*-cygwin* | *-*-mingw32* )
1046 SHARED_LD_CC="\$(CC) -shared -o"
1047 SHARED_LD_CXX="\$(CXX) -shared -o"
1050 *-pc-os2_emx | *-pc-os2-emx )
1051 SHARED_LD_CC="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
1052 SHARED_LD_CXX="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
1054 AC_BAKEFILE_CREATE_FILE_DLLAR_SH
1058 powerpc-apple-macos* | \
1059 *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | \
1068 AC_MSG_ERROR(unknown system type $BAKEFILE_HOST.)
1071 if test "x$PIC_FLAG" != "x" ; then
1072 PIC_FLAG="$PIC_FLAG -DPIC"
1075 if test "x$SHARED_LD_MODULE_CC" = "x" ; then
1076 SHARED_LD_MODULE_CC="$SHARED_LD_CC"
1078 if test "x$SHARED_LD_MODULE_CXX" = "x" ; then
1079 SHARED_LD_MODULE_CXX="$SHARED_LD_CXX"
1082 AC_SUBST(SHARED_LD_CC)
1083 AC_SUBST(SHARED_LD_CXX)
1084 AC_SUBST(SHARED_LD_MODULE_CC)
1085 AC_SUBST(SHARED_LD_MODULE_CXX)
1090 dnl ---------------------------------------------------------------------------
1091 dnl AC_BAKEFILE_SHARED_VERSIONS
1093 dnl Detects linker options for attaching versions (sonames) to shared libs.
1094 dnl ---------------------------------------------------------------------------
1096 AC_DEFUN([AC_BAKEFILE_SHARED_VERSIONS],
1105 case "${BAKEFILE_HOST}" in
1106 *-*-linux* | *-*-freebsd* )
1107 SONAME_FLAG="-Wl,-soname,"
1127 AC_SUBST(USE_SOVERSION)
1128 AC_SUBST(USE_SOVERLINUX)
1129 AC_SUBST(USE_SOVERSOLARIS)
1130 AC_SUBST(USE_MACVERSION)
1131 AC_SUBST(USE_SOSYMLINKS)
1132 AC_SUBST(SONAME_FLAG)
1136 dnl ---------------------------------------------------------------------------
1137 dnl AC_BAKEFILE_DEPS
1139 dnl Detects available C/C++ dependency tracking options
1140 dnl ---------------------------------------------------------------------------
1142 AC_DEFUN([AC_BAKEFILE_DEPS],
1144 AC_MSG_CHECKING([for dependency tracking method])
1147 if test "x$GCC" = "xyes"; then
1150 case "${BAKEFILE_HOST}" in
1152 dnl -cpp-precomp (the default) conflicts with -MMD option
1153 dnl used by bk-deps (see also http://developer.apple.com/documentation/Darwin/Conceptual/PortingUnix/compiling/chapter_4_section_3.html)
1154 DEPSFLAG_GCC="-no-cpp-precomp -MMD"
1160 AC_MSG_RESULT([gcc])
1161 elif test "x$MWCC" = "xyes"; then
1165 AC_MSG_RESULT([mwcc])
1167 AC_MSG_RESULT([none])
1170 if test $DEPS_TRACKING = 1 ; then
1171 AC_BAKEFILE_CREATE_FILE_BK_DEPS
1175 AC_SUBST(DEPS_TRACKING)
1178 dnl ---------------------------------------------------------------------------
1179 dnl AC_BAKEFILE_CHECK_BASIC_STUFF
1181 dnl Checks for presence of basic programs, such as C and C++ compiler, "ranlib"
1183 dnl ---------------------------------------------------------------------------
1185 AC_DEFUN([AC_BAKEFILE_CHECK_BASIC_STUFF],
1194 AC_CHECK_TOOL(AR, ar, ar)
1195 AC_CHECK_TOOL(STRIP, strip, :)
1196 AC_CHECK_TOOL(NM, nm, :)
1198 case ${BAKEFILE_HOST} in
1200 dnl HP-UX install doesn't handle the "-d" switch so don't
1202 INSTALL_DIR="mkdir -p"
1204 *) INSTALL_DIR="$INSTALL -d"
1207 AC_SUBST(INSTALL_DIR)
1210 case ${BAKEFILE_HOST} in
1211 *-*-cygwin* | *-*-mingw32* )
1212 LDFLAGS_GUI="-mwindows"
1214 AC_SUBST(LDFLAGS_GUI)
1218 dnl ---------------------------------------------------------------------------
1219 dnl AC_BAKEFILE_RES_COMPILERS
1221 dnl Checks for presence of resource compilers for win32 or mac
1222 dnl ---------------------------------------------------------------------------
1224 AC_DEFUN([AC_BAKEFILE_RES_COMPILERS],
1229 case ${BAKEFILE_HOST} in
1230 *-*-cygwin* | *-*-mingw32* )
1231 dnl Check for win32 resources compiler:
1232 if test "$build" != "$host" ; then
1233 RESCOMP=$host_alias-windres
1235 AC_CHECK_PROG(RESCOMP, windres, windres, windres)
1239 *-*-darwin* | powerpc-apple-macos* )
1240 AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez)
1241 AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile)
1249 dnl ---------------------------------------------------------------------------
1250 dnl AC_BAKEFILE_PRECOMP_HEADERS
1252 dnl Check for precompiled headers support (GCC >= 3.4)
1253 dnl ---------------------------------------------------------------------------
1255 AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS],
1258 AC_ARG_ENABLE([precomp-headers],
1259 AS_HELP_STRING([--disable-precomp-headers],
1260 [don't use precompiled headers even if compiler can]),
1261 [bk_use_pch="$enableval"])
1265 if test "x$bk_use_pch" = "x" -o "x$bk_use_pch" = "xyes" ; then
1266 if test "x$GCC" = "xyes"; then
1267 dnl test if we have gcc-3.4:
1268 AC_MSG_CHECKING([if the compiler supports precompiled headers])
1271 #if !defined(__GNUC__) || !defined(__GNUC_MINOR__)
1272 #error "no pch support"
1275 #error "no pch support"
1277 #if (__GNUC__ == 3) && \
1278 ((!defined(__APPLE_CC__) && (__GNUC_MINOR__ < 4)) || \
1279 ( defined(__APPLE_CC__) && (__GNUC_MINOR__ < 3)))
1280 #error "no pch support"
1284 AC_MSG_RESULT([yes])
1290 if test $GCC_PCH = 1 ; then
1291 AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH
1292 chmod +x bk-make-pch
1302 dnl ---------------------------------------------------------------------------
1303 dnl AC_BAKEFILE([autoconf_inc.m4 inclusion])
1305 dnl To be used in configure.in of any project using Bakefile-generated mks
1307 dnl Behaviour can be modified by setting following variables:
1308 dnl BAKEFILE_CHECK_BASICS set to "no" if you don't want bakefile to
1309 dnl to perform check for basic tools like ranlib
1310 dnl BAKEFILE_HOST set this to override host detection, defaults
1312 dnl BAKEFILE_FORCE_PLATFORM set to override platform detection
1316 dnl AC_BAKEFILE([FOO(autoconf_inc.m4)])
1318 dnl (replace FOO with m4_include above, aclocal would die otherwise)
1319 dnl (yes, it's ugly, but thanks to a bug in aclocal, it's the only thing
1321 dnl ---------------------------------------------------------------------------
1323 AC_DEFUN([AC_BAKEFILE],
1327 if test "x$BAKEFILE_HOST" = "x"; then
1328 BAKEFILE_HOST="${host}"
1331 if test "x$BAKEFILE_CHECK_BASICS" != "xno"; then
1332 AC_BAKEFILE_CHECK_BASIC_STUFF
1335 AC_BAKEFILE_PLATFORM
1336 AC_BAKEFILE_PLATFORM_SPECIFICS
1337 AC_BAKEFILE_SUFFIXES
1338 AC_BAKEFILE_SHARED_LD
1339 AC_BAKEFILE_SHARED_VERSIONS
1341 AC_BAKEFILE_RES_COMPILERS
1343 BAKEFILE_BAKEFILE_M4_VERSION="0.1.6"
1345 dnl includes autoconf_inc.m4:
1348 if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then
1349 AC_MSG_ERROR([Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match.])
1354 dnl ---------------------------------------------------------------------------
1355 dnl Embedded copies of helper scripts follow:
1356 dnl ---------------------------------------------------------------------------
1358 AC_DEFUN([AC_BAKEFILE_CREATE_FILE_DLLAR_SH],
1360 dnl ===================== dllar.sh begins here =====================
1361 dnl (Created by merge-scripts.py from dllar.sh
1362 dnl file do not edit here!)
1367 # dllar - a tool to build both a .dll and an .a file
1368 # from a set of object (.o) files for EMX/OS2.
1370 # Written by Andrew Zabolotny, bit@freya.etu.ru
1371 # Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de
1373 # This script will accept a set of files on the command line.
1374 # All the public symbols from the .o files will be exported into
1375 # a .DEF file, then linker will be run (through gcc) against them to
1376 # build a shared library consisting of all given .o files. All libraries
1377 # (.a) will be first decompressed into component .o files then act as
1378 # described above. You can optionally give a description (-d "description")
1379 # which will be put into .DLL. To see the list of accepted options (as well
1380 # as command-line format) simply run this program without options. The .DLL
1381 # is built to be imported by name (there is no guarantee that new versions
1382 # of the library you build will have same ordinals for same symbols).
1384 # dllar is free software; you can redistribute it and/or modify
1385 # it under the terms of the GNU General Public License as published by
1386 # the Free Software Foundation; either version 2, or (at your option)
1387 # any later version.
1389 # dllar is distributed in the hope that it will be useful,
1390 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1391 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1392 # GNU General Public License for more details.
1394 # You should have received a copy of the GNU General Public License
1395 # along with dllar; see the file COPYING. If not, write to the Free
1396 # Software Foundation, 59 Temple Place - Suite 330, Boston, MA
1399 # To successfuly run this program you will need:
1400 # - Current drive should have LFN support (HPFS, ext2, network, etc)
1401 # (Sometimes dllar generates filenames which won't fit 8.3 scheme)
1403 # (used to build the .dll)
1405 # (used to create .def file from .o files)
1407 # (used to create .a file from .def file)
1408 # - GNU text utilites (cat, sort, uniq)
1409 # used to process emxexp output
1410 # - GNU file utilities (mv, rm)
1412 # - lxlite (optional, see flag below)
1413 # (used for general .dll cleanup)
1420 # basnam, variant of basename, which does _not_ remove the path, _iff_
1421 # second argument (suffix to remove) is given
1425 echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//'
1428 echo ${D}1 | sed 's/'${D}2'${D}//'
1431 echo "error in basnam ${D}*"
1437 # Cleanup temporary files and output
1440 for i in ${D}inputFiles ; do
1443 rm -rf \`basnam ${D}i !\`
1450 # Kill result in case of failure as there is just to many stupid make/nmake
1451 # things out there which doesn't do this.
1452 if @<:@ ${D}# -eq 0 @:>@; then
1453 rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile
1457 # Print usage and exit script with rc=1.
1459 echo 'Usage: dllar.sh @<:@-o@<:@utput@:>@ output_file@:>@ @<:@-i@<:@mport@:>@ importlib_name@:>@'
1460 echo ' @<:@-name-mangler-script script.sh@:>@'
1461 echo ' @<:@-d@<:@escription@:>@ "dll descrption"@:>@ @<:@-cc "CC"@:>@ @<:@-f@<:@lags@:>@ "CFLAGS"@:>@'
1462 echo ' @<:@-ord@<:@inals@:>@@:>@ -ex@<:@clude@:>@ "symbol(s)"'
1463 echo ' @<:@-libf@<:@lags@:>@ "{INIT|TERM}{GLOBAL|INSTANCE}"@:>@ @<:@-nocrt@<:@dll@:>@@:>@ @<:@-nolxl@<:@ite@:>@@:>@'
1464 echo ' @<:@*.o@:>@ @<:@*.a@:>@'
1465 echo '*> "output_file" should have no extension.'
1466 echo ' If it has the .o, .a or .dll extension, it is automatically removed.'
1467 echo ' The import library name is derived from this and is set to "name".a,'
1468 echo ' unless overridden by -import'
1469 echo '*> "importlib_name" should have no extension.'
1470 echo ' If it has the .o, or .a extension, it is automatically removed.'
1471 echo ' This name is used as the import library name and may be longer and'
1472 echo ' more descriptive than the DLL name which has to follow the old '
1473 echo ' 8.3 convention of FAT.'
1474 echo '*> "script.sh may be given to override the output_file name by a'
1475 echo ' different name. It is mainly useful if the regular make process'
1476 echo ' of some package does not take into account OS/2 restriction of'
1477 echo ' DLL name lengths. It takes the importlib name as input and is'
1478 echo ' supposed to procude a shorter name as output. The script should'
1479 echo ' expect to get importlib_name without extension and should produce'
1480 echo ' a (max.) 8 letter name without extension.'
1481 echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)'
1482 echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)'
1483 echo ' These flags will be put at the start of GCC command line.'
1484 echo '*> -ord@<:@inals@:>@ tells dllar to export entries by ordinals. Be careful.'
1485 echo '*> -ex@<:@clude@:>@ defines symbols which will not be exported. You can define'
1486 echo ' multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".'
1487 echo ' If the last character of a symbol is "*", all symbols beginning'
1488 echo ' with the prefix before "*" will be exclude, (see _GLOBAL* above).'
1489 echo '*> -libf@<:@lags@:>@ can be used to add INITGLOBAL/INITINSTANCE and/or'
1490 echo ' TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.'
1491 echo '*> -nocrt@<:@dll@:>@ switch will disable linking the library against emx''s'
1492 echo ' C runtime DLLs.'
1493 echo '*> -nolxl@<:@ite@:>@ switch will disable running lxlite on the resulting DLL.'
1494 echo '*> All other switches (for example -L./ or -lmylib) will be passed'
1495 echo ' unchanged to GCC at the end of command line.'
1496 echo '*> If you create a DLL from a library and you do not specify -o,'
1497 echo ' the basename for DLL and import library will be set to library name,'
1498 echo ' the initial library will be renamed to 'name'_s.a (_s for static)'
1499 echo ' i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial'
1500 echo ' library will be renamed into gcc_s.a.'
1503 echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord'
1504 echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"'
1509 # Execute a command.
1510 # If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script.
1511 # @Uses Whatever CleanUp() uses.
1517 if @<:@ ${D}rcCmd -ne 0 @:>@; then
1518 echo "command failed, exit code="${D}rcCmd
1533 CFLAGS="-s -Zcrtdll"
1535 EXPORT_BY_ORDINALS=0
1544 curDirS=${D}{curDirS}"/"
1550 while @<:@ ${D}1 @:>@; do
1553 EXPORT_BY_ORDINALS=1;
1563 -name-mangler-script)
1584 exclude_symbols=${D}{exclude_symbols}${D}1" "
1588 library_flags=${D}{library_flags}${D}1" "
1607 EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
1610 EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`"
1611 if @<:@ ${D}omfLinking -eq 1 @:>@; then
1612 EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib"
1614 EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a"
1619 if @<:@ ${D}libsToLink -ne 0 @:>@; then
1620 EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
1622 for file in ${D}1 ; do
1623 if @<:@ -f ${D}file @:>@; then
1624 inputFiles="${D}{inputFiles} ${D}file"
1628 if @<:@ ${D}found -eq 0 @:>@; then
1629 echo "ERROR: No file(s) found: "${D}1
1636 done # iterate cmdline words
1639 if @<:@ -z "${D}inputFiles" @:>@; then
1640 echo "dllar: no input files"
1644 # Now extract all .o files from .a files
1646 for file in ${D}inputFiles ; do
1657 EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf"
1662 dirname=\`basnam ${D}file ${D}suffix\`"_%"
1664 if @<:@ ${D}? -ne 0 @:>@; then
1665 echo "Failed to create subdirectory ./${D}dirname"
1669 # Append '!' to indicate archive
1670 newInputFiles="${D}newInputFiles ${D}{dirname}!"
1671 doCommand "cd ${D}dirname; ${D}AR x ../${D}file"
1674 for subfile in ${D}dirname/*.o* ; do
1675 if @<:@ -f ${D}subfile @:>@; then
1677 if @<:@ -s ${D}subfile @:>@; then
1678 # FIXME: This should be: is file size > 32 byte, _not_ > 0!
1679 newInputFiles="${D}newInputFiles ${D}subfile"
1683 if @<:@ ${D}found -eq 0 @:>@; then
1684 echo "WARNING: there are no files in archive \\'${D}file\\'"
1688 newInputFiles="${D}{newInputFiles} ${D}file"
1692 inputFiles="${D}newInputFiles"
1694 # Output filename(s).
1696 if @<:@ -z ${D}outFile @:>@; then
1698 set outFile ${D}inputFiles; outFile=${D}2
1701 # If it is an archive, remove the '!' and the '_%' suffixes
1704 outFile=\`basnam ${D}outFile _%!\`
1711 outFile=\`basnam ${D}outFile .dll\`
1714 outFile=\`basnam ${D}outFile .DLL\`
1717 outFile=\`basnam ${D}outFile .o\`
1720 outFile=\`basnam ${D}outFile .obj\`
1723 outFile=\`basnam ${D}outFile .a\`
1726 outFile=\`basnam ${D}outFile .lib\`
1731 case ${D}outimpFile in
1733 outimpFile=\`basnam ${D}outimpFile .a\`
1736 outimpFile=\`basnam ${D}outimpFile .lib\`
1741 if @<:@ -z ${D}outimpFile @:>@; then
1742 outimpFile=${D}outFile
1744 defFile="${D}{outFile}.def"
1745 arcFile="${D}{outimpFile}.a"
1746 arcFile2="${D}{outimpFile}.lib"
1748 #create ${D}dllFile as something matching 8.3 restrictions,
1749 if @<:@ -z ${D}renameScript @:>@ ; then
1750 dllFile="${D}outFile"
1752 dllFile=\`${D}renameScript ${D}outimpFile\`
1755 if @<:@ ${D}do_backup -ne 0 @:>@ ; then
1756 if @<:@ -f ${D}arcFile @:>@ ; then
1757 doCommand "mv ${D}arcFile ${D}{outFile}_s.a"
1759 if @<:@ -f ${D}arcFile2 @:>@ ; then
1760 doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib"
1764 # Extract public symbols from all the object files.
1765 tmpdefFile=${D}{defFile}_%
1766 rm -f ${D}tmpdefFile
1767 for file in ${D}inputFiles ; do
1772 doCommand "emxexp -u ${D}file >> ${D}tmpdefFile"
1777 # Create the def file.
1779 echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile
1780 dllFile="${D}{dllFile}.dll"
1781 if @<:@ ! -z ${D}description @:>@; then
1782 echo "DESCRIPTION \\"${D}{description}\\"" >> ${D}defFile
1784 echo "EXPORTS" >> ${D}defFile
1786 doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%"
1787 grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile
1789 # Checks if the export is ok or not.
1790 for word in ${D}exclude_symbols; do
1791 grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}%
1792 mv ${D}{tmpdefFile}% ${D}tmpdefFile
1796 if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
1797 sed "=" < ${D}tmpdefFile | \\
1801 s/^\\(@<:@0-9@:>@\\+\\)\\(@<:@^;@:>@*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/
1803 ' > ${D}{tmpdefFile}%
1804 grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile
1806 rm -f ${D}{tmpdefFile}%
1808 cat ${D}tmpdefFile >> ${D}defFile
1809 rm -f ${D}tmpdefFile
1811 # Do linking, create implib, and apply lxlite.
1813 for file in ${D}inputFiles ; do
1818 gccCmdl="${D}gccCmdl ${D}file"
1822 doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS"
1823 touch "${D}{outFile}.dll"
1825 doCommand "emximp -o ${D}arcFile ${D}defFile"
1826 if @<:@ ${D}flag_USE_LXLITE -ne 0 @:>@; then
1828 if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
1831 doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile"
1833 doCommand "emxomf -s -l ${D}arcFile"
1839 dnl ===================== dllar.sh ends here =====================
1842 AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_DEPS],
1844 dnl ===================== bk-deps begins here =====================
1845 dnl (Created by merge-scripts.py from bk-deps
1846 dnl file do not edit here!)
1851 # This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
1852 # script. It is used to track C/C++ files dependencies in portable way.
1854 # Permission is given to use this file in any way.
1856 DEPSMODE=${DEPSMODE}
1858 DEPSFLAG_GCC="${DEPSFLAG_GCC}"
1859 DEPSFLAG_MWCC="${DEPSFLAG_MWCC}"
1861 mkdir -p ${D}DEPSDIR
1863 if test ${D}DEPSMODE = gcc ; then
1864 ${D}* ${D}{DEPSFLAG_GCC}
1866 if test ${D}{status} != 0 ; then
1869 # move created file to the location we want it in:
1870 while test ${D}# -gt 0; do
1884 depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\`
1885 depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\`
1886 if test -f ${D}depfile ; then
1887 sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d
1890 depfile=\`basename ${D}objfile | sed -e 's/\\..*${D}/.d/g'\`
1891 if test -f ${D}depfile ; then
1892 sed -e "/^${D}objfile/!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{DEPSDIR}/${D}{objfile}.d
1897 elif test ${D}DEPSMODE = mwcc ; then
1900 if test ${D}{status} != 0 ; then
1903 # Run mwcc again with -MM and redirect into the dep file we want
1904 # NOTE: We can't use shift here because we need ${D}* to be valid
1906 for arg in ${D}* ; do
1907 if test "${D}prevarg" = "-o"; then
1920 ${D}* ${D}DEPSFLAG_MWCC >${D}{DEPSDIR}/${D}{objfile}.d
1927 dnl ===================== bk-deps ends here =====================
1930 AC_DEFUN([AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH],
1932 dnl ===================== shared-ld-sh begins here =====================
1933 dnl (Created by merge-scripts.py from shared-ld-sh
1934 dnl file do not edit here!)
1936 cat <<EOF >shared-ld-sh
1938 #-----------------------------------------------------------------------------
1939 #-- Name: distrib/mac/shared-ld-sh
1940 #-- Purpose: Link a mach-o dynamic shared library for Darwin / Mac OS X
1941 #-- Author: Gilles Depeyrot
1942 #-- Copyright: (c) 2002 Gilles Depeyrot
1943 #-- Licence: any use permitted
1944 #-----------------------------------------------------------------------------
1949 linking_flag="-dynamiclib"
1951 while test ${D}# -gt 0; do
1958 -o|-compatibility_version|-current_version|-framework|-undefined|-install_name)
1959 # collect these options and values
1960 args="${D}{args} ${D}1 ${D}2"
1964 -l*|-L*|-flat_namespace|-headerpad_max_install_names)
1965 # collect these options
1966 args="${D}{args} ${D}1"
1969 -dynamiclib|-bundle)
1970 linking_flag="${D}1"
1974 echo "shared-ld: unhandled option '${D}1'"
1978 *.o | *.a | *.dylib)
1979 # collect object files
1980 objects="${D}{objects} ${D}1"
1984 echo "shared-ld: unhandled argument '${D}1'"
1993 # Link one module containing all the others
1995 if test ${D}{verbose} = 1; then
1996 echo "c++ -r -keep_private_externs -nostdlib ${D}{objects} -o master.${D}${D}.o"
1998 c++ -r -keep_private_externs -nostdlib ${D}{objects} -o master.${D}${D}.o
2000 if test ${D}{status} != 0; then
2005 # Link the shared library from the single module created
2007 if test ${D}{verbose} = 1; then
2008 echo "cc ${D}{linking_flag} master.${D}${D}.o ${D}{args}"
2010 c++ ${D}{linking_flag} master.${D}${D}.o ${D}{args}
2012 if test ${D}{status} != 0; then
2017 # Remove intermediate module
2019 rm -f master.${D}${D}.o
2023 dnl ===================== shared-ld-sh ends here =====================
2026 AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH],
2028 dnl ===================== bk-make-pch begins here =====================
2029 dnl (Created by merge-scripts.py from bk-make-pch
2030 dnl file do not edit here!)
2032 cat <<EOF >bk-make-pch
2035 # This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
2036 # script. It is used to generated precompiled headers.
2038 # Permission is given to use this file in any way.
2047 while test ${D}{#} -gt 0; do
2050 incdir=\`echo ${D}{1} | sed -e 's/-I\\(.*\\)/\\1/g'\`
2051 if test "x${D}{headerfile}" = "x" -a -f "${D}{incdir}/${D}{header}" ; then
2052 headerfile="${D}{incdir}/${D}{header}"
2056 compiler="${D}{compiler} ${D}{1}"
2060 if test "x${D}{headerfile}" = "x" ; then
2061 echo "error: can't find header ${D}{header} in include paths" >2
2063 if test -f ${D}{outfile} ; then
2066 mkdir -p \`dirname ${D}{outfile}\`
2068 depsfile=".deps/\`echo ${D}{outfile} | tr '/.' '__'\`.d"
2070 # can do this because gcc is >= 3.4:
2071 ${D}{compiler} -o ${D}{outfile} -MMD -MF "${D}{depsfile}" "${D}{headerfile}"
2075 dnl ===================== bk-make-pch ends here =====================
2078 # Configure paths for GTK+
2079 # Owen Taylor 1997-2001
2081 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
2082 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
2083 dnl pass to pkg-config
2085 AC_DEFUN([AM_PATH_GTK_2_0],
2087 dnl Get the cflags and libraries from pkg-config
2089 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
2090 , enable_gtktest=yes)
2092 pkg_config_args=gtk+-2.0
2097 pkg_config_args="$pkg_config_args gthread-2.0"
2104 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2106 if test x$PKG_CONFIG != xno ; then
2107 if pkg-config --atleast-pkgconfig-version 0.7 ; then
2110 echo "*** pkg-config too old; version 0.7 or better required."
2118 min_gtk_version=ifelse([$1], ,2.0.0,$1)
2119 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
2121 if test x$PKG_CONFIG != xno ; then
2122 ## don't try to run the test against uninstalled libtool libs
2123 if $PKG_CONFIG --uninstalled $pkg_config_args; then
2124 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
2128 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
2135 if test x"$no_gtk" = x ; then
2136 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
2137 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
2138 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
2139 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
2140 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
2141 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
2142 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
2143 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
2144 if test "x$enable_gtktest" = "xyes" ; then
2145 ac_save_CFLAGS="$CFLAGS"
2146 ac_save_LIBS="$LIBS"
2147 CFLAGS="$CFLAGS $GTK_CFLAGS"
2148 LIBS="$GTK_LIBS $LIBS"
2150 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
2151 dnl checks the results of pkg-config to some extent)
2155 #include <gtk/gtk.h>
2162 int major, minor, micro;
2165 system ("touch conf.gtktest");
2167 /* HP/UX 9 (%@#!) writes to sscanf strings */
2168 tmp_version = g_strdup("$min_gtk_version");
2169 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
2170 printf("%s, bad version string\n", "$min_gtk_version");
2174 if ((gtk_major_version != $gtk_config_major_version) ||
2175 (gtk_minor_version != $gtk_config_minor_version) ||
2176 (gtk_micro_version != $gtk_config_micro_version))
2178 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
2179 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
2180 gtk_major_version, gtk_minor_version, gtk_micro_version);
2181 printf ("*** was found! If pkg-config was correct, then it is best\n");
2182 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
2183 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
2184 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
2185 printf("*** required on your system.\n");
2186 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
2187 printf("*** to point to the correct configuration files\n");
2189 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
2190 (gtk_minor_version != GTK_MINOR_VERSION) ||
2191 (gtk_micro_version != GTK_MICRO_VERSION))
2193 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
2194 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
2195 printf("*** library (version %d.%d.%d)\n",
2196 gtk_major_version, gtk_minor_version, gtk_micro_version);
2200 if ((gtk_major_version > major) ||
2201 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
2202 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
2208 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
2209 gtk_major_version, gtk_minor_version, gtk_micro_version);
2210 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
2211 major, minor, micro);
2212 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
2214 printf("*** If you have already installed a sufficiently new version, this error\n");
2215 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
2216 printf("*** being found. The easiest way to fix this is to remove the old version\n");
2217 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
2218 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
2219 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
2220 printf("*** so that the correct libraries are found at run-time))\n");
2225 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
2226 CFLAGS="$ac_save_CFLAGS"
2227 LIBS="$ac_save_LIBS"
2230 if test "x$no_gtk" = x ; then
2231 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
2232 ifelse([$2], , :, [$2])
2235 if test "$PKG_CONFIG" = "no" ; then
2236 echo "*** A new enough version of pkg-config was not found."
2237 echo "*** See http://pkgconfig.sourceforge.net"
2239 if test -f conf.gtktest ; then
2242 echo "*** Could not run GTK+ test program, checking why..."
2243 ac_save_CFLAGS="$CFLAGS"
2244 ac_save_LIBS="$LIBS"
2245 CFLAGS="$CFLAGS $GTK_CFLAGS"
2246 LIBS="$LIBS $GTK_LIBS"
2248 #include <gtk/gtk.h>
2250 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
2251 [ echo "*** The test program compiled, but did not run. This usually means"
2252 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
2253 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
2254 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
2255 echo "*** to the installed location Also, make sure you have run ldconfig if that"
2256 echo "*** is required on your system"
2258 echo "*** If you have an old version installed, it is best to remove it, although"
2259 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
2260 [ echo "*** The test program failed to compile or link. See the file config.log for the"
2261 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
2262 CFLAGS="$ac_save_CFLAGS"
2263 LIBS="$ac_save_LIBS"
2268 ifelse([$3], , :, [$3])
2270 AC_SUBST(GTK_CFLAGS)
2275 # Configure paths for GTK+
2276 # Owen Taylor 97-11-3
2278 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
2279 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
2281 AC_DEFUN(AM_PATH_GTK,
2283 dnl Get the cflags and libraries from the gtk-config script
2285 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
2286 gtk_config_prefix="$withval", gtk_config_prefix="")
2287 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
2288 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
2289 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
2290 , enable_gtktest=yes)
2296 gtk_config_args="$gtk_config_args gthread"
2301 if test x$gtk_config_exec_prefix != x ; then
2302 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
2303 if test x${GTK_CONFIG+set} != xset ; then
2304 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
2307 if test x$gtk_config_prefix != x ; then
2308 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
2309 if test x${GTK_CONFIG+set} != xset ; then
2310 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
2314 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
2315 min_gtk_version=ifelse([$1], ,0.99.7,$1)
2316 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
2318 if test "$GTK_CONFIG" = "no" ; then
2321 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
2322 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
2323 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
2324 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
2325 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
2326 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
2327 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
2328 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
2329 if test "x$enable_gtktest" = "xyes" ; then
2330 ac_save_CFLAGS="$CFLAGS"
2331 ac_save_LIBS="$LIBS"
2332 CFLAGS="$CFLAGS $GTK_CFLAGS"
2333 LIBS="$GTK_LIBS $LIBS"
2335 dnl Now check if the installed GTK is sufficiently new. (Also sanity
2336 dnl checks the results of gtk-config to some extent
2340 #include <gtk/gtk.h>
2347 int major, minor, micro;
2350 system ("touch conf.gtktest");
2352 /* HP/UX 9 (%@#!) writes to sscanf strings */
2353 tmp_version = g_strdup("$min_gtk_version");
2354 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
2355 printf("%s, bad version string\n", "$min_gtk_version");
2359 if ((gtk_major_version != $gtk_config_major_version) ||
2360 (gtk_minor_version != $gtk_config_minor_version) ||
2361 (gtk_micro_version != $gtk_config_micro_version))
2363 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
2364 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
2365 gtk_major_version, gtk_minor_version, gtk_micro_version);
2366 printf ("*** was found! If gtk-config was correct, then it is best\n");
2367 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
2368 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
2369 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
2370 printf("*** required on your system.\n");
2371 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
2372 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
2373 printf("*** before re-running configure\n");
2375 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
2376 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
2377 (gtk_minor_version != GTK_MINOR_VERSION) ||
2378 (gtk_micro_version != GTK_MICRO_VERSION))
2380 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
2381 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
2382 printf("*** library (version %d.%d.%d)\n",
2383 gtk_major_version, gtk_minor_version, gtk_micro_version);
2385 #endif /* defined (GTK_MAJOR_VERSION) ... */
2388 if ((gtk_major_version > major) ||
2389 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
2390 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
2396 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
2397 gtk_major_version, gtk_minor_version, gtk_micro_version);
2398 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
2399 major, minor, micro);
2400 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
2402 printf("*** If you have already installed a sufficiently new version, this error\n");
2403 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
2404 printf("*** being found. The easiest way to fix this is to remove the old version\n");
2405 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
2406 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
2407 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
2408 printf("*** so that the correct libraries are found at run-time))\n");
2413 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
2414 CFLAGS="$ac_save_CFLAGS"
2415 LIBS="$ac_save_LIBS"
2418 if test "x$no_gtk" = x ; then
2420 ifelse([$2], , :, [$2])
2423 if test "$GTK_CONFIG" = "no" ; then
2424 echo "*** The gtk-config script installed by GTK could not be found"
2425 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
2426 echo "*** your path, or set the GTK_CONFIG environment variable to the"
2427 echo "*** full path to gtk-config."
2429 if test -f conf.gtktest ; then
2432 echo "*** Could not run GTK test program, checking why..."
2433 CFLAGS="$CFLAGS $GTK_CFLAGS"
2434 LIBS="$LIBS $GTK_LIBS"
2436 #include <gtk/gtk.h>
2438 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
2439 [ echo "*** The test program compiled, but did not run. This usually means"
2440 echo "*** that the run-time linker is not finding GTK or finding the wrong"
2441 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
2442 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
2443 echo "*** to the installed location Also, make sure you have run ldconfig if that"
2444 echo "*** is required on your system"
2446 echo "*** If you have an old version installed, it is best to remove it, although"
2447 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
2449 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
2450 echo "*** came with the system with the command"
2452 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
2453 [ echo "*** The test program failed to compile or link. See the file config.log for the"
2454 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
2455 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
2456 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
2457 CFLAGS="$ac_save_CFLAGS"
2458 LIBS="$ac_save_LIBS"
2463 ifelse([$3], , :, [$3])
2465 AC_SUBST(GTK_CFLAGS)
2471 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
2472 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
2473 dnl also defines GSTUFF_PKG_ERRORS on error
2474 AC_DEFUN(PKG_CHECK_MODULES, [
2477 if test -z "$PKG_CONFIG"; then
2478 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2481 if test "$PKG_CONFIG" = "no" ; then
2482 echo "*** The pkg-config script could not be found. Make sure it is"
2483 echo "*** in your path, or set the PKG_CONFIG environment variable"
2484 echo "*** to the full path to pkg-config."
2485 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
2487 PKG_CONFIG_MIN_VERSION=0.9.0
2488 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
2489 AC_MSG_CHECKING(for $2)
2491 if $PKG_CONFIG --exists "$2" ; then
2495 AC_MSG_CHECKING($1_CFLAGS)
2496 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
2497 AC_MSG_RESULT($$1_CFLAGS)
2499 AC_MSG_CHECKING($1_LIBS)
2500 $1_LIBS=`$PKG_CONFIG --libs "$2"`
2501 AC_MSG_RESULT($$1_LIBS)
2505 ## If we have a custom action on failure, don't print errors, but
2506 ## do set a variable so people can do so.
2507 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
2508 ifelse([$4], ,echo $$1_PKG_ERRORS,)
2514 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
2515 echo "*** See http://www.freedesktop.org/software/pkgconfig"
2519 if test $succeeded = yes; then
2520 ifelse([$3], , :, [$3])
2522 ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
2528 # Configure paths for SDL
2529 # Sam Lantinga 9/21/99
2530 # stolen from Manish Singh
2531 # stolen back from Frank Belew
2532 # stolen from Manish Singh
2533 # Shamelessly stolen from Owen Taylor
2535 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
2536 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
2538 AC_DEFUN([AM_PATH_SDL],
2540 dnl Get the cflags and libraries from the sdl-config script
2542 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
2543 sdl_prefix="$withval", sdl_prefix="")
2544 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
2545 sdl_exec_prefix="$withval", sdl_exec_prefix="")
2546 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
2547 , enable_sdltest=yes)
2549 if test x$sdl_exec_prefix != x ; then
2550 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
2551 if test x${SDL_CONFIG+set} != xset ; then
2552 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
2555 if test x$sdl_prefix != x ; then
2556 sdl_args="$sdl_args --prefix=$sdl_prefix"
2557 if test x${SDL_CONFIG+set} != xset ; then
2558 SDL_CONFIG=$sdl_prefix/bin/sdl-config
2562 AC_REQUIRE([AC_CANONICAL_TARGET])
2563 PATH="$prefix/bin:$prefix/usr/bin:$PATH"
2564 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
2565 min_sdl_version=ifelse([$1], ,0.11.0,$1)
2566 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
2568 if test "$SDL_CONFIG" = "no" ; then
2571 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
2572 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
2574 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
2575 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
2576 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
2577 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
2578 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
2579 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
2580 if test "x$enable_sdltest" = "xyes" ; then
2581 ac_save_CFLAGS="$CFLAGS"
2582 ac_save_LIBS="$LIBS"
2583 CFLAGS="$CFLAGS $SDL_CFLAGS"
2584 LIBS="$LIBS $SDL_LIBS"
2586 dnl Now check if the installed SDL is sufficiently new. (Also sanity
2587 dnl checks the results of sdl-config to some extent
2597 my_strdup (char *str)
2603 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
2604 strcpy (new_str, str);
2612 int main (int argc, char *argv[])
2614 int major, minor, micro;
2617 /* This hangs on some systems (?)
2618 system ("touch conf.sdltest");
2620 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
2622 /* HP/UX 9 (%@#!) writes to sscanf strings */
2623 tmp_version = my_strdup("$min_sdl_version");
2624 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
2625 printf("%s, bad version string\n", "$min_sdl_version");
2629 if (($sdl_major_version > major) ||
2630 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
2631 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
2637 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
2638 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
2639 printf("*** best to upgrade to the required version.\n");
2640 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
2641 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
2642 printf("*** config.cache before re-running configure\n");
2647 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
2648 CFLAGS="$ac_save_CFLAGS"
2649 LIBS="$ac_save_LIBS"
2652 if test "x$no_sdl" = x ; then
2654 ifelse([$2], , :, [$2])
2657 if test "$SDL_CONFIG" = "no" ; then
2658 echo "*** The sdl-config script installed by SDL could not be found"
2659 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
2660 echo "*** your path, or set the SDL_CONFIG environment variable to the"
2661 echo "*** full path to sdl-config."
2663 if test -f conf.sdltest ; then
2666 echo "*** Could not run SDL test program, checking why..."
2667 CFLAGS="$CFLAGS $SDL_CFLAGS"
2668 LIBS="$LIBS $SDL_LIBS"
2673 int main(int argc, char *argv[])
2676 #define main K_and_R_C_main
2678 [ echo "*** The test program compiled, but did not run. This usually means"
2679 echo "*** that the run-time linker is not finding SDL or finding the wrong"
2680 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
2681 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
2682 echo "*** to the installed location Also, make sure you have run ldconfig if that"
2683 echo "*** is required on your system"
2685 echo "*** If you have an old version installed, it is best to remove it, although"
2686 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
2687 [ echo "*** The test program failed to compile or link. See the file config.log for the"
2688 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
2689 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
2690 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
2691 CFLAGS="$ac_save_CFLAGS"
2692 LIBS="$ac_save_LIBS"
2697 ifelse([$3], , :, [$3])
2699 AC_SUBST(SDL_CFLAGS)
2704 dnl Perform a check for a GStreamer element using gst-inspect
2705 dnl Thomas Vander Stichele <thomas at apestaart dot org>
2706 dnl Last modification: 23/10/2002
2708 dnl AM_GST_ELEMENT_CHECK(ELEMENT-NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
2710 AC_DEFUN([AM_GST_ELEMENT_CHECK],
2712 AC_CHECK_PROG(GST_INSPECT, gst-inspect, gst-inspect, [])
2713 if test "x$GST_INSPECT" != "x"; then
2714 AC_MSG_CHECKING(GStreamer element $1)
2715 if [ $GST_INSPECT $1 > /dev/null 2> /dev/null ]; then
2716 AC_MSG_RESULT(found.)
2719 AC_MSG_RESULT(not found.)
2726 dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
2728 AC_DEFUN(AM_PATH_CPPUNIT,
2731 AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
2732 cppunit_config_prefix="$withval", cppunit_config_prefix="")
2733 AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
2734 cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
2736 if test x$cppunit_config_exec_prefix != x ; then
2737 cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
2738 if test x${CPPUNIT_CONFIG+set} != xset ; then
2739 CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
2742 if test x$cppunit_config_prefix != x ; then
2743 cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
2744 if test x${CPPUNIT_CONFIG+set} != xset ; then
2745 CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
2749 AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
2750 cppunit_version_min=$1
2752 AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
2754 if test "$CPPUNIT_CONFIG" = "no" ; then
2757 CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
2758 CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
2759 cppunit_version=`$CPPUNIT_CONFIG --version`
2761 cppunit_major_version=`echo $cppunit_version | \
2762 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
2763 cppunit_minor_version=`echo $cppunit_version | \
2764 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
2765 cppunit_micro_version=`echo $cppunit_version | \
2766 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
2768 cppunit_major_min=`echo $cppunit_version_min | \
2769 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
2770 cppunit_minor_min=`echo $cppunit_version_min | \
2771 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
2772 cppunit_micro_min=`echo $cppunit_version_min | \
2773 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
2775 cppunit_version_proper=`expr \
2776 $cppunit_major_version \> $cppunit_major_min \| \
2777 $cppunit_major_version \= $cppunit_major_min \& \
2778 $cppunit_minor_version \> $cppunit_minor_min \| \
2779 $cppunit_major_version \= $cppunit_major_min \& \
2780 $cppunit_minor_version \= $cppunit_minor_min \& \
2781 $cppunit_micro_version \>= $cppunit_micro_min `
2783 if test "$cppunit_version_proper" = "1" ; then
2784 AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
2791 if test "x$no_cppunit" = x ; then
2792 ifelse([$2], , :, [$2])
2796 ifelse([$3], , :, [$3])
2799 AC_SUBST(CPPUNIT_CFLAGS)
2800 AC_SUBST(CPPUNIT_LIBS)