diff --git a/Makefile.pre.in b/Makefile.pre.in index 318bbadfbf4..62db9c1374a 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -436,10 +436,14 @@ platform: $(BUILDPYTHON) # Build the shared modules sharedmods: $(BUILDPYTHON) - @case $$MAKEFLAGS in \ - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ - esac + if which getopt >/dev/null; then \ + mflags=`getopt s $$MAKEFLAGS 2>/dev/null | sed 's/ --.*/ /'`; \ + else \ + mflags=" $$MAKEFLAGS "; \ + fi; \ + case $$mflags in "* -s *") quiet=-q; esac; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + ./$(BUILDPYTHON) -E $(srcdir)/setup.py $$quiet build # Build static library # avoid long command lines, same as LIBRARY_OBJS