Changeset 2725


Ignore:
Timestamp:
Apr 18, 2012, 4:40:09 AM (7 years ago)
Author:
Peter
Message:

prefer 'AS_ECHO' over 'echo'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat_common.m4

    r2608 r2725  
    11## $Id$
    22#
    3 # Copyright (C) 2009, 2010 Peter Johansson
     3# Copyright (C) 2009, 2010, 2012 Peter Johansson
    44#
    55# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2222# This file contains some small useful macros.
    2323#
    24 # serial 1
     24# serial 2 (yat 0.9)
    2525#
    2626
    2727
    2828# YAT_ECHO_LOG(STRING)
     29# ====================
    2930# print STRING to config.log
    3031AC_DEFUN([YAT_ECHO_LOG],
    3132[
    3233  AC_PREREQ([2.58])
    33   echo "$as_me:${as_lineno-$LINENO}: $1" >&AS_MESSAGE_LOG_FD
     34  AS_ECHO(["$as_me:${as_lineno-$LINENO}: $1"]) >&AS_MESSAGE_LOG_FD
    3435]) #YAT_ECHO_LOG
    3536
    3637
    3738# YAT_RUN_LOG(COMMAND, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
     39# =========================================================
    3840# run COMMAND and log the output, set status in $yat_status and log
    3941# it. If status is zero execute ACTION-IF-TRUE, else execute
    4042# ACTION-IF-FALSE and log stderror from COMMAND
    4143AC_DEFUN([YAT_RUN_LOG],
    42 [ 
     44[
    4345  AC_PREREQ([2.58])
    44   yat_command="$1";
    45   YAT_ECHO_LOG([$yat_command])
    46   $yat_command >&AS_MESSAGE_LOG_FD 2>conftest.err
    47   yat_status=$? 
     46  m4_pushdef([COMMAND], [$1])
     47  YAT_ECHO_LOG([COMMAND])
     48  COMMAND >&AS_MESSAGE_LOG_FD 2>conftest.err
     49  yat_status=$?
    4850  YAT_ECHO_LOG([status: $yat_status])
    49   AS_IF([test $yat_status == 0], [$2], 
     51  AS_IF([test $yat_status == 0], [$2],
    5052        [test -f conftest.err && cat conftest.err >&AS_MESSAGE_LOG_FD; $3])
    51 ]) #YAT_ECHO_LOG
     53  m4_popdef([COMMAND])
     54]) #YAT_RUN_LOG
Note: See TracChangeset for help on using the changeset viewer.