3 dnl use default LHS width (called implicitly if not called explicitly)
4 dnl GP_CONFIG_INIT([WIDTH-OF-LHS])
5 dnl explicitly set the LHS width to the given value
9 dnl GP_CONFIG_MSG([LHS],[RHS])
10 dnl formatted output line "LHS: RHS"
13 dnl print all the output messages we collected in the mean time
15 dnl Simple way to print a configuration summary at the end of ./configure.
20 dnl GP_CONFIG_MSG([Source code location],[${srcdir}])
21 dnl GP_CONFIG_MSG([Compiler],[${CC}])
23 dnl GP_CONFIG_MSG([Feature foo],[${foo}])
24 dnl GP_CONFIG_MSG([Location of bar],[${bar}])
30 AC_DEFUN([GP_CONFIG_INIT],
32 AC_REQUIRE([GP_CHECK_SHELL_ENVIRONMENT])
33 dnl the empty string must contain at least as many spaces as the substr length
34 dnl FIXME: let m4 determine that length
35 dnl (collect left parts in array and choose largest length)
36 m4_if([$1],[],[gp_config_len="30"],[gp_config_len="$1"])
38 gp_config_len3="$(expr "$gp_config_len" - 3)"
40 while test "$n" -gt 0; do
41 gp_config_empty="${gp_config_empty} "
45 Configuration (${PACKAGE_TARNAME} ${PACKAGE_VERSION}):
50 AC_DEFUN([GP_CONFIG_MSG],
51 [AC_REQUIRE([GP_CONFIG_INIT])dnl
53 gp_config_msg="${gp_config_msg}
56 gp_config_msg="${gp_config_msg}
60 gp_config_msg_len="$(expr "[$1]" : '.*')"
61 if test "$gp_config_msg_len" -ge "$gp_config_len"; then
62 gp_config_msg_lhs="$(expr "[$1]" : "\(.\{0,${gp_config_len3}\}\)")..:"
64 gp_config_msg_lhs="$(expr "[$1]:${gp_config_empty}" : "\(.\{0,${gp_config_len}\}\)")"
66 gp_config_msg="${gp_config_msg} ${gp_config_msg_lhs} [$2]
70 AC_DEFUN([GP_CONFIG_MSG_SUBDIRS],[dnl
71 # Message about configured subprojects
72 if test "x$subdirs" != "x"; then
75 for sd in $subdirs; do
76 ssd="$(basename "$sd")"
77 if test "x$_subdirs" = "x"; then
80 _subdirs="$_subdirs $ssd"
83 GP_CONFIG_MSG([Subprojects],[${_subdirs}])dnl
87 AC_DEFUN([GP_CONFIG_OUTPUT],
88 [AC_REQUIRE([GP_CONFIG_INIT])dnl
89 AC_REQUIRE([GP_CONFIG_MSG])dnl
90 AC_REQUIRE([GP_CONFIG_MSG_SUBDIRS])dnl
91 echo "${gp_config_msg}
92 You may run \"make\" and \"make install\" now."
95 dnl Please do not remove this:
96 dnl filetype: de774af3-dc3b-4b1d-b6f2-4aca35d3da16
97 dnl I use this to find all the different instances of this file which
98 dnl are supposed to be synchronized.