Remove FT2 check macro.
[vte.git] / acinclude.m4
1 dnl From msw.
2 dnl
3 dnl a macro to check for ability to create python extensions
4 dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
5 dnl function also defines PYTHON_INCLUDES
6 AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
7 [AC_REQUIRE([AM_PATH_PYTHON])
8 AC_MSG_CHECKING(for headers required to compile python extensions)
9 dnl deduce PYTHON_INCLUDES
10 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
11 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
12 if test -x "$PYTHON-config"; then
13     PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
14 else
15     PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
16     if test "$py_prefix" != "$py_exec_prefix"; then
17       PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
18     fi
19 fi
20 PYTHON_LIBS="-L${py_prefix}/libs -lpython${PYTHON_VERSION}"
21 AC_SUBST(PYTHON_INCLUDES)
22 AC_SUBST(PYTHON_LIBS)
23 dnl check if the headers exist:
24 save_CPPFLAGS="$CPPFLAGS"
25 CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
26 AC_TRY_CPP([#include <Python.h>],dnl
27 [AC_MSG_RESULT(found)
28 $1],dnl
29 [AC_MSG_RESULT(not found)
30 $2])
31 CPPFLAGS="$save_CPPFLAGS"
32 ])
33
34 dnl From ac-archive.
35 dnl
36 dnl @synopsis AC_CHECK_CC_OPT(flag, cachevarname)
37 dnl 
38 dnl AC_CHECK_CC_OPT(-fvomit-frame,vomitframe)
39 dnl would show a message as like 
40 dnl "checking wether gcc accepts -fvomit-frame ... no"
41 dnl and sets the shell-variable $vomitframe to either "-fvomit-frame"
42 dnl or (in this case) just a simple "". In many cases you would then call 
43 dnl AC_SUBST(_fvomit_frame_,$vomitframe) to create a substitution that
44 dnl could be fed as "CFLAGS = @_funsigned_char_@ @_fvomit_frame_@
45 dnl
46 dnl in consequence this function is much more general than their 
47 dnl specific counterparts like ac_cxx_rtti.m4 that will test for
48 dnl -fno-rtti -fno-exceptions
49 dnl 
50 dnl @version $Id$
51 dml @author  Guido Draheim <guidod@gmx.de>
52
53 AC_DEFUN([AC_CHECK_CC_OPT],
54 [AC_CACHE_CHECK(whether ${CC-cc} accepts [$1], [$2],
55 [AC_SUBST($2)
56 echo 'void f(){}' > conftest.c
57 if test -z "`${CC-cc} -c $1 conftest.c 2>&1`"; then
58   $2="$1"
59 else
60   $2=""
61 fi
62 rm -f conftest*
63 ])])