File: codadef.m4

package info (click to toggle)
harp 1.5%2Bdata-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,032 kB
  • sloc: xml: 286,510; ansic: 143,710; yacc: 1,910; python: 913; makefile: 600; lex: 574; sh: 69
file content (30 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# ST_CODADEF_VERSION(definitions_dir, product_class)
# --------------------------------------------------
# Determine version number of codadef files
AC_DEFUN([ST_CODADEF_VERSION],
[if test -d [$]srcdir/$1/$2 ; then
files=`find [$]srcdir/$1/$2 [$]srcdir/$1/$2/types [$]srcdir/$1/$2/products -maxdepth 1 -name "*.xml"`
CODADEF_VERSION_$2=`(for file in $files ; do grep last-modified $file | head -1 ; done) | sed -e 's:^.*last-modified=\"\([[^"]]*\).*$:\1:' | sort -r | head -1 | sed 's:-::g'`
else
file=`ls [$]srcdir/$1/$2-*.codadef | sort -r | head -1`
if test -z "$file" ; then
  echo Cannot find .codadef file for $2 in [$]srcdir/$1
  exit 1
fi
CODADEF_VERSION_$2=`basename $file | sed -e "s:$2-\(.*\).codadef:\1:"`
fi
AC_SUBST(CODADEF_VERSION_$2)
AC_SUBST(CODADEF_FILE_$2, $2-${CODADEF_VERSION_$2}.codadef)
AC_SUBST(CODADEF_RULE_$2,
['
$1/$2-${CODADEF_VERSION_$2}.codadef:
	test -d $1 || [$](mkinstalldirs) $1
	@[$](CODADEFSH) [$](srcdir)/$1/$2 $1
	@if test ! -f $1/$2-${CODADEF_VERSION_$2}.codadef ; then \
	  echo $1/$2-${CODADEF_VERSION_$2}.codadef not created. ; \
	  echo run "./config.status --recheck" to update the .codadef version reference. ; \
	  exit 1 ; \
	 fi
'])
AM_SUBST_NOTMAKE(CODADEF_RULE_$2)
])# ST_CODADEF_VERSION