1 dnl Make automake/libtool output more friendly to humans
3 dnl SHAVE_INIT([shavedir])
5 dnl shavedir: the directory where the shave scripts are, it defaults to
8 dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just
9 dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and
10 dnl LIBTOOL, you don't want the configure tests to have these variables
12 dnl * This macro requires GNU make's -s option.
14 AC_DEFUN([SHAVE_INIT],
16 dnl enable/disable shave
17 AC_ARG_ENABLE([shave],
18 AS_HELP_STRING([--enable-shave],
19 [use shave to make the build pretty [[default=no]]]),,
22 if test x"$enable_shave" = xyes; then
23 dnl where can we find the shave scripts?
25 [shavedir='$(top_builddir)'],
26 [shavedir='$(top_builddir)'/$1])
30 AC_SUBST([MAKEFLAGS], [-s])
31 AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`'])
34 AC_CHECK_PROG(SED,sed,sed,false)
36 dnl substitute libtool
37 SHAVE_SAVED_LIBTOOL=$LIBTOOL
38 AC_SUBST(SHAVE_SAVED_LIBTOOL)
39 LIBTOOL="\$(SHELL) \$(shavedir)/shave-libtool '\$(SHAVE_SAVED_LIBTOOL)'"
45 AC_SUBST(SHAVE_SAVED_CC)
46 AC_SUBST(SHAVE_SAVED_CXX)
47 CC="\$(SHELL) \$(shavedir)/shave cc '\$(SHAVE_SAVED_CC)'"
48 CXX="\$(SHELL) \$(shavedir)/shave cxx '\$(SHAVE_SAVED_CXX)'"
61 AC_DEFUN([SHAVE_OUTPUT],
63 if test x"$enable_shave" = xyes; then
64 dnl small workaround to fix libtool itself
65 dnl it's shokingly hard to find a better way, really! wtf...
66 test -f $srcdir/libtool && (tmpfile=`mktemp` && cat $srcdir/libtool | sed "s,^LTCC=.*$,LTCC=\"$SHELL $ac_pwd/shave cc $SHAVE_SAVED_CC\"," > $tmpfile && mv $tmpfile $srcdir/libtool)