Improve build system (new flags, silent rules)
authorJulien Lavergne <julien.lavergne@gmail.com>
Mon, 20 Dec 2010 17:53:29 +0000 (18:53 +0100)
committerJulien Lavergne <julien.lavergne@gmail.com>
Mon, 20 Dec 2010 17:53:29 +0000 (18:53 +0100)
Makefile.am
configure.ac
src/Makefile.am

index 01adef9..1783f62 100644 (file)
@@ -1,6 +1,6 @@
 NULL=
 
-SUBDIRS=src po data
+SUBDIRS=src data man po   
 
 EXTRA_DIST = \
        $(NULL)
index a80dbe5..da8b633 100644 (file)
@@ -25,6 +25,13 @@ AC_HEADER_STDC
 # intltool
 IT_PROG_INTLTOOL([0.40.0])
 
+AC_ARG_ENABLE(man,
+       [AC_HELP_STRING([--enable-man],
+               [regenerate roff man pages from Docbook @<:@default=no@:>@])],
+       [enable_man="${enableval}"],
+       [enable_man=no]
+)
+
 PKG_CHECK_MODULES(XLIB, "x11")
 AC_SUBST(XLIB_CFLAGS)
 AC_SUBST(XLIB_LIBS)
@@ -49,12 +56,13 @@ AC_SUBST(GMODULE_LIBS)
 # AC_SUBST(MENU_CACHE_CFLAGS)
 # AC_SUBST(MENU_CACHE_LIBS)
 
-AC_ARG_ENABLE(debug,
-    [AC_HELP_STRING([--enable-debug],
-        [build libfm with debug support @<:@default=no@:>@])],
-    [enable_debug="${enableval}"],
-    [enable_debug=no]
+AC_ARG_ENABLE(man,
+       [AC_HELP_STRING([--enable-man],
+               [regenerate roff man pages from Docbook @<:@default=no@:>@])],
+       [enable_man="${enableval}"],
+       [enable_man=no]
 )
+
 if test "$enable_debug" = "yes"; then
     # turn on debug and disable optimization
     CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
@@ -78,6 +86,21 @@ AC_SUBST(GETTEXT_PACKAGE)
 AM_GLIB_GNU_GETTEXT
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
 
+if test x"$enable_man" = x"yes"; then
+       AC_PATH_PROG([XSLTPROC], [xsltproc])
+       if test -z "$XSLTPROC"; then
+               enable_man=no
+       fi
+
+       dnl check for DocBook DTD and stylesheets in the local catalog.
+       JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
+               [DocBook XML DTD V4.1.2], [], enable_man=no)
+       JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
+               [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
+fi
+
+AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
+
 AC_CONFIG_FILES([
     Makefile
     src/Makefile
@@ -85,6 +108,7 @@ AC_CONFIG_FILES([
     data/ui/Makefile
     data/ui/about.glade
     data/lxappearance.pc
+    man/Makefile
     po/Makefile.in
 ])
 
index 5aa0ddd..706bc8f 100644 (file)
@@ -35,6 +35,7 @@ lxappearance_CFLAGS = \
        $(GTK_CFLAGS) \
        $(XLIB_CFLAGS) \
        $(GMODULE_CFLAGS) \
+       $(ADDITIONAL_FLAGS) \
        -Werror-implicit-function-declaration \
        $(NULL)