1 dnl Add compile warnings
3 AC_DEFUN([IDT_COMPILE_WARNINGS],[
4 if test -f $srcdir/autogen.sh; then
5 default_compile_warnings="error"
7 default_compile_warnings="no"
10 AC_ARG_WITH(compile-warnings,
11 AS_HELP_STRING([--with-compile-warnings=@<:@no/yes/error@:>@],
13 [enable_compile_warnings="$withval"],
14 [enable_compile_warnings="$default_compile_warnings"])
17 if test "x$GCC" != xyes; then
18 enable_compile_warnings=no
22 realsave_CFLAGS="$CFLAGS"
24 case "$enable_compile_warnings" in
29 warning_flags="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
32 warning_flags="-Wall -Wunused -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
33 CFLAGS="$warning_flags $CFLAGS"
34 for option in -Wno-sign-compare; do
36 CFLAGS="$CFLAGS $option"
37 AC_MSG_CHECKING([whether gcc understands $option])
38 AC_TRY_COMPILE([], [],
42 AC_MSG_RESULT($has_option)
43 if test $has_option = yes; then
44 warning_flags="$warning_flags $option"
50 if test "$enable_compile_warnings" = "error" ; then
51 warning_flags="$warning_flags -Werror"
55 AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
58 CFLAGS="$realsave_CFLAGS"
59 AC_MSG_CHECKING(what warning flags to pass to the C compiler)
60 AC_MSG_RESULT($warning_flags)
62 WARN_CFLAGS="$warning_flags"
67 dnl -*- mode: autoconf -*-
72 dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
73 AC_DEFUN([GTK_DOC_CHECK],
75 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
76 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
77 dnl for overriding the documentation installation directory
79 AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
80 [with_html_dir='${datadir}/gtk-doc/html'])
81 HTML_DIR="$with_html_dir"
84 dnl enable/disable documentation building
85 AC_ARG_ENABLE(gtk-doc,
86 AC_HELP_STRING([--enable-gtk-doc],
87 [use gtk-doc to build documentation [default=no]]),,
91 if test x$enable_gtk_doc = xyes; then
92 if test -z "$PKG_CONFIG"; then
93 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
95 if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
99 dnl do we want to do a version check?
101 [gtk_doc_min_version=$1
102 if test "$have_gtk_doc" = yes; then
103 AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
104 if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
112 if test "$have_gtk_doc" != yes; then
117 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
118 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
121 ## this one is commonly used with AM_PATH_PYTHONDIR ...
122 dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
123 dnl Check if a module containing a given symbol is visible to python.
124 AC_DEFUN(AM_CHECK_PYMOD,
125 [AC_REQUIRE([AM_PATH_PYTHON])
126 py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
127 AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
128 AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
129 ifelse([$2],[], [prog="
137 sys.exit(0)"], [prog="
140 if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
142 eval "py_cv_mod_$py_mod_var=yes"
144 eval "py_cv_mod_$py_mod_var=no"
147 py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
148 if test "x$py_val" != xno; then
150 ifelse([$3], [],, [$3
154 ifelse([$4], [],, [$4
159 dnl a macro to check for ability to create python extensions
160 dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
161 dnl function also defines PYTHON_INCLUDES
162 AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
163 [AC_REQUIRE([AM_PATH_PYTHON])
164 AC_MSG_CHECKING(for headers required to compile python extensions)
165 dnl deduce PYTHON_INCLUDES
166 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
167 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
168 PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
169 if test "$py_prefix" != "$py_exec_prefix"; then
170 PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
172 AC_SUBST(PYTHON_INCLUDES)
173 dnl check if the headers exist:
174 save_CPPFLAGS="$CPPFLAGS"
175 CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
176 AC_TRY_CPP([#include <Python.h>],dnl
177 [AC_MSG_RESULT(found)
179 [AC_MSG_RESULT(not found)
181 CPPFLAGS="$save_CPPFLAGS"