Changeset 1446 for trunk


Ignore:
Timestamp:
Dec 22, 2011, 1:00:24 AM (9 years ago)
Author:
Peter Johansson
Message:

upgrade macro from yat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat_am_macros.m4

    r1386 r1446  
    1 ## $Id: yat_am_macros.m4 2501 2011-06-28 00:04:02Z peter $
    2 
    3 # serial 4 (yat 0.8)
     1## $Id: yat_am_macros.m4 2552 2011-08-14 15:21:43Z peter $
     2
     3# serial 8 (yat 0.8)
    44
    55m4_define([yat_am_macros_copyright], [
     
    4343# YAT_PROG_MOVE_IF_CHANGE
    4444#
     45# Create shell script move-if-change at autoconf time and AC_SUBST
     46# MOVE_IF_CHANGE
    4547AC_DEFUN([YAT_PROG_MOVE_IF_CHANGE],
    4648[
    47 m4_pushdef([yat_OUT], m4_default([$1], [move-if-change]))
    48 AC_SUBST([MOVE_IF_CHANGE], ['${SHELL} $(top_srcdir)/yat_OUT'])
    49 AX_AC_PRINT_TO_FILE(yat_OUT, [#!/bin/sh])
    50 _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,[
    5153# Like mv ]$[1 ]$[2, but if the files are the same, just delete ]$[1.
    5254# Status is zero if successful, nonzero otherwise.
     
    6264fi
    6365])
    64 m4_popdef([yat_OUT])
    6566]) # YAT_PROG_MOVE_IF_CHANGE
    6667
     
    112113dnl end AX_AC_APPEND_TO_FILE
    113114m4_popdef([YAT_AM_FILE])
    114 ]) # YAT_SVN_RELEASE
     115]) # YAT_SVN_REVISION
    115116
    116117
     
    135136AC_DEFUN([YAT_REVISION_HEADER],
    136137[
     138AC_REQUIRE([YAT_PROG_MOVE_IF_CHANGE])
    137139m4_pushdef([yat_AM_FILE], [m4_default([$1], [svn_revision_header.am])])
    138140m4_define([yat_HEADER_FILE], [m4_default([$2], [svn_revision.h])])
    139 m4_pushdef([yat_REVISION_DEFINE], [m4_default([$1], [SVN_REVISION])])
    140 m4_pushdef([yat_INPUT_FILE], [m4_default([$3], [.revision])])
     141m4_pushdef([yat_REVISION_DEFINE], [m4_default([$3], [SVN_REVISION])])
     142m4_pushdef([yat_INPUT_FILE], [m4_default([$4], [.revision])])
    141143
    142144dnl create svn_revision.h.in
    143 AX_AC_PRINT_TO_FILE([]yat_HEADER_FILE[.in],[
     145AX_AC_PRINT_TO_FILE([]yat_HEADER_FILE[.in-t],[
    144146/* created by $0 */
    145147#ifndef ]yat_REVISION_DEFINE[
     
    147149#endif
    148150])
     151m4_syscmd([sh ]yat_MOVE_IF_CHANGE[ ]yat_HEADER_FILE[.in-t ]yat_HEADER_FILE[.in])
    149152dnl write make rule for svn_revision.h
    150153_YAT_AM_TOP(yat_AM_FILE)
     
    164167
    165168
    166 # YAT_SVN_RELEASE_YEAR([AM_FILE = svn_releas_year.am], [OUTPUT = .release_year])
     169# YAT_SVN_RELEASE_YEAR([AM_FILE = svn_release_year.am],[OUTPUT = .release_year])
    167170#
    168171# Create file, AM_FILE, with make rules for creation of a file,
     
    184187AC_REQUIRE([YAT_PROG_MOVE_IF_CHANGE])
    185188# .release_year is generated during make so in order to avoid bootstrap problem
    186 test -r $srcdir/.release_year || date -u "+%Y" > $srcdir/.release_year
     189test -r $srcdir/$2 || date -u "+%Y" > $srcdir/$2
    187190# propagate RELEASE_YEAR from file .release_year
    188 RELEASE_YEAR=`cat $srcdir/.release_year`
     191RELEASE_YEAR=`cat "$srcdir/$2"`
    189192AC_SUBST([RELEASE_YEAR])
    190193AC_DEFINE_UNQUOTED([RELEASE_YEAR], ["$RELEASE_YEAR"],
    191194                   [Define year package was last modified])
    192195dnl generate make rule for .release_year
    193 _YAT_AM_TOP([svn_release_year.am])
    194 _YAT_AC_APPEND_TO_FILE([svn_release_year.am],
    195 EXTRA_DIST += $(srcdir)/.release_year
    196 CONFIG_STATUS_DEPENDENCIES += $(srcdir)/.release_year
     196_YAT_AM_TOP([$1])
     197_YAT_AC_APPEND_TO_FILE([$1],
     198EXTRA_DIST += $(srcdir)/$2
     199CONFIG_STATUS_DEPENDENCIES += $(srcdir)/$2
    197200RELEASE_YEAR_FORCE:
    198201if HAVE_SVN_WC
    199 $(srcdir)/.release_year: RELEASE_YEAR_FORCE
     202$(srcdir)/$2: RELEASE_YEAR_FORCE
    200203  @if $(SVNVERSION) $(srcdir) | grep 'M' > /dev/null; then \
    201204     date -u "+%%Y" > [$][@]-t \
Note: See TracChangeset for help on using the changeset viewer.