[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble with variable substitution
From: |
Gary V. Vaughan |
Subject: |
Re: Trouble with variable substitution |
Date: |
Wed, 28 Jan 2004 10:01:27 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
martin f krafft wrote:
| Hi there, I am trying to do the following:
|
| AC_INIT(libhid, 0.1.91.0.0, address@hidden)
|
| LIBHID_MAJOR_VERSION=`echo $AC_PACKAGE_VERSION | cut -d. -f1`
| LIBHID_MINOR_VERSION=`echo $AC_PACKAGE_VERSION | cut -d. -f2`
| LIBHID_MICRO_VERSION=`echo $AC_PACKAGE_VERSION | cut -d. -f3`
| LIBHID_INTERFACE_AGE=`echo $AC_PACKAGE_VERSION | cut -d. -f4`
| LIBHID_BINARY_AGE=`echo $AC_PACKAGE_VERSION | cut -d. -f5`
| LIBHID_VERSION=`echo $AC_PACKAGE_VERSION | cut -d. -f1-3`
|
| PACKAGE=AC_PACKAGE_NAME
| VERSION=LIBHID_VERSION
~From libtool configure.ac (which uses maj.min[.mic][alpha]):
LT_MAJOR=`echo "AC_PACKAGE_VERSION" | sed ['s,\..*$,,g']`
LT_MINOR=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.\([0-9]*\).*$,\1,']`
LT_MICRO=`echo "AC_PACKAGE_VERSION" \
| sed ['s,^[0-9]*\.[0-9]*\(\.[0-9]*\).*$,\1,']`
LT_ALPHA=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9.]*,,']`
Note the lack of $AC_PACKAGE_VERSION, AC_PACKAGE_VERSION is an m4 macro!
After this you could add, say:
VERSION=$LT_MAJOR.$LT_MINOR.$LT_MICRO
HTH,
Gary.
- --
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://www.oranda.demon.co.uk
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAF4h3FRMICSmD1gYRAgNaAKCQg7sQ4VhXZ9XuQpwoKPFi9R9xrgCfTFlW
DJ/yxZREukedlcPzetSo5qk=
=pPF6
-----END PGP SIGNATURE-----