shithub: libvpx

Download patch

ref: 3d7063d4b0c936cdb2b5e484aad13052f0000ebb
parent: 5c02f88a813fe3fd1ea6eeeba954cdfd4e113f7f
author: Tom Finegan <tomfinegan@google.com>
date: Tue May 12 11:33:40 EDT 2015

Remove claims of universal target support from the build system.

These targets no longer build (PPC support was removed from
libvpx). Remove the dead code and misleading help output.

BUG=https://code.google.com/p/webm/issues/detail?id=997

Change-Id: Ib35614806adeae970f3821da0d8dbcc54ab8d868

--- a/README
+++ b/README
@@ -101,13 +101,6 @@
     x86_64-win64-vs10
     x86_64-win64-vs11
     x86_64-win64-vs12
-    universal-darwin8-gcc
-    universal-darwin9-gcc
-    universal-darwin10-gcc
-    universal-darwin11-gcc
-    universal-darwin12-gcc
-    universal-darwin13-gcc
-    universal-darwin14-gcc
     generic-gnu
 
   The generic-gnu target, in conjunction with the CROSS environment variable,
--- a/build/make/Makefile
+++ b/build/make/Makefile
@@ -56,14 +56,7 @@
         fi
 endif
 
-ifneq ($(target),)
-# Normally, we want to build the filename from the target and the toolchain.
-# This disambiguates from the $(target).mk file that exists in the source tree.
-# However, the toolchain is part of the target in universal builds, so we
-# don't want to include TOOLCHAIN in that case. FAT_ARCHS is used to test
-# if we're in the universal case.
-include $(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk
-endif
+include $(target)-$(TOOLCHAIN).mk
 BUILD_ROOT?=.
 VPATH=$(SRC_PATH_BARE)
 CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
@@ -312,21 +305,6 @@
         -o $$@ \
         $$(filter %.o,$$^) $$(extralibs)
 endef
-
-
-
-define lipo_lib_template
-$(1): $(addsuffix /$(1),$(FAT_ARCHS))
-	$(if $(quiet),@echo "    [LIPO] $$@")
-	$(qexec)libtool -static -o $$@ $$?
-endef
-
-define lipo_bin_template
-$(1): $(addsuffix /$(1),$(FAT_ARCHS))
-	$(if $(quiet),@echo "    [LIPO] $$@")
-	$(qexec)lipo -output $$@ -create $$?
-endef
-
 
 #
 # Get current configuration
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -390,7 +390,7 @@
 write_common_config_targets() {
   for t in ${all_targets}; do
     if enabled ${t}; then
-      if enabled universal || enabled child; then
+      if enabled child; then
         fwrite config.mk "ALL_TARGETS += ${t}-${toolchain}"
       else
         fwrite config.mk "ALL_TARGETS += ${t}"
@@ -647,14 +647,6 @@
 
     # detect tgt_os
     case "$gcctarget" in
-      *darwin8*)
-        tgt_isa=universal
-        tgt_os=darwin8
-        ;;
-      *darwin9*)
-        tgt_isa=universal
-        tgt_os=darwin9
-        ;;
       *darwin10*)
         tgt_isa=x86_64
         tgt_os=darwin10
@@ -1215,7 +1207,7 @@
           ;;
       esac
       ;;
-    universal*|*-gcc|generic-gnu)
+    *-gcc|generic-gnu)
       link_with_cc=gcc
       enable_feature gcc
       setup_gnu_toolchain
--- a/configure
+++ b/configure
@@ -148,13 +148,6 @@
 all_platforms="${all_platforms} x86_64-win64-vs10"
 all_platforms="${all_platforms} x86_64-win64-vs11"
 all_platforms="${all_platforms} x86_64-win64-vs12"
-all_platforms="${all_platforms} universal-darwin8-gcc"
-all_platforms="${all_platforms} universal-darwin9-gcc"
-all_platforms="${all_platforms} universal-darwin10-gcc"
-all_platforms="${all_platforms} universal-darwin11-gcc"
-all_platforms="${all_platforms} universal-darwin12-gcc"
-all_platforms="${all_platforms} universal-darwin13-gcc"
-all_platforms="${all_platforms} universal-darwin14-gcc"
 all_platforms="${all_platforms} generic-gnu"
 
 # all_targets is a list of all targets that can be configured
@@ -436,22 +429,8 @@
 
 process_targets() {
     enabled child || write_common_config_banner
-    enabled universal || write_common_target_config_h  ${BUILD_PFX}vpx_config.h
-
-    # For fat binaries, call configure recursively to configure for each
-    # binary architecture to be included.
-    if enabled universal; then
-        # Call configure (ourselves) for each subarchitecture
-        for arch in $fat_bin_archs; do
-            BUILD_PFX=${arch}/ toolchain=${arch} $self --child $cmdline_args || exit $?
-        done
-    fi
-
-    # The write_common_config (config.mk) logic is deferred until after the
-    # recursive calls to configure complete, because we want our universal
-    # targets to be executed last.
+    write_common_target_config_h ${BUILD_PFX}vpx_config.h
     write_common_config_targets
-    enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk
 
     # Calculate the default distribution name, based on the enabled features
     cf=""
@@ -596,24 +575,6 @@
 process_toolchain() {
     process_common_toolchain
 
-    # Handle universal binaries for this architecture
-    case $toolchain in
-        universal-darwin*)
-            darwin_ver=${tgt_os##darwin}
-
-            # Tiger (10.4/darwin8) brought support for x86
-            if [ $darwin_ver -ge 8 ]; then
-                fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}"
-            fi
-
-            # Leopard (10.5/darwin9) brought 64 bit support
-            if [ $darwin_ver -ge 9 ]; then
-                fat_bin_archs="$fat_bin_archs x86_64-${tgt_os}-${tgt_cc}"
-            fi
-            ;;
-    esac
-
-
     # Enable some useful compiler flags
     if enabled gcc; then
         enabled werror && check_add_cflags -Werror
@@ -701,7 +662,7 @@
     esac
 
     # Other toolchain specific defaults
-    case $toolchain in x86*|universal*) soft_enable postproc;; esac
+    case $toolchain in x86*) soft_enable postproc;; esac
 
     if enabled postproc_visualizer; then
         enabled postproc || die "postproc_visualizer requires postproc to be enabled"
--- a/examples.mk
+++ b/examples.mk
@@ -254,14 +254,6 @@
 $(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
 
 
-# If this is a universal (fat) binary, then all the subarchitectures have
-# already been built and our job is to stitch them together. The
-# BUILD_OBJS variable indicates whether we should be building
-# (compiling, linking) the library. The LIPO_OBJS variable indicates
-# that we're stitching.
-$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_OBJS,BUILD_OBJS):=yes)
-
-
 # Create build/install dependencies for all examples. The common case
 # is handled here. The MSVS case is handled below.
 NOT_MSVS = $(if $(CONFIG_MSVS),,yes)
@@ -269,7 +261,7 @@
 INSTALL-BINS-$(NOT_MSVS)   += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX)))
 DIST-SRCS-yes              += $(ALL_SRCS)
 INSTALL-SRCS-yes           += $(UTIL_SRCS)
-OBJS-$(NOT_MSVS)           += $(if $(BUILD_OBJS),$(call objs,$(ALL_SRCS)))
+OBJS-$(NOT_MSVS)           += $(call objs,$(ALL_SRCS))
 BINS-$(NOT_MSVS)           += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX)))
 
 
@@ -278,15 +270,11 @@
 SHARED_LIB_SUF=$(if $(filter darwin%,$(TGT_OS)),.dylib,.so)
 CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
 $(foreach bin,$(BINS-yes),\
-    $(if $(BUILD_OBJS),$(eval $(bin):\
-        $(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF)))\
-    $(if $(BUILD_OBJS),$(eval $(call linker_template,$(bin),\
+    $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\
+    $(eval $(call linker_template,$(bin),\
         $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \
         -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
-        )))\
-    $(if $(LIPO_OBJS),$(eval $(call lipo_bin_template,$(bin))))\
-    )
-
+        )))
 
 # The following pairs define a mapping of locations in the distribution
 # tree to locations in the source/build trees.
--- a/libs.mk
+++ b/libs.mk
@@ -25,7 +25,7 @@
 	@echo "    [CREATE] $$@"
 	$$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \
           --sym=$(1) \
-          --config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)).mk \
+          --config=$$(CONFIG_DIR)$$(target)-$$(TOOLCHAIN).mk \
           $$(RTCD_OPTIONS) $$^ > $$@
 CLEAN-OBJS += $$(BUILD_PFX)$(1).h
 RTCD += $$(BUILD_PFX)$(1).h
@@ -34,12 +34,11 @@
 CODEC_SRCS-yes += CHANGELOG
 CODEC_SRCS-yes += libs.mk
 
-# If this is a universal (fat) binary, then all the subarchitectures have
-# already been built and our job is to stitch them together. The
-# BUILD_LIBVPX variable indicates whether we should be building
-# (compiling, linking) the library. The LIPO_LIBVPX variable indicates
-# that we're stitching.
-$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
+# TODO(tomfinegan): Remove $BUILD_LIBVPX throughout. It's a vestigial piece of
+# universal Mac OS X build support from eons ago when universal meant fat
+# libraries containing PPC + X86. We now have build/make/iosbuild.sh that can
+# be used to build VPX.framework containing user selected targets instead.
+BUILD_LIBVPX := yes
 
 include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
 CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
@@ -313,9 +312,6 @@
 CLEAN-OBJS += vpx.pc
 endif
 
-LIBS-$(LIPO_LIBVPX) += libvpx.a
-$(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a)))
-
 #
 # Rule to make assembler configuration file from C configuration file
 #
@@ -447,13 +443,10 @@
 
 CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
 CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
-ifeq ($(BUILD_LIBVPX),yes)
 $(LIBVPX_TEST_BIN): lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a
 $(eval $(call linkerxx_template,$(LIBVPX_TEST_BIN), \
               $(LIBVPX_TEST_OBJS) \
               -L. -lvpx -lgtest $(extralibs) -lm))
-$(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(LIBVPX_TEST_BIN))))
-endif  # BUILD_LIBVPX=yes
 
 endif  # CONFIG_UNIT_TESTS