Jim Meyering
2008-Oct-09 15:16 UTC
[Ovirt-devel] [PATCH *all-7*] autogen.sh: run autoheader and libtool only if needed
This makes it so autogen.sh (all 7 modules) no longer runs autoheader unnecessarily (suggestion from Alan Pevec). Also, it skips the check for libtool when it's not needed. [it's not needed in any of these modules] I tested it by running this: for i in *; do test -d $i/.git && (cd $i && ./autogen.sh); done and ensuring there were no errors.>From b2eaec5c40bb3bd5c63baca9513dade17cae510a Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Thu, 9 Oct 2008 17:03:56 +0200 Subject: [PATCH appliance] autogen.sh: run autoheader and libtool only if needed --- autogen.sh | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 8e77f25..6b0970f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,17 @@ THEDIR=`pwd` die=1 } - (libtool --version) < /dev/null > /dev/null 2>&1 || { + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" die=1 + } } (automake --version) < /dev/null > /dev/null 2>&1 || { @@ -46,7 +51,10 @@ THEDIR=`pwd` fi aclocal - autoheader + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + automake --add-missing autoconf ./configure "$@" -- 1.6.0.2.304.gc76d>From 9621960dd03f2204f4a968ba9afac49ea3e0dc7a Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Thu, 9 Oct 2008 17:03:56 +0200 Subject: [PATCH docs] autogen.sh: run autoheader and libtool only if needed --- autogen.sh | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 234141b..74fc1e2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,17 @@ THEDIR=`pwd` die=1 } - (libtool --version) < /dev/null > /dev/null 2>&1 || { + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" die=1 + } } (automake --version) < /dev/null > /dev/null 2>&1 || { @@ -46,7 +51,10 @@ THEDIR=`pwd` fi aclocal - autoheader + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + automake --add-missing autoconf ./configure "$@" -- 1.6.0.2.304.gc76d>From e732750ce270975bc6ae338ff0728dbedfa6193d Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Thu, 9 Oct 2008 17:03:56 +0200 Subject: [PATCH node] autogen.sh: run autoheader and libtool only if needed --- autogen.sh | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index d018b64..5fd5c2f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,17 @@ THEDIR=`pwd` die=1 } - (libtool --version) < /dev/null > /dev/null 2>&1 || { + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" die=1 + } } (automake --version) < /dev/null > /dev/null 2>&1 || { @@ -46,7 +51,10 @@ THEDIR=`pwd` fi aclocal - autoheader + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + automake --add-missing autoconf ./configure "$@" -- 1.6.0.2.304.gc76d>From 82e8c9d6bc8a2b7fd215074f4bccc3b3344bff5d Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Thu, 9 Oct 2008 17:03:56 +0200 Subject: [PATCH node-image] autogen.sh: run autoheader and libtool only if needed --- autogen.sh | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index a2b0f89..e4b75c2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,17 @@ THEDIR=`pwd` die=1 } - (libtool --version) < /dev/null > /dev/null 2>&1 || { + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" die=1 + } } (automake --version) < /dev/null > /dev/null 2>&1 || { @@ -46,7 +51,10 @@ THEDIR=`pwd` fi aclocal - autoheader + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + automake --add-missing autoconf ./configure "$@" -- 1.6.0.2.304.gc76d>From ea981202624fe8600d9adb143e1a0984dc511267 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Thu, 9 Oct 2008 17:03:56 +0200 Subject: [PATCH recipe] autogen.sh: run autoheader and libtool only if needed --- autogen.sh | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 02a4ca2..34b0e47 100755 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,17 @@ THEDIR=`pwd` die=1 } - (libtool --version) < /dev/null > /dev/null 2>&1 || { + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" die=1 + } } (automake --version) < /dev/null > /dev/null 2>&1 || { @@ -46,7 +51,10 @@ THEDIR=`pwd` fi aclocal - autoheader + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + automake --add-missing autoconf ./configure "$@" -- 1.6.0.2.304.gc76d>From a3825ffe53956f46981daa6776943b5d65c71aeb Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Thu, 9 Oct 2008 17:03:56 +0200 Subject: [PATCH release] autogen.sh: run autoheader and libtool only if needed --- autogen.sh | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index cca9761..af6ff67 100755 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,17 @@ THEDIR=`pwd` die=1 } - (libtool --version) < /dev/null > /dev/null 2>&1 || { + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" die=1 + } } (automake --version) < /dev/null > /dev/null 2>&1 || { @@ -46,7 +51,10 @@ THEDIR=`pwd` fi aclocal - autoheader + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + automake --add-missing autoconf ./configure "$@" -- 1.6.0.2.304.gc76d>From d8d0db5e0d902e779c89a81426a0340249ae8e8e Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Thu, 9 Oct 2008 17:03:56 +0200 Subject: [PATCH server] autogen.sh: run autoheader and libtool only if needed --- autogen.sh | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 7f0ca85..68ef0d8 100755 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,17 @@ THEDIR=`pwd` die=1 } - (libtool --version) < /dev/null > /dev/null 2>&1 || { + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have libtool installed." echo "Download the appropriate package for your distribution," echo "or see http://www.gnu.org/software/libtool" die=1 + } } (automake --version) < /dev/null > /dev/null 2>&1 || { @@ -46,7 +51,10 @@ THEDIR=`pwd` fi aclocal - autoheader + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + automake --add-missing autoconf ./configure "$@" -- 1.6.0.2.304.gc76d
Jim Meyering
2008-Oct-09 18:51 UTC
[Ovirt-devel] [PATCH *all-7*] autogen.sh: run autoheader and libtool only if needed
Jim Meyering <jim at meyering.net> wrote:> This makes it so autogen.sh (all 7 modules) no longer > runs autoheader unnecessarily (suggestion from Alan Pevec). > Also, it skips the check for libtool when it's not needed. > [it's not needed in any of these modules] > > I tested it by running this: > > for i in *; do test -d $i/.git && (cd $i && ./autogen.sh); done > > and ensuring there were no errors.I've just pushed those.