aboutsummaryrefslogtreecommitdiff
path: root/maketgz
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-11-06 11:34:19 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-11-06 11:34:19 +0000
commit472c4d86167f71261b5f7fd577fd84be19d9a4e1 (patch)
tree44d1383dd21a27b1d05daea50396ae66ec456600 /maketgz
parent45abf75e1ee8f94be0bc42eb2db8118f545dd2d7 (diff)
Insert the major, minor and patch numbers into the curl/curl.h header as
well. Removed the depedency on perl.
Diffstat (limited to 'maketgz')
-rwxr-xr-xmaketgz17
1 files changed, 9 insertions, 8 deletions
diff --git a/maketgz b/maketgz
index b22c2fbcd..09fe23cfb 100755
--- a/maketgz
+++ b/maketgz
@@ -11,23 +11,24 @@ fi
libversion="$version"
-#
-# Now we have a section to get the major, minor and patch number from the
-# full version string. We create a single hexadecimal number from it '0xMMmmpp'
-#
-perl='$a=<STDIN>;@p=split("[\\.-]",$a);for(0..2){printf STDOUT ("%02x",$p[0+$_]);}';
-
-numeric=`echo $libversion | perl -e "$perl"`
-
# we make curl the same version as libcurl
curlversion=$libversion
+major=`echo $libversion |cut -d. -f1 | sed -e "s/[^0-9]//g"`
+minor=`echo $libversion |cut -d. -f2 | sed -e "s/[^0-9]//g"`
+patch=`echo $libversion |cut -d. -f3 | sed -e "s/[^0-9]//g"`
+
+numeric=`echo "obase=16; $major*256*256 + $minor*256 + $patch" | bc`
+
HEADER=include/curl/curl.h
CHEADER=src/version.h
# Replace version number in header file:
sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
-e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
+ -e 's/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \
+ -e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/g' \
+ -e 's/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \
$HEADER >$HEADER.dist
# Replace version number in header file: