X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04840eaa88133aa1d57577bf98aac3342188fe40..97ee90eec5faa0f361c47e39ee14299d07bbb50b:/aclocal.m4 diff --git a/aclocal.m4 b/aclocal.m4 index 0f681ca22e..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 @@ -1152,8 +1327,10 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity @@ -1219,6 +1396,7 @@ int main (int argc, char *argv[]) ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" fi fi @@ -1238,6 +1416,7 @@ int main (int argc, char *argv[]) else echo "*** Could not run SDL test program, checking why..." CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" AC_TRY_LINK([ #include @@ -1262,6 +1441,7 @@ int main(int argc, char *argv[]) echo "*** or that you have moved SDL since it was installed. In the latter case, you" echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" fi fi @@ -1274,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 --------------------------------------------------------------------------- @@ -1281,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 @@ -1785,9 +1959,9 @@ AC_DEFUN([AC_BAKEFILE_DEPS], esac AC_MSG_RESULT([gcc]) elif test "x$MWCC" = "xyes"; then - DEPSMODE=gcc + DEPSMODE=mwcc DEPS_TRACKING=1 - DEPSFLAG_GCC="-MMD" + DEPSFLAG_MWCC="-MM" AC_MSG_RESULT([mwcc]) else AC_MSG_RESULT([none]) @@ -1926,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 @@ -1936,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], @@ -1958,9 +2140,10 @@ AC_DEFUN([AC_BAKEFILE], AC_BAKEFILE_DEPS AC_BAKEFILE_RES_COMPILERS - BAKEFILE_BAKEFILE_M4_VERSION="0.1.5" - - 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.]) @@ -1975,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 @@ -2457,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 @@ -2469,6 +2656,7 @@ cat <bk-deps DEPSMODE=${DEPSMODE} DEPSDIR=.deps DEPSFLAG_GCC="${DEPSFLAG_GCC}" +DEPSFLAG_MWCC="${DEPSFLAG_MWCC}" mkdir -p ${D}DEPSDIR @@ -2506,6 +2694,31 @@ if test ${D}DEPSMODE = gcc ; then fi fi exit 0 +elif test ${D}DEPSMODE = mwcc ; then + ${D}* + status=${D}? + if test ${D}{status} != 0 ; then + exit ${D}{status} + fi + # Run mwcc again with -MM and redirect into the dep file we want + # NOTE: We can't use shift here because we need ${D}* to be valid + prevarg= + for arg in ${D}* ; do + if test "${D}prevarg" = "-o"; then + objfile=${D}arg + else + case "${D}arg" in + -* ) + ;; + * ) + srcfile=${D}arg + ;; + esac + fi + prevarg="${D}arg" + done + ${D}* ${D}DEPSFLAG_MWCC >${D}{DEPSDIR}/${D}{objfile}.d + exit 0 else ${D}* exit ${D}? @@ -2517,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 @@ -2611,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