@matheusbsbs / matheus-bagliano / commits / 70cf991093
Fork 0

Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments

This library is required on Solaris when compiling with NO_IPV6 since hstrerror resides in libresolv. Additionally, Solaris 7 will need it, since inet_ntop and inet_pton reside there too. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Jun 5, 2009 at 18:36 UTC 70cf991093d4ab8854de0090aca9cf8d10ebd8f8
1 file changed +10 -1
Makefile
+10 -1
@@ -91,6 +91,10 @@ all::
91 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
92 # Patrick Mauritz).
93 #
94 +# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.
95 +# Notably on Solaris hstrerror resides in libresolv and on Solaris 7
96 +# inet_ntop and inet_pton additionally reside there.
97 +#
98 # Define NO_MMAP if you want to avoid mmap.
99 #
100 # Define NO_PTHREADS if you do not have or do not want to use Pthreads.
@@ -700,7 +704,6 @@ ifeq ($(uname_S),SunOS)
704 SHELL_PATH = /bin/bash
705 NO_STRCASESTR = YesPlease
706 NO_MEMMEM = YesPlease
703 - NO_HSTRERROR = YesPlease
707 NO_MKDTEMP = YesPlease
708 OLD_ICONV = UnfortunatelyYes
709 ifeq ($(uname_R),5.8)
@@ -715,6 +718,9 @@ ifeq ($(uname_S),SunOS)
718 NO_C99_FORMAT = YesPlease
719 NO_STRTOUMAX = YesPlease
720 endif
721 + ifdef NO_IPV6
722 + NEEDS_RESOLV = YesPlease
723 + endif
724 INSTALL = /usr/ucb/install
725 TAR = gtar
726 BASIC_CFLAGS += -D__EXTENSIONS__
@@ -956,6 +962,9 @@ endif
962 ifdef NEEDS_NSL
963 EXTLIBS += -lnsl
964 endif
965 +ifdef NEEDS_RESOLV
966 + EXTLIBS += -lresolv
967 +endif
968 ifdef NO_D_TYPE_IN_DIRENT
969 BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
970 endif