"Fossies" - the Fresh Open Source Software Archive

Member "openmpi-3.1.6/ompi/mca/io/romio314/romio/confdb/aclocal_runlog.m4" (18 Mar 2020, 7471 Bytes) of package /linux/misc/openmpi-3.1.6.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl
    2 dnl PAC_RUN_LOG mimics _AC_RUN_LOG which is autoconf internal routine.
    3 dnl We also make sure PAC_RUN_LOG can be used in AS_IF, so the last
    4 dnl test command should have terminating ]), i.e. without newline before ]).
    5 dnl
    6 AC_DEFUN([PAC_RUNLOG],[
    7 { AS_ECHO(["$as_me:$LINENO: $1"]) >&AS_MESSAGE_LOG_FD
    8   (eval $1) 2>&AS_MESSAGE_LOG_FD
    9   ac_status=$?
   10   AS_ECHO(["$as_me:$LINENO: \$? = $ac_status"]) >&AS_MESSAGE_LOG_FD
   11   test $ac_status = 0; }])
   12 
   13 dnl
   14 dnl PAC_COMMAND_IFELSE is written to replace AC_TRY_EVAL with added logging
   15 dnl to config.log, i.e. AC_TRY_EVAL does not log anything to config.log.
   16 dnl If autoconf provides AC_COMMAND_IFELSE or AC_EVAL_IFELSE,
   17 dnl AC_COMMAND_IFELSE dnl should be replaced by the official autoconf macros.
   18 dnl
   19 dnl PAC_COMMAND_IFELSE(COMMMAND,[ACTION-IF-RUN-OK],[ACTION-IF-RUN-FAIL])
   20 dnl
   21 AC_DEFUN([PAC_COMMAND_IFELSE],[
   22 AS_IF([PAC_RUNLOG([$1])],[
   23     $2
   24 ],[
   25     AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
   26     m4_ifvaln([$3],[
   27         (exit $ac_status)
   28         $3
   29     ])
   30 ])
   31 ])
   32 
   33 AC_DEFUN([PAC_RUNLOG_IFELSE],[
   34 dnl pac_TESTLOG is the internal temporary logfile for this macro.
   35 pac_TESTLOG="pac_test.log"
   36 rm -f $pac_TESTLOG
   37 PAC_COMMAND_IFELSE([$1 > $pac_TESTLOG],[
   38     ifelse([$2],[],[],[$2])
   39 ],[
   40     AS_ECHO(["*** $1 :"]) >&AS_MESSAGE_LOG_FD
   41     cat $pac_TESTLOG >&AS_MESSAGE_LOG_FD
   42     ifelse([$3],[],[],[$3])
   43 ])
   44 rm -f $pac_TESTLOG
   45 ])
   46 
   47 
   48 dnl PAC_VAR_PUSHVAL(VARNAME, [LastSavedValue]))
   49 dnl
   50 dnl Save the content of the shell variable, VARNAME, onto a stack.
   51 dnl The saved value of VARNAME is restorable with respect to the nesting
   52 dnl of the macro.
   53 dnl
   54 dnl The Last saved value of VARNAME on the stack is stored in shell variable
   55 dnl pac_LastSavedValueOf_$VARNAME if the 2nd argument is NOT supplied.
   56 dnl If the 2nd argument is present, the last saved value will be stored
   57 dnl in the 2nd argument instead.
   58 dnl
   59 dnl The First saved value of VARNAME on the stack is stored in shell variable
   60 dnl dnl pac_FirstSavedValueOf_$VARNAME.
   61 dnl
   62 AC_DEFUN([PAC_VAR_PUSHVAL],[
   63 # START of PUSHVAL
   64 dnl define local m4-name pac_stk_level.
   65 AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level])
   66 AS_VAR_SET_IF([pac_stk_level],[
   67     AS_VAR_ARITH([pac_stk_level], [$pac_stk_level + 1])
   68 ],[
   69     AS_VAR_SET([pac_stk_level], [0])
   70 ])
   71 dnl AS_ECHO_N(["PUSHVAL: pac_stk_level = $pac_stk_level, "])
   72 dnl Save the content of VARNAME, i.e. $VARNAME, onto the stack.
   73 AS_VAR_SET([pac_stk_$1_$pac_stk_level],[$$1])
   74 AS_VAR_IF([pac_stk_level], [0], [
   75     dnl Save the 1st pushed value of VARNAME as pac_FirstSavedValueOf_$VARNAME
   76     AS_VAR_COPY([pac_FirstSavedValueOf_$1],[pac_stk_$1_$pac_stk_level])
   77 ])
   78 ifelse([$2],[],[
   79     dnl Save the last pushed value of VARNAME as pac_LastSavedValueOf_$VARNAME
   80     AS_VAR_COPY([pac_LastSavedValueOf_$1],[pac_stk_$1_$pac_stk_level])
   81     dnl AS_ECHO(["pac_LastSavedValueOf_$1 = $pac_LastSavedValueOf_$1"])
   82 ],[
   83     dnl Save the last pushed value of VARNAME as $2
   84     AS_VAR_COPY([$2],[pac_stk_$1_$pac_stk_level])
   85     dnl AS_ECHO(["$2 = $$2"])
   86 ])
   87 AS_VAR_POPDEF([pac_stk_level])
   88 # END of PUSHVAL
   89 ])
   90 dnl
   91 dnl
   92 dnl
   93 dnl PAC_VAR_POPVAL(VARNAME)
   94 dnl
   95 dnl Restore variable, VARNAME, from the stack.
   96 dnl This macro is safe with respect to the nesting.
   97 dnl Some minimal checking of nesting balance of PAC_VAR_PUSH[POP]VAL()
   98 dnl is done here.
   99 dnl
  100 AC_DEFUN([PAC_VAR_POPVAL],[
  101 # START of POPVAL
  102 dnl define local m4-name pac_stk_level.
  103 AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level])
  104 AS_VAR_SET_IF([pac_stk_level],[
  105     AS_VAR_IF([pac_stk_level],[-1],[
  106         AC_MSG_WARN(["Imbalance of PUSHVAL/POPVAL of $1"])
  107     ],[
  108         dnl AS_ECHO_N(["POPVAL: pac_stk_level = $pac_stk_level, "])
  109         AS_VAR_COPY([$1],[pac_stk_$1_$pac_stk_level])
  110         dnl AS_ECHO(["popped_val = $$1"])
  111         AS_VAR_ARITH([pac_stk_level], [ $pac_stk_level - 1 ])
  112     ])
  113 ],[
  114     AC_MSG_WARN(["Uninitialized PUSHVAL/POPVAL of $1"])
  115 ])
  116 AS_VAR_POPDEF([pac_stk_level])
  117 # END of POPVAL
  118 ])
  119 dnl
  120 dnl
  121 dnl
  122 dnl PAC_COMPILE_IFELSE_LOG is a wrapper around AC_COMPILE_IFELSE with the
  123 dnl output of ac_compile to a specified logfile instead of AS_MESSAGE_LOG_FD
  124 dnl
  125 dnl PAC_COMPILE_IFELSE_LOG(logfilename, input,
  126 dnl                        [action-if-true], [action-if-false])
  127 dnl
  128 dnl where input, [action-if-true] and [action-if-false] are used
  129 dnl in AC_COMPILE_IFELSE(input, [action-if-true], [action-if-false]).
  130 dnl This macro is nesting safe.
  131 dnl
  132 AC_DEFUN([PAC_COMPILE_IFELSE_LOG],[
  133 dnl
  134 dnl Instead of defining our own ac_compile and do AC_TRY_EVAL
  135 dnl on these variables.  We modify ac_compile used by AC_*_IFELSE
  136 dnl by piping the output of the command to a logfile.  The reason is that
  137 dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_compile
  138 dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in
  139 dnl these commands, i.e. deviate from how GNU standard uses these variables.
  140 dnl
  141 dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_compile.
  142 dnl Save a copy of ac_compile on a stack
  143 dnl which is safe through nested invocations of this macro.
  144 PAC_VAR_PUSHVAL([ac_compile])
  145 dnl Modify ac_compile based on the unmodified ac_compile.
  146 ac_compile="`echo $pac_FirstSavedValueOf_ac_compile | sed -e 's|>.*$|> $1 2>\&1|g'`"
  147 AC_COMPILE_IFELSE([$2],[
  148     ifelse([$3],[],[:],[$3])
  149 ],[
  150     ifelse([$4],[],[:],[$4])
  151 ])
  152 dnl Restore the original ac_compile from the stack.
  153 PAC_VAR_POPVAL([ac_compile])
  154 ])
  155 dnl
  156 dnl
  157 dnl
  158 dnl PAC_LINK_IFELSE_LOG is a wrapper around AC_LINK_IFELSE with the
  159 dnl output of ac_link to a specified logfile instead of AS_MESSAGE_LOG_FD
  160 dnl
  161 dnl PAC_LINK_IFELSE_LOG(logfilename, input,
  162 dnl                     [action-if-true], [action-if-false])
  163 dnl
  164 dnl where input, [action-if-true] and [action-if-false] are used
  165 dnl in AC_LINK_IFELSE(input, [action-if-true], [action-if-false]).
  166 dnl This macro is nesting safe.
  167 dnl
  168 AC_DEFUN([PAC_LINK_IFELSE_LOG],[
  169 dnl
  170 dnl Instead of defining our own ac_link and do AC_TRY_EVAL
  171 dnl on these variables.  We modify ac_link used by AC_*_IFELSE
  172 dnl by piping the output of the command to a logfile.  The reason is that
  173 dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_link
  174 dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in
  175 dnl these commands, i.e. deviate from how GNU standard uses these variables.
  176 dnl
  177 dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_link.
  178 dnl Save a copy of ac_link on a stack
  179 dnl which is safe through nested invocations of this macro.
  180 PAC_VAR_PUSHVAL([ac_link])
  181 dnl Modify ac_link based on the unmodified ac_link.
  182 ac_link="`echo $pac_FirstSavedValueOf_ac_link | sed -e 's|>.*$|> $1 2>\&1|g'`"
  183 dnl
  184 AC_LINK_IFELSE([$2],[
  185     ifelse([$3],[],[:],[$3])
  186 ],[
  187     ifelse([$4],[],[:],[$4])
  188 ])
  189 dnl Restore the original ac_link from the stack.
  190 PAC_VAR_POPVAL([ac_link])
  191 ])
  192 dnl
  193 dnl
  194 dnl
  195 dnl PAC_COMPLINK_IFELSE (input1, input2, [action-if-true], [action-if-false])
  196 dnl
  197 dnl where input1 and input2 are either AC_LANG_SOURCE or AC_LANG_PROGRAM
  198 dnl enclosed input programs.
  199 dnl
  200 dnl The macro first compiles input1 and uses the object file created
  201 dnl as part of LIBS during linking.  This macro is nesting safe.
  202 dnl
  203 AC_DEFUN([PAC_COMPLINK_IFELSE],[
  204 AC_COMPILE_IFELSE([$1],[
  205     PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
  206     PAC_VAR_PUSHVAL([LIBS])
  207     LIBS="pac_conftest.$OBJEXT $pac_FirstSavedValueOf_LIBS"
  208     AC_LINK_IFELSE([$2],[
  209         ifelse([$3],[],[:],[$3])
  210     ],[
  211         ifelse([$4],[],[:],[$4])
  212     ])
  213     PAC_VAR_POPVAL([LIBS])
  214     rm -f pac_conftest.$OBJEXT
  215 ],[
  216     ifelse([$4],[],[:],[$4])
  217 ])
  218 ])