From 107506f814f42af4a905156e7ce5dd9a2ca6c0c7 Mon Sep 17 00:00:00 2001 From: David Meyer Date: Sat, 18 Feb 2012 10:03:19 +0000 Subject: [PATCH] On Cygwin/MingW, add SharedLibDir and LLVMToolDir to the library search path, since shared libraries are placed in 'bin'. (static libraries are still in 'lib'). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150876 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.rules | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.rules b/Makefile.rules index 32a97c646c7..a1edb6b7dd8 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -701,7 +701,13 @@ ifeq ($(HOST_OS),AuroraUX) CPP.BaseFlags += -include llvm/Support/Solaris.h endif # !HOST_OS - AuroraUX. -LD.Flags += -L$(LibDir) -L$(LLVMLibDir) +# On Windows, SharedLibDir != LibDir. The order is important. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + LD.Flags += -L$(SharedLibDir) -L$(LibDir) -L$(LLVMToolDir) -L$(LLVMLibDir) +else + LD.Flags += -L$(LibDir) -L$(LLVMLibDir) +endif + CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS # All -I flags should go here, so that they don't confuse llvm-config. CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \