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")