Changeset 2552


Ignore:
Timestamp:
Aug 14, 2011, 5:21:43 PM (10 years ago)
Author:
Peter
Message:

YAT_REVISION_HEADER: avoid updating time-stamp of file.h.in if not needed. closes #659

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat_am_macros.m4

    r2540 r2552  
    11## $Id$
    22
    3 # serial 7 (yat 0.8)
     3# serial 8 (yat 0.8)
    44
    55m4_define([yat_am_macros_copyright], [
     
    4747AC_DEFUN([YAT_PROG_MOVE_IF_CHANGE],
    4848[
    49 m4_pushdef([yat_OUT], m4_default([$1], [move-if-change]))
    50 AC_SUBST([MOVE_IF_CHANGE], ['${SHELL} $(top_srcdir)/yat_OUT'])
    51 AX_AC_PRINT_TO_FILE(yat_OUT, [#!/bin/sh])
    52 _YAT_AC_APPEND_TO_FILE(yat_OUT,[
     49m4_define([yat_MOVE_IF_CHANGE], m4_default([$1], [move-if-change]))
     50AC_SUBST([MOVE_IF_CHANGE], ['${SHELL} $(top_srcdir)/yat_MOVE_IF_CHANGE'])
     51AX_AC_PRINT_TO_FILE(yat_MOVE_IF_CHANGE, [#!/bin/sh])
     52_YAT_AC_APPEND_TO_FILE(yat_MOVE_IF_CHANGE,[
    5353# Like mv ]$[1 ]$[2, but if the files are the same, just delete ]$[1.
    5454# Status is zero if successful, nonzero otherwise.
     
    6464fi
    6565])
    66 m4_popdef([yat_OUT])
    6766]) # YAT_PROG_MOVE_IF_CHANGE
    6867
     
    137136AC_DEFUN([YAT_REVISION_HEADER],
    138137[
     138AC_REQUIRE([YAT_PROG_MOVE_IF_CHANGE])
    139139m4_pushdef([yat_AM_FILE], [m4_default([$1], [svn_revision_header.am])])
    140140m4_define([yat_HEADER_FILE], [m4_default([$2], [svn_revision.h])])
     
    143143
    144144dnl create svn_revision.h.in
    145 AX_AC_PRINT_TO_FILE([]yat_HEADER_FILE[.in],[
     145AX_AC_PRINT_TO_FILE([]yat_HEADER_FILE[.in-t],[
    146146/* created by $0 */
    147147#ifndef ]yat_REVISION_DEFINE[
     
    149149#endif
    150150])
     151m4_syscmd([sh ]yat_MOVE_IF_CHANGE[ ]yat_HEADER_FILE[.in-t ]yat_HEADER_FILE[.in])
    151152dnl write make rule for svn_revision.h
    152153_YAT_AM_TOP(yat_AM_FILE)
  • trunk/test/yat_revision_header_test.sh

    r2539 r2552  
    6666make check VERBOSE=1 || exit_fail
    6767
     68ls -lrt
     69bootstrap
     70ls -lrt
     71find . -anewer my.h.in | grep 'my.h' || exit_fail
     72
    6873exit_success;
Note: See TracChangeset for help on using the changeset viewer.