summaryrefslogtreecommitdiff
path: root/m4/update-header-version.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/update-header-version.m4')
-rw-r--r--m4/update-header-version.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/update-header-version.m4 b/m4/update-header-version.m4
new file mode 100644
index 0000000..5a370dd
--- /dev/null
+++ b/m4/update-header-version.m4
@@ -0,0 +1,24 @@
+# update-header-version.m4 serial 1
+dnl Copyright (C) 2008 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# sj_UPDATE_HEADER_VERSION(HEADER-FILE)
+# -------------
+# Update version number in HEADER-FILE. It searches for '_VERSION ".*"'
+# and replaces the .* part with the $PACKAGE_VERSION.
+AC_DEFUN([sj_UPDATE_HEADER_VERSION],
+[
+ # Update version number in lib/libtasn1.h.
+ if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' $1 > fixhdr.tmp; then
+ AC_MSG_ERROR([[*** Failed to update version number in $1...]])
+ fi
+ if cmp -s $1 fixhdr.tmp 2>/dev/null; then
+ rm -f fixhdr.tmp
+ elif ! mv fixhdr.tmp $1; then
+ AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to $1...]])
+ fi
+])