X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1d22ded8d389f1deab28b67d0501d96671585a1..932203004620a0981f8669314ad21c503e4c0722:/aclocal.m4 diff --git a/aclocal.m4 b/aclocal.m4 index 811d83d24e..6fb5548951 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -21,6 +21,20 @@ dnl dnl Version: $Id$ dnl --------------------------------------------------------------------------- + +dnl =========================================================================== +dnl Objective-C(++) related macros +dnl =========================================================================== +m4_define([AC_WX_LANG_OBJECTIVEC], +[AC_LANG(C) +ac_ext=m +]) + +m4_define([AC_WX_LANG_OBJECTIVECPLUSPLUS], +[AC_LANG(C++) +ac_ext=mm +]) + dnl =========================================================================== dnl macros to find the a file in the list of include/lib paths dnl =========================================================================== @@ -648,6 +662,167 @@ if test "$ac_cv_cxx_static_cast" = yes; then fi ]) +dnl http://autoconf-archive.cryp.to/ac_cxx_dynamic_cast.html +AC_DEFUN([AC_CXX_DYNAMIC_CAST], +[AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>, +ac_cv_cxx_dynamic_cast, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +class Base { public : Base () {} virtual void f () = 0;}; +class Derived : public Base { public : Derived () {} virtual void f () {} };],[ +Derived d; Base& b=d; return dynamic_cast(&b) ? 0 : 1;], + ac_cv_cxx_dynamic_cast=yes, ac_cv_cxx_dynamic_cast=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_dynamic_cast" = yes; then + AC_DEFINE(HAVE_DYNAMIC_CAST,,[define if the compiler supports dynamic_cast<>]) +fi +]) + + +dnl --------------------------------------------------------------------------- +dnl Compiler detection macros by David Elliott +dnl --------------------------------------------------------------------------- + + +dnl =========================================================================== +dnl Macros to detect non-GNU compilers (MetroWerks, XLC) +dnl =========================================================================== + +dnl Based on autoconf _AC_LANG_COMPILER_GNU +AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_MWERKS], +[AC_CACHE_CHECK([whether we are using the Metrowerks _AC_LANG compiler], + [bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks], + [AC_TRY_COMPILE([],[#ifndef __MWERKS__ + choke me +#endif +], + [bakefile_compiler_mwerks=yes], + [bakefile_compiler_mwerks=no]) + bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks=$bakefile_compiler_mwerks + ]) +]) + +dnl Loosely based on autoconf AC_PROG_CC +dnl TODO: Maybe this should wrap the call to AC_PROG_CC and be used instead. +AC_DEFUN([AC_BAKEFILE_PROG_MWCC], +[AC_LANG_PUSH(C) +_AC_BAKEFILE_LANG_COMPILER_MWERKS +MWCC=`test $bakefile_cv_c_compiler_mwerks = yes && echo yes` +AC_LANG_POP(C) +]) + +dnl Loosely based on autoconf AC_PROG_CXX +dnl TODO: Maybe this should wrap the call to AC_PROG_CXX and be used instead. +AC_DEFUN([AC_BAKEFILE_PROG_MWCXX], +[AC_LANG_PUSH(C++) +_AC_BAKEFILE_LANG_COMPILER_MWERKS +MWCXX=`test $bakefile_cv_cxx_compiler_mwerks = yes && echo yes` +AC_LANG_POP(C++) +]) + +dnl Based on autoconf _AC_LANG_COMPILER_GNU +AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_XLC], +[AC_CACHE_CHECK([whether we are using the IBM xlC _AC_LANG compiler], + [wx_cv_[]_AC_LANG_ABBREV[]_compiler_xlc], + [AC_TRY_COMPILE([],[#ifndef __xlC__ + choke me +#endif +], + [wx_compiler_xlc=yes], + [wx_compiler_xlc=no]) + wx_cv_[]_AC_LANG_ABBREV[]_compiler_xlc=$wx_compiler_xlc + ]) +]) + +dnl Loosely based on autoconf AC_PROG_CC +AC_DEFUN([AC_BAKEFILE_PROG_XLCC], +[AC_LANG_PUSH(C) +_AC_BAKEFILE_LANG_COMPILER_XLC +XLCC=`test $wx_cv_c_compiler_xlc = yes && echo yes` +AC_LANG_POP(C) +]) + +dnl Loosely based on autoconf AC_PROG_CXX +AC_DEFUN([AC_BAKEFILE_PROG_XLCXX], +[AC_LANG_PUSH(C++) +_AC_BAKEFILE_LANG_COMPILER_XLC +XLCXX=`test $wx_cv_cxx_compiler_xlc = yes && echo yes` +AC_LANG_POP(C++) +]) + + +dnl =========================================================================== +dnl macros to detect specialty compiler options +dnl =========================================================================== + +dnl Figure out if we need to pass -ext o to compiler (MetroWerks) +AC_DEFUN([AC_BAKEFILE_METROWERKS_EXTO], +[AC_CACHE_CHECK([if the _AC_LANG compiler requires -ext o], wx_cv_[]_AC_LANG_ABBREV[]_exto, +dnl First create an empty conf test +[AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) +dnl Now remove .o and .c.o or .cc.o +rm -f conftest.$ac_objext conftest.$ac_ext.o +dnl Now compile the test +AS_IF([AC_TRY_EVAL(ac_compile)], +dnl If the test succeeded look for conftest.c.o or conftest.cc.o +[for ac_file in `(ls conftest.* 2>/dev/null)`; do + case $ac_file in + conftest.$ac_ext.o) + wx_cv_[]_AC_LANG_ABBREV[]_exto="-ext o" + ;; + *) + ;; + esac +done], +[AC_MSG_FAILURE([cannot figure out if compiler needs -ext o: cannot compile]) +]) dnl AS_IF + +rm -f conftest.$ac_ext.o conftest.$ac_objext conftest.$ac_ext +]) dnl AC_CACHE_CHECK + +if test "x$wx_cv_[]_AC_LANG_ABBREV[]_exto" '!=' "x"; then + if test "[]_AC_LANG_ABBREV[]" = "c"; then + CFLAGS="$wx_cv_[]_AC_LANG_ABBREV[]_exto $CFLAGS" + fi + if test "[]_AC_LANG_ABBREV[]" = "cxx"; then + CXXFLAGS="$wx_cv_[]_AC_LANG_ABBREV[]_exto $CXXFLAGS" + fi +fi +]) dnl AC_DEFUN + + +dnl =========================================================================== +dnl Macros to do all of the compiler detections as one macro +dnl =========================================================================== +AC_DEFUN([AC_BAKEFILE_PROG_CC], +[ + AC_PROG_CC + AC_BAKEFILE_METROWERKS_EXTO + dnl By the time we find out that we need -ext o some tests have failed. + if test "x$wx_cv_c_exto" '!=' "x"; then + unset ac_cv_prog_cc_g + _AC_PROG_CC_G + fi + AC_BAKEFILE_PROG_MWCC + AC_BAKEFILE_PROG_XLCC +]) + +AC_DEFUN([AC_BAKEFILE_PROG_CXX], +[ + AC_PROG_CXX + AC_BAKEFILE_METROWERKS_EXTO + dnl By the time we find out that we need -ext o some tests have failed. + if test "x$wx_cv_cxx_exto" '!=' "x"; then + unset ac_cv_prog_cxx_g + _AC_PROG_CXX_G + fi + AC_BAKEFILE_PROG_MWCXX + AC_BAKEFILE_PROG_XLCXX +]) + + # Configure paths for GTK+ # Owen Taylor 1997-2001 @@ -1279,6 +1454,30 @@ int main(int argc, char *argv[]) rm -f conf.sdltest ]) +dnl Perform a check for a GStreamer element using gst-inspect +dnl Thomas Vander Stichele +dnl Last modification: 25/01/2005 + +dnl AM_GST_ELEMENT_CHECK(ELEMENT-NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) + +AC_DEFUN([AM_GST_ELEMENT_CHECK], +[ + if test "x$GST_INSPECT" == "x"; then + AC_CHECK_PROG(GST_INSPECT, gst-inspect, gst-inspect, []) + fi + + if test "x$GST_INSPECT" != "x"; then + AC_MSG_CHECKING(GStreamer element $1) + if [ $GST_INSPECT $1 > /dev/null 2> /dev/null ]; then + AC_MSG_RESULT(found.) + $2 + else + AC_MSG_RESULT(not found.) + $3 + fi + fi +]) + dnl --------------------------------------------------------------------------- dnl Support macros for makefiles generated by BAKEFILE. dnl --------------------------------------------------------------------------- @@ -1286,37 +1485,7 @@ dnl --------------------------------------------------------------------------- dnl Lots of compiler & linker detection code contained here was taken from dnl wxWindows configure.in script (see http://www.wxwindows.org) -dnl Based on autoconf _AC_LANG_COMPILER_GNU -AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_MWERKS], -[AC_CACHE_CHECK([whether we are using the Metrowerks _AC_LANG compiler], - [bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks], - [AC_TRY_COMPILE([],[#ifndef __MWERKS__ - choke me -#endif -], - [bakefile_compiler_mwerks=yes], - [bakefile_compiler_mwerks=no]) - bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks=$bakefile_compiler_mwerks - ]) -]) - -dnl Loosely based on autoconf AC_PROG_CC -dnl TODO: Maybe this should wrap the call to AC_PROG_CC and be used instead. -AC_DEFUN([AC_BAKEFILE_PROG_MWCC], -[AC_LANG_PUSH(C) -_AC_BAKEFILE_LANG_COMPILER_MWERKS -MWCC=`test $bakefile_compiler_mwerks = yes && echo yes` -AC_LANG_POP(C) -]) -dnl Loosely based on autoconf AC_PROG_CXX -dnl TODO: Maybe this should wrap the call to AC_PROG_CXX and be used instead. -AC_DEFUN([AC_BAKEFILE_PROG_MWCXX], -[AC_LANG_PUSH(C++) -_AC_BAKEFILE_LANG_COMPILER_MWERKS -MWCXX=`test $bakefile_compiler_mwerks = yes && echo yes` -AC_LANG_POP(C++) -]) dnl --------------------------------------------------------------------------- dnl AC_BAKEFILE_GNUMAKE @@ -1931,7 +2100,7 @@ AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS], dnl --------------------------------------------------------------------------- -dnl AC_BAKEFILE +dnl AC_BAKEFILE([autoconf_inc.m4 inclusion]) dnl dnl To be used in configure.in of any project using Bakefile-generated mks dnl @@ -1941,6 +2110,14 @@ dnl to perform check for basic tools like ranlib dnl BAKEFILE_HOST set this to override host detection, defaults dnl to ${host} dnl BAKEFILE_FORCE_PLATFORM set to override platform detection +dnl +dnl Example usage: +dnl +dnl AC_BAKEFILE([FOO(autoconf_inc.m4)]) +dnl +dnl (replace FOO with m4_include above, aclocal would die otherwise) +dnl (yes, it's ugly, but thanks to a bug in aclocal, it's the only thing +dnl we can do...) dnl --------------------------------------------------------------------------- AC_DEFUN([AC_BAKEFILE], @@ -1963,9 +2140,10 @@ AC_DEFUN([AC_BAKEFILE], AC_BAKEFILE_DEPS AC_BAKEFILE_RES_COMPILERS - BAKEFILE_BAKEFILE_M4_VERSION="0.1.4" - - m4_include([autoconf_inc.m4]) + BAKEFILE_BAKEFILE_M4_VERSION="0.1.8" + + dnl includes autoconf_inc.m4: + $1 if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then AC_MSG_ERROR([Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match.]) @@ -1980,6 +2158,8 @@ dnl --------------------------------------------------------------------------- AC_DEFUN([AC_BAKEFILE_CREATE_FILE_DLLAR_SH], [ dnl ===================== dllar.sh begins here ===================== +dnl (Created by merge-scripts.py from dllar.sh +dnl file do not edit here!) D='$' cat <dllar.sh #!/bin/sh @@ -2462,6 +2642,8 @@ dnl ===================== dllar.sh ends here ===================== AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_DEPS], [ dnl ===================== bk-deps begins here ===================== +dnl (Created by merge-scripts.py from bk-deps +dnl file do not edit here!) D='$' cat <bk-deps #!/bin/sh @@ -2548,6 +2730,8 @@ dnl ===================== bk-deps ends here ===================== AC_DEFUN([AC_BAKEFILE_CREATE_FILE_SHARED_LD_SH], [ dnl ===================== shared-ld-sh begins here ===================== +dnl (Created by merge-scripts.py from shared-ld-sh +dnl file do not edit here!) D='$' cat <shared-ld-sh #!/bin/sh @@ -2642,6 +2826,8 @@ dnl ===================== shared-ld-sh ends here ===================== AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_MAKE_PCH], [ dnl ===================== bk-make-pch begins here ===================== +dnl (Created by merge-scripts.py from bk-make-pch +dnl file do not edit here!) D='$' cat <bk-make-pch #!/bin/sh