summaryrefslogtreecommitdiff
blob: 7e290d434f03ef31311b6d8348298ac2ab8b7427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Bug: https://bugs.gentoo.org/show_bug.cgi?id=618878

A few patches to make crossdev for mingw-w64 play nice with ruby's ebuilds.
Basic gist is that without the following patch to configure.in ruby-2.4.1
hardcodes 240 into the shared, static, and import library names, which when
built with the current ruby ebuilds results in names like libx64-msvcrt-ruby24240.dll and so on. The patch is in ruby-trunk[1], but may take a while
to hit the tarballs that gentoo uses.

Index: configure.in
===================================================================
--- a/configure.in	(revision 57824)
+++ b/configure.in	(revision 57825)
@@ -3825,7 +3825,23 @@
 
 AC_ARG_WITH(soname,
 	AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]),
-	[RUBY_SO_NAME=$withval], [RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
+	[RUBY_SO_NAME=$withval],
+	[
+	    AS_CASE(["$target_os"],
+	    [darwin*], [
+	        RUBY_SO_NAME='$(RUBY_BASE_NAME).$(RUBY_PROGRAM_VERSION)'
+	    ],
+	    [cygwin*], [
+	        RUBY_SO_NAME='$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0'
+	    ],
+	    [mingw*], [
+		RUBY_SO_NAME="${rb_cv_msvcrt}"'-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0'
+		AS_IF([test x"${target_cpu}" != xi386], [
+		    RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
+		])
+	    ],
+	    [RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
+	])
 
 LIBRUBY_LDSHARED=$LDSHARED
 LIBRUBY_DLDFLAGS=$DLDFLAGS
@@ -3925,7 +3941,6 @@
 	SOLIBS='-lm -lc'
 	],
     [darwin*], [
-	RUBY_SO_NAME="$RUBY_SO_NAME"'.$(RUBY_PROGRAM_VERSION)'
 	LIBRUBY_LDSHARED='$(CC) -dynamiclib'
 	if test "$load_relative" = yes; then
 	    libprefix="@executable_path/../${libdir_basename}"
@@ -4157,7 +4172,6 @@
 	fi
 	],
     [cygwin*|mingw*], [
-	RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)0'
 	LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
 	AS_CASE(["$target_os"],
 	[cygwin*], [
@@ -4167,10 +4181,6 @@
 	    fi
 	    ],
 	[mingw*], [
-	    RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
-	    if test x"${target_cpu}" != xi386; then
-		RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
-	    fi
 	    if test x"$enable_shared" = xyes; then
 		LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
 		LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'