1 AC_DEFUN([AC_PROG_CC_PIE], [
2 AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [
3 echo 'void f(){}' > conftest.c
4 if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then
13 AC_DEFUN([COMPILER_FLAGS], [
14 if (test "${CFLAGS}" = ""); then
15 CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2"
17 if (test "$USE_MAINTAINER_MODE" = "yes"); then
18 CFLAGS+=" -Werror -Wextra"
19 CFLAGS+=" -Wno-unused-parameter"
20 CFLAGS+=" -Wno-missing-field-initializers"
21 CFLAGS+=" -Wdeclaration-after-statement"
22 CFLAGS+=" -Wmissing-declarations"
23 CFLAGS+=" -Wredundant-decls"
24 CFLAGS+=" -Wcast-align"
28 AC_DEFUN([GTK_DOC_CHECK],
30 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
31 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
32 dnl for overriding the documentation installation directory
33 AC_ARG_WITH([html-dir],
34 AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
35 [with_html_dir='${datadir}/gtk-doc/html'])
36 HTML_DIR="$with_html_dir"
39 dnl enable/disable documentation building
40 AC_ARG_ENABLE([gtk-doc],
41 AS_HELP_STRING([--enable-gtk-doc],
42 [use gtk-doc to build documentation [[default=no]]]),,
45 if test x$enable_gtk_doc = xyes; then
47 [PKG_CHECK_EXISTS([gtk-doc],,
48 AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
49 [PKG_CHECK_EXISTS([gtk-doc >= $1],,
50 AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))])
53 AC_MSG_CHECKING([whether to build gtk-doc documentation])
54 AC_MSG_RESULT($enable_gtk_doc)
56 AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,)
58 AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
59 AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])