The big change is that this gets rid of gtk-doc. gtk-doc mostly just makes things harder for us, so let's just not use it anymore. This will hopefully make things easier for those of you making and testing builds, since it means that you no longer need to run `make' before `make dist'. ./configure and `make po-pull' are still necessary. ./configure --enable-gtk-doc will fail, because there's no --enable-gtk-doc anymore.
Other than that, add some things to some autotools files, remove some things, and do the tests in such a way that missing dependencies don't cause the configure script to fail. If you're just running `make dist' you don't really care whether or not gtk3-devel-3.very-latest is installed or not. gettext and gobject-introspection-devel are still required in order for autogen.sh to run, but intltool and the rest of the g* things are no longer hard requirements.
David Shea (8): Dump gtk-doc. Don't distribute the gnome desktop file with translations Use the result from AC_FUNC_FORK at build time Include config.h in every C file. Add a couple of things that autoscan found Remove unused parts of the configure.ac files. Clean up the handling of CFLAGS Switch to kinder, gentler autoconf errors
.gitignore | 7 ---- acinclude.m4 | 75 ++++++++++++++++++++++++++++++++++++ configure.ac | 75 +++++++----------------------------- data/liveinst/gnome/Makefile.am | 3 +- pyanaconda/isys/auditd.c | 6 +++ utils/dd/dd_extract.c | 3 ++ utils/dd/dd_list.c | 3 ++ utils/dd/rpmutils.c | 2 + widgets/Makefile.am | 4 +- widgets/acinclude.m4 | 1 + widgets/autogen.sh | 1 - widgets/configure.ac | 36 ++++++++--------- widgets/doc/AnacondaWidgets-docs.xml | 63 ------------------------------ widgets/doc/Makefile.am | 59 ---------------------------- widgets/src/BaseStandalone.c | 2 + widgets/src/BaseWindow.c | 2 + widgets/src/DiskOverview.c | 2 + widgets/src/HubWindow.c | 2 + widgets/src/LayoutIndicator.c | 2 + widgets/src/MountpointSelector.c | 2 + widgets/src/SpokeSelector.c | 2 + widgets/src/SpokeWindow.c | 2 + widgets/src/StandaloneWindow.c | 2 + widgets/src/glade-adaptor.c | 2 + widgets/src/intl.h | 2 +- widgets/src/widgets-common.c | 2 + 26 files changed, 149 insertions(+), 213 deletions(-) create mode 100644 acinclude.m4 create mode 120000 widgets/acinclude.m4 delete mode 100644 widgets/doc/AnacondaWidgets-docs.xml delete mode 100644 widgets/doc/Makefile.am
Gtk-doc is the worst. Allow me to enumerate:
- It adds an option to our autoconf script that causes everything to fail if it is disabled. It is disabled by default.
- It's driven through an opaque Makefile that forces docs to be built at source distribution time.
- It requires the library to be built before it can generate docs, so it requires a full build before a source tarball can be created.
- ...and it doesn't set up any Makefile dependencies at all, so it just fails if you forget to do a build first.
- In fact, it's pretty crummy about keeping track of the dependencies for its own generated files. If you add or remove one of the source files that docs are generated from, you pretty much just have to do a git clean and start over.
- It pulls in a ton of dependencies for other docs packages so that it can generate cross references but it still doesn't have cross reference data for half the stuff in glib because it sucks.
Also no one reads the docs, probably. --enable-gtk-doc will now cause ./configure to fail: we're yanking this band-aid off so update your builds. --- .gitignore | 7 ---- widgets/Makefile.am | 4 +-- widgets/autogen.sh | 1 - widgets/configure.ac | 6 ---- widgets/doc/AnacondaWidgets-docs.xml | 63 ------------------------------------ widgets/doc/Makefile.am | 59 --------------------------------- 6 files changed, 2 insertions(+), 138 deletions(-) delete mode 100644 widgets/doc/AnacondaWidgets-docs.xml delete mode 100644 widgets/doc/Makefile.am
diff --git a/.gitignore b/.gitignore index 1f46374..a218d6f 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ configure data/liveinst/gnome/fedora-welcome.desktop depcomp dirbrowser -gtk-doc.m4 install-sh keymaps-override-* libtool @@ -83,12 +82,6 @@ tests/test-suite.log updates.img utils/dd/dd_extract utils/dd/dd_list -widgets/doc/AnacondaWidgets-*.txt -widgets/doc/AnacondaWidgets.* -widgets/doc/*.stamp -widgets/doc/html -widgets/doc/xml -widgets/gtk-doc.make widgets/src/gettext.h anaconda.po data/liveinst/gnome/fedora-welcome.po diff --git a/widgets/Makefile.am b/widgets/Makefile.am index ad80f87..be28f54 100644 --- a/widgets/Makefile.am +++ b/widgets/Makefile.am @@ -21,10 +21,10 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src python glade doc data +SUBDIRS = src python glade data
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in config.sub \ - configure depcomp gtk-doc.make install-sh ltmain.sh missing py-compile \ + configure depcomp install-sh ltmain.sh missing py-compile \ m4/*.m4
run-glade: diff --git a/widgets/autogen.sh b/widgets/autogen.sh index e18b17c..55ed5de 100755 --- a/widgets/autogen.sh +++ b/widgets/autogen.sh @@ -1,7 +1,6 @@ #!/bin/bash -e [ -d m4 ] || mkdir m4 libtoolize --copy --force -gtkdocize --copy aclocal -I m4 autoconf autoheader --force diff --git a/widgets/configure.ac b/widgets/configure.ac index 49c4104..1922afa 100644 --- a/widgets/configure.ac +++ b/widgets/configure.ac @@ -47,11 +47,6 @@ GOBJECT_INTROSPECTION_CHECK([0.6.7]) AS_IF([test "x$found_introspection" = xyes], [:], [AC_MSG_ERROR([*** GObject introspection must be enabled])])
-dnl A missing GTK_DOC_CHECK should fail in autogen.sh running gtkdocize, but -dnl might as well check it here too -m4_pattern_forbid([GTK_DOC_CHECK])dnl -GTK_DOC_CHECK([1.14], [--flavour no-tmpl]) - PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) PKG_CHECK_MODULES([GLIB], [glib-2.0]) @@ -64,7 +59,6 @@ AC_STRUCT_TIMEZONE
AC_CHECK_FUNCS([pow setenv setlocale strchr]) AC_CONFIG_FILES([Makefile - doc/Makefile glade/Makefile src/Makefile python/Makefile diff --git a/widgets/doc/AnacondaWidgets-docs.xml b/widgets/doc/AnacondaWidgets-docs.xml deleted file mode 100644 index b67f97d..0000000 --- a/widgets/doc/AnacondaWidgets-docs.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" - "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ -<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> -]> - -<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude"> - <bookinfo> - <title>The AnacondaWidgets Library Reference Manual</title> - - <authorgroup> - <author> - <firstname>Chris</firstname> - <surname>Lumens</surname> - <affiliation> - <address> - <email>clumens@redhat.com</email> - </address> - </affiliation> - </author> - </authorgroup> - </bookinfo> - - <chapter id="windows"> - <title>Window Widgets</title> - <xi:include href="xml/BaseWindow.xml" /> - <xi:include href="xml/BaseStandalone.xml" /> - <xi:include href="xml/HubWindow.xml" /> - <xi:include href="xml/SpokeWindow.xml" /> - <xi:include href="xml/StandaloneWindow.xml" /> - </chapter> - - <chapter id="disks"> - <title>Disk-Related Widgets</title> - <xi:include href="xml/DiskOverview.xml" /> - <xi:include href="xml/MountpointSelector.xml" /> - </chapter> - - <chapter id="miscellaneous"> - <title>Miscellaneous Widgets</title> - <xi:include href="xml/SpokeSelector.xml" /> - <xi:include href="xml/LayoutIndicator.xml" /> - </chapter> - - <chapter id="utility"> - <title>Utility Functions</title> - <xi:include href="xml/widgets-common.xml" /> - </chapter> - - <chapter id="hierarchy"> - <title>Object Hierarchy</title> - <xi:include href="xml/tree_index.sgml" /> - </chapter> - - <index id="api-index-full"> - <title>Index</title> - <xi:include href="xml/api-index-full.xml" /> - </index> - - <xi:include href="xml/annotation-glossary.xml"> - <xi:fallback /> - </xi:include> -</book> diff --git a/widgets/doc/Makefile.am b/widgets/doc/Makefile.am deleted file mode 100644 index b148f39..0000000 --- a/widgets/doc/Makefile.am +++ /dev/null @@ -1,59 +0,0 @@ -# Makefile.am for anaconda widget documentation -# -# Copyright (C) 2011 Red Hat, Inc. -# -# This copyrighted material is made available to anyone wishing to use, -# modify, copy, or redistribute it subject to the terms and conditions of -# the GNU General Public License v.2, or (at your option) any later version. -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY expressed or implied, including the implied warranties of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. You should have received a copy of the -# GNU General Public License along with this program; if not, write to the -# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the -# source code or documentation are not subject to the GNU General Public -# License and may only be used or replicated with the express permission of -# Red Hat, Inc. -# -# Red Hat Author(s): Chris Lumens clumens@redhat.com -# - -## Process this file with automake to produce Makefile.in - -# The name of the module. -DOC_MODULE=AnacondaWidgets - -# The top-level SGML file. -DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml - -# Directories containing the source code. -DOC_SOURCE_DIR=$(top_srcdir) - -# Header files to ignore while scanning. -IGNORE_HFILES = config.h \ - gettext.h \ - intl.h - -# Extra options to supply to gtkdoc-scan. -SCAN_OPTIONS=--rebuild-types - -# Extra options to supply to gtkdoc-mkdb -MKDB_OPTIONS=--sgml-mode - -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties (which we are). -GTKDOC_CFLAGS=$(GLIB_CFLAGS) $(GTK_CFLAGS) -GTKDOC_LIBS=$(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/src/libAnacondaWidgets.la - -include $(top_srcdir)/gtk-doc.make - -if ENABLE_GTK_DOC -TESTS_ENVIRONMENT = cd $(srcdir) && \ - DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ - SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) -#TESTS = $(GTKDOC_CHECK) -endif - -MAINTAINERCLEANFILES = AnacondaWidgets-overrides.txt AnacondaWidgets-sections.txt \ - AnacondaWidgets.types Makefile.in
On Thu, Jul 24, 2014, at 03:32 PM, David Shea wrote:
Gtk-doc is the worst. Allow me to enumerate:
- It adds an option to our autoconf script that causes everything to fail if it is disabled. It is disabled by default.
You can use m4_ifdef to avoid a hard dependency on it.
For example: https://git.gnome.org/browse/glib/tree/configure.ac#n2576
- It's driven through an opaque Makefile that forces docs to be built at source distribution time.
FWIW I avoid this by just using "git archive" to generate tarballs. If anyone pursues this path in the future (say, for continuous delivery where you don't want to download data from some external webservice that might or might not be up), using Source1 in the RPM seems like it'd work.
- It requires the library to be built before it can generate docs, so it requires a full build before a source tarball can be created.
Yeah, but this also not an issue with "git archive". That's how I deal with it, and that's also how Continuous works.
Also no one reads the docs, probably.
That however is probably true =)
On 07/24/2014 04:12 PM, Colin Walters wrote:
On Thu, Jul 24, 2014, at 03:32 PM, David Shea wrote:
Gtk-doc is the worst. Allow me to enumerate:
- It adds an option to our autoconf script that causes everything to fail if it is disabled. It is disabled by default.
You can use m4_ifdef to avoid a hard dependency on it.
For example: https://git.gnome.org/browse/glib/tree/configure.ac#n2576
That's not what I meant (though thanks for mentioning that, it might be worthwhile to wrap the gobject-introspection macro in that). I mean the part where if you try to run make dist on a tree configured without --enable-gtk-doc it does:
make[3]: Entering directory `/home/dshea/src/anaconda/widgets/doc' *** gtk-doc must be installed and enabled in order to make dist make[3]: *** [dist-check-gtkdoc] Error 1
Although I just tried with the rawhide gtk-doc, and it appears to just ignore --enable/disable-gtk-doc, instead, and build the docs regardless. So they fixed half of the problem, I guess.
On 07/24/2014 03:32 PM, David Shea wrote:
--enable-gtk-doc will now cause ./configure to fail:
This part is a lie, so I'll remove it. Part of using AC_CONFIG_SUBDIRS for the widgets means we can actually junk up the configure line with all kinds of garbage and it'll just ignore it.
Well, I read the docs sometimes and if we want to support addons and encourage people creating them, we need some documentation for our widgets.
I agree that having gtk-doc a part of the build/distribution process is a pain, but I don't like removing the files allowing the documentation to be built. We should have something like a 'docs' make target that would depend on the 'build' target and run that first. Probably also a separate anaconda-docs package?
Gtk-doc is the worst at autotools integration. Allow me to enumerate:
- It adds an option to our autoconf script that causes everything to fail if it is disabled. It is disabled by default.
- It's driven through an opaque Makefile that forces docs to be built at source distribution time.
- It requires the library to be built before it can generate docs, so it requires a full build before a source tarball can be created.
- ...and it doesn't set up any Makefile dependencies at all, so it just fails if you forget to do a build first.
- In fact, it's pretty crummy about keeping track of the dependencies for its own generated files. If you add or remove one of the source files that docs are generated from, you pretty much just have to do a git clean and start over.
- It pulls in a ton of dist-time dependencies for other docs packages so that it can generate cross references but it still doesn't have cross reference data for half the stuff in glib because it sucks.
Get rid of gtk-doc's automatically installed files, where most of the problems lie. Adapt the rules from gtk-doc.make into a single script that runs everything to reduce the dependency nightmare. Run the script at build time. --- .gitignore | 1 - widgets/Makefile.am | 2 +- widgets/autogen.sh | 1 - widgets/configure.ac | 10 ++-- widgets/doc/Makefile.am | 88 +++++++++++++++++++++++++++++++---- widgets/doc/run-gtkdoc.sh | 116 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 201 insertions(+), 17 deletions(-) create mode 100755 widgets/doc/run-gtkdoc.sh
diff --git a/.gitignore b/.gitignore index 1f46374..2b03149 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ configure data/liveinst/gnome/fedora-welcome.desktop depcomp dirbrowser -gtk-doc.m4 install-sh keymaps-override-* libtool diff --git a/widgets/Makefile.am b/widgets/Makefile.am index ad80f87..7afcf19 100644 --- a/widgets/Makefile.am +++ b/widgets/Makefile.am @@ -24,7 +24,7 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src python glade doc data
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in config.sub \ - configure depcomp gtk-doc.make install-sh ltmain.sh missing py-compile \ + configure depcomp install-sh ltmain.sh missing py-compile \ m4/*.m4
run-glade: diff --git a/widgets/autogen.sh b/widgets/autogen.sh index e18b17c..55ed5de 100755 --- a/widgets/autogen.sh +++ b/widgets/autogen.sh @@ -1,7 +1,6 @@ #!/bin/bash -e [ -d m4 ] || mkdir m4 libtoolize --copy --force -gtkdocize --copy aclocal -I m4 autoconf autoheader --force diff --git a/widgets/configure.ac b/widgets/configure.ac index 49c4104..ecad88f 100644 --- a/widgets/configure.ac +++ b/widgets/configure.ac @@ -47,10 +47,12 @@ GOBJECT_INTROSPECTION_CHECK([0.6.7]) AS_IF([test "x$found_introspection" = xyes], [:], [AC_MSG_ERROR([*** GObject introspection must be enabled])])
-dnl A missing GTK_DOC_CHECK should fail in autogen.sh running gtkdocize, but -dnl might as well check it here too -m4_pattern_forbid([GTK_DOC_CHECK])dnl -GTK_DOC_CHECK([1.14], [--flavour no-tmpl]) +# Add gtk-doc's html-dir option without pulling in the rest of gtk-doc +AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) +HTML_DIR="$with_html_dir" +AC_SUBST([HTML_DIR])
PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) diff --git a/widgets/doc/Makefile.am b/widgets/doc/Makefile.am index b148f39..d445d63 100644 --- a/widgets/doc/Makefile.am +++ b/widgets/doc/Makefile.am @@ -28,7 +28,7 @@ DOC_MODULE=AnacondaWidgets DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# Directories containing the source code. -DOC_SOURCE_DIR=$(top_srcdir) +DOC_SOURCE_DIR=$(top_srcdir)/src
# Header files to ignore while scanning. IGNORE_HFILES = config.h \ @@ -46,14 +46,82 @@ MKDB_OPTIONS=--sgml-mode GTKDOC_CFLAGS=$(GLIB_CFLAGS) $(GTK_CFLAGS) GTKDOC_LIBS=$(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/src/libAnacondaWidgets.la
-include $(top_srcdir)/gtk-doc.make +# Extra junk copied from gtk-doc.make +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute
-if ENABLE_GTK_DOC -TESTS_ENVIRONMENT = cd $(srcdir) && \ - DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ - SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) -#TESTS = $(GTKDOC_CHECK) -endif +# gtk-doc is terrible at integrating with autotools, so build things by hand.
-MAINTAINERCLEANFILES = AnacondaWidgets-overrides.txt AnacondaWidgets-sections.txt \ - AnacondaWidgets.types Makefile.in +# Copy the files we need into $builddir +SETUP_FILES = $(DOC_MAIN_SGML_FILE) +GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) +GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; + +setup-build.stamp: + $(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + test -d $(abs_builddir) || $(MKDIR_P) $(abs_builddir) ; \ + cp -pf $(abs_srcdir)/$(DOC_MAIN_SGML_FILE) $(abs_builddir)/$(DOC_MAIN_SGML_FILE) ; \ + fi + $(AM_V_at)touch setup-build.stamp + +GTK_DOC_V_BUILD=$(GTK_DOC_V_BUILD_$(V)) +GTK_DOC_V_BUILD_=$(GTK_DOC_V_BUILD_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_BUILD_0=@echo "DOC Building docs"; + +noinst_DATA = gtkdoc.stamp +dist_noinst_SCRIPTS = run-gtkdoc.sh +dist_noinst_DATA = AnacondaWidgets-docs.xml + +# Copy a bunch of make variables to the environment and run the gtk-doc script +gtkdoc.stamp: run-gtkdoc.sh $(DOC_SOURCE_DIR)/*.c $(DOC_SOURCE_DIR)/*.h \ + $(top_builddir)/src/libAnacondaWidgets.la \ + $(DOC_MAIN_SGML_FILE) \ + setup-build.stamp + $(GTK_DOC_V_BUILD)DOC_MODULE="$(DOC_MODULE)" \ + DOC_MAIN_SGML_FILE="$(DOC_MAIN_SGML_FILE)" \ + DOC_SOURCE_DIR="$(DOC_SOURCE_DIR)" \ + IGNORE_HFILES="$(IGNORE_HFILES)" \ + SCAN_OPTIONS="$(SCAN_OPTIONS)" \ + MKDB_OPTIONS="$(MKDB_OPTIONS)" \ + HTML_DIR="$(HTML_DIR)" \ + GTKDOC_CC="$(GTKDOC_CC)" \ + GTKDOC_LD="$(GTKDOC_LD)" \ + GTKDOC_RUN="$(GTKDOC_RUN)" \ + GTKDOC_CFLAGS="$(GTKDOC_CFLAGS)" \ + GTKDOC_LIBS="$(GTKDOC_LIBS)" \ + V=$(V) \ + $(srcdir)/run-gtkdoc.sh + +# install and uninstall targets adapted from gtk-doc.make +install-data-local: gtkdoc.stamp + @installfiles=`echo $(builddir)/html/*`; \ + installdir="$(DESTDIR)$(HTML_DIR)/$(DOC_MODULE)" ; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done ; \ + gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir} + +uninstall-local: + @installdir="$(DESTDIR)$(HTML_DIR)/$(DOC_MODULE)" ; \ + rm -rf $${installdir} + +# Clean up the mess +CLEANFILES = AnacondaWidgets-decl-list.txt AnacondaWidgets-decl.txt \ + AnacondaWidgets-overrides.txt AnacondaWidgets-sections.txt \ + AnacondaWidgets.types AnacondaWidgets.args AnacondaWidgets.hierarchy \ + AnacondaWidgets.interfaces AnacondaWidgets.prerequisites AnacondaWidgets.signals \ + AnacondaWidgets-doc.bottom AnacondaWidgets-doc.top AnacondaWidgets-undeclared.txt \ + AnacondaWidgets-undocumented.txt AnacondaWidgets-unused.txt \ + sgml.stamp html.stamp gtkdoc.stamp setup-build.stamp + +clean-local: + @rm -rf xml html + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(abs_builddir)/$(DOC_MAIN_SGML_FILE) ; \ + fi + +MAINTAINERCLEANFILES = Makefile.in diff --git a/widgets/doc/run-gtkdoc.sh b/widgets/doc/run-gtkdoc.sh new file mode 100755 index 0000000..40e6d1d --- /dev/null +++ b/widgets/doc/run-gtkdoc.sh @@ -0,0 +1,116 @@ +#!/bin/sh -e +# Generate HTML documentation +# +# Copyright (C) 2014 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# the GNU General Public License v.2, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY expressed or implied, including the implied warranties of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. You should have received a copy of the +# GNU General Public License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the +# source code or documentation are not subject to the GNU General Public +# License and may only be used or replicated with the express permission of +# Red Hat, Inc. +# +# Red Hat Author(s): David Shea dshea@redhat.com +# + +# Using make to run tools with multiple outputs is a recipe for disaster, so +# use make to run this instead. It's not like any of it can be parallelized +# anyway, and if anything changes we more than likely have to start at the +# beginning. This script will run all of the various gtkdoc programs and create +# a single output file, $DOC_OUTPUT_DIR/gtkdoc.stamp + +# ---- ENVIRONMENT VARIABLES ----- +# DOC_MODULE: the name of the module +# DOC_MAIN_SGML_FILE: the top-level SGML file +# DOC_SOURCE_DIR: directories containing the source code +# IGNORE_HFILES: header files to ignore while scanning +# SCAN_OPTIONS: Extra options to supply to gtkdoc-scan +# MKDB_OPTIONS: Extra options to supply to gtkdoc-mkdb +# HTML_DIR: The gtk-doc html directory +# GTKDOC_CC: compiler to use with gtkdoc-scangobj (e.g., $(LTCOMPILE)) +# GTKDOC_LD: linker to use with gtkdoc-scangobj (e.g., $(LINK)) +# GTKDOC_RUN: Wrapper to run whatever gtdkco-scangobj made (e.g., $(LIBTOOL) --mode=execute) +# GTKDOC_CFLAGS: CFLAGS to pass to gtkdoc-scangobj (e.g., $(GTK_CFLAGS)) +# GTKDOC_LIBS: LIBS to pass to gtkdoc-scangobj (e.g., $(GTK_LIB) plus the .la file to scan) + +# Everything will be output in the current directory because these tools are +# awful at communicating paths to each other, and all of the paths in +# $DOC_MAIN_SGML_FILE need to be relative to the output directory. Which +# also means that $DOC_MAIN_SGML_FILE needs to be copied into $builddir. + +# This script should be run any time the source files or the main SGML file +# change. + +if [ -n "$V" ]; then + set -x +fi + +# Remove the old stamp file +rm -f gtkdoc.stamp + +# Generate --source-dir args for gtkdoc-scan and gtkdoc-mkdb +# Use realpath to convert to absolute paths because whoever wrote gtkdoc-mkdb +# couldn't imagine a world in which input file aren't in the current directory +_source_dir= +for d in $DOC_SOURCE_DIR ; do + _source_dir="${_source_dir} --source-dir=$(realpath $d)" +done + +# Convert DOC_MAIN_SGML_FILE to an absolute path because gtkdoc-mkhtml can't +# specify an output directory +DOC_MAIN_SGML_FILE=$(realpath ${DOC_MAIN_SGML_FILE}) + +# Clean up files from gtkdoc-scan and run +rm -f ${DOC_MODULE}-decl-list.txt ${DOC_MODULE}-decl.txt ${DOC_MODULE}-overrides.txt \ + ${DOC_MODULE}-sections.txt ${DOC_MODULE}.types + +gtkdoc-scan \ + --module=${DOC_MODULE} \ + --ignore-headers="${IGNORE_HFILES}" ${_source_dir} \ + --output-dir=. \ + ${SCAN_OPTIONS} + +# Clean up files from gtkdoc-scangobj and run +rm -f ${DOC_MODULE}.args ${DOC_MODULE}.hierarchy ${DOC_MODULE}.interfaces \ + ${DOC_MODULE}.prerequisites ${DOC_MODULE}.signals + +gtkdoc-scangobj \ + --module=${DOC_MODULE} \ + --types=${DOC_MODULE}.types \ + --output-dir=. \ + --cc="${GTKDOC_CC}" \ + --run="${GTKDOC_RUN}" \ + --ld="${GTKDOC_LD}" \ + --cflags="${GTKDOC_CFLAGS}" \ + --ldflags="${GTKDOC_LIBS}" + +# Clean up files from gtkdoc-mkdb and run +rm -rf ${DOC_MODULE}-doc.bottom ${DOC_MODULE}-doc.top \ + ${DOC_MODULE}-undeclared.txt ${DOC_MODULE}-undocumented.txt \ + ${DOC_MODULE}-unused.txt sgml.stamp xml + +gtkdoc-mkdb --module=${DOC_MODULE} \ + --source-suffixes=c,h \ + --ignore-files="${IGNORE_HFILES}" \ + --output-dir=xml \ + --main-sgml-file=${DOC_MAIN_SGML_FILE} \ + --output-format=xml \ + ${_source_dir} \ + ${MKDB_OPTIONS} + +# We almost have something useful! gtkdoc-mkhtml is next +rm -rf html +mkdir html +( cd html && gtkdoc-mkhtml ${DOC_MODULE} ${DOC_MAIN_SGML_FILE} ) + +gtkdoc-fixxref --module=${DOC_MODULE} --module-dir=html --html-dir=${HTML_DIR} + +# All done, new stamp file +touch gtkdoc.stamp
On Fri, 2014-07-25 at 17:08 -0400, David Shea wrote:
Gtk-doc is the worst at autotools integration. Allow me to enumerate:
It adds an option to our autoconf script that causes everything to fail if it is disabled. It is disabled by default.
It's driven through an opaque Makefile that forces docs to be built at source distribution time.
It requires the library to be built before it can generate docs, so it requires a full build before a source tarball can be created.
...and it doesn't set up any Makefile dependencies at all, so it just fails if you forget to do a build first.
In fact, it's pretty crummy about keeping track of the dependencies for its own generated files. If you add or remove one of the source files that docs are generated from, you pretty much just have to do a git clean and start over.
It pulls in a ton of dist-time dependencies for other docs packages so that it can generate cross references but it still doesn't have cross reference data for half the stuff in glib because it sucks.
Get rid of gtk-doc's automatically installed files, where most of the problems lie. Adapt the rules from gtk-doc.make into a single script that runs everything to reduce the dependency nightmare. Run the script at build time.
First of all big THANKS for your effort and working on this! The patch looks good to me though I cannot say I understand it completely.
We distribute the template file and we distribute the translations, so we can put the intltool-merge step off until build. --- data/liveinst/gnome/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/data/liveinst/gnome/Makefile.am b/data/liveinst/gnome/Makefile.am index ae05a5c..861f5b1 100644 --- a/data/liveinst/gnome/Makefile.am +++ b/data/liveinst/gnome/Makefile.am @@ -18,8 +18,9 @@ # Author: Kalev Lember kalevlember@gmail.com
welcomedir = $(datadir)/$(PACKAGE_NAME)/gnome -dist_welcome_DATA = fedora-welcome.desktop install-button.png +dist_welcome_DATA = install-button.png dist_welcome_SCRIPTS = fedora-welcome +welcome_DATA = fedora-welcome.desktop
EXTRA_DIST = fedora-welcome.desktop.in
Make it look like we have that macro there for a reason and not just because autoscan told us to use it. --- pyanaconda/isys/auditd.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/pyanaconda/isys/auditd.c b/pyanaconda/isys/auditd.c index 24cefa8..8b36505 100644 --- a/pyanaconda/isys/auditd.c +++ b/pyanaconda/isys/auditd.c @@ -98,6 +98,12 @@ int audit_daemonize(void) { #ifdef USESELINUX int fd; pid_t child; + +/* I guess we should actually do something with the output of AC_FUNC_FORK */ +#ifndef HAVE_WORKING_WORK +#error "Autoconf could not find a working fork. Please fix this." +#endif + if ((child = fork()) > 0) return 0;
On 07/24/2014 04:04 PM, Colin Walters wrote:
On Thu, Jul 24, 2014, at 03:32 PM, David Shea wrote:
+#ifndef HAVE_WORKING_WORK
Typo? _______________________________________________ anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
Yeah. Fixed locally to HAVE_WORKING_FORK
Make sure that whatever autoconf finds or whatever #defines we tell it to use actually get used. --- utils/dd/dd_extract.c | 3 +++ utils/dd/dd_list.c | 3 +++ utils/dd/rpmutils.c | 2 ++ widgets/src/BaseStandalone.c | 2 ++ widgets/src/BaseWindow.c | 2 ++ widgets/src/DiskOverview.c | 2 ++ widgets/src/HubWindow.c | 2 ++ widgets/src/LayoutIndicator.c | 2 ++ widgets/src/MountpointSelector.c | 2 ++ widgets/src/SpokeSelector.c | 2 ++ widgets/src/SpokeWindow.c | 2 ++ widgets/src/StandaloneWindow.c | 2 ++ widgets/src/glade-adaptor.c | 2 ++ widgets/src/intl.h | 2 +- widgets/src/widgets-common.c | 2 ++ 15 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/utils/dd/dd_extract.c b/utils/dd/dd_extract.c index 46c8426..d0a386e 100644 --- a/utils/dd/dd_extract.c +++ b/utils/dd/dd_extract.c @@ -17,6 +17,9 @@ * Author(s): Martin Sivak msivak@redhat.com * Brian C. Lane bcl@redhat.com */ + +#include "config.h" + #include <ctype.h> #include <stdio.h> #include <stdlib.h> diff --git a/utils/dd/dd_list.c b/utils/dd/dd_list.c index 28ce8d5..7412644 100644 --- a/utils/dd/dd_list.c +++ b/utils/dd/dd_list.c @@ -17,6 +17,9 @@ * Author(s): Martin Sivak msivak@redhat.com * Brian C. Lane bcl@redhat.com */ + +#include "config.h" + #include <ctype.h> #include <stdio.h> #include <stdlib.h> diff --git a/utils/dd/rpmutils.c b/utils/dd/rpmutils.c index 7c77973..4f06d25 100644 --- a/utils/dd/rpmutils.c +++ b/utils/dd/rpmutils.c @@ -22,6 +22,8 @@ * * */
+#include "config.h" + #include <stdlib.h> #include <stdio.h> #include <string.h> diff --git a/widgets/src/BaseStandalone.c b/widgets/src/BaseStandalone.c index 0ff1049..9075fdc 100644 --- a/widgets/src/BaseStandalone.c +++ b/widgets/src/BaseStandalone.c @@ -17,6 +17,8 @@ * Author: David Shea dshea@redhat.com */
+#include "config.h" + #include "BaseWindow.h" #include "BaseStandalone.h" #include "intl.h" diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c index 9f5282a..5b7f337 100644 --- a/widgets/src/BaseWindow.c +++ b/widgets/src/BaseWindow.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + #include <libintl.h> #include <locale.h> #include <stdlib.h> diff --git a/widgets/src/DiskOverview.c b/widgets/src/DiskOverview.c index f558e7f..a53992a 100644 --- a/widgets/src/DiskOverview.c +++ b/widgets/src/DiskOverview.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + #include <atk/atk.h> #include <gdk/gdk.h> #include <gio/gio.h> diff --git a/widgets/src/HubWindow.c b/widgets/src/HubWindow.c index 3b5cdea..bfdd228 100644 --- a/widgets/src/HubWindow.c +++ b/widgets/src/HubWindow.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + #include "BaseStandalone.h" #include "HubWindow.h" #include "intl.h" diff --git a/widgets/src/LayoutIndicator.c b/widgets/src/LayoutIndicator.c index cebc21d..e872b89 100644 --- a/widgets/src/LayoutIndicator.c +++ b/widgets/src/LayoutIndicator.c @@ -19,6 +19,8 @@ * Author: Vratislav Podzimek vpodzime@redhat.com */
+#include "config.h" + #include <atk/atk.h> #include <glib.h> #include <gdk/gdk.h> diff --git a/widgets/src/MountpointSelector.c b/widgets/src/MountpointSelector.c index b2323b4..a9ad215 100644 --- a/widgets/src/MountpointSelector.c +++ b/widgets/src/MountpointSelector.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + #include <unistd.h> #include <gdk/gdk.h> #include <glib.h> diff --git a/widgets/src/SpokeSelector.c b/widgets/src/SpokeSelector.c index 492a6e2..33506cc 100644 --- a/widgets/src/SpokeSelector.c +++ b/widgets/src/SpokeSelector.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + #include <atk/atk.h> #include <gdk/gdk.h> #include <gio/gio.h> diff --git a/widgets/src/SpokeWindow.c b/widgets/src/SpokeWindow.c index a1a46f1..f213177 100644 --- a/widgets/src/SpokeWindow.c +++ b/widgets/src/SpokeWindow.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + #include "BaseWindow.h" #include "SpokeWindow.h" #include "intl.h" diff --git a/widgets/src/StandaloneWindow.c b/widgets/src/StandaloneWindow.c index 5d0836a..9daaad9 100644 --- a/widgets/src/StandaloneWindow.c +++ b/widgets/src/StandaloneWindow.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + #include "BaseStandalone.h" #include "StandaloneWindow.h" #include "intl.h" diff --git a/widgets/src/glade-adaptor.c b/widgets/src/glade-adaptor.c index 367e0e8..8cc37d2 100644 --- a/widgets/src/glade-adaptor.c +++ b/widgets/src/glade-adaptor.c @@ -17,6 +17,8 @@ * Author: Chris Lumens clumens@redhat.com */
+#include "config.h" + /* This file contains code called by glade when it creates, reads, writes, or * otherwise manipulates anaconda-specific widgets. Each function in this file * that glade should call must be referenced in a glade-widget-class stanza of diff --git a/widgets/src/intl.h b/widgets/src/intl.h index 18aad9f..f73ce7a 100644 --- a/widgets/src/intl.h +++ b/widgets/src/intl.h @@ -20,7 +20,7 @@ #ifndef _INTL_H #define _INTL_H
-#include "../config.h" +#include "config.h" #include "gettext.h"
#define _(x) dgettext("anaconda", x) diff --git a/widgets/src/widgets-common.c b/widgets/src/widgets-common.c index 459289a..0bdee46 100644 --- a/widgets/src/widgets-common.c +++ b/widgets/src/widgets-common.c @@ -20,6 +20,8 @@ * */
+#include "config.h" + #include "widgets-common.h"
#include <stdlib.h>
--- widgets/configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/widgets/configure.ac b/widgets/configure.ac index 1922afa..ceaa3d6 100644 --- a/widgets/configure.ac +++ b/widgets/configure.ac @@ -31,6 +31,8 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
+AC_TYPE_SIZE_T + AC_PROG_CC AC_PROG_CXX AC_PROG_LIBTOOL @@ -53,7 +55,7 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0]) PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30])
-AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h]) +AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h])
AC_STRUCT_TIMEZONE
We never check the output of any of those program tests, so if you don't have a working awk or grep installed, too bad. Nothing links directly with libX11 anymore. We don't need an explicit check for pkg-config because we always run PKG_CHECK_MODULES. nfs and ipv6 cannot be disabled. We don't use glib directly. Caring about timezones has been moved to an external library. There's no need to reset $LIBS because none of the checks we have left set it in the first place. --- configure.ac | 28 ---------------------------- widgets/configure.ac | 7 +------ 2 files changed, 1 insertion(+), 34 deletions(-)
diff --git a/configure.ac b/configure.ac index 8abad7d..ef1b81a 100644 --- a/configure.ac +++ b/configure.ac @@ -30,12 +30,8 @@ AC_DEFINE_UNQUOTED([BUILD_DATE], ["`date +%m%d%Y`"], [Date of anaconda build]) AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
# Checks for programs. -AC_PROG_AWK -AC_PROG_GREP AC_PROG_CC -AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_PROG_MKDIR_P
@@ -69,7 +65,6 @@ AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18.3])
# Checks for header files. -AC_PATH_X AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h], [], [AC_MSG_FAILURE([*** Header file $ac_header not found.])], @@ -104,7 +99,6 @@ PKG_CHECK_MODULES([PYTHON], [python], [ [AC_MSG_FAILURE([*** Unable to find python library])])
# Check for libraries we need that provide pkg-config scripts -PKG_PROG_PKG_CONFIG([0.23]) PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4])
@@ -115,23 +109,6 @@ else CFLAGS="$CFLAGS $RPM_OPT_FLAGS" fi
-# NFS support can, in theory, be enabled or disabled -AC_ARG_ENABLE(nfs, - AC_HELP_STRING([--enable-nfs], - [enable NFS support (default is yes)]), - [nfs=$enableval], - [nfs=yes]) - -# IPv6 support can be enabled or disabled -AC_ARG_ENABLE(ipv6, - AC_HELP_STRING([--enable-ipv6], - [enable IPv6 support (default is yes)]), - [ipv6=$enableval], - [ipv6=yes]) -if test x$ipv6 = xyes ; then - AC_SUBST(IPV6_CFLAGS, [-DENABLE_IPV6]) -fi - # GCC likes to bomb out on some ridiculous warnings. Add your favorites # here. SHUT_UP_GCC="-Wno-unused-result" @@ -157,11 +134,6 @@ cflags_filter() { } CFLAGS="`cflags_filter $CFLAGS`"
-# Unset $(LIBS) because different programs and libraries will have different -# lists of libraries to link with, we don't want everything linking against -# all libraries we checked for. -LIBS= - # Get the release number from the spec file rel="`awk '/Release:/ { split($2, r, "%"); print r[[1]] }' $srcdir/anaconda.spec.in`" AC_SUBST(PACKAGE_RELEASE, [$rel]) diff --git a/widgets/configure.ac b/widgets/configure.ac index ceaa3d6..cbdc079 100644 --- a/widgets/configure.ac +++ b/widgets/configure.ac @@ -34,9 +34,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_TYPE_SIZE_T
AC_PROG_CC -AC_PROG_CXX AC_PROG_LIBTOOL -AC_PROG_LN_S
AM_GNU_GETTEXT([external])
@@ -51,15 +49,12 @@ AS_IF([test "x$found_introspection" = xyes], [:],
PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) -PKG_CHECK_MODULES([GLIB], [glib-2.0]) PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30])
AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h])
-AC_STRUCT_TIMEZONE - -AC_CHECK_FUNCS([pow setenv setlocale strchr]) +AC_CHECK_FUNCS([setenv setlocale]) AC_CONFIG_FILES([Makefile glade/Makefile src/Makefile
On 07/24/2014 03:32 PM, David Shea wrote:
We don't use glib directly.
Rather, we don't *need* to use glib directly. With the second version of the gtk-build patch, in this patch I'll also remove GLIB_CFLAGS and GLIB_LIBS from widgets/doc/Makefile.am.
If we need $RPM_OPT_FLAGS, rpmbuild will add them through the %configure macro. Use autoconf macros for -D_GNU_SOURCE and large file support. Duplicate CFLAGS don't actually matter. --- configure.ac | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-)
diff --git a/configure.ac b/configure.ac index ef1b81a..d9bf184 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,9 @@ AC_CONFIG_MACRO_DIR([m4]) AC_DEFINE_UNQUOTED([BUILD_DATE], ["`date +%m%d%Y`"], [Date of anaconda build]) AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
+AC_USE_SYSTEM_EXTENSIONS +AC_SYS_LARGEFILE + # Checks for programs. AC_PROG_CC AC_PROG_LN_S @@ -102,37 +105,12 @@ PKG_CHECK_MODULES([PYTHON], [python], [ PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4])
-# Set $RPM_OPT_FLAGS if we don't have it -if test -z $RPM_OPT_FLAGS ; then - CFLAGS="$CFLAGS -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" -else - CFLAGS="$CFLAGS $RPM_OPT_FLAGS" -fi - # GCC likes to bomb out on some ridiculous warnings. Add your favorites # here. SHUT_UP_GCC="-Wno-unused-result"
# Add remaining compiler flags we want to use -CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" - -# Filter CFLAGS (remove duplicate flags) -cflags_filter() { - have= - first=1 - for flag in $* ; do - if test -z "`echo $have | grep -- $flag`" ; then - if test x$first == x1 ; then - first=2 - else - echo -n " " - fi - echo -n $flag - have="$have $flag" - fi - done -} -CFLAGS="`cflags_filter $CFLAGS`" +CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC"
# Get the release number from the spec file rel="`awk '/Release:/ { split($2, r, "%"); print r[[1]] }' $srcdir/anaconda.spec.in`"
On Thu, Jul 24, 2014, at 03:32 PM, David Shea wrote:
If we need $RPM_OPT_FLAGS, rpmbuild will add them through the %configure macro. Use autoconf macros for -D_GNU_SOURCE and large file support. Duplicate CFLAGS don't actually matter.
Looks right to me.
The usual paradigm in autoconf is to fail configure if a dependency is not found, but this is unhelpful in an environment that has 47 zillion make targets that aren't directly connected to compling a program. Instead of failing, print a message about missing dependencies at the end of the ./configure with some ***'s, but still exit with a status 0 and let the Makefiles be generated. Any missing dependencies will cause a failure during `make', and other targets like `make dist' will still work. --- acinclude.m4 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 17 +++++++----- widgets/acinclude.m4 | 1 + widgets/configure.ac | 25 ++++++++++++------ 4 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 acinclude.m4 create mode 120000 widgets/acinclude.m4
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..61eb1a8 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,75 @@ +dnl autoconf macros for anaconda +dnl +dnl Copyright (C) 2014 Red Hat, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU Lesser General Public License as published +dnl by the Free Software Foundation; either version 2.1 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public License +dnl along with this program. If not, see http://www.gnu.org/licenses/. +dnl +dnl Author: David Shea dshea@redhat.com + +dnl ANACONDA_SOFT_FAILURE(MESSAGE) +dnl +dnl Store a message that in some contexts could be considered indicative +dnl of a failure, but in other contexts could be indicative of who cares. +dnl +dnl For example, the anaconda widgets require a version of gtk3-devel of +dnl particular newness, and the widgets will fail to build if this library +dnl and headers are not available. On the other hand, gtk3 isn't required at +dnl all for most everything else, so it would be nice if a missing or old +dnl gtk3-devel didn't halt the configure script. +dnl +dnl Any message sent to this macro will be stored, and they can all be +dnl displayed at the end of configure using the ANACONDA_FAILURES macro. +AC_DEFUN([ANACONDA_SOFT_FAILURE], [dnl +AS_IF([test x"$anaconda_failure_messages" = x], + [anaconda_failure_messages="[$1]"], + [anaconda_failure_messages="$anaconda_failure_messages +[$1]" +])])dnl + +dnl ANACONDA_PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES) +dnl +dnl Check whether a module is available, using pkg-config. Instead of failing +dnl if a module is not found, store the failure in a message that can be +dnl printed using the ANACONDA_FAILURES macro. +dnl +dnl The syntax and behavior of VARIABLE-PREFIX and MODULES is the same as for +dnl PKG_CHECK_MODULES. +AC_DEFUN([ANACONDA_PKG_CHECK_MODULES], [dnl +PKG_CHECK_MODULES([$1], [$2], [], [ANACONDA_SOFT_FAILURE($[$1]_PKG_ERRORS)]) +])dnl + +dnl ANACONDA_PKG_CHECK_EXISTS(MODULES) +dnl +dnl Check whether a module exists, using pkg-config. Instead of failing +dnl if a module is not found, store the failure in a message that can be +dnl printed using the ANACONDA_FAILURES macro. +dnl +dnl The syntax and behavior of MOUDLES is the same as for +dnl PKG_CHECK_EXISTS. +AC_DEFUN([ANACONDA_PKG_CHECK_EXISTS], [dnl +PKG_CHECK_EXISTS([$1], [], [ANACONDA_SOFT_FAILURE([Check for $1 failed])]) +])dnl + +dnl ANACONDA_FAILURES +dnl +dnl Print the failure messages collected by ANACONDA_SOFT_FAILURE and +dnl ANACONDA_PKG_CHECK_MODULES +AC_DEFUN([ANACONDA_FAILURES], [dnl +AS_IF([test x"$anaconda_failure_messages" = x], [], [dnl +echo "" +echo "*** Anaconda encountered the following issues during configuration:" +echo "$anaconda_failure_messages" +echo "" +echo "*** Anaconda will not successfully build without these missing dependencies" +])])dnl diff --git a/configure.ac b/configure.ac index d9bf184..e537da2 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ AC_PROG_MKDIR_P AC_PATH_PROG([INTLTOOL_EXTRACT], [intltool-extract]) AC_PATH_PROG([INTLTOOL_MERGE], [intltool-merge]) AS_IF([test -z "$INTLTOOL_EXTRACT" -o -z "$INTLTOOL_MERGE"], - [AC_MSG_ERROR([*** intltool not found])]) + [ANACONDA_SOFT_FAILURE([intltool not found])])
# Add the bits for Makefile rules INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' @@ -70,7 +70,7 @@ AM_GNU_GETTEXT_VERSION([0.18.3]) # Checks for header files. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h], [], - [AC_MSG_FAILURE([*** Header file $ac_header not found.])], + [ANACONDA_SOFT_FAILURE([Header file $ac_header not found.])], [])
# Checks for typedefs, structures, and compiler characteristics. @@ -84,7 +84,7 @@ AC_TYPE_INT64_T AC_FUNC_FORK AC_CHECK_FUNCS([getcwd memset mkdir strchr strdup], [], - [AC_MSG_FAILURE([*** Required function $ac_func not found.])]) + [ANACONDA_SOFT_FAILURE([Function $ac_func not found.])])
AM_PATH_PYTHON(python_required_version)
@@ -96,14 +96,14 @@ PKG_CHECK_MODULES([PYTHON], [python], [ AC_TRY_LINK_FUNC([Py_Initialize], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_FAILURE([*** Unable to use python library])]) + ANACONDA_SOFT_FAILURE([Unable to use python library])]) LIBS="$LIBS_save" ], - [AC_MSG_FAILURE([*** Unable to find python library])]) + [ANACONDA_SOFT_FAILURE([Unable to find python library])])
# Check for libraries we need that provide pkg-config scripts -PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) -PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4]) +ANACONDA_PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) +ANACONDA_PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4])
# GCC likes to bomb out on some ridiculous warnings. Add your favorites # here. @@ -176,3 +176,6 @@ AC_CONFIG_FILES([Makefile utils/Makefile utils/dd/Makefile]) AC_OUTPUT + +# Gently advise the user about the build failures they are about to encounter +ANACONDA_FAILURES diff --git a/widgets/acinclude.m4 b/widgets/acinclude.m4 new file mode 120000 index 0000000..d84c32a --- /dev/null +++ b/widgets/acinclude.m4 @@ -0,0 +1 @@ +../acinclude.m4 \ No newline at end of file diff --git a/widgets/configure.ac b/widgets/configure.ac index cbdc079..a960c32 100644 --- a/widgets/configure.ac +++ b/widgets/configure.ac @@ -43,18 +43,24 @@ dnl is not expanded. m4_pattern_forbid([GOBJECT_INTROSPECTION_CHECK])dnl GOBJECT_INTROSPECTION_CHECK([0.6.7])
-# Fail if introspection was not enabled +# Complain if introspection was not enabled AS_IF([test "x$found_introspection" = xyes], [:], - [AC_MSG_ERROR([*** GObject introspection must be enabled])]) + [ANACONDA_SOFT_FAILURE([GObject introspection must be enabled])])
-PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) -PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) -PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) -PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30]) +ANACONDA_PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) +ANACONDA_PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) +ANACONDA_PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) +ANACONDA_PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30])
-AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h]) +AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h], + [], + [ANACONDA_SOFT_FAILURE([Header file $ac_header not found.])], + []) + +AC_CHECK_FUNCS([setenv setlocale], + [], + [ANACONDA_SOFT_FAILURE([Function $ac_func not found.])])
-AC_CHECK_FUNCS([setenv setlocale]) AC_CONFIG_FILES([Makefile glade/Makefile src/Makefile @@ -62,3 +68,6 @@ AC_CONFIG_FILES([Makefile data/Makefile data/pixmaps/Makefile]) AC_OUTPUT + +# Gently advise the user about the build failures they are about to encounter +ANACONDA_FAILURES
(this version makes gobject-introspection-devel optional)
The usual paradigm in autoconf is to fail configure if a dependency is not found, but this is unhelpful in an environment that has 47 zillion make targets that aren't directly connected to compling a program. Instead of failing, print a message about missing dependencies at the end of the ./configure with some ***'s, but still exit with a status 0 and let the Makefiles be generated. Any missing dependencies will cause a failure during `make', and other targets like `make dist' will still work. --- acinclude.m4 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 17 +++++++----- widgets/acinclude.m4 | 1 + widgets/configure.ac | 31 +++++++++++++++------- 4 files changed, 107 insertions(+), 17 deletions(-) create mode 100644 acinclude.m4 create mode 120000 widgets/acinclude.m4
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..61eb1a8 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,75 @@ +dnl autoconf macros for anaconda +dnl +dnl Copyright (C) 2014 Red Hat, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU Lesser General Public License as published +dnl by the Free Software Foundation; either version 2.1 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public License +dnl along with this program. If not, see http://www.gnu.org/licenses/. +dnl +dnl Author: David Shea dshea@redhat.com + +dnl ANACONDA_SOFT_FAILURE(MESSAGE) +dnl +dnl Store a message that in some contexts could be considered indicative +dnl of a failure, but in other contexts could be indicative of who cares. +dnl +dnl For example, the anaconda widgets require a version of gtk3-devel of +dnl particular newness, and the widgets will fail to build if this library +dnl and headers are not available. On the other hand, gtk3 isn't required at +dnl all for most everything else, so it would be nice if a missing or old +dnl gtk3-devel didn't halt the configure script. +dnl +dnl Any message sent to this macro will be stored, and they can all be +dnl displayed at the end of configure using the ANACONDA_FAILURES macro. +AC_DEFUN([ANACONDA_SOFT_FAILURE], [dnl +AS_IF([test x"$anaconda_failure_messages" = x], + [anaconda_failure_messages="[$1]"], + [anaconda_failure_messages="$anaconda_failure_messages +[$1]" +])])dnl + +dnl ANACONDA_PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES) +dnl +dnl Check whether a module is available, using pkg-config. Instead of failing +dnl if a module is not found, store the failure in a message that can be +dnl printed using the ANACONDA_FAILURES macro. +dnl +dnl The syntax and behavior of VARIABLE-PREFIX and MODULES is the same as for +dnl PKG_CHECK_MODULES. +AC_DEFUN([ANACONDA_PKG_CHECK_MODULES], [dnl +PKG_CHECK_MODULES([$1], [$2], [], [ANACONDA_SOFT_FAILURE($[$1]_PKG_ERRORS)]) +])dnl + +dnl ANACONDA_PKG_CHECK_EXISTS(MODULES) +dnl +dnl Check whether a module exists, using pkg-config. Instead of failing +dnl if a module is not found, store the failure in a message that can be +dnl printed using the ANACONDA_FAILURES macro. +dnl +dnl The syntax and behavior of MOUDLES is the same as for +dnl PKG_CHECK_EXISTS. +AC_DEFUN([ANACONDA_PKG_CHECK_EXISTS], [dnl +PKG_CHECK_EXISTS([$1], [], [ANACONDA_SOFT_FAILURE([Check for $1 failed])]) +])dnl + +dnl ANACONDA_FAILURES +dnl +dnl Print the failure messages collected by ANACONDA_SOFT_FAILURE and +dnl ANACONDA_PKG_CHECK_MODULES +AC_DEFUN([ANACONDA_FAILURES], [dnl +AS_IF([test x"$anaconda_failure_messages" = x], [], [dnl +echo "" +echo "*** Anaconda encountered the following issues during configuration:" +echo "$anaconda_failure_messages" +echo "" +echo "*** Anaconda will not successfully build without these missing dependencies" +])])dnl diff --git a/configure.ac b/configure.ac index d9bf184..e537da2 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ AC_PROG_MKDIR_P AC_PATH_PROG([INTLTOOL_EXTRACT], [intltool-extract]) AC_PATH_PROG([INTLTOOL_MERGE], [intltool-merge]) AS_IF([test -z "$INTLTOOL_EXTRACT" -o -z "$INTLTOOL_MERGE"], - [AC_MSG_ERROR([*** intltool not found])]) + [ANACONDA_SOFT_FAILURE([intltool not found])])
# Add the bits for Makefile rules INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' @@ -70,7 +70,7 @@ AM_GNU_GETTEXT_VERSION([0.18.3]) # Checks for header files. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h], [], - [AC_MSG_FAILURE([*** Header file $ac_header not found.])], + [ANACONDA_SOFT_FAILURE([Header file $ac_header not found.])], [])
# Checks for typedefs, structures, and compiler characteristics. @@ -84,7 +84,7 @@ AC_TYPE_INT64_T AC_FUNC_FORK AC_CHECK_FUNCS([getcwd memset mkdir strchr strdup], [], - [AC_MSG_FAILURE([*** Required function $ac_func not found.])]) + [ANACONDA_SOFT_FAILURE([Function $ac_func not found.])])
AM_PATH_PYTHON(python_required_version)
@@ -96,14 +96,14 @@ PKG_CHECK_MODULES([PYTHON], [python], [ AC_TRY_LINK_FUNC([Py_Initialize], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_FAILURE([*** Unable to use python library])]) + ANACONDA_SOFT_FAILURE([Unable to use python library])]) LIBS="$LIBS_save" ], - [AC_MSG_FAILURE([*** Unable to find python library])]) + [ANACONDA_SOFT_FAILURE([Unable to find python library])])
# Check for libraries we need that provide pkg-config scripts -PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) -PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4]) +ANACONDA_PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) +ANACONDA_PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4])
# GCC likes to bomb out on some ridiculous warnings. Add your favorites # here. @@ -176,3 +176,6 @@ AC_CONFIG_FILES([Makefile utils/Makefile utils/dd/Makefile]) AC_OUTPUT + +# Gently advise the user about the build failures they are about to encounter +ANACONDA_FAILURES diff --git a/widgets/acinclude.m4 b/widgets/acinclude.m4 new file mode 120000 index 0000000..d84c32a --- /dev/null +++ b/widgets/acinclude.m4 @@ -0,0 +1 @@ +../acinclude.m4 \ No newline at end of file diff --git a/widgets/configure.ac b/widgets/configure.ac index cbdc079..73a6151 100644 --- a/widgets/configure.ac +++ b/widgets/configure.ac @@ -40,21 +40,29 @@ AM_GNU_GETTEXT([external])
dnl Make sure that autoconf fails if the gobject-introspection macro dnl is not expanded. -m4_pattern_forbid([GOBJECT_INTROSPECTION_CHECK])dnl -GOBJECT_INTROSPECTION_CHECK([0.6.7]) +m4_ifdef([GOBJECT_INTROSPECTION_CHECK], +[GOBJECT_INTROSPECTION_CHECK([0.6.7])], +[found_introspection=no +AM_CONDITIONAL(HAVE_INTROSPECTION, false)])
-# Fail if introspection was not enabled +# Complain if introspection was not enabled AS_IF([test "x$found_introspection" = xyes], [:], - [AC_MSG_ERROR([*** GObject introspection must be enabled])]) + [ANACONDA_SOFT_FAILURE([GObject introspection must be enabled])])
-PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) -PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) -PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) -PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30]) +ANACONDA_PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) +ANACONDA_PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) +ANACONDA_PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) +ANACONDA_PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30])
-AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h]) +AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h], + [], + [ANACONDA_SOFT_FAILURE([Header file $ac_header not found.])], + []) + +AC_CHECK_FUNCS([setenv setlocale], + [], + [ANACONDA_SOFT_FAILURE([Function $ac_func not found.])])
-AC_CHECK_FUNCS([setenv setlocale]) AC_CONFIG_FILES([Makefile glade/Makefile src/Makefile @@ -62,3 +70,6 @@ AC_CONFIG_FILES([Makefile data/Makefile data/pixmaps/Makefile]) AC_OUTPUT + +# Gently advise the user about the build failures they are about to encounter +ANACONDA_FAILURES
On Thu, 2014-07-24 at 17:44 -0400, David Shea wrote:
(this version makes gobject-introspection-devel optional)
The usual paradigm in autoconf is to fail configure if a dependency is not found, but this is unhelpful in an environment that has 47 zillion make targets that aren't directly connected to compling a program. Instead of failing, print a message about missing dependencies at the end of the ./configure with some ***'s, but still exit with a status 0 and let the Makefiles be generated. Any missing dependencies will cause a failure during `make', and other targets like `make dist' will still work.
acinclude.m4 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 17 +++++++----- widgets/acinclude.m4 | 1 + widgets/configure.ac | 31 +++++++++++++++------- 4 files changed, 107 insertions(+), 17 deletions(-) create mode 100644 acinclude.m4 create mode 120000 widgets/acinclude.m4
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..61eb1a8 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,75 @@ +dnl autoconf macros for anaconda +dnl +dnl Copyright (C) 2014 Red Hat, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU Lesser General Public License as published +dnl by the Free Software Foundation; either version 2.1 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public License +dnl along with this program. If not, see http://www.gnu.org/licenses/. +dnl +dnl Author: David Shea dshea@redhat.com
+dnl ANACONDA_SOFT_FAILURE(MESSAGE) +dnl +dnl Store a message that in some contexts could be considered indicative +dnl of a failure, but in other contexts could be indicative of who cares. +dnl +dnl For example, the anaconda widgets require a version of gtk3-devel of +dnl particular newness, and the widgets will fail to build if this library +dnl and headers are not available. On the other hand, gtk3 isn't required at +dnl all for most everything else, so it would be nice if a missing or old +dnl gtk3-devel didn't halt the configure script. +dnl +dnl Any message sent to this macro will be stored, and they can all be +dnl displayed at the end of configure using the ANACONDA_FAILURES macro. +AC_DEFUN([ANACONDA_SOFT_FAILURE], [dnl +AS_IF([test x"$anaconda_failure_messages" = x],
- [anaconda_failure_messages="[$1]"],
- [anaconda_failure_messages="$anaconda_failure_messages
+[$1]" +])])dnl
+dnl ANACONDA_PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES) +dnl +dnl Check whether a module is available, using pkg-config. Instead of failing +dnl if a module is not found, store the failure in a message that can be +dnl printed using the ANACONDA_FAILURES macro. +dnl +dnl The syntax and behavior of VARIABLE-PREFIX and MODULES is the same as for +dnl PKG_CHECK_MODULES. +AC_DEFUN([ANACONDA_PKG_CHECK_MODULES], [dnl +PKG_CHECK_MODULES([$1], [$2], [], [ANACONDA_SOFT_FAILURE($[$1]_PKG_ERRORS)]) +])dnl
+dnl ANACONDA_PKG_CHECK_EXISTS(MODULES) +dnl +dnl Check whether a module exists, using pkg-config. Instead of failing +dnl if a module is not found, store the failure in a message that can be +dnl printed using the ANACONDA_FAILURES macro. +dnl +dnl The syntax and behavior of MOUDLES is the same as for +dnl PKG_CHECK_EXISTS. +AC_DEFUN([ANACONDA_PKG_CHECK_EXISTS], [dnl +PKG_CHECK_EXISTS([$1], [], [ANACONDA_SOFT_FAILURE([Check for $1 failed])]) +])dnl
+dnl ANACONDA_FAILURES +dnl +dnl Print the failure messages collected by ANACONDA_SOFT_FAILURE and +dnl ANACONDA_PKG_CHECK_MODULES +AC_DEFUN([ANACONDA_FAILURES], [dnl +AS_IF([test x"$anaconda_failure_messages" = x], [], [dnl +echo "" +echo "*** Anaconda encountered the following issues during configuration:" +echo "$anaconda_failure_messages" +echo "" +echo "*** Anaconda will not successfully build without these missing dependencies" +])])dnl diff --git a/configure.ac b/configure.ac index d9bf184..e537da2 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ AC_PROG_MKDIR_P AC_PATH_PROG([INTLTOOL_EXTRACT], [intltool-extract]) AC_PATH_PROG([INTLTOOL_MERGE], [intltool-merge]) AS_IF([test -z "$INTLTOOL_EXTRACT" -o -z "$INTLTOOL_MERGE"],
[AC_MSG_ERROR([*** intltool not found])])
[ANACONDA_SOFT_FAILURE([intltool not found])])# Add the bits for Makefile rules INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' @@ -70,7 +70,7 @@ AM_GNU_GETTEXT_VERSION([0.18.3]) # Checks for header files. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h], [],
[AC_MSG_FAILURE([*** Header file $ac_header not found.])],
[ANACONDA_SOFT_FAILURE([Header file $ac_header not found.])], [])# Checks for typedefs, structures, and compiler characteristics. @@ -84,7 +84,7 @@ AC_TYPE_INT64_T AC_FUNC_FORK AC_CHECK_FUNCS([getcwd memset mkdir strchr strdup], [],
[AC_MSG_FAILURE([*** Required function $ac_func not found.])])
[ANACONDA_SOFT_FAILURE([Function $ac_func not found.])])AM_PATH_PYTHON(python_required_version)
@@ -96,14 +96,14 @@ PKG_CHECK_MODULES([PYTHON], [python], [ AC_TRY_LINK_FUNC([Py_Initialize], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])
AC_MSG_FAILURE([*** Unable to use python library])])
LIBS="$LIBS_save" ],ANACONDA_SOFT_FAILURE([Unable to use python library])])
- [AC_MSG_FAILURE([*** Unable to find python library])])
- [ANACONDA_SOFT_FAILURE([Unable to find python library])])
# Check for libraries we need that provide pkg-config scripts -PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) -PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4]) +ANACONDA_PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0]) +ANACONDA_PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4])
# GCC likes to bomb out on some ridiculous warnings. Add your favorites # here. @@ -176,3 +176,6 @@ AC_CONFIG_FILES([Makefile utils/Makefile utils/dd/Makefile]) AC_OUTPUT
+# Gently advise the user about the build failures they are about to encounter +ANACONDA_FAILURES diff --git a/widgets/acinclude.m4 b/widgets/acinclude.m4 new file mode 120000 index 0000000..d84c32a --- /dev/null +++ b/widgets/acinclude.m4 @@ -0,0 +1 @@ +../acinclude.m4 \ No newline at end of file diff --git a/widgets/configure.ac b/widgets/configure.ac index cbdc079..73a6151 100644 --- a/widgets/configure.ac +++ b/widgets/configure.ac @@ -40,21 +40,29 @@ AM_GNU_GETTEXT([external])
dnl Make sure that autoconf fails if the gobject-introspection macro dnl is not expanded. -m4_pattern_forbid([GOBJECT_INTROSPECTION_CHECK])dnl -GOBJECT_INTROSPECTION_CHECK([0.6.7]) +m4_ifdef([GOBJECT_INTROSPECTION_CHECK], +[GOBJECT_INTROSPECTION_CHECK([0.6.7])], +[found_introspection=no +AM_CONDITIONAL(HAVE_INTROSPECTION, false)])
-# Fail if introspection was not enabled +# Complain if introspection was not enabled AS_IF([test "x$found_introspection" = xyes], [:],
[AC_MSG_ERROR([*** GObject introspection must be enabled])])
[ANACONDA_SOFT_FAILURE([GObject introspection must be enabled])])-PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) -PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) -PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) -PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30]) +ANACONDA_PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10]) +ANACONDA_PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3]) +ANACONDA_PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1]) +ANACONDA_PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30])
-AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h]) +AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h locale.h],
[],[ANACONDA_SOFT_FAILURE([Header file $ac_header not found.])],[])+AC_CHECK_FUNCS([setenv setlocale],
[],[ANACONDA_SOFT_FAILURE([Function $ac_func not found.])])-AC_CHECK_FUNCS([setenv setlocale]) AC_CONFIG_FILES([Makefile glade/Makefile src/Makefile @@ -62,3 +70,6 @@ AC_CONFIG_FILES([Makefile data/Makefile data/pixmaps/Makefile]) AC_OUTPUT
+# Gently advise the user about the build failures they are about to encounter +ANACONDA_FAILURES
Taking this as a piece of black magic that I hope will work and not hurt.
On Thu, 2014-07-24 at 15:32 -0400, David Shea wrote:
The big change is that this gets rid of gtk-doc. gtk-doc mostly just makes things harder for us, so let's just not use it anymore. This will hopefully make things easier for those of you making and testing builds, since it means that you no longer need to run `make' before `make dist'. ./configure and `make po-pull' are still necessary. ./configure --enable-gtk-doc will fail, because there's no --enable-gtk-doc anymore.
Other than that, add some things to some autotools files, remove some things, and do the tests in such a way that missing dependencies don't cause the configure script to fail. If you're just running `make dist' you don't really care whether or not gtk3-devel-3.very-latest is installed or not. gettext and gobject-introspection-devel are still required in order for autogen.sh to run, but intltool and the rest of the g* things are no longer hard requirements.
Apart from leaving no way to build the docs these patches look good to me. Well, with my limitted understanding of all the autotools magic. Definitely a step in the right direction.
anaconda-patches@lists.fedorahosted.org