summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mauritz <oxygene@studentenbude.ath.cx>2005-09-05 23:24:03 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-08 05:08:28 (GMT)
commitf0ebff0dfebc667e5edf6f67d190fd960513ab66 (patch)
tree383cfd9f34d559c51bcd7d764e2fbbac5cb896b6
parent215a7ad1ef790467a4cd3f0dcffbd6e5f04c38f7 (diff)
downloadgit-f0ebff0dfebc667e5edf6f67d190fd960513ab66.zip
git-f0ebff0dfebc667e5edf6f67d190fd960513ab66.tar.gz
git-f0ebff0dfebc667e5edf6f67d190fd960513ab66.tar.bz2
[PATCH] Portability fix for Solaris 10/x86
* getdomainname unavailable there. * needs -lsocket for linkage. * needs __EXTENSIONS__ at the beginning of convert-objects.c [JC: I've done this slightly differently from what Patrick originally sent to the list and dropped the bit that deals with installations that has curl header and library at non-default location. I am resisting the slipperly slope called autoconf.] Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--Makefile18
-rw-r--r--convert-objects.c1
-rw-r--r--ident.c3
3 files changed, 19 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 18696fa..4f55f63 100644
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,14 @@
# a bundled SHA1 routine optimized for PowerPC.
#
# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
+#
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
-
+#
+# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
+# Patrick Mauritz).
+#
+# Define NO_GETDOMAINNAME if your library lack it (SunOS, Patrick Mauritz).
+#
# Define COLLISION_CHECK below if you believe that SHA1's
# 1461501637330902918203684832716283019655932542976 hashes do not give you
# sufficient guarantee that no collisions between objects will ever happen.
@@ -37,7 +43,7 @@
GIT_VERSION = 0.99.6
CFLAGS = -g -O2 -Wall
-ALL_CFLAGS = $(CFLAGS) $(DEFINES)
+ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
prefix = $(HOME)
bindir = $(prefix)/bin
@@ -131,6 +137,10 @@ ifeq ($(shell uname -s),Darwin)
NEEDS_SSL_WITH_CRYPTO = YesPlease
NEEDS_LIBICONV = YesPlease
endif
+ifeq ($(shell uname -s),SunOS)
+ NEEDS_SOCKET = YesPlease
+ PLATFORM_DEFINES += -DNO_GETDOMAINNAME=1
+endif
ifndef NO_OPENSSL
LIB_OBJS += epoch.o
@@ -162,6 +172,10 @@ else
LIBS += $(LIB_4_CRYPTO)
endif
endif
+ifdef NEEDS_SOCKET
+ LIBS += -lsocket
+ SIMPLE_LIB += -lsocket
+endif
DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'
diff --git a/convert-objects.c b/convert-objects.c
index 9ad0c77..073cab5 100644
--- a/convert-objects.c
+++ b/convert-objects.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE /* glibc2 needs this */
+#define __EXTENSIONS__ /* solaris needs this */
#include <time.h>
#include <ctype.h>
#include "cache.h"
diff --git a/ident.c b/ident.c
index 0fe81f6..7e917f7 100644
--- a/ident.c
+++ b/ident.c
@@ -36,12 +36,13 @@ 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;