From: Stepan Kasal Date: Wed, 17 Aug 2005 12:13:16 +0000 (+0000) Subject: New function, prevents duplicates in $cm_macrodirs. (check_m4macros): Use X-Git-Tag: gnome-2-12-anchor~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07e892143d1ded887fee9a6f5f19938e68570f3c;p=platform%2Fupstream%2Fgnome-common.git New function, prevents duplicates in $cm_macrodirs. (check_m4macros): Use 2005-08-17 Stepan Kasal * macros2/gnome-autogen.sh (add_to_cm_macrodirs): New function, prevents duplicates in $cm_macrodirs. (check_m4macros): Use it. Read the dirlist file, if it is supported by the version of Automake actually in use. svn path=/trunk/; revision=3605 --- diff --git a/ChangeLog b/ChangeLog index 61d34af..8a1f348 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2005-08-17 Stepan Kasal + * macros2/gnome-autogen.sh (add_to_cm_macrodirs): New function, + prevents duplicates in $cm_macrodirs. + (check_m4macros): Use it. Read the dirlist file, if it is supported + by the version of Automake actually in use. + +2005-08-17 Stepan Kasal + * macros2/gnome-autogen.sh (version_check): Set $variable_VERSION to the actual version number of the tool. diff --git a/macros2/gnome-autogen.sh b/macros2/gnome-autogen.sh index fb32eb8..54c8e32 100644 --- a/macros2/gnome-autogen.sh +++ b/macros2/gnome-autogen.sh @@ -131,16 +131,42 @@ forbid_m4macro() { } # Usage: +# add_to_cm_macrodirs dirname +# Adds the dir to $cm_macrodirs, if it's not there yet. +add_to_cm_macrodirs() { + case $cm_macrodirs in + "$1 "* | *" $1 "* | *" $1") ;; + *) cm_macrodirs="$cm_macrodirs $1";; + esac +} + +# Usage: # check_m4macros # Checks that all the requested macro files are in the aclocal macro path # Uses REQUIRED_M4MACROS and ACLOCAL variables. check_m4macros() { # construct list of macro directories - cm_macrodirs="`$ACLOCAL --print-ac-dir`" + cm_macrodirs=`$ACLOCAL --print-ac-dir` + # aclocal also searches a version specific dir, eg. /usr/share/aclocal-1.9 + # but it contains only Automake's own macros, so we can ignore it. + + # Read the dirlist file, supported by Automake >= 1.7. + if compare_versions 1.7 $AUTOMAKE_VERSION && [ -s $cm_macrodirs/dirlist ]; then + cm_dirlist=`sed 's/[ ]*#.*//;/^$/d' $cm_macrodirs/dirlist` + if [ -n "$cm_dirlist" ] ; then + for cm_dir in $cm_dirlist; do + if [ -d $cm_dir ]; then + add_to_cm_macrodirs $cm_dir + fi + done + fi + fi + + # Parse $ACLOCAL_FLAGS set - $ACLOCAL_FLAGS while [ $# -gt 0 ]; do if [ "$1" = "-I" ]; then - cm_macrodirs="$cm_macrodirs $2" + add_to_cm_macrodirs "$2" shift fi shift