summaryrefslogtreecommitdiff
path: root/maketgz
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-05-22 14:12:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-05-22 14:12:12 +0000
commit96dde76b99897352aa3d0877a0b621a9e605733e (patch)
tree4fdab47b4c9769405aa799bf65971c31abf2de6b /maketgz
parentfb9d1ff00f76836dd66725de869656c5fa53b071 (diff)
downloadcurl-96dde76b99897352aa3d0877a0b621a9e605733e.tar.gz
moved here from the newlib branch
Diffstat (limited to 'maketgz')
-rwxr-xr-xmaketgz13
1 files changed, 11 insertions, 2 deletions
diff --git a/maketgz b/maketgz
index 6ad429b5d..79982d0d3 100755
--- a/maketgz
+++ b/maketgz
@@ -7,15 +7,24 @@ read version
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"`
+
echo "CURL version number?"
read curlversion
HEADER=include/curl/curl.h
CHEADER=src/version.h
-
# Replace version number in header file:
-sed 's/#define LIBCURL_VERSION.*/#define LIBCURL_VERSION "'$libversion'"/g' $HEADER >$HEADER.new
+sed -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
+ -e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
+ $HEADER >$HEADER.new
# Save old header file
cp -p $HEADER $HEADER.old