#3537: flea/muttbug tries to run C compiler with -v option to get the version
number
--------------------+-------------------------------------------------------
 Reporter:  marcel  |       Owner:  mutt-dev
     Type:  defect  |      Status:  new     
 Priority:  major   |   Milestone:  1.6     
Component:  mutt    |     Version:  1.5.21  
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by richburridge):

 We have recently fixed this in the version of mutt delivered in
 the Solaris 11 (Update 1 build #5) O/S with the following approach.

 This is for mutt version 1.5.21:

 Firstly, the following patch is applied to muttbug.sh.in

 +--- mutt-1.5.21/muttbug.sh.in.orig     Thu Dec  1 09:37:14 2011
 ++++ mutt-1.5.21/muttbug.sh.in  Fri Dec  2 10:52:31 2011
 +@@ -251,14 +251,9 @@
 + echo
 + echo "-- Build environment information"
 + echo
 +-echo "(Note: This is the build environment installed on the system"
 +-echo "muttbug is run on.  Information may or may not match the
 environment"
 +-echo "used to build mutt.)"
 ++echo "- C compiler version information"
 ++echo "XXX-CUSAGE-XXX"
 + echo
 +-echo "- gcc version information"
 +-echo "@CC@"
 +-@CC@ -v 2>&1
 +-echo
 + echo "- CFLAGS"
 + echo @CFLAGS@
 +

 after the mutt tarball has been downloaded and unpacked.

 You will see that this replaces running "@CC@ -v 2>&" with the special
 string
 "XXX-CUSAGE-XXX".

 We now add a special post-configuration action to our top-level Makefile.
 This Makefile is one level above the mutt-1.5.21 one and controls how we
 configure, build and install the source code and how we publish the final
 package:

 # Add in the C compiler information to the muttbug (a.k.a. flea) script.
 COMPONENT_POST_CONFIGURE_ACTION = \
        $(GSED) -i 's%XXX-CUSAGE-XXX%$(shell $(CC) -V 2>&1 | head -1)%' \
        $(BUILD_DIR_32)/muttbug.sh

 This will replace that "XXX-CUSAGE-XXX" string with the output of "$(CC)
 -V 2>&1"
 at mutt build time.

 There are a couple things to note here:

 1/ We use the Sun Studio compiler when we build mutt for Solaris.
 Therefore
    we need the "-V" option, not the "-v" option used by gcc.

 2/ This approach is obviously not general enough for the generic mutt
 distribution
    but it does give an indication of the approach to take to fix this
 problem.
    In other words, this information should be determined at mutt build
 time and
    automatically embedded in the muttbug.sh/flea script, rather than
 trying to
    obtain it at runtime, and having it being potentially different for the
 system
    that mutt is running on versus the system it was built on. You really
 need it
    for the latter, otherwise it's not very helpful.

 Hope this helps you solve the problem.

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/3537#comment:1>
Mutt <http://www.mutt.org/>
The Mutt mail user agent

Reply via email to