From f9b2ca5b99c9de6fa503daf44f789b983579522d Mon Sep 17 00:00:00 2001
From: John Koleszar <jkoleszar@google.com>
Date: Tue, 21 Sep 2010 10:06:41 -0400
Subject: [PATCH] configure: add --enable-small

Build with -O2 rather than -O3, to dissuade the compiler from inlining
so much. See issue #1.

Change-Id: Iacb8ddb59125d3f01c5fea846b45a1c004c9aee0
---
 build/make/configure.sh | 6 +++---
 configure               | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/build/make/configure.sh b/build/make/configure.sh
index e787c5d2c5..e4a3da6b6b 100755
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -880,9 +880,9 @@ process_common_toolchain() {
     enabled gcov &&
         check_add_cflags -fprofile-arcs -ftest-coverage &&
         check_add_ldflags -fprofile-arcs -ftest-coverage
-    enabled optimizations && check_add_cflags -O3
-    if enabled rvct; then
-        enabled optimizations && check_add_cflags -Otime
+    if enabled optimizations; then
+        enabled rvct && check_add_cflags -Otime
+        enabled small && check_add_cflags -O2 || check_add_cflags -O3
     fi
 
     # Position Independant Code (PIC) support, for building relocatable
diff --git a/configure b/configure
index 33ab74ad1f..b3cd0c72b8 100755
--- a/configure
+++ b/configure
@@ -38,6 +38,7 @@ Advanced options:
   ${toggle_realtime_only}         enable this option while building for real-time encoding
   ${toggle_runtime_cpu_detect}    runtime cpu detection
   ${toggle_shared}                shared library support
+  ${toggle_small}                 favor smaller size over speed
   ${toggle_arm_asm_detok}         assembly version of the detokenizer (ARM platforms only)
 
 Codecs:
@@ -244,6 +245,7 @@ CONFIG_LIST="
     spatial_resampling
     realtime_only
     shared
+    small
     arm_asm_detok
 "
 CMDLINE_SELECT="
@@ -281,6 +283,7 @@ CMDLINE_SELECT="
     spatial_resampling
     realtime_only
     shared
+    small
     arm_asm_detok
 "
 
-- 
GitLab