From 996927fa2b3e9fe40e3d236d3c8a08b1cbb9ad58 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Fri, 15 Apr 2005 00:47:38 +0200 Subject: [PATCH] update m4 macros from gphoto --- m4m/gp-check-library.m4 | 18 ++++++++++-------- m4m/gp-config-msg.m4 | 3 +++ m4m/gp-documentation.m4 | 25 +++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/m4m/gp-check-library.m4 b/m4m/gp-check-library.m4 index 1799f89..455a4e5 100644 --- a/m4m/gp-check-library.m4 +++ b/m4m/gp-check-library.m4 @@ -90,7 +90,9 @@ dnl AC_REQUIRE([GP_CONFIG_MSG])dnl AC_REQUIRE([GP_PKG_CONFIG])dnl AC_REQUIRE([_GP_CHECK_LIBRARY_SOEXT])dnl -dnl +dnl Use _CFLAGS and _LIBS given to configure. +dnl This makes it possible to set these vars in a configure script +dnl and AC_CONFIG_SUBDIRS this configure. AC_ARG_VAR([$1][_CFLAGS], [CFLAGS for compiling with ][$2])dnl AC_ARG_VAR([$1][_LIBS], [LIBS to add for linking against ][$2])dnl dnl @@ -109,10 +111,11 @@ if test "x${[$1][_LIBS]}" = "x" && test "x${[$1][_CFLAGS]}" = "x"; then AC_MSG_RESULT([${try_][$1][}]) m4_popdef([gp_lib_arg])dnl if test "x${[try_][$1]}" = "xautodetect"; then + dnl we need that line break after the PKG_CHECK_MODULES m4_ifval([$3], [PKG_CHECK_MODULES([$1],[$2][ $3],[have_][$1][=yes])], [PKG_CHECK_MODULES([$1],[$2], [have_][$1][=yes])] - )dnl + ) if test "x${[have_][$1]}" = "xno"; then ifs="$IFS" IFS=":" # FIXME: for W32 and OS/2 we need ";" here @@ -197,16 +200,15 @@ fi ])dnl dnl dnl Run our own test link -dnl Does not work for *.la libs, so we deactivated it. +dnl Does not work for libraries which be built after configure time, +dnl so we deactivate it. dnl dnl m4_ifval([$5],[dnl dnl if test "x${[have_][$1]}" = "xyes"; then -dnl AC_MSG_CHECKING([whether ][$2][ test link succeeds]) -dnl LDFLAGS_save="$LDFLAGS" -dnl LDFLAGS="${[$1]_LIBS}" +dnl LIBS_save="$LIBSS" +dnl LIBS="${[$1]_LIBS}" dnl AC_TRY_LINK_FUNC([$5],[],[have_][$1][=no]) -dnl LDFLAGS="$LDFLAGS_save" -dnl AC_MSG_RESULT([${[have_][$1]}]) +dnl LIBS="$LIBS_save" dnl fi dnl ])dnl dnl diff --git a/m4m/gp-config-msg.m4 b/m4m/gp-config-msg.m4 index ae8df96..8cf7427 100644 --- a/m4m/gp-config-msg.m4 +++ b/m4m/gp-config-msg.m4 @@ -51,6 +51,9 @@ AC_DEFUN([GP_CONFIG_MSG], m4_if([$1],[],[ gp_config_msg="${gp_config_msg} " +],[$2],[],[ +gp_config_msg="${gp_config_msg} $1 +" ],[ gp_config_msg="${gp_config_msg} $(expr "$1:${gp_config_empty}" : "\(.\{0,${gp_config_len}\}\)") $2 " diff --git a/m4m/gp-documentation.m4 b/m4m/gp-documentation.m4 index a944cc5..b4a486a 100644 --- a/m4m/gp-documentation.m4 +++ b/m4m/gp-documentation.m4 @@ -7,7 +7,8 @@ dnl AC_DEFUN([GP_CHECK_DOC_DIR], [ -AC_BEFORE([$0], [GP_BUILD_DOCS])dnl +AC_BEFORE([$0], [GP_BUILD_GTK_DOCS])dnl +AC_BEFORE([$0], [GP_CHECK_DOXYGEN])dnl AC_ARG_WITH([doc-dir], [AS_HELP_STRING([--with-doc-dir=PATH], @@ -56,7 +57,7 @@ dnl * determine presence of prerequisites (only gtk-doc for now) dnl * determine destination directory for HTML files dnl -AC_DEFUN([GP_BUILD_DOCS], +AC_DEFUN([GP_BUILD_GTK_DOCS], [ # docdir has to be determined in advance AC_REQUIRE([GP_CHECK_DOC_DIR]) @@ -109,3 +110,23 @@ apidocdir="${htmldir}/api" AC_SUBST([apidocdir}]) ])dnl + + +dnl doxygen related stuff +dnl look for tools +dnl define substitutions for Doxyfile.in +AC_DEFUN([GP_CHECK_DOXYGEN],[dnl +AC_REQUIRE([GP_CHECK_DOC_DIR])dnl +AC_PATH_PROG([DOT], [dot], [false]) +AC_PATH_PROG([DOXYGEN], [doxygen], [false]) +AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "false"]) +AM_CONDITIONAL([HAVE_DOT], [test "x$DOT" != "false"]) +if test "x$DOT" != "false"; then + AC_SUBST([HAVE_DOT],[YES]) +else + AC_SUBST([HAVE_DOT],[NO]) +fi +AC_SUBST([HTML_APIDOC_DIR], ["${PACKAGE_TARNAME}-api.html"]) +AC_SUBST([DOXYGEN_OUTPUT_DIR], [doxygen-output]) +])dnl + -- 2.7.4