From: Jan Nieuwenhuizen Date: Tue, 24 Feb 2004 12:00:03 +0000 (+0000) Subject: * stepmake/stepmake/c++-vars.make (EXTRA_CXXFLAGS): Remove -pipe X-Git-Tag: release/2.1.28~44 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f169e9999944ce02479e4f54ade14036393ec854;p=lilypond.git * stepmake/stepmake/c++-vars.make (EXTRA_CXXFLAGS): Remove -pipe comment. * stepmake/aclocal.m4: Add --enable-pipe option, with check. Enabled by default, may save 10% compile time. --- diff --git a/ChangeLog b/ChangeLog index 2b6b744741..6574fef12a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-02-24 Jan Nieuwenhuizen + + * stepmake/stepmake/c++-vars.make (EXTRA_CXXFLAGS): Remove -pipe + comment. + + * stepmake/aclocal.m4: Add --enable-pipe option, with check. + Enabled by default, may save 10% compile time. + 2004-02-24 Han-Wen Nienhuys * Documentation/user/refman.itely (Customized accidental rules): diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index 6308424a7b..876f4203bf 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -152,6 +152,7 @@ AC_DEFUN(STEPMAKE_COMPILE, [ optimise_b=yes profile_b=no debug_b=yes + pipe_b=yes AC_ARG_ENABLE(checking, [ --enable-checking set runtime checks (assert calls). Default: on], @@ -169,6 +170,9 @@ AC_DEFUN(STEPMAKE_COMPILE, [ [ --enable-profiling compile with gprof support. Default: off], [profile_b=$enableval]) + AC_ARG_ENABLE(pipe, + [ --enable-pipe compile with -pipe. Default: on], + [pipe_b=$enableval]) if test "$checking_b" = no; then # ugh @@ -180,22 +184,35 @@ AC_DEFUN(STEPMAKE_COMPILE, [ OPTIMIZE="-O2 -finline-functions" fi - if test $profile_b = yes; then EXTRA_LIBES="-pg" OPTIMIZE="$OPTIMIZE -pg" fi - if test $debug_b = yes; then + if test $debug_b = yes; then OPTIMIZE="$OPTIMIZE -g" fi - - + AC_PROG_CC STEPMAKE_OPTIONAL_REQUIRED(CC, cc, $1) LD='$(CC)' AC_SUBST(LD) + # If -pipe requested, test if it works and add to CFLAGS. + if test "$pipe_b" = yes; then + save_cflags="$CFLAGS" + CFLAGS="-pipe $CFLAGS"; + AC_CACHE_CHECK([whether compiler understands -pipe], + [stepmake_cflags_pipe], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[/* -pipe test */]])], + [stepmake_cflags_pipe=yes], + [stepmake_cflags_pipe=no])) + CFLAGS=$save_cflags + if test $stepmake_cflags_pipe = yes; then + OPTIMIZE="$OPTIMIZE -pipe" + fi + fi + CFLAGS="$CFLAGS $OPTIMIZE" CPPFLAGS=${CPPFLAGS-""} @@ -211,6 +228,7 @@ AC_DEFUN(STEPMAKE_COMPILE, [ AC_MSG_RESULT([none]) ;; esac + AC_SUBST(cross_compiling) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) diff --git a/stepmake/stepmake/c++-vars.make b/stepmake/stepmake/c++-vars.make index 3f8c5803a6..09b9ad958e 100644 --- a/stepmake/stepmake/c++-vars.make +++ b/stepmake/stepmake/c++-vars.make @@ -1,12 +1,6 @@ include $(stepdir)/compile-vars.make -# added two warnings that are treated by cygwin32's gcc 2.7.2 as errors. -# huh, but still, no warnings even provoced with linux's gcc 2.7.2.1? - -# -pipe makes it go faster, but is not supported on all platforms. -# how much faster -- would this warrant configure check? -# EXTRA_CXXFLAGS= -Wall -Winline -W -Wmissing-prototypes -Wmissing-declarations -Wconversion EXTRA_CXXFLAGS= -W -Wall -Wconversion ALL_CXXFLAGS = $(CXXFLAGS) $(ICFLAGS) $(DEFINES) $(addprefix -I,$(INCLUDES)) $(USER_CFLAGS) $(EXTRA_CFLAGS) $(MODULE_CFLAGS) $($(PACKAGE)_CFLAGS) $($(PACKAGE)_CXXFLAGS) $(USER_CXXFLAGS) $(EXTRA_CXXFLAGS) $(MODULE_CXXFLAGS)