Changeset 378ede7 for m4


Ignore:
Timestamp:
Jun 25, 2011, 5:46:42 AM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
650fb2c
Parents:
f2a96c0
git-author:
Anders Kaseorg <andersk@mit.edu> (06/25/11 05:41:16)
git-committer:
Anders Kaseorg <andersk@mit.edu> (06/25/11 05:46:42)
Message:
Update autoconf macros from autoconf-archive

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Location:
m4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • m4/ax_cflags_warn_all.m4

    r8073852 r378ede7  
    11# ===========================================================================
    2 #           http://autoconf-archive.cryp.to/ax_cflags_warn_all.html
     2#    http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
    33# ===========================================================================
    44#
    55# SYNOPSIS
    66#
    7 #   AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
     7#   AX_CFLAGS_WARN_ALL   [(shellvar [,default, [A/NA]])]
     8#   AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
     9#   AX_FCFLAGS_WARN_ALL  [(shellvar [,default, [A/NA]])]
    810#
    911# DESCRIPTION
    1012#
    1113#   Try to find a compiler option that enables most reasonable warnings.
    12 #   This macro is directly derived from VL_PROG_CC_WARNINGS which is split
    13 #   up into two AX_CFLAGS_WARN_ALL and AX_CFLAGS_WARN_ALL_ANSI
    1414#
    15 #   For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
    16 #   result is added to the shellvar being CFLAGS by default.
     15#   For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
     16#   is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
    1717#
    18 #   Currently this macro knows about GCC, Solaris C compiler, Digital Unix C
    19 #   compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC
    20 #   SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C
    21 #   compiler.
     18#   Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
     19#   HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
     20#   Intel compilers.  For a given compiler, the Fortran flags are much more
     21#   experimental than their C equivalents.
    2222#
    23 #    - $1 shell-variable-to-add-to : CFLAGS
     23#    - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
    2424#    - $2 add-value-if-not-found : nothing
    2525#    - $3 action-if-found : add value to shellvariable
     
    2929#
    3030#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
     31#   Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
    3132#
    3233#   This program is free software; you can redistribute it and/or modify it
    3334#   under the terms of the GNU General Public License as published by the
    34 #   Free Software Foundation; either version 2 of the License, or (at your
     35#   Free Software Foundation; either version 3 of the License, or (at your
    3536#   option) any later version.
    3637#
     
    5657#   exception to the GPL to apply to your modified version as well.
    5758
     59#serial 10
     60
    5861AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
    5962AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
     
    6164AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
    6265VAR,[VAR="no, unknown"
    63  AC_LANG_SAVE
    64  AC_LANG_C
     66 AC_LANG_PUSH([C])
    6567 ac_save_[]FLAGS="$[]FLAGS"
    6668for ac_arg dnl
     
    7577   #
    7678do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
    77    AC_TRY_COMPILE([],[return 0;],
    78    [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
     79   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
     80                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
    7981done
    8082 FLAGS="$ac_save_[]FLAGS"
    81  AC_LANG_RESTORE
     83 AC_LANG_POP([C])
    8284])
    8385case ".$VAR" in
     
    101103AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
    102104AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
    103 AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
     105AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl
    104106AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
    105107VAR,[VAR="no, unknown"
    106  AC_LANG_SAVE
    107  AC_LANG_CPLUSPLUS
     108 AC_LANG_PUSH([C++])
    108109 ac_save_[]FLAGS="$[]FLAGS"
    109110for ac_arg dnl
     
    118119   #
    119120do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
    120    AC_TRY_COMPILE([],[return 0;],
    121    [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
     121   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
     122                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
    122123done
    123124 FLAGS="$ac_save_[]FLAGS"
    124  AC_LANG_RESTORE
     125 AC_LANG_POP([C++])
     126])
     127case ".$VAR" in
     128     .ok|.ok,*) m4_ifvaln($3,$3) ;;
     129   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
     130        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
     131                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
     132   *) m4_ifvaln($3,$3,[
     133   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
     134   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
     135   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
     136                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
     137   fi ]) ;;
     138esac
     139AS_VAR_POPDEF([VAR])dnl
     140AS_VAR_POPDEF([FLAGS])dnl
     141])
     142
     143dnl the only difference - the LANG selection... and the default FLAGS
     144
     145AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
     146AS_VAR_PUSHDEF([FLAGS],[FCFLAGS])dnl
     147AS_VAR_PUSHDEF([VAR],[ax_cv_fcflags_warn_all])dnl
     148AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
     149VAR,[VAR="no, unknown"
     150 AC_LANG_PUSH([Fortran])
     151 ac_save_[]FLAGS="$[]FLAGS"
     152for ac_arg dnl
     153in "-warn all  % -warn all"   dnl Intel
     154   "-pedantic  % -Wall"       dnl GCC
     155   "-xstrconst % -v"          dnl Solaris C
     156   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
     157   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
     158   "-ansi -ansiE % -fullwarn" dnl IRIX
     159   "+ESlit     % +w1"         dnl HP-UX C
     160   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
     161   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
     162   #
     163do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
     164   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
     165                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
     166done
     167 FLAGS="$ac_save_[]FLAGS"
     168 AC_LANG_POP([Fortran])
    125169])
    126170case ".$VAR" in
     
    148192dnl   like -Woption or -Xoption as they think of it is a pass-through
    149193dnl   to later compile stages or something. The "%" is used as a
    150 dnl   delimimiter. A non-option comment can be given after "%%" marks
     194dnl   delimiter. A non-option comment can be given after "%%" marks
    151195dnl   which will be shown but not added to the respective C/CXXFLAGS.
  • m4/ax_prog_perl_modules.m4

    r2d3ed95 r378ede7  
    11# ===========================================================================
    2 #      http://www.nongnu.org/autoconf-archive/ax_prog_perl_modules.html
     2#   http://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html
    33# ===========================================================================
    44#
     
    3333#   warranty.
    3434
    35 #serial 6
     35#serial 7
    3636
    3737AU_ALIAS([AC_PROG_PERL_MODULES], [AX_PROG_PERL_MODULES])
Note: See TracChangeset for help on using the changeset viewer.