| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 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 |
|
|---|
| 10 |
py_prefix=`$PYTHON -c "import sys; print sys.prefix"` |
|---|
| 11 |
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` |
|---|
| 12 |
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" |
|---|
| 13 |
if test "$py_prefix" != "$py_exec_prefix"; then |
|---|
| 14 |
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" |
|---|
| 15 |
fi |
|---|
| 16 |
AC_SUBST(PYTHON_INCLUDES) |
|---|
| 17 |
|
|---|
| 18 |
save_CPPFLAGS="$CPPFLAGS" |
|---|
| 19 |
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" |
|---|
| 20 |
AC_TRY_CPP([ |
|---|
| 21 |
[AC_MSG_RESULT(found) |
|---|
| 22 |
$1], |
|---|
| 23 |
[AC_MSG_RESULT(not found) |
|---|
| 24 |
$2]) |
|---|
| 25 |
CPPFLAGS="$save_CPPFLAGS" |
|---|
| 26 |
]) |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
dml @author Guido Draheim <guidod@gmx.de> |
|---|
| 46 |
|
|---|
| 47 |
AC_DEFUN([AC_CHECK_CC_OPT], |
|---|
| 48 |
[AC_CACHE_CHECK(whether ${CC-cc} accepts [$1], [$2], |
|---|
| 49 |
[AC_SUBST($2) |
|---|
| 50 |
echo 'void f(){}' > conftest.c |
|---|
| 51 |
if test -z "`${CC-cc} -c $1 conftest.c 2>&1`"; then |
|---|
| 52 |
$2="$1" |
|---|
| 53 |
else |
|---|
| 54 |
$2="" |
|---|
| 55 |
fi |
|---|
| 56 |
rm -f conftest* |
|---|
| 57 |
])]) |
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
AC_DEFUN([VTE_CHECK_FT2], |
|---|
| 67 |
[ |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
AC_ARG_WITH(ft-prefix, |
|---|
| 71 |
[ --with-ft-prefix=PREFIX |
|---|
| 72 |
Prefix where FreeType is installed (optional)], |
|---|
| 73 |
ft_config_prefix="$withval", ft_config_prefix="") |
|---|
| 74 |
AC_ARG_WITH(ft-exec-prefix, |
|---|
| 75 |
[ --with-ft-exec-prefix=PREFIX |
|---|
| 76 |
Exec prefix where FreeType is installed (optional)], |
|---|
| 77 |
ft_config_exec_prefix="$withval", ft_config_exec_prefix="") |
|---|
| 78 |
AC_ARG_ENABLE(freetypetest, |
|---|
| 79 |
[ --disable-freetypetest Do not try to compile and run |
|---|
| 80 |
a test FreeType program], |
|---|
| 81 |
[], enable_fttest=yes) |
|---|
| 82 |
|
|---|
| 83 |
if test x$ft_config_exec_prefix != x ; then |
|---|
| 84 |
ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" |
|---|
| 85 |
if test x${FT2_CONFIG+set} != xset ; then |
|---|
| 86 |
FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config |
|---|
| 87 |
fi |
|---|
| 88 |
fi |
|---|
| 89 |
if test x$ft_config_prefix != x ; then |
|---|
| 90 |
ft_config_args="$ft_config_args --prefix=$ft_config_prefix" |
|---|
| 91 |
if test x${FT2_CONFIG+set} != xset ; then |
|---|
| 92 |
FT2_CONFIG=$ft_config_prefix/bin/freetype-config |
|---|
| 93 |
fi |
|---|
| 94 |
fi |
|---|
| 95 |
AC_PATH_PROG(FT2_CONFIG, freetype-config, no) |
|---|
| 96 |
|
|---|
| 97 |
min_ft_version=ifelse([$1], ,6.1.0,$1) |
|---|
| 98 |
AC_MSG_CHECKING(for FreeType - version >= $min_ft_version) |
|---|
| 99 |
no_ft="" |
|---|
| 100 |
if test "$FT2_CONFIG" = "no" ; then |
|---|
| 101 |
no_ft=yes |
|---|
| 102 |
else |
|---|
| 103 |
FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` |
|---|
| 104 |
FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` |
|---|
| 105 |
ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ |
|---|
| 106 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
|---|
| 107 |
ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ |
|---|
| 108 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
|---|
| 109 |
ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ |
|---|
| 110 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
|---|
| 111 |
ft_min_major_version=`echo $min_ft_version | \ |
|---|
| 112 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
|---|
| 113 |
ft_min_minor_version=`echo $min_ft_version | \ |
|---|
| 114 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
|---|
| 115 |
ft_min_micro_version=`echo $min_ft_version | \ |
|---|
| 116 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
|---|
| 117 |
if test x$enable_fttest = xyes ; then |
|---|
| 118 |
ft_config_is_lt="" |
|---|
| 119 |
if test $ft_config_major_version -lt $ft_min_major_version ; then |
|---|
| 120 |
ft_config_is_lt=yes |
|---|
| 121 |
else |
|---|
| 122 |
if test $ft_config_major_version -eq $ft_min_major_version ; then |
|---|
| 123 |
if test $ft_config_minor_version -lt $ft_min_minor_version ; then |
|---|
| 124 |
ft_config_is_lt=yes |
|---|
| 125 |
else |
|---|
| 126 |
if test $ft_config_minor_version -eq $ft_min_minor_version ; then |
|---|
| 127 |
if test $ft_config_micro_version -lt $ft_min_micro_version ; then |
|---|
| 128 |
ft_config_is_lt=yes |
|---|
| 129 |
fi |
|---|
| 130 |
fi |
|---|
| 131 |
fi |
|---|
| 132 |
fi |
|---|
| 133 |
fi |
|---|
| 134 |
if test x$ft_config_is_lt = xyes ; then |
|---|
| 135 |
no_ft=yes |
|---|
| 136 |
else |
|---|
| 137 |
ac_save_CFLAGS="$CFLAGS" |
|---|
| 138 |
ac_save_LIBS="$LIBS" |
|---|
| 139 |
CFLAGS="$CFLAGS $FT2_CFLAGS" |
|---|
| 140 |
LIBS="$FT2_LIBS $LIBS" |
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
AC_TRY_RUN([ |
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 |
int |
|---|
| 151 |
main() |
|---|
| 152 |
{ |
|---|
| 153 |
FT_Library library; |
|---|
| 154 |
FT_Error error; |
|---|
| 155 |
|
|---|
| 156 |
error = FT_Init_FreeType(&library); |
|---|
| 157 |
|
|---|
| 158 |
if (error) |
|---|
| 159 |
return 1; |
|---|
| 160 |
else |
|---|
| 161 |
{ |
|---|
| 162 |
FT_Done_FreeType(library); |
|---|
| 163 |
return 0; |
|---|
| 164 |
} |
|---|
| 165 |
} |
|---|
| 166 |
],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
|---|
| 167 |
CFLAGS="$ac_save_CFLAGS" |
|---|
| 168 |
LIBS="$ac_save_LIBS" |
|---|
| 169 |
fi |
|---|
| 170 |
fi |
|---|
| 171 |
fi |
|---|
| 172 |
if test x$no_ft = x ; then |
|---|
| 173 |
AC_MSG_RESULT(yes) |
|---|
| 174 |
ifelse([$2], , :, [$2]) |
|---|
| 175 |
else |
|---|
| 176 |
AC_MSG_RESULT(no) |
|---|
| 177 |
if test "$FT2_CONFIG" = "no" ; then |
|---|
| 178 |
echo "*** The freetype-config script installed by FreeType 2 could not be found." |
|---|
| 179 |
echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in" |
|---|
| 180 |
echo "*** your path, or set the FT2_CONFIG environment variable to the" |
|---|
| 181 |
echo "*** full path to freetype-config." |
|---|
| 182 |
else |
|---|
| 183 |
if test x$ft_config_is_lt = xyes ; then |
|---|
| 184 |
echo "*** Your installed version of the FreeType 2 library is too old." |
|---|
| 185 |
echo "*** If you have different versions of FreeType 2, make sure that" |
|---|
| 186 |
echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix" |
|---|
| 187 |
echo "*** are used, or set the FT2_CONFIG environment variable to the" |
|---|
| 188 |
echo "*** full path to freetype-config." |
|---|
| 189 |
else |
|---|
| 190 |
echo "*** The FreeType test program failed to run. If your system uses" |
|---|
| 191 |
echo "*** shared libraries and they are installed outside the normal" |
|---|
| 192 |
echo "*** system library path, make sure the variable LD_LIBRARY_PATH" |
|---|
| 193 |
echo "*** (or whatever is appropiate for your system) is correctly set." |
|---|
| 194 |
fi |
|---|
| 195 |
fi |
|---|
| 196 |
FT2_CFLAGS="" |
|---|
| 197 |
FT2_LIBS="" |
|---|
| 198 |
ifelse([$3], , :, [$3]) |
|---|
| 199 |
fi |
|---|
| 200 |
AC_SUBST(FT2_CFLAGS) |
|---|
| 201 |
AC_SUBST(FT2_LIBS) |
|---|
| 202 |
]) |
|---|