Changeset bc932fd for m4


Ignore:
Timestamp:
Jun 25, 2011, 6:03:23 AM (13 years ago)
Author:
GitHub Merge Button <merge-button@github.com>
Parents:
2560529 (diff), 650fb2c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge 650fb2c030491f5d6668ad439b83a6a6b7b9870e into 2560529186e398f85a038e8683d29058857eb7b7
Location:
m4
Files:
1 added
1 deleted
3 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])
  • m4/pkg.m4

    r8073852 r650fb2c  
    11# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
     2# serial 1 (pkg-config-0.24)
    23#
    34# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
     
    2627AC_DEFUN([PKG_PROG_PKG_CONFIG],
    2728[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
    28 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
    29 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
     29m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
     30m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
     31AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
     32AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
     33AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
     34
    3035if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
    3136        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
     
    4045                PKG_CONFIG=""
    4146        fi
    42                
    4347fi[]dnl
    4448])# PKG_PROG_PKG_CONFIG
     
    4953# to PKG_CHECK_MODULES(), but does not set variables or print errors.
    5054#
    51 #
    52 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
    53 # this or PKG_CHECK_MODULES is called, or make sure to call
    54 # PKG_CHECK_EXISTS manually
     55# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
     56# only at the first occurence in configure.ac, so if the first place
     57# it's called might be skipped (such as if it is within an "if", you
     58# have to call PKG_CHECK_EXISTS manually
    5559# --------------------------------------------------------------
    5660AC_DEFUN([PKG_CHECK_EXISTS],
     
    5862if test -n "$PKG_CONFIG" && \
    5963    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
    60   m4_ifval([$2], [$2], [:])
     64  m4_default([$2], [:])
    6165m4_ifvaln([$3], [else
    6266  $3])dnl
    6367fi])
    6468
    65 
    6669# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
    6770# ---------------------------------------------
    6871m4_define([_PKG_CONFIG],
    69 [if test -n "$PKG_CONFIG"; then
    70     if test -n "$$1"; then
    71         pkg_cv_[]$1="$$1"
    72     else
    73         PKG_CHECK_EXISTS([$3],
    74                          [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
    75                          [pkg_failed=yes])
    76     fi
    77 else
    78         pkg_failed=untried
     72[if test -n "$$1"; then
     73    pkg_cv_[]$1="$$1"
     74 elif test -n "$PKG_CONFIG"; then
     75    PKG_CHECK_EXISTS([$3],
     76                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
     77                      test "x$?" != "x0" && pkg_failed=yes ],
     78                     [pkg_failed=yes])
     79 else
     80    pkg_failed=untried
    7981fi[]dnl
    8082])# _PKG_CONFIG
     
    118120
    119121if test $pkg_failed = yes; then
     122        AC_MSG_RESULT([no])
    120123        _PKG_SHORT_ERRORS_SUPPORTED
    121124        if test $_pkg_short_errors_supported = yes; then
    122                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
     125                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
    123126        else
    124                 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
     127                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
    125128        fi
    126129        # Put the nasty error message in config.log where it belongs
    127130        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
    128131
    129         ifelse([$4], , [AC_MSG_ERROR(dnl
     132        m4_default([$4], [AC_MSG_ERROR(
    130133[Package requirements ($2) were not met:
    131134
     
    135138installed software in a non-standard prefix.
    136139
    137 _PKG_TEXT
    138 ])],
    139                 [AC_MSG_RESULT([no])
    140                 $4])
     140_PKG_TEXT])[]dnl
     141        ])
    141142elif test $pkg_failed = untried; then
    142         ifelse([$4], , [AC_MSG_FAILURE(dnl
     143        AC_MSG_RESULT([no])
     144        m4_default([$4], [AC_MSG_FAILURE(
    143145[The pkg-config script could not be found or is too old.  Make sure it
    144146is in your PATH or set the PKG_CONFIG environment variable to the full
     
    147149_PKG_TEXT
    148150
    149 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
    150                 [$4])
     151To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
     152        ])
    151153else
    152154        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
    153155        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
    154156        AC_MSG_RESULT([yes])
    155         ifelse([$3], , :, [$3])
     157        $3
    156158fi[]dnl
    157159])# PKG_CHECK_MODULES
Note: See TracChangeset for help on using the changeset viewer.