build: support fully excluding stdbuf from the build
authorMike Frysinger <vapier@gentoo.org>
Tue, 20 Jul 2010 18:13:40 +0000 (19:13 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 21 Jul 2010 23:34:04 +0000 (00:34 +0100)
* configure.ac (optional_pkglib_progs): Only update
after the main programs have been selected, so that
libstdbuf.so can be excluded if stdbuf also is.

configure.ac

index e7037a1..acd397e 100644 (file)
@@ -332,7 +332,6 @@ if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
 fi
 
 # Limit stdbuf to ELF systems with GCC
-optional_pkglib_progs=
 AC_MSG_CHECKING([whether this is an ELF system])
 AC_EGREP_CPP([yes], [#if __ELF__
 yes
@@ -341,7 +340,6 @@ AC_MSG_RESULT([$elf_sys])
 if test "$elf_sys" = "yes" && \
    test "$GCC" = "yes"; then
   gl_ADD_PROG([optional_bin_progs], [stdbuf])
-  gl_ADD_PROG([optional_pkglib_progs], [libstdbuf.so])
 fi
 
 ############################################################################
@@ -395,6 +393,13 @@ esac
 # corresponding ./configure option argument is comma-separated on input.
 gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname,su])
 
+# Now that we know which programs will actually be built up, figure out
+# which optional helper progs should be compiled.
+optional_pkglib_progs=
+case " $optional_bin_progs " in
+  *' stdbuf '*) gl_ADD_PROG([optional_pkglib_progs], [libstdbuf.so]) ;;
+esac
+
 # Set INSTALL_SU if su installation has been requested via
 # --enable-install-program=su.
 AC_SUBST([INSTALL_SU])