5

I'm curious as to what build flags are available to me when installing gcc 4.8 using brew.

This question explains how to install gcc 4.8 using brew, but only specifies two possible flags i.e (--enable-cxx and --enable-fortran).

Is there a list of what's available or can someone iterate them for me?

If it matters I am running OS X 10.7.5 on the Intel i5 dual core.

6

Use brew options. On my machine I get this:

brew options gcc48
--enable-all-languages
        Enable all compilers and languages, except Ada
--enable-cxx
        Build the g++ compiler
--enable-fortran
        Build the gfortran compiler
--enable-java
        Buld the gcj compiler
--enable-multilib
        Build with multilib support
--enable-nls
        Build with native language support (localization)
--enable-objc 
        Enable Objective-C language support
--enable-objcxx
        Enable Objective-C++ language support
--enable-profiled-build
        Make use of profile guided optimization when bootstrapping GCC
  • Excellent! Exactly what I wanted to know. – quine Aug 14 '13 at 13:29
1

I'm not aware of a direct way to list all the possible flags for different software. With brew options [formula] you can list the build flags you can use directly with brew install. These options are defined in the Formula of the software and you can inspect it with brew edit [formula] (e.g. brew edit gcc48 and search for option lines).

However, at least with gcc (and any software that uses Autoconf), you can list all possible flags by following the steps below.

First, use brew install -i gcc48 to get a shell with the package to be installed extracted to a temporary directory. From there, you can use ./configure --help to list all possible flags for the particular software.

If you want to use some of the flags not possible with brew, you can proceed as you would with a normal installation without brew (./configure [flags]; make; make install). After that, when you exit, brew should pick up the finished build and you are done.

If you just exit after taking a look at the ./configure --help, brew notices that the there is nothing to be installed and exits with an error ("Error: Empty installation"). The same happens when there is some error in the actual build process ("Aborting due to non-zero exit status").

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .