From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Here are the portability patches we needed at TWW to enable
git-1.7.0.2 to compile and run on all of the wide range of Unix
machines we support. These patches apply to the git-1.7.0.2 release,
and address all of the feedback from the previous two times I posted
them to this list, most particularly splitting everything into many
small self-contained chunks.
Note that I have not invested the time to figure out why the testsuite
is mostly useless on everything but Linux and Solaris 8+, because I'm
reasonably satisfied that the build itself is working properly. Most
likely, it is merely GNUisms in the way the test cases call external
tools. But maybe I'm missing something, but even the 3 new patches to
address test errors when diff does not support the -u option don't
improve the testsuite situation on HPUX, AIX, OSF1 and Solaris 7 and
older.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Without this patch there is no straight forward way to pass additional
CPPFLAGS at configure-time. At TWW, everything non-vendor package is
installed to its own subdirectory, so we need the following to show
the preprocessor where the headers for the libraries we will link
later can be found:
$SHELL ./configure \
CPPFLAGS="-I${SB_VAR_CURL_INC}\
-I${SB_VAR_LIBEXPAT_INC}\
-I${SB_VAR_LIBZ_INC}\
${CPPFLAGS+ $CPPFLAGS}" <<...>>
---
Makefile | 6 ++++--
config.mak.in | 1 +
configure.ac | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
There is no nanosecond field on HPUX.
---
Makefile | 1 +
1 file changed, 1 insertion(+)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Being careful not to overwrite the results of testing for hstrerror in
libresolv, also test whether inet_ntop/inet_pton are available from
that library.
---
Makefile | 6 ++++++
config.mak.in | 2 ++
configure.ac | 38 ++++++++++++++++++++++++++++++--------
3 files changed, 38 insertions(+), 8 deletions(-)
Index: b/Makefile
===================================================================
@@ -525,11 +525,33 @@ AC_SUBST(NEEDS_SOCKET) test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket" #-# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.-# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.-AC_CHECK_LIB([c], [inet_ntop],-[NEEDS_RESOLV=],-[NEEDS_RESOLV=YesPlease])+# The next few tests will define NEEDS_RESOLV if linking with+# libresolv provides some of the functions we would normally get+# from libc.+NEEDS_RESOLV=+AC_SUBST(NEEDS_RESOLV)+#+# Define NO_INET_NTOP if linking with -lresolv is not enough.+# Solaris 2.7 in particular hos inet_ntop in -lresolv.+NO_INET_NTOP=+AC_SUBST(NO_INET_NTOP)+AC_CHECK_FUNC([inet_ntop],+ [],+ [AC_CHECK_LIB([resolv], [inet_ntop],+ [NEEDS_RESOLV=YesPlease],+ [NO_INET_NTOP=YesPlease])+])+#+# Define NO_INET_PTON if linking with -lresolv is not enough.+# Solaris 2.7 in particular hos inet_pton in -lresolv.+NO_INET_PTON=+AC_SUBST(NO_INET_PTON)+AC_CHECK_FUNC([inet_pton],+ [],+ [AC_CHECK_LIB([resolv], [inet_pton],+ [NEEDS_RESOLV=YesPlease],+ [NO_INET_PTON=YesPlease])+]) # # Define NO_HSTRERROR if linking with -lresolv is not enough. # Solaris 2.6 in particular has no hstrerror, even in -lresolv.
@@ -541,8 +563,9 @@ AC_CHECK_FUNC([hstrerror], [NO_HSTRERROR=YesPlease]) ]) AC_SUBST(NO_HSTRERROR)--AC_SUBST(NEEDS_RESOLV)+#+# If any of the above tests determined that -lresolv is needed at+# build-time, also set it here for remaining configure-time checks. test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv" AC_CHECK_LIB([c], [basename],
@@ -772,7 +795,6 @@ GIT_CHECK_FUNC(mkstemps, [NO_MKSTEMPS=YesPlease]) AC_SUBST(NO_MKSTEMPS) #-# # Define NO_MMAP if you want to avoid mmap. # # Define NO_ICONV if your libc does not properly support iconv.
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Systems that do not provide ss_family in sockaddr_storage do not compile.
This patch adds a configure test, and a new Makefile define along with
default settings for HPUX-11.00, Solaris-2.6 and others.
I've also added a configure test to set NO_SOCKADDR_STORAGE
appropriately, rather than relying on the default settings in
Makefile.
---
Makefile | 15 +++++++++++++++
config.mak.in | 1 +
configure.ac | 17 +++++++++++++++++
daemon.c | 31 ++++++++++++++++++++-----------
4 files changed, 53 insertions(+), 11 deletions(-)
Index: b/daemon.c
===================================================================
@@ -122,6 +122,9 @@ all::# Define NO_SOCKADDR_STORAGE if your platform does not have struct# sockaddr_storage.#+# Define NO_SS_FAMILY_IN_SOCKADDR_X if your platform lacks ss_family+# in sockaddr_storage, sockaddr_in and sockaddr_in6.+## Define NO_ICONV if your libc does not properly support iconv.## Define OLD_ICONV if your library has an old iconv(), where the second
@@ -895,6 +904,7 @@ ifeq ($(uname_S),IRIX)NO_MEMMEM=YesPleaseNO_MKSTEMPS=YesPleaseNO_MKDTEMP=YesPlease+NO_SS_FAMILY_IN_SOCKADDR_X=YesPlease # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set), # git dies with a segmentation fault when trying to access the first
@@ -656,6 +656,23 @@ AC_CHECK_TYPE([struct addrinfo],[ ]) AC_SUBST(NO_IPV6) #+# Define NO_SS_FAMILY_IN_SOCKADDR_X if your platform lacks ss_family+# in struct sockaddr_storage, sockaddr_in6 and sockaddr_in.+save_CPPFLAGS="$CPPFLAGS"+case $NO_SOCKADDR_STORAGE:$NO_IPV6 in+YesPlease:YesPlease)+ CPPFLAGS="-Dsockaddr_storage=sockaddr_in${CPPFLAGS+ $CPPFLAGS}" ;;+YesPlease:)+ CPPFLAGS="-Dsockaddr_storage=sockaddr_in6${CPPFLAGS+ $CPPFLAGS}" ;;+esac+AC_CHECK_MEMBER(struct sockaddr_storage.ss_family,+[NO_SS_FAMILY_IN_SOCKADDR_X=],+[NO_SS_FAMILY_IN_SOCKADDR_X=YesPlease],[+#include <sys/types.h>+#include <sys/socket.h>+])+AC_SUBST(NO_SS_FAMILY_IN_SOCKADDR_X)+# # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) # do not support the 'size specifiers' introduced by C99, namely ll, hh, # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Without this patch, systems that provide stubs for pthread functions
in libc, but which still require libpthread for full the pthread
implementation are not detected correctly.
Also, some systems require -pthread in CFLAGS for each compilation
unit for a successful link of an mt binary, which is also addressed by
this patch.
---
Makefile | 4 ++++
config.mak.in | 1 +
configure.ac | 17 +++++++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
Index: b/Makefile
===================================================================
@@ -799,7 +803,8 @@ if test -n "$USER_NOPTHREAD"; then # handle these separately since PTHREAD_CFLAGS could be '-lpthreads # -D_REENTRANT' or some such. elif test -z "$PTHREAD_CFLAGS"; then- for opt in -pthread -lpthread; do+ threads_found=no+ for opt in -mt -pthread -lpthread; do old_CFLAGS="$CFLAGS" CFLAGS="$opt $CFLAGS" AC_MSG_CHECKING([Checking for POSIX Threads with '$opt'])
@@ -807,11 +812,18 @@ elif test -z "$PTHREAD_CFLAGS"; then [AC_MSG_RESULT([yes]) NO_PTHREADS= PTHREAD_LIBS="$opt"+ PTHREAD_CFLAGS="$opt"+ threads_found=yes break ], [AC_MSG_RESULT([no])]) CFLAGS="$old_CFLAGS" done+ if test $threads_found != yes; then+ AC_CHECK_LIB([pthread], [pthread_create],+ [PTHREAD_LIBS="-lpthread"],+ [NO_PTHREADS=UnfortunatelyYes])+ fi else old_CFLAGS="$CFLAGS" CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
@@ -828,6 +840,7 @@ fi CFLAGS="$old_CFLAGS"+AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) AC_SUBST(NO_PTHREADS)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Irix 6.5 does not define 'sgi', but does define '__sgi'.
Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD
u_short types et. al. to be declared properly.
---
git-compat-util.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: b/git-compat-util.h
===================================================================
--- a/git-compat-util.h+++ b/git-compat-util.h
@@ -55,13 +55,14 @@# else# define _XOPEN_SOURCE 500# endif-#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)+#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) && !defined(__sgi)#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */#endif#define _ALL_SOURCE 1#define _GNU_SOURCE 1#define _BSD_SOURCE 1+#define _BSD_TYPES 1 /* IRIX needs this for u_short et al */#define _NETBSD_SOURCE 1#define _SGI_SOURCE 1
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Without this patch, git does not compile correctly on HPUX 11.11 and
earlier.
Compiler support for inline is sometimes buggy, and occasionally
missing entirely. This patch adds a test for inline support, and
redefines the keyword with the preprocessor if necessary at compile
time.
---
Makefile | 4 ++++
config.mak.in | 1 +
configure.ac | 7 +++++++
3 files changed, 12 insertions(+)
Index: b/Makefile
===================================================================
@@ -0,0 +1,41 @@+dnl Check for socklen_t: historically on BSD it is an int, and in+dnl POSIX 1g it is a type of its own, but some platforms use different+dnl types for the argument to getsockopt, getpeername, etc. So we+dnl have to test to find something that will work.+AC_DEFUN([TYPE_SOCKLEN_T],+[+ AC_CHECK_TYPE([socklen_t], ,[+ AC_MSG_CHECKING([for socklen_t equivalent])+ AC_CACHE_VAL([git_cv_socklen_t_equiv],+ [+ # Systems have either "struct sockaddr *" or+ # "void *" as the second argument to getpeername+ git_cv_socklen_t_equiv=+ for arg2 in "struct sockaddr" void; do+ for t in int size_t unsigned long "unsigned long"; do+ AC_TRY_COMPILE([+ #include <sys/types.h>+ #include <sys/socket.h>++ int getpeername (int, $arg2 *, $t *);+ ],[+ $t len;+ getpeername(0,0,&len);+ ],[+ git_cv_socklen_t_equiv="$t"+ break 2+ ])+ done+ done++ if test "x$git_cv_socklen_t_equiv" = x; then+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])+ fi+ ])+ AC_MSG_RESULT($git_cv_socklen_t_equiv)+ AC_DEFINE_UNQUOTED(socklen_t, $git_cv_socklen_t_equiv,+ [type to use in place of socklen_t if not defined])],+ [#include <sys/types.h>+#include <sys/socket.h>])+])+
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
HP-UX 10.20 has no PREAD, and while it does support mmap(), there is
no system MAP_FAILED definition.
---
Makefile | 1 +
git-compat-util.h | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Some of the flags used with the first diff found in PATH cause the
vendor diff to choke.
---
Documentation/install-webdoc.sh | 2 +-
Makefile | 4 +++-
config.mak.in | 1 +
configure.ac | 1 +
git-merge-one-file.sh | 2 +-
t/Makefile | 1 +
6 files changed, 8 insertions(+), 3 deletions(-)
Index: b/Makefile
===================================================================
@@ -342,6 +342,7 @@ fi #AC_PROG_INSTALL # needs install-sh or install.sh in sources AC_CHECK_TOOLS(AR, [gar ar], :) AC_CHECK_PROGS(TAR, [gtar tar])+AC_CHECK_PROGS(DIFF, [gnudiff gdiff diff]) # TCLTK_PATH will be set to some value if we want Tcl/Tk # or will be empty otherwise. if test -z "$NO_TCLTK"; then
@@ -107,7 +107,7 @@ case "${1:-.}${2:-.}${3:-.}" in# remove lines that are unique to ours.orig=`git-unpack-file$2`sz0=`wc-c<"$orig"`-diff-u-La/$orig-Lb/$orig$orig$src2|gitapply--no-add+$DIFF-u-La/$orig-Lb/$orig$orig$src2|gitapply--no-addsz1=`wc-c<"$orig"`# If we do not have enough common material, it is not
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
SunOS 5.6 and 5.5.1 do not have hstrerror, even in libresolv.
This patch improves the logic of the test for hstrerror, not to
blindly assume that if there is no hstrerror in libc that it must
exist in libresolv.
---
Makefile | 1 +
config.mak.in | 1 +
configure.ac | 17 ++++++++++++++---
3 files changed, 16 insertions(+), 3 deletions(-)
Index: b/configure.ac
===================================================================
--- a/configure.ac+++ b/configure.ac
@@ -526,11 +526,22 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS - # # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.-# Notably on Solaris hstrerror resides in libresolv and on Solaris 7-# inet_ntop and inet_pton additionally reside there.-AC_CHECK_LIB([c], [hstrerror],+# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.+AC_CHECK_LIB([c], [inet_ntop], [NEEDS_RESOLV=], [NEEDS_RESOLV=YesPlease])+#+# Define NO_HSTRERROR if linking with -lresolv is not enough.+# Solaris 2.6 in particular has no hstrerror, even in -lresolv.+NO_HSTRERROR=+AC_CHECK_FUNC([hstrerror],+ [],+ [AC_CHECK_LIB([resolv], [hstrerror],+ [NEEDS_RESOLV=YesPlease],+ [NO_HSTRERROR=YesPlease])+])+AC_SUBST(NO_HSTRERROR)+ AC_SUBST(NEEDS_RESOLV) test -n "$NEEDS_RESOLV" && LIBS="$LIBS -lresolv"
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).
This patch simply breaks apart any compound declarations with dynamic
initialisation expressions, and moves the initialisation until after
the last declaration in the same block, in all the places necessary to
have the offending compilers accept the code.
---
builtin-add.c | 4 +++-
builtin-blame.c | 10 ++++++----
builtin-cat-file.c | 4 +++-
builtin-checkout.c | 3 ++-
builtin-commit.c | 3 ++-
builtin-fetch.c | 6 ++++--
builtin-remote.c | 9 ++++++---
convert.c | 4 +++-
daemon.c | 19 ++++++++++---------
ll-merge.c | 14 +++++++-------
refs.c | 6 +++++-
remote.c | 3 +--
unpack-trees.c | 4 +++-
wt-status.c | 23 ++++++++++++-----------
14 files changed, 67 insertions(+), 45 deletions(-)
Index: b/convert.c
===================================================================
--- a/convert.c+++ b/convert.c
@@ -249,7 +249,9 @@ static int filter_buffer(int in, int outstructchild_processchild_process;structfilter_params*params=(structfilter_params*)data;intwrite_err,status;-constchar*argv[]={params->cmd,NULL};+constchar*argv[]={NULL,NULL};++argv[0]=params->cmd;memset(&child_process,0,sizeof(child_process));child_process.argv=argv;
@@ -733,10 +733,11 @@ static int pass_blame_to_parent(struct s{intlast_in_target;mmfile_tfile_p,file_o;-structblame_chunk_cb_datad={sb,target,parent,0,0};+structblame_chunk_cb_datad;xpparam_txpp;xdemitconf_txecfg;-+memset(&d,0,sizeof(d));+d.sb=sb;d.target=target;d.parent=parent;last_in_target=find_last_in_target(sb,target);if(last_in_target<0)return1;/* nothing remains for this target */
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
By default the testsuite calls 'diff -u' whenever a file comparison is
called for. Unfortunately that throws a "diff: unknown option '-u'"
error for most non-GNU diffs.
This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where
that happens. As a matter of fact, the testsuite as a whole still
fails around 70% of all tests, but I'm able to clone a repository and
commit to a local branch on those machines, so I'm pretty sure that
the problem is the testsuite itself.
---
Makefile | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
In tests, call test_cmp rather than raw diff where possible (i.e. if
the output does not go to a pipe), to allow the use of, say, 'cmp'
when the default 'diff -u' is not compatible with a vendor diff.
When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.
---
t/Makefile | 1 +
t/t0000-basic.sh | 2 +-
t/t3200-branch.sh | 4 ++--
t/t3210-pack-refs.sh | 8 ++++----
t/t3903-stash.sh | 2 +-
t/t4002-diff-basic.sh | 2 +-
t/t4124-apply-ws-rule.sh | 10 +++++-----
t/t4127-apply-same-fn.sh | 6 +++---
t/t5300-pack-object.sh | 6 +++---
t/t5510-fetch.sh | 2 +-
t/t5520-pull.sh | 2 +-
t/t5700-clone-reference.sh | 8 ++++----
t/t6000lib.sh | 2 +-
t/t6001-rev-list-graft.sh | 2 +-
t/t6022-merge-rename.sh | 4 ++--
t/t7002-grep.sh | 16 ++++++++--------
t/t7005-editor.sh | 6 +++---
t/t9200-git-cvsexportcommit.sh | 26 +++++++++++++-------------
t/t9400-git-cvsserver-server.sh | 24 ++++++++++++------------
19 files changed, 67 insertions(+), 66 deletions(-)
Index: b/t/t0000-basic.sh
===================================================================
--- a/t/t0000-basic.sh+++ b/t/t0000-basic.sh
@@ -280,7 +280,7 @@ $expectfilter >expected <<\EOF EOF test_expect_success\'validate git diff-files output for a know cache/work tree state.'\-'git diff-files >current && diff >/dev/null -b current expected'+'git diff-files >current && test_cmp current expected >/dev/null' test_expect_success\'git update-index --refresh should succeed.'\
@@ -43,7 +43,7 @@ test_expect_success \gitbranch-ld/e/f&&test-f.git/refs/heads/d/e/f&&test-f.git/logs/refs/heads/d/e/f&&-diffexpect.git/logs/refs/heads/d/e/f'+test_cmpexpect.git/logs/refs/heads/d/e/f' test_expect_success\'git branch -d d/e/f should delete a branch and a log'\
@@ -28,7 +28,7 @@ test_expect_success \SHA1=`cat.git/refs/heads/a`&&echo"$SHA1 refs/heads/a">expect&&gitshow-refa>result&&-diffexpectresult'+test_cmpexpectresult' test_expect_success\'see if a branch still exists when packed'\
@@ -37,7 +37,7 @@ test_expect_success \rm-f.git/refs/heads/b&&echo"$SHA1 refs/heads/b">expect&&gitshow-refb>result&&-diffexpectresult'+test_cmpexpectresult' test_expect_success'git branch c/d should barf if branch c exists''gitbranchc&&
@@ -44,7 +44,7 @@ test_fix () {apply_patch--whitespace=fix||return1# find touched lines-difffiletarget|sed-n-e"s/^> //p">fixed+$DIFFfiletarget|sed-n-e"s/^> //p">fixed# the changed lines are all expeced to changefixed_cnt=$(wc-l<fixed)
@@ -71,7 +71,7 @@ test_expect_success "fetch test for-mergecho"$one_in_two "}>expected&&cut-f-2.git/FETCH_HEAD>actual&&-diffexpectedactual'+test_cmpexpectedactual' test_expect_success'fetch tags when there is no tags''
@@ -26,7 +26,7 @@ cd "$D" test_expect_success'checking the results''test-ffile&&test-fcloned/file&&-difffilecloned/file+test_cmpfilecloned/file' test_expect_success'pulling into void using master:master''
@@ -280,7 +280,7 @@ test_expect_success 'updated working treecho"BAD: should have complained"return1}-diffMM.saved||{+test_cmpMM.saved||{echo"BAD: should have left M intact"return1}
@@ -301,7 +301,7 @@ test_expect_success 'updated working treecho"BAD: should have complained"return1}-diffMM.saved||{+test_cmpMM.saved||{echo"BAD: should have left M intact"return1}
@@ -89,10 +89,10 @@ test_expect_success \check_entriesD"newfile4.png/1.2/-kb"&&check_entriesE"newfile5.txt/1.1/"&&check_entriesF"newfile6.png/1.1/-kb"&&-diffA/newfile1.txt../A/newfile1.txt&&-diffD/newfile4.png../D/newfile4.png&&-diffE/newfile5.txt../E/newfile5.txt&&-diffF/newfile6.png../F/newfile6.png+test_cmpA/newfile1.txt../A/newfile1.txt&&+test_cmpD/newfile4.png../D/newfile4.png&&+test_cmpE/newfile5.txt../E/newfile5.txt&&+test_cmpF/newfile6.png../F/newfile6.png)'# Should fail (but only on the git cvsexportcommit stage)
@@ -27,7 +27,7 @@ test_expect_success 'apply same filenamecpsame_fnsame_fn2&&gitreset--hard&&gitapplypatch0&&-diffsame_fnsame_fn2+test_cmpsame_fnsame_fn2' test_expect_success'apply same filename with overlapping changes''
@@ -40,7 +40,7 @@ test_expect_success 'apply same filenamecpsame_fnsame_fn2&&gitreset--hard&&gitapplypatch0&&-diffsame_fnsame_fn2+test_cmpsame_fnsame_fn2' test_expect_success'apply same new filename after rename''
@@ -54,7 +54,7 @@ test_expect_success 'apply same new filecpnew_fnnew_fn2&&gitreset--hard&&gitapply--indexpatch1&&-diffnew_fnnew_fn2+test_cmpnew_fnnew_fn2' test_expect_success'apply same old filename after rename -- should fail.''
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:26
Add defaults for Tru64 Unix. Without this patch I cannot compile
git on Tru64 5.1.
---
Makefile | 6 ++++++
1 file changed, 6 insertions(+)
Index: b/Makefile
===================================================================
--- a/Makefile+++ b/Makefile
@@ -695,6 +695,12 @@ EXTLIBS =# because maintaining the nesting to match is a pain. If# we had "elif" things would have been much nicer...+ifeq ($(uname_S),OSF1)+ # Need this for u_short definitions et al+BASIC_CFLAGS+=-D_OSF_SOURCE+NO_STRTOULL=YesPlease+NO_NSEC=YesPlease+endififeq ($(uname_S),Linux)NO_STRLCPY=YesPleaseNO_MKSTEMPS=YesPlease
Heya,
On Tue, Mar 16, 2010 at 06:42, Gary V. Vaughan
[off-list ref] wrote:
Here are the portability patches we needed at TWW to enable
git-1.7.0.2 to compile and run on all of the wide range of Unix
machines we support.
Oh wow, thanks! Glad to see you followed up on this, awesome!
Note that I have not invested the time to figure out why the testsuite
is mostly useless on everything but Linux and Solaris 8+, because I'm
reasonably satisfied that the build itself is working properly.
I'm curious now, what kind of errors are you getting? Would you mind
perhaps posting a few to the list in a new thread?
--
Cheers,
Sverre Rabbelier
@@ -280,7 +280,7 @@ $expectfilter >expected <<\EOF EOF test_expect_success\'validate git diff-files output for a know cache/work tree state.'\-'git diff-files >current && diff >/dev/null -b current expected'+'git diff-files >current && test_cmp current expected >/dev/null'
The original says "compare ignoring whitespace changes" but the updated
one says "they must match literally". Is this conversion safe?
For the purpose of debugging tests, I think it would be better to lose the
redirection into /dev/null. If the test passes, we wouldn't see anything
anyway, and if the test fails, we would see what's different, and that
helps diagnosing the breakage. For systems with implementations of diff
that is "-u" challenged, we could define test_cmp in terms of "diff -c"
instead of "cmp".
If the -q in the original really matters, then please add the redirection
to /dev/null only for test_cmp; never redirect the output from the entire
test_expect_success. On the other hand, if -q does not matter the outcome
of the test, simply lose the "quiet". We really should not care, and make
sure it is available easily to people who broke cvsserver and need to see
the difference between expected and actual results while debugging.
There are similar dubious conversions in your patch to this file.
If this forces plain diff not more readable "diff -u" to everybody, that
sounds like a regression to me.
Other than that, the conversion in this patch looked sane.
Thanks.
From: Junio C Hamano <hidden> Date: 2016-06-15 22:48:26
"Gary V. Vaughan" [off-list ref] writes:
By default the testsuite calls 'diff -u' whenever a file comparison is
called for. Unfortunately that throws a "diff: unknown option '-u'"
error for most non-GNU diffs.
This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where
that happens.
Wouldn't most of these platforms you listed have a working "diff -c" at
least? Using it would make debugging the tests easier, as it would be
more readable than output from "cmp".
I also saw your patch to install-webdoc used "$DIFF -u"; as the patch
series seem to assume a unified-capable diff implementation is available
somewhere, perhaps you do not need this patch after all, but instead just
need to default GIT_TEST_CMP to "$DIFF -u" in t/test-lib.sh, no?
From: Junio C Hamano <hidden> Date: 2016-06-15 22:48:26
"Gary V. Vaughan" [off-list ref] writes:
Irix 6.5 does not define 'sgi', but does define '__sgi'.
Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD
u_short types et. al. to be declared properly.
If Irix 6.5 defines __sgi and the patch _adds_ "defined(__sgi)" I wouldn't
have to worry too much, but would replacing "defined(sgi)" with the
double-underscore version make somebody who added "defined(sgi)" in the
first place cry, if it was done for different version of Irix that does
define "sgi" (worse yet, but not "__sgi")?
Another natural question is if defining _BSD_TYPES everywhere has negative
effects on somebody else's platforms, but that is what people on different
platforms will have to apply this patch, test, and report success or
breakage. Help from the list audience is appreciated.
Thanks.
From: Junio C Hamano <hidden> Date: 2016-06-15 22:48:26
"Gary V. Vaughan" [off-list ref] writes:
quoted hunk
SunOS 5.6 and 5.5.1 do not have hstrerror, even in libresolv.
This patch improves the logic of the test for hstrerror, not to
blindly assume that if there is no hstrerror in libc that it must
exist in libresolv.
---
Makefile | 1 +
config.mak.in | 1 +
configure.ac | 17 ++++++++++++++---
3 files changed, 16 insertions(+), 3 deletions(-)
Index: b/configure.ac
===================================================================
--- a/configure.ac+++ b/configure.ac
@@ -526,11 +526,22 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS - # # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.-# Notably on Solaris hstrerror resides in libresolv and on Solaris 7-# inet_ntop and inet_pton additionally reside there.-AC_CHECK_LIB([c], [hstrerror],+# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.
You lost the thing they are "additional" to, so this needs a bit of
rewording?
Other than that the patch looked sane (I don't have access to any vintage
of Solaris these days, so I only read it through, though).
Thanks.
From: Johannes Sixt <hidden> Date: 2016-06-15 22:48:26
Gary V. Vaughan schrieb:
Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).
Yes, a comprehensive list would be appreciated. This change is an
uglification that I personally would prefer to stay out of the code base
unless many consumers of git are hurt.
The problem with this non-feature is that it is all too easy that new code
introduces new incompatibilities.
Irix 6.5 does not define 'sgi', but does define '__sgi'.
Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD
u_short types et. al. to be declared properly.
Which IRIX release (uname -R) and compiler version are you using?
I have IRIX 6.5.29m and MIPSpro Compiler 7.4.4m.
Both 'sgi' and '__sgi' appear to be predefined by the preprocessor
on my system. I wasn't aware of '__sgi' when I added 'sgi', otherwise
I would have used it.
On my system, defining _SGI_SOURCE causes _SGIAPI to be enabled which
causes all of the BSD types to be enabled. In my header files in
/usr/include/ everywhere I see a test for _BSD_TYPES, I also see a
test for _SGIAPI (or something equivalent) like this:
#if _SGIAPI || defined(_BSD_TYPES)
So defining _BSD_TYPES will probably not affect compiling on IRIX for
me (though I haven't tested your patches yet), but do your header
files not do the same thing with _SGI_SOURCE, _SGIAPI, and _BSD_TYPES?
Which shell are you using? Bash? or the native Korn shell? If you're
trying to use the Korn shell, then you'll need a patch to t/test-lib.sh
in order for the test suite to work properly. I can send it to you if
you'd like.
I compile and test with the following config.mak settings:
GIT_SKIP_TESTS := \
t3900.1[129] t3900.2[0234] \
t5100.5 t5100.1[09] \
t8005.[234]
export GIT_SKIP_TESTS
# perl 5.8.0
# python 2.1
# GNU tar 1.2
PERL_PATH = /apps/bin/perl
PYTHON_PATH = /apps/bin/python
TAR = /sw/local/bin/gtar
CC = c99
CFLAGS = -n32 -O2
NO_C99_FORMAT = 1
NO_CURL = 1
NO_TCLTK = 1
NO_MMAP =
NO_OPENSSL = 1
BLK_SHA1 = 1
DEFAULT_PAGER = more
# For IRIX <= 6.5.20 compatibility (uname -R)
# i.e. the next two are not necessary for IRIX > 6.5.20
NO_STRLCPY = 1
NO_DEFLATE_BOUND = 1
-brandon
Here are the portability patches we needed at TWW to enable
git-1.7.0.2 to compile and run on all of the wide range of Unix
machines we support. These patches apply to the git-1.7.0.2 release,
and address all of the feedback from the previous two times I posted
them to this list, most particularly splitting everything into many
small self-contained chunks.
Note that I have not invested the time to figure out why the testsuite
is mostly useless on everything but Linux and Solaris 8+, because I'm
reasonably satisfied that the build itself is working properly. Most
likely, it is merely GNUisms in the way the test cases call external
tools. But maybe I'm missing something, but even the 3 new patches to
address test errors when diff does not support the -u option don't
improve the testsuite situation on HPUX, AIX, OSF1 and Solaris 7 and
older.
Which shell are you using? If you're trying to use Korn or /usr/xpg4/bin/sh
on Solaris, you'll have problems, but it is possible. I can send you a
patch.
I have 3 patches that I apply on top of master which allows me to compile and
test on Solaris 7. I remove all but the first when installing, since it is
necessary to compile and the others are only necessary for the test suite.
1) Remove const declaration from arrays with non-constant initializers
2) t5100/*.mbox: use '646' rather than 'us-ascii' for Solaris
3) t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE
Here's the config.mak file I use:
GIT_SKIP_TESTS := \
t1304.3 \
t3900.2[23] \
t5000.1[5-79] t5000.2[013-6] t5000.41 \
t6030.1[23] \
t8005.[23]
GIT_TEST_CMP = cmp -s
export GIT_SKIP_TESTS GIT_TEST_CMP
SHELL_PATH = /usr/xpg4/bin/sh
# This is an old GNU tar that's why some of the
# tests in t5000? still fail
TAR = /apps/bin/gtar
CC = /opt/SUNWspro/bin/cc
# zlib is installed in /apps
CFLAGS = -fast -native -I/apps/include
LDFLAGS = -L/apps/lib
NO_CURL = 1
NO_TCLTK = 1
NO_OPENSSL = 1
BLK_SHA1 = 1
NO_PYTHON = 1
DEFAULT_PAGER = more
-brandon
On Tue, Mar 16, 2010 at 3:31 AM, Johannes Sixt [off-list ref] wrote:
Gary V. Vaughan schrieb:
quoted
Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).
Yes, a comprehensive list would be appreciated. This change is an
uglification that I personally would prefer to stay out of the code base
unless many consumers of git are hurt.
The problem with this non-feature is that it is all too easy that new code
introduces new incompatibilities.
This is probably a stupid question, but why not just build it using
gcc on systems with a broken vendor compiler? You don't have to
distribute gcc just to distribute binaries built with it, so it seems
like there's no downside... and less suffering for the build
maintainer.
Have fun,
Avery
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:42
On Tue, Mar 16, 2010 at 08:31:40AM +0100, Johannes Sixt wrote:
Gary V. Vaughan schrieb:
quoted
Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).
Yes, a comprehensive list would be appreciated. This change is an
uglification that I personally would prefer to stay out of the code base
unless many consumers of git are hurt.
Portable code is rarely pretty... just take a look at the output of
autoconf or automake.
Of the various architectures we support, the latest vendor compilers
for IRIX 6.5 and older, and for HP-UX 10.20 and older do not compile
dynamic compound declarations, throwing errors such as:
cc-1028 cc: ERROR File = const-expr.c, Line = 6
The expression used must have a constant value.
const char *array[2] = { str, NULL };
^
1 error detected in the compilation of "const-expr.c".
The problem with this non-feature is that it is all too easy that new code
introduces new incompatibilities.
Do you mean that new code may prevent the code from compiling on those
machines again? Well, that's kinda the same problem you have when you
wish to support any architecture that you don't have access to... the
beauty of free software is that if it bites any significant number of
people you will get bug reports, and probably patches for as long as
people want to use the software on those machines.
BTW, did you notice that git is a version control system that hosts itself? ;)
I did... but we use the SCM neutral quilt package to manage our local
stack of per-package patches. I'm not particularly fluent with git
yet, and it took only a couple of minutes to get quilt to submit a
message threaded set of patch emails to the list in a git-like format.
Does git absolutely require that you clone the entire project history
to your local disk? For the thousands of ports we maintain, that
would fast become a giant chunk of disk!
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:42
[It seems like all my replies to this list don't make it through, even
though I'm able to post a new thread. Please forward on my behalf.]
On Tue, Mar 16, 2010 at 07:43:54PM -0400, Avery Pennarun wrote:
On Tue, Mar 16, 2010 at 3:31 AM, Johannes Sixt [off-list ref] wrote:
quoted
Gary V. Vaughan schrieb:
quoted
Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).
Yes, a comprehensive list would be appreciated. This change is an
uglification that I personally would prefer to stay out of the code base
unless many consumers of git are hurt.
The problem with this non-feature is that it is all too easy that new code
introduces new incompatibilities.
This is probably a stupid question, but why not just build it using
gcc on systems with a broken vendor compiler? You don't have to
distribute gcc just to distribute binaries built with it, so it seems
like there's no downside... and less suffering for the build
maintainer.
More often than not the vendor compiler produces better code than gcc
on any given architecture, and one of the features of the TWW package
builds is that in the vast majority of cases we port the upstream code
to build using the vendor compiler, because this is what our customers
want.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
@@ -280,7 +280,7 @@ $expectfilter >expected <<\EOF EOF test_expect_success\'validate git diff-files output for a know cache/work tree state.'\-'git diff-files >current && diff >/dev/null -b current expected'+'git diff-files >current && test_cmp current expected >/dev/null'
The original says "compare ignoring whitespace changes" but the updated
one says "they must match literally". Is this conversion safe?
Not all diff implementations support the '-b' option, unfortunately.
This change doesn't cause any regressions, at least the test suite
continues to report success on the architectures where running it is
safe (i.e. Linux and Solaris 8+).
For the purpose of debugging tests, I think it would be better to lose the
redirection into /dev/null. If the test passes, we wouldn't see anything
anyway, and if the test fails, we would see what's different, and that
helps diagnosing the breakage. For systems with implementations of diff
that is "-u" challenged, we could define test_cmp in terms of "diff -c"
instead of "cmp".
Agreed. For all the hosts I have access to, diff -c is always
available.
If the -q in the original really matters, then please add the redirection
to /dev/null only for test_cmp; never redirect the output from the entire
test_expect_success.
Don't worry, I didn't do that:
$ echo 'test_expect_success' &&
> echo 'test_cmp' >/dev/null
test_expect_success
On the other hand, if -q does not matter the outcome
of the test, simply lose the "quiet". We really should not care, and make
sure it is available easily to people who broke cvsserver and need to see
the difference between expected and actual results while debugging.
There are similar dubious conversions in your patch to this file.
I'd be even happier to see the >/dev/null redirections dropped if the
patch is pushed. Part of the reason I didn't invest too much effort
into debugging the massive testsuite failures everything but Linux and
Solaris 8+ is because it's too difficult to find out why a particular
test actually failed.
If this forces plain diff not more readable "diff -u" to everybody, that
sounds like a regression to me.
It does, because "diff -u" is not portable.
A more comprehensive patch might run a configure test to see whether
-u is supported, and then fallback first to "${ac_cv_prog_DIFF} -c",
or if that breaks too, finally settle on "cmp". And then we'd have to
set matching defaults in Makefile.
I'm afraid I don't have time to help with that, since the testsuite is
so very broken on nearly all of our architectures. I'll post some
examples presently.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:42
On Tue, Mar 16, 2010 at 12:22:53AM -0700, Junio C Hamano wrote:
"Gary V. Vaughan" [off-list ref] writes:
quoted
By default the testsuite calls 'diff -u' whenever a file comparison is
called for. Unfortunately that throws a "diff: unknown option '-u'"
error for most non-GNU diffs.
This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where
that happens.
Wouldn't most of these platforms you listed have a working "diff -c" at
least? Using it would make debugging the tests easier, as it would be
more readable than output from "cmp".
Yes, I've checked, and everything I have access to supports "diff -c"
with the vendor implementation.
I also saw your patch to install-webdoc used "$DIFF -u"; as the patch
series seem to assume a unified-capable diff implementation is available
somewhere, perhaps you do not need this patch after all, but instead just
need to default GIT_TEST_CMP to "$DIFF -u" in t/test-lib.sh, no?
That is more than adequate for me, since one of our packages is GNU
diffutils, and my git build recipe puts the path to our diffutils
package first in PATH before launching configure and make.
However, anyone else that wants to build git on a non-"diff -u"
capable machine won't necessarily have this luxury. At the moment
it's hard for me to tell whether the diff changes are a net win, since
I can't get the testsuite to run properly on any of the architectures
that would be affected.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:42
On Tue, Mar 16, 2010 at 12:24:36AM -0700, Junio C Hamano wrote:
"Gary V. Vaughan" [off-list ref] writes:
quoted
Irix 6.5 does not define 'sgi', but does define '__sgi'.
Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD
u_short types et. al. to be declared properly.
If Irix 6.5 defines __sgi and the patch _adds_ "defined(__sgi)" I wouldn't
have to worry too much, but would replacing "defined(sgi)" with the
double-underscore version make somebody who added "defined(sgi)" in the
first place cry, if it was done for different version of Irix that does
define "sgi" (worse yet, but not "__sgi")?
Agreed. I've amended my local version of this patch to check both
(sgi) and (__sgi) now. Thanks.
Another natural question is if defining _BSD_TYPES everywhere has negative
effects on somebody else's platforms, but that is what people on different
platforms will have to apply this patch, test, and report success or
breakage. Help from the list audience is appreciated.
Good point. Perhaps better to make that change in the Makefile?
ifeq ($(uname_S),IRIX64)
# Need this for u_short definitions et al
BASIC_CFLAGS += -D_BSD_TYPES
endif
I only have use of mips-sgi-irix6.5 machines, so I'm not sure what
other versions are affected... probably a safe bet that
ifeq($(uname_S),IRIX) should get that definition too.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:42
[It seems that while the list allows me to start a new thread, all my
replies are actually discarded or held for moderation :( Please
forward a copy to the list on my behalf]
On Tue, Mar 16, 2010 at 10:27:07AM -0500, Brandon Casey wrote:
On 03/16/2010 12:42 AM, Gary V. Vaughan wrote:
quoted
Irix 6.5 does not define 'sgi', but does define '__sgi'.
Also, Irix 6.5 requires _BSD_TYPES to be defined in order for the BSD
u_short types et. al. to be declared properly.
Which IRIX release (uname -R) and compiler version are you using?
I have IRIX 6.5.29m and MIPSpro Compiler 7.4.4m.
IRIX 6.5.26m here, with the same compiler.
Both 'sgi' and '__sgi' appear to be predefined by the preprocessor
on my system. I wasn't aware of '__sgi' when I added 'sgi', otherwise
I would have used it.
I was quite surprised too, but __sgi is necessary here.
On my system, defining _SGI_SOURCE causes _SGIAPI to be enabled which
causes all of the BSD types to be enabled. In my header files in
/usr/include/ everywhere I see a test for _BSD_TYPES, I also see a
test for _SGIAPI (or something equivalent) like this:
#if _SGIAPI || defined(_BSD_TYPES)
So defining _BSD_TYPES will probably not affect compiling on IRIX for
me (though I haven't tested your patches yet), but do your header
files not do the same thing with _SGI_SOURCE, _SGIAPI, and _BSD_TYPES?
They do, but when I was looking for a macro to define to get the
additional declarations, _BSD_TYPES was the first one I found.
_SGI_SOURCE, _SGIAPI and even _BSD_COMPAT appear to work equally well.
Which shell are you using? Bash? or the native Korn shell? If you're
trying to use the Korn shell, then you'll need a patch to t/test-lib.sh
in order for the test suite to work properly. I can send it to you if
you'd like.
I believe we're using bash. At least our environment has
SHELL=/opt/fsw/bash32/bin/bash and we call configure with '${SHELL}
./configure ...' and gmake with 'make SHELL=${SHELL}'. But I suppose
it's possible that if t/Makefile ignores those settings and the tests
begin with '#!/bin/sh', then perhaps they are using Korn shell?
Thanks, yes, I'll be interested to see your patch... but shouldn't we
try to fix git in the repo so that it respects the SHELL environment
and make setting?
I compile and test with the following config.mak settings:
GIT_SKIP_TESTS := \
t3900.1[129] t3900.2[0234] \
t5100.5 t5100.1[09] \
t8005.[234]
export GIT_SKIP_TESTS
# perl 5.8.0
# python 2.1
# GNU tar 1.2
PERL_PATH = /apps/bin/perl
PYTHON_PATH = /apps/bin/python
TAR = /sw/local/bin/gtar
CC = c99
CFLAGS = -n32 -O2
NO_C99_FORMAT = 1
NO_CURL = 1
NO_TCLTK = 1
NO_MMAP =
NO_OPENSSL = 1
BLK_SHA1 = 1
DEFAULT_PAGER = more
# For IRIX <= 6.5.20 compatibility (uname -R)
# i.e. the next two are not necessary for IRIX > 6.5.20
NO_STRLCPY = 1
NO_DEFLATE_BOUND = 1
And similarly, shouldn't these settings be fed back upstream for the
benefit of other IRIX users of git?
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:42
On Tue, Mar 16, 2010 at 12:24:47AM -0700, Junio C Hamano wrote:
"Gary V. Vaughan" [off-list ref] writes:
quoted
@@ -526,11 +526,22 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS - # # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.-# Notably on Solaris hstrerror resides in libresolv and on Solaris 7-# inet_ntop and inet_pton additionally reside there.-AC_CHECK_LIB([c], [hstrerror],+# Notably on Solaris 7 inet_ntop and inet_pton additionally reside there.
You lost the thing they are "additional" to, so this needs a bit of
rewording?
I did that to minimise the changes in this patch. no-inet_ntop.patch
rewrites the inet_ntop test and deletes the incomplete comment line
too.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
This looks like making use of configure mandatory to me? Could you do
this patch without doing so?
Sure.
SunOS 2.6 and earlier, HP-UX 10.20 and OSF1 do not have a socklen_t type
declaration.
---
Makefile | 10 ++++++++++
aclocal.m4 | 41 +++++++++++++++++++++++++++++++++++++++++
config.mak.in | 1 +
configure.ac | 6 ++++++
4 files changed, 58 insertions(+)
Index: b/Makefile
===================================================================
--- a/Makefile+++ b/Makefile
@@ -8,6 +8,9 @@ all::# Define SANE_TOOL_PATH to a colon-separated list of paths to prepend# to PATH if your tools in /usr/bin are broken.#+# Define SOCKLEN_T to a suitable type (such as 'size_t') if your+# system headers do not define a socklen_t type.+## Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()# or vsnprintf() return -1 instead of number of characters which would# have been written to the final string if enough space had been available.
@@ -698,6 +701,7 @@ EXTLIBS =ifeq ($(uname_S),OSF1) # Need this for u_short definitions et alBASIC_CFLAGS+=-D_OSF_SOURCE+SOCKLEN_T=intNO_STRTOULL=YesPleaseNO_NSEC=YesPleaseendif
@@ -613,6 +613,12 @@ AC_SUBST(OLD_ICONV) ## Checks for typedefs, structures, and compiler characteristics. AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics]) #+TYPE_SOCKLEN_T+case $ac_cv_type_socklen_t in+ yes) ;;+ *) AC_SUBST([SOCKLEN_T], [$git_cv_socklen_t_equiv]) ;;+esac+ # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. AC_CHECK_MEMBER(struct dirent.d_ino, [NO_D_INO_IN_DIRENT=],
@@ -0,0 +1,41 @@+dnl Check for socklen_t: historically on BSD it is an int, and in+dnl POSIX 1g it is a type of its own, but some platforms use different+dnl types for the argument to getsockopt, getpeername, etc. So we+dnl have to test to find something that will work.+AC_DEFUN([TYPE_SOCKLEN_T],+[+ AC_CHECK_TYPE([socklen_t], ,[+ AC_MSG_CHECKING([for socklen_t equivalent])+ AC_CACHE_VAL([git_cv_socklen_t_equiv],+ [+ # Systems have either "struct sockaddr *" or+ # "void *" as the second argument to getpeername+ git_cv_socklen_t_equiv=+ for arg2 in "struct sockaddr" void; do+ for t in int size_t unsigned long "unsigned long"; do+ AC_TRY_COMPILE([+ #include <sys/types.h>+ #include <sys/socket.h>++ int getpeername (int, $arg2 *, $t *);+ ],[+ $t len;+ getpeername(0,0,&len);+ ],[+ git_cv_socklen_t_equiv="$t"+ break 2+ ])+ done+ done++ if test "x$git_cv_socklen_t_equiv" = x; then+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])+ fi+ ])+ AC_MSG_RESULT($git_cv_socklen_t_equiv)+ AC_DEFINE_UNQUOTED(socklen_t, $git_cv_socklen_t_equiv,+ [type to use in place of socklen_t if not defined])],+ [#include <sys/types.h>+#include <sys/socket.h>])+])+
Cheeers,
--
Gary V. Vaughan (gary@thewrittenword.com)