{"thread":{"id":"1735","subject":"patches","startedAt":"2005-09-05T23:24:03Z","lastAt":"2005-09-12T05:39:07Z","messageCount":5,"participants":["Patrick Mauritz","Junio C Hamano","Jason Riedy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"8114","messageId":"1125962642.15293.20.camel@divert","threadId":"1735","inReplyTo":null,"subject":"patches","fromName":"Patrick Mauritz","fromEmail":"oxygene@studentenbude.ath.cx","sentAt":"2005-09-05T23:24:03Z","receivedAt":"2005-09-05T23:24:03Z","isPatch":false,"sender":{"key":"oxygene@studentenbude.ath.cx","avatar":null},"body":"Hi,\n\nattached are two patches:\nthe first fixes some build issues on solaris10/x86 with sunpro (and some\nthat also happen with gcc), while the second adds a simple way to add\nadditional search and link paths for curl library and headers.\n\n\npatrick mauritz\n(not on the list, please Cc:)\n\n\ndiff -ur git-core-0.99.4.orig/convert-cache.c git-core-0.99.4/convert-cache.c\n--- git-core-0.99.5.orig/convert-cache.c\tWed Aug 17 09:55:00 2005\n+++ git-core-0.99.5/convert-cache.c\tWed Aug 17 09:58:48 2005\n@@ -1,4 +1,5 @@\n #define _XOPEN_SOURCE /* glibc2 needs this */\n+#define __EXTENSIONS__ /* solaris needs this */\n #include <time.h>\n #include <ctype.h>\n #include \"cache.h\"\ndiff -ur git-core-0.99.4.orig/ident.c git-core-0.99.4/ident.c\n--- git-core-0.99.5.orig/ident.c\tWed Aug 17 09:55:00 2005\n+++ git-core-0.99.5/ident.c\tWed Aug 17 09:57:54 2005\n@@ -36,12 +36,13 @@\n \tmemcpy(real_email, pw->pw_name, len);\n \treal_email[len++] = '@';\n \tgethostname(real_email + len, sizeof(real_email) - len);\n+#ifndef __sun\n \tif (!strchr(real_email+len, '.')) {\n \t\tlen = strlen(real_email);\n \t\treal_email[len++] = '.';\n \t\tgetdomainname(real_email+len, sizeof(real_email)-len);\n \t}\n-\n+#endif\n \t/* And set the default date */\n \tdatestamp(real_date, sizeof(real_date));\n \treturn 0;\n--- git-core-0.99.5/Makefile~\tThu Aug 25 03:54:24 2005\n+++ git-core-0.99.5/Makefile\tTue Sep  6 01:18:32 2005\n@@ -146,7 +146,11 @@\n \t\tendif\n \tendif\n endif\n+ifeq ($(shell uname -s),SunOS)\n+  LIBS += -lsocket\n+endif\n \n+\n DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'\n \n \n\n\n--- git-core-0.99.5/Makefile~\tTue Sep  6 01:13:29 2005\n+++ git-core-0.99.5/Makefile\tTue Sep  6 01:15:40 2005\n@@ -34,7 +34,14 @@\n \n GIT_VERSION = 0.99.5\n \n-CFLAGS = -g -O2 -Wall\n+ifndef COPTS\n+COPTS = -g -O2 -Wall\n+endif\n+CFLAGS = $(COPTS)\n+ifdef CURLDIR\n+CFLAGS+=-I$(CURLDIR)/include\n+endif\n+\n ALL_CFLAGS = $(CFLAGS) $(DEFINES)\n \n prefix = $(HOME)\n@@ -172,7 +179,11 @@\n git-ssh-pull: rsh.o pull.o\n git-ssh-push: rsh.o\n \n+ifdef CURLDIR\n+git-http-pull: LIBS += -lcurl -L$(CURLDIR)/lib -R$(CURLDIR)/lib\n+else\n git-http-pull: LIBS += -lcurl\n+endif\n git-rev-list: LIBS += $(OPENSSL_LIBSSL)\n \n init-db.o: init-db.c\n"},{"id":"8184","messageId":"7vr7c0xqhd.fsf@assigned-by-dhcp.cox.net","threadId":"1735","inReplyTo":"1125962642.15293.20.camel@divert","subject":"Re: patches","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-08T02:06:38Z","receivedAt":"2005-09-08T02:06:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Mauritz <oxygene@studentenbude.ath.cx> writes:\n\nI would have appreciated if you said \"Solaris portability patch\"\nor somesuch on the subject line.\n\n> diff -ur git-core-0.99.4.orig/convert-cache.c git-core-0.99.4/convert-cache.c\n> --- git-core-0.99.5.orig/convert-cache.c\tWed Aug 17 09:55:00 2005\n> +++ git-core-0.99.5/convert-cache.c\tWed Aug 17 09:58:48 2005\n> @@ -1,4 +1,5 @@\n>  #define _XOPEN_SOURCE /* glibc2 needs this */\n> +#define __EXTENSIONS__ /* solaris needs this */\n>  #include <time.h>\n>  #include <ctype.h>\n>  #include \"cache.h\"\n\nI'll take this; thanks.\n\n> diff -ur git-core-0.99.4.orig/ident.c git-core-0.99.4/ident.c\n> --- git-core-0.99.5.orig/ident.c\tWed Aug 17 09:55:00 2005\n> +++ git-core-0.99.5/ident.c\tWed Aug 17 09:57:54 2005\n> @@ -36,12 +36,13 @@\n>  \tmemcpy(real_email, pw->pw_name, len);\n>  \treal_email[len++] = '@';\n>  \tgethostname(real_email + len, sizeof(real_email) - len);\n> +#ifndef __sun\n>  \tif (!strchr(real_email+len, '.')) {\n>  \t\tlen = strlen(real_email);\n>  \t\treal_email[len++] = '.';\n>  \t\tgetdomainname(real_email+len, sizeof(real_email)-len);\n>  \t}\n> -\n> +#endif\n>  \t/* And set the default date */\n>  \tdatestamp(real_date, sizeof(real_date));\n>  \treturn 0;\n\nI'll do this slightly differently, because I do not want to have\n\"ifdef __platform_name\" in the code when possible.\n\n> --- git-core-0.99.5/Makefile~\tThu Aug 25 03:54:24 2005\n> +++ git-core-0.99.5/Makefile\tTue Sep  6 01:18:32 2005\n> @@ -146,7 +146,11 @@\n>  \t\tendif\n>  \tendif\n>  endif\n> +ifeq ($(shell uname -s),SunOS)\n> +  LIBS += -lsocket\n> +endif\n>  \n> +\n>  DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'\n\nI'll do this in the way similar to how I did -liconv for Darwin.\n\n> +ifdef CURLDIR\n> +git-http-pull: LIBS += -lcurl -L$(CURLDIR)/lib -R$(CURLDIR)/lib\n> +else\n>  git-http-pull: LIBS += -lcurl\n> +endif\n\nCurious.  Doesn't the order of -l and -L/-R matter these days?\n\nI am sympathetic to the reason why you need this, but if we go\nthis route we should also do openssl as well.  I'd drop this\npart for now.\n"},{"id":"8192","messageId":"1126174268.723.10.camel@divert","threadId":"1735","inReplyTo":"7vr7c0xqhd.fsf@assigned-by-dhcp.cox.net","subject":"Re: patches","fromName":"Patrick Mauritz","fromEmail":"oxygene@studentenbude.ath.cx","sentAt":"2005-09-08T10:11:09Z","receivedAt":"2005-09-08T10:11:09Z","isPatch":false,"sender":{"key":"oxygene@studentenbude.ath.cx","avatar":null},"body":"On Thu, 2005-09-08 at 04:06, Junio C Hamano wrote:\n> I would have appreciated if you said \"Solaris portability patch\"\n> or somesuch on the subject line.\nsorry, of course you're right..\n\nthe #ifndef __sun was done because getdomainname() doesn't exist on\nsolaris. (just for clarification)\n\n> Curious.  Doesn't the order of -l and -L/-R matter these days?\nhmm.. no idea why it worked for me, but a test case fails now: better\nmake that -L -R -l\n\n> I am sympathetic to the reason why you need this, but if we go\n> this route we should also do openssl as well.  I'd drop this\n> part for now.\nbecause on solaris there are lots of places where external libraries\ncould be found (/usr/local/lib, /opt/csw/lib, whereever people who\npackage themselves put them). ld.so.conf doesn't exist (same as on\n*bsd), so using -L and -R is the standard way of linking external\nlibraries.\n\n\nthanks,\npatrick mauritz\n"},{"id":"8246","messageId":"25968.1126304722@lotus.CS.Berkeley.EDU","threadId":"1735","inReplyTo":"1125962642.15293.20.camel@divert","subject":"Re: patches","fromName":"Jason Riedy","fromEmail":"ejr@eecs.berkeley.edu","sentAt":"2005-09-09T22:25:22Z","receivedAt":"2005-09-09T22:25:22Z","isPatch":false,"sender":{"key":"ejr@eecs.berkeley.edu","avatar":"https://gravatar.com/avatar/547fa56f887cab01599edab4e9f813c949c1269e02714f20e0496c56185d9837?d=mp&s=160"},"body":"And Patrick Mauritz writes:\n - \n - --- git-core-0.99.5.orig/convert-cache.c\tWed Aug 17 09:55:00 2005\n - +++ git-core-0.99.5/convert-cache.c\tWed Aug 17 09:58:48 2005\n - @@ -1,4 +1,5 @@\n -  #define _XOPEN_SOURCE /* glibc2 needs this */\n - +#define __EXTENSIONS__ /* solaris needs this */\n\nTo be honest, the right place to handle both these \n#defines is the Makefile.  AIX needs its own set of \n-Ds to turn on various standards.  ugh.  I'm sure \nHP-UX needs even more magic, IRIX needs (is?) a dead \nchicken, etc.\n\n - +#ifndef __sun\n[...]\n -  \t\tgetdomainname(real_email+len, sizeof(real_email)-len);\n[...]\n - +#endif\n\ngetdomainname isn't declared, but it is in libnsl\n(on Solaris 8, Sparc) and works just fine.  Sun \ndocuments sysinfo (2) as its replacement, but that \ncall is different on different platforms.  I'd be\nshocked if getdomainname disappeared from libnsl,\nespecially since the C++ include files declare it.\nWhoops.\n\n - +ifeq ($(shell uname -s),SunOS)\n - +  LIBS += -lsocket\n - +endif\n\nTraditionally, it's -lsocket -lnsl to cover all the\nbases.  Old SunOS4 -> SunOS5 porting annoyance.  That \nalso lets getdomainname work.\n\nThe Makefile is generally insufficient for any platform\nother than Linux with system-supplied support libraries.\nFixing that will take a good deal of work and probably\nwill involve putting a bunch of variable-defining makefile\nfragments somewhere and including the \"right\" one.  With\nthe right variable definitions, a user can over-ride any\nof them from the make command...\n\nIn the meantime, my personal coping method is just to copy\nthe Makefile to Makefile.platform, edit it, and use make -f \nMakefile.platform.  I could be really cool and just use a \ndifferent git branch per platform, but I'm lazy.\n\nJason\n"},{"id":"8363","messageId":"7vmzmilu9w.fsf_-_@assigned-by-dhcp.cox.net","threadId":"1735","inReplyTo":"25968.1126304722@lotus.CS.Berkeley.EDU","subject":"[PATCH] getdomainname should be usable on SunOS with -lnsl","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-12T05:39:07Z","receivedAt":"2005-09-12T05:39:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jason Riedy suggests that we should be able to use getdomainname\nif we properly specify which libraries to link.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n I've tried this on an ancient Solaris machine I happened to\n have access at work and it seems to link OK.  Patrick, could\n you try this and see if it works OK for you?\n\n Makefile |    6 +++++-\n ident.c  |    2 --\n 2 files changed, 5 insertions(+), 3 deletions(-)\n\n2b6a27b6157c6ee472d654dbcaf380aec00d6444\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -148,7 +148,7 @@ ifeq ($(shell uname -s),Darwin)\n endif\n ifeq ($(shell uname -s),SunOS)\n \tNEEDS_SOCKET = YesPlease\n-\tPLATFORM_DEFINES += -DNO_GETDOMAINNAME=1\n+\tNEEDS_NSL = YesPlease\n endif\n \n ifndef SHELL_PATH\n@@ -195,6 +195,10 @@ ifdef NEEDS_SOCKET\n \tLIBS += -lsocket\n \tSIMPLE_LIB += -lsocket\n endif\n+ifdef NEEDS_NSL\n+\tLIBS += -lnsl\n+\tSIMPLE_LIB += -lnsl\n+endif\n \n DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'\n \ndiff --git a/ident.c b/ident.c\n--- a/ident.c\n+++ b/ident.c\n@@ -36,13 +36,11 @@ int setup_ident(void)\n \tmemcpy(real_email, pw->pw_name, len);\n \treal_email[len++] = '@';\n \tgethostname(real_email + len, sizeof(real_email) - len);\n-#ifndef NO_GETDOMAINNAME\n \tif (!strchr(real_email+len, '.')) {\n \t\tlen = strlen(real_email);\n \t\treal_email[len++] = '.';\n \t\tgetdomainname(real_email+len, sizeof(real_email)-len);\n \t}\n-#endif\n \t/* And set the default date */\n \tdatestamp(real_date, sizeof(real_date));\n \treturn 0;\n"}]}