tests: show mount list on failure for df tests
[coreutils.git] / build-aux / gen-lists-of-programs.sh
blob40c3a3236ccbaa547c736605b322beb77e8fa9ba
1 #!/bin/sh
2 # Generate lists of all coreutils programs, to be fed both to Autoconf
3 # and Automake, and with further distinctions about how and when these
4 # programs should be built. This is useful to avoid duplicating these
5 # list definitions among several files ('configure.ac' and
6 # 'src/local.mk' at least); such duplication had proved a source of
7 # inconsistencies and bugs in the past.
9 set -u
10 set -e
12 # These are the names of programs that are neither built nor installed
13 # by default. This list is *not* intended for programs like 'who',
14 # 'nice', 'chroot', etc., that are built only when certain requisite
15 # system features are detected.
16 # If you would like to install programs from this list anyway, say A and B,
17 # use "--enable-install-program=A,B" when invoking configure.
18 disabled_by_default_progs='
19 arch
20 coreutils
21 hostname
24 # Programs that can be built only when certain requisite system
25 # features are detected at configure time.
26 build_if_possible_progs='
27 chroot
29 hostid
30 libstdbuf.so
31 nice
32 pinky
33 stdbuf
34 stty
35 uptime
36 users
37 who
40 # All the other programs, to be built by default, and that should
41 # be buildable without problems on any target system.
42 normal_progs='
44 base64
45 base32
46 basename
47 cat
48 chcon
49 chgrp
50 chmod
51 chown
52 cksum
53 comm
55 csplit
56 cut
57 date
59 dir
60 dircolors
61 dirname
63 echo
64 env
65 expand
66 expr
67 factor
68 false
69 fmt
70 fold
71 ginstall
72 groups
73 head
75 join
76 kill
77 link
79 logname
81 md5sum
82 mkdir
83 mkfifo
84 mknod
85 mktemp
88 nproc
89 nohup
90 numfmt
92 paste
93 pathchk
95 printenv
96 printf
97 ptx
98 pwd
99 readlink
100 realpath
102 rmdir
103 runcon
105 sha1sum
106 sha224sum
107 sha256sum
108 sha384sum
109 sha512sum
110 shred
111 shuf
112 sleep
113 sort
114 split
115 stat
117 sync
119 tail
121 test
122 timeout
123 touch
125 true
126 truncate
127 tsort
129 uname
130 unexpand
131 uniq
132 unlink
133 vdir
135 whoami
139 me=`echo "$0" | sed 's,.*/,,'`
140 msg="Automatically generated by $me. DO NOT EDIT BY HAND!"
142 case $#,$1 in
143 1,--autoconf|1,--for-autoconf)
144 echo "dnl $msg"
145 for p in $normal_progs; do
146 test x"$p" = x"[" && p='@<:@'
147 echo "gl_ADD_PROG([optional_bin_progs], [$p])"
148 done
149 # Extra 'echo' to normalize whitespace.
150 echo "no_install_progs_default='`echo $disabled_by_default_progs`'"
151 sed 's/^ *//' <<END
152 # Given the name of a variable containing a space-separated
153 # list of install-by-default programs and the actual list of
154 # do-not-install-by-default programs, modify the former variable
155 # to reflect any "do-install" and "don't-install" requests.
156 # That is, add any program specified via --enable-install-program,
157 # and remove any program specified via --enable-no-install-program.
158 # Note how the second argument below is a literal, with ","
159 # separators. That is required due to the way the macro works,
160 # and since the corresponding ./configure option argument is
161 # comma-separated on input.
162 gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [`\
163 echo $disabled_by_default_progs \
164 | sed 's/ /,/g'`])
167 1,--automake|1,--for-automake)
168 echo "## $msg"
169 progsdir=src
170 echo no_install__progs =
171 for p in $disabled_by_default_progs; do
172 echo no_install__progs += $progsdir/$p
173 done
174 echo build_if_possible__progs =
175 for p in $build_if_possible_progs; do
176 echo build_if_possible__progs += $progsdir/$p
177 done
178 echo default__progs =
179 for p in $normal_progs; do
180 echo default__progs += $progsdir/$p
181 done
183 1,--list-progs)
184 for p in $disabled_by_default_progs $build_if_possible_progs \
185 $normal_progs; do
186 echo $p
187 done
190 echo "$0: invalid usage" >&2; exit 2
192 esac
194 exit 0