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([SHAVE_ARG_ENABLE],
30 AC_ARG_ENABLE([shave],
33 [use shave to make the build pretty [[default=no]]]),,
36 AC_CONFIG_FILES(shave shave-libtool)
39 AC_DEFUN([SHAVE_INIT],
41 if test x"$enable_shave" = xyes; then
42 dnl where can we find the shave scripts?
45 [shavedir="$ac_pwd/$1"])
49 AC_SUBST([MAKEFLAGS], [-s])
50 AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`'])
53 AC_CHECK_PROG(SED,sed,sed,false)
55 dnl substitute libtool
56 SHAVE_SAVED_LIBTOOL=$LIBTOOL
57 LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'"
65 CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}"
66 CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}"
67 FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}"
68 F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}"
83 AC_DEFUN([GTK_DOC_CHECK],
85 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
86 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
87 dnl for overriding the documentation installation directory
88 AC_ARG_WITH([html-dir],
89 AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
90 [with_html_dir='${datadir}/gtk-doc/html'])
91 HTML_DIR="$with_html_dir"
94 dnl enable/disable documentation building
95 AC_ARG_ENABLE([gtk-doc],
96 AS_HELP_STRING([--enable-gtk-doc],
97 [use gtk-doc to build documentation [[default=no]]]),,
100 if test x$enable_gtk_doc = xyes; then
102 [PKG_CHECK_EXISTS([gtk-doc],,
103 AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
104 [PKG_CHECK_EXISTS([gtk-doc >= $1],,
105 AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))])
108 AC_MSG_CHECKING([whether to build gtk-doc documentation])
109 AC_MSG_RESULT($enable_gtk_doc)
111 AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,)
113 AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
114 AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])