[gtk-doc] build: various build cleanups. Fixes #591450
- From: Stefan Kost <stefkost src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk-doc] build: various build cleanups. Fixes #591450
- Date: Wed, 30 Sep 2009 13:20:30 +0000 (UTC)
commit 5561666e571a4326e2716ddebbee7328f942eee2
Author: H. Habighorst <h habighorst googlemail com>
Date: Wed Sep 30 16:13:27 2009 +0300
build: various build cleanups. Fixes #591450
- acinclude.m4 shouldn't be used if a m4 folder exists. Splitted the two macros
out in the m4 folder.
- renamed configure.in to configure.ac.
- kills off whitespace in configure.ac and formats it.
- replace AC_HELP_STRING by AS_HELP_STRING.
- Makefile.am -> use ACLOCAL_AMFLAGS=-I m4 to include the macros
- replaced # by dnl
Makefile.am | 1 +
configure.in => configure.ac | 145 ++++++++++++++++++++----------------------
m4/gnome-doc-utils.m4 | 3 +
3 files changed, 73 insertions(+), 76 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5853f3a..3dfb10e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
## Process this file with automake to produce Makefile.in
+ACLOCAL_AMFLAGS=-I m4
SUBDIRS = help tests
diff --git a/configure.in b/configure.ac
similarity index 67%
rename from configure.in
rename to configure.ac
index 0d30fe3..f07a4cf 100644
--- a/configure.in
+++ b/configure.ac
@@ -1,12 +1,11 @@
dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.52)
+AC_PREREQ(2.58)
dnl Use a simple 2-digit version number for a while, since our old example
dnl Makefile can only cope with that, i.e. use 1.1, 1.2, 1.3 ... 9.9.
m4_define(gtk_doc_version, 1.12)
-AC_INIT([gtk-doc], [gtk_doc_version],
- [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc])
+AC_INIT([gtk-doc], [gtk_doc_version], [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([gtkdoc-common.pl.in])
@@ -18,14 +17,14 @@ dnl Forcing a non-null ACTION-IF-NOT-FOUND disables scrollkeeper if
dnl gnome-doc-utils is not found but does not invalidate the build.
GNOME_DOC_INIT([],[],enable_scrollkeeper=no)
-# make sure $ACLOCAL_FLAGS are used during a rebuild.
+dnl make sure $ACLOCAL_FLAGS are used during a rebuild.
AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_LIBTOOL
-# Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
+dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
PKG_PROG_PKG_CONFIG([0.19])
dnl
@@ -33,15 +32,15 @@ dnl Check for Perl.
dnl
AC_PATH_PROG([PERL], [perl])
if test -z "$PERL"; then
- AC_MSG_ERROR([perl not found])
+ AC_MSG_ERROR([perl not found])
fi
AC_MSG_CHECKING([if Perl version >= 5.6.0])
if "$PERL" -e "require v5.6.0"; then
- AC_MSG_RESULT([yes])
+ AC_MSG_RESULT([yes])
else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([perl >= 5.6.0 is required for gtk-doc])
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([perl >= 5.6.0 is required for gtk-doc])
fi
dnl
@@ -60,11 +59,11 @@ dnl
SGML_FORMAT_TYPE=sgml-raw
AC_PATH_PROG([JADE], [openjade])
if test -z "$JADE"; then
- SGML_FORMAT_TYPE=sgml
- AC_PATH_PROG([JADE], [jade])
- if test -z "$JADE"; then
- AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
- fi
+ SGML_FORMAT_TYPE=sgml
+ AC_PATH_PROG([JADE], [jade])
+ if test -z "$JADE"; then
+ AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
+ fi
fi
AC_SUBST([SGML_FORMAT_TYPE])
@@ -73,7 +72,7 @@ dnl Check for xsltproc
dnl
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
- AC_MSG_ERROR([xsltproc not found])
+ AC_MSG_ERROR([xsltproc not found])
fi
dnl
@@ -81,17 +80,15 @@ dnl Check for dblatex/fop (for pdf output)
dnl
AC_PATH_PROG([DBLATEX], [dblatex])
if test -z "$DBLATEX"; then
- AC_PATH_PROG([FOP], [fop])
- if test -z "$FOP"; then
- AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
- fi
+ AC_PATH_PROG([FOP], [fop])
+ if test -z "$FOP"; then
+ AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
+ fi
fi
dnl check for DocBook DTD and stylesheets in the local catalog.
-JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN],
- [DocBook XML DTD V4.3])
-JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl],
- [DocBook XSL Stylesheets])
+JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
+JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
dnl
dnl Check for syntax highlighters
@@ -99,85 +96,82 @@ dnl
HIGHLIGHT_OPTIONS=""
AC_PATH_PROG([HIGHLIGHT], [source-highlight])
if test -n "$HIGHLIGHT"; then
- HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i"
+ HIGHLIGHT_OPTIONS="-t4 -sc -cstyle.css --no-doc -i"
else
- AC_PATH_PROG([HIGHLIGHT], [highlight])
- if test -n "$HIGHLIGHT"; then
- HIGHLIGHT_OPTIONS="-X -f --class-name=gtkdoc "
- else
- AC_PATH_PROG([HIGHLIGHT], [vim])
- if test -n "$HIGHLIGHT"; then
- dnl vim is useless if it does not support syntax highlighting
- AC_MSG_CHECKING([whether vim has +syntax feature])
- if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- HIGHLIGHT=
- fi
- fi
- fi
+ AC_PATH_PROG([HIGHLIGHT], [highlight])
+ if test -n "$HIGHLIGHT"; then
+ HIGHLIGHT_OPTIONS="-X -f --class-name=gtkdoc "
+ else
+ AC_PATH_PROG([HIGHLIGHT], [vim])
+ if test -n "$HIGHLIGHT"; then
+ dnl vim is useless if it does not support syntax highlighting
+ AC_MSG_CHECKING([whether vim has +syntax feature])
+ if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ HIGHLIGHT=
+ fi
+ fi
+ fi
fi
AC_SUBST([HIGHLIGHT_OPTIONS])
-
-#
-# Set PACKAGE_DATA_DIR so we can find the script containing common routines.
-#
+dnl
+dnl Set PACKAGE_DATA_DIR so we can find the script containing common routines.
+dnl
dnl From Autoconf Macro Archive:
m4_define([AC_DEFINE_DIR], [
- prefix_NONE=
- exec_prefix_NONE=
- test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
- test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
- eval ac_define_dir="\"[$]$2\""
- eval ac_define_dir="\"$ac_define_dir\""
- AC_SUBST($1, "$ac_define_dir")
- test "$prefix_NONE" && prefix=NONE
- test "$exec_prefix_NONE" && exec_prefix=NONE
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+ eval ac_define_dir="\"[$]$2\""
+ eval ac_define_dir="\"$ac_define_dir\""
+ AC_SUBST($1, "$ac_define_dir")
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
])
PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
-
dnl Only use -Wall if we have gcc
if test "x$GCC" = "xyes"; then
- if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
- CFLAGS="$CFLAGS -Wall"
- fi
+ if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
+ CFLAGS="$CFLAGS -Wall"
+ fi
fi
-# if glib is available we can enable the tests
-PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0], [
- glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
- gtk_doc_use_libtool=yes
- build_tests=yes
- ],[
- gtk_doc_use_libtool=no
- build_tests=no
- ]
+dnl if glib is available we can enable the tests
+PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
+ [ glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
+ gtk_doc_use_libtool="yes"
+ build_tests="yes"
+ ],
+ [ gtk_doc_use_libtool="no"
+ build_tests="no"
+ ]
)
AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
-dnl this enables the rule in test/Makefile.am
+dnl this enable the rule in test/Makefile.am
AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
AC_SUBST(glib_prefix)
dnl enable runtime debugging code
AC_MSG_CHECKING(whether to enable runtime debugging code)
-AC_ARG_ENABLE(
- debug,
- AC_HELP_STRING([--enable-debug],[enable runtime debugging code (default=no)]),
- ,
- [enable_debug="no"])
+AC_ARG_ENABLE([debug],
+ AS_HELP_STRING([--enable-debug],
+ [enable runtime debugging code (default=no)]),,
+ [enable_debug="no"])
AC_MSG_RESULT($enable_debug)
+
if test "$enable_debug" = "yes"; then
- TRACE="print __FILE__ . \":\" . __LINE__ . \":\" ."
+ TRACE="print __FILE__ . \":\" . __LINE__ . \":\" ."
else
- TRACE="#"
+ TRACE="#"
fi
AC_SUBST(TRACE)
-
AC_CONFIG_FILES([Makefile
gtk-doc.pc
gtk-doc.dsl
@@ -244,4 +238,3 @@ test -n "$HIGHLIGHT" \
test "x$build_tests" != "xno" \
&& AC_MSG_NOTICE([** Building regression tests]) \
|| AC_MSG_NOTICE([ Skipping regression tests])
-
diff --git a/m4/gnome-doc-utils.m4 b/m4/gnome-doc-utils.m4
index 4aef712..402bb3e 100644
--- a/m4/gnome-doc-utils.m4
+++ b/m4/gnome-doc-utils.m4
@@ -40,12 +40,15 @@ AC_DEFUN([GNOME_DOC_INIT],
ifelse([$1],,[gdu_cv_version_required=0.3.2],[gdu_cv_version_required=$1])
+AC_MSG_CHECKING([gnome-doc-utils >= $gdu_cv_version_required])
PKG_CHECK_EXISTS([gnome-doc-utils >= $gdu_cv_version_required],
[gdu_cv_have_gdu=yes],[gdu_cv_have_gdu=no])
if test "$gdu_cv_have_gdu" = "yes"; then
+ AC_MSG_RESULT([yes])
ifelse([$2],,[:],[$2])
else
+ AC_MSG_RESULT([no])
ifelse([$3],,[AC_MSG_ERROR([gnome-doc-utils >= $gdu_cv_version_required not found])],[$3])
fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]