History

configure: add --enable-static option

Fixes issue #62.

James Zern committed 15 years ago

Commit 495b2411 parent 5b0de483 files · +23 −7Browse files

Unified · Split

3 files
  1. configure +4 −0
  2. examples.mk +3 −1
  3. libs.mk +16 −6
configure+4−0
@@ -40,6 +40,7 @@ Advanced options: · 39 unmodified lines
4040 ${toggle_error_concealment} enable this option to get a decoder which is able to conceal losses
4141 ${toggle_runtime_cpu_detect} runtime cpu detection
4242 ${toggle_shared} shared library support
43+ ${toggle_static} static library support
4344 ${toggle_small} favor smaller size over speed
4445 ${toggle_postproc_visualizer} macro block / block level visualizers
4546
@@ -153,6 +154,7 @@ enabled doxygen && php -v >/dev/null 2>&1 && enable install_docs · 107 unmodified lines
153154 enable install_bins
154155 enable install_libs
155156
157+enable static
156158 enable optimizations
157159 enable fast_unaligned #allow unaligned accesses, if supported by hw
158160 enable md5
@@ -252,6 +254,7 @@ CONFIG_LIST=" · 93 unmodified lines
252254 realtime_only
253255 error_concealment
254256 shared
257+ static
255258 small
256259 postproc_visualizer
257260 os_support
@@ -293,6 +296,7 @@ CMDLINE_SELECT=" · 35 unmodified lines
293296 realtime_only
294297 error_concealment
295298 shared
299+ static
296300 small
297301 postproc_visualizer
298302 "
examples.mk+3−1
@@ -167,8 +167,10 @@ BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=)) · 166 unmodified lines
167167
168168 # Instantiate linker template for all examples.
169169 CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
170+CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
170171 $(foreach bin,$(BINS-yes),\
171− $(if $(BUILD_OBJS),$(eval $(bin): $(LIB_PATH)/lib$(CODEC_LIB).a))\
172+ $(if $(BUILD_OBJS),$(eval $(bin):\
173+ $(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF)))\
172174 $(if $(BUILD_OBJS),$(eval $(call linker_template,$(bin),\
173175 $(call objs,$($(notdir $(bin)).SRCS)) \
174176 -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
libs.mk+16−6
@@ -121,7 +121,7 @@ INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/v · 120 unmodified lines
121121 INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp)
122122 endif
123123 else
124−INSTALL-LIBS-yes += $(LIBSUBDIR)/libvpx.a
124+INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a
125125 INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
126126 endif
127127
@@ -177,12 +177,13 @@ endif · 49 unmodified lines
177177 else
178178 LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
179179 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS)
180−LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
180+LIBS-$(CONFIG_STATIC) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
181181 $(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
182182
183183 BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
184184 LIBVPX_SO := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
185−LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)
185+LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\
186+ $(notdir $(LIBVPX_SO_SYMLINKS))
186187 $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) libvpx.ver
187188 $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
188189 $(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(VERSION_MAJOR)
@@ -198,9 +199,18 @@ libvpx.ver: $(call enabled,CODEC_EXPORTS) · 9 unmodified lines
198199 $(qexec)echo "local: *; };" >> $@
199200 CLEAN-OBJS += libvpx.ver
200201
201−$(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)): $(DIST_DIR)/$(LIBSUBDIR)/$(LIBVPX_SO)
202− @echo " [LN] $@"
203− $(qexec)ln -sf $(LIBVPX_SO) $@
202+define libvpx_symlink_template
203+$(1): $(2)
204+ @echo " [LN] $$@"
205+ $(qexec)ln -sf $(LIBVPX_SO) $$@
206+endef
207+
208+$(eval $(call libvpx_symlink_template,\
209+ $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\
210+ $(BUILD_PFX)$(LIBVPX_SO)))
211+$(eval $(call libvpx_symlink_template,\
212+ $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
213+ $(DIST_DIR)/$(LIBSUBDIR)/$(LIBVPX_SO)))
204214
205215 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
206216 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t