summaryrefslogtreecommitdiff
path: root/m4/update-header-version.m4
blob: 5a370ddf2e901947c3ad15258d63c51237f2a186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
])