Permalink
Browse files

Build updates

	Add quiet build, depend in mod_mono_config.h, avoid 'unused' warning.
  • Loading branch information...
gonzalop committed Nov 18, 2010
1 parent a2355a8 commit 2f963433b499f2620110ba30fdd1a8e13076de6a
Showing with 54 additions and 1 deletion.
  1. +6 −0 configure.in
  2. +40 −0 scripts/patch-quiet.sh
  3. +1 −0 src/Makefile.am
  4. +7 −1 src/mod_mono.h
View
@@ -28,6 +28,7 @@ AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
fi
)
AC_ARG_ENABLE(quiet-build, [ --enable-quiet-build Enable quiet build (on by default)], enable_quiet_build=$enableval, enable_quiet_build=yes)
# Checks for header files.
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([netdb.h unistd.h])
@@ -439,6 +440,11 @@ AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(DFLT_MONO_CONFIG_DIR)
if test x$enable_quiet_build = xyes; then
AC_CONFIG_COMMANDS([quiet], [for i in `find src -name Makefile.in | sed -e 's/Makefile.in/Makefile/g'`; do if test -f $i; then $srcdir/scripts/patch-quiet.sh $i; fi; done], [shell=$SHELL])
AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/$echo "copying selected/$show "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool; sed -e 's/$ECHO "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
fi
AC_OUTPUT(
Makefile
mod_mono.conf
View
@@ -0,0 +1,40 @@
#!/bin/sh
#
# patch-quiet.sh: Shell script to rewrite Makefiles using libtool to be less verbose
#
if [ "$1" = "" ]; then
echo "Usage: patch-quiet.sh <path to Makefile>"
exit 1
fi
src=$1
if head -n1 $src | grep -q '# Postprocessed with patch-quiet\.sh'; then
# already handled
exit 0
fi
echo "# Postprocessed with patch-quiet.sh" > $src.tmp && cat $src >> $src.tmp && cp $src.tmp $src && rm -f $src.tmp
# compile
sed -e 's/^\t\(if \)\?$(COMPILE)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(COMPILE)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
sed -e 's/^\t\(if \)\?$(LTCOMPILE)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(LTCOMPILE)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
sed -e 's/^\t\(if \)\?$(LTCXXCOMPILE)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(LTCXXCOMPILE)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
sed -e 's/^\t\(if \)\?$(LIBTOOL)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(LIBTOOL)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
# link
# automake defines multiple symbols ending with LINK
sed -e 's/^\t$(\(.*LINK\))/\t$(if $(V),,@echo -e "LD\\t$@";) $(\1)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
#sed -e 's/LINK = $(LIBTOOL)/LINK = $(if $(V),,@echo -e "LD\\t$@";) $(LIBTOOL)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
# CC
sed -e 's/^\t\(if \)\?$(CC)/\t$(if $(V),,@echo -e "CC\\t$@";) \1$(CC)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
# mv
sed -e 's/^\tmv -f/\t$(if $(V),,@)mv -f/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
sed -e 's/^am__mv = /&$(if $(V),,@)/' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
# libtool messages
sed -e 's/\$(LIBTOOL)/$(LIBTOOL) $(if $(V),,--quiet)/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
# This causes this script to be rerun if Makefile.am changes
sed -e 's/am__depfiles_maybe = depfiles/& quiet/g' < $src > $src.tmp && cp $src.tmp $src && rm -f $src.tmp
View
@@ -3,6 +3,7 @@ CLEANFILES = .libs/libmod_mono.so .libs/libmod_mono_old.so *~
lib_LTLIBRARIES = mod_mono.la
mod_mono_la_SOURCES = mod_mono.c mod_mono.h mono-io-portability.c mono-io-portability.h glib_compat.h glib_compat.c
mod_mono_la_LDFLAGS = -module
mod_mono_la_DEPENDENCIES = ../include/mod_mono_config.h
#/usr/sbin/apxs -c -I../include -I. -D HAVE_CONFIG_H mod_mono.c
mod_mono_la_CFLAGS = -Wall -DDFLT_MONO_CONFIG_DIR=\"$(DFLT_MONO_CONFIG_DIR)\"
View
@@ -147,7 +147,13 @@ enum Cmd {
LAST_COMMAND
};
static char *cmdNames [] = {
#ifdef __GNUC__
#define UNUSED __attribute__ ((unused))
#else
#define UNUSED
#endif
static char UNUSED *cmdNames [] = {
"SEND_FROM_MEMORY",
"GET_SERVER_VARIABLES",
"SET_RESPONSE_HEADERS",

0 comments on commit 2f96343

Please sign in to comment.