]> git.donarmstrong.com Git - lilypond.git/commitdiff
* stepmake/stepmake/c++-vars.make (EXTRA_CXXFLAGS): Remove -pipe
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 24 Feb 2004 12:00:03 +0000 (12:00 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 24 Feb 2004 12:00:03 +0000 (12:00 +0000)
comment.

* stepmake/aclocal.m4: Add --enable-pipe option, with check.
Enabled by default, may save 10% compile time.

ChangeLog
stepmake/aclocal.m4
stepmake/stepmake/c++-vars.make

index 2b6b744741694f36a0d19a915f9c7d5dca1b2aca..6574fef12ab8e2cd202ff71c2900b53915c37e58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-02-24  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * 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   <hanwen@xs4all.nl>
 
        * Documentation/user/refman.itely (Customized accidental rules):
index 6308424a7b17e911e323fc6817b88179dcf9bafb..876f4203bf343e077db181f59bcc03d2ecfe1c3a 100644 (file)
@@ -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)
index 3f8c5803a69d5a9dfbe2246a5c04a15743c11d87..09b9ad958e9b2fdf1c7c60e5879e4801bfdc7bfc 100644 (file)
@@ -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)