kalid55 / git-core

Automatically exported from code.google.com/p/git-core
Other
0 stars 0 forks source link

git 1.7.9.4 doesn't correct detect the need for GNU gettext/libintl on Solaris #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. configure git 1.7.9.4 on Solaris
2. make

What is the expected output? What do you see instead?

The expected output is a successful link, but what I actually get is

cc -I/local/include -I/local/gnu/include -I/local/openssl/include 
-I/local/include -I/local/krb5/include -I/local/BerkeleyDB/include 
-I/local/include -Xa -xO3 -xtarget=generic -m64 -xarch=generic -I/local/include 
-I/local/gnu/include -I/local/openssl/include -I/local/include 
-I/local/krb5/include -I/local/BerkeleyDB/include -I/local/include -I. 
-D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H -DNO_D_TYPE_IN_DIRENT -DOLD_ICONV 
-mt -DSHA1_HEADER='<openssl/sha.h>'  -DNO_STRCASESTR -Icompat/fnmatch 
-DNO_FNMATCH_CASEFOLD -DNO_MKDTEMP -DNO_MKSTEMPS -DNO_MEMMEM -Icompat/regex -o 
git-daemon -L/local/lib/64 -L/local/gnu/lib/64 -L/local/openssl/lib/64 
-L/local/lib/64 -L/local/krb5/lib/64 -L/local/BerkeleyDB/lib/64 -L/local/lib/64 
 daemon.o libgit.a xdiff/lib.a  -lz -lsocket -lnsl -lresolv  -lcrypto -mt
Undefined                       first referenced
 symbol                             in file
libintl_bind_textdomain_codeset     libgit.a(gettext.o)
libintl_gettext                     libgit.a(commit.o)
libintl_textdomain                  libgit.a(gettext.o)
libintl_bindtextdomain              libgit.a(gettext.o)
libintl_ngettext                    libgit.a(remote.o)
ld: fatal: Symbol referencing errors. No output written to git-daemon
gmake: *** [git-daemon] Error 2

What version of the product are you using? On what operating system?

git 1.7.9.4 on x86_64-sun-solaris2.10

Please provide any additional information below.

The problem is (I think) because git is detecting that Solaris has a gettext() 
function in libc:

checking for basename in -lc... yes
checking for gettext in -lc... yes
checking how to run the C preprocessor... cc -E

*but* that gettext() function is incompatible with GNU gettext.  Configure then 
later detects the presence of GNU libintl.h:

checking for unistd.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes

so at this point it believes that it has what it needs.  The problem is that it 
has the GNU gettext headers, which remap all the functions to the libintl_* 
names, but it thinks it can link with libc to get the functions it needs, when 
it can't.  It needs to link with libintl.

The easiest fix would probably just be to use the AM_GNU_GETTEXT macro to 
detect what's needed to get GNU gettext.  That's what scores of other packages 
do, but it requires a lot of support files from autoconf & automake.

The other potential way to work around it is to just hack configure so that if 
the target host is Solaris, ignore the gettext() result from libc.

Original issue reported on code.google.com by Timothy....@gmail.com on 22 Mar 2012 at 11:27