[libvirt] [glib PATCH 1/2] autogen.sh: Simplify autogen.sh

Michal Prívozník mprivozn at redhat.com
Sat May 25 07:16:23 UTC 2019


On 5/24/19 5:32 PM, Fabiano Fidêncio wrote:
> Let's use an autogen.sh based on libosinfo's one, which is cleaner and
> matches the current GNOME guidelines.
> 
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
>  .gitignore |  3 +++
>  autogen.sh | 70 +++++++++++++++++++-----------------------------------
>  2 files changed, 28 insertions(+), 45 deletions(-)
> 
> diff --git a/.gitignore b/.gitignore
> index de89c4d..4b9467e 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -19,11 +19,14 @@ Makefile.in
>  *.la
>  *~
>  *.orig
> +m4/gtk-doc.m4
> +m4/introspection.m4
>  m4/ltsugar.m4
>  m4/lt~obsolete.m4
>  m4/libtool.m4
>  m4/ltversion.m4
>  m4/ltoptions.m4
> +m4/pkg.m4
>  autom4te.cache
>  config.*
>  COPYING
> diff --git a/autogen.sh b/autogen.sh
> index 3b593ce..c679131 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -1,57 +1,37 @@
>  #!/bin/sh
>  # Run this to generate all the initial makefiles, etc.
> +test -n "$srcdir" || srcdir=$(dirname "$0")
> +test -n "$srcdir" || srcdir=.
>  
> -set -e
> -srcdir=`dirname $0`
> -test -z "$srcdir" && srcdir=.
> +olddir=$(pwd)
>  
> -THEDIR=`pwd`
> -cd $srcdir
> +cd "$srcdir"
>  
> -DIE=0
> -
> -for prog in autoreconf automake autoconf libtoolize
> -do
> -    ($prog --version) < /dev/null > /dev/null 2>&1 || {
> -        echo
> -        echo "You must have $prog installed to compile libvirt-glib."
> -        DIE=1
> -    }
> -done
> -
> -if test "$DIE" -eq 1; then
> -        exit 1
> -fi
> -
> -if test -z "$*"; then
> -        echo "I am going to run ./configure with no args - if you "
> -        echo "wish to pass any extra arguments to it, please specify them on "
> -        echo "the $0 command line."
> -fi
> +(test -f libvirt-glib/libvirt-glib-main.c) || {
> +    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
> +    echo " top-level libvirt-glib directory"
> +    exit 1
> +}
>  
>  # Real ChangeLog/AUTHORS is auto-generated from GIT logs at
>  # make dist time, but automake requires that it
>  # exists at all times :-(
>  touch ChangeLog AUTHORS
>  
> -mkdir -p build-aux
> -autoreconf -if
> -
> -cd $THEDIR
> -
> -if test "x$1" = "x--system"; then

Please keep this in. It's a nice shortcut that's standardized through
libvirt projects. it's nice to have an argument that sets all them paths:

> -    shift
> -    prefix=/usr
> -    libdir=$prefix/lib
> -    sysconfdir=/etc
> -    localstatedir=/var
> -    if [ -d /usr/lib64 ]; then
> -      libdir=$prefix/lib64
> -    fi
> -    EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
> -fi

Otherwise looking good.

Michal




More information about the libvir-list mailing list