From: Junio C Hamano Date: Sat, 13 Jun 2009 19:48:34 +0000 (-0700) Subject: Merge branch 'bc/solaris' X-Git-Tag: v1.6.4-rc0~66 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=436f66b7;p=git.git Merge branch 'bc/solaris' * bc/solaris: configure: test whether -lresolv is needed Makefile: insert SANE_TOOL_PATH to PATH before /bin or /usr/bin git-compat-util.h: avoid using c99 flex array feature with Sun compiler 5.8 Makefile: add section for SunOS 5.7 Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH Makefile: define __sun__ on SunOS git-compat-util.h: tweak the way _XOPEN_SOURCE is set on Solaris On Solaris choose the OLD_ICONV iconv() declaration based on the UNIX spec Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall Conflicts: Makefile --- 436f66b7e908d5ce2f292d1fd4e7f6f9de7c6fa1 diff --cc config.mak.in index e8d96e88b,d0cd15581..dd6045131 --- a/config.mak.in +++ b/config.mak.in @@@ -30,9 -30,9 +30,10 @@@ NEEDS_SSL_WITH_CRYPTO=@NEEDS_SSL_WITH_C NO_OPENSSL=@NO_OPENSSL@ NO_CURL=@NO_CURL@ NO_EXPAT=@NO_EXPAT@ +NO_LIBGEN_H=@NO_LIBGEN_H@ NEEDS_LIBICONV=@NEEDS_LIBICONV@ NEEDS_SOCKET=@NEEDS_SOCKET@ + NEEDS_RESOLV=@NEEDS_RESOLV@ NO_SYS_SELECT_H=@NO_SYS_SELECT_H@ NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@ NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT@ diff --cc git-compat-util.h index f25f7f1a9,48d99fab8..919b7f1ad --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -39,12 -39,23 +39,25 @@@ /* Approximation of the length of the decimal representation of this type. */ #define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) - #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) + #if defined(__sun__) + /* + * On Solaris, when _XOPEN_EXTENDED is set, its header file + * forces the programs to be XPG4v2, defeating any _XOPEN_SOURCE + * setting to say we are XPG5 or XPG6. Also on Solaris, + * XPG6 programs must be compiled with a c99 compiler, while + * non XPG6 programs must be compiled with a pre-c99 compiler. + */ + # if __STDC_VERSION__ - 0 >= 199901L + # define _XOPEN_SOURCE 600 + # else + # define _XOPEN_SOURCE 500 + # endif + #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ +#ifndef __sun__ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ #endif +#endif #define _ALL_SOURCE 1 #define _GNU_SOURCE 1 #define _BSD_SOURCE 1