1 # update-header-version.m4 serial 1
2 dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl From Simon Josefsson
9 # sj_UPDATE_HEADER_VERSION(HEADER-FILE)
11 # Update version number in HEADER-FILE. It searches for '_VERSION ".*"'
12 # and replaces the .* part with the $PACKAGE_VERSION.
13 AC_DEFUN([sj_UPDATE_HEADER_VERSION],
15 # Update version number in lib/libtasn1.h.
16 if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' $1 > fixhdr.tmp; then
17 AC_MSG_ERROR([[*** Failed to update version number in $1...]])
19 if cmp -s $1 fixhdr.tmp 2>/dev/null; then
21 elif ! mv fixhdr.tmp $1; then
22 AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to $1...]])