1
## -*- mode: autoconf -*-
4
## This file is part of the Score-P software (http://www.score-p.org)
6
## Copyright (c) 2009-2011,
7
## RWTH Aachen University, Germany
9
## Copyright (c) 2009-2011,
10
## Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
12
## Copyright (c) 2009-2015,
13
## Technische Universitaet Dresden, Germany
15
## Copyright (c) 2009-2011,
16
## University of Oregon, Eugene, USA
18
## Copyright (c) 2009-2013,
19
## Forschungszentrum Juelich GmbH, Germany
21
## Copyright (c) 2009-2011,
22
## German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
24
## Copyright (c) 2009-2011,
25
## Technische Universitaet Muenchen, Germany
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.
32
## file afs_summary.m4
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)
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
61
m4_ifnblank($1, AFS_SUMMARY([$1], [$2]))
62
m4_pushdef([_AFS_SUMMARY_INDENT], _AFS_SUMMARY_INDENT[ ])dnl
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
72
m4_popdef([_AFS_SUMMARY_INDENT])dnl
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
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
86
AFS_SUMMARY_SECTION_BEGIN
87
m4_pushdef([_AFS_SUMMARY_FILE], _AFS_SUMMARY_FILE[.x])dnl
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
97
AC_DEFUN([AFS_SUMMARY_POP], [
98
AC_REQUIRE([AFS_SUMMARY_INIT])dnl
100
m4_define([_afs_summary_tmp], _AFS_SUMMARY_FILE)dnl
101
m4_popdef([_AFS_SUMMARY_FILE])dnl
102
AFS_SUMMARY_SECTION_END
104
AFS_SUMMARY([$1], [$2])
105
cat _afs_summary_tmp >>_AFS_SUMMARY_FILE
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
116
cat >>_AFS_SUMMARY_FILE <<_ACEOF
117
AS_HELP_STRING(_AFS_SUMMARY_INDENT[ $1:], [$2], 32, 128)
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], [
128
AS_IF([test "x${verbose}" = "xyes"], [
129
AFS_SUMMARY([$1], [$2])
135
AC_DEFUN([_AFS_SUMMARY_SHOW], [
138
cat AC_PACKAGE_TARNAME.summary
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], [
149
AS_ECHO(["Configure command:"])
150
prefix=" $as_myself "
151
printf "%-32s" "$prefix"
153
AS_IF([test ${#prefix} -gt 32], [
154
sep="\\$as_nl$padding"
159
eval "set x $ac_configure_args"
161
AS_FOR([ARG], [arg], [], [
163
[*\'*], [arg="`$as_echo "$arg" | sed "s/'/'\\\\\\\\''/g"`"])
164
AS_ECHO_N(["$sep'$arg'"])
165
sep=" \\$as_nl$padding"
169
AS_IF([test x"${MODULESHOME:+set}" = x"set"], [
171
AS_ECHO(["Loaded modules:"])
173
AS_IF([test x"${LOADEDMODULES:+set}" = x"set"], [
174
prefix=" module load "
175
printf "%-32s" "$prefix"
176
IFS=': ' eval 'set x $LOADEDMODULES'
178
AS_FOR([MODULE], [module], [], [
179
AS_ECHO_N(["$sep$module"])
180
sep=" \\$as_nl$padding"
184
AS_ECHO([" No modules loaded"])
189
sep="Configuration summary:"
190
LC_ALL=C find . -name config.summary |
191
LC_ALL=C $AWK -F "config.summary" '{print $[]1}' |
193
LC_ALL=C $AWK '{print $[]0 "config.summary"}' |
200
) >AC_PACKAGE_TARNAME.summary
203
[AS_IF([$1], [_AFS_SUMMARY_SHOW])])