# Compiling git on Solaris. Recipe included.

3 messages from 2012-05-09 to 2012-05-09. Participants: Mark Ashley, Junio C Hamano, Ben Walton.
Thread: https://gitlist.dev/t/30480

## Mark Ashley, 2012-05-09 03:11

Subject: Compiling git on Solaris. Recipe included.
Message-ID: <CADmdEsnSt5Do+EuJHzfGxNY6aCnGA6AF6fbEETAGpoL6p7Nuwg@mail.gmail.com>
URL: https://gitlist.dev/e/CADmdEsnSt5Do%2BEuJHzfGxNY6aCnGA6AF6fbEETAGpoL6p7Nuwg%40mail.gmail.com

```
Hey folks,

I'm compiling git on Solaris 10 and 11 SPARC and X86 using the Sun Studio
12.x compilers.

git doesn't compile out of the box, there are (see below) lots of tweaks to
have it use open source stuff in /usr/local/* and also to pass some of the
configure tests for inet_ntop and -lintl.

This recipe below fixes everything and I'm on to using git now.

Thanks,
Mark.

  cd /var/tmp
  rm -rf /git git-1.7.10
   untgz /usr/local/src/utils/git-1.7.10.tar.gz
  cd git-1.7.10
   mkdir /git

  /bin/perl -pe "s#^ifndef V#ifdef XYZZY#" -i Makefile
   /bin/perl -pe "s#^ifndef V#ifdef XYZZY#" -i git-gui/Makefile
  /bin/perl -pe "s#^ifndef V#ifdef XYZZY#" -i git_remote_helpers/Makefile
   /bin/perl -pe "s#^ifndef V#ifdef XYZZY#" -i gitk-git/Makefile
  /bin/perl -pe "s#^ifndef V#ifdef XYZZY#" -i gitweb/Makefile
   /bin/perl -pe "s#^ifndef V#ifdef XYZZY#" -i perl/Makefile
  /bin/perl -pe "s#^ifndef V#ifdef XYZZY#" -i templates/Makefile

  /bin/perl -pe "s#-lintl#-L/usr/local/lib -lintl#" -i Makefile
   /bin/perl -pe "s#-Wall##" -i Makefile
  /bin/perl -pe "s#^TCL_PATH = tclsh#TCL_PATH = /usr/local/bin/tclsh8.5#"
-i Makefile
   /bin/perl -pe "s#tclsh#/usr/local/bin/tclsh8.5#" -i git-gui/Makefile
  /bin/perl -pe "s#tclsh#/usr/local/bin/tclsh8.5#" -i gitk-git/Makefile
   /bin/perl -pe
"s#LIBC_CONTAINS_LIBINTL=YesPlease#LIBC_CONTAINS_LIBINTL=#" -i configure
  /bin/perl -pe "s#NO_INET_NTOP=YesPlease#NEEDS_RESOLV=YesPlease#" -i
configure
   setenv TCL_PATH /usr/local/bin/tclsh8.5
  ./configure --prefix=/git \
               --with-iconv=/usr/local \
              --with-openssl=/usr/local \
               --with-curl=/usr/local \
              --with-expat=/usr/local \
               --with-zlib=/usr/local \
              --with-tcltk=/usr/local/bin/tclsh8.5 \
                --with-python=/usr/local/bin/python
  gmake
   gmake INSTALL=/usr/local/bin/ginstall install
  unsetenv TCL_PATH

```

## Junio C Hamano, 2012-05-09 17:45

Subject: Re: Compiling git on Solaris. Recipe included.
Message-ID: <7vd36dtfi2.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd36dtfi2.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CADmdEsnSt5Do+EuJHzfGxNY6aCnGA6AF6fbEETAGpoL6p7Nuwg@mail.gmail.com>

```
Mark Ashley <mark@ibiblio.org> writes:

> I'm compiling git on Solaris 10 and 11 SPARC and X86 using the Sun Studio
> 12.x compilers.
>
> git doesn't compile out of the box, there are (see below) lots of tweaks to

Thanks for an interest in Git, but I am somewhat dissapointed by your
message.  As our Makefiles strive to offer necessary knobs to tweak from
the command line for platform-specific glitches, from "Recipe included" on
the subject, I think people would have expected to see something like:

    gmake   VAR1=VAL1 \
            VAR2=VAL2 \
            VAR3=VAL3 ...

or perhaps:

    cat >config.mak <<-EOF
    VAR1=VAL1
    VAR2=VAL2
    ...
    EOF

and not a sequence of commands to rewrite files in-tree.

Other people have built git on Solaris but probably not many people have
done so recently.  The platform specific knobs in our Makefiles may have
to be extended to accomodate newer version of Solaris.  So the "Recipe"
may not be just the series of make variables, but needs a patch or two to
the Makefile to enhance the tweaks.

See 614dd90 (Makefile: SunOS 5.6 portability fix, 2010-05-14) for an
example of such a patch.

Thanks.

```

## Ben Walton, 2012-05-09 17:58

Subject: Re: Compiling git on Solaris. Recipe included.
Message-ID: <1336586103-sup-4584@pinkfloyd.chass.utoronto.ca>
URL: https://gitlist.dev/e/1336586103-sup-4584%40pinkfloyd.chass.utoronto.ca
In-Reply-To: <CADmdEsnSt5Do+EuJHzfGxNY6aCnGA6AF6fbEETAGpoL6p7Nuwg@mail.gmail.com>

```
Excerpts from Mark Ashley's message of Tue May 08 23:11:30 -0400 2012:

Hi Mark,

> I'm compiling git on Solaris 10 and 11 SPARC and X86 using the Sun
> Studio 12.x compilers.

I'm building for solaris 9+ at OpenCSW with the studio compilers.

> git doesn't compile out of the box, there are (see below) lots of
> tweaks to have it use open source stuff in /usr/local/* and also to
> pass some of the configure tests for inet_ntop and -lintl.

I use the following patch for -lintl:
https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/git/trunk/files/0007-on-solaris-we-need-to-use-lintl-to-allow-the-new-i18.patch

(For some reason, I didn't get around to generalizing it for
submission yet.)

The build recipe I'm using (for our build system GAR) is here:
https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/git/trunk/Makefile

(There is some baggage in the recipe that needs cleanup, such as old
patches that are merged or no longer required, but it builds a nice
clean package that passes the test suite.)

Hope that helps.

Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

```
