1 # ***************************************************************************
4 # ***************************************************************************
5 # awk script which fetches c-ares version number and string from input
6 # file and writes them to STDOUT. Here you can get an awk version for Win32:
7 # http://www.gknw.net/development/prgtools/awk-20100523.zip
10 while ((getline < ARGV[1]) > 0) {
11 sub("\r", "") # make MSYS gawk work with CRLF header input.
12 if (match ($0, /^#define ARES_COPYRIGHT "[^"]+"$/))
13 copyright_string = substr($0, 25, length($0)-25)
14 else if (match ($0, /^#define ARES_VERSION_STR "[^"]+"$/))
15 version_string = substr($3, 2, length($3)-2)
16 else if (match ($0, /^#define ARES_VERSION_MAJOR [0-9]+$/))
18 else if (match ($0, /^#define ARES_VERSION_MINOR [0-9]+$/))
20 else if (match ($0, /^#define ARES_VERSION_PATCH [0-9]+$/))
23 print "LIBCARES_VERSION = " version_major "," version_minor "," version_patch
24 print "LIBCARES_VERSION_STR = " version_string
25 print "LIBCARES_COPYRIGHT_STR = " copyright_string