From: Junio C Hamano Date: Mon, 12 Sep 2005 05:25:49 +0000 (-0700) Subject: [PATCH] getdomainname should be usable on SunOS with -lnsl X-Git-Tag: v0.99.7~13 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=5a90d4ac1ab4d7700595e415e3a2062ecb378523;hp=aa894d8887c96a8b72adf94c2b52c519f7b47174;p=git.git [PATCH] getdomainname should be usable on SunOS with -lnsl Jason Riedy suggests that we should be able to use getdomainname if we properly specify which libraries to link. Signed-off-by: Junio C Hamano --- diff --git a/Makefile b/Makefile index b48fe44b..0e9f2ec4 100644 --- a/Makefile +++ b/Makefile @@ -151,7 +151,8 @@ ifeq ($(shell uname -s),Darwin) endif ifeq ($(shell uname -s),SunOS) NEEDS_SOCKET = YesPlease - PLATFORM_DEFINES += -DNO_GETDOMAINNAME=1 + NEEDS_NSL = YesPlease + PLATFORM_DEFINES += -D__EXTENSIONS__ endif ifndef SHELL_PATH @@ -198,6 +199,10 @@ ifdef NEEDS_SOCKET LIBS += -lsocket SIMPLE_LIB += -lsocket endif +ifdef NEEDS_NSL + LIBS += -lnsl + SIMPLE_LIB += -lnsl +endif DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)' diff --git a/convert-objects.c b/convert-objects.c index 073cab59..9ad0c776 100644 --- a/convert-objects.c +++ b/convert-objects.c @@ -1,5 +1,4 @@ #define _XOPEN_SOURCE /* glibc2 needs this */ -#define __EXTENSIONS__ /* solaris needs this */ #include #include #include "cache.h" diff --git a/ident.c b/ident.c index 0df2d979..a2d241fb 100644 --- a/ident.c +++ b/ident.c @@ -36,13 +36,11 @@ int setup_ident(void) memcpy(real_email, pw->pw_name, len); real_email[len++] = '@'; gethostname(real_email + len, sizeof(real_email) - len); -#ifndef NO_GETDOMAINNAME if (!strchr(real_email+len, '.')) { len = strlen(real_email); real_email[len++] = '.'; getdomainname(real_email+len, sizeof(real_email)-len); } -#endif /* And set the default date */ datestamp(real_date, sizeof(real_date)); return 0;