b2sum: a new checksum utility with md5sum like interface
[coreutils.git] / build-aux / gen-lists-of-programs.sh
blob2666492e82ddc9bf5bf3df38a694e38d8d057942
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 b2sum
45 base64
46 base32
47 basename
48 cat
49 chcon
50 chgrp
51 chmod
52 chown
53 cksum
54 comm
56 csplit
57 cut
58 date
60 dir
61 dircolors
62 dirname
64 echo
65 env
66 expand
67 expr
68 factor
69 false
70 fmt
71 fold
72 ginstall
73 groups
74 head
76 join
77 kill
78 link
80 logname
82 md5sum
83 mkdir
84 mkfifo
85 mknod
86 mktemp
89 nproc
90 nohup
91 numfmt
93 paste
94 pathchk
96 printenv
97 printf
98 ptx
99 pwd
100 readlink
101 realpath
103 rmdir
104 runcon
106 sha1sum
107 sha224sum
108 sha256sum
109 sha384sum
110 sha512sum
111 shred
112 shuf
113 sleep
114 sort
115 split
116 stat
118 sync
120 tail
122 test
123 timeout
124 touch
126 true
127 truncate
128 tsort
130 uname
131 unexpand
132 uniq
133 unlink
134 vdir
136 whoami
140 me=`echo "$0" | sed 's,.*/,,'`
141 msg="Automatically generated by $me. DO NOT EDIT BY HAND!"
143 case $#,$1 in
144 1,--autoconf|1,--for-autoconf)
145 echo "dnl $msg"
146 for p in $normal_progs; do
147 test x"$p" = x"[" && p='@<:@'
148 echo "gl_ADD_PROG([optional_bin_progs], [$p])"
149 done
150 # Extra 'echo' to normalize whitespace.
151 echo "no_install_progs_default='`echo $disabled_by_default_progs`'"
152 sed 's/^ *//' <<END
153 # Given the name of a variable containing a space-separated
154 # list of install-by-default programs and the actual list of
155 # do-not-install-by-default programs, modify the former variable
156 # to reflect any "do-install" and "don't-install" requests.
157 # That is, add any program specified via --enable-install-program,
158 # and remove any program specified via --enable-no-install-program.
159 # Note how the second argument below is a literal, with ","
160 # separators. That is required due to the way the macro works,
161 # and since the corresponding ./configure option argument is
162 # comma-separated on input.
163 gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [`\
164 echo $disabled_by_default_progs \
165 | sed 's/ /,/g'`])
168 1,--automake|1,--for-automake)
169 echo "## $msg"
170 progsdir=src
171 echo no_install__progs =
172 for p in $disabled_by_default_progs; do
173 echo no_install__progs += $progsdir/$p
174 done
175 echo build_if_possible__progs =
176 for p in $build_if_possible_progs; do
177 echo build_if_possible__progs += $progsdir/$p
178 done
179 echo default__progs =
180 for p in $normal_progs; do
181 echo default__progs += $progsdir/$p
182 done
184 1,--list-progs)
185 for p in $disabled_by_default_progs $build_if_possible_progs \
186 $normal_progs; do
187 echo $p
188 done
191 echo "$0: invalid usage" >&2; exit 2
193 esac
195 exit 0