monoautogen

--build configuration option prior to compiling mono from a git source code checkout


Recently I compiled mono from source in order to use it with asp.net vnext

I followed the instructions at Compiling Mono on OS X

Built using a git source code checkout.

One of the steps includes the following bash command:

CC='cc -m32' ./autogen.sh --prefix=$PREFIX --disable-nls --build=i386-apple-darwin11.2.0

Please explain the --build option when compiling mono on os x, I am trying to understand what different values I can pass to it and what they do. I could not find any mention of this option in the readme on github. So far I've only been able to deduce that omitting the option is required to compile mono in 64bit mode.


Solution

  • The --build option is related to the GNU build system.

    Check out this link: gcc, Configure Terms and History

    --build: it is the machine where you are building mono

    By default, if you do not specify its value, it will be found out running the script called config.guess, which basically runs the uname command (config.guess is part of the automake system, which you should have in order to build mono)

    Run the config.guess script if you want to know what values autogen.sh is going to use by default.

    By the way, I do not have OS X but I think, in order to build mono in 64bit mode you should run autogen.sh without CC='cc -m32'

    EDIT

    Just for fun, reading the config.guess script, for OS X the default values would be the result of running this:

    UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
    UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}