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:
parent
5c73f3de57
commit
20158f0440
|
@ -1,8 +1,8 @@
|
|||
### Do not execute make in the help subdirectory if DISABLE_DOC is set
|
||||
if DISABLE_DOC
|
||||
SUBDIRS = compose data doc include po src
|
||||
else
|
||||
# Only execute make in the help subdirectory if BUILD_HELP_DOC is set
|
||||
if BUILD_HELP_DOC
|
||||
SUBDIRS = help compose data doc include po src
|
||||
else
|
||||
SUBDIRS = compose data doc include po src
|
||||
endif
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
|
31
configure.ac
31
configure.ac
|
@ -236,29 +236,32 @@ PKG_CHECK_EXISTS(
|
|||
dnl======================
|
||||
dnl check whether to build documentation - Gnome-Doc-Utils
|
||||
dnl======================
|
||||
AC_ARG_ENABLE([doc],
|
||||
[ --disable-doc do not build documentation],,)
|
||||
if test "x${enable_doc}" = "x" ; then
|
||||
enable_doc=yes
|
||||
fi
|
||||
AC_ARG_ENABLE(
|
||||
[doc],
|
||||
AS_HELP_STRING(
|
||||
[--disable-doc],
|
||||
dnl Autoconf quadrigraphs '@<:@' = '[' and '@:>@' = ']'
|
||||
[disable building help documentation @<:@default=enabled@:>@]),
|
||||
[enable_doc=$enableval],
|
||||
[enable_doc=yes]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether documentation should be built])
|
||||
if test ${enable_doc} = no; then
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_CHECKING([whether help documentation should be built])
|
||||
if test "x$enable_doc" = xyes; then
|
||||
AC_DEFINE([ENABLE_HELP_DOC], [1], [Define to 1 when help documentation is built])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
if test ${enable_doc} = yes; then
|
||||
if test "x$enable_doc" = xyes; then
|
||||
GNOME_DOC_INIT
|
||||
else
|
||||
dnl Do not care if GDU is not found
|
||||
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
|
||||
|
||||
AM_CONDITIONAL([DISABLE_DOC], [test ${enable_doc} = no])
|
||||
AM_CONDITIONAL([BUILD_HELP_DOC], [test "x$enable_doc" = xyes])
|
||||
|
||||
|
||||
dnl======================
|
||||
|
@ -327,7 +330,7 @@ echo ""
|
|||
echo "======================== Final configuration ==========================="
|
||||
echo " Installing into prefix : $prefix"
|
||||
echo ""
|
||||
echo " Build documentation? : $enable_doc"
|
||||
echo " Build help documentation? : $enable_doc"
|
||||
echo ""
|
||||
echo " Use native libparted dmraid support? : $enable_libparted_dmraid"
|
||||
echo ""
|
||||
|
|
|
@ -1442,8 +1442,11 @@ void Win_GParted::show_help_dialog( const Glib::ustring & filename /* E.g., gpar
|
|||
|
||||
void Win_GParted::menu_help_contents()
|
||||
{
|
||||
#ifdef HAVE_DISABLE_DOC
|
||||
//GParted was configured with --disable-doc
|
||||
#ifdef ENABLE_HELP_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,
|
||||
_( "Documentation is not available" ),
|
||||
false,
|
||||
|
@ -1457,9 +1460,6 @@ void Win_GParted::menu_help_contents()
|
|||
tmp_msg += "http://gparted.org" ;
|
||||
dialog .set_secondary_text( tmp_msg ) ;
|
||||
dialog .run() ;
|
||||
#else
|
||||
//GParted was configured without --disable-doc
|
||||
show_help_dialog( "gparted", "" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue