Darwin: Ignore missing /sw/lib
authorShawn Pearce <spearce@spearce.org>
Tue, 28 Feb 2006 14:03:48 +0000 (09:03 -0500)
committerJunio C Hamano <junkio@cox.net>
Tue, 28 Feb 2006 19:02:13 +0000 (11:02 -0800)
When on Darwin platforms don't include Fink or DarwinPorts
into the link path unless the related library directory
is actually present.  The linker on MacOS 10.4 complains
if it is given a directory which does not exist.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile

index 6c59cee41490d4bfba0fb43102555d8de3371d01..19578fc93a60cc41c31883ceac37a0f1ec4202d7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -223,11 +223,15 @@ ifeq ($(uname_S),Darwin)
        NEEDS_SSL_WITH_CRYPTO = YesPlease
        NEEDS_LIBICONV = YesPlease
        ## fink
-       ALL_CFLAGS += -I/sw/include
-       ALL_LDFLAGS += -L/sw/lib
+       ifeq ($(shell test -d /sw/lib && echo y),y)
+               ALL_CFLAGS += -I/sw/include
+               ALL_LDFLAGS += -L/sw/lib
+       endif
        ## darwinports
-       ALL_CFLAGS += -I/opt/local/include
-       ALL_LDFLAGS += -L/opt/local/lib
+       ifeq ($(shell test -d /opt/local/lib && echo y),y)
+               ALL_CFLAGS += -I/opt/local/include
+               ALL_LDFLAGS += -L/opt/local/lib
+       endif
 endif
 ifeq ($(uname_S),SunOS)
        NEEDS_SOCKET = YesPlease