Tidyup Autoconf check for --disable-doc (#734076)

Use AC_ARG_ENABLE() and AS_HELP_STRING() macros to improve handling of
the --disable-doc option.

Change the names, and sence, of the Autoconf and Automake definitions
used to control building of the help documentation.  Reasons are:
(1) Switch from negative to positive statements which are more natural
    to comprehend.
(2) Insert HELP in the names from *_DOC to *_HELP_DOC as they control
    building of the documentation in the help subdirectory, not the
    manual page in the doc directory.

Autoconf: HAVE_DISABLE_DOC -> ENABLE_HELP_DOC
Automake: DISABLE_DOC      -> BUILD_HELP_DOC

Bug #734076 - Autodetect parted online partition resizing capability
This commit is contained in:
Mike Fleetwood 2014-08-12 21:36:08 +01:00 committed by Curtis Gedak
parent 5c73f3de57
commit 20158f0440
3 changed files with 26 additions and 23 deletions

View File

@ -1,8 +1,8 @@
### Do not execute make in the help subdirectory if DISABLE_DOC is set # Only execute make in the help subdirectory if BUILD_HELP_DOC is set
if DISABLE_DOC if BUILD_HELP_DOC
SUBDIRS = compose data doc include po src
else
SUBDIRS = help compose data doc include po src SUBDIRS = help compose data doc include po src
else
SUBDIRS = compose data doc include po src
endif endif
@INTLTOOL_DESKTOP_RULE@ @INTLTOOL_DESKTOP_RULE@

View File

@ -236,29 +236,32 @@ PKG_CHECK_EXISTS(
dnl====================== dnl======================
dnl check whether to build documentation - Gnome-Doc-Utils dnl check whether to build documentation - Gnome-Doc-Utils
dnl====================== dnl======================
AC_ARG_ENABLE([doc], AC_ARG_ENABLE(
[ --disable-doc do not build documentation],,) [doc],
if test "x${enable_doc}" = "x" ; then AS_HELP_STRING(
enable_doc=yes [--disable-doc],
fi dnl Autoconf quadrigraphs '@<:@' = '[' and '@:>@' = ']'
[disable building help documentation @<:@default=enabled@:>@]),
[enable_doc=$enableval],
[enable_doc=yes]
)
AC_MSG_CHECKING([whether documentation should be built]) AC_MSG_CHECKING([whether help documentation should be built])
if test ${enable_doc} = no; then if test "x$enable_doc" = xyes; then
AC_MSG_RESULT([no]) AC_DEFINE([ENABLE_HELP_DOC], [1], [Define to 1 when help documentation is built])
else
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi fi
if test ${enable_doc} = yes; then if test "x$enable_doc" = xyes; then
GNOME_DOC_INIT GNOME_DOC_INIT
else else
dnl Do not care if GDU is not found dnl Do not care if GDU is not found
GNOME_DOC_INIT(,,[:]) GNOME_DOC_INIT(,,[:])
dnl Set #define HAVE_DISABLE_DOC 1 to indicate documentation not wanted
AC_DEFINE([HAVE_DISABLE_DOC], [1], [Define to 1 if --disable-doc specified])
fi fi
AM_CONDITIONAL([DISABLE_DOC], [test ${enable_doc} = no]) AM_CONDITIONAL([BUILD_HELP_DOC], [test "x$enable_doc" = xyes])
dnl====================== dnl======================
@ -327,7 +330,7 @@ echo ""
echo "======================== Final configuration ===========================" echo "======================== Final configuration ==========================="
echo " Installing into prefix : $prefix" echo " Installing into prefix : $prefix"
echo "" echo ""
echo " Build documentation? : $enable_doc" echo " Build help documentation? : $enable_doc"
echo "" echo ""
echo " Use native libparted dmraid support? : $enable_libparted_dmraid" echo " Use native libparted dmraid support? : $enable_libparted_dmraid"
echo "" echo ""

View File

@ -1442,8 +1442,11 @@ void Win_GParted::show_help_dialog( const Glib::ustring & filename /* E.g., gpar
void Win_GParted::menu_help_contents() void Win_GParted::menu_help_contents()
{ {
#ifdef HAVE_DISABLE_DOC #ifdef ENABLE_HELP_DOC
//GParted was configured with --disable-doc //GParted was built with help documentation
show_help_dialog( "gparted", "" );
#else
//GParted was built *without* help documentation using --disable-doc
Gtk::MessageDialog dialog( *this, Gtk::MessageDialog dialog( *this,
_( "Documentation is not available" ), _( "Documentation is not available" ),
false, false,
@ -1457,9 +1460,6 @@ void Win_GParted::menu_help_contents()
tmp_msg += "http://gparted.org" ; tmp_msg += "http://gparted.org" ;
dialog .set_secondary_text( tmp_msg ) ; dialog .set_secondary_text( tmp_msg ) ;
dialog .run() ; dialog .run() ;
#else
//GParted was configured without --disable-doc
show_help_dialog( "gparted", "" );
#endif #endif
} }