summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 215a7ad)
raw | patch | inline | side by side (parent: 215a7ad)
author | Patrick Mauritz <oxygene@studentenbude.ath.cx> | |
Mon, 5 Sep 2005 23:24:03 +0000 (01:24 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 8 Sep 2005 05:08:28 +0000 (22:08 -0700) |
* 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>
* 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>
Makefile | patch | blob | history | |
convert-objects.c | patch | blob | history | |
ident.c | patch | blob | history |
diff --git a/Makefile b/Makefile
index 18696fa7bc213e667f80052e0484f9a4e1879e7e..4f55f631b9327ce4af5c54a8050244f0debfa4df 100644 (file)
--- a/Makefile
+++ b/Makefile
# 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.
GIT_VERSION = 0.99.6
CFLAGS = -g -O2 -Wall
-ALL_CFLAGS = $(CFLAGS) $(DEFINES)
+ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
prefix = $(HOME)
bindir = $(prefix)/bin
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
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 9ad0c77678a740c82c91b4f99de039e12605808d..073cab592fba81c97e6f13d660b0329a42427ef0 100644 (file)
--- a/convert-objects.c
+++ b/convert-objects.c
#define _XOPEN_SOURCE /* glibc2 needs this */
+#define __EXTENSIONS__ /* solaris needs this */
#include <time.h>
#include <ctype.h>
#include "cache.h"
index 0fe81f6900dcb6951539c050f1398b1d4b208ea6..7e917f74de234fd827658805537bc268c34adca6 100644 (file)
--- a/ident.c
+++ b/ident.c
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;