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 ===========================================================================
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 <typeinfo>
+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<Derived*>(&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
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
],, 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
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 <stdio.h>
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
rm -f conf.sdltest
])
+dnl Perform a check for a GStreamer element using gst-inspect
+dnl Thomas Vander Stichele <thomas at apestaart dot org>
+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 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
AC_BAKEFILE_DEPS
AC_BAKEFILE_RES_COMPILERS
- BAKEFILE_BAKEFILE_M4_VERSION="0.1.6"
+ BAKEFILE_BAKEFILE_M4_VERSION="0.1.8"
dnl includes autoconf_inc.m4:
$1
EOF
dnl ===================== bk-make-pch ends here =====================
])
+
dnl
dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl