~ubuntu-branches/debian/experimental/cubew/experimental

« back to all changes in this revision

Viewing changes to vendor/common/build-config/m4/afs_summary.m4

  • Committer: Package Import Robot
  • Author(s): Andreas Beckmann
  • Date: 2017-12-22 10:16:20 UTC
  • Revision ID: package-import@ubuntu.com-20171222101620-5kgzz922neq7h2ho
Tags: upstream-4.4~rc1
ImportĀ upstreamĀ versionĀ 4.4~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## -*- mode: autoconf -*-
 
2
 
 
3
##
 
4
## This file is part of the Score-P software (http://www.score-p.org)
 
5
##
 
6
## Copyright (c) 2009-2011,
 
7
## RWTH Aachen University, Germany
 
8
##
 
9
## Copyright (c) 2009-2011,
 
10
## Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
 
11
##
 
12
## Copyright (c) 2009-2015,
 
13
## Technische Universitaet Dresden, Germany
 
14
##
 
15
## Copyright (c) 2009-2011,
 
16
## University of Oregon, Eugene, USA
 
17
##
 
18
## Copyright (c) 2009-2013,
 
19
## Forschungszentrum Juelich GmbH, Germany
 
20
##
 
21
## Copyright (c) 2009-2011,
 
22
## German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
 
23
##
 
24
## Copyright (c) 2009-2011,
 
25
## Technische Universitaet Muenchen, Germany
 
26
##
 
27
## This software may be modified and distributed under the terms of
 
28
## a BSD-style license.  See the COPYING file in the package base
 
29
## directory for details.
 
30
##
 
31
 
 
32
## file afs_summary.m4
 
33
 
 
34
# AFS_SUMMARY_INIT
 
35
# ----------------
 
36
# Initializes the summary system and adds the package header (possibly
 
37
# including the sub-build name) to it. It removes config.summary files
 
38
# from previous configure runs recursively, therefore you need to call
 
39
# AFS_SUMMARY_INIT before any sub-configures.
 
40
# The sub-build name is used from the `AFS_PACKAGE_BUILD` variable
 
41
# set by the AFS_PACKAGE_INIT macro.
 
42
AC_DEFUN([AFS_SUMMARY_INIT], [
 
43
rm -f AC_PACKAGE_TARNAME.summary
 
44
LC_ALL=C find . -name config.summary -exec rm -f '{}' \;
 
45
m4_define([_AFS_SUMMARY_INDENT], [m4_ifndef([AFS_PACKAGE_BUILD], [], [  ])])dnl
 
46
m4_define([_AFS_SUMMARY_FILE], [config.summary])
 
47
cat >_AFS_SUMMARY_FILE <<_ACEOF
 
48
AS_HELP_STRING(_AFS_SUMMARY_INDENT[]AC_PACKAGE_NAME[ ]m4_ifndef([AFS_PACKAGE_BUILD], AC_PACKAGE_VERSION, [(]AFS_PACKAGE_BUILD[)])[:], [], 32, 128)
 
49
_ACEOF
 
50
])
 
51
 
 
52
 
 
53
# AFS_SUMMARY_SECTION_BEGIN( [DESCR, [VALUE]] )
 
54
# ---------------------------------------------
 
55
# Starts a new section, optionally with the given description.
 
56
# All summary lines after this call will be indented by 2 spaces.
 
57
# Close the section with 'AFS_SUMMARY_SECTION_END'.
 
58
AC_DEFUN([AFS_SUMMARY_SECTION_BEGIN], [
 
59
AC_REQUIRE([AFS_SUMMARY_INIT])dnl
 
60
 
 
61
m4_ifnblank($1, AFS_SUMMARY([$1], [$2]))
 
62
m4_pushdef([_AFS_SUMMARY_INDENT], _AFS_SUMMARY_INDENT[  ])dnl
 
63
])
 
64
 
 
65
 
 
66
# AFS_SUMMARY_SECTION_END
 
67
# -----------------------
 
68
# Close a previously opened section with 'AFS_SUMMARY_SECTION_BEGIN'.
 
69
AC_DEFUN([AFS_SUMMARY_SECTION_END], [
 
70
AC_REQUIRE([AFS_SUMMARY_INIT])dnl
 
71
 
 
72
m4_popdef([_AFS_SUMMARY_INDENT])dnl
 
73
])
 
74
 
 
75
 
 
76
# AFS_SUMMARY_PUSH
 
77
# ----------------
 
78
# Starts a new section (see 'AFS_SUMMARY_SECTION_BEGIN'), but without a
 
79
# section heading and it collects all subsequent summaries and sections in
 
80
# a hold space.
 
81
# All summary lines after this call will be indented by 2 spaces.
 
82
# Output the hold space with 'AFS_SUMMARY_POP'.
 
83
AC_DEFUN([AFS_SUMMARY_PUSH], [
 
84
AC_REQUIRE([AFS_SUMMARY_INIT])dnl
 
85
 
 
86
AFS_SUMMARY_SECTION_BEGIN
 
87
m4_pushdef([_AFS_SUMMARY_FILE], _AFS_SUMMARY_FILE[.x])dnl
 
88
: >_AFS_SUMMARY_FILE
 
89
])
 
90
 
 
91
 
 
92
# AFS_SUMMARY_POP( DESCR, VALUE )
 
93
# -------------------------------
 
94
# Close a previously opened section with 'AFS_SUMMARY_PUSH'. Outputs the
 
95
# section header with DESCR and VALUE, and than outputs the summary from the
 
96
# hold space.
 
97
AC_DEFUN([AFS_SUMMARY_POP], [
 
98
AC_REQUIRE([AFS_SUMMARY_INIT])dnl
 
99
 
 
100
m4_define([_afs_summary_tmp], _AFS_SUMMARY_FILE)dnl
 
101
m4_popdef([_AFS_SUMMARY_FILE])dnl
 
102
AFS_SUMMARY_SECTION_END
 
103
 
 
104
AFS_SUMMARY([$1], [$2])
 
105
cat _afs_summary_tmp >>_AFS_SUMMARY_FILE
 
106
rm _afs_summary_tmp
 
107
])
 
108
 
 
109
 
 
110
# AFS_SUMMARY( DESCR, VALUE )
 
111
# ---------------------------
 
112
# Generates a summary line with the given description and value.
 
113
AC_DEFUN([AFS_SUMMARY], [
 
114
AC_REQUIRE([AFS_SUMMARY_INIT])dnl
 
115
 
 
116
cat >>_AFS_SUMMARY_FILE <<_ACEOF
 
117
AS_HELP_STRING(_AFS_SUMMARY_INDENT[  $1:], [$2], 32, 128)
 
118
_ACEOF
 
119
])
 
120
 
 
121
 
 
122
# AFS_SUMMARY_VERBOSE( DESCR, VALUE )
 
123
# -----------------------------------
 
124
# Generates a summary line with the given description and value, but only
 
125
# if ./configure was called with --verbose
 
126
AC_DEFUN([AFS_SUMMARY_VERBOSE], [
 
127
 
 
128
AS_IF([test "x${verbose}" = "xyes"], [
 
129
    AFS_SUMMARY([$1], [$2])
 
130
])
 
131
])
 
132
 
 
133
 
 
134
# internal
 
135
AC_DEFUN([_AFS_SUMMARY_SHOW], [
 
136
 
 
137
AS_ECHO([""])
 
138
cat AC_PACKAGE_TARNAME.summary
 
139
])
 
140
 
 
141
# AFS_SUMMARY_COLLECT( [SHOW-COND] )
 
142
# --------------------------------
 
143
# Collectes the summary of all configures recursively into the file
 
144
# $PACKAGE.summary. If SHOW-COND is not given, or the expression
 
145
# evaluates to true the summary is also printed to stdout.
 
146
# Should be called after AC_OUTPUT.
 
147
AC_DEFUN([AFS_SUMMARY_COLLECT], [
 
148
    (
 
149
    AS_ECHO(["Configure command:"])
 
150
    prefix="  $as_myself "
 
151
    printf "%-32s" "$prefix"
 
152
    padding="                                "
 
153
    AS_IF([test ${#prefix} -gt 32], [
 
154
        sep="\\$as_nl$padding"
 
155
    ], [
 
156
        sep=""
 
157
    ])
 
158
 
 
159
    eval "set x $ac_configure_args"
 
160
    shift
 
161
    AS_FOR([ARG], [arg], [], [
 
162
        AS_CASE([$arg],
 
163
        [*\'*], [arg="`$as_echo "$arg" | sed "s/'/'\\\\\\\\''/g"`"])
 
164
        AS_ECHO_N(["$sep'$arg'"])
 
165
        sep=" \\$as_nl$padding"
 
166
    ])
 
167
    AS_ECHO([""])
 
168
 
 
169
    AS_IF([test x"${MODULESHOME:+set}" = x"set"], [
 
170
        AS_ECHO([""])
 
171
        AS_ECHO(["Loaded modules:"])
 
172
        sep=""
 
173
        AS_IF([test x"${LOADEDMODULES:+set}" = x"set"], [
 
174
            prefix="  module load "
 
175
            printf "%-32s" "$prefix"
 
176
            IFS=': ' eval 'set x $LOADEDMODULES'
 
177
            shift
 
178
            AS_FOR([MODULE], [module], [], [
 
179
                AS_ECHO_N(["$sep$module"])
 
180
                sep=" \\$as_nl$padding"
 
181
            ])
 
182
            AS_ECHO([""])
 
183
        ], [
 
184
            AS_ECHO(["  No modules loaded"])
 
185
        ])
 
186
    ])
 
187
 
 
188
    AS_ECHO([""])
 
189
    sep="Configuration summary:"
 
190
    LC_ALL=C find . -name config.summary |
 
191
        LC_ALL=C $AWK -F "config.summary" '{print $[]1}' |
 
192
        LC_ALL=C sort |
 
193
        LC_ALL=C $AWK '{print $[]0 "config.summary"}' |
 
194
        while read summary
 
195
    do
 
196
        AS_ECHO(["$sep"])
 
197
        cat $summary
 
198
        sep=""
 
199
    done
 
200
    ) >AC_PACKAGE_TARNAME.summary
 
201
    m4_ifblank($1,
 
202
              [_AFS_SUMMARY_SHOW],
 
203
              [AS_IF([$1], [_AFS_SUMMARY_SHOW])])
 
204
])