summaryrefslogtreecommitdiff
path: root/maketgz
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-10-24 13:02:09 (GMT)
committerDaniel Stenberg <daniel@haxx.se>2004-10-24 13:02:09 (GMT)
commit902015cfd982aaefb7819d525bc7c292f6b47e80 (patch)
treec3901c58cf3a50ee344319601f8d138707666689 /maketgz
parent9b9d36f8484596593ed65022d2a81da3042d4c8e (diff)
downloadc-ares-902015cfd982aaefb7819d525bc7c292f6b47e80.zip
c-ares-902015cfd982aaefb7819d525bc7c292f6b47e80.tar.gz
c-ares-902015cfd982aaefb7819d525bc7c292f6b47e80.tar.bz2
maketgz now creates a ares_version.h.dist file with the given version data
properly set, and the Makefile.am is now fixed to use that when building a new package with make dist.
Diffstat (limited to 'maketgz')
-rwxr-xr-xmaketgz21
1 files changed, 21 insertions, 0 deletions
diff --git a/maketgz b/maketgz
index 224079a..6abe3f1 100755
--- a/maketgz
+++ b/maketgz
@@ -12,6 +12,27 @@ if(!-f "ares.h") {
exit;
}
+my ($major, $minor, $patch)=split(/\./, $version);
+
+$major += 0;
+$minor += 0;
+$patch += 0;
+
+open(VER, "<ares_version.h") ||
+ die "can't open ares_version.h";
+open(NEWV, ">ares_version.h.dist");
+while(<VER>) {
+ $_ =~ s/^\#define ARES_VERSION_MAJOR .*/\#define ARES_VERSION_MAJOR $major/;
+ $_ =~ s/^\#define ARES_VERSION_MINOR .*/\#define ARES_VERSION_MINOR $minor/;
+ $_ =~ s/^\#define ARES_VERSION_PATCH .*/\#define ARES_VERSION_PATCH $patch/;
+ $_ =~ s/^\#define ARES_VERSION_STR .*/\#define ARES_VERSION_STR \"$version\"/;
+
+ print NEWV $_;
+}
+close(VER);
+close(NEWV);
+print "ares_version.h.dist created\n";
+
if(!-f "configure") {
print "running buildconf\n";
`./buildconf`;