如何在Solaris上构建Git

时间:2014-01-09 01:42:17

标签: git makefile solaris

我从以下网址下载了Git来源:

https://github.com/git/git

现在尝试在Solaris 10g上构建。

我不确定在Makefile中需要更改什么,如果有的话,因为没有“configure”文件。当我跑步时,我得到:

cc: illegal option -Wall
make: *** [credential-store.o] Error 1

我确实安装了gcc,但我不确定如何告诉Makefile使用它。

更新

下面更新了每个答案的Makefile,但我仍然无法编译:

make
CC credential-store.o
cc1: error: unrecognized command line option "-fprofile-correction"
make: *** [credential-store.o] Error 1

3 个答案:

答案 0 :(得分:4)

Makefile的第396行修改为

CC = gcc

关于-fprofile-correction问题,您可以通过从Makefile的第1558行删除有问题的选项来解决此问题。 也就是说,改变

CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1

CFLAGS += -fprofile-use=$(PROFILE_DIR) -DNO_NORETURN=1

答案 1 :(得分:1)

看看OpenCSW。您可以获得一个有效的git包以及如何构建它的来源。

答案 2 :(得分:0)

2年后,当前版本的git是2.9.3,但是谷歌把我送到这里作为参考。

我原来的编译错误是:

    LINK git-credential-store
ld: fatal: library -liconv: not found
ld: fatal: file processing errors. No output written to git-credential-store
collect2: ld returned 1 exit status
make: *** [Makefile:2018: git-credential-store] Error 1
$

它使用编译(gnu make在Solaris make之前,在路径中):

make configure      # creates the configure script
./configure --with-iconv=/usr/local --with-openssl=/usr/local --with-zlib=/usr/local --with-python=/usr/sfw/bin
make ICONV_LINK='-L/usr/local/lib -lintl' CC=gcc

编译GNU软件需要gmake或同等版本。由于其他项目,我最近重建了/ usr / sfw /中编译到/ usr / local中的大多数内容,包括最新的gnu make。找到了iconv& gettext是相互关联的,他们需要知道彼此的存在,然后编译两次。

INSTALL档案和./configure --help对我来说没有足够的参考资料,但他们让我获得90%的胜利。

直到我点击此引用,我才找到成功编译所需的ICONV_LINK='-L/usr/local/lib -lintl'。第一次,我完全跟着它进行了所有编辑,直到我把它缩小到我上面发布的内容: http://git.661346.n2.nabble.com/Compiling-git-on-Solaris-Recipe-included-td7541556.html

主持人&编译器:

$ uname -a
SunOS mysunbox 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Blade-1500 Solaris
$
$ gcc -v
Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
Configured with: /sfw10/builds/build/sfw10-patch/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/ccs/bin/as --without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
$

希望这有助于某人! (未来可能还有2年)

相关问题