From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Momentum appears to have stalled on this portability patch set, but
I received a lot of great feed back on restructuring and tweaking, the
results of which follow. If there's anything else I can do to help the
adoption of some or all of these patches into upstream please don't
hesitate to ask. There are no new changes in this v5 patchset, and
the additional 2 patches in the series over the last submission is
purely an artifact of the restructuring based on feedback.
So, as I said before: Here are the portability patches we needed at
TWW to enable git-1.7.1 to compile and run on all of the wide range of
Unix machines we support. These patches apply to the git-1.7.1
release, and address all of the feedback from the previous four
times I posted them to this list.
With the exception of a hand-full of test failures outside of Linux
and Solaris8+, git now compiles and passes all tests on the following
architectures:
Solaris 2.6/SPARC
Solaris 7/SPARC
Solaris 8/SPARC
Solaris 9/SPARC
Solaris 10/SPARC
Solaris 10/Intel
HP-UX 10.20/PA
HP-UX 11.00/PA
HP-UX 11.11/PA
HP-UX 11.23/PA
HP-UX 11.23/IA
HP-UX 11.31/PA
HP-UX 11.31/IA
AIX 5.1
AIX 5.2
AIX 5.3
AIX 6.1
Tru64 UNIX 5.1
IRIX 6.5
RHEL 3/x86
RHEL 3/amd64
RHEL 4/x86
RHEL 4/amd64
RHEL 5/x86
RHEL 5/amd64
SLES 10/x86
SLES 10/amd64
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
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}" <<...>>
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 2 +-
config.mak.in | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
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.
Signed-off-by: Gary V. Vaughan <redacted>
---
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:48
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.
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 4 ++++
config.mak.in | 1 +
configure.ac | 17 +++++++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
Index: b/Makefile
===================================================================
@@ -819,7 +823,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'])
@@ -827,11 +832,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"
@@ -848,6 +860,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:48
Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX
5.1 fails to compile git.
enum style is inconsistent already, with some enums declared on one
line, some over 3 lines with the enum values all on the middle line,
sometimes with 1 enum value per line... and independently of that the
trailing comma is sometimes present and other times absent, often
mixing with/without trailing comma styles in a single file, and
sometimes in consecutive enum declarations.
Clearly, omitting the comma is the more portable style, and this patch
changes all enum declarations to use the portable omitted dangling
comma style consistently.
Signed-off-by: Gary V. Vaughan <redacted>
---
attr.h | 2 +-
builtin/apply.c | 4 ++--
builtin/branch.c | 4 ++--
builtin/commit.c | 6 +++---
builtin/help.c | 2 +-
builtin/mailinfo.c | 4 ++--
builtin/receive-pack.c | 2 +-
builtin/remote.c | 2 +-
cache.h | 16 ++++++++--------
commit.h | 2 +-
connect.c | 2 +-
ctype.c | 2 +-
diff.h | 2 +-
dir.c | 6 +++---
fast-import.c | 2 +-
grep.h | 8 ++++----
http-push.c | 2 +-
http-walker.c | 2 +-
imap-send.c | 2 +-
merge-recursive.h | 2 +-
parse-options.h | 6 +++---
pretty.c | 2 +-
remote.h | 2 +-
rerere.c | 2 +-
revision.c | 2 +-
wt-status.h | 2 +-
26 files changed, 45 insertions(+), 45 deletions(-)
Index: b/attr.h
===================================================================
--- a/attr.h+++ b/attr.h
@@ -34,7 +34,7 @@ int git_checkattr(const char *path, int,enumgit_attr_direction{GIT_ATTR_CHECKIN,GIT_ATTR_CHECKOUT,-GIT_ATTR_INDEX,+GIT_ATTR_INDEX};voidgit_attr_set_direction(enumgit_attr_direction,structindex_state*);
@@ -131,7 +131,7 @@ int path_match(const char *path, int nr,enumprotocol{PROTO_LOCAL=1,PROTO_SSH,-PROTO_GIT,+PROTO_GIT};staticenumprotocolget_protocol(constchar*name)
@@ -145,7 +145,7 @@ int branch_merge_matches(struct branch *enummatch_refs_flags{MATCH_REFS_NONE=0,MATCH_REFS_ALL=(1<<0),-MATCH_REFS_MIRROR=(1<<1),+MATCH_REFS_MIRROR=(1<<1)};/* Reporting of tracking info */
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Some of the flags used with the first diff found in PATH cause the
vendor diff to choke.
Signed-off-by: Gary V. Vaughan <redacted>
---
Documentation/install-webdoc.sh | 2 +-
Makefile | 4 +++-
config.mak.in | 1 +
configure.ac | 1 +
git-merge-one-file.sh | 2 +-
5 files changed, 7 insertions(+), 3 deletions(-)
Index: b/Makefile
===================================================================
@@ -362,6 +362,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:48
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.
Signed-off-by: Gary V. Vaughan <redacted>
---
t/Makefile | 4 ++++
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 | 2 +-
19 files changed, 59 insertions(+), 55 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:48
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. The previous version of this patch forgot to export
GIT_TEST_CMP from t/Makefile, which is why 'make test' continued to
fail most tests on most architectures - test-lib.sh was falling back
on its default of `diff -u' for GIT_TEST_CMP. This version of this
patch shows a vast improvement in testsuite results where either GNU
diff is in the path at configure time, or where Makefile knows that
GIT_TEST_CMP=cmp is required.
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 5 +++++
t/Makefile | 1 +
2 files changed, 6 insertions(+)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
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.
Signed-off-by: Gary V. Vaughan <redacted>
---
config.mak.in | 1 +
configure.ac | 17 ++++++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
Index: b/configure.ac
===================================================================
--- a/configure.ac+++ b/configure.ac
@@ -546,11 +546,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:48
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.
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 7 +++++++
config.mak.in | 1 +
configure.ac | 6 ++++++
3 files changed, 14 insertions(+)
Index: b/Makefile
===================================================================
--- a/Makefile+++ b/Makefile
@@ -11,6 +11,9 @@ all::# Define SOCKLEN_T to a suitable type (such as 'size_t') if your# system headers do not define a socklen_t type.#+# Define INLINE to a suitable substitute (such as '__inline' or '') if git+# fails to compile with errors about undefined inline functions or similar.+## 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.
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Some platforms do not have a socklen_t type declaration.
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 7 +++++++
aclocal.m4 | 41 +++++++++++++++++++++++++++++++++++++++++
config.mak.in | 1 +
configure.ac | 6 ++++++
4 files changed, 55 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.
@@ -633,6 +633,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>])+])+
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
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.
Signed-off-by: Gary V. Vaughan <redacted>
---
config.mak.in | 2 ++
configure.ac | 37 ++++++++++++++++++++++++++++++-------
2 files changed, 32 insertions(+), 7 deletions(-)
Index: b/configure.ac
===================================================================
--- a/configure.ac+++ b/configure.ac
@@ -545,11 +545,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.
@@ -561,8 +583,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],
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Although configure takes care of most of this, set some default values
for Solaris 2.6 (aka SunOS-5.6) to ensure git compiles even when
configure is not used to build it.
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 12 ++++++++++++
1 file changed, 12 insertions(+)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Irix 6.5 does not define 'sgi', but does define '__sgi'.
Signed-off-by: Gary V. Vaughan <redacted>
---
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
@@ -56,7 +56,8 @@# define _XOPEN_SOURCE 500# endif#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \-!defined(_M_UNIX)&&!defined(sgi)&&!defined(__DragonFly__)+!defined(_M_UNIX)&&!defined(sgi)&&!defined(__sgi)&&\+!defined(__DragonFly__)#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
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
There is no nanosecond field on HPUX, the inline keyword is
spelled "__inline", and there are no inet_ntop/inet_pton definitions
on HP-UX 11.00
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 6 ++++++
1 file changed, 6 insertions(+)
Index: b/Makefile
===================================================================
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Add defaults for Tru64 Unix. Without this patch I cannot compile
git on Tru64 5.1.
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 7 +++++++
1 file changed, 7 insertions(+)
Index: b/Makefile
===================================================================
--- a/Makefile+++ b/Makefile
@@ -740,6 +740,13 @@ 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+SOCKLEN_T=int+NO_STRTOULL=YesPlease+NO_NSEC=YesPlease+endififeq ($(uname_S),Linux)NO_STRLCPY=YesPleaseNO_MKSTEMPS=YesPlease
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
HP-UX 10.20 has no pread definition, the inline keyword doesn't work,
and has no inet_ntop/inet_pton definitions.
Signed-off-by: Gary V. Vaughan <redacted>
---
Makefile | 8 ++++++++
1 file changed, 8 insertions(+)
Index: b/Makefile
===================================================================
From: Robin H. Johnson <hidden> Date: 2016-06-15 22:48:48
On Fri, May 14, 2010 at 09:31:32AM +0000, Gary V. Vaughan wrote:
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:
As a point of comparision, this is what we use in Gentoo, to allow us to
override many of the variables:
sed -i \
-e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
-e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
-e 's:^\(CC = \).*$:\1$(OPTCC):' \
-e 's:^\(AR = \).*$:\1$(OPTAR):' \
Makefile || die "sed failed"
Which would be equivilent to changing the Makefile to have:
CFLAGS = $(OPTCFLAGS) -Wall
LDFLAGS = $(OPTLDFLAGS)
CC = $(OPTCC)
AR = $(OPTAR)
Thereafter, we pass in the relevant values for those variables.
CPPFLAGS is reserved for flags destined for ONLY the preprocessor, and we don't
want to introduce for that reason.
--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Hi Robin,
On Fri, May 14, 2010 at 09:53:30AM +0000, Robin H. Johnson wrote:
On Fri, May 14, 2010 at 09:31:32AM +0000, Gary V. Vaughan wrote:
quoted
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:
As a point of comparision, this is what we use in Gentoo, to allow us to
override many of the variables:
sed -i \
-e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
-e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
-e 's:^\(CC = \).*$:\1$(OPTCC):' \
-e 's:^\(AR = \).*$:\1$(OPTAR):' \
Makefile || die "sed failed"
Which would be equivilent to changing the Makefile to have:
CFLAGS = $(OPTCFLAGS) -Wall
LDFLAGS = $(OPTLDFLAGS)
CC = $(OPTCC)
AR = $(OPTAR)
Thereafter, we pass in the relevant values for those variables.
CPPFLAGS is reserved for flags destined for ONLY the preprocessor, and we don't
want to introduce for that reason.
Letting the user pass preprocessor flags to the preprocessor with
CPPFLAGS at build and/or configure time is a *very* standard feature.
Why would you want to stop a person who builds git from using it?
As a matter of fact, Automake even jumps through hoops with
AM_CPPFLAGS to make sure that the package maintainer doesn't
accidentally trample over the package builder's CPPFLAGS settings - I
can't think of a scenario where the person who writes the build system
for a package knows more about what CPPFLAGS the person who builds it
will need that the person doing the actual building.
I'm pretty sure I'm missing the point though, since letting the
package builder choose their own CPPFLAGS has been at the core of
building Unix packages for as long as I can remember...
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Robin H. Johnson <hidden> Date: 2016-06-15 22:48:48
On Fri, May 14, 2010 at 10:58:32AM +0000, Gary V. Vaughan wrote:
As a matter of fact, Automake even jumps through hoops with
AM_CPPFLAGS to make sure that the package maintainer doesn't
accidentally trample over the package builder's CPPFLAGS settings - I
can't think of a scenario where the person who writes the build system
for a package knows more about what CPPFLAGS the person who builds it
will need that the person doing the actual building.
AM_CFLAGS != AM_CPPFLAGS. My concern was the mixing of them.
IIRC the correct direction was that all CPPFLAGS should be valid CFLAGS,
but not all valid CFLAGS are valid CPPFLAGS (depending on your cpp, they
might be passed to other layers).
I'm pretty sure I'm missing the point though, since letting the
package builder choose their own CPPFLAGS has been at the core of
building Unix packages for as long as I can remember...
As a middle ground:
CFLAGS = $(OPTCFLAGS) -Wall
CPPFLAGS = $(OPTCPPFLAGS)
LDFLAGS = $(OPTLDFLAGS)
CC = $(OPTCC)
AR = $(OPTAR)
(and pass them suitably to the various binaries).
--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:48
Hi Robin,
On Fri, May 14, 2010 at 11:04:59AM +0000, Robin H. Johnson wrote:
On Fri, May 14, 2010 at 10:58:32AM +0000, Gary V. Vaughan wrote:
quoted
As a matter of fact, Automake even jumps through hoops with
AM_CPPFLAGS to make sure that the package maintainer doesn't
accidentally trample over the package builder's CPPFLAGS settings - I
can't think of a scenario where the person who writes the build system
for a package knows more about what CPPFLAGS the person who builds it
will need that the person doing the actual building.
AM_CFLAGS != AM_CPPFLAGS. My concern was the mixing of them.
While I agree that mixing up AM_CFLAGS and AM_CPPFLAGS, or even
AM_CXXFLAGS and AM_CFLAGS is likely to break your build, that's no
reason to deprecate the user's CPPFLAGS setting!
As a middle ground:
CFLAGS = $(OPTCFLAGS) -Wall
CPPFLAGS = $(OPTCPPFLAGS)
LDFLAGS = $(OPTLDFLAGS)
CC = $(OPTCC)
AR = $(OPTAR)
Okay, I think we are mostly in agreement here. In all the packages we
build here at TWW, we let the user use CFLAGS, CPPFLAGS, LDFLAGS etc,
and to preserve that we'll jump through some Automake-like hoops so
that the build system doesn't overwrite them at build time.
You actually propose the same separation, except that you want the
package builder to use the OPTCFLAGS, OPTCPPFLAGS, OPTLDFLAGS etc so
that the build system can use CFLAGS et al. I don't think this
buys you anything but confusion when anyone used to building on Unix
over the last 20 or 30 years tries to pass flags into the build using
the tried and tested mechanism (CFLAGS, CPPFLAGS et al) to no effect.
Git already follows the tried and tested mechanism, but forgot to
honor the user's CPPFLAGS setting, which is what this patch is trying
to address.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:51
On Fri, May 14, 2010 at 09:31:31AM +0000, Gary V. Vaughan wrote:
Momentum appears to have stalled on this portability patch set, but
I received a lot of great feed back on restructuring and tweaking, the
results of which follow. If there's anything else I can do to help the
adoption of some or all of these patches into upstream please don't
hesitate to ask. There are no new changes in this v5 patchset, and
the additional 2 patches in the series over the last submission is
purely an artifact of the restructuring based on feedback.
Ping?
Anything I can do to help oil the wheels that process git patch
contributions?
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Gary V. Vaughan <redacted>
IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'
macro. Since later IRIX versions (6.5.29m) define both macros, and since
an underscore prefixed macro is preferred anyway, use '__sgi' to detect
compilation on SGI IRIX.
Signed-off-by: Brandon Casey <redacted>
---
Hi Gary,
Here's a resubmit of your patch with an updated commit message. Since the
__sgi macro seems to be more common than the sgi macro, I modified your
patch to check for only the __sgi macro. I know Junio suggested checking
for both macros, but I'm the one that Junio was talking about when he made
his comments, and __sgi works for me.
It's such a simple little patch, but still I removed your signed-off-by line
since I modified the patch, and I am not you. Please do reply to this message
with a signed-off-by if you sign off on the patch. Junio will add it to the
patch when he applies the it.
-brandon
git-compat-util.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: Junio C Hamano <hidden> Date: 2016-06-15 22:48:53
This one is really unfortunate, not just because it adds quite a lot of
noise, but because anybody touching the codebase in the future needs to be
aware of the limitation we are imposing on us. The same comment applies
to 04/18 (enum without trailing comma) but the level of annoyance is much
lower there and I would say it is at an acceptable level.
From: Junio C Hamano <hidden> Date: 2016-06-15 22:48:53
"Gary V. Vaughan" [off-list ref] writes:
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.
@@ -6,10 +6,14 @@-include ../config.mak#GIT_TEST_OPTS=--verbose --debug+GIT_TEST_CMP?=$(DIFF)SHELL_PATH?=$(SHELL)TAR?=$(TAR)RM?=rm-f+# Make sure test-lib.sh uses make's value of GIT_TEST_CMP+exportGIT_TEST_CMP+# Shell quote;SHELL_PATH_SQ=$(subst','\'',$(SHELL_PATH))
But isn't this a regression? When GIT_TEST_CMP is not defined, we used to
GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}
which in turn is used like this:
test_cmp() {
$GIT_TEST_CMP "$@"
}
so people would get a more readable "diff -u" output when GIT_TEST_CMP is
not defined and exported. With your patch we would lose -u everywhere,
no?
Also even if your vendor diff lacks unified context format, I would
presume that it would support good old copied context format with -c, and
it would give us a better readability.
How about doing something like this on top of your patch?
Your 7/18 will instead be setting "GIT_TEST_CMP_USE_COPIED_CONTEXT =
YesPlease" for (hopefully) most of the targets whose native "diff" knows
copied context format, and others will set GIT_TEST_CMP to cmp, perhaps?
---
Makefile | 4 ++++
t/Makefile | 4 ----
t/test-lib.sh | 11 ++++++++++-
3 files changed, 14 insertions(+), 5 deletions(-)
@@ -63,7 +63,16 @@ export GIT_MERGE_VERBOSITYexportGIT_AUTHOR_EMAILGIT_AUTHOR_NAMEexportGIT_COMMITTER_EMAILGIT_COMMITTER_NAMEexportEDITOR-GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}++iftest-z"$GIT_TEST_CMP"+then+iftest-n"$GIT_TEST_CMP_USE_COPIED_CONTEXT"+then+GIT_TEST_CMP="$DIFF -c"+else+GIT_TEST_CMP="$DIFF -u"+fi+fi# Protect ourselves from common misconfiguration to export# CDPATH into the environment
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:54
Hi Brandon,
On Tue, Jun 01, 2010 at 08:55:36PM -0500, Brandon Casey wrote:
From: Gary V. Vaughan <redacted>
IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'
macro. Since later IRIX versions (6.5.29m) define both macros, and since
an underscore prefixed macro is preferred anyway, use '__sgi' to detect
compilation on SGI IRIX.
Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Gary V. Vaughan <redacted>
Here's a resubmit of your patch with an updated commit message. Since the
__sgi macro seems to be more common than the sgi macro, I modified your
patch to check for only the __sgi macro. I know Junio suggested checking
for both macros, but I'm the one that Junio was talking about when he made
his comments, and __sgi works for me.
Sure, that's fine. I only need the __sgi part for git to compile
correctly on my IRIX machines, so if you feel that the non-underscore
flavour is superfluous then I won't miss it! ;)
It's such a simple little patch, but still I removed your signed-off-by line
since I modified the patch, and I am not you. Please do reply to this message
with a signed-off-by if you sign off on the patch. Junio will add it to the
patch when he applies the it.
Done.
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
From: Tor Arntsen <hidden> Date: 2016-06-15 22:48:54
On Wed, Jun 2, 2010 at 03:55, Brandon Casey [off-list ref] wrote:
From: Gary V. Vaughan <redacted>
IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'
macro. Since later IRIX versions (6.5.29m) define both macros, and since
an underscore prefixed macro is preferred anyway, use '__sgi' to detect
compilation on SGI IRIX.
Yes, __sgi is the one to use. It's been there on all the SGI systems
I've used, at least back to IRIX 5.3 (I don't recall for sure about
4.0.5 but my guess is yes). 'sgi' is often there too, also on IRIX 6.2
(with the old MIPS compiler), but on both 6.2 and 6.5 it goes away if
you use certain other options, e.g. -ansi. __sgi, on the other hand,
is always there - it doesn't depend on any other compiler options.
-Tor
From: Gary V. Vaughan <hidden> Date: 2016-06-15 22:48:55
Just bumping this thread so that it doesn't fall off the radar.
Is there anything I can do to help reviewers or committers accept
or reject the patches in this set?
Cheers,
Gary
On Fri, May 14, 2010 at 09:31:31AM +0000, Gary V. Vaughan wrote:
Momentum appears to have stalled on this portability patch set, but
I received a lot of great feed back on restructuring and tweaking, the
results of which follow. If there's anything else I can do to help the
adoption of some or all of these patches into upstream please don't
hesitate to ask. There are no new changes in this v5 patchset, and
the additional 2 patches in the series over the last submission is
purely an artifact of the restructuring based on feedback.
So, as I said before: Here are the portability patches we needed at
TWW to enable git-1.7.1 to compile and run on all of the wide range of
Unix machines we support. These patches apply to the git-1.7.1
release, and address all of the feedback from the previous four
times I posted them to this list.
With the exception of a hand-full of test failures outside of Linux
and Solaris8+, git now compiles and passes all tests on the following
architectures:
Solaris 2.6/SPARC
Solaris 7/SPARC
Solaris 8/SPARC
Solaris 9/SPARC
Solaris 10/SPARC
Solaris 10/Intel
HP-UX 10.20/PA
HP-UX 11.00/PA
HP-UX 11.11/PA
HP-UX 11.23/PA
HP-UX 11.23/IA
HP-UX 11.31/PA
HP-UX 11.31/IA
AIX 5.1
AIX 5.2
AIX 5.3
AIX 6.1
Tru64 UNIX 5.1
IRIX 6.5
RHEL 3/x86
RHEL 3/amd64
RHEL 4/x86
RHEL 4/amd64
RHEL 5/x86
RHEL 5/amd64
SLES 10/x86
SLES 10/amd64
Cheers,
--
Gary V. Vaughan (gary@thewrittenword.com)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html