diff options
author | Stepan Kasal <kasal@ucw.cz> | 2005-08-17 12:13:16 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2005-08-17 12:13:16 +0000 |
commit | 07e892143d1ded887fee9a6f5f19938e68570f3c (patch) | |
tree | c079d6126cefd6c00af46e0af0407568e3eaf861 | |
parent | 31c9a5dc170a0921a43ad4b6c994a3705361ffb0 (diff) | |
download | gnome-common-07e892143d1ded887fee9a6f5f19938e68570f3c.tar.gz |
New function, prevents duplicates in $cm_macrodirs. (check_m4macros): Use
2005-08-17 Stepan Kasal <kasal@ucw.cz>
* 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
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | macros2/gnome-autogen.sh | 30 |
2 files changed, 35 insertions, 2 deletions
@@ -1,5 +1,12 @@ 2005-08-17 Stepan Kasal <kasal@ucw.cz> + * 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 <kasal@ucw.cz> + * 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 |