| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | $NetBSD: patch-aa,v 1.6 2013/09/11 15:50:32 ryoon Exp $ | | 1 | $NetBSD: patch-aa,v 1.7 2013/11/09 05:28:35 ryoon Exp $ |
2 | | | 2 | |
3 | --- build/make/Makefile.orig 2013-09-04 18:49:22.000000000 +0000 | | 3 | --- build/make/Makefile.orig 2013-09-04 18:49:22.000000000 +0000 |
4 | +++ build/make/Makefile | | 4 | +++ build/make/Makefile |
5 | @@ -110,7 +110,7 @@ $(BUILD_PFX)%.c.d: %.c | | 5 | @@ -110,7 +110,7 @@ $(BUILD_PFX)%.c.d: %.c |
6 | | | 6 | |
7 | $(BUILD_PFX)%.c.o: %.c | | 7 | $(BUILD_PFX)%.c.o: %.c |
8 | $(if $(quiet),@echo " [CC] $@") | | 8 | $(if $(quiet),@echo " [CC] $@") |
9 | - $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $< | | 9 | - $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $< |
10 | + $(qexec)${LIBTOOL} --mode=compile $(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $< | | 10 | + $(qexec)${LIBTOOL} --mode=compile $(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $< |
11 | | | 11 | |
12 | $(BUILD_PFX)%.cc.d: %.cc | | 12 | $(BUILD_PFX)%.cc.d: %.cc |
13 | $(if $(quiet),@echo " [DEP] $@") | | 13 | $(if $(quiet),@echo " [DEP] $@") |
14 | @@ -119,7 +119,7 @@ $(BUILD_PFX)%.cc.d: %.cc | | 14 | @@ -119,7 +119,7 @@ $(BUILD_PFX)%.cc.d: %.cc |
| @@ -20,91 +20,101 @@ $NetBSD: patch-aa,v 1.6 2013/09/11 15:50 | | | @@ -20,91 +20,101 @@ $NetBSD: patch-aa,v 1.6 2013/09/11 15:50 |
20 | | | 20 | |
21 | $(BUILD_PFX)%.asm.d: %.asm | | 21 | $(BUILD_PFX)%.asm.d: %.asm |
22 | $(if $(quiet),@echo " [DEP] $@") | | 22 | $(if $(quiet),@echo " [DEP] $@") |
23 | @@ -129,7 +129,8 @@ $(BUILD_PFX)%.asm.d: %.asm | | 23 | @@ -129,7 +129,8 @@ $(BUILD_PFX)%.asm.d: %.asm |
24 | | | 24 | |
25 | $(BUILD_PFX)%.asm.o: %.asm | | 25 | $(BUILD_PFX)%.asm.o: %.asm |
26 | $(if $(quiet),@echo " [AS] $@") | | 26 | $(if $(quiet),@echo " [AS] $@") |
27 | - $(qexec)$(AS) $(ASFLAGS) -o $@ $< | | 27 | - $(qexec)$(AS) $(ASFLAGS) -o $@ $< |
28 | + $(qexec)${LIBTOOL} --mode=compile --tag=CC sh strip_fPIC.sh \ | | 28 | + $(qexec)${LIBTOOL} --mode=compile --tag=CC sh strip_fPIC.sh \ |
29 | + $(AS) $(ASFLAGS) -o $@ $< | | 29 | + $(AS) $(ASFLAGS) -o $@ $< |
30 | | | 30 | |
31 | $(BUILD_PFX)%.s.d: %.s | | 31 | $(BUILD_PFX)%.s.d: %.s |
32 | $(if $(quiet),@echo " [DEP] $@") | | 32 | $(if $(quiet),@echo " [DEP] $@") |
33 | @@ -211,13 +212,15 @@ define linker_template | | 33 | @@ -139,7 +140,8 @@ $(BUILD_PFX)%.s.d: %.s |
| | | 34 | |
| | | 35 | $(BUILD_PFX)%.s.o: %.s |
| | | 36 | $(if $(quiet),@echo " [AS] $@") |
| | | 37 | - $(qexec)$(AS) $(ASFLAGS) -o $@ $< |
| | | 38 | + $(qexec)${LIBTOOL} --mode=compile --tag=CC sh strip_fPIC.sh \ |
| | | 39 | + $(AS) $(ASFLAGS) -o $@ $< |
| | | 40 | |
| | | 41 | .PRECIOUS: %.c.S |
| | | 42 | %.c.S: CFLAGS += -DINLINE_ASM |
| | | 43 | @@ -211,13 +213,15 @@ define linker_template |
34 | $(1): $(filter-out -%,$(2)) | | 44 | $(1): $(filter-out -%,$(2)) |
35 | $(1): | | 45 | $(1): |
36 | $(if $(quiet),@echo " [LD] $$@") | | 46 | $(if $(quiet),@echo " [LD] $$@") |
37 | - $(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) | | 47 | - $(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) |
38 | + $(qexec)${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $$@ \ | | 48 | + $(qexec)${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $$@ \ |
39 | + $$(filter-out -lvpx,$(2)) libvpx.la $$(extralibs) | | 49 | + $$(filter-out -lvpx,$(2)) libvpx.la $$(extralibs) |
40 | endef | | 50 | endef |
41 | define linkerxx_template | | 51 | define linkerxx_template |
42 | $(1): $(filter-out -%,$(2)) | | 52 | $(1): $(filter-out -%,$(2)) |
43 | $(1): | | 53 | $(1): |
44 | $(if $(quiet),@echo " [LD] $$@") | | 54 | $(if $(quiet),@echo " [LD] $$@") |
45 | - $(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) | | 55 | - $(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) |
46 | + $(qexec)${LIBTOOL} --mode=link ${CXX} $(LDFLAGS) -o $$@ \ | | 56 | + $(qexec)${LIBTOOL} --mode=link ${CXX} $(LDFLAGS) -o $$@ \ |
47 | + $$(filter-out -lvpx,$(2)) libvpx.la $$(extralibs) | | 57 | + $$(filter-out -lvpx,$(2)) libvpx.la $$(extralibs) |
48 | endef | | 58 | endef |
49 | # make-3.80 has a bug with expanding large input strings to the eval function, | | 59 | # make-3.80 has a bug with expanding large input strings to the eval function, |
50 | # which was triggered in some cases by the following component of | | 60 | # which was triggered in some cases by the following component of |
51 | @@ -230,8 +233,12 @@ endef | | 61 | @@ -230,8 +234,12 @@ endef |
52 | define install_map_template | | 62 | define install_map_template |
53 | $(DIST_DIR)/$(1): $(2) | | 63 | $(DIST_DIR)/$(1): $(2) |
54 | $(if $(quiet),@echo " [INSTALL] $$@") | | 64 | $(if $(quiet),@echo " [INSTALL] $$@") |
55 | - $(qexec)mkdir -p $$(dir $$@) | | 65 | - $(qexec)mkdir -p $$(dir $$@) |
56 | - $(qexec)cp -p $$< $$@ | | 66 | - $(qexec)cp -p $$< $$@ |
57 | + $(qexec)${BSD_INSTALL_DATA} -d -m 755 $$(dir $$@) | | 67 | + $(qexec)${BSD_INSTALL_DATA} -d -m 755 $$(dir $$@) |
58 | + $$(if $$(filter %.a,$$<), \ | | 68 | + $$(if $$(filter %.a,$$<), \ |
59 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} -c $$(patsubst %.a,%.la,$$<) $$(dir $$@), \ | | 69 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} -c $$(patsubst %.a,%.la,$$<) $$(dir $$@), \ |
60 | + $$(if $$(filter %.h %.pc,$$<), \ | | 70 | + $$(if $$(filter %.h %.pc,$$<), \ |
61 | + ${BSD_INSTALL_DATA} -c -m 644 $$< $$(dir $$@), \ | | 71 | + ${BSD_INSTALL_DATA} -c -m 644 $$< $$(dir $$@), \ |
62 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} -c -s $$< $$(dir $$@))) | | 72 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} -c -s $$< $$(dir $$@))) |
63 | endef | | 73 | endef |
64 | | | 74 | |
65 | define archive_template | | 75 | define archive_template |
66 | @@ -240,7 +247,9 @@ define archive_template | | 76 | @@ -240,7 +248,9 @@ define archive_template |
67 | # for creating them. | | 77 | # for creating them. |
68 | $(1): | | 78 | $(1): |
69 | $(if $(quiet),@echo " [AR] $$@") | | 79 | $(if $(quiet),@echo " [AR] $$@") |
70 | - $(qexec)$$(AR) $$(ARFLAGS) $$@ $$? | | 80 | - $(qexec)$$(AR) $$(ARFLAGS) $$@ $$? |
71 | + $(qexec)${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -Wl,-Bsymbolic -o $$(patsubst %.a,%.la,$$@) \ | | 81 | + $(qexec)${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -Wl,-Bsymbolic -o $$(patsubst %.a,%.la,$$@) \ |
72 | + $$(patsubst %.o,%.lo,$$?) -rpath $(PREFIX)/lib $$(extralibs) \ | | 82 | + $$(patsubst %.o,%.lo,$$?) -rpath $(PREFIX)/lib $$(extralibs) \ |
73 | + -version-info $(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_PATCH) | | 83 | + -version-info $(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_PATCH) |
74 | endef | | 84 | endef |
75 | | | 85 | |
76 | define so_template | | 86 | define so_template |
77 | @@ -317,20 +326,20 @@ clean:: | | 87 | @@ -317,20 +327,20 @@ clean:: |
78 | rm -f .bins .install-bins $(BINS) | | 88 | rm -f .bins .install-bins $(BINS) |
79 | | | 89 | |
80 | LIBS=$(call enabled,LIBS) | | 90 | LIBS=$(call enabled,LIBS) |
81 | -.libs: $(LIBS) | | 91 | -.libs: $(LIBS) |
82 | +dot.libs: $(LIBS) | | 92 | +dot.libs: $(LIBS) |
83 | @touch $@ | | 93 | @touch $@ |
84 | -$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib)))) | | 94 | -$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib)))) |
85 | +$(foreach lib,$(filter %.a,$(LIBS)),$(eval $(call archive_template,$(lib)))) | | 95 | +$(foreach lib,$(filter %.a,$(LIBS)),$(eval $(call archive_template,$(lib)))) |
86 | $(foreach lib,$(filter %so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib)))) | | 96 | $(foreach lib,$(filter %so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib)))) |
87 | | | 97 | |
88 | INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS) | | 98 | INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS) |
89 | ifeq ($(MAKECMDGOALS),dist) | | 99 | ifeq ($(MAKECMDGOALS),dist) |
90 | INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS) | | 100 | INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS) |
91 | endif | | 101 | endif |
92 | -.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS)) | | 102 | -.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS)) |
93 | +.install-libs: dot.libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS)) | | 103 | +.install-libs: dot.libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS)) |
94 | @touch $@ | | 104 | @touch $@ |
95 | | | 105 | |
96 | clean:: | | 106 | clean:: |
97 | - rm -f .libs .install-libs $(LIBS) | | 107 | - rm -f .libs .install-libs $(LIBS) |
98 | + rm -f dot.libs .install-libs $(LIBS) | | 108 | + rm -f dot.libs .install-libs $(LIBS) |
99 | | | 109 | |
100 | ifeq ($(CONFIG_EXTERNAL_BUILD),yes) | | 110 | ifeq ($(CONFIG_EXTERNAL_BUILD),yes) |
101 | PROJECTS=$(call enabled,PROJECTS) | | 111 | PROJECTS=$(call enabled,PROJECTS) |
102 | @@ -380,7 +389,7 @@ ifeq ($(CONFIG_EXTERNAL_BUILD),yes) | | 112 | @@ -380,7 +390,7 @@ ifeq ($(CONFIG_EXTERNAL_BUILD),yes) |
103 | BUILD_TARGETS += .projects | | 113 | BUILD_TARGETS += .projects |
104 | INSTALL_TARGETS += .install-projects | | 114 | INSTALL_TARGETS += .install-projects |
105 | endif | | 115 | endif |
106 | -BUILD_TARGETS += .docs .libs .bins | | 116 | -BUILD_TARGETS += .docs .libs .bins |
107 | +BUILD_TARGETS += .docs dot.libs .bins | | 117 | +BUILD_TARGETS += .docs dot.libs .bins |
108 | INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins | | 118 | INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins |
109 | all: $(BUILD_TARGETS) | | 119 | all: $(BUILD_TARGETS) |
110 | install:: $(INSTALL_TARGETS) | | 120 | install:: $(INSTALL_TARGETS) |