From fb1f70ee05886de87c061c4e7a76a01c3bdbb8dd Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 5 Feb 2024 21:45:04 +0100 Subject: [PATCH] Add a check for yelp-tools to autogen.sh. Also mention this in the README.md. Fixes #143 --- README.md | 4 ++-- autogen.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6a5117fba..b854260ab 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ modelled after the windows only, closed source application called Buzz. ## building from git To build use autogen.sh instead of configure. This accept the same options like configure. Later one can use autoregen.sh to rerun the bootstrapping. -To build from git one needs to have gtk-doc and cvs (for autopoint from gettext) -installed. +To build from git one needs to have gtk-doc, yelp-tools and cvs (for autopoint +from gettext) installed. ## directories * docs : design ideas and API reference diff --git a/autogen.sh b/autogen.sh index 9f37e0d17..8a3b7e909 100755 --- a/autogen.sh +++ b/autogen.sh @@ -128,6 +128,45 @@ version_check () return 1; } +path_check () +{ + PACKAGE=$1 + COMMAND=$2 + URL=$3 + + test -z "$NOCHECK" && { + echo -n " checking for $PACKAGE ... " + } || { + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + } + + LOC=$(which 2>/dev/null $COMMAND) + if test ! -z "$LOC"; then + echo "ok." + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + else + echo "not ok !" + fi + + if test ! -z "$URL"; then + echo "not found !" + echo "You must have $PACKAGE installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at $URL" + fi + return 1; +} + aclocal_check () { # normally aclocal is part of automake @@ -321,6 +360,9 @@ version_check "libtoolize" "libtoolize glibtoolize" \ version_check "pkg-config" "" \ "ftp://ftp.gnome.org/pub/gnome/sources/pkgconfig/" 0 8 0 || DIE=1 +path_check "yelp-tools" "yelp-check" \ + "ftp://ftp.gnome.org/pub/gnome/sources/yelp-tools" || DIE=1 + die_check $DIE aclocal_check || DIE=1