guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

325/376: Fix library handling on Cygwin


From: Ludovic Courtès
Subject: 325/376: Fix library handling on Cygwin
Date: Wed, 28 Jan 2015 22:05:56 +0000

civodul pushed a commit to tag 1.8
in repository guix.

commit 4872677ffafce60bf863583804bb5700601ad7a4
Author: Marko Durkovic <address@hidden>
Date:   Tue Dec 9 12:22:12 2014 +0100

    Fix library handling on Cygwin
    
    1. Shared lib extension is .dll
    2. Shared libs are installed to $(prefix)/bin
    3. Linker does not support -z flag
---
 mk/libraries.mk |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/mk/libraries.mk b/mk/libraries.mk
index 3b91c69..3b292e9 100644
--- a/mk/libraries.mk
+++ b/mk/libraries.mk
@@ -3,7 +3,11 @@ libs-list :=
 ifeq ($(OS), Darwin)
   SO_EXT = dylib
 else
-  SO_EXT = so
+  ifeq (CYGWIN,$(findstring CYGWIN,$(OS)))
+    SO_EXT = dll
+  else
+    SO_EXT = so
+  endif
 endif
 
 # Build a library with symbolic name $(1).  The library is defined by
@@ -50,7 +54,11 @@ define build-library
   $(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs)))
   _libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH))
 
-  $(1)_INSTALL_DIR ?= $$(libdir)
+  ifeq (CYGWIN,$(findstring CYGWIN,$(OS)))
+    $(1)_INSTALL_DIR ?= $$(bindir)
+  else
+    $(1)_INSTALL_DIR ?= $$(libdir)
+  endif
 
   $(1)_LDFLAGS_USE :=
   $(1)_LDFLAGS_USE_INSTALLED :=
@@ -65,7 +73,9 @@ define build-library
       endif
     else
       ifneq ($(OS), Darwin)
-        $(1)_LDFLAGS += -Wl,-z,defs
+        ifneq (CYGWIN,$(findstring CYGWIN,$(OS)))
+          $(1)_LDFLAGS += -Wl,-z,defs
+        endif
       endif
     endif
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]