What build flags are available for brew install of gcc?

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

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").