summarylogtreecommitdiffstats
path: root/0001-enable-shared-on.mingw.patch
blob: 9089fbe4f0777d1950bbc8d7dac98d1ec4be6b78 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
diff -aur libvpx-1.6.0-orig/build/make/configure.sh libvpx-1.6.0/build/make/configure.sh
--- libvpx-1.6.0-orig/build/make/configure.sh	2016-07-21 04:15:41.000000000 +0300
+++ libvpx-1.6.0/build/make/configure.sh	2016-07-28 18:34:25.287546800 +0300
@@ -647,7 +647,10 @@
       --libdir=*)
         libdir="${optval}"
         ;;
-      --libc|--as|--prefix|--libdir)
+      --bindir=*)
+        bindir="${optval}"
+        ;;
+      --libc|--as|--prefix|--libdir|--bindir)
         die "Option ${opt} requires argument"
         ;;
       --help|-h)
@@ -618,9 +621,14 @@
   prefix="${prefix%/}"
   libdir="${libdir:-${prefix}/lib}"
   libdir="${libdir%/}"
+  bindir="${bindir:-${prefix}/bin}"
+  bindir="${bindir%/}"
   if [ "${libdir#${prefix}}" = "${libdir}" ]; then
     die "Libdir ${libdir} must be a subdirectory of ${prefix}"
   fi
+  if [ "${bindir#${prefix}}" = "${bindir}" ]; then
+    die "Bindir ${bindir} must be a subdirectory of ${prefix}"
+  fi
 }
 
 post_process_cmdline() {
diff -aur libvpx-1.6.0-orig/build/make/Makefile libvpx-1.6.0/build/make/Makefile
--- libvpx-1.6.0-orig/build/make/Makefile	2016-07-21 04:15:41.000000000 +0300
+++ libvpx-1.6.0/build/make/Makefile	2016-07-28 18:34:25.287546800 +0300
@@ -300,6 +300,20 @@
             $$(filter %.o,$$^) $$(extralibs)
 endef
 
+define dll_gnu_template
+# Not using a pattern rule here because we don't want to generate empty
+# archives when they are listed as a dependency in files not responsible
+# for creating them.
+#
+# This needs further abstraction for dealing with non-GNU linkers.
+$(1):
+	$(if $(quiet),@echo "    [LD] $$@")
+	$(qexec)$$(LD) -shared $$(LDFLAGS) \
+            -Wl,--no-undefined \
+            -o $$@ \
+            -Wl,--out-implib=$$(subst $(2),.dll.a,$(1)) $$(filter %.o,$$^) $$(extralibs)
+endef
+
 define dl_template
 # Not using a pattern rule here because we don't want to generate empty
 # archives when they are listed as a dependency in files not responsible
@@ -383,6 +397,7 @@
 $(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
 $(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
 $(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))
+$(foreach lib,$(filter %-$(VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_gnu_template,$(lib),-$(VERSION_MAJOR).dll)))
 
 INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
 ifeq ($(MAKECMDGOALS),dist)
Only in libvpx-1.6.0/build/make: Makefile.orig
diff -aur libvpx-1.6.0-orig/configure libvpx-1.6.0/configure
--- libvpx-1.6.0-orig/configure	2016-07-21 04:15:41.000000000 +0300
+++ libvpx-1.6.0/configure	2016-07-28 18:37:36.879364800 +0300
@@ -473,6 +473,7 @@
 DIST_DIR?=\$(DESTDIR)${prefix}
 endif
 LIBSUBDIR=${libdir##${prefix}/}
+BINSUBDIR=${bindir##${prefix}/}
 
 VERSION_STRING=${VERSION_STRING}
 
@@ -510,9 +511,13 @@
             ;;
         *)
             if enabled gnu; then
-                echo "--enable-shared is only supported on ELF; assuming this is OK"
+                echo "--enable-shared is only supported on ELF and PE; assuming this is OK"
+            elif enabled win32; then
+                echo "--enable-shared is only supported on ELF and PE; assuming this is OK"
+            elif enabled win64; then
+                echo "--enable-shared is only supported on ELF and PE; assuming this is OK"
             else
-                die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
+                die "--enable-shared only supported on ELF, OS/2, Darwin and PE for now"
             fi
             ;;
         esac
diff -aur libvpx-1.6.0-orig/examples.mk libvpx-1.6.0/examples.mk
--- libvpx-1.6.0-orig/examples.mk	2016-07-21 04:15:41.000000000 +0300
+++ libvpx-1.6.0/examples.mk	2016-07-28 18:34:25.303172800 +0300
@@ -302,9 +302,13 @@
 ifneq ($(filter os2%,$(TGT_OS)),)
 SHARED_LIB_SUF=_dll.a
 else
+ifneq ($(filter win%,$(TGT_OS)),)
+SHARED_LIB_SUF=.dll.a
+else
 SHARED_LIB_SUF=.so
 endif
 endif
+endif
 CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
 $(foreach bin,$(BINS-yes),\
     $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\
diff -aur libvpx-1.6.0-orig/libs.mk libvpx-1.6.0/libs.mk
--- libvpx-1.6.0-orig/libs.mk	2016-07-21 04:15:41.000000000 +0300
+++ libvpx-1.6.0/libs.mk	2016-07-28 18:34:25.303172800 +0300
@@ -130,6 +130,7 @@
 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/%
 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/%
 INSTALL_MAPS += $(LIBSUBDIR)/%     %
+INSTALL_MAPS += $(BINSUBDIR)/%     %
 INSTALL_MAPS += src/%     $(SRC_PATH_BARE)/%
 ifeq ($(CONFIG_MSVS),yes)
 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/%  $(p)/Release/%)
@@ -252,6 +253,13 @@
 LIBVPX_SO_SYMLINKS      :=
 LIBVPX_SO_IMPLIB        := libvpx_dll.a
 else
+ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS))
+LIBVPX_SO               := libvpx-$(VERSION_MAJOR).dll
+SHARED_LIB_SUF          := .dll.a
+EXPORT_FILE             :=
+LIBVPX_SO_SYMLINKS      :=
+LIBVPX_SO_IMPLIB        := libvpx.dll.a
+else
 LIBVPX_SO               := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
 SHARED_LIB_SUF          := .so
 EXPORT_FILE             := libvpx.ver
@@ -261,13 +269,14 @@
 endif
 endif
 endif
+endif
 
 LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\
                            $(notdir $(LIBVPX_SO_SYMLINKS)) \
                            $(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB))
 $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
 $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
-$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR)
+$(BUILD_PFX)$(LIBVPX_SO): SONAME = $(LIBVPX_SO)
 $(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
 
 libvpx.ver: $(call enabled,CODEC_EXPORTS)
@@ -295,6 +304,10 @@
 	$(qexec)emximp -o $@ $<
 CLEAN-OBJS += libvpx_dll.a
 
+libvpx.dll.a: $(LIBVPX_SO)
+	@echo "    [IMPLIB] $@"
+CLEAN-OBJS += libvpx.dll.a
+
 define libvpx_symlink_template
 $(1): $(2)
 	@echo "    [LN]     $(2) $$@"
@@ -311,7 +324,7 @@
 
 
 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
-INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
+INSTALL-LIBS-$(CONFIG_SHARED) += $(BINSUBDIR)/$(LIBVPX_SO)
 INSTALL-LIBS-$(CONFIG_SHARED) += $(if $(LIBVPX_SO_IMPLIB),$(LIBSUBDIR)/$(LIBVPX_SO_IMPLIB))