Add example for D-Bus documentation
[framework/connectivity/connman.git] / acinclude.m4
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
5                         ac_cv_prog_cc_pie=yes
6                 else
7                         ac_cv_prog_cc_pie=no
8                 fi
9                 rm -rf conftest*
10         ])
11 ])
12
13 AC_DEFUN([GTK_DOC_CHECK],
14 [
15   AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
16   AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
17   dnl for overriding the documentation installation directory
18   AC_ARG_WITH([html-dir],
19     AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
20     [with_html_dir='${datadir}/gtk-doc/html'])
21   HTML_DIR="$with_html_dir"
22   AC_SUBST([HTML_DIR])
23
24   dnl enable/disable documentation building
25   AC_ARG_ENABLE([gtk-doc],
26     AS_HELP_STRING([--enable-gtk-doc],
27                    [use gtk-doc to build documentation [[default=no]]]),,
28     [enable_gtk_doc=no])
29
30   if test x$enable_gtk_doc = xyes; then
31     ifelse([$1],[],
32       [PKG_CHECK_EXISTS([gtk-doc],,
33                         AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
34       [PKG_CHECK_EXISTS([gtk-doc >= $1],,
35                         AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))])
36   fi
37
38   AC_MSG_CHECKING([whether to build gtk-doc documentation])
39   AC_MSG_RESULT($enable_gtk_doc)
40
41   AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,)
42
43   AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
44   AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
45 ])