63
# The test suite needs to know if we have a working perl.
64
# FIXME: this is suboptimal. Ideally, we would be able to call gl_PERL
65
# with an ACTION-IF-NOT-FOUND argument ...
67
case $PERL in *"/missing "*) cu_have_perl=no;; esac
68
AM_CONDITIONAL([HAVE_PERL], [test $cu_have_perl = yes])
48
70
AC_ARG_ENABLE([gcc-warnings],
49
71
[AS_HELP_STRING([--enable-gcc-warnings],
50
[turn on lots of GCC warnings (for developers)])],
72
[turn on many GCC warnings (for developers; best with GNU make)])],
51
73
[case $enableval in
53
75
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
55
77
gl_gcc_warnings=$enableval],
78
[if test -d "$srcdir"/.git; then
85
# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
86
# ------------------------------------------------
87
# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
88
# Otherwise, run RUN-IF-NOT-FOUND.
89
AC_DEFUN([gl_GCC_VERSION_IFELSE],
93
#if ($1) < __GNUC__ || (($1) == __GNUC__ && ($2) <= __GNUC_MINOR__)
96
# error "your version of gcc is older than $1.$2"
59
103
if test "$gl_gcc_warnings" = yes; then
360
419
############################################################################
361
mk="$srcdir/src/Makefile.am"
362
# Extract all literal names from the definition of $(EXTRA_PROGRAMS)
363
# in $mk but don't expand the variable references.
364
# Append each literal name to $optional_bin_progs.
366
for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
367
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
368
| tr -s '\\015\\012\\\\' ' '`; do
369
gl_ADD_PROG([optional_bin_progs], $gl_i)
372
# As above, extract literal names from the definition of $(no_install__progs)
373
# in $mk but don't expand the variable references.
375
t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
376
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
377
| tr -s '\\015\\012\\\\' ' '`
378
# Remove any trailing space.
379
no_install_progs_default=`echo "$t"|sed 's/ $//'`
381
# Unfortunately, due to the way autoconf's AS_HELP_STRING works, the list
382
# of default-not-installed programs, "arch hostname su", must appear in two
383
# places: in this file below, and in $mk. Using "$no_install_progs_default"
384
# below cannot work. And we can't substitute the names into $mk because
385
# automake needs the literals, too.
386
# The compromise is to ensure that the space-separated list extracted
387
# above matches the literal 2nd argument below.
388
c="$srcdir/configure.ac"
389
re='^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])'
390
t=`sed -n '/'"$re"'/{s/'"$re"'/\1/;s/,/ /gp
393
$no_install_progs_default) ;;
394
*) AC_MSG_ERROR([[internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t,
395
does not match the list of default-not-installed programs
396
($no_install_progs_default) also recorded in $mk]],
400
# Given the name of a variable containing a space-separated list of
401
# install-by-default programs and the actual list do-not-install-by-default
402
# programs, modify the former variable to reflect any "do-install" and
403
# "don't-install" requests.
404
# I.e., add any program name specified via --enable-install-program=..., and
405
# remove any program name specified via --enable-no-install-program=...
406
# Note how the second argument below is a literal, with "," separators.
407
# That is required due to the way the macro works, and since the
408
# corresponding ./configure option argument is comma-separated on input.
409
gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname,su])
411
# Now that we know which programs will actually be built up, figure out
421
dnl Autogenerated by the 'gen-lists-of-programs.sh' auxiliary script.
422
dnl Issue proper calls to the macros gl_INCLUDE_EXCLUDE_PROG and
423
dnl gl_ADD_PROG (updating $optional_bin_progs), and generate the list
424
dnl of coreutils programs to be built only upon explicit user request,
425
dnl saving that list in the $no_install_progs_default shell variable.
426
m4_include([m4/cu-progs.m4])
428
# Now that we know which programs will actually be built, determine
412
429
# which optional helper progs should be compiled.
413
optional_pkglib_progs=
414
case " $optional_bin_progs " in
415
*' stdbuf '*) gl_ADD_PROG([optional_pkglib_progs], [libstdbuf.so]) ;;
418
# Set INSTALL_SU if su installation has been requested via
419
# --enable-install-program=su.
420
AC_SUBST([INSTALL_SU])
421
case " $optional_bin_progs " in
422
*' su '*) INSTALL_SU=yes ;;
426
MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'`
428
# Change "ginstall.1" to "install.1" in $MAN.
429
MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \
430
| tr '\015\012' ' '; echo`
432
# Remove [.1, since writing a portable rule for it in man/Makefile.am
433
# is not practical. The sed LHS below uses the autoconf quadrigraph
435
MAN=`echo "$MAN"|sed 's/\@<:@\.1//'`
437
OPTIONAL_BIN_PROGS=`echo "$optional_bin_progs "|sed 's/ /\$(EXEEXT) /g;s/ $//'`
438
AC_SUBST([OPTIONAL_BIN_PROGS])
439
OPTIONAL_PKGLIB_PROGS=`echo "$optional_pkglib_progs " | sed 's/ $//'`
440
AC_SUBST([OPTIONAL_PKGLIB_PROGS])
441
NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default
442
AC_SUBST([NO_INSTALL_PROGS_DEFAULT])
430
case " $optional_bin_progs " in
431
*' stdbuf '*) pkglibexec_PROGRAMS='src/libstdbuf.so';;
432
*) pkglibexec_PROGRAMS='';;
436
for p in $optional_bin_progs; do
437
# Change "ginstall.1" to "install.1".
438
test $p = ginstall && p=install
439
# Ignore the "[" program, since writing a portable make rule to
440
# generate its manpage is not practical.
441
dnl Use the autoconf-provided quadrigraph to represent "[",
442
dnl otherwise we will incur in dreadful quoting issues.
443
test x$p = x'@<:@' && continue
447
# Not installed by "make install", but must be built when creating
448
# a distribution tarball.
449
EXTRA_MANS=`for p in $no_install_progs_default; do echo man/$p.1; done`
451
# The programs built and installed by "make && make install".
452
# Since this is AC_SUBST'd, Automake won't be able to perform rewrite
453
# with $(EXEEXT) appending on it, so we have to do it ourselves -- in
454
# this case, only for $(bin_PROGRAMS).
456
for p in $optional_bin_progs; do echo src/"$p"'$(EXEEXT)'; done`
458
# Normalize whitespace.
459
man1_MANS=`echo $man1_MANS`
460
EXTRA_MANS=`echo $EXTRA_MANS`
461
bin_PROGRAMS=`echo $bin_PROGRAMS`
462
pkglibexec_PROGS=`echo $pkglibexec_PROGRAMS`
464
AC_SUBST([bin_PROGRAMS]) AM_SUBST_NOTMAKE([bin_PROGRAMS])
465
AC_SUBST([pkglibexec_PROGRAMS]) AM_SUBST_NOTMAKE([pkglibexec_PROGRAMS])
466
AC_SUBST([man1_MANS]) AM_SUBST_NOTMAKE([man1_MANS])
467
AC_SUBST([EXTRA_MANS]) AM_SUBST_NOTMAKE([EXTRA_MANS])
469
AC_SUBST([built_programs], [$optional_bin_progs])
444
471
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
446
# Arrange to rerun configure whenever the file, src/Makefile.am,
447
# containing the list of program names changes.
448
CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/src/Makefile.am'
449
AC_SUBST([CONFIG_STATUS_DEPENDENCIES])
450
473
############################################################################
452
475
# As long as "grep 'PRI[diouxX]' po/*.pot" reports matches in