GNU indent for OSX

Discussion in 'Mac Programming' started by Harun, Nov 9, 2008.

  1. Harun macrumors member

    Joined:
    Sep 6, 2007
    #1
    I am new to programming on OSX but not new to programming. I needed GNU indent for a project. The version of indent that ships with OSX wasn't what I was used to. I downloaded GNU's version and after a few hiccups got the build to work. You can download the fixed version that will build from source here:

    http://tiny.cc/GbHc6

    To build it you need the GNU compiler that Apple provides in the XCode download. If you have all that taken care of, unpack the archive, go in to that directory and do this:

    $ autoconf
    $ ./configure
    $ make
    $ sudo make install

    You will still have the systems old indent in "/usr/bin/indent/". The new one you just built will be in "/usr/local/bin/indent/". You can resolve this however you wish. I just added the line:

    alias indent="/usr/local/bin/indent"

    To my .bash_profile.

    Enjoy
     
  2. netytan macrumors 6502

    netytan

    Joined:
    May 23, 2004
    #2
    Thanks Harun, this is exactly what I was looking for! Have you tried getting your changes merged back into the official code base?
     
  3. kocoman macrumors regular

    Joined:
    Dec 26, 2007
    #3
    Has anyone tried this in mountain lion and Xcode 4.5.1?

    thanks
     
  4. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
    #4
    Have you looked at Homebrew?

    http://mxcl.github.com/homebrew/

    If you install it, you can type 'brew install gnu-indent' and it will give you version 2.2.10
     
  5. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England

Share This Page