1 # bold.m4 serial 1 (libsigsegv-2.0)
2 dnl Copyright (C) 1999-2002 Ralf S. Engelschall <rse@engelschall.com>
3 dnl Copyright (C) 2002 Bruno Haible <bruno@clisp.org>
4 dnl This file is free software, distributed under the terms of the GNU
5 dnl General Public License. As a special exception to the GNU General
6 dnl Public License, this file may be distributed as part of a program
7 dnl that contains a configuration script generated by Autoconf, under
8 dnl the same distribution terms as the rest of that program.
10 # Determine the escape sequences for switching bold output on and off.
14 dnl AC_REQUIRE([AC_PROG_AWK])
17 # for the most important terminal types we directly know the sequences
19 term_bold=`${AWK:-awk} 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
20 term_norm=`${AWK:-awk} 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
23 term_bold=`${AWK:-awk} 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
24 term_norm=`${AWK:-awk} 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
26 # for all others, we try to use a possibly existing `tput' or `tcout' utility
28 paths=`echo "$PATH" | sed -e 's/:/ /g'`
29 for tool in tput tcout; do
31 if test -r "$dir/$tool"; then
32 for seq in bold md smso; do # 'smso' is last
33 bold="`$dir/$tool $seq 2>/dev/null`"
34 if test -n "$bold"; then
39 if test -n "$term_bold"; then
40 for seq in sgr0 me rmso reset; do # 'reset' is last
41 norm="`$dir/$tool $seq 2>/dev/null`"
42 if test -n "$norm"; then
51 if test -n "$term_bold" && test -n "$term_norm"; then
57 echo "$term_bold" | tr -d '\n' > termbold
58 echo "$term_norm" | tr -d '\n' > termnorm